PageSourceSearch

https://www.coversandall.com/_next/static/chunks/8121-e264527477ce30fe.js

js coversandall.com collected 2026-10-03 19:23:09 UTC 74,784 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8121],{952:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(95155),n=r(12115),s=r(32321);let l=(0,n.memo)(e=>{let{length:t,onVerifyOtp:r,containerClass:l,className:i,onOtpComplete:o,style:d}=e,[c,u]=(0,n.useState)(Array(t).fill("")),m=n.useRef([]),p=(0,n.useMemo)(()=>c.every(e=>e),[c]);return(0,n.useEffect)(()=>{o&&o(p)},[p]),(0,n.useEffect)(()=>{p&&r(c.join(""))},[p,c]),(0,a.jsx)("div",{className:(0,s.cn)("flex justify-between",l),children:c.map((e,r)=>(0,a.jsx)("input",{ref:e=>{m.current[r]=e},style:d,autoFocus:0===r,type:"text",inputMode:"numeric",maxLength:1,className:(0,s.cn)("border-primary h-10 w-full rounded border text-center text-xs focus:outline-none",{"border-gray-500":p},i),value:e,onChange:e=>((e,r)=>{if(!/^[0-9]?$/.test(e))return;let a=[...c];if(a[r]=e,u(a),e&&r<t-1){var n;null==(n=m.current[r+1])||n.focus()}})(e.target.value,r),onKeyDown:e=>{e.stopPropagation(),((e,t)=>{if("Backspace"===e.key&&!c[t]&&t>0){var r;null==(r=m.current[t-1])||r.focus()}})(e,r)},onPaste:e=>((e,r)=>{e.preventDefault();let a=e.clipboardData.getData("Text").replace(/\D/g,"").slice(0,t-r);if(!a)return;let n=[...c];a.split("").forEach((e,t)=>{var a;n[r+t]=e,null==(a=m.current[r+t+1])||a.focus()}),u(n)})(e,r)},r))})})},1293:(e,t,r)=>{r.d(t,{_:()=>a});var a=function(e){return e.USA="usa",e.EU="eu",e.CA="ca",e.UK="uk",e.AU="au",e}({})},2582:(e,t,r)=>{r.d(t,{Q:()=>i});var a=r(52963),n=r(6829),s=r(12115);let l={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},i=e=>{let t=(e=>{if(!e)return 1024;let t=e;try{t=decodeURIComponent(e)}catch(r){t=e}let r=t.toLowerCase();return/android|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(r)?375:1024})((0,n.Ri)(a.e.UserAgent)),[r,i]=(0,s.useState)(t);(0,s.useEffect)(()=>{let e,t=()=>i(window.innerWidth),r=()=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(t)};return t(),window.addEventListener("resize",r),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",r)}},[]);let o=r<l.md,d=r>=l.md&&r<l.lg,c=r>=l.lg,u=e&&l[e]?r>=l[e]:void 0;return{isMobile:o,isTablet:d,isDesktop:c,width:r,...e?{matches:u}:{}}}},5400:(e,t,r)=>{r.d(t,{A:()=>g});var a=r(95155),n=r(20063),s=r(12115),l=r(70104),i=r(52627),o=r(32321),d=r(83460),c=r(1293),u=r(89690),m=r(49322),p=r(15239);let f=e=>{let{COUNTRY_OPTIONS:t,selectedCountry:r,handleCountrySelectChange:n,selectClassName:l,isCustomCountryCodeEnabled:i=!1,cdnPath:d}=e,[c,u]=(0,s.useState)(!1),m=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let f=t.find(e=>e.country===r),g=f?(0,a.jsxs)("span",{className:"flex items-center gap-[4px]",children:[f.icon&&(0,a.jsx)(p.default,{width:20,height:15,src:"".concat(d).concat(f.icon),className:"aspect-3/2 rounded-[2px] object-cover",alt:f.label}),(0,a.jsx)("span",{className:"capitalize",children:f.value})]}):null;return(0,a.jsxs)("div",{className:"relative h-full w-full",ref:m,children:[(0,a.jsx)("div",{className:(0,o.cn)("flex w-full cursor-pointer items-center justify-between rounded bg-white p-2 text-sm ".concat("other"===r?"h-full border border-gray-500":""),{"border-gray-500":i,"border-white":!i},l),onClick:()=>u(e=>!e),children:g}),c&&(0,a.jsx)("ul",{className:"absolute top-full left-0 z-50 mt-1 max-h-48 w-full overflow-auto rounded border border-gray-300 bg-white shadow-md",children:t.map(e=>(0,a.jsx)("li",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 text-xs hover:bg-gray-100",onClick:()=>{n(e.country),u(!1)},children:(0,a.jsxs)("span",{className:"flex items-center uppercase",children:[e.icon&&(0,a.jsx)(p.default,{width:20,height:15,src:"".concat(d).concat(e.icon),className:"mr-2 aspect-3/2 rounded-[2px] object-cover",alt:e.label}),e.country]})},e.value+e.country))})]})},g=e=>{var t,r,p,g,h,x,v,y,w;let{countryCodeField:b,mobileField:_,register:S,watch:N,setValue:C,errors:E,containerClassName:j="",inputClassName:A="",errorClassName:I="",onInputChange:k,isRequired:P,label:T="",labelClassName:U,asteriskColor:O,countryClassName:G="",onFieldBlur:D,countrySelectClassName:R="",clearErrors:L,style:M,addressType:$}=e,W=(0,n.usePathname)(),B=(0,m.v)().label,F=(0,m.v)().cdnPath||"https://cdn.coversandall.com",z=N(b),V=N(_)||"",[Q,H]=(0,s.use
1State)(z||d.b.US),Y="other"===Q;(0,s.useEffect)(()=>{let e=N(b);(null==e||""===String(e).trim())&&((null==B?void 0:B.toLowerCase())===c._.USA?(H(d.b.US),C(b,d.b.US,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})):(null==B?void 0:B.toLowerCase())===c._.EU?(H("other"),C(b,"+43",{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})):(H((null==B?void 0:B.toLowerCase())||"+1"),C(b,null==B?void 0:B.toLowerCase(),{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})))},[B,b,C,N]),(0,s.useEffect)(()=>{if($&&z){var e,t;let r=null==(e=i.gH.find(e=>e.country===z))?void 0:e.country,a=null==(t=i.gH.find(e=>e.value===z))?void 0:t.country;r||a?H(r||a||"other"):H("other")}},[$,B,b,C,z]),(0,s.useEffect)(()=>{let e=V||"";(e=e.replace(/[^0-9]/g,"").trim())!==V&&C(_,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},[V,_,C]);let{onChange:q,...K}=S(_,{required:!!P&&"Phone number is required",validate:{validLengthByCountry:e=>{let t=e.trim();if(!t)return!0;let r=t.length;return r<5?"Phone number must be at least 5 digits long":!(r>12)||"Phone number cannot exceed ".concat(12," digits")}},onBlur:e=>{let t=e.target.value;null==D||D(_,t)}}),Z=S(b,{required:!!Y&&"Country code is required",validate:{onlyNumbersAfterPlus:e=>{if(Y&&e){let t=e.replace("+","");return/^[0-9]+$/.test(t)||'Only digits allowed after "+"'}return!0},maxLength:e=>"other"!==Q||!e||e.replace("+","").length<=3||"Custom country code cannot exceed 3 digits"}});return(0,a.jsxs)("div",{className:(0,o.cn)({"mb-4":E[_],"mb-0":!E[_]}),children:[(0,a.jsx)("input",{type:"hidden",...Z}),T&&(0,a.jsxs)(l.default,{element:"p",variant:"body-xs",className:(0,o.cn)("text-primary-900 mb-1",U),children:[T,P&&(0,a.jsx)(l.default,{element:"span",className:(0,o.cn)(O||"text-primary-900"),children:"*"})]}),(0,a.jsxs)("div",{className:(0,o.cn)("grid w-full grid-cols-[85px_auto_1fr] items-center gap-2 rounded-sm border border-gray-500 bg-white",{"border-red-500":(null==(t=E[_])?void 0:t.message)&&!Y,"border-transparent bg-white":Y},j),children:[(0,a.jsxs)("div",{className:"relative flex h-full cursor-pointer items-center justify-end",children:[(0,a.jsx)(f,{COUNTRY_OPTIONS:i.gH,selectedCountry:Q,cdnPath:F,handleCountrySelectChange:e=>{H(e),C(b,"other"!==e?e:(null==B?void 0:B.toLowerCase())===c._.EU?"+43":"",{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),"other"!==e&&L&&setTimeout(()=>{L(b)},100)},isCustomCountryCodeEnabled:Y,selectClassName:R||"text-black"}),(0,a.jsx)(u.b,{size:16,className:"pointer-events-none absolute z-0 mr-2"})]}),Y&&(0,a.jsx)("div",{className:(0,o.cn)("max-w-[102px]",G),children:(0,a.jsx)("input",{type:"text",placeholder:"Country Code",className:(0,o.cn)("placeholder:text-secondary-100 w-full rounded-sm border border-gray-500 bg-white p-2 text-sm focus:outline-none",{"border-red-500":null==(r=E[b])?void 0:r.message},A),value:"other"!==z&&z?z:(null==B?void 0:B.toLowerCase())===c._.EU?"+43":"",style:M,onChange:e=>{let t=e.target.value;(t=t.replace(/[^0-9+]/g,"")).startsWith("+")||(t="+".concat(t)),t.replace("+","").length>3||C(b,t,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}})}),(0,a.jsx)("div",{className:(0,o.cn)("relative flex gap-2",{"col-span-2":!Y}),children:(0,a.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"Phone Number",className:(0,o.cn)("placeholder:text-secondary-100 w-full rounded-sm border border-transparent bg-white p-2 text-sm focus:outline-none",{"border-gray-500":Y,"border-red-500":(null==(p=E[_])?void 0:p.message)&&Y,"pl-0":!Y},A),style:M,onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData("text").replace(/\D/g,"").trim();C(_,t.length>12?t.slice(0,12):t,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},value:V,onChange:e=>{let t=e.target.value.replace(/\D/g,"").trim(),r=t.length>12?t.slice(0,12):t;q(e),null==k||k(r),C(_,r,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},...K})})]}),Y&&"string"==typeof(null==(g=E[b])?void 0:g.message)?(0,a.jsx)("div",{className:"phone-error relative flex flex-1 gap-2",children:"/checkout"===W?(0,a.jsx)(l.default,{element:"span",variant:"body-xs",className:"mt-1 pt-0 text-red-600",children:null==(h=E[b])?void 0:h.message}):(0,a.jsx)(l.default,{element:"span",variant:"body-xs",className:(0,o.cn)("absolute top-full pt-0 text-red-600",I),children:null==(x=E[b])?void 0:x.message})}):(0,a.jsx)(a.Fragment,{children:"string"==typeof(null==(v=E[_])?void 0:v.message)&&(0,a.jsx)("div",{className:"phone-error relative flex flex-1 gap-2",children:"/checkout"===W?(0,a.jsx)(l.default,{element:"span",variant:"body-xs",className:"mt-1 pt-2 text-red-600",children:null==(y=E[_])?void 0:y.message}):(0,a.jsx)(l.default,{element:"span",variant:"body-xs",className:(0,o.cn)("absolute top-full text-red-600",I),children:null==(w=E[_])?void 0:w.message})})})]})}},6671:(e,t,r)=>{r.d(t,{E:()=>n});var a=r(30926);let n=(0,a.createServerReference)("60659531ef07bef8ac7126cb06e864e5cb6010c5f4",a.callServer,void 0,a.findSourceMapURL,"persistAuthTokenCookie")},8121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>eE});var a=r(95155),n=r(16760),s=r(89055),l=r(12115),i=r(20063),o=r(52627),d=r(22544),c=r(23071),u=r(70104),m=r(32321),p=r(77011),f=r(15532);let g=(0,l.forwardRef)((e,t)=>{let{type:r="text",placeholder:n,value:s,onChange:i,className:o="",label:d,labelClassName:c,...u}=e,[g,h]=(0,l.useState)(!1),x=(0,l.useMemo)(()=>"password"===r,[r]);return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:x?g?"text":"password":r,className:(0,m.cn)("peer focus:border-primary block w-full appearance-none rounded-lg border px-3 py-2 focus:ring-0 focus:outline-none",{"pr-10":x},o),placeholder:d?" ":n,value:s,onChange:i,ref:t,...u}),d&&(0,a.jsx)("label",{className:(0,m.cn)("text-secondary-100 pointer-events-none absolute left-3 z-10 origin-left transform bg-white px-1 text-sm transition-all","peer-focus:text-primary peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75","peer-[:not(:placeholder-shown)]:top-2 peer-[:not(:placeholder-shown)]:-translate-y-4 peer-[:not(:placeholder-shown)]:scale-75","top-1/2 -translate-y-1/2 scale-100",c),children:d}),x&&(0,a.jsx)("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-600 hover:text-gray-700 focus:text-gray-700",onClick:()=>h(!g),children:g?(0,a.jsx)(p.G,{size:20,weight:"bold"}):(0,a.jsx)(f.b,{size:20,weight:"bold"})})]})});g.displayName="FloatingInput";var h=r(36219),x=r(30340),v=r(5400),y=r(77821),w=r(74644),b=r(63257),_=r(30926);let S=(0,_.createServerReference)("40d3b027c129982597fb55f3d50ea1572a4e88f3c4",_.callServer,void 0,_.findSourceMapURL,"updateCustomer");var N=r(83460),C=r(6829),E=r(53333),j=r(49322),A=r(87826),I=r(1815),k=r(2582),P=r(40329),T=r(83
1050),U=r(69327),O=r(1213),G=r(21693);let D=e=>{var t,r,s,l,p;let{isLoading:f,setLoading:_,onSwitch:D,userEmail:R,fetchCustomerDetails:L,type:M}=e,{isDesktop:$}=(0,k.Q)(),W=(0,O.wA)(),B=(0,i.usePathname)(),F={token:"",countryCode:N.b.US,agreeToTerms:!0,email:R,mobile:""},z=(0,j.v)(),V=M===n.Yj.POPUP,{register:Q,trigger:H,handleSubmit:Y,watch:q,setValue:K,getValues:Z,reset:J,formState:{errors:X}}=(0,d.mN)({defaultValues:F,mode:"onChange"}),ee=Z("firstname"),et=Z("lastname"),er=Z("mobile"),ea=Z("password"),en=Z("email"),es=(null==ee?void 0:ee.trim())||(null==et?void 0:et.trim())||(null==er?void 0:er.trim().replace("+",""))||(null==ea?void 0:ea.trim()),el=async e=>{if(e.preventDefault(),e.stopPropagation(),_(!0),!await H())return void _(!1);await Y(ei)()},ei=async e=>{let t=!Object.values(N.b).includes(e.countryCode),r=o.gH.find(t=>t.country===e.countryCode),a=t?e.countryCode:null==r?void 0:r.value,n=(0,C.Ri)("authToken"),s=(0,C.Ri)("rptoken");try{var l,i,d,u,m,p,f;let t={};if(e.firstname&&(t.firstname=e.firstname),e.lastname&&(t.lastname=e.lastname),e.password&&(t.password=e.password),void 0!==e.agreeToTerms&&(t.sms_notification=!!e.agreeToTerms),en&&(t.email=en),t.website_id=z.storeId||A.wh.USA,t.group_id=1,((null==e?void 0:e.mobile)||(null==e?void 0:e.agreeToTerms))&&(t.custom_attributes=[{attribute_code:"cell_phone",value:e.mobile?"".concat(a).concat(e.mobile):""},{attribute_code:"smsnotification",value:+!!e.agreeToTerms},{attribute_code:"recency",value:"2"},{attribute_code:"frequency",value:"2"},{attribute_code:"monetary",value:"1"},{attribute_code:"customer_activated",value:"0"},{attribute_code:"activation_flag",value:"0"},{attribute_code:"is_cp_guest",value:"0"},{attribute_code:"freshsale_contact_id",value:"4013144926"},{attribute_code:"is_ordered",value:"No"},{attribute_code:"tj_exemption_type",value:"non_exempt"}]),t.password&&s&&en){let e={query:E.sn,variables:{email:en,newPassword:t.password,resetPasswordToken:s}};await (0,b.M)(e)}let r={query:E.PX,variables:t,token:null!=n?n:void 0},g=await S(r);(null==g?void 0:g.ok)&&!(null==g||null==(l=g.data)?void 0:l.errors)?((0,y.S)(w.Q.ADB_SIGN_UP_UPDATE_DETAILS_EVENT,{user:{emailID:R,encryptedEmailid:window.btoa(unescape(R)).substr(0,36),firstName:e.firstname,lastName:e.lastname,phone:e.mobile}},!0),L().then(()=>{_(!1),(0,c.VX)("Signup successful!"),J(),D(o.SG.SIGNUP_SUCCESS),(0,G.kQ)(B)&&(W((0,P.Id)()),W((0,T.NS)()),W((0,U.$i)(!0)))})):(_(!1),(0,c.UG)("string"!=typeof(null==g||null==(u=g.data)||null==(d=u.errors)||null==(i=d[0])?void 0:i.message)?I.UU.SOMETHING_WENT_WRONG:(null==g||null==(f=g.data)||null==(p=f.errors)||null==(m
1=p[0])?void 0:m.message)||"Signup failed. Please try again."))}catch(e){e instanceof Error?(0,c.UG)("string"!=typeof(null==e?void 0:e.message)?I.UU.SOMETHING_WENT_WRONG:(null==e?void 0:e.message)||"Signup failed. Please try again."):(0,c.UG)("Signup failed. Please try again."),(0,y.S)(w.Q.ADB_SIGNUP_FAILED_EVENT,{user:{signupType:"sign_up_form"},other:{err:e}},!0),_(!1)}};return(0,a.jsxs)("div",{className:(0,m.cn)("flex w-full flex-col gap-y-8",{"h-full":V}),children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2 whitespace-break-spaces",children:[(0,a.jsx)(u.default,{element:"h2",variant:"heading-3",weight:"medium",className:"text-primary-900 text-xl",children:"You're now signed in! \uD83C\uDF89"}),(0,a.jsx)(u.default,{variant:"body-xs",className:"text-secondary text-center text-xs",children:"Complete your profile for exclusive offers and updates"})]}),(0,a.jsxs)("form",{className:"grid grid-cols-2 gap-4",onSubmit:el,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(g,{label:"First Name",type:"text",placeholder:"First Name",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":X.firstname,"border-primary":q("firstname")&&!X.firstname}),style:$?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},labelClassName:(0,m.cn)({"text-error peer-focus:text-error":X.firstname,"text-primary":q("firstname")&&!X.firstname}),...Q("firstname",{required:"First name is required",pattern:{value:RegExp("^[\\p{L}\\p{M},\\-_.’'\\s\\d]{1,255}$","u"),message:"Invalid Characters Included."}})}),(null==X?void 0:X.firstname)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-error whitespace-break-spaces",children:null==X||null==(t=X.firstname)?void 0:t.message})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(g,{label:"Last Name",type:"text",placeholder:"Last Name*",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":X.lastname,"border-primary":q("lastname")&&!X.lastname}),style:$?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},labelClassName:(0,m.cn)({"text-error peer-focus:text-error":X.lastname,"text-primary":q("lastname")&&!X.lastname}),...Q("lastname",{required:"Last name is required",pattern:{value:RegExp("^[\\p{L}\\p{M},\\-_.’'\\s\\d]{1,255}$","u"),message:"Invalid Characters Included."}})}),(null==X?void 0:X.lastname)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-error whitespace-break-spaces",children:null==X||null==(r=X.lastname)?void 0:r.message})]}),(0,a.jsxs)("div",{className:"col-span-2 hidden",children:[(0,a.jsx)(g,{label:"Email",type:"email",readOnly:!0,placeholder:"Email*",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":X.email,"border-primary":q("email")&&!X.email}),style:$?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},labelClassName:(0,m.cn)({"text-error peer-focus:text-error":X.email,"text-primary":q("email")&&!X.email}),disabled:!!R,...Q("email",{disabled:!!R,pattern:{value:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,message:"Invalid email address"}})}),(null==X?void 0:X.email)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-error whitespace-break-spaces",children:null==X||null==(s=X.email)?void 0:s.message})]}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(v.A,{countryCodeField:"countryCode",mobileField:"mobile",register:Q,watch:q,setValue:K,errors:X,style:$?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"}})}),(0,a.jsxs)("div",{className:"col-span-2 mt-1",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(x.A,{label:"",id:"agreement",checked:q("agreeToTerms"),...Q("agreeToTerms")}),(0,a.jsx)("label",{htmlFor:"agreement",className:"text-secondary leading-3 whitespace-break-spaces",children:(0,a.jsx)(u.default,{variant:"body-xs",element:"span",className:"text-[10px]",children:"By providing your number, you consent to receive updates, wallet details, and exclusive offers via SMS or WhatsApp. Opt out anytime."})})]}),(null==X?void 0:X.agreeToTerms)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"whitespace-break-spaces text-red-500",children:null==X||null==(l=X.agreeToTerms)?void 0:l.message})]}),(0,a.jsxs)("div",{className:"relative col-span-2 w-full",children:[(0,a.jsx)(g,{label:"Password",type:"password",placeholder:"Create Password*",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":X.password,"border-primary":q("password")&&!X.password}),style:$?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},labelClassName:(0,m.cn)({"text-error peer-focus:text-error":X.password,"text-primary":q("password")&&!X.password}),...Q("password",{minLength:{value:6,message:"Minimum 6 characters"}})}),(null==X?void 0:X.password)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-error whitespace-break-spaces",children:null==X||null==(p=X.password)?void 0:p.message})]}),(0,a.jsx)(h.A,{size:"small",type:"submit",className:(0,m.cn)("col-span-2",{"pointer-events-none":!es||f}),disabled:f||!es,children:"Continue"}),(0,a.jsx)(h.A,{size:"small",variant:"secondary",type:"button",className:"col-span-2 font-normal",onClick:()=>{(0,y.S)(w.Q.ADB_SIGN_UP_DETAILS_SKIP_EVENT,{user:{emailID:R,encryptedEmailid:window.btoa(unescape(R)).substr(0,36)}},!0),L().then(()=>{_(!1),J(),D(o.SG.SIGNUP_SUCCESS),(0,G.kQ)(B)&&(W((0,P.Id)()),W((0,T.NS)()),W((0,U.$i)(!0)))})},children:"Skip for Now"})]})]})};var R=r(28720),L=r(76122),M=r(34591),$=r(98821);let W=e=>{let{closeModal:t,type:r}=e,[s,o]=(0,l.useState)(5),d=r===n.Yj.POPUP,c=r===n.Yj.LANDING_PAGE,{handleProtectedClick:m}=(0,L.u)(()=>{}),p=(0,i.useSearchParams)(),f=p.get("pid"),g=p.get("callback");return(0,l.useEffect)(()=>{let e=setInterval(()=>{o(r=>r<=1?(clearInterval(e),setTimeout(()=>{if(f&&window.location.assign(R.A.MYCART),d&&t(),c&&!g&&m(R.A.MYACCOUNT_PROFILE,"profile"),g){let e=(0,$.tJ)(g,p);window.location.assign(e)}},0),0):r-1)},1e3);return()=>clearInterval(e)},[t]),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2",children:[(0,a.jsx)(M.C,{weight:"fill",size:74,className:"text-success"}),(0,a.jsx)(u.default,{variant:"heading-3",className:"text-primary-900 pb-1 text-xl",children:"Congratulations"}),(0,a.jsx)(u.default,{variant:"body-xs",className:"text-secondary pb-2 text-xs",children:"Your account has been successfully created."}),(0,a.jsxs)(u.default,{variant:"body-xs",className:"text-secondary-500 mt-2 hidden text-xs",children:["Closing in ",s," second",1!==s?"s":"","..."]}
1)]})},B=e=>{let{email:t="[email protected]",closeModal:r,type:s}=e,[i,o]=(0,l.useState)(5),d=s===n.Yj.POPUP,c=s===n.Yj.LANDING_PAGE;return(0,l.useEffect)(()=>{let e=setInterval(()=>{o(t=>t<=1?(clearInterval(e),d&&r(),c&&window.location.assign("/"),0):t-1)},1e3);return()=>clearInterval(e)},[r]),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2",children:[(0,a.jsx)(u.default,{variant:"heading-3",className:"text-primary-900 pb-1 text-xl",children:"Reset your Password"}),(0,a.jsxs)(u.default,{variant:"body-xs",className:"text-secondary pb-4 text-center text-xs",children:["We've emailed a password reset link to ",(0,a.jsx)("br",{}),(0,a.jsx)(u.default,{variant:"body-xs",element:"span",weight:"medium",children:t})]}),(0,a.jsxs)(u.default,{variant:"body-xs",className:"text-secondary-500 mt-2 hidden text-xs",children:["Closing in ",i," second",1!==i?"s":"","..."]})]})};var F=r(74774),z=r(36489),V=r(952),Q=r(34339);let H=function(){let e=(0,j.v)().businessUrl;return(0,a.jsx)("div",{className:"flex flex-col items-center justify-center gap-y-1",children:(0,a.jsxs)("div",{className:"flex items-center gap-x-1",children:[(0,a.jsxs)(u.default,{variant:"body-xs",weight:"medium",children:["For bulk orders,"," ",(0,a.jsx)("a",{href:null!=e?e:"",target:"_blank",className:"text-blue-500 underline",children:"visit"})]}),(0,a.jsx)(Q.CDNImage,{src:"/images/icons/cov-busniess.png",alt:"Covers & All",width:120,height:18,unoptimized:!0})]})})},Y=function(){return(0,a.jsxs)("div",{className:"inline-block w-full text-center text-gray-700 lg:mt-auto",children:[(0,a.jsxs)(u.default,{variant:"body-xs",element:"span",children:["Read our"," "]}),(0,a.jsx)("a",{href:"/terms-and-condition",target:"_blank",className:"inline-block",children:(0,a.jsx)(u.default,{variant:"body-xs",element:"span",weight:"medium",className:"underline",children:"Terms & Conditions"})}),(0,a.jsxs)(u.default,{variant:"body-xs",element:"span",children:[" ","and"," "]}),(0,a.jsx)("a",{href:"/privacy-policy",target:"_blank",className:"inline-block",children:(0,a.jsx)(u.default,{variant:"body-xs",element:"span",weight:"medium",className:"underline",children:"Privacy Policy"})})]})},q=e=>{var t,r;let{isLoading:s,watch:i,getEmailPasscodeHandler:d,onSwitch:c,verifyOtpHandler:p,register:f,setValue:g,errors:v,isRegisteredUser:b=!1,timeLeft:_,showPasswordWithLoginCTA:S,type:N}=e,[C,E]=(0,l.useState)(!1),{isDesktop:j}=(0,k.Q)(),A=i("email"),I=s||!i("otp")||!C,P=N===n.Yj.POPUP,T=N===n.Yj.LANDING_PAGE;return(0,a.jsxs)("div",{className:(0,m.cn)("relative flex w-200 w-full flex-col",{"h-full bg-white":P,"max-w-[450px]":T}),children:[(0,a.jsxs)("div",{className:"flex flex-col gap-y-8",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2 whitespace-break-spaces",children:[(0,a.jsx)(u.default,{element:"h2",variant:"heading-3",weight:"medium",className:"text-primary-900 text-center text-xl",children:b?"Welcome back! You're already registered with us":"Enter your code to Sign Up"}),A&&(0,a.jsxs)(u.default,{variant:"body-xs",className:"text-secondary text-center text-xs",children:["We've sent a 4-digit code to"," ",(0,a.jsx)(u.default,{element:"span",className:"font-medium wrap-anywhere",children:A}),"."," ",b?"Enter the code below to access your account.":"Enter the code below to finish creating your account."]})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),e.stopPropagation(),p(e)},className:"flex w-full flex-col gap-y-4",children:[(0,a.jsxs)("div",{className:"flex w-full flex-col",children:[(0,a.jsx)(V.A,{length:4,style:j?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},onVerifyOtp:e=>{g("otp",e)},onOtpComplete:E,containerClass:"justify-around gap-x-6"}),v.otp&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-red-500",children:null==v||null==(t=v.otp)?void 0:t.message})]}),(0,a.jsx)("div",{className:"request-code",children:(0,a.jsx)("button",{type:"button",onClick:d,disabled:0!==_&&null!==_,className:(0,m.cn)("text-success text-xs",{"pointer-events-none cursor-not-allowed":0!==_&&null!==_}),children:null!==_&&_>0?"Request a new code in ".concat(String(_).padStart(2,"0")," ").concat(_>1?"seconds":"second"):"Request a new code"})}),!b&&(0,a.jsxs)("div",{className:"mt-1",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(x.A,{label:"",id:"agreement",checked:i("agreeToTerms"),...f("agreeToTerms")}),(0,a.jsx)("label",{htmlFor:"agreement",className:"text-secondary text-xs whitespace-break-spaces",children:(0,a.jsx)(u.default,{variant:"body-xs",element:"span",className:"text-[10px]",children:"By 
1signing up, you agree to receive updates, wallet information, and exclusive offers via email. Unsubscribe anytime. We respect your privacy."})})]}),v.agreeToTerms&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-red-500",children:null==v||null==(r=v.agreeToTerms)?void 0:r.message})]}),(0,a.jsxs)(h.A,{type:"submit",size:"small",disabled:I,className:"h-[44px]",children:["Confirm & ",b?"login ":"sign up"]}),b&&S&&(0,a.jsx)(h.A,{variant:"secondary",size:"small",type:"button",onClick:()=>{(0,y.S)(w.Q.ADB_LOGIN_WITH_PASSWORD_EVENT,{user:{emailID:A,encryptedEmailid:window.btoa(unescape(A)).substr(0,36)}},!0),c(o.SG.SIGN_IN_WITH_PASS)},children:"Sign in with a password instead"}),(0,a.jsx)(H,{})]})]}),P&&(0,a.jsx)(Y,{})]})};q.displayName="VeryfyOtp";let K=(0,l.memo)(q);var Z=r(84604),J=r(24649),X=r(83339),ee=r(89146),et=r(47376),er=r(24899);let ea=e=>{let{item:t,setIsLoader:r,type:s}=e,l=(0,i.useSearchParams)(),o=l.get("pid"),d=s===n.Yj.LANDING_PAGE,{handleProtectedClick:c}=(0,L.u)(()=>{}),u=(0,ee.A)(),m=(0,et.F)(),p=l.get("callback"),f={callback:p,loginSearchParams:l,isLandingPage:d&&!p,pid:o},g=async e=>{r(!0);try{let t=await (0,z.signIn)("google",{redirect:!1,token:e});(null==t?void 0:t.error)?(X.A.error("Sign-in error:",{component:"ErrorBoundary",response:t}),r(!1)):(await (0,er.M)({mergeCart:u,mergeMeasurement:m}),(0,$.E8)(f,()=>c(R.A.MYACCOUNT_PROFILE,"profile")))}catch(e){r(!1),X.A.error("Sign-in failed:",{component:"ErrorBoundary",err:e})}},h=(0,Z.mg)({onSuccess:async e=>{r(!0),(null==e?void 0:e.access_token)&&await g(e.access_token)},onError:e=>{X.A.error("Google Login Failed:",{component:"ErrorBoundary",errorResponse:e}),r(!1)},flow:"implicit"});return(0,a.jsxs)("button",{onClick:()=>h(),type:"button",className:"flex w-full items-center justify-center gap-2 rounded border border-gray-500 bg-white px-4 py-2 text-sm font-medium text-gray-800 transition hover:bg-gray-100",title:t.title,children:[(0,a.jsx)(Q.CDNImage,{src:t.imageSrc,width:20,height:20,alt:t.alt}),t.title]},"social-".concat(t.title))},en=e=>{let{item:t,setIsLoader:r,type:s}=e;(()=>{let e=(0,j.v)(),t=null==e?void 0:e.fbAppId;(0,l.useEffect)(()=>{t&&(window.FB||(window.fbAsyncInit=function(){var e;null==(e=window.FB)||e.init({appId:t,cookie:!0,xfbml:!0,version:"v18.0"})},function(e,t,r){var a;if(e.getElementById(r))return;let n=e.createElement(t);n.id=r,n.src="https://connect.facebook.net/en_US/sdk.js";let s=e.getElementsByTagName(t)[0];null==(a=s.parentNode)||a.insertBefore(n,s)}(document,"script","facebook-jssdk")))},[t])})();let o=(0,i.useSearchParams)(),d=o.get("pid"),c=s===n.Yj.LANDING_PAGE,{handleProtectedClick:u}=(0,L.u)(()=>{}),m=(0,ee.A)(),p=(0,et.F)(),f=o.get("callback"),g={callback:f,loginSearchParams:o,isLandingPage:c&&!f,pid:d};return(0,a.jsxs)("button",{onClick:()=>{window.FB&&window.FB.login(e=>{e.authResponse&&"unknown"!==e.status?(async()=>{r(!0);let t=e.authResponse.accessToken;try{let e=await (0,z.signIn)("facebook",{redirect:!1,token:t});(null==e?void 0:e.error)?(X.A.error("Sign-in error:",{component:"FacebookLoginButton",response:e}),r(!1)):(await (0,er.M)({mergeCart:m,mergeMeasurement:p}),(0,$.E8)(g,()=>u(R.A.MYACCOUNT_PROFILE,"profile")))}catch(e){X.A.error("Unexpected error during sign-in",{component:"FacebookLoginButton",error:e})}finally{r(!1)}})():(X.A.error("User cancelled login or did not fully authorize.",{component:"FacebookLoginButton"}),r(!1))},{scope:"public_profile,email",auth_type:"reauthenticate"})},type:"button",className:"flex w-full items-center justify-center gap-2 rounded border border-gray-500 bg-white px-4 py-2 text-sm font-medium text-gray-800 transition hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",title:t.title,children:[(0,a.jsx)(Q.CDNImage,{src:t.imageSrc,width:20,height:20,alt:t.alt}),t.title]},"social-".concat(t.title))},es=e=>{let{item:t,setIsLoader:r,type:s}=e,l=s===n.Yj.LANDING_PAGE,o=(0,i.useSearchParams)(),d=o.get("callback"),u=o.get("pid"),m=async e=>{try{r(!0);let t=(0,$.k2)({callback:d,loginSearchParams:o,isLandingPage:l&&!d,pid:u});t!==(0,$.rh)()&&(0,$.N)(t),await (0,z.signIn)(e,{callbackUrl:(0,$.Oc)(t)})}catch(e){r(!1),X.A.error("Amazon sign-in exception",{component:"AmazonLoginButton",error:e}),(0,c.UG)("Amazon sign-in failed. Please try again later.")}};return(0,a.jsxs)("button",{onClick:()=>m(t.provider),type:"button",className:"flex w-full items-center justify-center gap-2 rounded border border-gray-500 bg-white px-4 py-2 text-sm font-medium text-gray-800 transition hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50 lg:col-span-2 lg:max-w-[176px]",title:t.title,children:[(0,a.jsx)(Q.CDNImage,{src:t.imageSrc,width:20,height:20,alt:t.alt}),t.title]},"social-".concat(t.title))},el=e=>{let{type:t}=e,[r,n]=(0,l.useState)(!1),s=(0,j.v)(),i=s.socialLogin,d=null==i?void 0:i.split(","),c=s.googleAppId;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"grid place-items-center gap-3 py-2 lg:grid-cols-2",children:o.wP.map(e=>{var r;return(0,a.jsx)(l.Fragment,{children:(null==d?void 0:d.includes(null==(r=e.title)?void 0:r.toLowerCase()))&&
1(0,a.jsx)(a.Fragment,{children:e.provider===J.r.GOOGLE?(0,a.jsx)(Z.G_,{clientId:c,children:(0,a.jsx)(ea,{item:o.wP[0],setIsLoader:n,type:t})}):e.provider===J.r.FACEBOOK?(0,a.jsx)(en,{item:o.wP[1],setIsLoader:n,type:t}):(0,a.jsx)(es,{item:o.wP[2],setIsLoader:n,type:t})})},e.title)})}),r&&(0,a.jsx)(F.A,{})]})};var ei=r(75355);let eo=(0,_.createServerReference)("4033d991df9d379f98163d01e7c69239cbaead960c",_.callServer,void 0,_.findSourceMapURL,"forgotPassword"),ed=e=>{let{userEmail:t,setLoading:r,onSwitch:n}=e,s=async e=>{if(e.preventDefault(),!t)return void(0,c.UG)("Please enter your email first");try{r(!0);let e={email:t,template:"email_reminder",websiteId:(0,j.v)().storeId||A.D6.USA,token:"",storeCode:(0,j.v)().storeCode||A.wh.USA},a=await eo(e);(null==a?void 0:a.ok)?((0,c.VX)("Password reset link sent to your email"),n(o.SG.RESET_PASSWORD_SUCCESS)):(0,c.UG)("Failed to send reset link")}catch(e){e instanceof Error?(0,c.UG)("An error occurred. Please try again.: ".concat(null==e?void 0:e.message)):(0,c.UG)("An error occurred. Please try again.")}finally{r(!1)}};return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(h.A,{type:"button",size:"small",variant:"tertiary",className:"self-start p-0",onClick:s,children:(0,a.jsx)(u.default,{variant:"body-xs",children:"Forgot Password?"})})})},ec=e=>{var t;let{isLoading:r,setLoading:s,watch:l,signInWithPasswordHandler:i,onSwitch:d,register:c,errors:p,type:f,oldLogin:g}=e,x=l("email"),v=f===n.Yj.POPUP;return(0,a.jsxs)("div",{className:(0,m.cn)("relative flex w-full flex-col",{"h-full bg-white":v}),children:[(0,a.jsxs)("div",{className:"grid gap-y-8",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2 whitespace-break-spaces",children:[(0,a.jsx)(u.default,{element:"h2",variant:"heading-3",weight:"medium",className:"text-primary-900 text-xl",children:"Sign in with your password"}),(0,a.jsxs)(u.default,{variant:"body-xs",className:"text-secondary text-center text-xs",children:["Enter the password to access your account linked to"," ",(0,a.jsx)(u.default,{element:"span",weight:"medium",className:"wrap-anywhere",children:x})]})]}),(0,a.jsxs)("form",{onSubmit:i,className:"flex flex-col gap-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(ei.default,{type:"password",placeholder:"Enter your password",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":p.password,"border-primary":l("password")&&!p.password}),onKeyDown:e=>{if("Enter"===e.key){e.preventDefault(),e.stopPropagation();let t=e.currentTarget.form;if(t){if("function"==typeof t.requestSubmit)return void t.requestSubmit();t.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}))}}},...c("password",{required:"Password is required",minLength:{value:6,message:"Minimum 6 characters"}})}),(null==p?void 0:p.password)&&(0,a.jsx)(u.default,{variant:"body-xs",className:"text-error mt-1",children:null==p||null==(t=p.password)?void 0:t.message})]}),(0,a.jsx)(ed,{register:c,onSwitch:d,setLoading:s,userEmail:x}),(0,a.jsx)(h.A,{size:"small",type:"submit",disabled:r||!l("password"),children:"Sign In"}),!g&&(0,a.jsx)(h.A,{size:"small",variant:"secondary",type:"button",onClick:()=>d(o.SG.OTP),children:"Sign in with a passcode instead"}),(0,a.jsx)(H,{})]})]}),v&&(0,a.jsx)(Y,{})]})};ec.displayName="SignInWithPass";var eu=r(79031);let em=(0,_.createServerReference)("40c7bc2a06c0988ddd455919f20facbbb5b2be0588",_.callServer,void 0,_.findSourceMapURL,"createCustomer");var ep=r(6671),ef=r(22512),eg=r(51602),eh=r(68290),ex=r(51100),ev=r(28492),ey=r(8782);let ew=e=>{var t;let{currentScreen:r,isLoading:s,setLoading:p,onSwitch:f,closeModal:x,setUserEmail:v,type:b,oldLogin:_}=e,S=(0,O.wA)(),[N,A]=(0,l.useState)(null),[U,D]=(0,l.useState)(!1),L=(0,ee.A)(),M=(0,et.F)(),[W,B]=(0,l.useState)(!1),[F,{isSuccess:V,data:Q,isError:q}]=(0,eg.X)(),[Z,J]=(0,l.useState)(0),X=(0,O.d4)(e=>e.auth.customer),ea=(0,i.useRouter)(),en=(0,ev.A)(),es=(0,l.useRef)(!1),ei=(0,i.usePathname)(),eo=(0,i.useSearchParams)(),ed=eo.get("error"),ew=eo.get("error_source"),eb=eo.get("pid"),e_=eo.get("callback"),eS=(0,l.useRef)(null),eN=(0,j.v)(),eC=(0,C.Ri)("source_masked_i
1d"),eE=b===n.Yj.POPUP,ej=b===n.Yj.LANDING_PAGE,{setEmailIdTrack:eA}=(0,eh.v)(),{isDesktop:eI}=(0,k.Q)(),{data:ek}=(0,z.useSession)(),{register:eP,handleSubmit:eT,watch:eU,setValue:eO,getValues:eG,trigger:eD,reset:eR,formState:{errors:eL,isValid:eM,isSubmitting:e$}}=(0,d.mN)({defaultValues:{token:"",agreeToTerms:!0},mode:"onBlur"});(0,l.useEffect)(()=>{if(null===Z||Z<=0)return;let e=setTimeout(()=>{J(Z-1)},1e3);return()=>clearTimeout(e)},[Z]),(0,l.useEffect)(()=>{ej&&!X&&f(o.SG.SIGNIN)},[X]),(0,l.useEffect)(()=>{en&&(es.current||(es.current=!0,null==x||x(),(0,c.UG)("Login is not available during agent checkout. Redirecting to home page."),ea.replace(R.A.HOME)))},[x,en,ea]),(0,l.useEffect)(()=>{(null==X?void 0:X.email)&&(eO("email",X.email),eA(X.email))},[null==X?void 0:X.email]),(0,l.useEffect)(()=>{V&&((null==Q?void 0:Q.is_guest)?(S((0,ex.nQ)()),D(!1)):D(!0),(null==Q?void 0:Q.is_set_password)&&B(null==Q?void 0:Q.is_set_password),eW())},[V,q]);let eW=async()=>{if(_)return f(o.SG.SIGN_IN_WITH_PASS),p(!1),0;if(p(!0),"caches"in window&&caches.keys().then(e=>{e.forEach(e=>{caches.delete(e).catch(e=>{})})}),console.log("Service Worker unregistered and caches cleared due to API request"),!await eD("email"))return void p(!1);let e=eG("email");eA(e);try{var t,a,n,s,l,i,d,u,m,g,h,x,b,S,N,C,j,A,k,P,T,U,O,G,D;let _={query:E.Yz,variables:{email:e,token:""}},R=await (0,eu.o)(_);if((null==R?void 0:R.ok)&&(null==R||null==(n=R.data)||null==(a=n.data)||null==(t=a.loginByEmailOtpData)?void 0:t.success)==="true"&&(null==R||null==(i=R.data)||null==(l=i.data)||null==(s=l.loginByEmailOtpData)?void 0:s.haserror)==="false")(0,y.S)(w.Q.ADB_GET_EMAIL_OTP_EVENT,{user:{emailID:e,encryptedEmailid:window.btoa(unescape(e)).substr(0,36),success:!0,message:(null==R||null==(m=R.data)||null==(u=m.data)||null==(d=u.loginByEmailOtpData)?void 0:d.message)||"OTP has been sent successfully"}},!0),(null==R?void 0:R.data)&&(null==R?void 0:R.data)&&J(60),(0,c.VX)((null==R||null==(x=R.data)||null==(h=x.data)||null==(g=h.loginByEmailOtpData)?void 0:g.message)||"OTP Send Successfully!"),p(!1),r===o.SG.SIGNIN&&(v(e),f(o.SG.OTP));else if(p(!1),null==R||null==(S=R.data)||null==(b=S.data)?void 0:b.loginByEmailOtpData){let e=null==R||null==(j=R.data)||null==(C=j.data)||null==(N=C.loginByEmailOtpData)?void 0:N.message,t=null==R||null==(k=R.data)||null==(A=k.data)?void 0:A.loginByEmailOtpData.time;e=null==e?void 0:e.replace(/{time}/,t),(0,c.UG)("string"!=typeof e?I.UU.SOMETHING_WENT_WRONG:e)}else{let e="string"!=typeof(null==R||null==(U=R.data)||null==(T=U.errors)||null==(P=T[0])?void 0:P.message)?I.UU.SOMETHING_WENT_WRONG:null==R||null==(D=R.data)||null==(G=D.errors)||null==(O=G[0])?void 0:O.message;(0,c.UG)(e||I.UU.SOMETHING_WENT_WRONG)}}catch(e){e instanceof Error&&(0,c.UG)("string"!=typeof(null==e?void 0:e.message)?I.UU.SOMETHING_WENT_WRONG:(null==e?void 0:e.message)||I.UU.SOMETHING_WENT_WRONG),p(!1)}};(0,l.useEffect)(()=>{ed&&"social-login"===ew&&(sessionStorage.setItem("socialLoginError",decodeURIComponent(ed)),setTimeout(()=>{window.location.assign("/")},5e3))},[ed,ew]),(0,l.useEffect)(()=>{let e=sessionStorage.getItem("socialLoginError");e&&A(e)},[]),(0,l.useEffect)(()=>{r===o.SG.SIGN_IN_WITH_PASS&&eO("password","")},[r]);let eB=(0,l.useRef)(null),eF=(0,l.useRef)(null),ez=eP("email",{pattern:{value:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,message:"Invalid email address"}}),eV=async e=>{e.preventDefault(),e.stopPropagation();try{if(p(!0),!eM&&r===o.SG.SIGN_IN_WITH_PASS)return void p(!1);await eT(eQ)()}catch(e){e instanceof Error?(0,c.UG)("string"!=typeof(null==e?void 0:e.message)?I.UU.SOMETHING_WENT_WRONG:(null==e?void 0:e.message)||"Login Failed. Please try again."):(0,c.UG)("Login Failed. Please try again."),p(!1)}},eQ=async e=>{var t,a,n,s,l,i,d,u,m,g,h,v,b,_,N,j,A,k,O,D,W,B,F,V,Q,H;let Y="",q="";r===o.SG.SIGN_IN_WITH_PASS?(eO("otp",""),Y="password",q=e.password):r===o.SG.OTP&&(eO("password",""),Y="otp",q=e.otp);let K=(0,C.Ri)("source_masked_id")||"";if(U){let r={username:e.email,password:q,logintype:Y,token:"2wicoj6asvud7ed9nm34uf9nwyohd2ro",source_masked_i
1d:K};try{let n=await (0,z.signIn)("login",{redirect:!1,...r,session_id:null!=(t=null==ek?void 0:ek.sessionId)?t:(0,ey.y)()});if(null==n?void 0:n.ok){eA(e.email),(0,y.S)(w.Q.ADB_LOGIN_SUCCESSFUL_EVENT,{user:{loginType:Y}},!0),(0,c.VX)("Login Successfully!"),eR(),await (0,er.M)({mergeCart:L,mergeMeasurement:M,guestCartId:K});let t=null!=e_?e_:new URLSearchParams(window.location.search).get("callback"),r=ei===R.A.LOGIN_LANDING_PAGE||ei.replace(/\/$/,"")===R.A.LOGIN_LANDING_PAGE;if(eE){if(x(),p(!1),(0,G.kQ)(ei)&&(S((0,P.Id)()),S((0,T.NS)())),t){let e=(0,$.tJ)(t,eo);window.location.replace(e);return}if(r)return void window.location.replace(R.A.MYACCOUNT_DASHBOARD);eb&&setTimeout(()=>{window.location.assign(R.A.MYCART)},2e3);return}if(t){let e=(0,$.tJ)(t,eo);window.location.replace(e);return}if(ej)return void(e=>{if(t){let e=(0,$.tJ)(t,eo);window.location.replace(e)}else{let t=(0,$.tJ)(e,eo);window.location.replace(t)}})(R.A.MYACCOUNT_DASHBOARD);eb&&setTimeout(()=>{window.location.assign(R.A.MYCART)},2e3)}else(0,y.S)(w.Q.ADB_LOGIN_FAILED_EVENT,{other:{errorMessage:null!=(a=null==n?void 0:n.error)?a:"Login failed. Please try again."},user:{loginType:Y}},!0),p(!1),(0,c.UG)("string"!=typeof(null==n?void 0:n.error)?I.UU.SOMETHING_WENT_WRONG:(null==n?void 0:n.error)||"Login failed. Please try again.")}catch(e){p(!1),(0,c.UG)(I.UU.SOMETHING_WENT_WRONG),f(o.SG.SIGNUP)}}else if(!U)try{let t={firstname:"Customer",lastname:"​",email:e.email,otp:q,is_subscribed:e.agreeToTerms,source_masked_id:K,website_id:eN.storeId,password:q,custom_attributes:[{attribute_code:"smsnotification",value:e.agreeToTerms?"1":"0"},{attribute_code:"cell_phone",value:""}],klaviyo_source:"signInPopup",signUpType:Y,token:""},r={query:E.wF,variables:t},a=await em(r);if((null==a?void 0:a.ok)&&!(null==a||null==(n=a.data)?void 0:n.errors)){if((0,y.S)(w.Q.ADB_SIGN_UP_SUCCESSFUL_EVENT,{user:{emailID:e.email,encryptedEmailid:window.btoa(unescape(e.email)).substr(0,36)}},!0),null==a||null==(d=a.data)||null==(i=d.data)||null==(l=i.createCustomerV2)||null==(s=l.customer)?void 0:s.token){let e=a.data.data.createCustomerV2.customer.token;(null==(b=a.headers)?void 0:b.length)>0&&200===a.status&&a.headers.forEach(e=>(0,C.Si)(e)),(0,C.Ri)("authToken")||((0,ef.w6)()?(0,ep.E)(e,30):(0,C.lc)("authToken",e,30)),await L({guestCartId:eC||"",token:e}),await M()}(null==a||null==(v=a.data)||null==(h=v.data)||null==(g=h.createCustomerV2)||null==(m=g.customer)||null==(u=m.customer_extra_fields)?void 0:u.rptoken)&&(0,C.lc)("rptoken",null==a||null==(A=a.data.data)||null==(j=A.createCustomerV2)||null==(N=j.customer)||null==(_=N.customer_extra_fields)?void 0:_.rptoken,30),eE&&eR(),f(o.SG.SIGNUP),p(!1)}else(0,y.S)(w.Q.ADB_SIGNUP_FAILED_EVENT,{user:{loginType:Y},other:{errorMessage:null==a||null==(D=a.data)||null==(O=D.errors)||null==(k=O[0])?void 0:k.message}},!0),(0,c.UG)("string"!=typeof(null==a||null==(F=a.data)||null==(B=F.errors)||null==(W=B[0])?void 0:W.message)?I.UU.SOMETHING_WENT_WRONG:(null==a||null==(H=a.data)||null==(Q=H.errors)||null==(V=Q[0])?void 0:V.message)||"Create customer failed. Please try again."),p(!1)}catch(e){e instanceof Error?(0,c.UG)("string"!=typeof(null==e?void 0:e.message)?I.UU.SOMETHING_WENT_WRONG:null==e?void 0:e.message):(0,c.UG)(I.UU.SOMETHING_WENT_WRONG),p(!1)}};return en?null:r===o.SG.OTP?(0,a.jsx)(K,{isLoading:s,watch:eU,getEmailPasscodeHandler:eW,onSwitch:f,verifyOtpHandler:eV,register:eP,setValue:eO,errors:eL,isRegisteredUser:U,timeLeft:Z,showPasswordWithLoginCTA:W,type:b}):r===o.SG.SIGN_IN_WITH_PASS?(0,a.jsx)(ec,{isLoading:s,setLoading:p,signInWithPasswordHandler:eV,watch:eU,onSwitch:f,register:eP,errors:eL,type:b,oldLogin:_}):(0,a.jsxs)(a.Fragment,{children:[N&&(0,a.jsxs)("div",{className:"mb-4 w-full rounded-md bg-red-600 p-4 py-2 text-center text-sm whitespace-break-spaces text-white",children:["Login failed: ",N]}),(0,a.jsxs)("div",{className:(0,m.cn)("flex w-full flex-col gap-y-8",{"h-full":eE}),children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2 whitespace-break-spaces",children:[(0,a.jsx)(u.default,{element:"h2",variant:"heading-3",weight:"medium",className:"text-primary-900 text-xl",children:_?"Customer Login":"Login or sign up"}),!_&&(0,a.jsx)(u.default,{variant:"body-xs",className:"text-secondary text-center text-xs",children:"Get order updates, wallet perks, and special offers — right in y
1our inbox."})]}),(0,a.jsxs)("div",{className:"grid gap-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(g,{onKeyDown:e=>{if("Enter"===e.code||"NumpadEnter"===e.code){var t;e.preventDefault(),e.stopPropagation(),null==(t=eS.current)||t.click()}},type:"email",label:"Email",placeholder:"Enter Email",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-xs",{"border-error focus:border-error":eL.email,"border-primary":eU("email")&&!eL.email}),style:eI?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},labelClassName:(0,m.cn)({"text-error peer-focus:text-error":eL.email,"text-primary":eU("email")&&!eL.email}),...ez,onFocus:e=>{let t=e.currentTarget,r=()=>{null===eF.current&&(eF.current=window.requestAnimationFrame(()=>{eF.current=null,(()=>{var e;let r=window.visualViewport,a=null!=(e=null==r?void 0:r.height)?e:window.innerHeight,n=t.getBoundingClientRect(),s=a-30,l=0;n.bottom>s?l=n.bottom-s:n.top<30&&(l=n.top-30),0!==l&&window.scrollBy({top:l,behavior:"auto"})})()}))},a=window.visualViewport;a?(a.addEventListener("resize",r),eB.current=()=>{a.removeEventListener("resize",r),null!==eF.current&&(window.cancelAnimationFrame(eF.current),eF.current=null)}):eB.current=()=>{null!==eF.current&&(window.cancelAnimationFrame(eF.current),eF.current=null)},r()},onBlur:e=>{ez.onBlur(e),(()=>{var e;null==(e=eB.current)||e.call(eB),eB.current=null})()}}),eL.email&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-error mt-1",children:null==eL||null==(t=eL.email)?void 0:t.message})]}),(0,a.jsx)(h.A,{ref:eS,size:"small",type:"button",onClick:()=>{p(!0);let e=eG("email");F({storeCode:eN.storeCode,data:{email:e,quoteId:eC||""}}).then(e=>{e.error&&p(!1)})},disabled:s||!eU("email")||e$,children:"Next"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,a.jsx)("hr",{className:"border-secondary-100 flex-grow"}),(0,a.jsx)(u.default,{variant:"body-xs",element:"span",className:"text-secondary-100",children:"Or Continue With"}),(0,a.jsx)("hr",{className:"border-secondary-100 flex-grow"})]}),(0,a.jsx)(el,{type:b}),(0,a.jsx)(H,{})]}),eE&&(0,a.jsx)(Y,{})]})]})};var eb=r(48093);let e_=e=>{let{currentScreen:t,onSwitch:r}=e,n=(0,l.useCallback)(()=>{t!=o.SG.SIGNIN&&r(o.SG.SIGNIN)},[t,r]);return(0,a.jsxs)(h.A,{variant:"tertiary",size:"small",type:"button",onClick:n,className:"text-secondary-100 hover:text-secondary-100 focus:text-secondary-100 active:text-secondary-100 gap-x-0 p-0 no-underline",children:[(0,a.jsx)(eb.e,{size:20}),(0,a.jsx)(u.default,{className:"hidden md:block",children:"Back"})]})};var eS=r(76567);let eN={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode(e){let t,r,a,n,s,l,i,o="",d=0;for(e=eN._utf8_encode(e);d<e.length;)t=e.charCodeAt(d++),r=e.charCodeAt(d++),a=e.charCodeAt(d++),n=t>>2,s=(3&t)<<4|r>>4,l=(15&r)<<2|a>>6,i=63&a,Number.isNaN(r)?l=i=64:Number.isNaN(a)&&(i=64),o=o+eN._keyStr.charAt(n)+eN._keyStr.charAt(s)+eN._keyStr.charAt(l)+eN._keyStr.charAt(i);return o},decode(e){let t,r,a,n,s,l,i,o="",d=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");d<e.length;)n=eN._keyStr.indexOf(e.charAt(d++)),s=eN._keyStr.indexOf(e.charAt(d++)),l=eN._keyStr.indexOf(e.charAt(d++)),i=eN._keyStr.indexOf(e.charAt(d++)),t=n<<2|s>>4,r=(15&s)<<4|l>>2,a=(3&l)<<6|i,o+=String.fromCharCode(t),64!==l&&(o+=String.fromCharCode(r)),64!==i&&(o+=String.fromCharCode(a));return eN._utf8_decode(o)},_utf8_encode(e){e=e.replace(/\r\n/g,"\n");let t="";for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);a<128?t+=String.fromCharCode(a):(a>127&&a<2048?t+=String.fromCharCode(a>>6|192):(t+=String.fromCharCode(a>>12|224),t+=String.fromCharCode(a>>6&63|128)),t+=String.fromCharCode(63&a|128))}return t},_utf8_decode(e){let t="",r=0;for(;r<e.length;){let a=e.charCodeAt(r);a<128?(t+=String.fromCharCode(a),r++):a>191&&a<224?(t+=String.fromCharCode((31&a)<<6|63&e.charCodeAt(r+1)),r+=2):(t+=String.fromCharCode((15&a)<<12|(63&e.charCodeAt(r+1))<<6|63&e.charCodeAt(r+2)),r+=3)}return t}},eC=e=>{var t,r;let{type:s,onSwitch:p}=e,f=(0,i.useSearchParams)(),v=f.get("email"),y=f.get("token"),[w,_]=(0,l.useState)(!1),S=s===n.Yj.POPUP,{register:N,handleSubmit:C,watch:j,reset:A,formState:{errors:I,isValid:k}}=(0,d.mN)({mode:"onChange"}),P=async e=>{var t,r,a,n,s,l,i,d,u;if(!y||!v)return;let m={query:E.sn,variables:{email:eN.decode(v),newPassword:e.confirmPassword,resetPasswordToken:y}},f=await (0,b.M)(m);f.ok&&(null==f||null==(r=f.data)||null==(t=r.data)?void 0:t.resetPassword)?(A(),(0,c.VX)("Your password has been reset successfully. You can now log in."),p(o.SG.SIGNIN)):f.ok&&(null!=(s=null==(n=f.data)||null==(a=n.errors)?void 0:a.length)?s:0)>0&&(0,c.UG)(null!=(u=null==(d=f.data)||null==(i=d.errors)||null==(l=i[0])?void 0:l.message)?u:"An unknown error occurred")};return(0,a.jsxs)("div",{className:(0,m.cn)("flex w-full flex-col gap-y-8",{"h-full":S}),children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-y-2 whitespace-break-spaces",children:[(0,a.jsx)(u.default,{element:"h2",variant:"heading-3",weight:"medium",className:"text-primary-900 text-xl",children:"Set your password"}),(0,a.jsx)(u.default,{variant:"body-xs",className:"text-secondary text-center text-xs",children:"Enter a new password below"})]}),(0,a.jsx)("div",{className:"grid gap-y-4",children:(0,a.jsxs)("form",{onSubmit:C(P),className:"flex w-full max-w-md flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(g,{label:"New Password",type:w?"text":"password",placeholder:"Enter new password",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-sm",{"border-error focus:border-error":I.password,"border-primary":j("password")&&!I.password}),...N("password",{required:"New Password is required",minLength:{value:6,message:"Minimum 6 characters required"}})}),(null==I?void 0:I.password)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-red-500",children:null==I||null==(t=I.password)?void 0:t.message})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(g,{label:"Confirm New Password",type:w?"text":"password",placeholder:"Re-enter new password",className:(0,m.cn)("w-full rounded-sm border-gray-500 py-2.5 text-sm",{"border-error focus:border-error":I.confirmPassword,"border-primary":j("confirmPassword")&&!I.confirmPassword}),...N("confirmPassword",{required:"Confirm Password is required",validate:e=>e===j("password")||"Passwords do not match"})}),(null==I?void 0:I.confirmPassword)&&(0,a.jsx)(u.default,{element:"span",variant:"body-xs",className:"text-red-500",children:null==I||null==(r=I.confirmPassword)?void 0:r.message})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(x.A,{id:"showPassword",checked:w,onChange:()=>_(e=>!e)}),(0,a.jsx)("label",{htmlFor:"showPassword",className:"text-primary-900 cursor-pointer text-sm",children:"Show Password"})]}),(0,a.jsx)(h.A,{size:"small",type:"submit",className:(0,m.cn)("w-full",{"pointer-events-none opacity-60":!k}),children:"Set a New Password"})]})}),S&&(0,a.jsx)(Y,{})]})},eE=(0,l.memo)(e=>{let{isMobileView:t,onClose:r,type:d,oldLogin:c}=e,u=(0,i.usePathname)(),p=(0,i.useSearchParams)(),f=p.get("email"),g=p.get("token"),x=(0,O.wA)(),v=d===n.Yj.POPUP,y=d===n.Yj.LANDING_PAGE,w=u===R.A.LOGIN_LANDING_PAGE||u===R.A.LOGIN_RESET_PASSWORD,b=(0,O.d4)(e=>e.auth),[_,S]=(0,l.useState)(o.SG.SIGNIN),[N,E]=(0,l.useState)(!1),[j,A]=(0,l.useState)(""),[I,k]=(0,l.useState)(!1),P=e=>{S(e)},T=()=>{sessionStorage.removeItem("socialLoginError"),localStorage.removeItem("redirectAfterLogin")},U=()=>{k(e=>!e),T()},G=(0,C.Ri)("authToken"),L=(0,l.useCallback)(async()=>{try{E(!0),await (0,z.signIn)("fetch-customer-details",{redirect:!1,token:G}),E(!1)}catch(e){E(!1)}},[G]);(0,l.useEffect)(()=>{_===o.SG.SIGNIN&&(null==b?void 0:b.customer)&&M()},[b]),(0,l.useEffect)(()=>{f&&g&&(y&&w?P(o.SG.SET_NEW_PASSWORD):v&&!w&&P(o.SG.SET_NEW_PASSWORD))},[f,g,y,v,w]);let M=()=>{x((0,ex.Mz)()),[o.SG.SIGNUP_SUCCESS,o.SG.SIGNIN,o.SG.RESET_PASSWORD_SUCCESS].includes(_)?(r(),T()):_===o.SG.SET_NEW_PASSWORD?(r(),T(),(0,i.redirect)(u)):U()},$=o.cR.includes(_);return(0,a.jsxs)("section",{className:(0,m.cn)({relative:t,"bg-opacity-grey fixed inset-0 z-50 flex items-center justify-center":v&&!t,"w-full":y}),onClick:M,children:[N&&(0,a.jsx)(F.A,{}),I&&(0,a.jsx)(eS.A,{title:"Do you want to close this process?",message:"You will lose your progress if you close now.",onCancel:U,onConfirm:_===o.SG.SIGNUP?()=>{L().then(()=>{P(o.SG.SIGNUP_SUCCESS),T()})}:r}),(0,a.jsxs)("div",{className:(0,m.cn)("grid overflow-hidden",{"grid-cols-10 gap-x-6":!t,"rounded-3xl bg-white lg:w-206":v}),onClick:e=>e.stopPropagation(),children:[!t&&(0,a.jsx)("div",{className:(0,m.cn)("relative h-137 w-full self
1-center",{"col-span-5 m-2":v,"col-span-4 hidden lg:block":y}),children:(0,a.jsx)(Q.CDNImage,{fill:!0,src:"/images/authImage.webp",alt:"ImageLogo",objectFit:"cover",className:(0,m.cn)({"rounded-l-3xl":v}),fetchPriority:"high"})}),(0,a.jsxs)("div",{className:(0,m.cn)("flex flex-col",{"col-span-5 gap-y-4 pt-6 pr-5 pb-2":!t&&v,"col-span-10 items-center justify-center py-2 lg:col-span-6":y}),children:[(0,a.jsxs)("div",{className:(0,m.cn)("flex w-full",{"justify-end":$,"justify-between":!$,"pb-3":t}),children:[!$&&(0,a.jsx)(e_,{currentScreen:_,onSwitch:P}),!t&&v&&(0,a.jsx)(h.A,{size:"small",type:"button",variant:"tertiary",children:(0,a.jsx)(s.u,{size:20,onClick:M,className:"text-secondary-100 cursor-pointer"})})]}),(0,a.jsxs)("div",{className:(0,m.cn)("flex h-full flex-col items-center justify-center",{"w-full max-w-[450px] px-4 py-10 lg:px-2":y,"px-2":v}),children:[_===o.SG.SIGNUP&&(0,a.jsx)(D,{onSwitch:P,isLoading:N,setLoading:E,userEmail:j,fetchCustomerDetails:L,type:d}),_===o.SG.SET_NEW_PASSWORD&&(0,a.jsx)(eC,{type:d,onSwitch:P}),_===o.SG.SIGNUP_SUCCESS&&(0,a.jsx)(W,{type:d,closeModal:r}),_===o.SG.RESET_PASSWORD_SUCCESS&&(0,a.jsx)(B,{email:j,closeModal:r,type:d}),o.Z8.includes(_)&&(0,a.jsx)(ew,{currentScreen:_,onSwitch:P,isLoading:N,setLoading:E,closeModal:r,setUserEmail:A,type:d,oldLogin:c})]})]})]})]})})},21693:(e,t,r)=>{r.d(t,{AC:()=>f,Dx:()=>i,Tt:()=>o,cT:()=>m,kQ:()=>l,oo:()=>d});var a=r(49322);r(87826);var n=r(28720),s=r(32321);function l(e){let t=e.replace(/\/$/,"");return t.includes(n.A.CHECKOUT_V2)||t.includes(n.A.CHECKOUT)||t.includes(n.A.SECURE_CHECKOUT)||t.includes(n.A.SECURE_CHECKOUT_V3)}function i(e,t){if(e.customAddress)return!0;let r=(0,s.Yf)(e);if(null==r){var a;return!!(e.postcode||e.googleAddress||(null==(a=e.street)?void 0:a.length))}return(0,s.Np)(t,r)}function o(e,t){var r;if(null!=t){let r=e.find(e=>Number(e.id)===Number(t));if(r)return r}return null!=(r=e.find(e=>e.default_shipping))?r:e[0]}function d(e,t){var r,a;if(null!=t){let r=e.find(e=>Number(e.id)===Number(t));if(r)return r}return null!=(a=null!=(r=e.find(e=>e.default_billing))?r:e.find(e=>e.default_shipping))?a:e[0]}(0,a.v)();let c=new Set(["firstname","lastname","fname","lname"]);function u(e){if("string"!=typeof e)return!0;let t=e.trim();return!t||c.has(t.toLowerCase())}function m(e,t){let r=u(e)?"":String(e).trim(),a=u(t)?"":String(t).trim();if(r&&a)return{firstname:r,lastname:a};if(r){let e=r.split(/\s+/).filter(Boolean);return e.length>1?{firstname:e[0],lastname:e.slice(1).join(" ")}:{firstname:r,lastname:a||r}}return a?{firstname:a,lastname:a}:null}function p(e,t){let{firstname:r,lastname:a}=function(e){let[t="",...r]=(null==e?void 0:e.split(" "))||[];return{firstname:t.trim(),lastname:r.join(" ").trim()}}(e);return u(r)?null:{firstname:r,lastname:u(a)?u(t)?r:String(t).trim():a}}function f(e,t){var r,a,n,s,l,i,o,d,c,u,f,g,h;let x=function(e){var t,r,a,n,s,l;let i=null!=(s=null==(t=e.firstName)?void 0:t.trim())?s:"",o=null!=(l=null==(r=e.lastName)?void 0:r.trim())?l:"",d=p(null==(a=e.shippingAddress)?void 0:a.recipientName,o);if(d)return d;let c=m(i,o);if(c)return c;let u=p(null==(n=e.billingAddress)?void 0:n.recipientName,o);return u||{firstname:i||"firstname",lastname:o||"lastname"}}(e),v=e.shippingAddress,y=(null==v||null==(r=v.countryCode)?void 0:r.trim())||(null==(a=e.countryCode)?void 0:a.trim())||"",w=null!=(c=null==v||null==(n=v.line1)?void 0:n.trim())?c:"",b=null!=(u=null==v||null==(s=v.line2)?void 0:s.trim())?u:"",_=null!=(f=null==v||null==(l=v.city)?void 0:l.trim())?f:"",S=null!=(g=null==v||null==(i=v.postalCode)?void 0:i.trim())?g:"",N=null==(o=e.phone)?void 0:o.trim(),C=null!=t&&String(t).trim()?String(t).trim():null;return{firstname:x.firstname,lastname:x.lastname,company:null!=(h=null==(d=e.businessName)?void 0:d.trim())?h:"",street:[w,b],city:_||"city",postcode:S,country_code:y,telephone:N||C||"+1"}}},24899:(e,t,r)=>{r.d(t,{M:()=>d});var a=r(36489),n=r(6829),s=r(50498),l=r(16760),i=r(34122);async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3,t=Date.now();for(;Date.now()-t<e;){var r,s,i,o,d;let e=await (0,a.getSession)(),t=(null==e||null==(s=e.user)||null==(r=s.customer)?void 0:r.token)||(null==e||null==(d=e.user)||null==(o=d.api_response)||null==(i=o.customer)?void 0:i.token)||"";if(t)return t;let c=(0,n.Ri)(l.wQ.AUTHTOKEN)||(0,n.Ri)("authToken")||"";if(c)return c;await new Promise(e=>setTimeout(e,100))}return(0,n.Ri)(l.wQ.AUTHTOKEN)||(0,n.Ri)("authToken")||""}async function d(e){var t,r,d;
1if("1"===(0,n.Ri)(i.Z.MergeCartDone))return;let c=await o();if(!c)return;let u=null!=(d=null!=(r=null!=(t=e.guestCartId)?t:(0,n.Ri)(l.wQ.SOURCE_MASKED_ID))?r:(0,n.Ri)("source_masked_id"))?d:"";try{if(await e.mergeCart({guestCartId:u,token:c}),e.mergeMeasurement){let t=await (0,a.getSession)(),r=(0,s.nI)(null==t?void 0:t.user);await e.mergeMeasurement(null!=r?r:null)}}catch(e){}}},28492:(e,t,r)=>{r.d(t,{A:()=>i});var a=r(12115),n=r(20063),s=r(16760),l=r(6829);function i(){let e=(0,n.usePathname)(),[t,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{r((()=>{let e=!!(0,l.Ri)(s.wQ.AGENT_MEASUREMENT_SESSION),t=!!(0,l.Ri)(s.wQ.AGENT_MEASUREMENT_AUTH_TOKEN);return e||t})())},[e]),t}},30340:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(95155),n=r(443),s=r(75355),l=r(70104),i=r(32321);let o=e=>{let{label:t,checked:r,onChange:o,className:d,iconClassName:c,iconSize:u=11,...m}=e;return(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-x-2",children:[(0,a.jsxs)("div",{className:"relative h-[18px]",children:[(0,a.jsx)(s.default,{placeholder:"",type:"checkbox",checked:r,onChange:o,className:(0,i.cn)("checked:bg-primary mt-0 h-4 w-4 cursor-pointer appearance-none rounded-sm !p-0",r?"border-0":"border border-gray-500",d),value:"",...m}),r&&(0,a.jsx)(n.S,{className:(0,i.cn)("absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transform text-white",c),size:u,strokeWidth:4})]}),t&&(0,a.jsx)(l.default,{variant:"body-sm",weight:r?"medium":"normal",children:t})]})}},47376:(e,t,r)=>{r.d(t,{F:()=>o});var a=r(12115),n=r(6829),s=r(16760),l=r(66656),i=r(50498);let o=()=>{let[e]=(0,l.wA)(),[t]=(0,l.h)();return(0,a.useCallback)(async r=>{let a=(0,n.Ri)(s.wQ.BOOKING_ID);if(a){let t;try{t=decodeURIComponent(a)}catch(e){t=a}try{let r=await e({guest_token:t}).unwrap();(0,n.Yj)(s.wQ.BOOKING_ID);let a="string"==typeof(null==r?void 0:r.booking_id)?r.booking_id.trim():"";a&&(0,n.TV)(s.wQ.BOOKING_ID,a,30),(0,i.TL)()}catch(e){}return}if(r)try{await t({booking_id:r}).unwrap(),(0,n.TV)(s.wQ.BOOKING_ID,r,30),(0,i.TL)()}catch(e){}},[e,t])}},51602:(e,t,r)=>{r.d(t,{X:()=>i});var a=r(88128),n=r(90735),s=r(23071),l=r(1815);let{useCheckEmailAvailabilityMutation:i}=n.tb.injectEndpoints({endpoints:e=>({checkEmailAvailability:e.mutation({query:e=>{let{storeCode:t,data:r}=e;return{url:"/rest/".concat(t,"/V1/customers/checkEmailAvailable"),method:"POST",body:r}},async onQueryStarted(e,t){let{dispatch:r,queryFulfilled:n}=t;try{let{data:e}=await n;r((0,a.E8)(e))}catch(e){(0,s.UG)(l.UU.SOMETHING_WENT_WRONG)}},transformErrorResponse(e){var t;return{data:null,message:null==e||null==(t=e.data)?void 0:t.message}}})})})},53333:(e,t,r)=>{r.d(t,{$$:()=>s,BU:()=>o,J:()=>m,PX:()=>d,Yz:()=>a,aT:()=>n,qk:()=>l,ru:()=>u,sn:()=>c,wF:()=>i});let a="\n    mutation loginByEmailOtpData($email: String!, $token: String!) {\n        loginByEmailOtpData(input: { email: $email, token: $token }) {\n        email\n        store_id\n        success\n        haserror\n        message\n        }\n    }\n",n="\n    mutation loginByEmailOtpData($email: String!, $token: String!, $flowContext: String!) {\n        loginByEmailOtpData(input: { email: $email, token: $token, flowContext: $flowContext }) {\n        email\n        store_id\n        success\n        haserror\n        message\n        }\n    }\n",s="\n  mutation verifyEmailOtp($otp: Int!, $email: String!, $storeId: Int!) {\n    verifyEmailOtp(input: { \n      otp: $otp, \n      email: $email, \n      store_id: $storeId \n    }) {\n      email\n      store_id\n      success\n      haserror\n      message\n    }\n  }\n",l="\n  mutation updateCustomerEmail($email: String!, $password: String!) {\n    updateCustomerEmail(email: $email, password: $password) {\n      customer {\n        customer_extra_fields {\n          id\n          store_id\n          group_id\n          website_id\n          updated_at\n          disable_auto_group_change\n          created_in\n          custom_attributes {\n            attribute_code\n            value\n          }\n          is_klaviyo_synced\n          rptoken\n        }\n        firstname\n        lastname\n        email\n        is_subscribed\n        default_billing\n        default_shipping\n        created_at\n        prefix\n        middlename\n        suffix\n        date_of_birth\n        taxvat\n        gender\n        addresses {\n          id\n          customer_id\n          firstname\n          lastname\n          street\n          city\n          postcode\n          telephone\n          default_billing\n          default_shipping\n          country_id\n          company\n          region_id\n          region {\n            region_code\n            region\n            region_id\n          }\n        }\n      }\n    }\n  }\n",i="\nmutation createCustomerV2($firstname: String!, $lastname: String!, $email: String!, $password: String, $is_subscribed: Boolean, $website_id: Int!, $klaviyo_source: String!, $token: String!, $custom_attributes: [CustomerAddressAttributeInput], $otp: String, $signUpType: String) {\n  createCustomerV2(\n    input: {firstname: $firstname, lastname: $lastname, email: $email, password: $password, is_subscribed: $is_subscribed, website_id: $website_id, klaviyo_source: $klaviyo_source, token: $token, custom_attributes: $custom_attributes, otp: $otp, signUpType: $signUpType}\n  ) {\n    customer {\n      customer_extra_fields {\n        id\n        store_id\n        group_id\n        website_id\n        updated_at\n        disable_auto_group_change\n        created_in\n        custom_attributes {\n          attribute_code\n          value\n        }\n        is_klaviyo_synced\n        rptoken\n      }\n      firstname\n      lastname\n      email\n      is_subscribed\n      default_billing\n      default_shipping\n      created_at\n      prefix\n      middlename\n      suffix\n      date_of_birth\n      taxvat\n      gender\n      addresses {\n        firstname\n        lastname\n        street\n        city\n        postcode\n        telephone\n        id\n        customer_id\n        default_billing\n        default_shipping\n        country_id\n        company\n        region_id\n        region {\n          region_code\n          region\n          region_id\n        }\n      }\n      token\n    }\n  }\n}",o="{\n  customer {\n    customer_extra_fields {\n      id\n      store_id\n      group_id\n      website_id\n      is_updated_profile\n      discount_percent\n      current_wallet_bal\n      custom_attributes {\n        attribute_code\n        value\n      }\n      total_number_of_order\n      last_transaction_date\n      last_transaction_value\
1n      life_time_purchase_value\n      rptoken\n      is_quotation_customer\n      allow_to_change_ref_order_number\n    }\n    firstname\n    lastname\n    email\n    is_subscribed\n    default_billing\n    default_shipping\n    created_at\n    addresses {\n      firstname\n      lastname\n      street\n      city\n      postcode\n      telephone\n      id\n      customer_id\n      default_billing\n      default_shipping\n      country_id\n      company\n      region_id\n      region {\n        region_code\n        region\n        region_id\n      }\n    }\n  }\n}",d="mutation updateCustomerV2($firstname: String!, $lastname: String!, $group_id: Int!, $website_id: Int!, $custom_attributes: [UpdateCustomerAttributeInput]) {\n  updateCustomerV2(\n    input: {firstname: $firstname, lastname: $lastname, group_id: $group_id, website_id: $website_id, custom_attributes: $custom_attributes}\n  ) {\n    customer {\n      customer_extra_fields {\n        id\n        store_id\n        group_id\n        website_id\n        updated_at\n        disable_auto_group_change\n        created_in\n        custom_attributes {\n          attribute_code\n          value\n        }\n      }\n      firstname\n      lastname\n      email\n      is_subscribed\n      default_billing\n      default_shipping\n      created_at\n      prefix\n      middlename\n      suffix\n      date_of_birth\n      taxvat\n      gender\n      addresses {\n        firstname\n        lastname\n        street\n        city\n        postcode\n        telephone\n        id\n        customer_id\n        default_billing\n        default_shipping\n        country_id\n        company\n        region_id\n        region {\n          region_code\n          region\n          region_id\n        }\n      }\n    }\n  }\n}",c="mutation resetPassword($email: String!, $resetPasswordToken: String!, $newPassword: String!) {\n  resetPassword(\n    email: $email\n    resetPasswordToken: $resetPasswordToken\n    newPassword: $newPassword\n  )\n}",u="mutation changeCustomerPassword($currentPassword: String!, $newPassword: String!) {\n  changeCustomerPassword(\n    currentPassword: $currentPassword\n    newPassword: $newPassword\n  ) {\n    email\n    message\n    status\n  }\n}\n",m="\nquery itemCommentData($input: itemCommentInput!) {\n  itemCommentData(input: $input) {\n    has_more_comment\n    items {\n      entity_id\n      status_label\n      status\n      historyuser\n      artwork_status\n      created_at\n      comment_type\n      is_itemlevel_comment\n      uploaded_comment\n      voiceNotes\n      artwork_images {\n        comment\n        image\n        preview_image\n      }\n      product_option {\n        label\n        value\n        option_price\n        code\n        value_code\n        is_option\n        file_name_prefix\n      }\n      product_warranty {\n        warranty_year_id\n        warranty_price\n      }\n    }\n  }\n}\n"},63257:(e,t,r)=>{r.d(t,{M:()=>n});var a=r(30926);let n=(0,a.createServerReference)("40b1110759f04960a0ed66ce0890f30fe8dec1b678",a.callServer,void 0,a.findSourceMapURL,"setNewPassword")},68290:(e,t,r)=>{r.d(t,{v:()=>s});var a=r(52963),n=r(6829);function s(){return{setEmailIdTrack:e=>{if(e)try{sessionStorage.setItem("emailId",e)}catch(e){}},setOrderDetailsTrack:e=>{if(e)try{sessionStorage.setItem("orderDetails",JSON.stringify(e))}catch(e){}},setCartIdTrack:()=>{try{let e=(0,n.Ri)("source_masked_id"),t=(0,n.Ri)("quoteId"),r=e||t;r&&sessionStorage.setItem("cartId",r)}catch(e){}},setClientIpTrack:async()=>{try{var e;let t=null!=(e=(0,n.Ri)(a.e.ClientIP))?e:"0.0.0.0";t&&sessionStorage.setItem("clientIp",t)}catch(e){}},clearIdentity:()=>{try{sessionStorage.removeItem("emailId"),sessionStorage.removeItem("orderDetails"),sessionStorage.removeItem("cartId"),sessionStorage.removeItem("clientIp")}catch(e){}}}}},72453:(e,t,r)=>{r.d(t,{Af:()=>y,I2:()=>g,J1:()=>b,Su:()=>p,ZA:()=>x,bL:()=>w,o0:()=>v,v3:()=>h,vb:()=>f});var a=r(16010);let n=null,s=null,l=null,i=null,o=null,d=null,c=null,u=null,m=null,p=e=>!!e&&o!==e&&(o=e,!0),f=e=>{e&&o!==e||(o=null)},g=e=>!!(e&&d===e),h=e=>{e&&(d=e)},x=e=>c||(c=e().finally(()=>{c=null})),v=(e,t)=>
1u&&m===e?u:(m=e,u=t().finally(()=>{m===e&&(u=null)})),y=(e,t)=>n&&s===e?n:(s=e,n=t().finally(()=>{s===e&&(n=null)})),w=(e,t)=>l&&i===e?l:(i=e,l=(0,a.fB)(t(),e).then(t=>((null==t?void 0:t.prices)&&h(e),t)).finally(()=>{i===e&&(l=null)})),b=e=>{e&&(i&&i!==e&&(l=null,i=null),d&&d!==e&&(e=>{e&&d!==e||(d=null)})(d))}},72509:(e,t,r)=>{r.d(t,{FQ:()=>i,sC:()=>s});var a=r(28720);let n=[a.A.CHECKOUT_V2,a.A.SECURE_CHECKOUT_V2,a.A.SECURE_CHECKOUT_V3];function s(e){return!!e&&n.some(t=>e.startsWith(t))}let l=[a.A.SECURE_CHECKOUT_V3];function i(e){return!!e&&l.some(t=>e.startsWith(t))}},75355:(e,t,r)=>{r.d(t,{default:()=>c});var a=r(95155),n=r(32321),s=r(12115),l=r(77011),i=r(15532),o=r(2582);let d=(0,s.forwardRef)((e,t)=>{let{type:r="text",placeholder:d,value:c,onChange:u,className:m="",...p}=e,[f,g]=(0,s.useState)(!1),h=(0,s.useMemo)(()=>"password"===r,[r]),{isDesktop:x}=(0,o.Q)();return(0,a.jsxs)("div",{className:"relative w-full",children:[(0,a.jsx)("input",{type:h?f?"text":"password":r,placeholder:d,...void 0!==c?{value:c}:{},...u?{onChange:u}:{},className:(0,n.cn)("w-full appearance-none rounded-lg border px-3 py-2 focus:outline-none",{"pr-10":h},m),style:x?{}:{fontSize:"16px",transform:"scale(1)",transformOrigin:"left center"},ref:t,...p}),h&&(0,a.jsx)("button",{type:"button",className:"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>g(!f),children:f?(0,a.jsx)(l.G,{size:20,weight:"bold"}):(0,a.jsx)(i.b,{size:20,weight:"bold"})})]})});d.displayName="InputField";let c=d},76122:(e,t,r)=>{r.d(t,{u:()=>o});var a=r(74644),n=r(77821),s=r(36489),l=r(12115);let i={wallet:a.Q.ADB_FOOTER_MY_ACCOUNT_WALLET,help:a.Q.ADB_FOOTER_MY_ACCOUNT_GET_HELP,referal:a.Q.ADB_TOP_MENU_REFERRALS};function o(e){let{data:t,status:r}=(0,s.useSession)();return{handleProtectedClick:(0,l.useCallback)((a,s)=>{let l=i[s];l&&(0,n.S)(l,{navigation_name:s,..."referal"===s?{user:{userType:"Guest User"}}:{}},!0),"loading"!==r&&((null==t?void 0:t.user)?window.location.assign(a):(localStorage.setItem("redirectAfterLogin",a),e()))},[t,r,e])}}},76567:(e,t,r)=>{r.d(t,{A:()=>d});var a=r(95155),n=r(47650),s=r(36219),l=r(70104),i=r(32321),o=r(96414);let d=e=>{let{title:t,message:r,onConfirm:d,onCancel:c,cancelLabel:u="Cancel",confirmLabel:m="Close",children:p,className:f,buttonsAlign:g="justify-between",fullWidthButtons:h=!0,closeOnOutsideClick:x=!0,buttonLayoutClassName:v,cancelButtonvariantType:y,confirmButtonvariantType:w}=e;return(0,o.A)(!0),n.createPortal((0,a.jsx)("div",{onClick:()=>{x&&(null==c||c())},className:(0,i.cn)("bg-opacity-grey fixed inset-0 z-[9999] flex items-center justify-center",f),children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"mx-4 flex w-full max-w-xl flex-col gap-y-3 rounded-lg bg-white p-6 shadow-lg",children:[(0,a.jsx)(l.default,{variant:"heading-4",weight:"medium",children:t}),(0,a.jsx)(l.default,{className:"mb-4",variant:"body-sm",children:r}),p||(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-2 lg:flex-row lg:gap-4",{left:"justify-start",right:"justify-end",center:"justify-center",between:"justify-between"}[g],v),children:[(0,a.jsx)(s.A,{variant:y||"secondary",size:"small",className:h?"w-full":"w-auto",onClick:e=>{e.stopPropagation(),null==c||c()},children:u}),(0,a.jsx)(s.A,{variant:w||"primary",size:"small",className:h?"w-full":"w-auto",onClick:e=>{e.stopPropagation(),null==d||d()},children:m})]})]})}),document.body)}},79031:(e,t,r)=>{r.d(t,{o:()=>n});var a=r(30926);let n=(0,a.createServerReference)("403d63210435934bc539426d07c3eccf5704c628c3",a.callServer,void 0,a.findSourceMapURL,"sendEmailOTP")},89146:(e,t,r)=>{r.d(t,{A:()=>y});var a=r(54717),n=r(16760),s=r(20063),l=r(6829),i=r(49322),o=r(12115),d=r(34122),c=r(71420),u=r(21693),m=r(72509),p=r(16010),f=r(72453),g=r(59736),h=r(22512),x=r(30926);let v=(0,x.createServerReference)("4084a0564b3c4a9571223ee20a0175fdb2accf5d6d",x.callServer,void 0,x.findSourceMapURL,"mergeCartWithMagentoCookies"),y=()=>{let e=(0,s.usePathname)(),{mutations:t}=(0,c._)(),r=(0,i.v)(),[x]=(0,a.R_)(),y=(0,u.kQ)(e),w=(0,m.sC)(e);return(0,o.useCallback)(e=>{let{guestCartId:a,token:s}=e;return(0,f.ZA)(async()=>
1{if("1"!==(0,l.Ri)(d.Z.MergeCartDone))try{let e=(0,h.w6)();e&&((0,l.Yk)(n.wQ.SOURCE_MASKED_ID),(0,l.Yk)(n.wQ.QUOTE_ID),(0,l.Yk)(d.Z.MergeCartDone));let i=e?await v({storeCode:r.storeCode,guestCartId:a||"",wishlistCookieId:"",isCheckoutPage:y,token:s}):await x({storeCode:r.storeCode,guestCartId:a||"",wishlistCookieId:"",isCheckoutPage:y,token:s}).then(e=>{var t;return{data:null!=(t=e.data)?t:null,error:e.error?"Merge cart failed":null}}),o=i.data;if(!(null==o?void 0:o.masked_id))return void i.error;if(e?(!(0,l.Ri)(n.wQ.SOURCE_MASKED_ID)&&o.masked_id&&(0,l.lc)(n.wQ.SOURCE_MASKED_ID,o.masked_id,30),!(0,l.Ri)(n.wQ.QUOTE_ID)&&o.quote_id&&(0,l.lc)(n.wQ.QUOTE_ID,String(o.quote_id),30),"1"!==(0,l.Ri)(d.Z.MergeCartDone)&&(0,l.lc)(d.Z.MergeCartDone,"1",30)):((0,l.lc)(n.wQ.SOURCE_MASKED_ID,o.masked_id,30),(0,l.lc)(n.wQ.QUOTE_ID,o.quote_id,30),(0,l.lc)(d.Z.MergeCartDone,"1",30)),(0,p.qx)(o.masked_id),(0,f.J1)(o.masked_id),(0,g.I)(o.masked_id),((0,l.Ri)(n.wQ.SOURCE_MASKED_ID)||o.masked_id)&&t.fetchCart(!1,!0),w)return void await (0,f.bL)(o.masked_id,()=>t.prepareCheckoutV2())}catch(e){}})},[y,w,x,t,r.storeCode])}},96414:(e,t,r)=>{r.d(t,{A:()=>n});var a=r(12115);function n(e){let{strategy:t="fixed"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.useEffect)(()=>{if(!e)return;if("overflow"===t){let e=document.documentElement.style.overflow,t=document.body.style.overflow;return document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",()=>{document.documentElement.style.overflow=e,document.body.style.overflow=t}}let r=window.navigator.userAgent,a=/iP(ad|hone|od)/.test(r)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,n=/^((?!chrome|android).)*safari/i.test(r),s=window.scrollY;document.body.style.position="fixed",document.body.style.width="100%",document.body.style.overflow="hidden",document.body.style.userSelect="none";let l=null;if(a&&n&&window.visualViewport){let e=()=>{let e=window.visualViewport.height<.9*window.innerHeight;e&&!l?(l=e=>e.preventDefault(),document.addEventListener("touchmove",l,{passive:!1})):!e&&l&&(document.removeEventListener("touchmove",l),l=null)};return window.visualViewport.addEventListener("resize",e),e(),()=>{var t;null==(t=window)||t.visualViewport.removeEventListener("resize",e),l&&document.removeEventListener("touchmove",l),document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",document.body.style.userSelect="",window.scrollTo(0,s)}}return()=>{document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",document.body.style.userSelect="",window.scrollTo(0,s)}},[e,t])}},98821:(e,t,r)=>{r.d(t,{$A:()=>i,E8:()=>u,N:()=>l,Oc:()=>o,k2:()=>c,rh:()=>d,tJ:()=>m});var a=r(28720);let n=new Set(["callback","oldLogin","error","error_source"]),s="socialLoginRedirect";function l(e){sessionStorage.setItem(s,JSON.stringify({url:e,at:Date.now()}))}function i(){let e=sessionStorage.getItem(s);if(sessionStorage.removeItem(s),!e)return null;try{let{url:t,at:r}=JSON.parse(e);if(Date.now()-r>9e5)return null;return t}catch(t){return e}}function o(e){return e.startsWith("http://")||e.startsWith("https://")?e:new URL(e,window.location.origin).href}function d(){let e=new URLSearchParams(window.location.search);for(let t of n)e.delete(t);let t=e.toString();return t?"".concat(window.location.pathname,"?").concat(t):window.location.pathname}function c(e){let{callback:t,loginSearchParams:r,isLandingPage:n,pid:s}=e;return t?m(t,r):n?a.A.MYACCOUNT_PROFILE:s?a.A.MYCART:d()}function u(e,t){let r=c(e);if(r===d())return;if(e.isLandingPage&&!e.callback&&t)return void t();let a=()=>window.location.assign(r);e.pid?setTimeout(a,2e3):a()}function m(e,t){let r;try{r=decodeURIComponent(e)}catch(t){r=e}let a=new URLSearchParams;for(let[e,r]of t.entries())!n.has(e)&&(a.has(e)||a.set(e,r));let s=a.toString();return s?"".concat(r,"?").concat(s):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.