(() => { // webpackBootstrap (() => { var __webpack_exports__ = {}; const { EventManager, utils, constants } = ShopbySkin; const slideMenuEL = document.querySelector('slide-menu'); const slideMenuClickActionMap = { CLOSE_SLIDE_MENU: () => { EventManager.fire('TOGGLE_HEADER_SLIDE_MENU', { type: 'close' }); }, TOGGLE_HEADER_SLIDE_MENU: () => { EventManager.fire('TOGGLE_HEADER_SLIDE_MENU', { type: 'close' }); }, TOGGLE_HEADER_SLIDE_MENU_CHILD_CATEGORY: (e) => { const categoryWrapEl = e?.target?.closest('[shopby-category-no]'); EventManager.fire('TOGGLE_HEADER_SLIDE_MENU_CHILD_CATEGORY', { wrapEl: categoryWrapEl }); }, SIGN_OUT_BTN: () => { slideMenuClickActionMap.CLOSE_SLIDE_MENU(); EventManager.fire('SIGN_OUT'); }, GO_MY_MENU: (e) => { if (!utils.isSignedIn()) { e.preventDefault(); slideMenuClickActionMap.CLOSE_SLIDE_MENU(); const from = e.target.href; const nextUrl = `${location.origin}${constants.PAGE.SIGN_IN}`; utils.moveTo({ url: `${nextUrl}?from=${encodeURIComponent(from)}` }); } else { if (!e.target.href) { return; } slideMenuClickActionMap.CLOSE_SLIDE_MENU(); utils.moveTo({ url: e.target.href }); } }, GO_NEXT: (event) => { event.preventDefault(); const { target } = event; const href = target?.href ?? target.closest('[shopby-action="GO_NEXT"]')?.href; if (!href) { return; } slideMenuClickActionMap.CLOSE_SLIDE_MENU(); utils.moveTo({ url: href }); }, }; const clickEventListener = (e) => { const action = e?.target?.closest('[shopby-action]')?.getAttribute('shopby-action'); slideMenuClickActionMap[action]?.(e); }; slideMenuEL?.addEventListener('click', clickEventListener); ShopbySkin.utils.myappProxyRegistry.applyToSlideMenu = (proxyFn) => { if (typeof proxyFn === 'function') { slideMenuEL?.removeEventListener('click', clickEventListener); slideMenuEL?.addEventListener('click', proxyFn(clickEventListener)); } }; ShopbySkin.utils.myappProxyRegistry.applyToSlideMenu.proxyFnKey = 'slideMenuProxy'; EventManager.fire('INIT_MYAPP'); })(); })(); //2024.07.26 snpu98 (async () => { const getExcludeCategoryNos = async () => { const dataSummery = await fetchProductSummery(); const excludeCategoryNosArr = []; for ( const category1 of dataSummery.depth1Categories ) { const categoryNo1 = category1.categoryNo; const label1 = category1.label; if ( 'en' != label1 ) { excludeCategoryNosArr.push(categoryNo1); } } const excludeCategoryNos = excludeCategoryNosArr.join(','); return excludeCategoryNos; }; const fetchProductSummery = async () => { const queryStr = new URLSearchParams({ "filter.saleStatus": "ALL_CONDITIONS", "filter.soldout": true, }).toString(); return await fetch(`https://shop-api.e-ncp.com/products/search/summary?${queryStr}`, { method: 'GET', headers: { 'Content-Type': 'application/json', Version: '1.0', clientId: '99ZDpWfrizZV8irrjPvB8w==', platform: 'PC', language: 'ko', }, }).then((res) => res.json()); }; $(document).ready(async () => { const excludeCategoryNos = await getExcludeCategoryNos(); if ( document.querySelector('#slideMenuBrand') ) { // document.querySelector('#slideMenuBrand').href = `/en/pages/brand/brand-list.html?excludeCategoryNo=${excludeCategoryNos}`; document.querySelector('#slideMenuBrand').href = `/en/pages/brand/brand-list.html?categoryNo=799277`; } }); const { EventManager } = ShopbySkin; EventManager.on('PAGE_LOAD_COMPLETED', (commonData) => { if ( commonData?.profile?.memberName ) { $(document).ready(() => { $('#slideMenuMemberName').html(commonData.profile.memberName); }); } }); })();