const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["74775c2e.CEulVlAE.js","3ad72313.CQ3ZvzK7.js","89a70c1b.OxEzY3oz.js"])))=>i.map(i=>d[i]); import{a6 as e,_ as t,T as r,h as n,t as o,v as u,k as a,G as l}from"./2c1ab0fe.Dbn2KvkT.js";import{it as i}from"./164ad2e3.FTBuhkTQ.js";import{_ as c}from"./app.CooG55fE.js";function s({accessibilityRole:t,...r}){const n=i();return e(null==n?"h1":`h${n}`,{...r,role:"heading"===t?void 0:t})}let m=null,d=null;function p(e,l="",i,s){const[p,f]=t(({formatter:e,regionCode:t,phoneNumber:r},n)=>{switch(n.type){case"reset":return n.state;case"formatter":{const{PhoneNumberFormatter:e}=n;return b(r,t,new e(t),i)}case"phone":return b(n.phoneNumber,t,e)}},{phoneNumber:l,regionCode:e,loading:!0},({regionCode:e,phoneNumber:t})=>h(t,e,s,i));let{phoneNumber:N,regionCode:g,formatter:C}=p;const y=p.loading,_=r(l),j=r(e);if(_.current!==l||j.current!==e){const t=j.current!==e,r=/^\+\d/.test(l),n=!t&&r;_.current=l,j.current=e;const o=h(l,n?g??e:e,p.formatter);N=o.phoneNumber,g=o.regionCode,C=o.formatter,f({type:"reset",state:o})}n(()=>{let e=!0;return async function(){if(C)return;const t=await(d||(d=(async()=>{const{default:e}=await a(()=>c(()=>import("./74775c2e.CEulVlAE.js"),__vite__mapDeps([0,1])));return m=e,m})(),d));e&&f({type:"formatter",PhoneNumberFormatter:t})}(),()=>{e=!1}},[C]);const P=o(t=>{C&&!/^\+\d/.test(t)&&C.updateRegionCode(e),f({type:"phone",phoneNumber:t})},[C,e]),V=o(e=>{null!=C&&(C.updateRegionCode(e),f({type:"phone",phoneNumber:`+${C.countryCode}${C.getNationalNumber(N)}`}))},[C,N]),v=u(()=>null==C?"+1":`+${C.getCountryCodeFromRegionCode(g??j.current)}`,[C,g]);return{loading:y,formattedNumber:N,formattedNumberValueObject:p.phoneNumberValueObject,regionCode:g,prefix:v,setPhoneNumber:P,selectCountry:V}}function b(e,t,r,n){if(null==r)return{phoneNumber:e,phoneNumberValueObject:{value:e},regionCode:t,loading:!0};const o=r.format(e||(n?`+${r.countryCode}`:""));return{formatter:r,phoneNumber:o,phoneNumberValueObject:{value:o},regionCode:r?.regionCode,loading:!1}}function h(e,t,r,n){let o;return r?(r.updateRegionCode(t),o=r):o=m?new m(t):void 0,b(e,t,o,n)}function f(){const[e,t]=l(N);n(()=>{requestIdleCallback(async()=>{t(await async function(){const e=await a(()=>c(()=>import("./89a70c1b.OxEzY3oz.js"),__vite__mapDeps([2,1])));return N=e,N}())})},[]);const r=o((e,t,r)=>{return e.parsePhoneNumber(t,r&&(n=r,e.isSupportedCountry(n))?r:"US");var n},[]),i=o((t,n)=>{try{if(null==e)return null;const o=r(e,t,n);return null!=o.country&&o.isValid()&&o.format("E.164")||null}catch{return null}},[e,r]),s=o((t,n,o=!1)=>{try{if(null==e)return!0;const u=r(e,t,n);return null!=u.country&&!(o&&!t.startsWith(`+${e.getCountryCallingCode(u.country)}`))&&u.isValid()}catch{return!1}},[e,r]);return{isPhoneNumberUtilLoaded:u(()=>Boolean(e),[e]),validatePhoneNumber:s,formatPhoneNumber:i}}let N=null;export{s as A,p as a,f as u};