{"version":3,"file":"common.js","mappings":";;;;;AAAA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACnBA;AACe;AACf;AACA,iEAAiE;AACjE,iEAAiE;AACjE,mEAAmE;AACnE,6DAA6D;AAC7D;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA,4EAA4E,yBAAyB;AACrG,4EAA4E,yBAAyB;AACrG;AACA;AACA,2FAA2F,yBAAyB;AACpH;AACA;AACA,yEAAyE,yBAAyB;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;;AClDA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrB6D;AAC7D;AACe;AACf;AACA,0BAA0B,oBAAoB;AAC9C,mEAAmE;AACnE,6EAA6E;AAC7E,gEAAgE;AAChE;AACA,wEAAwE;AACxE,8EAA8E;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB;AACA;AACA,sFAAsF;AACtF;AACA,yEAAyE;AACzE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,qFAAqF;AACrF;AACA,wEAAwE;AACxE,+EAA+E;AAC/E;AACA;AACA,SAAS;AACT;AACA,gFAAgF;AAChF,SAAS;AACT;AACA;AACA;AACA;;;ACvGA;AACe;AACf;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;AC3BA;AACe;AACf;AACA;AACA;AACA,8BAA8B,yCAAyC;AACvE;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;;;ACzCA;AACe;AACf;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9BqC;AACM;AACd;AACM;AACI;AACyB;AAChE,yBAAyB,YAAY;AACrC;AACA;AACA;AACA;AACA,yBAAyB,QAAQ;AACjC,yBAAyB,QAAQ;AACjC,2BAA2B,UAAU;AACrC,sCAAsC,qBAAqB;AAC3D,CAAC;AACD;AACA,IAAI,SAAS,4BAA4B,SAAS;AAClD;AACA","sources":["webpack://website-develop/./ts/_utilities.ts","webpack://website-develop/./ts/_partsInclude.ts","webpack://website-develop/./ts/_background-scroll-lock.ts","webpack://website-develop/./ts/_ui.ts","webpack://website-develop/./ts/_backhead.ts","webpack://website-develop/./ts/_anchorlink.ts","webpack://website-develop/./ts/_scroll-down-on-firstview.ts","webpack://website-develop/./ts/common.ts"],"sourcesContent":["/* ユーティリティ関数 */\nexport default class Utilities {\n constructor() {\n }\n // タッチデバイス判定\n static isTouchDevice() {\n return window.ontouchstart || navigator.maxTouchPoints;\n }\n // デバイス判定(必要に応じて追加)\n static deviceInspector() {\n const UA = navigator.userAgent;\n const deviceObj = {\n isIOS: false,\n isIPadOS: false\n };\n (/iPhone/.test(UA)) ? deviceObj.isIOS = true : deviceObj.isIOS = false;\n (/iPad/.test(UA)) ? deviceObj.isIPadOS = true : deviceObj.isIPadOS = false;\n return deviceObj;\n }\n}\n","/* JSインクルード */\nexport default class PartsInclude {\n constructor() {\n this.mainHeader = document.getElementById('mainHeader'); // メインヘッダー\n this.mainFooter = document.getElementById('mainFooter'); // メインフッター\n this.leadingLink = document.getElementById('leadingLink'); // 誘導リンク\n this.localNav = document.getElementById('localNav'); // ローカルナビ\n this.isLeadingLink = (this.leadingLink) ? true : false;\n this.isLocalNav = (this.localNav) ? true : false;\n this.localNavURL = ''; // ローカルナビURL\n if (this.isLocalNav) {\n this.localNavURL = '/assets/includes/localnav-' + this.localNav.dataset.localnav + '.html';\n }\n this.complete = new Event('include-complete'); // インクルード完了カスタムイベント\n this.init();\n }\n init() {\n const _this = this;\n let fetchList = [\n fetch('/assets/includes/main-header.html').then((response) => { return response.text(); }),\n fetch('/assets/includes/main-footer.html').then((response) => { return response.text(); })\n ];\n if (_this.isLocalNav) {\n fetchList.push(fetch('/assets/includes/leadinglink.html').then((response) => { return response.text(); }));\n }\n if (_this.isLocalNav) {\n fetchList.push(fetch(_this.localNavURL).then((response) => { return response.text(); }));\n }\n Promise.all(fetchList).then((data) => {\n if (_this.mainHeader) {\n _this.mainHeader.innerHTML = data[0];\n }\n if (_this.mainFooter) {\n _this.mainFooter.innerHTML = data[1];\n }\n // 誘導リンクがあれば追加\n if (_this.isLeadingLink) {\n _this.leadingLink.innerHTML = data[2];\n }\n // ローカルナビがあれば追加\n if (_this.isLocalNav) {\n _this.localNav.innerHTML = data[3];\n }\n // インクルード完了カスタムイベントを発火\n document.dispatchEvent(_this.complete);\n })\n .catch(error => {\n console.error('Error:', error);\n });\n }\n}\n","/* 背景スクロールロック */\nexport default class BackgroundScrollLock {\n constructor() {\n this.html = document.querySelector('html');\n }\n static getInstance() {\n if (!this.backgroundScrollLock) {\n this.backgroundScrollLock = new BackgroundScrollLock;\n }\n return this.backgroundScrollLock;\n }\n lock() {\n if (!this.html.classList.contains('locked')) {\n this.html.classList.add('locked');\n }\n }\n unlock() {\n if (this.html.classList.contains('locked')) {\n this.html.classList.remove('locked');\n }\n }\n}\n","import BackgroundScrollLock from \"./_background-scroll-lock\";\n/* UI制御 */\nexport default class CommonUI {\n constructor() {\n this.scrollLock = BackgroundScrollLock.getInstance();\n this.mainHeader = document.querySelector('.l-mainheader'); // メインヘッダー\n this.navToggle = document.querySelector('.l-mainheader__navtoggle'); // ナビトグルボタン\n this.navWrapper = document.querySelector('.l-mainnav'); // メインナビ\n if (this.mainHeader && this.navWrapper) {\n this.navSub = document.querySelectorAll('.l-mainnav__sub'); // サブナビ\n this.navHasSub = this.navWrapper.querySelectorAll('.has-subnav'); // 開閉リンク\n this.mainFunc = {\n // メインナビ制御\n navToggleHandler: (ev) => {\n ev.preventDefault();\n this.mainHeader.classList.toggle('sp-nav-active');\n if (this.mainHeader.classList.contains('sp-nav-active')) {\n this.scrollLock.lock();\n }\n else {\n this.scrollLock.unlock();\n }\n },\n listToggle: (ev) => {\n const target = ev.target;\n ev.preventDefault();\n target.parentElement.classList.toggle('sp-subnav-active');\n },\n megaMenuOpen: (ev) => {\n const target = ev.target;\n ev.preventDefault();\n this.mainFunc.megaMenuClose();\n target.parentElement.classList.add('pc-subnav-active');\n },\n megaMenuClose: (ev) => {\n this.navHasSub.forEach((elm) => {\n elm.parentElement.classList.remove('pc-subnav-active');\n });\n }\n };\n this.init();\n }\n }\n init() {\n let resizeTimer; // リサイズ遅延タイマー\n let hoverTimer; // マウスホバー遅延タイマー\n this.destroy(); // reset\n if (window.innerWidth < 1058) {\n // SPナビ\n this.navToggle.addEventListener('click', this.mainFunc.navToggleHandler); // メインナビ\n this.navHasSub.forEach(elm => {\n elm.addEventListener('click', this.mainFunc.listToggle); // サブナビ開閉\n });\n }\n else {\n // PCナビ\n this.navSub.forEach(elm => {\n // サブナビメガメニュー開く(即時)\n elm.addEventListener('mouseenter', (ev) => {\n clearTimeout(hoverTimer);\n this.mainFunc.megaMenuOpen(ev);\n });\n // サブナビメガメニュー閉じる(即時)\n elm.addEventListener('mouseleave', () => {\n this.mainFunc.megaMenuClose();\n });\n });\n this.navHasSub.forEach(elm => {\n // サブナビメガメニュー開く(遅延付き)\n elm.addEventListener('mouseenter', (ev) => {\n clearTimeout(hoverTimer);\n hoverTimer = setTimeout(() => {\n this.mainFunc.megaMenuOpen(ev);\n }, 200);\n });\n // サブナビメガメニュー閉じる(遅延付き)\n elm.addEventListener('mouseleave', () => {\n clearTimeout(hoverTimer);\n hoverTimer = setTimeout(this.mainFunc.megaMenuClose, 200);\n });\n });\n }\n window.addEventListener('resize', () => {\n clearTimeout(resizeTimer);\n resizeTimer = setTimeout(() => {\n this.init();\n }, 200);\n });\n }\n destroy() {\n this.navToggle.removeEventListener('click', this.mainFunc.navToggleHandler); // メインナビ\n this.navHasSub.forEach(elm => {\n elm.removeEventListener('click', this.mainFunc.listToggle); // サブナビ開閉\n elm.removeEventListener('mouseenter', this.mainFunc.megaMenuOpen); // サブナビメガメニュー開く\n elm.parentElement.classList.remove('sp-subnav-active');\n elm.parentElement.classList.remove('pc-subnav-active');\n });\n this.navSub.forEach(elm => {\n elm.removeEventListener('mouseleave', this.mainFunc.megaMenuClose); // サブナビメガメニュー閉じる\n });\n this.mainHeader.classList.remove('sp-nav-active');\n this.scrollLock.unlock();\n }\n}\n","/* ページの頭に戻る */\nexport default class Backhead {\n constructor() {\n this.backhead = document.querySelector('.l-backhead'); //as HTMLElement;\n if (this.backhead) {\n this.init();\n }\n }\n init() {\n var _a;\n (_a = this.backhead) === null || _a === void 0 ? void 0 : _a.addEventListener('click', (ev) => {\n ev.preventDefault();\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n });\n window.addEventListener('scroll', () => {\n if (window.scrollY > 600) {\n this.backhead.classList.add('active');\n }\n else {\n this.backhead.classList.remove('active');\n }\n });\n }\n}\n","/* アンカーリンク */\nexport default class AnchorLink {\n constructor() {\n this.win = window;\n this.hash = decodeURI(location.hash).replace('#', '');\n this.posOffset = 100; //(this.win.innerWidth < 768) ? 100 : 0; // アンカー位置からのずれ幅\n if (this.hash != '' && !/\\W/.test(this.hash)) {\n this.outerPage(); // ページ外からのアンカーリンク\n }\n else {\n this.triggers = document.querySelectorAll('.js-anchor');\n this.innerPage(); // ページ内アンカーリンク\n }\n }\n innerPage() {\n this.triggers.forEach((elm) => {\n const trigger = elm;\n const id = trigger.getAttribute('href').replace('#', '');\n const target = document.getElementById(id);\n if (target) {\n trigger.addEventListener('click', (ev) => {\n ev.preventDefault();\n window.scrollTo({\n top: target.getBoundingClientRect().top + window.scrollY - this.posOffset,\n behavior: 'smooth'\n });\n });\n }\n });\n }\n outerPage() {\n const target = document.getElementById(this.hash);\n if (target) {\n setTimeout(() => {\n window.scrollTo({\n top: target.getBoundingClientRect().top + window.scrollY - this.posOffset - 50,\n behavior: 'smooth'\n });\n }, 1000);\n }\n }\n}\n","/* ファーストビューのスクロールボタン */\nexport default class ScrollDownOnFirstView {\n constructor() {\n this.button = document.querySelector('.js-scroll-down'); //as HTMLElement;\n if (this.button) {\n this.init();\n }\n }\n init() {\n this.toggle();\n window.addEventListener(\"scroll\", () => {\n this.toggle();\n });\n this.button.addEventListener('click', (ev) => {\n ev.preventDefault();\n const firstViewHeight = window.innerHeight;\n window.scrollTo({\n top: firstViewHeight,\n left: 0,\n behavior: 'smooth'\n });\n });\n }\n toggle() {\n if (window.scrollY === 0) {\n this.button.classList.add('active');\n return;\n }\n this.button.classList.remove('active');\n }\n}\n","import Utilities from \"./_utilities\";\nimport PartsInclude from \"./_partsInclude\";\nimport CommonUI from \"./_ui\";\nimport Backhead from \"./_backhead\";\nimport AnchorLink from \"./_anchorlink\";\nimport ScrollDownOnFirstView from \"./_scroll-down-on-firstview\";\nconst partsInclude = new PartsInclude;\n// format-detection 追加\ndocument.head.insertAdjacentHTML('beforeend', '');\n// JSインクルード完了後(include-completeイベント発火後)に機能をアクティブ\ndocument.addEventListener('include-complete', () => {\n const commonUI = new CommonUI;\n const backhead = new Backhead;\n const anchorlink = new AnchorLink;\n const scrollDownOnFirstView = new ScrollDownOnFirstView;\n});\n// iOSのbackground-attachementバグ対策\nif (Utilities.deviceInspector().isIOS || Utilities.deviceInspector().isIPadOS) {\n document.querySelector('html').classList.add('is-iOS');\n}\n"],"names":[],"sourceRoot":""}