PageSourceSearch

https://maunaloa.com/cdn/shopifycloud/checkout-web/assets/c1/component-PickupPoint.Dm47aLjN.js

js maunaloa.com collected 2026-10-01 13:08:19 UTC 22,386 bytes, 1 lines download raw bytes

1import{e as ae,T as z,q as S,h as D,u as e,n as Ue,A as ee,Y as ue,X as qe,g as te,x as Ve,S as Z,k as F,a as pe}from"./esnext-vendor.BDPAaZdq.js";import{cn as re,K as _e,f6 as Pe,f7 as je,ct as We,bq as Ge,bp as Ke,c as x,F as oe,l as se,ad as Xe,cU as Ce,O as Le,M as Se,I as ie,f8 as Ye,a2 as Qe,B as G,P as R,o as B,aG as Je,cu as Ze,eg as ne,a5 as et,h as tt,v as me,a3 as ot,H as nt,U as he,b as ge,L as at}from"./hydrate.B0xlt2dG.js";import{O as I,Q as ce,eu as st,bi as it,aa as rt,ev as ct,E as lt,ew as dt,ce as Ie,cm as ut,bh as we,ex as Te,a8 as pt,P as Ae,G as fe,ey as mt,ez as ht}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{P as xe}from"./PendingShipping.2eopPL-C.js";import{A as gt,q as be,r as ft,t as bt}from"./components-VatNumberValidationField.mzwVZP7U.js";import{F as yt,a as kt}from"./FormLayout.CMVyKzjL.js";import{M as vt}from"./BillingAddressForm.aTSlVDrG.js";import"./app.D1P6yWfp.js";import{b as _t}from"./Choice.BIzIW4rp.js";import{C as Pt}from"./EmptyState.b83C9ddY.js";import{u as Ct}from"./localization-index.Bo8bPuxq.js";import{P as Lt,m as St,a as It,M as wt}from"./Map.kNoqIdtR.js";import{g as Tt,a as At,D as N}from"./utilities-dates.ChO2GdxN.js";import{a as xt}from"./hooks-useShouldRevealCustomization.wOAvQfO_.js";import"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./useShopPayButtonClassName.nv37ytUz.js";import"./addresses-is-address-empty.Ch6V3XcM.js";import"./AddressPresenter.B0qw2vWQ.js";import"./hooks-useForceShopPayUrl.F3deeEs7.js";import"./ChangeCompanyLocationLink.Ci5U9F_D.js";import"./Checkbox.CiixBh9Z.js";import"./shop-pay-installments-monorail.D0Myc1k_.js";import"./PhoneField.ykPh8SPx.js";import"./hooks-useSuppressShopPayModalOnLoad.brztd70E.js";import"./ImpressionEventCapture.iMEQlBKs.js";import"./ShopPayLogo.Cut4IRi6.js";import"./hooks-useWalletsTimeout.i08rvNYN.js";import"./hooks-usePostPurchase.BPY08f0g.js";import"./hooks-useWalletsMonorailTrack.CvfUTPBc.js";import"./hooks-useShopPayNewSignupLoginExperiment.CrD2gvGR.js";import"./cross-border-hooks.DVubeg9N.js";import"./Section-SectionStyleOverride.CP0VFRId.js";import"./utilities-publishMessage.BORnEDuA.js";import"./utilities-stable-ref.Dvd2X3ul.js";import"./TransitionHeight.M5zGQYzu.js";import"./AutocompleteField-hooks.D2O1AcIY.js";
1import"./Popover.BUTwaoOa.js";import"./amazon-pay-useAmazonPayPaymentLine.BXwZMsYY.js";import"./helpers-credit-card-disabled.BnSr1GsQ.js";import"./hooks-useStableHostMethodsReferences.DLE4q0sj.js";const Et=Le("AutocompleteSingleAddressField");function Mt({onSearch:t,loading:o,addressAutoFocus:c}){const i=ae(""),{i18n:l,observability:d,shop:{shippingCountries:a}}=I(),{geolocation:p}=re(),{locationAddress:n}=ce(),s=z(()=>st({countryCode:void 0,address:void 0}),[]),r=it(n.fields.countryCode,s.countryCode),{details:h,loading:y}=rt(r.value),f=ct(),m=z(()=>h??p.country,[h,p.country]),k=s.address.value,P=z(()=>a?.length?a:[{value:m.code,label:m.name}],[a,m]),u=y||o,b="location address",C=_e(void 0,Et),w=l.translate("pickup_point.search_button"),v=l.translate("pickup_point.address_label"),E=S(g=>lt(g,m,["company","firstName","lastName","phone","countryCode","zoneCode"]),[m]),M=n.value,V=i.value;D(()=>{r.value&&f("auto-selected",r.value,"pickupPoint")},[]),D(()=>{const g=n.value;i.value=E(g)},[n,E,i]);const A=Pe(n);Nt(n,s);const L=m.zones,$=()=>{L.length||(M.zoneCode=void 0),t(M)},K=g=>{A({countryCode:g}),s.address.value=void 0,f("user-input",g,"pickupPoint")},T={errors:s,state:{countryCode:n.fields.countryCode,address:i}},H=je()?.checkoutProfile.hasOverrides.value;return e(Ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(We,{...T,children:e(yt,{children:[e(kt,{children:e(vt,{interactive:!H,children:e(Ge,{name:"countryCode",label:m.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:o,...r,onChange:g=>K(g),children:P.map(g=>e(Ke,{value:g.value,children:g.label},g.value))})})}
1),e(x,{gap:"small-400",children:[e(oe,{gap:"small-400 base",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[e(gt,{addressType:"pickup",autoFocus:c,address:M,error:!!k,country:m,name:b,id:C,label:v,onSelect:g=>{const X=dt(g.countryCode),Y=!!(g.countryCode&&!X);Y&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:g.countryCode,fallbackCountryCode:r.value});const j=Y?{...g,countryCode:r.value}:{...g,countryCode:X};i.value=E(j),A(j)},value:V,onInput:g=>{g?s.address.value=void 0:i.value=""},onChange:g=>i.value=g,field:"address1",allowAllCountries:!0}),e(se,{variant:"primary",disabled:!M.coordinates||!V,onClick:$,loading:u,children:w})]}),k&&e(Xe,{controlID:C,children:k?.message??k})]})]})})})}function Nt(t,o){const{i18n:c,observability:i}=I();Ie(async({reason:l})=>{if(l==="negotiation")return{behavior:"allow"};const d=t.peek(),a=new Map;return d.coordinates||a.set("address",c.translate("field_errors.address_address1_blank")),ut(d.countryCode)||a.set("countryCode",c.translate("field_errors.address_country_blank")),a.size?(i.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(a).map(([,p])=>p)}),{behavior:"block",reason:we.InvalidLocalPickupAddress,perform:()=>{Ue(()=>{for(const[p,n]of a)o[p].value=n})}}):{behavior:"allow"}})}var O={Tabs:"qbjone5",TabList:"qbjone7 qbjone6 _1fragem64 _1fragemy6 _1fragem133 _1fragem1y",Tab:"qbjone9 qbjone8 _1fragempu _1fragemrn _1fragemo1 _1fragemtg _1fragemws _1fragem64 _1fragembj _1fragem19 _1fragemyk",TabPanel:"qbjonec qbjoneb _1fragemy6 _1fragem133",tabSelected:"qbjonea",inert:"qbjoned _1fragemz0"};const zt=Le("Tabs"),Ee=qe(null);function Rt({tabs:t,selected:o,ariaLabel:c,onChange:i,children:l}){const d=_e(void 0,zt),a=ee(null),p=t.length-1,n=ue.count(l),s=S(f=>{const m=o-1<0?p:o-1,k=o+1>p?0:o+1,u=new Map([["ArrowLeft",m],["Left",m],["ArrowRight",k],["Right",k],["Home",0],["End",p]]).get(f.key);u!=null&&(f.preventDefault(),i(u))},[i,o,p]);D(()=>{const{current:f}=a;if(f!=null)return f.addEventListener("keydown",s,!1),()=>{f.removeEventListener("keydown",s,!1)}},[a,s]),D(()=>{n!==t.length&&console.warn(`<Tabs /> has ${t.length} tabs and ${n} children. A mismatch will cause some content to be unavailable.`)},[n,t.length]);const r=[],h=[];ue.forEach(l,(f,m)=>{const k=t[m];if(k!=null){const{label:P,icon:u}=typeof k=="string"?{label:k,icon:void 0}:k;r.push(e(Bt,{label:P,icon:u,selected:o,onChange:i,id:d,index:m},P))}h.push(e(Dt,{index:m,children:f}))});const y=z(()=>({id:d,selected:o}),[d,o]);return e(Ee.Provider,{value:y,children:e("div",{className:O.Tabs,children:[e("div",{ref:a,role:"tablist","aria-label":c,className:O.TabList,children:r}),h]})})}function Bt({label:t,icon:o,index:c,selected:i,onChange:l,id:d}){if(c==null)throw new Te("`index` is missing");const a=ee(null),p=ee(!1),n=i===c,s=o==null?t:e(x,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(ie,{type:o}),e("span",{children:t})]}),r=Se(),h=()=>r?-1:n?0:-1;return D(()=>{a.current&&n&&p.current?a.current.focus():p.current=!0},[a,n]),e("button",{type:"button",role:"tab","aria-selected":n,id:`${d}Tab${c}`,"aria-controls":`${d}TabPanel${c}`,onClick:()=>l(c),className:te(O.Tab,n&&O.tabSelected,r&&O.inert),ref:a,tabIndex:h(),"aria-hidden":r?!0:void 0,children:s})}function Dt({index:t,children:o}){const{selected:c,id:i}=Ft(),l=c===t,d=Se();return e("div",{role:"tabpanel",id:`${i}TabPanel${t}`,"aria-labelledby":`${i}Tab${t}`,hidden:!l,className:te(O.TabPanel,d&&O.inert),children:o})}function Ft(){const t=Ve(Ee);if(t==null)throw new Te("No tabs found in context");return t}function Me(){const{shop:t}=I(),{rowsInset:o}=Ye(),{main:{section:c}}=Qe();return!t.hasFlagEnabled(pt)||o?be(void 0):be(c?.padding)}const Ot="Ak386",$t="IKBAC",Ht="BONgC",J={Paginator:Ot,PaginatorCaption:$t,Button:Ht};function Ne({page:t,pageCount:o,currentPageLabel:c,onPageChange:i,firstPage:l=1}){const{i18n:d}=I(),a=S(s=>()=>{i(t+s)},[t,i]),p=t<=l,n=t>=o+l-1;return e("div",{className:J.Paginator,children:[e("div",{className:J.Button,children:e(se,{onClick:a(-1),disabled:p,variant:"plain",inlineSize:"fill",accessibilityLabel:d.translate("pickup_point.paginator.previous_accessibility_label"),children:e(ie,{type:"arrow-left"})})}),e(G,{className:J.PaginatorCaption,accessibilityRole:"status",children:e(R,{children:c})}),e("div",{className:J.Button,children:e(se,{onClick:a(1),disabled:n,variant:"plain",inlineSize:"fill",accessibilityLabel:d.translate("pickup_point.paginator.next_accessibility_label"),children:e(ie,{type:"arrow-right"})})})]})}function Ut({businessHours:t}){const{i18n:o}=I();return e(x,{gap:"small-400",children:t?e(Z,{children:[e(R,{type:"small",children:e(B,{type:"strong",children:o.translate("pickup_point.business_hours")})}),e(qt,{businessHours:t})]}):e(R,{type:"small",color:"subdued",children:o.translate("pickup_point.no_business_hours")})})}function qt({businessHours:t}){const o=Je(),{i18n:c}=I(),{geolocation:i}
1=re(),l=z(()=>Tt(i?.country.code),[i]),d=At(l),a={};if(d.forEach(s=>{a[N[s]]=t.filter(r=>r.day===N[s].toUpperCase())}),d.every(s=>{const r=a[N[s]];return r.length===1?r[0].openingTime==="00:00"&&r[0].closingTime==="23:59":!1}))return e(B,{size:"small",color:"subdued",children:c.translate("pickup_point.open_twenty_four_hours")});const n=[];return d.forEach(s=>{if(n.push(e(B,{size:"small",children:[o(N[s].toLowerCase()),":"]},`${N[s]}-day`)),a[N[s]].length===0)n.push(e(B,{size:"small",children:c.translate("pickup_point.location_is_currently_closed")},`${N[s]}-closed`));else{let r="";a[N[s]].forEach(h=>{r=`${r}${r===""?"":", "}${h.openingTime} - ${h.closingTime}`}),n.push(e(B,{size:"small",children:r},`${N[s]}-hours`))}}),e(oe,{gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gap:"none base",children:n})}const Vt="k0DAZ",jt="tqSRi",W={LocationName:Vt,Capitalized:jt};function ze({pickupPoint:t,displayExtraDetails:o}){const{i18n:c}=I(),i=Ct(),{pickupLocation:l}=t,d=Ze(l.address,{hiddenFields:["countryCode"]}),a=!l.fromDeliveryOptionGenerator,p=(s,r)=>s===0?c.translate("shipping.free_rate_label"):c.formatCurrency(s,{form:"short",currency:r}),n=t.cost.amount===0?"uppercase":void 0;
1return e(x,{gap:"small-100",children:[e(oe,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 75%) minmax(0, 25%)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-400",children:[e(x,{gap:"small-500",children:[e(x,{children:[e(R,{children:i?e(B,{type:"strong",children:e("span",{className:te(W.LocationName,a&&W.Capitalized),children:a?l.name?.toLowerCase():l.name})}):e("span",{className:te(W.LocationName,a&&W.Capitalized),children:a?l.name?.toLowerCase():l.name})}),e(R,{color:i?void 0:"subdued",type:"small",children:e("span",{className:a?W.Capitalized:void 0,children:a?d?.toLowerCase():d})})]}),e(Lt,{pickupLocation:l})]}),e(x,{children:e(R,{textAlign:"end",children:e(B,{letterCase:n,type:"strong",children:p(t.cost.amount,t.cost.currencyCode)})})})]}),o&&e(Ut,{businessHours:l.businessHours})]})}const Wt="ErqSa",Gt={PickupPointList:Wt};function Kt({pickupPoints:t,index:o,displayExtraDetails:c}){const{i18n:i}=I(),l=Me(),{selectedPickupPoint:d,setProposedPickupPoint:a}=ne(),p=S(([v=""])=>{a({pickupPointHandle:v})},[a]),n=d?.handle,s=z(()=>n?[n]:[],[n]),r=6,h=S(v=>{const E=t.findIndex(M=>M.handle===v);return Math.floor(E/r)+1},[t]),[y,f]=F(n?h(n):1),m=S(v=>{f(v)},[]),k=z(()=>t.slice((y-1)*r,y*r),[t,y,r]),P=Math.ceil(t.length/r),u=(y-1)*r+1,b=Math.min(y*r,t.length);D(()=>{n&&f(h(n))},[n,h,o]);const C=t.length===0?i.translate("pickup_point.no_pickup_points_found"):i.translate("pickup_point.paginator.header",{first:u,last:b,count:t.length}),w=t.length===0?i.translate("pickup_point.no_pickup_points_found"):i.translate("pickup_point.paginator.selected_page",{first:u,last:b,count:t.length});return e("div",{className:Gt.PickupPointList,children:e(Pt,{name:"pickup-points-choice-list",values:s,onChange:p,itemPadding:l,children:[e(G,{padding:"small-100",borderWidth:"none none base none",accessibilityRole:"status",children:e(R,{textAlign:"center",children:C})}),k.map(v=>e(_t,{value:v.handle,children:e(ze,{pickupPoint:v,displayExtraDetails:!!(c&&v.handle===n)})},v.handle)),e(G,{borderRadius:"none none base base",children:e(Ne,{page:y,pageCount:P,currentPageLabel:w,onPageChange:m})})]})})}const Xt="/cdn/shopifycloud/checkout-web/assets/c1/assets/buyer-pin.BsPJAGmj.svg",Yt="/cdn/shopifycloud/checkout-web/assets/c1/assets/default-selected-pin.fbcUsoX1.svg",Qt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-chronopost.TKRkq9_v.svg",Jt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-colissimo.1yFHbzUT.svg",Zt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-correos.DHRxeQWp.svg",eo="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-dhl-germany.3lasOaUi.svg",to="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-evri.WlT4T36l.svg",oo="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-mondial-relay.04frVi7X.svg",no="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-poste-italiane.DfqidTJc.svg",ao="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-royal-mail.Dc9nPZcO.svg",so="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-chronopost.DPQXXY3U.svg",i
1o="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-colissimo.C-XQBcDy.svg",ro="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-correos.BZokoSyh.svg",co="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-dhl-germany.BLjj-dhz.svg",lo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-evri.DReFb6kT.svg",uo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-mondial-relay.DFe24aCF.svg",po="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-poste-italiane.DvDScNXR.svg",mo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-royal-mail.DxmaQMQN.svg",le={colissimo:{mapLogo:Jt,pin:io},correos:{mapLogo:Zt,pin:ro},mondial_relay:{mapLogo:oo,pin:uo},chronopost:{mapLogo:Qt,pin:so},hermes_uk:{mapLogo:to,pin:lo},poste_italiane:{mapLogo:no,pin:po},royal_mail:{mapLogo:ao,pin:mo},dhl_germany:{mapLogo:eo,pin:co}};function ho(t){return!!le[t]}function go(t){return le[t]?.mapLogo}function fo(t){return le[t]?.pin}const bo="VVdZM",yo={PickupPointMap:bo},ye=[{horizontal:15,vertical:0},{horizontal:-15,vertical:0},{horizontal:0,vertical:-15},{horizontal:0,vertical:-15}],ke=6378,ve=2/1e3,ko={drag_end:"checkout_pickup_point_map_dragend"};function vo(t,o){const c={latitude:0,longitude:0},i=o.filter(a=>Math.abs(a.latitude-t.latitude)<ve&&Math.abs(a.longitude-t.longitude)<ve).length;if(i===0)return c;const l=Math.min(i,ye.length)-1,d=ye[l];return c.longitude=d.horizontal/1e3/ke*(180/Math.PI)/Math.cos(t.latitude*Math.PI/180),c.latitude+=d.vertical/1e3/ke*(180/Math.PI),c}function _o(t){const{source:o,userEvents:c,shop:{id:i},checkout:{identity:l}}=I(),d=Ae().buyerIdentity.value?.customerProfile,a=Po(l);function p(n){c.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:o.checkoutSessionIdentifier||"",eventType:ko[n],shopId:parseInt(fe(i),10),numberLocationsFound:t,userId:d?.id?parseInt(fe(d.id),10):void 0,checkoutSurface:a}})}return{trackPickupPointMapInteraction:p}}function Po(t){return t.current.value==="shopPay"?"shop_pay":"guest_checkout"}function Co({onPickupPointSelect:t}){const{i18n:o}=I(),c=xt(),{pickupPoints:i,selectedPickupPoint:l}=ne(),{trackPickupPointMapInteraction:d}=_o(i.length),a=l?.handle,{locationAddress:p}=ce(),n=p.fields.coordinates.peek(),s=[],r=i.map((u,b)=>{const C=u.pickupLocation,w=a===u.handle,v=ho(C.carrierCode),E=w?k(v,C):P(v,C),A=w?{width:68,height:78}:v?{width:40,height:40}:{width:30,height:30},L={latitude:C.address.coordinates?.latitude||0,longitude:C.address.coordinates?.longitude||0},$=vo(L,s);return s.push(L),{title:C.name,label:C.carrierName,blockInfoWindow:!0,position:{lat:L.latitude+$.latitude,lng:L.longitude+$.longitude},zIndex:w?1001:0,image:E,style:A,id:u.handle,notInBounds:!w&&b>5,clusterable:!w}}),h={lat:n?.latitude??0,lng:n?.longitude??0};r.push({id:"buyer",image:Xt,notInBounds:!1,position:h,style:{width:36,height:36},blockInfoWindow:!0,clusterable:!1,zIndex:1e3});const y=r.find(u=>u.id===a)?.position||h,f={clustererOptions:{averageCenter:!0,clusterClass:"pickup_point_map__cluster",styles:{height:32,width:32,textColor:"#ffffff",textSize:16,textLineHeight:32,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"}},mapOptions:{gestureHandling:"greedy",scrollwheel:!0,center:y,boundsPadding:0,panToCenter:!0,maxZoom:19,styles:c?St:It}},m=o.translate("delivery_options.pickup_point_map_title");return e(wt,{className:yo.PickupPointMap,markers:r,title:m,onMarkerSelect:t,options:f,blockSize:286,handleDragEnd:()=>d("drag_end")});function k(u,b){return u?fo(b.carrierCode):Yt}function P(u,b){return u?go(b.carrierCode):b.carrierLogoUrl}}function Lo({negotiating:t}){const{i18n:o,shop:c}=I(),i=Me(),l=c.hasFlagEnabled(mt),[d,a]=F(l?1:0),[,p]=F(null),{selectedPickupPoint:n,pickupPoints:s,setProposedPickupPoint:r}=ne(),h=S(u=>{r({pickupPoint:s[u-1]}),p(s[u-1]?.handle)},[r,s]),y=S(u=>{const b=String(u);r({pickupPointHandle:b}),p(b)},[r,p]),f=n,m=z(()=>s.findIndex(u=>u.handle===f?.handle)+1,[s,f?.handle]);if(t)return e(xe,{text:o.translate("pickup_point.waiting_on_pickup_point_location_notice")});const k=s.length===0?o.translate("pickup_point.no_pickup_points_found"):o.translate("pickup_point.paginator.selected_pickup_point_label",{pickup_point_index:m,count:s.length}),P=s.some(({pickupLocation:u})=>u.businessHours);return e(Rt,{tabs:[{label:o.translate("pickup_point.selector_tab_map"),icon:"map"},{label:o.translate("pickup_point.selector_tab_list"),icon:"list-bulleted"}],selected:d,onChange:a,ariaLabel:o.translate("pickup_point.selector_tabs"),children:[e(G,{children:[e(Co,{onPickupPointSelect:y}),e(Ne,{page:m,pageCount:s.length,currentPageLabel:k,onPageChange:h}),e(et,{}),f&&e(G,{padding:i,children:e(ze,{pickupPoint:f,displayExtraDetails:P})})]}),e(Kt,{pickupPoints:s,index:d,displayExtraDetails:P})]})}function gn({heading:t="auto"}){const{i18n:o}=I(),{geolocation:c}=re(),i=ee(!1),l=o.translate("pickup_point.title"),d=o.translate("pickup_point.or"),[a,p]=F(!1),n=ae(!1),s=n.value,{locationAddress:r}=ce(),h=r.peek(),y=Pe(r),{negotiate:f}=tt(),{pickupPoints:m,setProposedPickupPoint:k}=ne(),P=m.length>0&&!!h.coordinates&&!!h.countryCode,[u,b]=F(P?2:1),[C,w]=F(!P),v=Ae(),{value:E}=v.allViolations,{value:M}=v.deliveryNext,V=v.merchandiseLines,A=o.translate("pickup_point.pickup_unavailable_banner_title",{count:V.value?.lines.length??0}),L=o.translate("pickup_point.could_not_resolve_address"),$=M?.status==="unavailable"&&E?.some(({code:_})=>_==="DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE")?A:void 0,[K,T]=F($),H=ae(!!(h.coordinates&&h.countryCode)&&m.length===0),g=H.value,X=me("Checkout::PickupPoints::RenderBefore"),Y=me("Checkout::PickupPoints::RenderAfter"),j=z(()=>({isLocationFormVisible:u===1}),[u]),U=S(_=>{T(Q=>Q===_?void 0:Q)},[T]);D(()=>(i.current=!0,()=>{i.current=!1}),[]);const q=S(()=>{w(!1),H.value=!0,f({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],silenceViolations:["delivery-method"],onComplete:_=>{switch(_.status){case"success":case"error":if(i.current&&(H.value=!1,_.negotiated.deliveryNext))switch(_.negotiated.deliveryNext.status){case"filled":case"partial":_.negotiated.deliveryNext.lines.length>0?(b(2),n.value=!0,U(A)):(T(A),b(1),n.value=!1);break;case"unavailable":T(A),b(1),n.value=!1;break;default:pe(_.negotiated.deliveryNext)}break;
1case"fetch_failed":case"invalid":case"stale":case"denied":case"throttled":case"tooManyRequests":case"alreadyCompleted":break;default:pe(_)}}})},[n,f,H,A,U]);D(()=>{h.coordinates&&h.countryCode&&C&&(m&&m.length>0?(b(2),n.value=!0):q())},[b,h,q,m,C,n]);const Re=S(_=>{if(!ht(_)){T(L);return}U(L),y({zoneCode:c.zone?.code,countryCode:c.country.code,coordinates:{latitude:_.coords.latitude,longitude:_.coords.longitude}}),q()},[c,y,q,T,U,L]),Be=S(({zoneCode:_,countryCode:Q,coordinates:de,address1:Fe,address2:Oe,city:$e,postalCode:He})=>{T(void 0),y({zoneCode:_,countryCode:Q,coordinates:de,address1:Fe,address2:Oe,city:$e,postalCode:He}),de?(q(),U(L)):T(L)},[L,y,q,U]);So(m.length>0);const De=S(()=>{T(void 0)},[]);return e(Ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(ot,{accessibilityLabel:l,children:e(x,{gap:"small-400",children:[t==="auto"&&e(nt,{level:2,autoFocus:s,children:l}),t==="text"&&e(B,{color:"subdued",children:l}),e(he,{customizations:X,options:j,render:_=>e(x,{padding:"small-500 none none none",gap:"small-100",children:_})}),u===1&&!g&&e(Z,{children:[e(ge,{blockSize:"small-500"}),e(ft,{onSuccess:Re,onLocateStart:De}),e(R,{textAlign:"center",color:"subdued",children:d}),e(Mt,{loading:!1,onSearch:Be,addressAutoFocus:a}),K&&e(x,{gap:"base",padding:"small-200 none none none",children:e(bt,{heading:K})})]}
1),u===2&&!g&&e(Z,{children:[e(oe,{gap:"@media (inline-size >= medium) large-500, none",gridTemplateColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gridAutoColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",justifyContent:"start",justifyItems:"start",alignItems:"start",alignContent:"start",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[e(R,{color:"subdued",children:m.length===0?o.translate("pickup_point.no_pickup_points_near_location"):o.translate("pickup_point.number_of_pickup_points_near_location",{count:m.length})}),e(at,{onClick:()=>{b(1),p(!0),n.value=!1,y({zoneCode:h.zoneCode,countryCode:h.countryCode,coordinates:void 0}),k({pickupPoint:void 0})},children:o.translate("pickup_point.change")})]}),e(Lo,{negotiating:g})]}),g&&e(Z,{children:[e(ge,{blockSize:"small-500"}),e(xe,{text:o.translate("pickup_point.waiting_on_pickup_point_location_notice")})]}),e(he,{customizations:Y,options:j})]})})})}function So(t){const{observability:o}=I();Ie(async({reason:c})=>c==="negotiation"?{behavior:"allow"}:t?{behavior:"allow"}:(o.leaveErrorBreadcrumb("No pickup points available"),{behavior:"block",reason:we.NoPickupPointsAvailable,perform:()=>{}}))}export{gn as default};

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.