PageSourceSearch

https://lataco.com/_next/static/chunks/pages/_sites/[siteSlug]/shipping-112f242d0a72550c.js

js lataco.com collected 2026-09-24 17:11:26 UTC 8,159 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[233],{3759:e=>{e.exports={formWrapper:"AddressManager_formWrapper___pSMj",submitBtn:"AddressManager_submitBtn__8es6R",utilityBtn:"AddressManager_utilityBtn__vOD6o",btnLink:"AddressManager_btnLink__brbaQ",loadingWrapper:"AddressManager_loadingWrapper__eqoNC",item:"AddressManager_item__HaOMC",name:"AddressManager_name__hY_pE"}},37035:e=>{e.exports={wrapper:"ProgressMeter_wrapper__tX6xX",text:"ProgressMeter_text__DHWBl"}},44438:(e,s,a)=>{"use strict";a.d(s,{A:()=>g});var t=a(37876),r=a(14232),n=a(49995),i=a(61902),l=a(74363),d=a(40880),p=a(40958),c=a(10346),o=a(14462),u=a(98777),h=a(50287),_=a(3759),m=a.n(_);let g=e=>{let{customerData:s,customerId:a,siteSlug:_,refreshExpiration:g,expiration:x}=e,[f,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)({name:s.name||"",line1:s.addressLine1||"",line2:s.addressLine2||"",city:s.addressCity||"",state:s.addressState||"",postalCode:s.addressPostalCode||"",country:s.countryCode||""}),{name:A,line1:b,line2:N,city:S,state:k,postalCode:C,country:E}=v,[w,W]=(0,r.useState)(!0),[P,B]=(0,r.useState)(!1),[M,L]=(0,r.useState)(null),[T,H]=(0,r.useState)(null),q=(0,i.useElements)(),D=(0,i.useStripe)(),I=(e,s)=>{y(a=>({...a,[e]:s}))},O=async e=>{if(e.complete){let s;j(!0);try{s=await (0,l.A)({name:e.value.name,addressLine1:e.value.address.line1,addressLine2:e.value.address.line2,addressCity:e.value.address.city,addressState:e.value.address.state,addressPostalCode:e.value.address.postal_code,countryCode:e.value.address.country},a,_,null,x,g),L(h.A.Success),H("Address updated successfully."),W(!1)}catch(e){(0,d.v)(e,{siteSlug:_}),L(h.A.Error),H("Error updating address. Please try again.")}s&&(I("name",e.value.name),I("line1",e.value.address.line1),I("line2",e.value.address.line2),I("city",e.value.address.city),I("state",e.value.address.state),I("postalCode",e.value.address.postal_code),I("country",e.value.address.country),j(!1))}else L(h.A.Error),W(!0),H("Some required fields are missing. Please try again.")},X=async()=>{let e=null==q?void 0:q.getElement("address");e&&O(await e.getValue())};return((0,r.useEffect)(()=>{A&&b&&S&&C&&W(!1)},[A,b,N,S,C]),D&&q)?w||f?(0,t.jsxs)(t.Fragment,{children:[T?(0,t.jsx)(c.A,{msg:T,status:M}):null,P?(0,t.jsxs)("button",{type:"button",onClick:()=>{W(!1),B(!1)},className:m().btnLink,children:[(0,t.jsx)(o.A,{}),"Go back"]}):null,(0,t.jsxs)("form",{onSubmit:X,children:[(0,t.jsx)(i.AddressElement,{options:{mode:"shipping",defaultValues:{name:A,address:{line1:b,line2:N,city:S,state:k,postal_code:C,country:E}}},id:"address-element"}),(0,t.jsx)("button",{disabled:f||!D||!q,id:"submit",type:"submit",className:f?m().loadingWrapper:m().submitBtn,children:(0,t.jsx)("span",{children:f?(0,t.jsx)(p.A,{variant:u.A.Inline}):"Save"})})]})]}):(0,t.jsxs)("div",{className:m().wrapper,children:[(0,t.jsxs)("div",{className:m().inner,children:[(0,t.jsx)("p",{className:(0,n.A)(m().item,m().name),children:A}),(0,t.jsx)("p",{className:m().item,children:b}),N?(0,t.jsx)("p",{className:m().item,children:N}):null,(0,t.jsxs)("p",{className:m().item,children:[S,", ",k," ",C]}),E?(0,t.jsx)("p",{className:m().item,children:E}):null]}),(0,t.jsx)("button",{type:"button",onClick:()=>{W(!0),B(!0)},className:m().utilityBtn,children:"Edit"})]}):(0,t.jsx)(p.A,{variant:u.A.Inline})}},52066:(e,s,a)=>{"use strict";a.d(s,{A:()=>l});var t=a(37876),r=a(96043),n=a(37035),i=a.n(n);let l=e=>{let{step:s,total:a}=e,{hideCheckoutProgress:n=!1}=(0,r.A)();return n?null:(0,t.jsx)("div",{className:i().wrapper,children:(0,t.jsxs)("p",{className:i().text,children:["Step ",s," of ",a]})})}},67689:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>A,default:()=>b});var t=a(37876),r=a(4241),n=a(37062),i=a(4309),l=a(40880),d=a(69835),p=a(37036),c=a(98777),o=a(14232),u=a(89099),h=a(81249),_=a(20884),m=a(52066),g=a(40958),x=a(61902),f=a(44438),j=a(14462),v=a(77912),y=a.n(v),A=!0;let b=e=>{let{globalData:s}=e,{siteTitle:a,publisherFeatureFlags:{streetAddressCollection:v=!1}}=s,{push:A,query:{siteSlug:b}}=(0,u.useRouter)(),[N,S]=(0,o.useState)(null),[k,C]=(0,o.useState)(!1),[E,w]=(0,o.useState)(null),[W,P]=(0,o.useState)(null),{userData:{hydrated:B,validated:M,customerId:L,theme:T,expiration:H,refreshExpiration:q}}=(0,i.u)(),D=T===p.B.Dark?"night":"stripe",I=T===p.B.Dark?"#ffffff"
1:"#333333",O=(0,d.A)(D,I),X=(0,o.useCallback)(async()=>{if(L){let e=await fetch("/api/customer/".concat(L),{method:"GET",headers:{"Cache-Control":"no-cache"}});w(await e.json())}},[L]),F=(0,o.useCallback)(async()=>{try{let e=await fetch((0,n.c)("publisherStripe",{siteSlug:b})),{stripeKey:s,stripeAccount:a}=await e.json();if(!s||!a)return void S(null);let t=(0,r.c)(s,{stripeAccount:a});S(t)}catch(e){(0,l.v)(e,{siteSlug:b}),C(!0)}},[b]);return(0,o.useEffect)(()=>{if(B&&!M){var e,s,a,t;let r=null==(s=globalThis)||null==(e=s.document)?void 0:e.referrer,n=null==(t=globalThis)||null==(a=t.location)?void 0:a.origin;if(void 0===r||void 0===n||r.includes(n))A("/login");else{let e=encodeURIComponent("/shipping");A("/login?redirect=".concat(e))}}},[A,M,B,b]),(0,o.useEffect)(()=>{F()},[F]),(0,o.useEffect)(()=>{X()},[X]),(0,o.useEffect)(()=>{let{name:e,addressLine1:s,addressCity:a,countryCode:t}=E||{};e&&s&&a&&t&&P(!0)},[E]),(0,t.jsxs)(h.A,{...s,title:"".concat(a," | Shipping Address"),headerTheme:"simple",footerTheme:"simple",hideAds:!0,children:[(0,t.jsxs)("div",{className:y().pageHeader,children:[(0,t.jsx)("h1",{className:y().pageTitle,children:"Shipping Address"}),(0,t.jsx)(m.A,{step:2,total:3})]}),v?(0,t.jsxs)("div",{className:y().pageWrapper,children:[(0,t.jsx)("h2",{className:y().sectionHeading,children:"Your Address"}),(0,t.jsxs)("div",{className:y().inner,children:[(0,t.jsx)("p",{className:y().meta,children:"You are subscribing to a product that requires a shipping address."}),E?(0,t.jsx)(x.Elements,{options:{appearance:O},stripe:N,children:(0,t.jsx)(f.A,{customerData:E,customerId:L,siteSlug:b,expiration:H,refreshExpiration:q})}):(0,t.jsx)("div",{className:y().loadingWrapper,children:(0,t.jsx)(g.A,{variant:c.A.Inline})}),(0,t.jsxs)("div",{className:y().ctaWrapper,children:[(0,t.jsxs)(_.A,{href:"/products",className:y().btnLink,children:[(0,t.jsx)(j.A,{}),"Back to products"]}),W?(0,t.jsx)(_.A,{href:"/payment",className:y().paymentBtn,children:"Proceed to payment"}):(0,t.jsx)("p",{className:y().msg,children:"Complete shipping address to proceed to payment."})]})]})]}):(0,t.jsxs)("div",{className:y().pageWrapper,children:[(0,t.jsx)("p",{children:"Product does not require a shipping address."}),(0,t.jsxs)(_.A,{href:"/products",className:y().btnLink,children:[(0,t.jsx)(j.A,{}),"Back to products"]})]}),k?(0,t.jsx)("p",{children:"An error occurred. Please refresh the page or try again later."}):null]})}},69835:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{theme:e||"stripe",labels:"floating",variables:{fontFamily:"'IBM Plex Sans', Helvetica, sans-serif",borderRadius:"3px",colorTextSecondary:s||"#333333"},...a}}},73873:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_sites/[siteSlug]/shipping",function(){return a(67689)}])},74363:(e,s,a)=>{"use strict";a.d(s,{A:()=>r});var t=a(37062);let r=async(e,s,a,r,n,i)=>{let l=await fetch((0,t.c)("customer/update"),{method:"POST",headers:{"Content-type":"application/json","Cache-Control":"no-cache, must-revalidate, max-age=0"},body:JSON.stringify({customerData:e,customerId:s,siteSlug:a,avatar:r,expiration:n,refreshExpiration:i})});return l.ok?l.json():l}},77912:e=>{e.exports={pageHeader:"shipping_pageHeader__Lh6PZ",pageWrapper:"shipping_pageWrapper__aTgf5",pageTitle:"shipping_pageTitle___oQtU",pageSubtitle:"shipping_pageSubtitle__hnPHo",sectionHeading:"shipping_sectionHeading__ZnPZY",inner:"shipping_inner__cv9LM",ctaWrapper:"shipping_ctaWrapper__CywZE",priceWrapper:"shipping_priceWrapper__kCXf3",link:"shipping_link__824lG",paymentBtn:"shipping_paymentBtn__o2AaN",loadingWrapper:"shipping_loadingWrapper__oz_5s",meta:"shipping_meta__NKqk2",msg:"shipping_msg__Ndlq9",btnLink:"shipping_btnLink__pSMkJ"}}},e=>{e.O(0,[1596,6071,8528,1249,636,6593,8792],()=>e(e.s=73873)),_N_E=e.O()}]);

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.