1import{a as m}from"./hydrate.CF3IlSyD.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.BGrWgv25.js";import{n as a}from"./web-mcp-runtime.4iGSonTb.js";import{g as h}from"./components-RedirectionNotice.module.XF2fVaLS.js";import"./esnext-vendor.B9Da21W6.js";import"./graphql-PaymentSessionMutation.807ZZcCI.js";import"./app.DVBC5YLc.js";import"./hooks-useShopPayExternalAppContext.CNonvHyI.js";import"./hooks-useReplaceShopPayInHistory.BfnBLCN9.js";import"./cvv-cvvBridge.CvY2bpH5.js";import"./helpers-derivations.BmLWJT7d.js";import"./redemption-promotions.Cr0-LgwN.js";import"./context-browser.DUmhw5lG.js";import"./proposal-delegated-payment-instrument.DX_0Jhkr.js";import"./shared-shop-theme.CtIOcRWM.js";import"./consent-manager-shared.CjK3vJk9.js";import"./shared-receipt-mapper-load-recovery.BspPG4WN.js";import"./shared-receipt-eager-mappers.CU0TM0v6.js";import"./shared-report-graphql-error.DWC6yr6c.js";import"./shop-pay-normalizeBuyerDetails.BIor-Ol3.js";import"./amazon-pay-useAmazonPayPaymentLine.iEQTjs0u.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.