1import{T as l,q as f,h as y,e as g,p as E,A}from"./esnext-vendor.DQ9BNaJe.js";import{T as P,I as S,D as b,a5 as C,fU as D,pm as T}from"./addresses-is-address-empty.BB1pvxM5.js";import{c as w,D as v,b as x}from"./amazon-pay-useAmazonPayPaymentLine.CsQac3SS.js";import{ca as N,f as U}from"./hydrate.D4A9Cb0p.js";function k(){let e,t;const n=new Promise((r,s)=>{e=r,t=s});return{get promise(){return n},resolve(r){e(r)},reject(r){t(r)}}}let m=null,u=null;function L({observability:e,url:t}){if(u)return u;const n=t.sandboxAutocomplete(),r={current:null},{promise:s,resolve:o}=k();if(u=s,!m){const a=c=>async d=>{e.leaveErrorBreadcrumb("Autocomplete iframe loaded",{url:n,event:JSON.stringify(d),time:Date.now(),specialId:c?.getAttribute(v)}),r.current=x(c,n,"autocomplete",e,{}),o(r)};m=w({id:"Autocomplete-IFrame",name:"Autocomplete-IFrame",url:n,privileges:["allow-scripts","allow-same-origin"],iframeSpecialId:b(),onLoad:a}),e.leaveErrorBreadcrumb("Autocomplete iframe created",{url:n,specialId:m.getAttribute(v)})}return u}function I(){const{observability:e,url:t}=P();return f(()=>L({observability:e,url:t}),[e,t])}function B(){const{shop:{id:e},source:{sourceId:t,checkoutSessionIdentifier:n}}=P(),r=I();return l(()=>{function s(){return{shopId:S(e),sourceId:t||"",checkoutSessionIdentifier:n||""}}return{async search(...o){return(await r()).current.call.search(...o)},async fetchAddress(...o){return(await r()).current.call.fetchAddress(...o)},async formatAddress(o){return(await r()).current.call.formatAddress(o,s())},async fetchCountriesWithPhoneNumberPrefix(o){return(await r()).current.call.fetchCountriesWithPhoneNumberPrefix(o,s())}}},[r,e,t,n])}function V(){const e=I();return l(()=>({async validation(...t){return(await e()).current.call.validation(...t)}}),[e])}const q=()=>{const{value:e}=C().deliveryNext,t=D(e,"ONE_TIME_PURCHASE"),n=t?.status==="available"?t:void 0,[r,s]=N({type:"ONE_TIME_PURCHASE",deliveryMethodType:"PICKUP_POINT"}),{negotiate:o}=U(),a=l(()=>n?.methods?.filter(i=>i.pickupLocation&&i.methodType==="PICKUP_POINT")??[],[n]),c=l(()=>a.find(({handle:i})=>i===r),[a,r]),d=f(({pickupPoint:i,pickupPointHandle:p})=>{const h=i??a.find(({handle:_})=>_===p);h&&(s(h.handle),o({}))},[a,s,o]);return y(()=>{if(a?.length<1)return;a.some(p=>p.handle===r)||s(a[0].handle)},[s,r,a]),{pickupPoints:a,selectedPickupPoint:c,setProposedPickupPoint:d}};var F=(e=>(e.C1InlineModal="c1_inline_modal",e.C1Modal="c1_modal",e.C1ModalShopPay="c1_modal_shop_pay",e.C1ModalShopPaySignIn="c1_modal_shop_pay_sign_in",e.PaymentRequest="payment_request",e))(F||{});function G(){const{shop:e,observability:t}=P(),n=e.hasFlagEnabled(T),r=f((s,o,a)=>{n&&t.log(s,`[ECP-SPI-DEBUG] ${o}`,a,{exportImmediately:!0})},[n,t]);return{enabled:n,log:r}}function K(e){const t=A();return y(()=>{t.current=e},[e]),t.current}function j(e){const t=g(void 0);return E(()=>{const n=e.value;return()=>{t.value=n}}),t}export{F as M,B as a,q as b,K as c,j as d,V as e,L as g,G as u};
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.