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AC+B,IAAIA,CAACC,KAAM,cAAsBC,MAAA,CAARvD,EAAKsC,EAAE,EAAIlB,UAAWC,IAAAA,aAAAA,UAAsB,sBASpF,CAEA2D,CAAAA,EAAA,QAAejF,qFCxLR,IAAMgF,EAAwB,CAACE,EAAcC,IAAuB,CAEzE,GAAID,EAAM,CACR,IAAIE,EAASC,CAAAA,EAAAA,EAAAA,CAAAA,EAAeH,GAAMI,SAAS,CAAC,EAAGH,GAU/C,MARyB,OAArBC,EAAOG,KAAK,CAAC,KACfH,CAAAA,EAASA,EAAOG,KAAK,CAAC,EAAG,GAAC,EAIxBH,EAAOvE,MAAM,CAAGqE,EAAKrE,MAAM,EAC7BuE,CAAAA,GAAU,OAELA,CACT,CAAC,MAEM,EACT,sECfO,IAAMC,EAAiB,GACrBG,EAAMC,OAAO,CAAC,4BAA6B,2BCLpDC,EAAAC,OAAA,EAAkB","sources":["webpack://_N_E/./src/iqfu/components/public/neighboring_company_cards_carousel/NeighboringCompanyCardsCarousel.tsx","webpack://_N_E/./src/iqfu/utils/formatCompanyCardText.ts","webpack://_N_E/./src/iqfu/utils/removeNewLines.ts","webpack://_N_E/./src/iqfu/components/public/neighboring_company_cards_carousel/NeighboringCompanyCardsCarousel.module.scss","webpack://_N_E/<anon>"],"sourcesContent":["import { FC, useEffect, useState } from 'react';\n\nimport Link from 'next/link';\n\nimport { useMediaQuery } from '@mui/material';\n\nimport { Navigation } from 'swiper';\nimport { Swiper, SwiperSlide } from 'swiper/react';\n// Import Swiper styles\nimport 'swiper/css';\n\nimport { formatCompanyCardText } from '@utils_iqfu/formatCompanyCardText';\n\nimport DisplayThumbImage from '@components_iqfu/public/display_thumb_image/DisplayThumbImage';\n\nimport { CompanyListItem } from '@type-def_iqfu/public/CompanyListItem';\n\nimport { MediaQuery } from '@constants_common';\n\nimport styles from './NeighboringCompanyCardsCarousel.module.scss';\n\ntype Props = {\n  data?: CompanyListItem[];\n  pageLabel: string;\n};\n\nconst NeighboringCompanyCardsCarousel: FC<Props> = ({ data, pageLabel }) => {\n  const [prevEl, setPrevEl] = useState<HTMLElement | null>(null);\n  const [nextEl, setNextEl] = useState<HTMLElement | null>(null);\n  const isMobile = useMediaQuery(MediaQuery.lg);\n  const showNav = (data && data.length > 1 && isMobile) || (data && data.length > 3 && !isMobile);\n\n  const [swiper, setSwiper] = useState<any>(null);\n\n  //ページ遷移時にスライドをリセット\n  useEffect(() => {\n    if (swiper && data && data.length > 0) {\n      swiper.slideTo(0, 0);\n    }\n  }, [data, swiper]);\n\n  return (\n    <div className={styles.container}>\n      <Swiper\n        modules={[Navigation]}\n        navigation={{\n          prevEl,\n          nextEl,\n        }}\n        threshold={10}\n        slidesPerView={1.1}\n        centeredSlides={true}\n        spaceBetween={0}\n        onUpdate={(swiper) => {\n          setSwiper(swiper);\n        }}\n        breakpoints={{\n          992: {\n            slidesPerView: 3,\n            spaceBetween: 0,\n            centeredSlides: false,\n          },\n        }}\n      >\n        {data &&\n          data.map((company, i) => (\n            <SwiperSlide key={company.id}>\n              <CompanyCard data={company} pageLabel={pageLabel} />\n            </SwiperSlide>\n          ))}\n      </Swiper>\n\n      {showNav && (\n        <div className={styles.sliderNavigation}>\n          <div ref={(node) => setPrevEl(node)} className={styles.sliderPrev}></div>\n          <div ref={(node) => setNextEl(node)} className={styles.sliderNext}></div>\n        </div>\n      )}\n\n      {/* end of slider */}\n    </div>\n  );\n};\n\nconst getOtherData = (data: CompanyListItem) => {\n  const access = data.overview_items.filter((item) => item.name === 'アクセス')[0]?.content;\n  //const holiday = data.overview_items.filter((item) => item.name === '定休日')[0]?.content;\n  const businessHours = data.overview_items.filter((item) => item.name === '営業時間')[0]?.content;\n  //const parking = data.overview_items.filter((item) => item.name === '駐車場')[0]?.content;\n  const holiday = data.overview_items.filter((item) => item.name === '定休日')[0]?.content;\n  return {\n    access,\n    businessHours,\n    holiday,\n  };\n};\n\ntype CompanyCardProps = {\n  data: CompanyListItem;\n  pageLabel: string;\n};\n\nconst CompanyCard: FC<CompanyCardProps> = ({ data, pageLabel }) => {\n  const [otherData, setOtherData] = useState(getOtherData(data));\n\n  return (\n    <div className={styles.sliderItemWrapper}>\n      <div className={styles.sliderItem}>\n        <h3 className={styles.company_name}>\n          <Link href={`/companies/${data.id}`}>{data.display_name}</Link>\n        </h3>\n\n        <div className={styles.company_image}>\n          {data.main_image ? (\n            <DisplayThumbImage\n              originalImagePath={data.main_image}\n              thumbSize=\"medium\"\n              lazyLoading={true}\n              altText={data.display_name}\n            />\n          ) : (\n            <div className={styles.no_image}>\n              <img\n                className={styles.company_img}\n                src={'/images/iqfu/public/no_company_image.png'}\n                alt=\"準備中\"\n                loading=\"lazy\"\n              />\n            </div>\n          )}\n        </div>\n        <div className={styles.info}>\n          <div className={styles.card_lead}>{data.cassette_title}</div>\n          {pageLabel === 'companies_detail' && (\n            <>\n              {data.tags && data.tags.length > 0 ? (\n                <ul className={styles.tag_container}>\n                  {data.tags.map((tag, i) => {\n                    return (\n                      <li className={styles.tag_item} key={i}>\n                        {tag.name}\n                      </li>\n                    );\n                  })}\n                </ul>\n              ) : (\n                <></>\n              )}\n              <table className={styles.other_data_container}>\n                <tbody>\n                  <tr>\n                    <th className={styles.other_data_title}>所在地</th>\n                    <td className={styles.other_data_content}>{data.full_address || '-'}</td>\n                  </tr>\n\n                  <tr>\n                    <th className={styles.other_data_title}>アクセス</th>\n                    <td className={styles.other_data_content}>{formatCompanyCardText(otherData.access, 36) || '-'}</td>\n                  </tr>\n\n                  {otherData.businessHours && (\n                    <tr>\n                      <th className={styles.other_data_title}>営業時間</th>\n                      <td className={styles.other_data_content}>\n                        {formatCompanyCardText(otherData.businessHours, 36)}\n                      </td>\n                    </tr>\n                  )}\n                  {otherData.holiday && (\n                    <tr>\n                      <th className={styles.other_data_title}>定休日</th>\n                      <td className={styles.other_data_content}>{formatCompanyCardText(otherData.holiday, 36)}</td>\n                    </tr>\n                  )}\n                </tbody>\n              </table>\n              <Link href={`/companies/${data.id}`} className={styles.detail_button}>\n                店舗詳細を見る\n              </Link>\n            </>\n          )}\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default NeighboringCompanyCardsCarousel;\n","import { removeNewLines } from './removeNewLines';\n\n//説明文のフォーマット処理\nexport const formatCompanyCardText = (body: string, word_count: number) => {\n  //改行削除して文字制限\n  if (body) {\n    let result = removeNewLines(body).substring(0, word_count);\n    //最後の文字が\\の場合は削除\n    if (result.slice(-1) === '\\\\') {\n      result = result.slice(0, -1);\n    }\n\n    //文字切り出した場合は...追加\n    if (result.length < body.length) {\n      result += '...';\n    }\n    return result;\n  }\n\n  return '';\n};\n","/**\n * 2行以上の連続の改行を削除する\n * @param value 対象の文字列\n * @returns\n */\nexport const removeNewLines = (value: string) => {\n  return value.replace(/(\\r\\n){3,}|\\r{3,}|\\n{3,}/g, '\\n\\n');\n};\n\n/**\n * 末尾についている改行を全て削除する\n * @param value 対象の文字列\n * @returns\n */\nexport const removeEndNewLines = (value: string) => {\n  return value.replace(/\\r*$|\\r\\n*$|\\n*$/, '');\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"NeighboringCompanyCardsCarousel_container__6cOND\",\"slider\":\"NeighboringCompanyCardsCarousel_slider__9sDd3\",\"sliderPrev\":\"NeighboringCompanyCardsCarousel_sliderPrev___p63o\",\"sliderNext\":\"NeighboringCompanyCardsCarousel_sliderNext__WWSGG\",\"sliderItemWrapper\":\"NeighboringCompanyCardsCarousel_sliderItemWrapper__gct3E\",\"sliderItem\":\"NeighboringCompanyCardsCarousel_sliderItem__TLhpA\",\"sliderPagination\":\"NeighboringCompanyCardsCarousel_sliderPagination__eOKnC\",\"sliderPagination_bullet\":\"NeighboringCompanyCardsCarousel_sliderPagination_bullet__QtpOg\",\"sliderPagination_bullet_active\":\"NeighboringCompanyCardsCarousel_sliderPagination_bullet_active__AMARV\",\"company_name\":\"NeighboringCompanyCardsCarousel_company_name__Fv1Tq\",\"company_image\":\"NeighboringCompanyCardsCarousel_company_image__mcddQ\",\"no_image\":\"NeighboringCompanyCardsCarousel_no_image__vdJ7F\",\"card_lead\":\"NeighboringCompanyCardsCarousel_card_lead__EvRsZ\",\"card_body\":\"NeighboringCompanyCardsCarousel_card_body__nMQmj\",\"tag_container\":\"NeighboringCompanyCardsCarousel_tag_container__pUF8_\",\"tag_item\":\"NeighboringCompanyCardsCarousel_tag_item__0xpUu\",\"other_data_container\":\"NeighboringCompanyCardsCarousel_other_data_container__2eU6n\",\"other_data_title\":\"NeighboringCompanyCardsCarousel_other_data_title__GYPF5\",\"other_data_content\":\"NeighboringCompanyCardsCarousel_other_data_content__1GhvE\",\"sliderNavigation\":\"NeighboringCompanyCardsCarousel_sliderNavigation__z9E3v\",\"info\":\"NeighboringCompanyCardsCarousel_info__DUJ8l\",\"detail_button\":\"NeighboringCompanyCardsCarousel_detail_button__a7qJA\"};"],"names":["NeighboringCompanyCardsCarousel","data","pageLabel","param","prevEl","setPrevEl","useState","nextEl","setNextEl","isMobile","useMediaQuery","MediaQuery","showNav","length","swiper","setSwiper","useEffect","slideTo","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","div","className","styles","jsx","Swiper","modules","Navigation","navigation","threshold","slidesPerView","centeredSlides","spaceBetween","onUpdate","breakpoints","map","company","i","SwiperSlide","CompanyCard","id","ref","node","getOtherData","access","overview_items","filter","item","name","content","businessHours","holiday","otherData","setOtherData","h3","Link","href","concat","display_name","main_image","DisplayThumbImage","originalImagePath","thumbSize","lazyLoading","altText","img","src","alt","loading","cassette_title","Fragment","tags","ul","tag","li","table","tbody","tr","th","td","full_address","formatCompanyCardText","__webpack_exports__","body","word_count","result","removeNewLines","substring","slice","value","replace","module","exports"],"sourceRoot":""}