1import{a as m}from"./hydrate.B4yS4myh.js";import{E as l,G as y,B as f,H as C,I as k,J as P}from"./addresses-is-address-empty.BgqK_zG_.js";import{n as a}from"./web-mcp-runtime.EWEnBFgl.js";import{g as h}from"./components-RedirectionNotice.module.CtEG0YAw.js";import"./esnext-vendor.B9Da21W6.js";import"./graphql-PaymentSessionMutation.DJrmXbx9.js";import"./app.3xnYS5zI.js";import"./hooks-useShopPayExternalAppContext.DPMzO6wO.js";import"./hooks-useReplaceShopPayInHistory.DcFB3a73.js";import"./cvv-cvvBridge.hYfPqjG6.js";import"./helpers-derivations.Cr-il7Z-.js";import"./redemption-promotions.DLBLAp8j.js";import"./context-browser.Q2R3PORz.js";import"./proposal-delegated-payment-instrument.DdQUrP6a.js";import"./shared-shop-theme.COUCqJYi.js";import"./consent-manager-shared.CGK4EXDP.js";import"./shared-receipt-mapper-load-recovery.D65uooMz.js";import"./shared-receipt-eager-mappers.Djoi_CR2.js";import"./shared-report-graphql-error.BoF9YjQU.js";import"./shop-pay-normalizeBuyerDetails.D_U_lYsO.js";import"./amazon-pay-useAmazonPayPaymentLine.BNRz9asa.js";function K(o){return{resolvePickupLocality:t=>L(t,o),announcePickupLocality:t=>I(t,o)}}async function L(o,t){const i=await h(t);return g(o,i.current.call,t)}async function g(o,t,{shop:i,source:n,i18n:d}){const p=f(),s={locale:d.locale,requestToken:p,shopId:C(i.id),sourceId:n.sourceId||"",checkoutSessionIdentifier:n.checkoutSessionIdentifier||""},{data:u}=await t.search(o.postal_code,{...s,countryCode:o.address_country,location:void 0},k),c=(await Promise.all(u.slice(0,5).map(e=>t.fetchAddress(e.addressId,{...s,completionService:e.completionService,extendedFields:!1})))).filter(e=>e.countryCode===o.address_country&&a(e.postalCode)===a(o.postal_code)&&(!o.address_region||e.zoneCode===o.address_region)&&e.coordinates&&Number.isFinite(e.coordinates.latitude)&&Number.isFinite(e.coordinates.longitude)&&Math.abs(e.coordinates.latitude)<=90&&Math.abs(e.coordinates.longitude)<=180);if(new Set(c.map(({coordinates:e})=>JSON.stringify(e))).size!==1)return;const r=c[0];return P({countryCode:r.countryCode,zoneCode:r.zoneCode,postalCode:r.postalCode,city:r.city,coordinates:r.coordinates})}function I(o,t){const i=l(o.countryCode?t.checkout.address.countryDetails.get(o.countryCode):void 0,t.i18n);m({content:y(o,i,["company","firstName","lastName","phone","countryCode","zoneCode"]),role:"status"})}export{I as announcePickupLocality,K as createPickupLocalityServices,L as lookupPickupLocality,g as resolvePickupLocality};
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.