@perevorot/shop 2.0.4 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},a=function(){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),document.documentElement.classList.remove("is-catalog-loading"),i()},r=function(r,i){var c=function(e){var t=e.hash?e.hash.substring(1):"",n=t?-1!==e.pathname.indexOf(":")?e.pathname+";"+t:e.pathname+"/"+t:e.pathname;return $env.shop.isTrailingSlash&&(n=n.replace(/\/$/,"")+"/"),e.origin+n+(e.search?e.search+"&filter":"?filter")}(r),l=function(e){return e.replace(/[^a-z0-9]/g,"")}(c);-1===n.indexOf(l)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(c).then((function(c){var u=document.createElement("html");u.innerHTML=c.data.page,window.app.component(l,{template:u.querySelector("#subcategory").innerHTML}),o(),n.push(l),t.value=l,i||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(o(),t.value=l,i||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a))},i=function(){document.querySelectorAll("[shop-filter] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r(e)}))}))},c=function(){var e=document.createElement("a");e.href=window.location.href,r(e,!0)};return window.addEventListener("DOMContentLoaded",(function(){i(),window.addEventListener("popstate",(function(){c()})),window.location.hash&&c()})),{page:t}}});t.render=function(t,n,o,a,r,i){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.page))},module.exports=t;
1
+ "use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},a=function(){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),document.documentElement.classList.remove("is-catalog-loading"),c()},r=function(r,c){var i=function(e){var t=e.hash?e.hash.substring(1):"",n=e.pathname.replace(/\/$/,"");return n=t?-1!==e.pathname.indexOf(":")?n+";"+t:n+"/"+t:n,$env.shop.isTrailingSlash&&(n+="/"),e.origin+n+(e.search?e.search+"&filter":"?filter")}(r),l=function(e){return e.replace(/[^a-z0-9]/g,"")}(i);-1===n.indexOf(l)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(i).then((function(i){var u=document.createElement("html");u.innerHTML=i.data.page,window.app.component(l,{template:u.querySelector("#subcategory").innerHTML}),o(),n.push(l),t.value=l,c||history.pushState({urlPath:r.href,source:"catalog"},document.title,r.href),e.nextTick(a)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(o(),t.value=l,c||history.pushState({urlPath:r.href,source:"catalog"},document.title,r.href),e.nextTick(a))},c=function(){document.querySelectorAll("[shop-filter] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r(e)}))}))},i=function(){var e=document.createElement("a");e.href=window.location.href,r(e,!0)};return window.addEventListener("DOMContentLoaded",(function(){c(),window.addEventListener("popstate",(function(e){e.state&&"catalog"==e.state.source&&i()})),window.location.hash&&i()})),{page:t}}});t.render=function(t,n,o,a,r,c){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.page))},module.exports=t;
2
2
  //# sourceMappingURL=Catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Catalog.js","sources":["../../../src/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=6334ff0d&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n let pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname.replace(/\\/$/, '') + '/';\n }\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n let pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname.replace(/\\/$/, '') + '/';\n }\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","indexOf","$env","shop","isTrailingSlash","replace","origin","search","parseFilterHref","componentName","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","title","nextTick","error","console","addEventListener","e","preventDefault","refresh","location","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,EAAOC,MAAI,MACXC,EAAQ,GAMRC,EAAiB,WACnBC,SAASC,iBAAiB,sBAAsBC,SAAQ,SAACC,GACrDA,EAAQC,aAIVC,EAAQ,WACVC,OAAOC,SAAS,CACZC,IAAK,EACLC,KAAM,EACNC,SAAU,WAGVJ,OAAOK,YACPL,OAAOK,WAAWC,SAGtBZ,SAASa,gBAAgBC,UAAUV,OAAO,sBAE1CW,KAcEC,EAAM,SAACC,EAAGC,OACNC,EAZc,SAACF,OACfG,EAAOH,EAAEG,KAAOH,EAAEG,KAAKC,UAAU,GAAK,GACxCC,EAAWF,GAAqC,IAA7BH,EAAEK,SAASC,QAAQ,KAAcN,EAAEK,SAAW,IAAMF,EAAOH,EAAEK,SAAW,IAAMF,EAAQH,EAAEK,gBAE3GE,KAAKC,KAAKC,kBACVJ,EAAWA,EAASK,QAAQ,MAAO,IAAM,KAGtCV,EAAEW,OAASN,GAAYL,EAAEY,OAASZ,EAAEY,OAAS,UAAY,WAInDC,CAAgBb,GAEvBc,EAxCU,SAACZ,UACVA,EAAKQ,QAAQ,aAAc,IAuCZK,CAAYb,IAEI,IAAlCrB,EAAMyB,QAAQQ,IACd/B,SAASa,gBAAgBC,UAAUmB,IAAI,sBAEvCC,MACKlB,IAAIG,GACJgB,MAAK,SAACC,OACCC,EAAOrC,SAASsC,cAAc,QAElCD,EAAKE,UAAYH,EAASI,KAAK5C,KAE/BU,OAAOmC,IAAIC,UAAUX,EAAe,CAChCY,SAAUN,EAAKO,cAAc,gBAAgBL,YAGjDxC,IAEAD,EAAM+C,KAAKd,GAEXnC,EAAKkD,MAAQf,EAERb,GACD6B,QAAQC,UAAU,CAAEC,QAAShC,EAAEE,MAAQnB,SAASkD,MAAOjC,EAAEE,MAG7DgC,WAAS9C,aAEN,SAAC+C,GACJC,QAAQD,MAAMA,eAET,WACLpD,SAASa,gBAAgBC,UAAUV,OAAO,2BAGlDL,IAEAH,EAAKkD,MAAQf,EAERb,GACD6B,QAAQC,UAAU,CAAEC,QAAShC,EAAEE,MAAQnB,SAASkD,MAAOjC,EAAEE,MAG7DgC,WAAS9C,KAIXU,EAAO,WACTf,SAASC,iBAAiB,mBAAmBC,SAAQ,SAACe,GAClDA,EAAEqC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFxC,EAAIC,UAKVwC,EAAU,eACNxC,EAAIjB,SAASsC,cAAc,KACjCrB,EAAEE,KAAOb,OAAOoD,SAASvC,KAEzBH,EAAIC,GAAG,WAGXX,OAAOgD,iBAAiB,oBAAoB,WACxCvC,IAEAT,OAAOgD,iBAAiB,YAAY,WAChCG,OAGAnD,OAAOoD,SAAStC,MAChBqC,OAID,CACH7D,KAAAA,0DChIR+D,wCAAgBC"}
1
+ {"version":3,"file":"Catalog.js","sources":["../../../src/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=40086de7&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n\n let pathname = a.pathname.replace(/\\/$/, '');\n\n pathname = hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n\n return href;\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href, source: 'catalog' }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href, source: 'catalog' }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', (e) => {\n if (e.state && e.state.source == 'catalog') {\n refresh();\n }\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n\n let pathname = a.pathname.replace(/\\/$/, '');\n\n pathname = hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n\n return href;\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href, source: 'catalog' }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href, source: 'catalog' }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', (e) => {\n if (e.state && e.state.source == 'catalog') {\n refresh();\n }\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","replace","indexOf","$env","shop","isTrailingSlash","origin","search","parseFilterHref","componentName","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","source","title","nextTick","error","console","addEventListener","e","preventDefault","refresh","location","state","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,EAAOC,MAAI,MACXC,EAAQ,GAMRC,EAAiB,WACnBC,SAASC,iBAAiB,sBAAsBC,SAAQ,SAACC,GACrDA,EAAQC,aAIVC,EAAQ,WACVC,OAAOC,SAAS,CACZC,IAAK,EACLC,KAAM,EACNC,SAAU,WAGVJ,OAAOK,YACPL,OAAOK,WAAWC,SAGtBZ,SAASa,gBAAgBC,UAAUV,OAAO,sBAE1CW,KAmBEC,EAAM,SAACC,EAAGC,OACNC,EAjBc,SAACF,OACfG,EAAOH,EAAEG,KAAOH,EAAEG,KAAKC,UAAU,GAAK,GAExCC,EAAWL,EAAEK,SAASC,QAAQ,MAAO,WAEzCD,EAAWF,GAAqC,IAA7BH,EAAEK,SAASE,QAAQ,KAAcF,EAAW,IAAMF,EAAOE,EAAW,IAA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,KAAAA,0DCvIRiE,wCAAgBC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=e.defineComponent({setup:function(){var t=e.ref(!1),n=e.ref(!0),o=e.ref([]),a=[],r={},i=!1,c=!1,l=function(e){var t=e.substring(e.lastIndexOf("/")+1);return"page-product-"+(t.match(/^page([0-9]+)$/)?t:"page1")},u=[l(window.location.href)],p=function(e){e.preventDefault(),u=[l(e.currentTarget.href)],s(e.currentTarget)},s=function(n,c){var u=n.href,p=l(u);if(i||(window.app.component("products-paginate",{data:function(){return{components:o}},template:'<teleport to="#products"><component :is="component" v-for="(component, key) in components" v-bind:key="key"></component></teleport>'}),t.value="products-paginate",i=!0),-1===a.indexOf(p))n.classList.add("is-loading"),$http.get(u+"?paginator").then((function(t){m(c);var n=document.createElement("html");n.innerHTML=t.data.products,window.app.component(p,{template:n.querySelector("#products").innerHTML}),a.push(p),history.pushState({urlPath:u},document.title,u),n.innerHTML=t.data.paginator,r[p]=t.data.paginator,document.getElementById("pagination").replaceWith(n.querySelector("#pagination")),c?(o.value.push(p),d()):(o.value=[p],window.scrollTo({top:0,left:0,behavior:"smooth"})),window.lazyImages&&window.lazyImages.update(),e.nextTick(f)}));else{history.pushState({urlPath:u},document.title,u);var s=document.createElement("html");s.innerHTML=r[p],document.getElementById("pagination").replaceWith(s.querySelector("#pagination")),c?(o.value.push(p),d()):(o.value=[p],window.scrollTo({top:0,left:0,behavior:"smooth"})),e.nextTick(f)}},d=function(){var e=document.getElementById("pagination");u.forEach((function(t){var n=e.querySelector("."+t);n&&n.classList.add("is-current")}))},m=function(e){e||c||(document.querySelectorAll("#products > *").forEach((function(e){e.remove()})),c=!0)},f=function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])");document.querySelectorAll("#pagination a:not([disabled])").forEach((function(e){e.addEventListener("click",p)})),n.value=Boolean(e),window.lazyImages&&window.lazyImages.update()};return e.onMounted((function(){f()})),{component:t,hasMorePages:n,more:function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])"),t=l(e.href);u.push(t),s(e,!0)}}}}),n={class:"shop-pagination has-text-centered mb-3"},o={key:0,class:"shop-pagination-more"},a=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-sync-alt"})],-1);t.render=function(t,r,i,c,l,u){return e.openBlock(),e.createElementBlock("div",n,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component))),t.hasMorePages?(e.openBlock(),e.createElementBlock("div",o,[e.renderSlot(t.$slots,"default",{more:t.more},(function(){return[e.createElementVNode("button",{class:"button is-small",onClick:r[0]||(r[0]=function(){return t.more&&t.more.apply(t,arguments)})},[a,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.pagination.more")),1)])]}))])):e.createCommentVNode("v-if",!0)])},module.exports=t;
1
+ "use strict";var e=require("vue"),t=e.defineComponent({setup:function(){var t=e.ref(!1),n=e.ref(!0),o=e.ref([]),a=[],r={},i=!1,c=!1,l=function(e){console.log(e.href),console.log(e.pathname);var t=e.pathname.replace(/\/$/,""),n=t.substring(t.lastIndexOf("/")+1);return"page-product-"+(n.match(/^page([0-9]+)$/)?n:"page1")},s=[l(window.location)],u=function(e){e.preventDefault(),s=[l(e.currentTarget)],d(e.currentTarget)},p=function(e){var t=e.pathname.replace(/\/$/,""),n=t.substring(t.lastIndexOf("/")+1),o=n.match(/^page([0-9]+)$/),a=o?n:"";o&&(t=t.substring(0,t.lastIndexOf("/")));var r=e.hash?e.hash.substring(1):"";return t=(r?-1!==e.pathname.indexOf(":")?t+";"+r:t+"/"+r:t)+(a?"/"+a:""),$env.shop.isTrailingSlash&&(t+="/"),e.origin+t+(e.search?e.search+"&paginator":"?paginator")},d=function(n,c){var s=p(n),u=l(n);if(i||(window.app.component("products-paginate",{data:function(){return{components:o}},template:'<teleport to="#products"><component :is="component" v-for="(component, key) in components" v-bind:key="key"></component></teleport>'}),t.value="products-paginate",i=!0),-1===a.indexOf(u))n.classList.add("is-loading"),document.documentElement.classList.add("is-catalog-loading"),$http.get(s).then((function(t){g(c);var i=document.createElement("html");i.innerHTML=t.data.products,window.app.component(u,{template:i.querySelector("#products").innerHTML}),a.push(u),history.pushState({urlPath:n.href},document.title,n.href),i.innerHTML=t.data.paginator,r[u]=t.data.paginator,document.getElementById("pagination").replaceWith(i.querySelector("#pagination")),c?(o.value.push(u),m()):(o.value=[u],window.scrollTo({top:0,left:0,behavior:"smooth"})),window.lazyImages&&window.lazyImages.update(),e.nextTick(h)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}));else{history.pushState({urlPath:s},document.title,s);var d=document.createElement("html");d.innerHTML=r[u],document.getElementById("pagination").replaceWith(d.querySelector("#pagination")),c?(o.value.push(u),m()):(o.value=[u],window.scrollTo({top:0,left:0,behavior:"smooth"})),e.nextTick(h)}},m=function(){var e=document.getElementById("pagination");s.forEach((function(t){var n=e.querySelector("."+t);n&&n.classList.add("is-current")}))},g=function(e){e||c||(document.querySelectorAll("#products > *").forEach((function(e){e.remove()})),c=!0)},h=function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])");document.querySelectorAll("#pagination a:not([disabled])").forEach((function(e){e.addEventListener("click",u)})),n.value=Boolean(e),window.lazyImages&&window.lazyImages.update()};return e.onMounted((function(){h()})),{component:t,hasMorePages:n,more:function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])");p(e);var t=l(e);s.push(t),d(e,!0)}}}}),n={class:"shop-pagination has-text-centered mb-3"},o={key:0,class:"shop-pagination-more"},a=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-sync-alt"})],-1);t.render=function(t,r,i,c,l,s){return e.openBlock(),e.createElementBlock("div",n,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component))),t.hasMorePages?(e.openBlock(),e.createElementBlock("div",o,[e.renderSlot(t.$slots,"default",{more:t.more},(function(){return[e.createElementVNode("button",{class:"button is-small",onClick:r[0]||(r[0]=function(){return t.more&&t.more.apply(t,arguments)})},[a,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.pagination.more")),1)])]}))])):e.createCommentVNode("v-if",!0)])},module.exports=t;
2
2
  //# sourceMappingURL=Pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":["../../../src/components/shop/Pagination.vue","../../../src/components/shop/Pagination.vue?vue&type=template&id=4691bf65&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (href) => {\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location.href)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget.href)];\n\n load(e.currentTarget);\n };\n\n const load = (button, isAppend) => {\n const href = button.href;\n\n const componentName = getComponentName(href);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n\n $http.get(href + '?paginator').then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: href }, document.title, href);\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const componentName = getComponentName(next.href);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>","<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (href) => {\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location.href)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget.href)];\n\n load(e.currentTarget);\n };\n\n const load = (button, isAppend) => {\n const href = button.href;\n\n const componentName = getComponentName(href);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n\n $http.get(href + '?paginator').then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: href }, document.title, href);\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const componentName = getComponentName(next.href);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>"],"names":["defineComponent","setup","component","ref","hasMorePages","visiblePages","pages","paginators","inited","cleared","getComponentName","href","last","substring","lastIndexOf","match","nextPages","window","location","get","e","preventDefault","currentTarget","load","button","isAppend","componentName","app","data","components","template","value","indexOf","classList","add","$http","then","response","clearInitial","html","document","createElement","innerHTML","products","querySelector","push","history","pushState","urlPath","title","paginator","getElementById","replaceWith","setPaginatorCurrentPages","scrollTo","top","left","behavior","lazyImages","update","nextTick","init","forEach","link","querySelectorAll","product","remove","next","addEventListener","Boolean","onMounted","more","_createElementVNode","_createElementBlock","_hoisted_1","_createBlock","_ctx","_hoisted_2","_renderSlot","onClick","_hoisted_3"],"mappings":"oCAkBeA,kBAAgB,CAC3BC,qBACUC,EAAYC,OAAI,GAChBC,EAAeD,OAAI,GACnBE,EAAeF,MAAI,IAErBG,EAAQ,GACRC,EAAa,GACbC,GAAS,EACTC,GAAU,EAERC,EAAmB,SAACC,OAChBC,EAAOD,EAAKE,UAAUF,EAAKG,YAAY,KAAO,SAE7C,iBAAmBF,EAAKG,MAAM,kBAAoBH,EAAO,UAGhEI,EAAY,CAACN,EAAiBO,OAAOC,SAASP,OAE5CQ,EAAM,SAACC,GACTA,EAAEC,iBAEFL,EAAY,CAACN,EAAiBU,EAAEE,cAAcX,OAE9CY,EAAKH,EAAEE,gBAGLC,EAAO,SAACC,EAAQC,OACZd,EAAOa,EAAOb,KAEde,EAAgBhB,EAAiBC,MAElCH,IACDS,OAAOU,IAAIzB,UAAU,oBAAqB,CACtC0B,sBACW,CACHC,WAAYxB,IAGpByB,SAAU,wIAGd5B,EAAU6B,MAAQ,oBAClBvB,GAAS,IAGyB,IAAlCF,EAAM0B,QAAQN,GACdF,EAAOS,UAAUC,IAAI,cAErBC,MAAMhB,IAAIR,EAAO,cAAcyB,MAAK,SAACC,GACjCC,EAAab,OAETc,EAAOC,SAASC,cAAc,QAElCF,EAAKG,UAAYL,EAAST,KAAKe,SAE/B1B,OAAOU,IAAIzB,UAAUwB,EAAe,CAChCI,SAAUS,EAAKK,cAAc,aAAaF,YAG9CpC,EAAMuC,KAAKnB,GAEXoB,QAAQC,UAAU,CAAEC,QAASrC,GAAQ6B,SAASS,MAAOtC,GACrD4B,EAAKG,UAAYL,EAAST,KAAKsB,UAE/B3C,EAAWmB,GAAiBW,EAAST,KAAKsB,UAE1CV,SAASW,eAAe,cAAcC,YAAYb,EAAKK,cAAc,gBAEhEnB,GASDpB,EAAa0B,MAAMc,KAAKnB,GACxB2B,MATAhD,EA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AAc,kBAAmBO,sCAAOH,sCACpCI,EAGAR,mDAASI"}
1
+ {"version":3,"file":"Pagination.js","sources":["../../../src/components/shop/Pagination.vue","../../../src/components/shop/Pagination.vue?vue&type=template&id=5bd5348a&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (a) => {\n console.log(a.href);\n console.log(a.pathname);\n\n const href = a.pathname.replace(/\\/$/, '');\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget)];\n\n load(e.currentTarget);\n };\n\n const parseHref = (a) => {\n let pathname = a.pathname.replace(/\\/$/, '');\n const page = pathname.substring(pathname.lastIndexOf('/') + 1);\n const isPage = page.match(/^page([0-9]+)$/);\n const pageUrl = isPage ? page : '';\n\n if (isPage) {\n pathname = pathname.substring(0, pathname.lastIndexOf('/'));\n }\n\n const hash = a.hash ? a.hash.substring(1) : '';\n\n pathname = (hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname) + (pageUrl ? '/' + pageUrl : '');\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&paginator' : '?paginator');\n\n return href;\n };\n\n const load = (button, isAppend) => {\n const href = parseHref(button);\n const componentName = getComponentName(button);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: button.href }, document.title, button.href);\n\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n const href = parseHref(next);\n const componentName = getComponentName(next);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>","<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (a) => {\n console.log(a.href);\n console.log(a.pathname);\n\n const href = a.pathname.replace(/\\/$/, '');\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget)];\n\n load(e.currentTarget);\n };\n\n const parseHref = (a) => {\n let pathname = a.pathname.replace(/\\/$/, '');\n const page = pathname.substring(pathname.lastIndexOf('/') + 1);\n const isPage = page.match(/^page([0-9]+)$/);\n const pageUrl = isPage ? page : '';\n\n if (isPage) {\n pathname = pathname.substring(0, pathname.lastIndexOf('/'));\n }\n\n const hash = a.hash ? a.hash.substring(1) : '';\n\n pathname = (hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname) + (pageUrl ? '/' + pageUrl : '');\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&paginator' : '?paginator');\n\n return href;\n };\n\n const load = (button, isAppend) => {\n const href = parseHref(button);\n const componentName = getComponentName(button);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: button.href }, document.title, button.href);\n\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n const href = parseHref(next);\n const componentName = getComponentName(next);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>"],"names":["defineComponent","setup","component","ref","hasMorePages","visiblePages","pages","paginators","inited","cleared","getComponentName","a","console","log","href","pathname","replace","last","substring","lastIndexOf","match","nextPages","window","location","get","e","preventDefault","currentTarget","load","parseHref","page","isPage","pageUrl","hash","indexOf","$env","shop","isTrailingSlash","origin","search","button","isAppend","componentName","app","data","components","template","value","classList","add","document","documentElement","$http","then","response","clearInitial","html","createElement","innerHTML","products","querySelector","push","history","pushState","urlPath","title","paginator","getElementById","replaceWith","setPaginatorCurrentPages","scrollTo","top","left","behavior","lazyImages","update","nextTick","init","error","remove","forEach","link","querySelectorAll","product","next","addEventListener","Boolean","onMounted","more","_createElementVNode","_createElementBlock","_hoisted_1","_create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C,EAAOf,EAAUN,cAAc,IAAMlB,GAEvCuC,GACAA,EAAKjC,UAAUC,IAAI,kBAKzBM,EAAe,SAACd,GACbA,GAAahC,IACIyC,SAASgC,iBAAiB,iBAEhCF,SAAQ,SAACG,GACjBA,EAAQJ,YAGZtE,GAAU,IAIZoE,EAAO,eACHO,EAAOlC,SAASU,cAAc,gDAEtBV,SAASgC,iBAAiB,iCAElCF,SAAQ,SAACC,GACXA,EAAKI,iBAAiB,QAAS7D,MAGnCpB,EAAa2C,MAAQuC,QAAQF,GAEzB9D,OAAOoD,YACPpD,OAAOoD,WAAWC,iBAc1BY,aAAU,WACNV,OAGG,CACH3E,UAAAA,EACAE,aAAAA,EACAoF,KAjBS,eACHJ,EAAOlC,SAASU,cAAc,gDACvB/B,EAAUuD,OACjB1C,EAAgBhC,EAAiB0E,GAEvC/D,EAAUwC,KAAKnB,GAEfd,EAAKwD,GAAM,iBCrNR,yDAEI,0BAGCK,mCAAY,kBACRA,gCAAS,6EAN7BC,2BAAAC,kBACIC,wCAAgBC,eACwBA,8BAAxCH,2BAAAI,GACIC,iCAAOP,KAAMK,SAAb,kBACIJ,qCAAc,kBAAmBO,sCAAOH,sCACpCI,EAGAR,mDAASI"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),o=require("vue-toastification").useToast(),n=e.defineComponent({setup:function(){var n=t.useStore(),a=e.ref(!1),r=e.computed((function(){return n.getters["compare/categories"]})),c=e.computed((function(){return n.getters["compare/products"]})),l=e.ref(!1);return n.dispatch("compare/get",{finally:function(){a.value=!0}}),{mounted:a,categories:r,products:c,deleteCategory:function(e){l.value||(l.value=!0,n.dispatch("compare/category",{slug:e.slug,finally:function(){o(__("shop.compare.category_deleted",{name:e.name}),{type:"success"}),l.value=!1}}))}}}}),a={class:"dropdown is-right is-hoverable shop-compare"},r={class:"dropdown-trigger"},c={key:0,class:"button"},l=e.createElementVNode("span",null,[e.createElementVNode("i",{class:"fas fa-balance-scale"})],-1),s={class:"ml-2"},i={key:0,class:"icon is-small"},d=[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"},null,-1)],m={key:0,class:"dropdown-menu",role:"menu"},u={class:"dropdown-content"},p={class:"dropdown-item pb-0 is-size-7"},g=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),f={class:"column"},v=["href"],E={class:"badge"},N={class:"column is-narrow"},V=["onClick"],k=[e.createElementVNode("span",{class:"icon",style:{transform:"scale(0.8)",color:"#888"}},[e.createElementVNode("i",{class:"fas fa-times"})],-1)];n.render=function(t,o,n,y,h,B){return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",r,[t.mounted?(e.openBlock(),e.createElementBlock("div",c,[e.renderSlot(t.$slots,"default",{total:t.products.length,categories:t.categories.length},(function(){return[l,e.createElementVNode("span",s,e.toDisplayString(t.products.length),1),t.categories.length?(e.openBlock(),e.createElementBlock("span",i,d)):e.createCommentVNode("v-if",!0)]}))])):e.createCommentVNode("v-if",!0)]),t.categories.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",u,[e.createElementVNode("div",p,e.toDisplayString(t.__("shop.title.compare")),1),g,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(o,n){return e.openBlock(),e.createElementBlock("div",{class:"columns is-gapless is-vcentered mb-0",key:n},[e.createElementVNode("div",f,[e.createElementVNode("a",{href:t.$ziggy("shop.compare")+"/"+o.slug,class:"dropdown-item"},[e.createTextVNode(e.toDisplayString(o.name)+" ",1),e.createElementVNode("span",E,e.toDisplayString(o.count),1)],8,v)]),e.createElementVNode("div",N,[e.createElementVNode("a",{class:"mr-2",onClick:function(e){return t.deleteCategory(o)}},k,8,V)])])})),128))])])):e.createCommentVNode("v-if",!0)])},module.exports=n;
1
+ "use strict";var e=require("vue"),t=require("vuex"),o=require("vue-toastification").useToast(),n=e.defineComponent({setup:function(){var n=t.useStore(),a=e.ref(!1),r=e.computed((function(){return n.getters["compare/categories"]})),l=e.computed((function(){return n.getters["compare/products"]})),c=e.ref(!1);return n.dispatch("compare/get",{finally:function(){a.value=!0}}),{mounted:a,categories:r,products:l,deleteCategory:function(e){c.value||(c.value=!0,n.dispatch("compare/category",{slug:e.slug,finally:function(){o(__("shop.compare.category_deleted",{name:e.name}),{type:"success"}),c.value=!1}}))}}}}),a={class:"dropdown is-right is-hoverable shop-compare"},r={class:"dropdown-trigger"},l={key:0,class:"button"},c=e.createElementVNode("span",null,[e.createElementVNode("i",{class:"fas fa-balance-scale"})],-1),s={class:"ml-2"},i={key:0,class:"icon is-small"},d=[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"},null,-1)],m={key:0,class:"dropdown-menu",role:"menu"},u={class:"dropdown-content"},p={class:"dropdown-item pb-0 is-size-7"},g=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),f={class:"column"},v=["href"],E={class:"badge"},h={class:"column is-narrow"},N=["onClick"],V=[e.createElementVNode("span",{class:"icon",style:{transform:"scale(0.8)",color:"#888"}},[e.createElementVNode("i",{class:"fas fa-times"})],-1)];n.render=function(t,o,n,k,y,B){return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",r,[t.mounted?(e.openBlock(),e.createElementBlock("div",l,[e.renderSlot(t.$slots,"default",{total:t.products.length,categories:t.categories.length},(function(){return[c,e.createElementVNode("span",s,e.toDisplayString(t.products.length),1),t.categories.length?(e.openBlock(),e.createElementBlock("span",i,d)):e.createCommentVNode("v-if",!0)]}))])):e.createCommentVNode("v-if",!0)]),t.categories.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",u,[e.createElementVNode("div",p,e.toDisplayString(t.__("shop.title.compare")),1),g,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(o,n){return e.openBlock(),e.createElementBlock("div",{class:"columns is-gapless is-vcentered mb-0",key:n},[e.createElementVNode("div",f,[e.createElementVNode("a",{href:t.$ziggy("shop.compare")+(t.$env.shop.isTrailingSlash?"":"/")+o.slug+(t.$env.shop.isTrailingSlash?"/":""),class:"dropdown-item"},[e.createTextVNode(e.toDisplayString(o.name)+" ",1),e.createElementVNode("span",E,e.toDisplayString(o.count),1)],8,v)]),e.createElementVNode("div",h,[e.createElementVNode("a",{class:"mr-2",onClick:function(e){return t.deleteCategory(o)}},V,8,N)])])})),128))])])):e.createCommentVNode("v-if",!0)])},module.exports=n;
2
2
  //# sourceMappingURL=Compare.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Compare.js","sources":["../../../../src/components/shop/compare/Compare.vue","../../../../src/components/shop/compare/Compare.vue?vue&type=template&id=14d99dbc&lang.js"],"sourcesContent":["<template>\n <div class=\"dropdown is-right is-hoverable shop-compare\">\n <div class=\"dropdown-trigger\">\n <div class=\"button\" v-if=\"mounted\">\n <slot :total=\"products.length\" :categories=\"categories.length\">\n <span>\n <i class=\"fas fa-balance-scale\"></i>\n </span>\n <span class=\"ml-2\">\n {{ products.length }}\n </span>\n <span class=\"icon is-small\" v-if=\"categories.length\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\" v-if=\"categories.length\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-item pb-0 is-size-7\">\n {{ __(\"shop.title.compare\") }}\n </div>\n <div class=\"dropdown-divider\"></div>\n <div\n class=\"columns is-gapless is-vcentered mb-0\"\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n >\n <div class=\"column\">\n <a\n :href=\"$ziggy('shop.compare') + '/' + item.slug\"\n class=\"dropdown-item\"\n >\n {{ item.name }}\n <span class=\"badge\">{{ item.count }}</span>\n </a>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"mr-2\" @click=\"deleteCategory(item)\">\n <span\n class=\"icon\"\n style=\"transform: scale(0.8); color: #888\"\n >\n <i class=\"fas fa-times\"></i>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { useToast } from \"vue-toastification\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const mounted = ref(false);\n const categories = computed(() => store.getters[\"compare/categories\"]);\n const products = computed(() => store.getters[\"compare/products\"]);\n const loading = ref(false);\n\n const deleteCategory = (category) => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/category\", {\n slug: category.slug,\n finally: () => {\n toast(\n __(\"shop.compare.category_deleted\", {\n name: category.name,\n }),\n {\n type: \"success\",\n }\n );\n\n loading.value = false;\n },\n });\n }\n };\n\n store.dispatch(\"compare/get\", {\n finally: () => {\n mounted.value = true;\n },\n });\n\n return {\n mounted,\n categories,\n products,\n deleteCategory,\n };\n },\n});\n</script>","<template>\n <div class=\"dropdown is-right is-hoverable shop-compare\">\n <div class=\"dropdown-trigger\">\n <div class=\"button\" v-if=\"mounted\">\n <slot :total=\"products.length\" :categories=\"categories.length\">\n <span>\n <i class=\"fas fa-balance-scale\"></i>\n </span>\n <span class=\"ml-2\">\n {{ products.length }}\n </span>\n <span class=\"icon is-small\" v-if=\"categories.length\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\" v-if=\"categories.length\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-item pb-0 is-size-7\">\n {{ __(\"shop.title.compare\") }}\n </div>\n <div class=\"dropdown-divider\"></div>\n <div\n class=\"columns is-gapless is-vcentered mb-0\"\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n >\n <div class=\"column\">\n <a\n :href=\"$ziggy('shop.compare') + '/' + item.slug\"\n class=\"dropdown-item\"\n >\n {{ item.name }}\n <span class=\"badge\">{{ item.count }}</span>\n </a>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"mr-2\" @click=\"deleteCategory(item)\">\n <span\n class=\"icon\"\n style=\"transform: scale(0.8); color: #888\"\n >\n <i class=\"fas fa-times\"></i>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { useToast } from \"vue-toastification\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const mounted = ref(false);\n const categories = computed(() => store.getters[\"compare/categories\"]);\n const products = computed(() => store.getters[\"compare/products\"]);\n const loading = ref(false);\n\n const deleteCategory = (category) => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/category\", {\n slug: category.slug,\n finally: () => {\n toast(\n __(\"shop.compare.category_deleted\", {\n name: category.name,\n }),\n {\n type: \"success\",\n }\n );\n\n loading.value = false;\n },\n });\n }\n };\n\n store.dispatch(\"compare/get\", {\n finally: () => {\n mounted.value = true;\n },\n });\n\n return {\n mounted,\n categories,\n products,\n deleteCategory,\n };\n },\n});\n</script>"],"names":["toast","defineComponent","setup","store","useStore","mounted","ref","categories","computed","getters","products","loading","dispatch","value","deleteCategory","category","slug","__","name","type","_createElementVNode","role","style","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_hoisted_3","_renderSlot","total","length","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","item","key","_hoisted_13","href","_hoisted_15","count","_hoisted_16","onClick"],"mappings":"oDAyDMA,6CAEuBC,kBAAgB,CACzCC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAaC,YAAS,kBAAML,EAAMM,QAAQ,yBAC1CC,EAAWF,YAAS,kBAAML,EAAMM,QAAQ,uBACxCE,EAAUL,OAAI,UAwBpBH,EAAMS,SAAS,cAAe,SACjB,WACLP,EAAQQ,OAAQ,KAIjB,CACHR,QAAAA,EACAE,WAAAA,EACAG,SAAAA,EACAI,eAhCmB,SAACC,GACfJ,EAAQE,QACTF,EAAQE,OAAQ,EAEhBV,EAAMS,SAAS,mBAAoB,CAC/BI,KAAMD,EAASC,aACN,WACLhB,EACIiB,GAAG,gCAAiC,CAChCC,KAAMH,EAASG,OAEnB,CACIC,KAAM,YAIdR,EAAQE,OAAQ,oBClFzB,wDACI,mCACI,YAEHO,kCACIA,gCAAS,uCAED,uBAGA,oBACRA,gCAAS,kCAAgC,iCAK9C,gBAAgBC,KAAK,iBACjB,6BACI,kCAGXD,kCAAW,sCAMI,8BAMS,kBAGT,qCAEHA,mCACU,OACNE,MAAA,wCAEAF,gCAAS,2EA1CrCG,2BAAAC,GACIJ,2BAAAK,GAC8BC,yBAA1BH,2BAAAI,GACIC,iCAAOC,MAAOH,WAASI,OAASvB,WAAYmB,aAAWI,SAAvD,kBACIC,EAGAX,4BAAAY,oBACON,WAASI,WAEkBJ,aAAWI,sBAA7CP,4BAAAU,+EAMiCP,aAAWI,sBAAxDP,2BAAAW,GACId,2BAAAe,GACIf,2BAAAgB,oBACOV,+BAEPW,mBACAd,kDAE0BG,uBAAdY,EAAMC,wBAFlBhB,kCACU,uCAECgB,IAAKA,IAEZnB,2BAAAoB,GACIpB,0BACKqB,KAAMf,6BAA+BY,EAAKtB,WACrC,sDAEHsB,EAAKpB,aACRE,4BAAAsB,oBAAuBJ,EAAKK,kBAGpCvB,2BAAAwB,GACIxB,gCAAS,OAAQyB,2BAAOnB,iBAAeY"}
1
+ {"version":3,"file":"Compare.js","sources":["../../../../src/components/shop/compare/Compare.vue","../../../../src/components/shop/compare/Compare.vue?vue&type=template&id=4f161126&lang.js"],"sourcesContent":["<template>\n <div class=\"dropdown is-right is-hoverable shop-compare\">\n <div class=\"dropdown-trigger\">\n <div class=\"button\" v-if=\"mounted\">\n <slot :total=\"products.length\" :categories=\"categories.length\">\n <span>\n <i class=\"fas fa-balance-scale\"></i>\n </span>\n <span class=\"ml-2\">{{ products.length }}</span>\n <span class=\"icon is-small\" v-if=\"categories.length\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\" v-if=\"categories.length\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-item pb-0 is-size-7\">{{ __(\"shop.title.compare\") }}</div>\n <div class=\"dropdown-divider\"></div>\n <div\n class=\"columns is-gapless is-vcentered mb-0\"\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n >\n <div class=\"column\">\n <a\n :href=\"$ziggy('shop.compare') + ($env.shop.isTrailingSlash ? '' : '/') + item.slug + ($env.shop.isTrailingSlash ? '/' : '')\"\n class=\"dropdown-item\"\n >\n {{ item.name }}\n <span class=\"badge\">{{ item.count }}</span>\n </a>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"mr-2\" @click=\"deleteCategory(item)\">\n <span class=\"icon\" style=\"transform: scale(0.8); color: #888\">\n <i class=\"fas fa-times\"></i>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { useToast } from \"vue-toastification\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const mounted = ref(false);\n const categories = computed(() => store.getters[\"compare/categories\"]);\n const products = computed(() => store.getters[\"compare/products\"]);\n const loading = ref(false);\n\n const deleteCategory = (category) => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/category\", {\n slug: category.slug,\n finally: () => {\n toast(\n __(\"shop.compare.category_deleted\", {\n name: category.name,\n }),\n {\n type: \"success\",\n }\n );\n\n loading.value = false;\n },\n });\n }\n };\n\n store.dispatch(\"compare/get\", {\n finally: () => {\n mounted.value = true;\n },\n });\n\n return {\n mounted,\n categories,\n products,\n deleteCategory,\n };\n },\n});\n</script>","<template>\n <div class=\"dropdown is-right is-hoverable shop-compare\">\n <div class=\"dropdown-trigger\">\n <div class=\"button\" v-if=\"mounted\">\n <slot :total=\"products.length\" :categories=\"categories.length\">\n <span>\n <i class=\"fas fa-balance-scale\"></i>\n </span>\n <span class=\"ml-2\">{{ products.length }}</span>\n <span class=\"icon is-small\" v-if=\"categories.length\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\" v-if=\"categories.length\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-item pb-0 is-size-7\">{{ __(\"shop.title.compare\") }}</div>\n <div class=\"dropdown-divider\"></div>\n <div\n class=\"columns is-gapless is-vcentered mb-0\"\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n >\n <div class=\"column\">\n <a\n :href=\"$ziggy('shop.compare') + ($env.shop.isTrailingSlash ? '' : '/') + item.slug + ($env.shop.isTrailingSlash ? '/' : '')\"\n class=\"dropdown-item\"\n >\n {{ item.name }}\n <span class=\"badge\">{{ item.count }}</span>\n </a>\n </div>\n <div class=\"column is-narrow\">\n <a class=\"mr-2\" @click=\"deleteCategory(item)\">\n <span class=\"icon\" style=\"transform: scale(0.8); color: #888\">\n <i class=\"fas fa-times\"></i>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { useToast } from \"vue-toastification\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const mounted = ref(false);\n const categories = computed(() => store.getters[\"compare/categories\"]);\n const products = computed(() => store.getters[\"compare/products\"]);\n const loading = ref(false);\n\n const deleteCategory = (category) => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/category\", {\n slug: category.slug,\n finally: () => {\n toast(\n __(\"shop.compare.category_deleted\", {\n name: category.name,\n }),\n {\n type: \"success\",\n }\n );\n\n loading.value = false;\n },\n });\n }\n };\n\n store.dispatch(\"compare/get\", {\n finally: () => {\n mounted.value = true;\n },\n });\n\n return {\n mounted,\n categories,\n products,\n deleteCategory,\n };\n },\n});\n</script>"],"names":["toast","defineComponent","setup","store","useStore","mounted","ref","categories","computed","getters","products","loading","dispatch","value","deleteCategory","category","slug","__","name","type","_createElementVNode","role","style","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_hoisted_3","_renderSlot","total","length","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","item","key","_hoisted_13","href","shop","isTrailingSlash","_hoisted_15","count","_hoisted_16","onClick"],"mappings":"oDAkDMA,6CAEuBC,kBAAgB,CACzCC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GACdC,EAAaC,YAAS,kBAAML,EAAMM,QAAQ,yBAC1CC,EAAWF,YAAS,kBAAML,EAAMM,QAAQ,uBACxCE,EAAUL,OAAI,UAwBpBH,EAAMS,SAAS,cAAe,SACjB,WACLP,EAAQQ,OAAQ,KAIjB,CACHR,QAAAA,EACAE,WAAAA,EACAG,SAAAA,EACAI,eAhCmB,SAACC,GACfJ,EAAQE,QACTF,EAAQE,OAAQ,EAEhBV,EAAMS,SAAS,mBAAoB,CAC/BI,KAAMD,EAASC,aACN,WACLhB,EACIiB,GAAG,gCAAiC,CAChCC,KAAMH,EAASG,OAEnB,CACIC,KAAM,YAIdR,EAAQE,OAAQ,oBC3EzB,wDACI,mCACI,YAEHO,kCACIA,gCAAS,uCAED,uBACA,oBACRA,gCAAS,kCAAgC,iCAK9C,gBAAgBC,KAAK,iBACjB,6BACI,kCACXD,kCAAW,sCAMI,8BAMS,kBAGT,qCAEHA,mCAAY,OAAOE,MAAA,wCACfF,gCAAS,2EAnCrCG,2BAAAC,GACIJ,2BAAAK,GAC8BC,yBAA1BH,2BAAAI,GACIC,iCAAOC,MAAOH,WAASI,OAASvB,WAAYmB,aAAWI,SAAvD,kBACIC,EAGAX,4BAAAY,oBAAsBN,WAASI,WACGJ,aAAWI,sBAA7CP,4BAAAU,+EAMiCP,aAAWI,sBAAxDP,2BAAAW,GACId,2BAAAe,GACIf,2BAAAgB,oBAA6CV,+BAC7CW,mBACAd,kDAE0BG,uBAAdY,EAAMC,wBAFlBhB,kCACU,uCAECgB,IAAKA,IAEZnB,2BAAAoB,GACIpB,0BACKqB,KAAMf,0BAA0BA,OAAKgB,KAAKC,wBAA8BL,EAAKtB,MAAQU,OAAKgB,KAAKC,8BAC1F,sDAEHL,EAAKpB,aACRE,4BAAAwB,oBAAuBN,EAAKO,kBAGpCzB,2BAAA0B,GACI1B,gCAAS,OAAQ2B,2BAAOrB,iBAAeY"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),n=require("vuex"),t=e.defineComponent({props:{id:Number},setup:function(t){var o=n.useStore(),r=e.computed((function(){return o.getters["compare/product"](t.id)})),a=e.ref(!1);return{product:r,action:function(){a.value||(a.value=!0,o.dispatch("compare/delete",{id:t.id,callback:function(e){var n=window.location.pathname.split("/"),o=n.pop();","!=(o=(o=(","+o+",").replace(","+t.id+",",",")).substring(1,o.length-1))&&n.push(o),window.location.href=n.join("/")},finally:function(){a.value=!1}}))},loading:a}}}),o=[e.createElementVNode("i",{class:"fas fa-times"},null,-1)];t.render=function(n,t,r,a,i,c){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["button compare",{"is-loading":n.loading}]),onClick:t[0]||(t[0]=function(){return n.action&&n.action.apply(n,arguments)})},[e.renderSlot(n.$slots,"default",{product:n.product},(function(){return[e.createElementVNode("span",{class:e.normalizeClass(["icon",{"is-transparent":!n.product}])},o,2)]}))],2)},module.exports=t;
1
+ "use strict";var e=require("vue"),n=require("vuex"),t=e.defineComponent({props:{id:Number},setup:function(t){var o=n.useStore(),r=e.computed((function(){return o.getters["compare/product"](t.id)})),a=e.ref(!1);return{product:r,action:function(){a.value||(a.value=!0,o.dispatch("compare/delete",{id:t.id,callback:function(e){var n=window.location.pathname.replace(/\/$/,"").split("/"),o=n.pop();","!=(o=(o=(","+o+",").replace(","+t.id+",",",")).substring(1,o.length-1))&&n.push(o),window.location.href=n.join("/")+($env.shop.isTrailingSlash?"/":"")},finally:function(){a.value=!1}}))},loading:a}}}),o=[e.createElementVNode("i",{class:"fas fa-times"},null,-1)];t.render=function(n,t,r,a,i,l){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["button compare",{"is-loading":n.loading}]),onClick:t[0]||(t[0]=function(){return n.action&&n.action.apply(n,arguments)})},[e.renderSlot(n.$slots,"default",{product:n.product},(function(){return[e.createElementVNode("span",{class:e.normalizeClass(["icon",{"is-transparent":!n.product}])},o,2)]}))],2)},module.exports=t;
2
2
  //# sourceMappingURL=CompareDelete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompareDelete.js","sources":["../../../../src/components/shop/compare/CompareDelete.vue","../../../../src/components/shop/compare/CompareDelete.vue?vue&type=template&id=970e078a&lang.js"],"sourcesContent":["<template>\n <button\n class=\"button compare\"\n @click=\"action\"\n v-bind:class=\"{ 'is-loading': loading }\"\n >\n <slot :product=\"product\">\n <span class=\"icon\" v-bind:class=\"{ 'is-transparent': !product }\">\n <i class=\"fas fa-times\"></i>\n </span>\n </slot>\n </button>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n props: {\n id: Number,\n },\n setup(props) {\n const store = useStore();\n const product = computed(() =>\n store.getters[\"compare/product\"](props.id)\n );\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: props.id,\n callback: (data) => {\n const { pathname } = window.location;\n\n let segments = pathname.split(\"/\");\n let last = segments.pop();\n\n last = (\",\" + last + \",\").replace(\n \",\" + props.id + \",\",\n \",\"\n );\n\n last = last.substring(1, last.length - 1);\n\n if (last != \",\") {\n segments.push(last);\n }\n\n window.location.href = segments.join(\"/\");\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n product,\n action,\n loading,\n };\n },\n});\n</script>","<template>\n <button\n class=\"button compare\"\n @click=\"action\"\n v-bind:class=\"{ 'is-loading': loading }\"\n >\n <slot :product=\"product\">\n <span class=\"icon\" v-bind:class=\"{ 'is-transparent': !product }\">\n <i class=\"fas fa-times\"></i>\n </span>\n </slot>\n </button>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n props: {\n id: Number,\n },\n setup(props) {\n const store = useStore();\n const product = computed(() =>\n store.getters[\"compare/product\"](props.id)\n );\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: props.id,\n callback: (data) => {\n const { pathname } = window.location;\n\n let segments = pathname.split(\"/\");\n let last = segments.pop();\n\n last = (\",\" + last + \",\").replace(\n \",\" + props.id + \",\",\n \",\"\n );\n\n last = last.substring(1, last.length - 1);\n\n if (last != \",\") {\n segments.push(last);\n }\n\n window.location.href = segments.join(\"/\");\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n product,\n action,\n loading,\n };\n },\n});\n</script>"],"names":["defineComponent","props","id","Number","setup","store","useStore","product","computed","getters","loading","ref","action","value","dispatch","callback","data","segments","window","location","pathname","split","last","pop","replace","substring","length","push","href","join","_createElementVNode","_createElementBlock","_ctx","onClick","_renderSlot"],"mappings":"sDAiB6BA,kBAAgB,CACzCC,MAAO,CACHC,GAAIC,QAERC,eAAMH,OACII,EAAQC,aACRC,EAAUC,YAAS,kBACrBH,EAAMI,QAAQ,mBAAmBR,EAAMC,OAGrCQ,EAAUC,OAAI,SAkCb,CACHJ,QAAAA,EACAK,OAlCW,WACNF,EAAQG,QACTH,EAAQG,OAAQ,EAEhBR,EAAMS,SAAS,iBAAkB,CAC7BZ,GAAID,EAAMC,GACVa,SAAU,SAACC,OAGHC,EAFiBC,OAAOC,SAApBC,SAEgBC,MAAM,KAC1BC,EAAOL,EAASM,MASR,MAFZD,GALAA,GAAQ,IAAMA,EAAO,KAAKE,QACtB,IAAMvB,EAAMC,GAAK,IACjB,MAGQuB,UAAU,EAAGH,EAAKI,OAAS,KAGnCT,EAASU,KAAKL,GAGlBJ,OAAOC,SAASS,KAAOX,EAASY,KAAK,cAEhC,WACLnB,EAAQG,OAAQ,OAS5BH,QAAAA,SCxDIoB,gCAAS,8EAPrBC,uDACU,+BAEwBC,aAD7BC,sCAAOD,0CAGRE,iCAAO3B,QAASyB,YAAhB,kBACIF,qDAAY,0BAA0CE"}
1
+ {"version":3,"file":"CompareDelete.js","sources":["../../../../src/components/shop/compare/CompareDelete.vue","../../../../src/components/shop/compare/CompareDelete.vue?vue&type=template&id=1b71b721&lang.js"],"sourcesContent":["<template>\n <button class=\"button compare\" @click=\"action\" v-bind:class=\"{ 'is-loading': loading }\">\n <slot :product=\"product\">\n <span class=\"icon\" v-bind:class=\"{ 'is-transparent': !product }\">\n <i class=\"fas fa-times\"></i>\n </span>\n </slot>\n </button>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n props: {\n id: Number,\n },\n setup(props) {\n const store = useStore();\n const product = computed(() =>\n store.getters[\"compare/product\"](props.id)\n );\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: props.id,\n callback: (data) => {\n const { pathname } = window.location;\n\n let segments = pathname.replace(/\\/$/, \"\").split(\"/\");\n let last = segments.pop();\n\n last = (\",\" + last + \",\").replace(\n \",\" + props.id + \",\",\n \",\"\n );\n\n last = last.substring(1, last.length - 1);\n\n if (last != \",\") {\n segments.push(last);\n }\n\n window.location.href = segments.join(\"/\") + ($env.shop.isTrailingSlash ? '/' : '');\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n product,\n action,\n loading,\n };\n },\n});\n</script>","<template>\n <button class=\"button compare\" @click=\"action\" v-bind:class=\"{ 'is-loading': loading }\">\n <slot :product=\"product\">\n <span class=\"icon\" v-bind:class=\"{ 'is-transparent': !product }\">\n <i class=\"fas fa-times\"></i>\n </span>\n </slot>\n </button>\n</template>\n<script>\nimport { ref, computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n props: {\n id: Number,\n },\n setup(props) {\n const store = useStore();\n const product = computed(() =>\n store.getters[\"compare/product\"](props.id)\n );\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: props.id,\n callback: (data) => {\n const { pathname } = window.location;\n\n let segments = pathname.replace(/\\/$/, \"\").split(\"/\");\n let last = segments.pop();\n\n last = (\",\" + last + \",\").replace(\n \",\" + props.id + \",\",\n \",\"\n );\n\n last = last.substring(1, last.length - 1);\n\n if (last != \",\") {\n segments.push(last);\n }\n\n window.location.href = segments.join(\"/\") + ($env.shop.isTrailingSlash ? '/' : '');\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n product,\n action,\n loading,\n };\n },\n});\n</script>"],"names":["defineComponent","props","id","Number","setup","store","useStore","product","computed","getters","loading","ref","action","value","dispatch","callback","data","segments","window","location","pathname","replace","split","last","pop","substring","length","push","href","join","$env","shop","isTrailingSlash","_createElementVNode","_createElementBlock","_ctx","onClick","_renderSlot"],"mappings":"sDAa6BA,kBAAgB,CACzCC,MAAO,CACHC,GAAIC,QAERC,eAAMH,OACII,EAAQC,aACRC,EAAUC,YAAS,kBACrBH,EAAMI,QAAQ,mBAAmBR,EAAMC,OAGrCQ,EAAUC,OAAI,SAkCb,CACHJ,QAAAA,EACAK,OAlCW,WACNF,EAAQG,QACTH,EAAQG,OAAQ,EAEhBR,EAAMS,SAAS,iBAAkB,CAC7BZ,GAAID,EAAMC,GACVa,SAAU,SAACC,OAGHC,EAFiBC,OAAOC,SAApBC,SAEgBC,QAAQ,MAAO,IAAIC,MAAM,KAC7CC,EAAON,EAASO,MASR,MAFZD,GALAA,GAAQ,IAAMA,EAAO,KAAKF,QACtB,IAAMpB,EAAMC,GAAK,IACjB,MAGQuB,UAAU,EAAGF,EAAKG,OAAS,KAGnCT,EAASU,KAAKJ,GAGlBL,OAAOC,SAASS,KAAOX,EAASY,KAAK,MAAQC,KAAKC,KAAKC,gBAAkB,IAAM,aAE1E,WACLtB,EAAQG,OAAQ,OAS5BH,QAAAA,SCxDIuB,gCAAS,8EAHrBC,uDAAc,+BAA+DC,aAA7CC,sCAAOD,0CACnCE,iCAAO9B,QAAS4B,YAAhB,kBACIF,qDAAY,0BAA0CE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("vue"),n=require("vuex"),o=e.defineComponent({setup:function(){var o=n.useStore(),t=e.ref(!1);return{action:function(){t.value||(t.value=!0,o.dispatch("compare/delete",{id:"all",callback:function(){window.location.href=$ziggy("shop.compare")},finally:function(){t.value=!1}}))},loading:t}}}),t=e.createTextVNode("Очистить все");o.render=function(n,o,r,a,i,l){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["button compare",{"is-loading":n.loading}]),onClick:o[0]||(o[0]=function(){return n.action&&n.action.apply(n,arguments)})},[e.renderSlot(n.$slots,"default",{},(function(){return[t]}))],2)},module.exports=o;
2
+ //# sourceMappingURL=CompareDeleteAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompareDeleteAll.js","sources":["../../../../src/components/shop/compare/CompareDeleteAll.vue","../../../../src/components/shop/compare/CompareDeleteAll.vue?vue&type=template&id=75ce7560&lang.js"],"sourcesContent":["<template>\n <button class=\"button compare\" @click=\"action\" v-bind:class=\"{ 'is-loading': loading }\">\n <slot>Очистить все</slot>\n </button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: 'all',\n callback: () => {\n window.location.href = $ziggy('shop.compare');\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n action,\n loading,\n };\n },\n});\n</script>","<template>\n <button class=\"button compare\" @click=\"action\" v-bind:class=\"{ 'is-loading': loading }\">\n <slot>Очистить все</slot>\n </button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n\n const loading = ref(false);\n\n const action = () => {\n if (!loading.value) {\n loading.value = true;\n\n store.dispatch(\"compare/delete\", {\n id: 'all',\n callback: () => {\n window.location.href = $ziggy('shop.compare');\n },\n finally: () => {\n loading.value = false;\n },\n });\n }\n };\n\n return {\n action,\n loading,\n };\n },\n});\n</script>"],"names":["defineComponent","setup","store","useStore","loading","ref","action","value","dispatch","id","callback","window","location","href","$ziggy","_createElementBlock","_ctx","onClick","_renderSlot"],"mappings":"sDAS6BA,kBAAgB,CACzCC,qBACUC,EAAQC,aAERC,EAAUC,OAAI,SAkBb,CACHC,OAjBW,WACNF,EAAQG,QACTH,EAAQG,OAAQ,EAEhBL,EAAMM,SAAS,iBAAkB,CAC7BC,GAAI,MACJC,SAAU,WACNC,OAAOC,SAASC,KAAOC,OAAO,yBAEzB,WACLV,EAAQG,OAAQ,OAQ5BH,QAAAA,0BC/BE,oEADVW,uDAAc,+BAA+DC,aAA7CC,sCAAOD,0CACnCE,oCAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("vue"),r=require("vuex"),t=e.defineComponent({setup:function(){var t=r.useStore(),n=e.computed((function(){return t.getters["compare/categories"]})),o=function(e){return $ziggy("shop.compare")+($env.shop.isTrailingSlash?"":"/")+e+($env.shop.isTrailingSlash?"/":"")};return{categories:n,url:o,isActive:function(e){return window.location.href==o(e)}}}}),n=["href"];t.render=function(r,t,o,i,l,s){return e.renderSlot(r.$slots,"default",{},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.categories,(function(t,o){return e.openBlock(),e.createElementBlock("li",{key:o,class:e.normalizeClass({"is-active":r.isActive(t.slug)})},[e.createElementVNode("a",{href:r.url(t.slug)},[e.createTextVNode(e.toDisplayString(t.name)+" ",1),e.createElementVNode("span",null,"("+e.toDisplayString(t.count)+")",1)],8,n)],2)})),128))]}))},module.exports=t;
2
+ //# sourceMappingURL=CompareList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompareList.js","sources":["../../../../src/components/shop/compare/CompareList.vue","../../../../src/components/shop/compare/CompareList.vue?vue&type=template&id=173b3007&lang.js"],"sourcesContent":["<template>\n <slot>\n <li\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n v-bind:class=\"{ 'is-active': isActive(item.slug) }\"\n >\n <a :href=\"url(item.slug)\">\n {{ item.name }}\n <span>({{ item.count }})</span>\n </a>\n </li>\n </slot>\n</template>\n<script>\nimport { computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const categories = computed(() => store.getters[\"compare/categories\"]);\n\n const url = (slug) => {\n return $ziggy('shop.compare') + ($env.shop.isTrailingSlash ? '' : '/') + slug + ($env.shop.isTrailingSlash ? '/' : '');\n }\n\n const isActive = (slug) => {\n return window.location.href == url(slug);\n }\n\n return {\n categories,\n url,\n isActive,\n }\n }\n});\n</script>","<template>\n <slot>\n <li\n v-for=\"(item, key) in categories\"\n v-bind:key=\"key\"\n v-bind:class=\"{ 'is-active': isActive(item.slug) }\"\n >\n <a :href=\"url(item.slug)\">\n {{ item.name }}\n <span>({{ item.count }})</span>\n </a>\n </li>\n </slot>\n</template>\n<script>\nimport { computed, defineComponent } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n const store = useStore();\n const categories = computed(() => store.getters[\"compare/categories\"]);\n\n const url = (slug) => {\n return $ziggy('shop.compare') + ($env.shop.isTrailingSlash ? '' : '/') + slug + ($env.shop.isTrailingSlash ? '/' : '');\n }\n\n const isActive = (slug) => {\n return window.location.href == url(slug);\n }\n\n return {\n categories,\n url,\n isActive,\n }\n }\n});\n</script>"],"names":["defineComponent","setup","store","useStore","categories","computed","getters","url","slug","$ziggy","$env","shop","isTrailingSlash","isActive","window","location","href","_renderSlot","_createElementBlock","_ctx","item","key","_createElementVNode","name","count"],"mappings":"sDAkB6BA,kBAAgB,CACzCC,qBACUC,EAAQC,aACRC,EAAaC,YAAS,kBAAMH,EAAMI,QAAQ,yBAE1CC,EAAM,SAACC,UACFC,OAAO,iBAAmBC,KAAKC,KAAKC,gBAAkB,GAAK,KAAOJ,GAAQE,KAAKC,KAAKC,gBAAkB,IAAM,WAOhH,CACHR,WAAAA,EACAG,IAAAA,EACAM,SAPa,SAACL,UACPM,OAAOC,SAASC,MAAQT,EAAIC,yDC3B3CS,oCAAA,mCACIC,kDAC0BC,uBAAdC,EAAMC,wBADlBH,2BAEWG,IAAKA,sCACiBF,WAASC,EAAKZ,UAE3Cc,0BAAIN,KAAMG,MAAIC,EAAKZ,4CACZY,EAAKG,aACRD,iCAAM,sBAAIF,EAAKI,OAAQ"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("simplebar")),o=e.defineComponent({setup:function(){window.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("comparsion"),t=e.querySelector("table"),o=document.getElementById("comparsion-header"),i=new n.default(e),r=o.querySelector("thead").cloneNode(!0),s=t.cloneNode();s.appendChild(r),s.removeAttribute("id"),s.classList.remove("original"),s.classList.add("corner"),o.querySelector(".switcher").remove(),o.querySelector(".comparsion-navigation").remove(),e.parentNode.insertBefore(s,e);var l,c=0,d=!1,a=!1;function u(e){e&&(s.style.left=e.x+c+"px",s.style.top=e.y+"px",s.style.display="block")}i.getScrollElement().addEventListener("scroll",(function(e){c=i.getScrollElement().scrollLeft,d||(window.requestAnimationFrame((function(){var e;e=c,o.style.transform="translateX(-"+e+"px)",t.classList[e>0?"add":"remove"]("shadow"),s.classList[e>0?"add":"remove"]("shadow"),y(),d=!1})),d=!0)}),{passive:!0}),document.addEventListener("scroll",(function(e){l=o.getBoundingClientRect(),a||(window.requestAnimationFrame((function(){u(l),a=!1})),a=!0)}),{passive:!0}),setTimeout((function(){u(o.getBoundingClientRect())}),300);var m=t.querySelectorAll("tbody tr"),v=[],f=o.querySelectorAll("th");m.forEach((function(e,t){var n=e.querySelectorAll("td");n.forEach((function(e,t){e.addEventListener("mouseover",(function(e){f.forEach((function(e){e.classList.remove("is-hovered")})),f[t].classList.add("is-hovered"),v.forEach((function(e){e.forEach((function(e){e.classList.remove("is-hovered")})),t>0&&e[t].classList.add("is-hovered")}))}))})),v.push(n)})),document.getElementById("comparsion-show").addEventListener("click",(function(){t.classList.toggle("only-difference")}));var L=document.getElementById("comparsion-next"),h=document.getElementById("comparsion-prev"),E=parseInt(t.querySelector("td").offsetWidth);L.addEventListener("click",(function(){g(c,c+E,300)})),h.addEventListener("click",(function(){g(c,c-E,300)}));var g=function(e,t,n){var o=(new Date).getTime(),r=setInterval((function(){var s,l,c,d=(new Date).getTime()-o,a=(s=d,l=e,c=t-e,(s/=n/2)<1?c/2*s*s*s*s+l:-c/2*((s-=2)*s*s*s-2)+l);i.getScrollElement().scrollLeft=a,d>=n&&clearInterval(r)}),1e3/60)};var p=i.getScrollElement().scrollWidth-i.getScrollElement().clientWidth;window.addEventListener("resize",(function(){p=i.getScrollElement().scrollWidth-i.getScrollElement().clientWidth,y()}));var y=function(){h.classList.remove("is-disabled"),L.classList.remove("is-disabled"),h.classList.remove("is-hidden"),L.classList.remove("is-hidden"),0==p&&(h.classList.add("is-hidden"),L.classList.add("is-hidden")),0==i.getScrollElement().scrollLeft&&h.classList.add("is-disabled"),i.getScrollElement().scrollLeft==p&&L.classList.add("is-disabled")};y()}))}});o.render=function(e,t,n,o,i,r){return null},module.exports=o;
1
+ "use strict";var e=require("vue"),t=require("simplebar"),n=require("dragscroll");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t),l=o(n),i=e.defineComponent({setup:function(){window.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("comparsion"),t=e.querySelector("table"),n=document.getElementById("comparsion-header"),o=new r.default(e),i=n.querySelector("thead").cloneNode(!0),s=t.cloneNode();s.appendChild(i),s.removeAttribute("id"),s.classList.remove("original"),s.classList.add("corner"),n.querySelector(".switcher").remove(),n.querySelector(".comparsion-navigation").remove(),e.parentNode.insertBefore(s,e);var c,d=0,a=!1,u=!1;function m(e){e&&(s.style.left=e.x+d+"px",s.style.top=e.y+"px",s.style.display="block")}o.getScrollElement().addEventListener("scroll",(function(e){d=o.getScrollElement().scrollLeft,a||(window.requestAnimationFrame((function(){var e;e=d,n.style.transform="translateX(-"+e+"px)",t.classList[e>0?"add":"remove"]("shadow"),s.classList[e>0?"add":"remove"]("shadow"),S(),a=!1})),a=!0)}),{passive:!0}),document.addEventListener("scroll",(function(e){c=n.getBoundingClientRect(),u||(window.requestAnimationFrame((function(){m(c),u=!1})),u=!0)}),{passive:!0}),setTimeout((function(){m(n.getBoundingClientRect())}),300);var f=t.querySelectorAll("tbody tr:not(.row-title-mobile)"),v=[],L=n.querySelectorAll("th");f.forEach((function(e,t){var n=e.querySelectorAll("td");n.forEach((function(e,t){e.addEventListener("mouseover",(function(e){L.forEach((function(e){e.classList.remove("is-hovered")})),L[t].classList.add("is-hovered"),v.forEach((function(e){e.forEach((function(e){e.classList.remove("is-hovered")})),t>0&&e[t].classList.add("is-hovered")}))}))})),v.push(n)})),document.getElementById("comparsion-show").addEventListener("click",(function(){t.classList.toggle("only-difference")}));var E=document.getElementById("comparsion-next"),g=document.getElementById("comparsion-prev"),h=parseInt(t.querySelector("tr:not(.row-title-mobile) td").offsetWidth);E.addEventListener("click",(function(){p(d,d+h,300)})),g.addEventListener("click",(function(){p(d,d-h,300)}));var p=function(e,t,n){var r=(new Date).getTime(),l=setInterval((function(){var i,s,c,d=(new Date).getTime()-r,a=(i=d,s=e,c=t-e,(i/=n/2)<1?c/2*i*i*i*i+s:-c/2*((i-=2)*i*i*i-2)+s);o.getScrollElement().scrollLeft=a,d>=n&&clearInterval(l)}),1e3/60)};var y=o.getScrollElement().scrollWidth-o.getScrollElement().clientWidth;window.addEventListener("resize",(function(){y=o.getScrollElement().scrollWidth-o.getScrollElement().clientWidth,S()}));var S=function(){g.classList.remove("is-disabled"),E.classList.remove("is-disabled"),g.classList.remove("is-hidden"),E.classList.remove("is-hidden"),0==y&&(g.classList.add("is-hidden"),E.classList.add("is-hidden")),0==o.getScrollElement().scrollLeft&&g.classList.add("is-disabled"),o.getScrollElement().scrollLeft==y&&E.classList.add("is-disabled")};S(),o.getScrollElement().classList.add("dragscroll"),l.default.reset()}))}});i.render=function(e,t,n,o,r,l){return null},module.exports=i;
2
2
  //# sourceMappingURL=Comparsion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Comparsion.js","sources":["../../../../src/components/shop/compare/Comparsion.vue"],"sourcesContent":["<template></template>\n<script>\nimport { defineComponent } from 'vue';\nimport SimpleBar from 'simplebar';\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n window.addEventListener('DOMContentLoaded', () => {\n const container = document.getElementById('comparsion');\n const table = container.querySelector('table');\n const duplicate = document.getElementById('comparsion-header');\n const simpleBar = new SimpleBar(container);\n\n const cornerThead = duplicate.querySelector('thead').cloneNode(true);\n\n const corner = table.cloneNode();\n\n corner.appendChild(cornerThead);\n corner.removeAttribute('id');\n corner.classList.remove('original');\n corner.classList.add('corner');\n\n duplicate.querySelector('.switcher').remove();\n duplicate.querySelector('.comparsion-navigation').remove();\n\n container.parentNode.insertBefore(corner, container);\n\n let lastKnownScrollPosition = 0;\n let duplicatePosition;\n let ticking = false;\n let tickingDocument = false;\n\n function correctHeader(s) {\n duplicate.style.transform = 'translateX(-' + s + 'px)';\n\n table.classList[s > 0 ? 'add' : 'remove']('shadow');\n corner.classList[s > 0 ? 'add' : 'remove']('shadow');\n\n correctArrowsVisibility();\n }\n\n function correctCorner(s) {\n if (s) {\n corner.style.left = s.x + lastKnownScrollPosition + 'px';\n corner.style.top = s.y + 'px';\n corner.style.display = 'block';\n }\n }\n\n simpleBar.getScrollElement().addEventListener(\n 'scroll',\n function (e) {\n lastKnownScrollPosition = simpleBar.getScrollElement().scrollLeft;\n\n if (!ticking) {\n window.requestAnimationFrame(function () {\n correctHeader(lastKnownScrollPosition);\n ticking = false;\n });\n\n ticking = true;\n }\n },\n { passive: true }\n );\n\n document.addEventListener(\n 'scroll',\n function (e) {\n duplicatePosition = duplicate.getBoundingClientRect();\n\n if (!tickingDocument) {\n window.requestAnimationFrame(function () {\n correctCorner(duplicatePosition);\n tickingDocument = false;\n });\n\n tickingDocument = true;\n }\n },\n { passive: true }\n );\n\n setTimeout(() => {\n correctCorner(duplicate.getBoundingClientRect());\n }, 300);\n\n let highlight = table.querySelectorAll('tbody tr');\n let highlightRows = [];\n let theadTh = duplicate.querySelectorAll('th');\n\n highlight.forEach((element, index) => {\n const tds = element.querySelectorAll('td');\n\n tds.forEach((td, i) => {\n td.addEventListener('mouseover', (e) => {\n theadTh.forEach((td) => {\n td.classList.remove('is-hovered');\n });\n\n theadTh[i].classList.add('is-hovered');\n\n highlightRows.forEach((row) => {\n row.forEach((td) => {\n td.classList.remove('is-hovered');\n });\n\n if (i > 0) {\n row[i].classList.add('is-hovered');\n }\n });\n });\n });\n\n highlightRows.push(tds);\n });\n\n document.getElementById('comparsion-show').addEventListener('click', () => {\n table.classList.toggle('only-difference');\n });\n\n let next = document.getElementById('comparsion-next');\n let prev = document.getElementById('comparsion-prev');\n\n const width = parseInt(table.querySelector('td').offsetWidth);\n\n next.addEventListener('click', () => {\n timer(lastKnownScrollPosition, lastKnownScrollPosition + width, 300);\n });\n\n prev.addEventListener('click', () => {\n timer(lastKnownScrollPosition, lastKnownScrollPosition - width, 300);\n });\n\n const timer = (from, to, duration) => {\n let start = new Date().getTime();\n\n let timer = setInterval(function () {\n let time = new Date().getTime() - start;\n let s = easeInOutQuart(time, from, to - from, duration);\n\n simpleBar.getScrollElement().scrollLeft = s;\n\n if (time >= duration) {\n clearInterval(timer);\n }\n }, 1000 / 60);\n };\n\n function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t + b;\n return (-c / 2) * ((t -= 2) * t * t * t - 2) + b;\n }\n\n let maxScrollLeft = simpleBar.getScrollElement().scrollWidth - simpleBar.getScrollElement().clientWidth;\n\n window.addEventListener('resize', () => {\n maxScrollLeft = simpleBar.getScrollElement().scrollWidth - simpleBar.getScrollElement().clientWidth;\n correctArrowsVisibility();\n });\n\n const correctArrowsVisibility = () => {\n prev.classList.remove('is-disabled');\n next.classList.remove('is-disabled');\n prev.classList.remove('is-hidden');\n next.classList.remove('is-hidden');\n\n if (maxScrollLeft == 0) {\n prev.classList.add('is-hidden');\n next.classList.add('is-hidden');\n }\n\n if (simpleBar.getScrollElement().scrollLeft == 0) {\n prev.classList.add('is-disabled');\n }\n\n if (simpleBar.getScrollElement().scrollLeft == maxScrollLeft) {\n next.classList.add('is-disabled');\n }\n };\n\n correctArrowsVisibility();\n });\n }\n});\n</script>"],"names":["defineComponent","setup","window","addEventListener","container","document","getElementById","table","querySelector","duplicate","simpleBar","SimpleBar","cornerThead","cloneNode","corner","appendChild","removeAttribute","classList","remove","add","parentNode","insertBefore","duplicatePosition","lastKnownScrollPosition","ticking","tickingDocument","correctCorner","s","style","left","x","top","y","display","getScrollElement","e","scrollLeft","requestAnimationFrame","transform","correctArrowsVisibility","passive","getBoundingClientRect","setTimeout","highlight","querySelectorAll","highlightRows","theadTh","forEach","element","index","tds","td","i","row","push","toggle","next","prev","width","parseInt","offsetWidth","timer","from","to","duration","start","Date","getTime","setInterval","t","b","c","time","clearInterval","maxScrollLeft","scrollWidth","clientWidth"],"mappings":"0IAK6BA,kBAAgB,CACzCC,iBACIC,OAAOC,iBAAiB,oBAAoB,eAClCC,EAAYC,SAASC,eAAe,cACpCC,EAAQ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xFrC,WAGEA,EAA0B,WAC5BkB,EAAKxC,UAAUC,OAAO,eACtBsC,EAAKvC,UAAUC,OAAO,eACtBuC,EAAKxC,UAAUC,OAAO,aACtBsC,EAAKvC,UAAUC,OAAO,aAED,GAAjBwD,IACAjB,EAAKxC,UAAUE,IAAI,aACnBqC,EAAKvC,UAAUE,IAAI,cAGwB,GAA3CT,EAAUwB,mBAAmBE,YAC7BqB,EAAKxC,UAAUE,IAAI,eAGnBT,EAAUwB,mBAAmBE,YAAcsC,GAC3ClB,EAAKvC,UAAUE,IAAI,gBAI3BoB"}
1
+ {"version":3,"file":"Comparsion.js","sources":["../../../../src/components/shop/compare/Comparsion.vue"],"sourcesContent":["<template></template>\n<script>\nimport { defineComponent } from 'vue';\nimport SimpleBar from 'simplebar';\nimport dragscroll from 'dragscroll';\n\nexport default /*#__PURE__*/ defineComponent({\n setup() {\n window.addEventListener('DOMContentLoaded', () => {\n const container = document.getElementById('comparsion');\n const table = container.querySelector('table');\n const duplicate = document.getElementById('comparsion-header');\n const simpleBar = new SimpleBar(container);\n\n const cornerThead = duplicate.querySelector('thead').cloneNode(true);\n\n const corner = table.cloneNode();\n\n corner.appendChild(cornerThead);\n corner.removeAttribute('id');\n corner.classList.remove('original');\n corner.classList.add('corner');\n\n duplicate.querySelector('.switcher').remove();\n duplicate.querySelector('.comparsion-navigation').remove();\n\n container.parentNode.insertBefore(corner, container);\n\n let lastKnownScrollPosition = 0;\n let duplicatePosition;\n let ticking = false;\n let tickingDocument = false;\n\n function correctHeader(s) {\n duplicate.style.transform = 'translateX(-' + s + 'px)';\n\n table.classList[s > 0 ? 'add' : 'remove']('shadow');\n corner.classList[s > 0 ? 'add' : 'remove']('shadow');\n\n correctArrowsVisibility();\n }\n\n function correctCorner(s) {\n if (s) {\n corner.style.left = s.x + lastKnownScrollPosition + 'px';\n corner.style.top = s.y + 'px';\n corner.style.display = 'block';\n }\n }\n\n simpleBar.getScrollElement().addEventListener(\n 'scroll',\n function (e) {\n lastKnownScrollPosition = simpleBar.getScrollElement().scrollLeft;\n\n if (!ticking) {\n window.requestAnimationFrame(function () {\n correctHeader(lastKnownScrollPosition);\n ticking = false;\n });\n\n ticking = true;\n }\n },\n { passive: true }\n );\n\n document.addEventListener(\n 'scroll',\n function (e) {\n duplicatePosition = duplicate.getBoundingClientRect();\n\n if (!tickingDocument) {\n window.requestAnimationFrame(function () {\n correctCorner(duplicatePosition);\n tickingDocument = false;\n });\n\n tickingDocument = true;\n }\n },\n { passive: true }\n );\n\n setTimeout(() => {\n correctCorner(duplicate.getBoundingClientRect());\n }, 300);\n\n let highlight = table.querySelectorAll('tbody tr:not(.row-title-mobile)');\n let highlightRows = [];\n let theadTh = duplicate.querySelectorAll('th');\n\n highlight.forEach((element, index) => {\n const tds = element.querySelectorAll('td');\n\n tds.forEach((td, i) => {\n td.addEventListener('mouseover', (e) => {\n theadTh.forEach((td) => {\n td.classList.remove('is-hovered');\n });\n\n theadTh[i].classList.add('is-hovered');\n\n highlightRows.forEach((row) => {\n row.forEach((td) => {\n td.classList.remove('is-hovered');\n });\n\n if (i > 0) {\n row[i].classList.add('is-hovered');\n }\n });\n });\n });\n\n highlightRows.push(tds);\n });\n\n document.getElementById('comparsion-show').addEventListener('click', () => {\n table.classList.toggle('only-difference');\n });\n\n let next = document.getElementById('comparsion-next');\n let prev = document.getElementById('comparsion-prev');\n\n const width = parseInt(table.querySelector('tr:not(.row-title-mobile) td').offsetWidth);\n\n next.addEventListener('click', () => {\n timer(lastKnownScrollPosition, lastKnownScrollPosition + width, 300);\n });\n\n prev.addEventListener('click', () => {\n timer(lastKnownScrollPosition, lastKnownScrollPosition - width, 300);\n });\n\n const timer = (from, to, duration) => {\n let start = new Date().getTime();\n\n let timer = setInterval(function () {\n let time = new Date().getTime() - start;\n let s = easeInOutQuart(time, from, to - from, duration);\n\n simpleBar.getScrollElement().scrollLeft = s;\n\n if (time >= duration) {\n clearInterval(timer);\n }\n }, 1000 / 60);\n };\n\n function easeInOutQuart(t, b, c, d) {\n if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t + b;\n return (-c / 2) * ((t -= 2) * t * t * t - 2) + b;\n }\n\n let maxScrollLeft = simpleBar.getScrollElement().scrollWidth - simpleBar.getScrollElement().clientWidth;\n\n window.addEventListener('resize', () => {\n maxScrollLeft = simpleBar.getScrollElement().scrollWidth - simpleBar.getScrollElement().clientWidth;\n correctArrowsVisibility();\n });\n\n const correctArrowsVisibility = () => {\n prev.classList.remove('is-disabled');\n next.classList.remove('is-disabled');\n prev.classList.remove('is-hidden');\n next.classList.remove('is-hidden');\n\n if (maxScrollLeft == 0) {\n prev.classList.add('is-hidden');\n next.classList.add('is-hidden');\n }\n\n if (simpleBar.getScrollElement().scrollLeft == 0) {\n prev.classList.add('is-disabled');\n }\n\n if (simpleBar.getScrollElement().scrollLeft == maxScrollLeft) {\n next.classList.add('is-disabled');\n }\n };\n\n correctArrowsVisibility();\n\n // const d = draggable({\n // element: simpleBar.getScrollElement(),\n // onDragStarted: (event) => console.log(event),\n // onDragChanged: (e) => {\n // if (e.direction == 'left' || e.direction == 'right') {\n // const el = simpleBar.getScrollElement().scrollLeft;\n // if (e.direction)\n // el = e.magnitude\n // }\n // },\n // onDragEnded: (event) => console.log(event)\n // });\n\n simpleBar.getScrollElement().classList.add('dragscroll');\n\n dragscroll.reset();\n });\n }\n});\n</script>"],"names":["defineComponent","setup","window","addEventListener","container","document","getElementById","table","querySelector","duplicate","simpleBar","SimpleBar","cornerThead","cloneNode","corner","appendChild","removeAttribute","classList","remove","add","parentNode","insertBefore","duplicatePosition","lastKnownScrollPosition","ticking","tickingDocument","correctCorner","s","style","left","x","top","y","display","getScrollElement","e","scrollLeft","requestAnimationFrame","transform","correctArrowsVisibility","passive","getBoundingClientRect","setTimeout","highlight","querySelectorAll","highlightRows","theadTh","forEach","element","index","tds","td","i","row","push","toggle","next","prev","width","parseInt","offsetWidth","timer","from","to","duration","start","Date","getTime","setInterval","t","b","c","time","clearInterval","maxScrollLeft","scr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mByC,YAAcjE,EAAUwB,mBAAmB0C,YAE5F1E,OAAOC,iBAAiB,UAAU,WAC9BuE,EAAgBhE,EAAUwB,mBAAmByC,YAAcjE,EAAUwB,mBAAmB0C,YACxFrC,WAGEA,EAA0B,WAC5BkB,EAAKxC,UAAUC,OAAO,eACtBsC,EAAKvC,UAAUC,OAAO,eACtBuC,EAAKxC,UAAUC,OAAO,aACtBsC,EAAKvC,UAAUC,OAAO,aAED,GAAjBwD,IACAjB,EAAKxC,UAAUE,IAAI,aACnBqC,EAAKvC,UAAUE,IAAI,cAGwB,GAA3CT,EAAUwB,mBAAmBE,YAC7BqB,EAAKxC,UAAUE,IAAI,eAGnBT,EAAUwB,mBAAmBE,YAAcsC,GAC3ClB,EAAKvC,UAAUE,IAAI,gBAI3BoB,IAeA7B,EAAUwB,mBAAmBjB,UAAUE,IAAI,cAE3C0D,UAAWC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.4",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"
@@ -23,6 +23,7 @@
23
23
  "copy-to-clipboard": "^3.3.1",
24
24
  "countdown.to": "^0.1.6",
25
25
  "dayjs": "^1.10.7",
26
+ "dragscroll": "^0.0.8",
26
27
  "formvuelate": "^3.8.1",
27
28
  "maska": "^1.5.0",
28
29
  "rollup-plugin-vue": "^6.0.0",