"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[15],{29:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});const a={cartInnerContent:"zUHyhS7e",cartHeader:"mhTDcJGU",drawerIcon:"f7qg_6Ph",discountCode:"Nt7jVoS4",cartItem:"wbxy_pLs",bundleItem:"eSlV2_JO",useSoloImages:"PpDx3vJ3",bundleComponentItem:"N9hw_dkZ",bundleComponentItemTitles:"D_6tJjGJ",linkReset:"pcHAsSdP",imageContainer:"fgz6BQ0S",image:"drLadhZV",details:"Q7XwhEzW",type:"E5Ruk7Se",bundleComponentItemsContainer:"ld_iStQN",bundleItemsHeader:"LcBBK1qM",bundleItemOptions:"dDK_oDau",product_title:"Q5x9NgcR",priceContainer:"pB0j74U_",originalPrice:"zddHL7YI",price:"QCO8XfMc",sizeSelector:"Snibh8YF",quantityContainer:"glwAfW_z",removeButton:"ZVfP_rFJ",wishListButton:"cSlEtpOt",quantitySelector:"BeVzPaRA",quantityButton:"RyV2qSnH",quantityInput:"JaPNtHML",cartUpdatingOverlay:"mvsQ5c0M",spinner:"r7ae6q0j",spin:"rMRBoxoX",shippingProgressContainer:"viuhVwt3",progressBar:"WFaAFy1n",shippingProgressInfo:"TE8fZl0m",properties:"L4Qayi5G",isBundleComponent:"rju1SvBi"}},106:(t,e,n)=>{const a=n(107);(0,n(2).createEntrypoint)("cart_items",a.CartContainer)},5:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatPrice=e.DEFAULT_BUNDLE_IMAGE=e.SHOPIFY_FILE_PATH=e.VALID_STORE_OPTIONS=e.EXCLUDE_TAGS=e.REVIEWS_ENDPOINT=e.REVIEWS_PER_PAGE=e.PRODUCT_IMAGE_WIDTH=e.PRODUCT_IMAGE_HEIGHT=e.PROJECT_HOSTNAME=void 0,e.PROJECT_HOSTNAME="comfrt.com",e.PRODUCT_IMAGE_HEIGHT=1600,e.PRODUCT_IMAGE_WIDTH=1200,e.REVIEWS_PER_PAGE=28,e.REVIEWS_ENDPOINT="https://shalom-development-worker-may-2024.digitaloptgroup.workers.dev",e.EXCLUDE_TAGS=["add","Extra Comfy"],e.VALID_STORE_OPTIONS=["Size","Color"],e.SHOPIFY_FILE_PATH="https://cdn.shopify.com/s/files/1/0569/4029/8284",e.DEFAULT_BUNDLE_IMAGE="https://cdn.shopify.com/s/files/1/0569/4029/8284/files/D_1_08856425-31e4-48ba-a71f-d8c06ce730ad.png?v=1655843751",e.formatPrice=function(t){return parseInt(t)}},108:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Cart=void 0;const a=n(0),s=n(1),i=n(42);e.Cart=function({cart:t,pathname:e,selectedVariant:n,flags:r,cartStatus:o,changeCart:l,showRouteInCart:c}){var d;return(0,a.jsxs)(s.Fragment,{children:[null===(d=null==t?void 0:t.items)||void 0===d?void 0:d.filter((t=>{var e,n;return"undefined"!=typeof window&&"Route"===t.vendor&&(null===(e=document.getElementById("cart-toggle"))||void 0===e?void 0:e.checked)&&(null===(n=window.__APP_CONFIG__)||void 0===n?void 0:n.postExposure)&&window.__APP_CONFIG__.postExposure("exposedCartShowRoute",c?"enabled":"disabled"),!!c||"Route"!==t.vendor})).map(((t,s)=>(0,a.jsx)(i.CartItem,Object.assign({},t,{cartItemkKey:t.key,selectedVariantId:null==n?void 0:n.id,pathname:e,line:s+1,flags:r,cartStatus:o,changeCart:l})))),(0,a.jsx)("div",{style:"height: 230px;"})]})}},107:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CartContainer=void 0;const a=n(0),s=(n(1),n(3)),i=n(108);e.CartContainer=function(t){var e,n,r,o;const l=t.useSharedState()((t=>({selectedVariant:t.selectedVariant,pathname:t.pathname,refreshCart:t.refreshCart,changeCart:t.changeCart,cartStatus:t.cartStatus,cartTotal:t.cartTotal,freeShippingThreshold:t.freeShippingThreshold,cart:t.cart})));(0,s.useEffect)((()=>{(null==l?void 0:l.cart)||l.refreshCart()}),[]);const c=null!==(e=l.cart)&&void 0!==e?e:t.cart,d=null!==(n=l.cartTotal)&&void 0!==n?n:(null!==(o=null===(r=t.cart)||void 0===r?void 0:r.total_price)&&void 0!==o?o:0)/100;return(0,a.jsx)(i.Cart,Object.assign({},l,{cart:c,cartTotal:d,showRouteInCart:t.showRouteInCart,flags:{moveToWishList:"disabled"}}))}},42:function(t,e,n){var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CartItem=void 0;const s=n(0),i=n(1),r=n(5),o=n(109),l=a(n(29)),c=n(110),d=n(2);function u(t){var e,n,a;const{image:r,featured_image:c,product_title:d,title:u,quantity:_,options_with_values:g,pathname:f,selectedVariantId:j,line:v,cartItemkKey:C,flags:I,cartStatus:O,changeCart:b,original_price:y,discounted_price:x,properties:E,discounts:P,url:S,has_components:T,item_components:R}=t;if(!R||R.length<1)return(0,s.jsx)(i.Fragment,{});const w=R.sort((t=>{var e;return 1===parseInt(null!==(e=t.properties._bundleOrder)&&void 0!==e?e:"1")?-1:1})),A=null!==(e=w[0])&&void 0!==e?e:{},B=A.url,{_compareRetail:M,_compareSolo:D}=null!==(n=A.properties)&&void 0!==n?n:{},q=w.every((t=>t.properties._heroImage)),V=!!w.find((t=>t.properties.Shipping));return(0,s.jsxs)("div",Object.assign({class:[l.default.bundleItem,q?l.default.useSoloImages:""].join(" ")},{children:[(0,s.jsx)("div",Object.assign({class:l.default.imageContainer},{children:w.map((t=>{const e=q?t.properties._heroImage:t.image;return(0,s.jsx)("div",Object.assign({style:"padding-bottom: 6px;"},{children:(0,s.jsx)(p,{image:e,title:t.title,url:t.url})}))}))})),(0,s.jsxs)("div",Object.assign({class:l.default.details},{children:[(0,s.jsx)(h,Object.assign({},{options_with_values:g,product_title:u,original_price:null!==(a=parseInt(M))&&void 0!==a?a:y,discounted_price:x,properties:Object.assign(Object.assign({},V?{Preorder:"This bundle includes pre-order items"}:{}),E),discounts:A.discounts,url:B})),(0,s.jsx)("div",Object.assign({class:l.default.bundleComponentItemsContainer},{children:w.map((t=>(0,s.jsx)("div",Object.assign({class:l.default.bundleComponentItemTitles},{children:(0,s.jsxs)("a",Object.assign({href:t.url,class:l.default.linkReset},{children:[(0,s.jsxs)("div",{children:["1 x ",t.product_title]}),(0,s.jsx)("div",Object.assign({class:l.default.bundleItemOptions},{children:t.variant_title})),(0,s.jsx)(m,{properties:t.properties,isBundleComponent:!0})]}))}))))})),(0,s.jsxs)("div",Object.assign({class:l.default.quantityContainer},{children:[(0,s.jsx)("div",{}),(0,s.jsx)(o.QuantityButton,Object.assign({pathname:f,selectedVariantId:j,quantity:0,line:v,buttonClass:l.default.removeButton,cartStatus:O,lineItemKey:C,changeCart:b},{children:"Remove"}))]}))]}))]}),C)}function p({image:t,title:e,url:n,height:a,width:i}){return(0,s.jsx)("a",Object.assign({href:n,class:l.default.imageContainer},{children:(0,s.jsx)("img",{src:t,alt:e,class:l.default.image,height:null!=a?a:r.PRODUCT_IMAGE_HEIGHT,width:null!=i?i:r.PRODUCT_IMAGE_WIDTH})}))}function h({options_with_values:t,product_title:e,original_price:n,discounted_price:a,properties:i,discounts:r,url:o}){var d;return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",Object.assign({class:l.default.type},{children:e.includes("Route")?"Package Protection":t.map((({value:t})=>t)).join(" | ")})),(0,s.jsx)("a",Object.assign({href:o,class:l.default.product_title},{children:e})),(0,s.jsxs)("div",Object.assign({class:l.default.priceContainer},{children:[(0,s.jsxs)("p",Object.assign({class:l.default.price},{children:["$",(0,c.formatPrice)(a)]})),n>a&&(0,s.jsxs)("p",Object.assign({class:l.default.originalPrice},{children:["$",(0,c.formatPrice)(n)]})),r[0]&&(0,s.jsx)("p",Object.assign({class:l.default.discountCode},{children:null===(d=r[0])||void 0===d?void 0:d.title}))]})),(0,s.jsx)(m,{properties:i})]})}function m({properties:t,isBundleComponent:e}){return(0,s.jsx)(i.Fragment,{children:Object.entries(t).filter((([t])=>!t.startsWith("_"))).map((([t,n])=>(0,s.jsx)("div",Object.assign({class:[l.default.properties,e?l.default.isBundleComponent:""].join(" ")},{children:n}),t)))})}function _({cartStatus:t,pathname:e,selectedVariantId:n,quantity:a,line:i,changeCart:r,flags:c,has_components:d,cartItemkKey:u}){return(0,s.jsxs)("div",Object.assign({class:l.default.quantityContainer},{children:[(0,s.jsxs)("div",Object.assign({class:l.default.quantitySelector},{children:[!d&&(0,s.jsx)(o.QuantityButton,Object.assign({pathname:e,selectedVariantId:n,quantity:Math.max(a-1,0),line:i,buttonClass:l.default.quantityButton,cartStatus:t,lineItemKey:u,changeCart:r},{children:"-"})),(0,s.jsx)("input",{type:"text",class:l.default.quantityInput,value:a.toString(),readOnly:!0}),!d&&(0,s.jsx)(o.QuantityButton,Object.assign({pathname:e,selectedVariantId:n,quantity:a+1,line:i,buttonClass:l.default.quantityButton,cartStatus:t,lineItemKey:u,changeCart:r},{children:"+"}))]})),"enabled"===c.moveToWishList?(0,s.jsx)(g,{}):(0,s.jsx)(o.QuantityButton,Object.assign({pathname:e,selectedVariantId:n,quantity:0,line:i,buttonClass:l.default.removeButton,cartStatus:t,lineItemKey:u,changeCart:r},{children:"Remove"}))]}))}function g(){return(0,s.jsxs)("div",Object.assign({class:l.default.removeButton,style:"display: flex;"},{children:["Move to wish list ",(0,s.jsx)("div",{class:l.default.wishListButton})]}))}e.CartItem=function(t){var e;const{image:n,featured_image:a,product_title:i,title:r,quantity:o,options_with_values:c,pathname:m,selectedVariantId:g,line:f,cartItemkKey:j,flags:v,cartStatus:C,changeCart:I,original_price:O,discounted_price:b,properties:y,discounts:x,url:E,has_components:P,item_components:S}=t;if(S&&(null==S?void 0:S.length)>0)return(0,s.jsx)(u,Object.assign({},t));const{_compareAtPrice:T}=null!=y?y:{},R=T&&(null!==(e=(0,d.getAssignment)("showCompareAtPriceInCart"))&&void 0!==e?e:"default");return(0,s.jsxs)("div",Object.assign({class:l.default.cartItem},{children:[(0,s.jsx)(p,Object.assign({},{image:null!=n?n:a,title:r,url:E})),(0,s.jsxs)("div",Object.assign({class:l.default.details},{children:[(0,s.jsx)(h,Object.assign({},{options_with_values:c,product_title:i,original_price:"enabled"===R?100*parseFloat(T):O,discounted_price:b,properties:y,discounts:x,url:E})),(0,s.jsx)(_,Object.assign({},{quantity:o,pathname:m,selectedVariantId:g,line:f,cartItemkKey:j,flags:v,cartStatus:C,changeCart:I,has_components:P}))]}))]}),j)}},109:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QuantityButton=void 0;const a=n(0),s=(n(1),n(10)),i=n(28);e.QuantityButton=function({pathname:t,selectedVariantId:e,buttonClass:n,line:r,cartStatus:o,lineItemKey:l,changeCart:c,quantity:d,children:u}){return(0,a.jsxs)("form",Object.assign({action:`/cart/change?${(0,i.shopifyCartReturnTo)(t,e)}`,method:"post"},{children:[(0,a.jsx)("input",{type:"hidden",name:"quantity",value:d}),(0,a.jsx)("input",{type:"hidden",name:"line",value:r}),(0,a.jsx)("button",Object.assign({type:"submit",class:n,disabled:o.status===s.Status.updating,onClick:t=>{t.preventDefault(),c({id:l,quantity:d})}},{children:u}))]}))}},110:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatPrice=void 0,e.formatPrice=function(t,e=2){try{return(t/100).toFixed(e)}catch(t){console.error("Error formating price")}}},28:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shopifyCartReturnTo=e.resetNestedMenus=void 0;const a=n(5);e.resetNestedMenus=function(){document.querySelectorAll(".toggleCheckbox").forEach((t=>{t.checked=!1}))},e.shopifyCartReturnTo=function(t,e){const n=new URL(`https://${a.PROJECT_HOSTNAME}`);return n.pathname=t,n.searchParams.set("viewcart","true"),e&&n.searchParams.set("variant",e),`return_to=${encodeURIComponent(n.pathname+n.search)}`}}},t=>{t.O(0,[1,2,4,5,6,7,8],(()=>(106,t(t.s=106)))),t.O()}]);