1/* empty css */import{r as T,d as z,c as S,G as $}from"./geoip-B3OWME3_.js";import{o as P}from"./dom-BgCgSkzk.js";import{u as a}from"./jsxRuntime.module-Y_evQR0z.js";import{e as k,T as F,A as Q,y as J,q as A,J as B,h as G,j as W,i as K,m as Y,n as X,o as Z,p as ee,r as C,s as te,t as se,u as re}from"./algolia-Ck055L_8.js";import{u as H,a as j}from"./dates-CY2so3NZ.js";import{b as ne}from"./index-Bd1YnzvY.js";import{r as U,o as R}from"./url-CPJmR8o2.js";import{i as b,b as ie,a as oe}from"./config-CKvTttiO.js";import{g as ae,Q as ce,P as le}from"./queries-CVFtVq3Z.js";import{d as de}from"./lodash-CKZltyTr.js";import{e as ue}from"./logger-BmRFrxw_.js";import"./NetworkError-BT_JgKZz.js";class he extends HTMLElement{constructor(){super(),this.elements={button:this.querySelector("button"),panel:this.querySelector(".i18n-panel"),currencies:this.querySelector("select.currencies-select"),languages:this.querySelector("select.languages-select")},this.elements.button.addEventListener("click",this.toggleSelector.bind(this)),this.elements.button.addEventListener("focusout",this.closeSelector.bind(this)),this.elements.currencies.addEventListener("change-manual",this.setCurrency.bind(this)),this.elements.currencies.addEventListener("change",this.setCurrency.bind(this)),this.elements.languages.addEventListener("change",this.setLanguage.bind(this))}isSelectorOpened(){return this.elements.button.getAttribute("aria-expanded")==="true"}setCurrency(e){this.querySelector(".selected-currency").innerHTML=this.elements.currencies.value,e.type==="change"&&this.isSelectorOpened()&&this.toggleSelector()}setLanguage(){this.querySelector("#localization_form")?.submit()}setPanelDirection(){const{panel:e}=this.elements;window.innerHeight-this.getBoundingClientRect().bottom<e.offsetHeight?(e.style.bottom="100%",e.style.top="auto"):e.style=null}toggleSelector(){this.elements.panel.classList.toggle("hidden"),this.elements.button.setAttribute("aria-expanded",(this.elements.button.getAttribute("aria-expanded")==="false").toString());const e=this.elements.button.querySelector(".caret-down");e&&e.classList.toggle("rotate-180"),this.isSelectorOpened()?this.setPanelDirection():this.elements.panel.style=null}closeSelector(e){const t=e.relatedTarget&&e.relatedTarget.nodeName==="BUTTON";this.isSelectorOpened()&&(e.relatedTarget===null||t)&&this.toggleSelector()}}customElements.define("localization-form",he);class pe extends HTMLElement{constructor(){super(),this.applyEventListener()}applyEventListener(){if(window.sessionStorage.getItem("nsfw")){T(null,{throttle:!0,writeSession:!1})();return}this.addEventListener("click",T,{once:!0})}}customElements.define("nsfw-overlay",pe);class me extends HTMLElement{constructor(){super(),this.container=this.querySelector(".text-container"),this.button=this.querySelector("button"),this.fadeOverlay=this.querySelector(".fade-overlay"),this.maxHeight=this.dataset.maxHeight||"120px",this.button&&this.button.addEventListener("click",this.onButtonClick.bind(this))}onButtonClick(){this.container.classList.contains("collapsed")?this.expand():this.collapse()}expand(){this.container.style.maxHeight="none",this.container.classList.remove("collapsed"),this.button.textContent=this.button.dataset.textLess,this.fadeOverlay.style.display="none"}collapse(){this.container.style.maxHeight=this.maxHeight,this.container.classList.add("collapsed"),this.button.textContent=this.button.dataset.textMore,this.fadeOverlay.style.display="block"}}customElements.define("collapsible-text",me);const ge=r=>{const e=document.querySelector("button[data-newsletter-trigger]"),t=localStorage.getItem("newsletter-dismissed");r&&e&&(!t||Date.now()-t>6048e5)&&location.pathname.match(/(\/products\/|\/collections\/)/)&&setTimeout(()=>r.showModal(),5e3)};function fe({image:r,setSubscribed:e}){const t=H(),{t:s}=j("getLocale",t),[n,i]=k(!1),[o,c]=k(null),l=async u=>{u.preventDefault(),u.stopPropagation();const m=u.target,f=new FormData(m),h=[];if(f.forEach((g,v)=>{v==="interests"&&h.push(g)}),h.length===0){c(s("marketing.newsletter.popup.register.options.error"));return}i(!0),c(null);const w=await ne(h);if(i(!1),!w){c(s("marketing.newsletter.popup.register.options.post_error"));return}w.message==="success"&&(window.SlrsIdentify.accepts_marketing=!0,window.SlrsIdentify.newsletters={daily10:h.includes("10for10"),earlyBird:h.includes("Newsletter")},document.querySelector("#newsletter").classList.add("hidden"),document.querySelector("#newsletter-subscribed").classList.remove("hidden"),document.querySelectorAll("button[data-newsletter-trigger]").forEach(g=>g.classList.add("hidden")),e(!0))};return a("div",{class:"w-full max-w-[500px]",children:[a("img",{alt:"newsletter_image",class:"w-full object-fill",loading:"lazy",src:r}),a("section",{class:"w-full rounded-bl rounded-br-[3rem] bg-white",children:a("div",{class:"px-16 py-8 xs:px-8 xs:py-4",children:[a("div",{class:"mb-8 xs:mb-4",children:[a("h2",{class:"m-0 mb-3 p-0 text-center text-2xl font-bold text-black xs:text-lg",children:window.SlrsIdentify?.accepts_marketing?s("marketing.newsletter.popup.register.header_existing"):s("marketing.newsletter.popup.register.header_new")}),a("p",{class:"m-0 p-0 px-12 text-center text-gray-500 xs:px-2 xs:text-sm",style:{fontSize:"17px"},children:s("marketing.newsletter.popup.register.content")})]}),a("form",{onSubmit:l,children:[a("fieldset",{class:"mb-8 flex flex-col gap-3",children:[a("div",{children:a("label",{class:"filter__checkbox",style:{fontSize:"17px"},children:[s("marketing.newsletter.popup.register.options.newsletter"),a("input",{name:"interests",type:"checkbox",value:"Newsletter"}),a("span",{class:"checkmark"})]})}),a("div",{children:a("label",{class:"filter__checkbox",style:{fontSize:"17px"},children:[s("marketing.newsletter.popup.register.options.10for10"),a("input",{name:"interests",type:"checkbox",value:"10for10"}),a("span",{class:"checkmark"})]})})]}),o&&a("p",{class:"m-0 mb-2 p-0 text-center text-red-500 xs:px-4",style:{fontSize:"13px"},children:o}),a("button",{disabled:n,type:"submit",class:`grid w-full place-items-center ${n?"bg-gray-300":"bg-[#EE404E]"} 2 h-[50px] max-h-[50px] rounded-[4px] font-medium text-white xs:max-h-[40px]`,children:s("marketing.newsletter.popup.register.button")}),a("p",{class:"m-0 mt-2 p-0 text-center text-gray-500 xs:px-4",style:{fontSize:"13px"},children:s("marketing.newsletter.popup.register.footer")})]})]})})]})}function ye({image:r,closeModal:e}){const t=H(),{t:s}=j("getLocale",t);return a("div",{class:"w-full max-w-[500px]",children:[a("img",{alt:"newsletter_image",class:"w-full object-fill",loading:"lazy",src:r}),a("section",{class:"w-fill rounded-bl rounded-br-[3rem] bg-white",children:a("div",{class:"px-16 py-8 xs:px-8 xs:py-4",children:[a("div",{class:"grid place-items-center",children:a("svg",{class:"h-[40px] w-[40px] xs:h-[32px] xs:w-[32px] sm:h-[36px] sm:w-[36px]",fill:"none",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg",children:[a("path",{d:"M35.8333 30L24.7619 20M15.2381 20L4.16672 30M3.33333 11.6667L16.9415 21.1924C18.0435 21.9638 18.5945 22.3495 19.1938 22.4989C19.7232 22.6308 20.2768 22.6308 20.8062 22.4989C21.4055 22.3495 21.9565 21.9638 23.0585 21.1924L26.4605 18.811M22.5 6.66667H11.3333C8.53307 6.66667 7.13293 6.66667 6.06338 7.21164C5.12257 7.69101 4.35766 8.45591 3.8783 9.39672C3.33333 10.4663 3.33333 11.8664 3.33333 14.6667V25.3333C3.33333 28.1336 3.33333 29.5337 3.8783 30.6033C4.35766 31.5441 5.12257 32.309 6.06338 32.7884C7.13293 33.3333 8.53307 33.3333 11.3333 33.3333H28.6667C31.4669 33.3333 32.8671 33.3333 33.9366 32.7884C34.8774 32.309 35.6423 31.5441 36.1217 3
20.6033C36.6667 29.5337 36.6667 28.1336 36.6667 25.3333V21.1924",opacity:"0.26",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5"}),a("path",{d:"M36.8683 6.46447C38.8209 8.41709 38.8209 11.5829 36.8683 13.5355C34.9156 15.4882 31.7498 15.4882 29.7972 13.5355C27.8446 11.5829 27.8446 8.41709 29.7972 6.46447C31.7498 4.51184 34.9156 4.51184 36.8683 6.46447Z",stroke:"#EE404E","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5"})]})}),a("div",{class:"mb-6",children:[a("h2",{class:"m-0 mb-3 mt-2 p-0 text-center text-2xl font-bold text-black xs:text-lg",children:s("marketing.newsletter.popup.success.header")}),a("p",{class:"m-0 p-0 px-2 text-center text-gray-500 xs:text-sm",style:{fontSize:"17px"},children:window.SlrsIdentify?.accepts_marketing?s("marketing.newsletter.popup.success.content_already_subscribed"):s("marketing.newsletter.popup.success.content_just_subscribed")})]}),a("button",{class:"grid h-[50px] max-h-[50px] w-full place-items-center rounded-[4px] bg-[#EE404E] font-medium text-white xs:max-h-[40px]",style:{fontSize:"17px"},onClick:e,children:s("marketing.newsletter.popup.success.button")})]})})]})}const we=()=>{const{images:r}=JSON.parse(document.querySelector("#getImages").textContent);return r};function Se(){const[r,e]=k(!1),t=F(we,[]),s=Q(null);J(()=>{ge(s.current)},[s]);const n=A(()=>{s.current.close()},[s]),i=A(()=>{localStorage.setItem("newsletter-dismissed",Date.now()),e(!1)},[]);return a("dialog",{ref:s,class:"m-0 grid h-screen max-h-[unset] w-screen max-w-[unset] place-items-center bg-transparent p-0",id:"newsletter-modal",style:{overflow:"clip",backdropFilter:"blur(2px)",backgroundColor:"rgba(246, 249, 252, 0.5)"},onClose:i,children:a("div",{class:"relative m-4 sm:mb-16",id:"modal-content",children:[a("button",{class:"absolute grid size-9 place-items-center rounded-full bg-gray-400 sm:bottom-[-48px] sm:right-[calc(50%-18px)] md:right-0 md:top-[9%]",onClick:n,children:a("svg",{fill:"none",height:"14",viewBox:"0 0 14 14",width:"14",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M13 1L1 13M1 1L13 13",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})})}),r?a(ye,{closeModal:n,image:t.newsletter_success}):a(fe,{image:t.newsletter_register,setSubscribed:e})]})})}P(()=>{const r=document.querySelector("#newsletter-modal"),e=document.querySelectorAll("button[data-newsletter-trigger]"),s=new URLSearchParams(window.location.search).get("open_newsletter_signup");e&&e.forEach(n=>{n.addEventListener("click",()=>{r.showModal()})}),window.addEventListener("click",n=>{n.target===r&&r.close()}),s&&!window.SlrsIdentify?.accepts_marketing&&!window.SlrsIdentify?.accepts_marketing&&r.showModal()});B(a(Se,{}),document.querySelector("body"));const be=()=>{const r=new URLSearchParams(window.location.search);return Object.fromEntries(r)},ve=r=>r&&r.length>0,Ce=G({windowTitle({query:r}){return ve(r)?`${r?`Results for "${r}"`:"Search"} â Solaris Japan`:window.baseTitle},createURL({qsModule:r,routeState:e}){const t=U(),s={};if(e.query&&(s.query=encodeURIComponent(e.query)),e.category&&(s.category=encodeURIComponent(e.category)),e.preOrder==="true"&&(s.preOrder=!0),e.page&&e.page>1&&(s.page=e.page),e.aff&&(s.aff=e.aff),Object.keys(s).length===0)return`${t}search`;const n=r.stringify(s,{addQueryPrefix:!0,arrayFormat:"repeat"});return`${t}search/${n}`},parseURL({qsModule:r,location:e}){const{aff:t,query:s="",category:n="",preOrder:i,page:o}=r.parse(e.search.slice(1));return{aff:t,query:decodeURIComponent(s),category:decodeURIComponent(n),preOrder:i,page:o}}}),xe={stateToRoute(r){const e=r[b]||{},{aff:t}=be();return{aff:t,query:e.query,category:e.hierarchicalMenu?.["sub_categories.lvl0"]?.[0],preOrder:e.refinementList?.is_preorder?.[0],page:e.page}},routeToState(r){const e=r.category?{"sub_categories.lvl0":[r.category]}:{},t=r.preOrder?{is_preorder:[r.preOrder]}:{};return{[b]:{query:r.query,page:r.page,hierarchicalMenu:e,refinementList:t}}}},_e={router:Ce,stateMapping:xe},Ee=r=>r.stock.toLowerCase()==="out of stock"||r.variants.every(({price:e})=>Number(e)===0),ke=(r,{html:e})=>{const t=Ee(r),s=JSON.parse(document.getElementById("getLocale").textContent),n=t?e`
3 <div class="product-overlay sold-out backdrop-opacity-10 bg-white/40"> 4 <span class="sold-out__content -rotate-12 pb-24 text-xl font-bold uppercase tracking-wider"> 5 ${s.products.sold_out} 6 </span> 7 </div> 8 `:e``,i=z(r.shopify_product_data)?e` 9 <nsfw-overlay class="product-overlay nsfw"> 10 <div class="flex flex-col items-center pb-24 font-semibold"> 11 <div class="text-5xl tracking-wider">${s.products.nsfw.title}</div> 12 13 <button class="text-sm font-bold uppercase" type="button">${s.products.nsfw.text}</button> 14 </div> 15 </nsfw-overlay> 16 `:e``;return e` 17 <div 18 class="product__item${t?" product__item--sold-out":""} hover:shadow-lg" 19 data-render="search-product" 20 data-shopify-id="${r.shopify_id}" 21 > 22 <a 23 id="product-${r.shopify_id}" 24 class="product-link" 25 href="${U()}products/${r.shopify_handle}?oid=${r.objectID}&qid=${r.__queryID}&qpos=${r.__position}" 26 aria-label="${r.name_en}" 27 > 28 ${i} ${n} 29 30 <div class="flex h-full flex-col items-center justify-between"> 31 <img 32 class="h-60 object-contain" 33 loading="lazy" 34 src=${S(r.image,"480x480")} 35 srcset=" 36 ${S(r.image,"600x600")} 1.5x, 37 ${S(r.image,"1024x1024")} 2.5x, 38 ${S(r.image,"1024x1024")} 3x 39 " 40 alt=${encodeURIComponent(r.name_en)} 41 /> 42 43 <div class="product-information flex w-full flex-col sm:p-2 sm:pt-0"> 44 <h3 class="title mx-0 my-4 text-base font-normal text-black">${r.name_en}</h3> 45 46 <div class="product__labels-wrapper w-full" data-component="ProductVariants"> 47 <div class="product-label product-label--placeholder"></div> 48 </div> 49 </div> 50 </div> 51 </a> 52 </div> 53 `},D=r=>` 54 <label class="filter__checkbox"> 55 ${r.label} 56 <input type="checkbox" value="${r.isRefined?"on":"off"}" ${r.isRefined?" checked":""} /> 57 <span class="checkmark"></span> 58 </label> 59 `,qe=(r,{html:e})=>e` 60 <a class="${r.cssClasses.link}" href="${r.url}"> 61 <span class="${r.cssClasses.label}">${r.label}</span> 62 <span class="${r.cssClasses.count}"> ${r.count.toLocaleString()} </span> 63 </a> 64 `,d={HEADER:"header.site-header",SEARCH_INPUT:".search-query",SEARCH_CLOSE:".search-close",SEARCH_FILTERS:"#SearchContainer .search-results__filter",SEARCH_FILTERS_BTN:"#SearchContainer .search-filters__button > button",MOBILE:{CONTAINER:".mobile-navbar",SEARCH_BTN:'li[data-open-search="mobile"]'}},N={sortBy:["isRefined","count:desc"],limit:5,showMore:!0,showMoreLimit:50,templates:{item:D},cssClasses:{showMore:"text-gradient"}},Le=(r,e)=>{Currency.customConvertAll(),(document.querySelector(".money").dataset.currency!==void 0||e>=5)&&clearInterval(r)},Pe=async()=>{const r=document.getElementById("search-results");if(!r)return;const e=Array.from(r.querySelectorAll('[data-render="search-product"]'));if(e.length===0)return;const t=e.map(s=>`gid://shopify/Product/${s.dataset.shopifyId}`);try{const s=await ae(ce,{ids:t});let{data:{nodes:n}}=await s.json();n=n.filter(o=>o),e.forEach(o=>{const c=`gid://shopify/Product/${o.dataset.shopifyId}`,l=n.find(({id:u})=>u===c);l&&B(a(le,{product:l}),o.querySelector('[data-component="ProductVariants"]'))});let i=0;if(Currency){const o=setInterval(()=>{Le(o,i+=1)},50)}}catch(s){console.error(s)}},Ie=()=>window.SlrsIdentify!==void 0?"account":"guest";class y{constructor(){window.ALGOLIA_INDEX=b,this.firstRender=!0,this.location={href:window.location.href,pathname:window.location.pathname},P(()=>{const e=new URLSearchParams(window.location.search).has("q");if(window.__searchTrigger?.fire||window.location.pathname.includes("/search")&&!window.location.search.includes("type=article")&&!e){if(this.attachListeners({page:"search"}),window.__searchTrigger?.options){const t=setInterval(()=>{try{if(this.search){const{options:{facets:s}}=window.__searchTrigger;s&&s.forEach(([n,i])=>{this.search.helper.toggleFacetRefinement(n,i)}),this.search.helper.search(),clearInterval(t)}}catch(s){console.error(s),clearInterval(t)}},100)}if(window.location.hash){const t=new URLSearchParams(window.location.hash.substring(1));if(t.has("q")){const s=setInterval(()=>{try{this.search&&(this.search.helper.setQuery(t.get("q")).search(),clearInterval(s))}catch(n){console.error(n),clearInterval(s)}},100)}}if(this.toggleSearch(!0),!y.isMobile())try{document.querySelector(d.SEARCH_INPUT).focus(),document.querySelector(d.SEARCH_CLOSE).style.display="none"}catch(t){console.warn("Can NOT load properly setup search: missing elment
64(s)"),console.error(t)}}else this.attachListeners()})}static isMobile(){return window.innerWidth<751}toggleSearch(e){const t=document.querySelector(".is-searching");e?(t||document.querySelector("body").classList.add("is-searching"),this.firstRender?(this.renderUI(),this.firstRender=!1):document.querySelectorAll(d.SEARCH_INPUT).forEach(s=>{s.value=this.search.helper.state.query})):t&&document.querySelector("body").classList.remove("is-searching")}static renderSearchBox(e,t){const{query:s,refine:n}=e;document.querySelectorAll(d.SEARCH_INPUT).forEach(i=>{t&&(i.value=s,i.addEventListener("input",o=>{n(o.target.value)}))})}renderUI(){const e=W(oe,ie);this.search=K({searchClient:e,indexName:b,routing:_e,insights:{insightsClient:null,onEvent:n=>{if(!window.Shopify||!window.Shopify.analytics)return;const{eventType:i,insightsMethod:o,payload:c,hits:l}=n;i!=="view"||o!=="viewedObjectIDs"||!l||l.length===0||window.Shopify.analytics.publish("algolia_hits_viewed",{hits:c.objectIDs,queryID:l[0]?.__queryID})}}}),window.search=this.search;let t;const s=Y(y.renderSearchBox);this.search.addWidgets([X({hitsPerPage:96,ruleContexts:[Ie()]}),s({queryHook(n,i){clearTimeout(t),t=setTimeout(()=>{i(n)},500)}}),Z({container:"#search-results",cssClasses:{root:"collection__products",list:"collection__products-wrapper"},templates:{item:ke,empty:(n,{html:i})=>i`<img 65 src="https://cdn.shopify.com/s/files/1/0318/2649/t/11/assets/no-results.svg?v=189511243498056529" 66 />`}}),ee({container:document.querySelector("#filter-category"),attributes:["sub_categories.lvl0","sub_categories.lvl1","sub_categories.lvl2"],sortBy:["name:asc"],limit:30,showMoreLimit:50,showMore:!0,templates:{item:qe}}),C({container:"#filter-release-status",attribute:"is_preorder",sortBy:["name:asc"],templates:{item:D},transformItems:n=>n.map(i=>({...i,label:i.label==="false"?"Released":"Pre-Order",highlighted:i.highlighted==="false"?"Released":"Pre-Order"}))}),C({...N,container:"#filter-character",attribute:"named_tags.character",searchable:!0,searchableIsAlwaysActive:!1}),C({...N,container:"#filter-franchise",attribute:"named_tags.franchise",searchable:!0,searchableIsAlwaysActive:!1}),te({container:"#refinement-list",cssClasses:{list:"filter__tags"},transformItems:n=>n.map(i=>{if(i.label==="is_preorder"){const o=i.refinements.map(c=>Object.assign(c,{label:c.label==="false"?"Released":"Preorder"}));return Object.assign(i,{refinements:o})}return i})}),se({container:"#clear-refinements",templates:{resetLabel({hasRefinements:n},{html:i}){return i`<span class="p-2">${n?"Clear refinements":"No refinements"}</span>`}}}),re({container:"#search-pagination",padding:2,showFirst:!1,showLast:!1,cssClasses:{list:"pagination",item:"pagination__item",selectedItem:"pagination__item--selected",disabledItem:"pagination__item--disabled",previousPageItem:"pagination__item--prev",nextPageItem:"pagination__item--next"}})]),this.search.start(),this.search.on("render",de(Pe,500)),this.search.helper.on("change",n=>{const i=document.querySelector(".gradient-border.filter-list");Object.values(n.state.disjunctiveFacetsRefinements).flat().length>0?i.style.display=null:i.style.display="none"})}attachListeners({page:e}={page:""}){document.querySelector(d.MOBILE.SEARCH_BTN).addEventListener("click",t=>{t.preventDefault(),this.toggleSearch(!0);const s=document.querySelector(`${d.MOBILE.CONTAINER} ${d.SEARCH_INPUT}`);s&&s.focus()}),document.querySelector(`.header-content ${d.SEARCH_INPUT}`).addEventListener("focus",()=>{this.toggleSearch(!0)}),document.querySelectorAll(d.SEARCH_INPUT).forEach(t=>{t.addEventListener("keyup",s=>{s.key==="Escape"&&(s.target.blur(),e!=="search"&&(s.target.value="",this.toggleSearch(!1),window.history.pushState({},"",this.location.pathname)))}),t.addEventListener("keydown",s=>{s.key==="Enter"&&s.preventDefault()})}),document.querySelectorAll(d.SEARCH_CLOSE).forEach(t=>{t.addEventListener("click",()=>{e!=="search"?(this.toggleSearch(!1),window.history.pushState({},"",this.location.pathname)):y.isMobile()&&window.location.replace(`${window.location.origin}`),document.querySelectorAll(d.SEARCH_INPUT).forEach(s=>{s.value=""})})}),document.querySelector(d.SEARCH_FILTERS_BTN).addEventListener("click",()=>{document.querySelector(d.SEARCH_FILTERS).classList.toggle("active")})}}new y;
66class p extends EventTarget{constructor(e){super(),this.changes={},this.init(e)}init(e){this.setCart(e)}setCart(e){this.total=e.original_total_price+this.totalChanges()-window.SolarisCart.protectionsTotalCost(),this.updateCurrencies()}getChange(e){return this.changes[e]||0}change(e){e&&!Number.isNaN(e)&&(this.total+=e,this.updateCurrencies())}changeBy(e,t){t&&!Number.isNaN(t)&&(this.changes[e]=(this.changes[e]||0)+t,this.change(t))}clearChangesByKey(e){this.changes[e]&&(this.change(-this.changes[e]),delete this.changes[e])}subtractChange(e,t){return this.changes[e]?t-this.changes[e]:t}totalChanges(){return Object.values(this.changes).reduce((e,t)=>e+t,0)}updateCurrencies(){const e=window.location.pathname;document.querySelectorAll(".cart__subtotal .money").forEach(t=>{p.updateElement(t,this.total)}),e.includes("/cart")&&EasyPoints?.Register&&(document.querySelectorAll('[data-loyal-target="total_price"]').forEach(t=>{t.setAttribute("data-loyal-total-price",this.total)}),document.querySelectorAll('[data-loyal-target="total-points-value"]').forEach(t=>{t.setAttribute("data-loyal-currency-cost",this.subtractChange("shippingProtection",this.total))}),EasyPoints.Points.insertTotalPoints(document)),this.dispatchEvent(new CustomEvent("update-cart",{detail:{total:this.total}}))}static updateElement(e,t){const{attributes:s}=e;for(let c=0;c<s.length;c+=1){const l=s[c];if(l.nodeName.includes("data-currency-")){const u=l.nodeName.substring(14).toUpperCase(),m=Currency.moneyFormats[u].money_format,f=Currency.convert(t,shopCurrency,u),h=Currency.formatMoney(f,m);e.setAttribute(`data-currency-${u.toLowerCase()}`,h)}}const n=Currency.currentCurrency,i=Currency.moneyFormats[n].money_format,o=Currency.convert(t,shopCurrency,n);e.innerHTML=Currency.formatMoney(o,i)}}class I extends EventTarget{constructor(){super(),this.initQtyController()}static updateCartCount(e){[...document.querySelectorAll(".cart-count-js")].forEach(t=>{t.innerText=e})}async setQtyValue(e,t,s=0){[...document.querySelectorAll(`.cart__qty-controller[data-item-key="${e}"] .cart__qty-input`)].forEach(n=>{n.value=t});try{const i=(await this.updateQuantity(e,t,s)).total_price-(window.SolarisCart?.protectionsTotalCost()??0);EasyPoints.Tiers.recalculate(i)}catch(n){console.warn(n.message)}}increaseQty(e,t){const s=parseInt(t.value,10);this.setQtyValue(e,s+1,s)}decreaseQty(e,t){if(t.value>1){const s=parseInt(t.value,10);this.setQtyValue(e,s-1,s)}}setLoadingCartItems(){const e=document.querySelector("[data-cart-items]");e.style.opacity="0.5"}initQtyController(){const e=document.querySelector("#CartForm");if(e){const t=[...e.querySelectorAll("[decrease-qty-controller]")],s=[...e.querySelectorAll("[increase-qty-controller]")],n=[...e.querySelectorAll("a[cart-delete-item]")],i=[...e.querySelectorAll(".cart__qty-input")];for(let o=0;o<i.length;o+=1){const c=i[o],{itemKey:l}=c.parentElement.dataset;t[o].onclick=()=>{this.decreaseQty(l,c)},s[o].onclick=()=>{this.increaseQty(l,c)},n[o].onclick=()=>{this.setLoadingCartItems()}}}}async updateQuantity(e,t,s){const o=await(await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,quantity:t})})).json();return I.updateCartCount(o.item_count-SolarisCart.protectionsItemsInCart()?.length),this.dispatchEvent(new CustomEvent("update-cart",{detail:{itemId:e,cart:o,change:t-s}})),o}}const q=()=>document.querySelector("#Checkout"),x=r=>{const e=q();if(!e)return;const t=e.querySelector("span");r?(e.setAttribute("disabled",""),t.innerText="",t.classList.add("loading-ellipsis")):(e.removeAttribute("disabled"),t.innerText="Check Out",t.classList.remove("loading-ellipsis"))};class Te{constructor(){this.promises={},this.status=null,this.attachEventToCheckoutBtn()}registerPromise(e,t){this.promises[e]=t}unregisterPromise(e){delete this.promises[e]}attachEventToCheckoutBtn(){const e=q();e&&e.addEventListener("click",t=>{if(this.status==="resolving")return t.preventDefault();if(this.status==="resolved"||!Object.keys(this.promises).length)return!0;t.preventDefault(),this.status="resolving",document.querySelector("body").style.cursor="progress",x(!0);const s=Object.values(this.promises).reduce((n,i)=>(n.push(i()),n),[]);return Promise.all(s).then(()=>{this.status="resolved",x(!1),q().click()}).catch(n=>{this.status=null,x(!1),ue(n)}).finally(()=>{document.querySelector("body").style.cursor=null})})}}const{currency:Ae}=window.Shopify,L=4825104252971,Re=Ae.active==="JPY"?5e4:400,Ne=async()=>{const r=await fetch("/products/SSP.json"),{product:e}=await r.json();return e},_=()=>document.querySelector(".shipping-protection .toggle-switch").classList.contains("checked");class Oe{constructor(e){this.cart=e,this.shippingProtectionProduct=null,this.suggestedVariant=null,this.variantPrice=0,this.setupListeners(),this.init()}setCart(e){this.cart=e,this.setSuggestedVariant()}setSuggestedVariant(){this.suggestedVariant=this.getSuggestedVariant(),this.variantPrice=Number(this.suggestedVariant.price)*100,this.modifyTotal(_())}
66async init(){this.shippingProtectionProduct=await Ne(),this.setSuggestedVariant(),window.SolarisCart.checkoutHandler.registerPromise("shippingProtection",()=>this.assureProtectionPromise()),this.setToggle(this.getProtectionSession()),document.querySelector(".shipping-protection").classList.toggle("loading")}getSuggestedVariant(){const e=this.totalWithoutServices()/100,s=2.5+Math.min(4.5,Math.floor(e/Re+.2)*.5);return this.shippingProtectionProduct.variants.find(n=>{const i=n.final_line_price||Number(n.price)*100,o=Math.ceil(i/s);return e<=o})}modifyTotal(e){const t=document.querySelector(".shipping-protection .description .money");p.updateElement(t,this.variantPrice);const s=window.SolarisCart.totalManipulator.changes?.shippingProtection;e&&(s===0||s!==this.variantPrice)?(s>0&&s!==this.variantPrice&&window.SolarisCart.totalManipulator.clearChangesByKey("shippingProtection"),window.SolarisCart.totalManipulator.changeBy("shippingProtection",this.variantPrice)):!e&&s===this.variantPrice&&window.SolarisCart.totalManipulator.changeBy("shippingProtection",-this.variantPrice)}setupListeners(){document.querySelector(".shipping-protection .toggle-switch").addEventListener("click",()=>{this.setToggle(!_())},{capture:!0})}setToggle(e){this.setProtectionSession(e);const t=document.querySelector(".shipping-protection .toggle-switch"),s=document.querySelector(".shipping-protection .shield");t&&(t.classList.toggle("checked",e),t.setAttribute("aria-checked",String(e))),s&&(s.classList.toggle("text-green-500",e),s.classList.toggle("text-current",!e)),this.modifyTotal(e)}assureProtectionPromise(){return new Promise((e,t)=>{Shopify.getCart(s=>{this.cart=s;const n=this.getSuggestedVariant(),i=s.items.reduce((o,c)=>c.product_id===L?{...o,[c.id]:0}:c.price===0?{...o,[c.id]:0}:o,{});_()&&(i[n.id]=1),fetch("/cart/update.js",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:i})}).then(e).catch(t)})})}setProtectionSession(e){const t={token:this.cart.token,value:e};sessionStorage.setItem("protection",JSON.stringify(t))}getProtectionSession(){const e=sessionStorage.getItem("protection");if(e){const t=JSON.parse(e);if(t&&t.token===this.cart.token)return t.value}return this.setProtectionSession(!0),!0}totalWithoutServices(){return this.cart.total_price-window.SolarisCart.protectionsTotalCost()}}function Me(){const e=` 67 <div> 68 <span class="label">${JSON.parse(document.getElementById("getLocale").textContent).cart.customs.estimate} </span> 69 <span class="float-right"> 70 <span class="estimated-import-fees-min"><span class="money"></span></span> 71 <span class="estimated-import-fees-tilde">~</span> 72 <span class="estimated-import-fees-max"><span class="money"></span></span> 73 </span> 74 </div> 75 `,t=document.querySelector(".cart-box .cart-box-inner:nth-child(3)");t.innerHTML+=e}function $e(r,e,t){const s=document.querySelector(".customs-invoice-value .money"),n=window.SolarisCart.cart.total_price-window.SolarisCart.protectionsTotalCost(),i=r/100,o=Math.round(n*i);p.updateElement(s,o);let c=0,l=.17,u=.25;e==="EU"?(c=2500,l=.17,u=.22):t==="CA"&&(c=2e3,l=.5);const m=document.querySelector(".estimated-import-fees-min"),f=document.querySelector(".estimated-import-fees-max"),h=document.querySelector(".estimated-import-fees-tilde"),w=m.querySelector(".money"),g=f.querySelector(".money");if(c>0&&o<c)h.style.display="none",m.style.display="none",p.updateElement(g,0);else{const v=o*l,V=o*u;h.style.display="inline",m.style.display="inline",p.updateElement(w,v),p.updateElement(g,V)}}function Be(r){const e=document.documentElement;r>66?e.style.setProperty("--track-color","var(--track-good)"):r>33?e.style.setProperty("--track-color","var(--track-warning)"):e.style.setProperty("--track-color","var(--track-danger)")}function He(r){document.querySelector(".checkout-disclaimer").dataset.value=r}function O(){return new Promise((r,e)=>{const t=document.querySelector(".checkout-disclaimer"),s=t.querySelector('input[type="checkbox"]');s.checked!==!0?(t.classList.add("error"),s.classList.add("ring","ring-red-500"),s.addEventListener("change",n=>{n.target.checked&&(t.classList.remove("error"),s.classList.remove("ring","ring-red-500"))},{once:!0}),e()):r()})}function E(r,e,t){Be(r),He(r),$e(r,e,t)}function je(r,e){const t=document.querySelector("#customs-invoice-shipping-cost"),s=document.querySelector("#customs-invoice-shipping-type"),n=document.querySelector("#customs_percentage"),i=n.value;window.SolarisCart.cart.attributes.mark_as_gift===void 0&&(window.SolarisCart.setAttribute("mark_as_gift",String(e!=="GB")),s.setAttribute("checked",e!=="GB"),s.checked=e!=="GB"),window.SolarisCart.cart.attributes.display_shipping_on_invoice===void 0&&window.SolarisCart.setAttribute("display_shipping_on_invoice",String(t.checked)),E(i,r,e),t.addEventListener("change",o=>{window.SolarisCart.setAttribute("display_shipping_on_invoice",String(o.target.checked));const c=document.querySelector("#shipping-cost-warning");c&&(c.style.display=o.target.checked?"block":"none")}),s.addEventListener("change",o=>{window.SolarisCart.setAttribute("mark_as_gift",String(o.target.checked))}),n.addEventListener("input",o=>{const{value:c}=o.target;Number.isNaN(c)||E(c,r,e)}),n.addEventListener("change",o=>{const{value:c}=o.target;Number.isNaN(c)||(E(c,r,e),window.SolarisCart.setAttribute("customs_invoice_percentage_value",String(c)))})}const Ue=async()=>{const{continent:r,country_code:e}=await $.get()||{};if(e===void 0||!document.querySelector(".invoice-settings")||r==="NA"&&!window.SlrsIdentify){window.SolarisCart.checkoutHandler.registerPromise("customsAgreement",()=>O());return}["RU","JP","US"].includes(e)||(document.querySelectorAll(".invoice-settings, .checkout-disclaimer__invoice-value, .customs-invoice-shipping-type-container").forEach(t=>t.classList.remove("hidden")),Me(),je(r,e)),["RU","JP"].includes(e)?document.querySelectorAll(".checkout-disclaimer").forEach(t=>t.classList.add("hidden")):window.SolarisCart.checkoutHandler.registerPromise("customsAgreement",()=>O())},De=()=>{document.querySelector("#customs_percentage").dispatchEvent(new Event("change"))},M={init:Ue,update:De},Ve=()=>{if(window.location.pathname.includes("/cart")){window.location.reload();return}
75const r=new URL(window.location.href).searchParams,e=r.get("qid"),t=r.get("oid");e&&t?window.location.href=`https://${R()}cart?oid=${t}&qid=${e}`:window.location.href=`https://${R()}cart`};let ze=class{constructor(){this.init()}init(){document.querySelectorAll("[data-open-mini-cart]").forEach(e=>{e.addEventListener("click",Ve)}),Shopify.getCart(e=>{this.cart=e,this.totalManipulator=new p(this.cart),this.quantityManipulator=new I(this.cart),window.location.pathname.includes("/cart")&&(this.checkoutHandler=new Te,this.shippingProtection=new Oe(this.cart),M.init()),this.quantityManipulator.addEventListener("update-cart",({detail:s})=>{this.cart=s.cart,this.totalManipulator.setCart(this.cart),this.shippingProtection&&(this.shippingProtection.setCart(this.cart),M.update())});const t=new CustomEvent("solariscart:initialized");document.dispatchEvent(t)})}supportedCurrencies(){return window.Currency.rates?Object.keys(window.Currency.rates):[...document.querySelectorAll('footer select[name="currencies"] option')].map(e=>e.value)}protectionsItemsInCart(){return this.cart.items.filter(e=>e.product_id===L)}protectionsTotalCost(){return this.cart.items.reduce((e,t)=>t.product_id===L?e+t.final_line_price:e,0)}async setAttribute(e,t){const s=Object.assign(this.cart.attributes||{},{[e]:t}),n=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:s})});return this.cart=await n.json(),this.cart}};function Fe(){const r=document.querySelector(".header-toolbar"),e=document.querySelector(".sticky-navbar__cart");document.body.scrollTop>r.offsetHeight||document.documentElement.scrollTop>r.offsetHeight?e.style.display="flex":e.style.display="none"}window.onscroll=()=>Fe();P(()=>{window.SolarisCart=new ze,$.get().then(({currency_code:r})=>{window.Currency.customSetCurrency(r)})});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.