{"ast":null,"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-runtime\";\nimport cn from 'classnames';\nimport CustomLink from 'components/customLink/CustomLink';\nimport { Arrow } from 'components/gui/Arrow';\nimport Button from 'components/gui/Button';\nimport CircleButton from 'components/gui/CircleButton';\nimport HouseInfos from 'components/houseInfos/HouseInfos';\nimport StatusBanner from 'components/statusBanner/StatusBanner';\nimport { useIsDesktop } from 'hooks/useIsDevice';\nimport { imageBuilder } from 'lib/sanity';\nimport { useEffect, useState } from 'react';\nimport ApartmentsSlice from 'slices/ApartmentsSlice/ApartmentsSlice';\nimport ExploreSlice from 'slices/ExploreSlice/ExploreSlice';\nimport NeighborhoodSlice from 'slices/NeighborhoodSlice/NeighborhoodSlice';\nimport PicturesSlice from 'slices/PicturesSlice/PicturesSlice';\nimport ServicesSlice from 'slices/ServicesSlice/ServicesSlice';\nimport SliceIntro from 'slices/SliceIntro/SliceIntro';\nimport styles from './House.module.scss';\n\nvar HousePage = function HousePage(_ref) {\n  var lang = _ref.lang,\n      housesMenu = _ref.housesMenu,\n      house = _ref.house,\n      title = _ref.title,\n      housesMenuTitle = _ref.housesMenuTitle,\n      picturesIntro = _ref.picturesIntro,\n      servicesIntro = _ref.servicesIntro,\n      servicesOnDemand = _ref.servicesOnDemand,\n      servicesMutualized = _ref.servicesMutualized,\n      accommodationsIntro = _ref.accommodationsIntro,\n      neighbourhoodIntro = _ref.neighbourhoodIntro,\n      exploreIntro = _ref.exploreIntro,\n      shareHouse = _ref.shareHouse,\n      cityLink = _ref.cityLink,\n      citiesLink = _ref.citiesLink,\n      joinUs = _ref.joinUs;\n  //console.log(lang + '/' + city.slug + '/' + slug + ' HousePage.js::7 render', typeof window === 'undefined' ? 'SS' : 'CS')\n  var city = house.city,\n      hero = house.hero,\n      services = house.services,\n      matterport = house.matterport,\n      statusTextKey = house.statusTextKey,\n      accommodations = house.accommodations;\n\n  var _useState = useState(false),\n      menuOpen = _useState[0],\n      setMenuOpen = _useState[1]; // const locale = useLocale()\n  // console.log('[house].js::19 house', house)\n\n\n  var isDesktop = useIsDesktop();\n  var heroURL = hero ? imageBuilder.image(hero.asset).url() : 'https://www.colivingfactory.com/assets/coresider/images/1.png';\n  var picturesIntroStr = isDesktop ? picturesIntro : picturesIntro ? picturesIntro.replace(':', '').trim() : '';\n  var servicesIntroStr = isDesktop ? servicesIntro : servicesIntro ? servicesIntro.replace(':', '').trim() : '';\n  var accommodationsIntroStr = isDesktop ? accommodationsIntro : accommodationsIntro ? accommodationsIntro.replace(':', '').trim() : '';\n  var neighbourhoodIntroStr = isDesktop ? neighbourhoodIntro : neighbourhoodIntro ? neighbourhoodIntro.replace(':', '').trim() : '';\n  var exploreIntroStr = isDesktop ? exploreIntro : exploreIntro ? exploreIntro.replace(':', '').trim() : '';\n  var pictures = ['https://www.colivingfactory.com/assets/coresider/images/1.png', 'https://www.colivingfactory.com/assets/coresider/images/2.png', 'https://www.colivingfactory.com/assets/coresider/images/3.png', 'https://www.colivingfactory.com/assets/coresider/images/4.png', 'https://www.colivingfactory.com/assets/coresider/images/5.png' // 'https://www.colivingfactory.com/assets/coresider/images/1.png',\n  // 'https://www.colivingfactory.com/assets/coresider/images/2.png',\n  // 'https://www.colivingfactory.com/assets/coresider/images/3.png',\n  // 'https://www.colivingfactory.com/assets/coresider/images/4.png',\n  // 'https://www.colivingfactory.com/assets/coresider/images/5.png',\n  ];\n  var accommodationsAnchor = 'accommodations';\n  useEffect(function () {\n    if (typeof document === 'undefined') return;\n\n    if (menuOpen) {\n      window.scrollTo({\n        top: 0,\n        behavior: 'smooth'\n      });\n    }\n\n    document.body.style.overflow = menuOpen ? 'hidden' : '';\n  }, [menuOpen]); // const clientWidth = useClientWidth()\n  // const clientHeight = useClientHeight()\n  // console.log('[house].js::57 housesMenu', housesMenu)\n\n  return /*#__PURE__*/_jsxs(_Fragment, {\n    children: [/*#__PURE__*/_jsxs(\"section\", {\n      className: cn(styles.introSlice),\n      style: {\n        backgroundImage: isDesktop && heroURL ? \"url(\".concat(heroURL, \")\") : undefined\n      },\n      children: [!isDesktop && /*#__PURE__*/_jsxs(_Fragment, {\n        children: [/*#__PURE__*/_jsxs(Button, {\n          className: cn(styles.titleButton, menuOpen && styles.titleButtonOpen),\n          onClick: function onClick() {\n            return setMenuOpen(!menuOpen);\n          },\n          children: [/*#__PURE__*/_jsx(\"h1\", {\n            className: cn('h--2'),\n            children: menuOpen ? housesMenuTitle : title //.replace('{house}', house.title).replace('{city}', house.city.title)\n\n          }), /*#__PURE__*/_jsx(Arrow, {\n            direction: \"down\",\n            size: \"medium\"\n          })]\n        }), /*#__PURE__*/_jsx(\"div\", {\n          className: cn(styles.housesMenu, menuOpen && styles.housesMenuOpen),\n          children: housesMenu.map(function (city) {\n            return city.houses && city.houses.length > 0 && /*#__PURE__*/_jsxs(\"div\", {\n              className: cn(styles.cityGroup),\n              children: [/*#__PURE__*/_jsx(\"h3\", {\n                className: cn('h--3'),\n                children: city.title\n              }), /*#__PURE__*/_jsx(\"ul\", {\n                children: city.houses.map(function (house) {\n                  return /*#__PURE__*/_jsx(\"li\", {\n                    children: /*#__PURE__*/_jsxs(CustomLink, {\n                      href: house.url,\n                      children: [/*#__PURE__*/_jsx(\"span\", {\n                        children: house.title\n                      }), /*#__PURE__*/_jsx(Arrow, {\n                        direction: \"right\",\n                        size: \"small\",\n                        color: \"white\"\n                      })]\n                    })\n                  });\n                })\n              })]\n            });\n          })\n        }), /*#__PURE__*/_jsxs(\"div\", {\n          className: cn(styles.hero),\n          children: [/*#__PURE__*/_jsx(\"img\", {\n            src: heroURL\n          }), /*#__PURE__*/_jsx(CircleButton, {\n            className: cn(styles.shareButton),\n            icon: \"share\",\n            onClick: function onClick() {}\n          }), /*#__PURE__*/_jsx(StatusBanner // className={cn(styles.banner)}\n          , {\n            status: statusTextKey\n          })]\n        })]\n      }), /*#__PURE__*/_jsx(HouseInfos, {\n        className: cn(styles.houseInfos),\n        house: house,\n        narrow: !isDesktop,\n        renderTitle: isDesktop,\n        renderText: true,\n        buttonLabel: \"D\\xE9couvrir les appartements\" //`Rejoindre ${house.title}`\n        ,\n        buttonHref: '#TODO'\n      })]\n    }), /*#__PURE__*/_jsx(PicturesSlice, {\n      introText: picturesIntroStr,\n      pictures: pictures,\n      matterport: matterport\n    }), /*#__PURE__*/_jsx(ServicesSlice, {\n      introText: servicesIntroStr,\n      onDemand: servicesOnDemand,\n      mutualized: servicesMutualized,\n      services: services\n    }), accommodations && /*#__PURE__*/_jsx(ApartmentsSlice, {\n      id: accommodationsAnchor,\n      introText: accommodationsIntroStr,\n      house: house,\n      accommodations: accommodations\n    }), /*#__PURE__*/_jsx(NeighborhoodSlice, {\n      introText: neighbourhoodIntroStr,\n      house: house\n    }), /*#__PURE__*/_jsx(ExploreSlice, {\n      introText: exploreIntroStr,\n      house: house,\n      shareHouse: shareHouse,\n      cityLink: cityLink,\n      cityURL: \"/\".concat(lang, \"/\").concat(city.slug),\n      citiesLink: citiesLink,\n      joinUs: joinUs\n    }), isDesktop && /*#__PURE__*/_jsx(SliceIntro, {})]\n  });\n};\n\nexport var __N_SSG = true;\nexport default HousePage;","map":null,"metadata":{},"sourceType":"module"}