1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["libphonenumber-index.-6DjIQHS.js","exports-getCountryCallingCode.B1Uy0QN5.js"])))=>i.map(i=>d[i]); 2import{k as g,h as N,q as c,T as v,r as L,f as h,l as m,u as d,S as f}from"./esnext-vendor.D7ldIee_.js";import{_}from"./app.A60-IfPs.js";import{O as y,N as b,cM as U,bx as A,$ as I,b2 as k,d_ as O}from"./addresses-is-address-empty.-MuOhIyI.js";import{F as E,L as P,ca as M,M as S}from"./hydrate.ByRIsqvd.js";const w="US";function F(){const[e,s]=g(p);N(()=>{requestIdleCallback(async()=>{s(await R())})},[]);const o=c((t,n,r)=>{const a=C=>t.isSupportedCountry(C);return t.parsePhoneNumber(n,r&&a(r)?r:w)},[]),i=c((t,n)=>{try{if(e==null)return null;const r=o(e,t,n);return r.country==null||!r.isValid()?null:r.format("E.164")||null}catch{return null}},[e,o]),u=c((t,n,r=!1)=>{try{if(e==null)return!0;const a=o(e,t,n);return a.country==null||r&&!t.startsWith(`+${e.getCountryCallingCode(a.country)}`)?!1:a.isValid()}catch{return!1}},[e,o]);return{isPhoneNumberUtilLoaded:v(()=>!!e,[e]),validatePhoneNumber:u,formatPhoneNumber:i}}let p=null;async function R(){return p=await L(()=>_(()=>import("./libphonenumber-index.-6DjIQHS.js"),__vite__mapDeps([0,1]))),p}function B(){const{shippingAddress:e,billingAddress:s}=y();return h(()=>e.fields.countryCode.value||s.fields.countryCode.value||"")}function G(e){const s=m(F().validatePhoneNumber),o=m(e),{shippingAddress:i,billingAddress:u}=y();return h(()=>{const l=i.fields.phone.value,t=u.fields.phone.value,n=l||t;return n&&s.value(n,o.value)?n:null})}const V=S("legal-link-modal");function $({handle:e,tone:s}){const{embed:o,i18n:i,shop:{merchantPolicies:u}}=b(),l=i.translate("shop_policies",{scope:e.replace(/-/g,"_")}),{localPolicies:t}=U(),n=u.some(a=>a.handle===e)?t.find(a=>a.handle===e):void 0,r=E(void 0,V);return n?.url&&A(o?.embedder)?d(P,{tone:s,"aria-haspopup":"dialog",onClick:()=>{o?.client?.windowOpenRequest(n.url)},children:l}):n?d(f,{children:[d(P,{commandFor:r,tone:s,children:l}),d(M,{id:r,heading:l,defaultPolicy:n})]}):d(f,{children:l})}function W(){const e=I().buyerIdentity,{shop:s,source:o}=b();return h(()=>!!(s.customerAccountLocationsUrl&&o.type!=="draftOrder"&&!k(o)&&O(e.value?.purchasingCompany)))}export{$ as L,B as a,G as b,W as c,F 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.