"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[75],{337:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});const i={container:"ARXqDxZt",writeReviewTitle:"BYrMqN9b",field:"mX1RH16p",label:"kOxbIdDY",input:"MWf_zaBJ",textarea:"c4EbHpL4",rating:"qKa8P3SJ",star:"Cr3A6eGy",starSelected:"vRJsPzxd",submit:"dk6iJfOU",imagePreview:"XZ7E9B5A",statusContainer:"OlsGRGkU",thankYouTitle:"COGuffWk",thankYouMessage:"YHPG5NZb"}},7:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});const i={gallery:"utYziQAE",imageContainer:"u7hALhRV",image:"HRX192Oq",imageMessage:"C0mfa5lU",review:"jT_XY_1t",reviewHeader:"c37mM92e",title:"pfrMrpCr",author:"EcdUmPEh",truncated:"YcyRuLBB",expanded:"IomlcWA2",modal:"EQpOtFeT",fadeIn:"sVWQQ9or",fadeOut:"sZfxzYzK",modalInner:"Lg4GX5Y4",modalContent:"OpbIhP35",modalOverlay:"iZzCdFwp",modalHeader:"wek3E8S1",fullBleedImage:"i2zolDuA",slideUp:"u96mNKND",slideDown:"jAr2PKY3",closeButton:"MvI_gVPT",modalTextContent:"bihC0FqM",modalBodyText:"ksR2mAtx",loadMoreButton:"QklUYRZO",reviewsHeader:"KjJxq4iV"}},336:(e,t,a)=>{const i=a(90);(0,a(2).createEntrypoint)("pdp_reviews",i.Reviews)},15:(e,t)=>{function a(e){return 100*Math.round(e)!==Math.round(100*e)?e.toFixed(2):Math.round(e).toString()}Object.defineProperty(t,"__esModule",{value:!0}),t.REVIEWS_ENDPOINT=t.REVIEWS_PER_PAGE=void 0,t.formatPrice=function(e){return a("number"==typeof e?e:parseFloat(e))},t.REVIEWS_PER_PAGE=28,t.REVIEWS_ENDPOINT="https://shalom-development-worker-may-2024.digitaloptgroup.workers.dev"},91:function(e,t,a){var i=this&&this.__awaiter||function(e,t,a,i){return new(a||(a=Promise))((function(s,l){function n(e){try{d(i.next(e))}catch(e){l(e)}}function r(e){try{d(i.throw(e))}catch(e){l(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(n,r)}d((i=i.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReviewForm=function({productId:e,productName:t,productHandle:a,productType:s,productDescription:o,productImageUrl:c,productUrl:u,config:h}){const[f,p]=(0,n.useState)("ready"),[v,m]=(0,n.useState)({name:"",email:"",rating:0,title:"",review:"",images:[]});function g(e){const t=e.target;m(Object.assign(Object.assign({},v),{[t.name]:t.value}))}return"submitting"===f?(0,l.jsx)("div",{class:r.default.statusContainer,children:(0,l.jsx)("div",{class:r.default.thankYouTitle,children:"Submitting your review..."})}):"success"===f?(0,l.jsxs)("div",{class:r.default.statusContainer,children:[(0,l.jsx)("div",{class:r.default.thankYouTitle,children:"Thank you for submitting a review!"}),(0,l.jsx)("div",{class:r.default.thankYouMessage,children:"Your input is very much appreciated. Share it with your friends so they can enjoy it too!"})]}):(0,l.jsxs)("form",{class:r.default.container,onSubmit:function(l){return i(this,void 0,void 0,(function*(){var i;l.preventDefault(),p("submitting");const n=(null==c?void 0:c.startsWith("/fast-image"))?`${h.shopify_file_path}${c.split(null!==(i=h.fast_image_prefix)&&void 0!==i?i:"")[1]}`:c,r=new FormData;r.append("productId",e),r.append("author",v.name),r.append("email",v.email),r.append("location",""),r.append("reviewRating",v.rating.toString()),r.append("reviewTitle",v.title),r.append("reviewMessage",v.review),r.append("productName",t),r.append("productSKU",a),r.append("productType",s),r.append("productDescription",o),r.append("productImageUrl",null!=n?n:""),r.append("productUrl",u),r.append("reviewSource","widget");for(let e=0;e(0,l.jsx)("span",{class:[r.default.star,v.rating>=e?r.default.starSelected:""].join(" "),onClick:()=>{return t=e,void m(Object.assign(Object.assign({},v),{rating:t}));var t},children:v.rating>=e?"★":"☆"},e)))})]}),(0,l.jsxs)("div",{class:r.default.field,children:[(0,l.jsx)("label",{class:r.default.label,for:"title",children:"Title of Review"}),(0,l.jsx)("input",{class:r.default.input,type:"text",id:"title",name:"title",value:v.title,onChange:g,placeholder:"Give your review a title"})]}),(0,l.jsxs)("div",{class:r.default.field,children:[(0,l.jsx)("label",{class:r.default.label,for:"review",children:"How was your overall experience?"}),(0,l.jsx)("textarea",{class:r.default.textarea,id:"review",name:"review",value:v.review,onChange:g})]}),(0,l.jsxs)("div",{class:r.default.field,children:[(0,l.jsx)("label",{class:r.default.label,for:"images",children:"Add Photos"}),(0,l.jsx)("input",{class:r.default.input,type:"file",id:"images",name:"images",multiple:!0,onChange:function(e){const t=e.target;t.files&&m(Object.assign(Object.assign({},v),{images:[...v.images,...Array.from(t.files)]}))}}),(0,l.jsx)("div",{class:r.default.imagePreview,children:v.images.map(((e,t)=>(0,l.jsx)("img",{src:URL.createObjectURL(e),alt:`Preview ${t+1}`},t)))})]}),(0,l.jsx)("div",{class:r.default.submit,children:(0,l.jsx)("button",{class:d.default.loadMoreButton,type:"submit",children:"Submit"})})]})};const l=a(0),n=(a(1),a(3)),r=s(a(337)),d=s(a(7))},164:function(e,t,a){var i=this&&this.__awaiter||function(e,t,a,i){return new(a||(a=Promise))((function(s,l){function n(e){try{d(i.next(e))}catch(e){l(e)}}function r(e){try{d(i.throw(e))}catch(e){l(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(n,r)}d((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ListTracking=function({children:e,id:t,cacheKey:a}){const n=(0,l.useRef)(null),[d,o]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{const e=new IntersectionObserver((s=>i(this,[s],void 0,(function*([i]){if(null==i?void 0:i.isIntersecting){n.current&&e.unobserve(n.current);try{yield r(a,t,"trial")}catch(e){}}}))),{root:null,rootMargin:"0px",threshold:1});return n.current&&e.observe(n.current),()=>{n.current&&e.unobserve(n.current)}}),[]),(0,s.jsx)("div",{ref:n,onClick:()=>i(this,void 0,void 0,(function*(){try{d||(yield r(a,t,"success"),o(!0))}catch(e){}})),children:e})};const s=a(0),l=(a(1),a(3)),n=a(15);function r(e,t,a){return i(this,void 0,void 0,(function*(){const i=new URL(n.REVIEWS_ENDPOINT);i.pathname="/__list_engagement__",i.searchParams.set(a,"1"),i.searchParams.set("cacheKey",e),i.searchParams.set("__orly_aid","NA"),i.searchParams.set("itemId",null==t?void 0:t.toString()),yield fetch(i.toString(),{mode:"no-cors"})}))}},90:function(e,t,a){var i=this&&this.__awaiter||function(e,t,a,i){return new(a||(a=Promise))((function(s,l){function n(e){try{d(i.next(e))}catch(e){l(e)}}function r(e){try{d(i.throw(e))}catch(e){l(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(n,r)}d((i=i.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Reviews=function(e){var t,a;const s=e.useSharedState(),{product:p,config:v}=s((e=>({product:e.product,config:e.config})));if(!p)return(0,l.jsx)(n.Fragment,{});const m=p.handle,{reviewCount:g,reviewRating:x}=p,j=Object.values(p.imageMap).flat().map((({src:e})=>e)),[w,y]=(0,r.useState)(!1),[b,_]=(0,r.useState)(!(e.reviews.length{M(!0),window.matchMedia("(max-width: 600px)").matches||(E(null),I(!1)),setTimeout((()=>{E(null),I(!1),M(!1)}),300),document.body.style.overflow="auto"},B=e=>{e.target===e.currentTarget&&D()},W="Studio photo";return(0,l.jsxs)("div",{id:"reviews",class:d.default.reviewContainer,children:[(0,l.jsx)("h2",{class:"visually-hidden",children:"Product Reviews"}),g&&x?(0,l.jsxs)("div",{class:d.default.reviewsHeader,children:["★★★★★ ",g," Reviews | Avg Rating: ",x.toFixed(1)]}):(0,l.jsx)("div",{class:d.default.reviewsHeader,children:"Be the first to review this item"}),O&&(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)("div",{class:[d.default.modal,T?d.default.fadeOut:""].join(" "),onClick:B,onDblClick:D}),(0,l.jsx)("div",{class:d.default.modalInner,onClick:B,onDblClick:D,children:(0,l.jsxs)("div",{class:[d.default.modalContent,T?d.default.slideDown:""].join(" "),onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{class:d.default.modalHeader,children:(0,l.jsx)("button",{class:d.default.closeButton,onClick:D,children:"X"})}),(0,l.jsx)("div",{class:d.default.modalTextContent,children:(0,l.jsx)(f.ReviewForm,{productId:p.id,productName:p.title,productHandle:p.handle,productType:p.productType,productDescription:p.description,productImageUrl:null===(a=null===(t=p.variants[0])||void 0===t?void 0:t.image)||void 0===a?void 0:a.src,productUrl:`https://${v.hostname}/products/${p.handle}`,config:v})})]})})]}),(0,l.jsx)("button",{class:d.default.loadMoreButton,onClick:()=>{I(!0),document.body.style.overflow="hidden"},children:"Write a Review"}),(0,l.jsx)("div",{className:d.default.gallery,children:C.map(((e,t)=>{const a=(null==e?void 0:e.images[0])?`https://cdn.stamped.io/uploads/photos/${e.images[0]}`:j[t%j.length];return(0,l.jsx)(u.ListTracking,{id:e.id,cacheKey:e.cacheKey,children:(0,l.jsxs)("div",{onClick:()=>((e,t)=>{E(Object.assign(Object.assign({},e),{imgSrc:t})),document.body.style.overflow="hidden"})(e,a),class:d.default.reviewContainer,children:[(0,l.jsxs)("div",{class:d.default.imageContainer,children:[(0,l.jsx)(h.LazyImage,{src:a,initialWidth:400,cssClass:d.default.image,alt:e.author,fullSizeWidth:600,width:200,height:200}),!(null==e?void 0:e.images[0])&&(0,l.jsx)("div",{class:d.default.imageMessage,children:W})]}),(0,l.jsxs)("div",{class:d.default.review,children:[(0,l.jsxs)("div",{class:d.default.reviewHeader,children:[(0,l.jsx)("h3",{class:d.default.title,children:e.title}),(0,l.jsx)("cite",{class:d.default.author,children:e.author}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{children:"✅ Verified Buyer | "}),(0,l.jsx)("span",{children:e.dateCreated})]}),(0,l.jsx)("span",{class:d.default.stars,role:"img","aria-label":"5 out of 5 stars",children:(0,l.jsx)("span",{"aria-hidden":"true",children:"★★★★★"})})]}),(0,l.jsx)("p",{class:d.default.truncated,children:e.body})]})]},e.title)})}))}),(T||P)&&(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)("div",{class:[d.default.modal,T?d.default.fadeOut:""].join(" "),onClick:B,onDblClick:D}),P&&(0,l.jsx)("div",{class:d.default.modalInner,onClick:B,onDblClick:D,children:(0,l.jsxs)("div",{class:[d.default.modalContent,T?d.default.slideDown:""].join(" "),onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)("div",{class:d.default.modalHeader,children:[(0,l.jsx)(h.LazyImage,{src:P.imgSrc,initialWidth:400,cssClass:d.default.fullBleedImage,alt:P.author,fullSizeWidth:600,width:200,height:200}),!(null==P?void 0:P.images[0])&&(0,l.jsx)("div",{class:d.default.imageMessage,children:W}),(0,l.jsx)("button",{class:d.default.closeButton,onClick:D,children:"X"})]}),(0,l.jsxs)("div",{class:d.default.modalTextContent,children:[(0,l.jsxs)("div",{class:d.default.reviewHeader,children:[(0,l.jsx)("h3",{class:d.default.title,children:P.title}),(0,l.jsx)("cite",{class:d.default.author,children:P.author}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{children:"✅ Verified Buyer | "}),(0,l.jsx)("span",{children:P.dateCreated})]}),(0,l.jsx)("span",{class:d.default.stars,role:"img","aria-label":"5 out of 5 stars",children:(0,l.jsx)("span",{"aria-hidden":"true",children:"★★★★★"})})]}),(0,l.jsx)("p",{class:d.default.modalBodyText,children:P.body})]})]})})]}),b&&(0,l.jsx)("button",{class:d.default.loadMoreButton,onClick:()=>i(this,void 0,void 0,(function*(){y(!0);const e=yield(0,o.getLazyState)("reviewsLazy",{productHandle:m,page:S+1});y(!1),(null!=e?e:[]).length{e.O(0,[1,2,3],(()=>e(e.s=336))),e.O()}]);