@aaravpos/appointment-booking-plugin 6.0.7 → 6.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,38 +1,38 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var xc=Object.create,kr=Object.defineProperty,Cc=Object.getOwnPropertyDescriptor,_c=Object.getOwnPropertyNames,wc=Object.getPrototypeOf,Ec=Object.prototype.hasOwnProperty,Pe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),As=(e,t)=>{let r={};for(var n in e)kr(r,n,{get:e[n],enumerable:!0});return t||kr(r,Symbol.toStringTag,{value:"Module"}),r},aa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=_c(t),i=0,s=a.length,d;i<s;i++)d=a[i],!Ec.call(e,d)&&d!==r&&kr(e,d,{get:(l=>t[l]).bind(null,d),enumerable:!(n=Cc(t,d))||n.enumerable});return e},Pc=(e,t,r)=>(aa(e,t,"default"),r&&aa(r,t,"default")),Jt=(e,t,r)=>(r=e!=null?xc(wc(e)):{},aa(t||!e||!e.__esModule?kr(r,"default",{value:e,enumerable:!0}):r,e));let Rr=require("react"),S=Jt(Rr,1);Rr=Jt(Rr);let M=require("react-redux"),be=require("redux"),We=require("redux-persist"),o=require("react/jsx-runtime"),he=require("luxon"),Z=require("react-toastify"),Ue=require("react-hook-form"),Oc=require("lodash");function yr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yr=function(r){return typeof r}:yr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yr(e)}function jc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Li(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Tc(e,t,r){return t&&Li(e.prototype,t),r&&Li(e,r),e}function Ac(e,t){return t&&(yr(t)==="object"||typeof t=="function")?t:gr(e)}function ia(e){return ia=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ia(e)}function gr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ic(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oa(e,t)}function oa(e,t){return oa=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},oa(e,t)}function $r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Is=(function(e){Ic(t,e);function t(){var r,n;jc(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=Ac(this,(r=ia(t)).call.apply(r,[this].concat(i))),$r(gr(n),"state",{bootstrapped:!1}),$r(gr(n),"_unsubscribe",void 0),$r(gr(n),"handlePersistorState",function(){n.props.persistor.getState().bootstrapped&&(n.props.onBeforeLift?Promise.resolve(n.props.onBeforeLift()).finally(function(){return n.setState({bootstrapped:!0})}):n.setState({bootstrapped:!0}),n._unsubscribe&&n._unsubscribe())}),n}return Tc(t,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return process.env.NODE_ENV!=="production"&&typeof this.props.children=="function"&&this.props.loading&&console.error("redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored."),typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),t})(Rr.PureComponent);$r(Is,"defaultProps",{children:null,loading:null});var ks=Symbol.for("immer-nothing"),Bi=Symbol.for("immer-draftable"),ve=Symbol.for("immer-state"),kc=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Ne(e,...t){if(process.env.NODE_ENV!=="production"){const r=kc[e],n=Ze(r)?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _e=Object,yt=_e.getPrototypeOf,Dr="constructor",ln="prototype",sa="configurable",Mr="enumerable",br="writable",Rt="value",xe=e=>!!e&&!!e[ve];function Re(e){return e?Rs(e)||un(e)||!!e[Bi]||!!e[Dr]?.[Bi]||fn(e)||pn(e):!1}var Rc=_e[ln][Dr].toString(),Ui=new WeakMap;function Rs(e){if(!e||!Ga(e))return!1;const t=yt(e);if(t===null||t===_e[ln])return!0;const r=_e.hasOwnProperty.call(t,Dr)&&t[Dr];if(r===Object)return!0;if(!Ze(r))return!1;let n=Ui.get(r);return n===void 0&&(n=Function.toString.call(r),Ui.set(r,n)),n===Rc}function Dc(e){return xe(e)||Ne(15,e),e[ve].base_}function cn(e,t,r=!0){Qt(e)===0?(r?Reflect.ownKeys(e):_e.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,a)=>t(a,n,e))}function Qt(e){const t=e[ve];return t?t.type_:un(e)?1:fn(e)?2:pn(e)?3:0}var Vi=(e,t,r=Qt(e))=>r===2?e.has(t):_e[ln].hasOwnProperty.call(e,t),da=(e,t,r=Qt(e))=>r===2?e.get(t):e[t],Fr=(e,t,r,n=Qt(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Mc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var un=Array.isArray,fn=e=>e instanceof Map,pn=e=>e instanceof Set,Ga=e=>typeof e=="object",Ze=e=>typeof e=="function",Vn=e=>typeof e=="boolean";function Fc(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Le=e=>e.copy_||e.base_,Ha=e=>e.modified_?e.copy_:e.base_;function la(e,t){if(fn(e))return new Map(e);if(pn(e))return new Set(e);if(un(e))return Array[ln].slice.call(e);const r=Rs(e);if(t===!0||t==="class_only"&&!r){const n=_e.getOwnPropertyDescriptors(e);delete n[ve];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const s=a[i],d=n[s];d[br]===!1&&(d[br]=!0,d[sa]=!0),(d.get||d.set)&&(n[s]={[sa]:!0,[br]:!0,[Mr]:d[Mr],[Rt]:e[s]})}return _e.create(yt(e),n)}else{const n=yt(e);if(n!==null&&r)return{...e};const a=_e.create(n);return _e.assign(a,e)}}function hn(e,t=!1){return mn(e)||xe(e)||!Re(e)||(Qt(e)>1&&_e.defineProperties(e,{set:ir,add:ir,clear:ir,delete:ir}),_e.freeze(e),t&&cn(e,(r,n)=>{hn(n,!0)},!1)),e}function Lc(){Ne(2)}var ir={[Rt]:Lc};function mn(e){return e===null||!Ga(e)?!0:_e.isFrozen(e)}var Lr="MapSet",ca="Patches",zi="ArrayMethods",Ds={};function tt(e){const t=Ds[e];return t||Ne(0,e),t}var qi=e=>!!Ds[e],Dt,Ms=()=>Dt,Bc=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:qi(Lr)?tt(Lr):void 0,arrayMethodsPlugin_:qi(zi)?tt(zi):void 0});function Wi(e,t){t&&(e.patchPlugin_=tt(ca),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ua(e){fa(e),e.drafts_.forEach(Uc),e.drafts_=null}function fa(e){e===Dt&&(Dt=e.parent_)}var Gi=e=>Dt=Bc(Dt,e);function Uc(e){const t=e[ve];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Hi(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[ve].modified_&&(ua(t),Ne(4)),Re(e)&&(e=Ki(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[ve].base_,e,t)}else e=Ki(t,r);return Vc(t,e,!0),ua(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ks?e:void 0}function Ki(e,t){if(mn(t))return t;const r=t[ve];if(!r)return Br(t,e.handledSet_,e);if(!vn(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Bs(r,e)}return r.copy_}function Vc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hn(t,r)}function Fs(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var vn=(e,t)=>e.scope_===t,zc=[];function Ls(e,t,r,n){const a=Le(e),i=e.type_;if(n!==void 0&&da(a,n,i)===t){Fr(a,n,r,i);return}if(!e.draftLocations_){const d=e.draftLocations_=new Map;cn(a,(l,c)=>{if(xe(c)){const u=d.get(c)||[];u.push(l),d.set(c,u)}})}const s=e.draftLocations_.get(t)??zc;for(const d of s)Fr(a,d,r,i)}function qc(e,t,r){e.callbacks_.push(function(a){const i=t;if(!i||!vn(i,a))return;a.mapSetPlugin_?.fixSetContents(i);const s=Ha(i);Ls(e,i.draft_??i,s,r),Bs(i,a)})}function Bs(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}Fs(e)}}function Wc(e,t,r){const{scope_:n}=e;if(xe(r)){const a=r[ve];vn(a,n)&&a.callbacks_.push(function(){Nr(e),Ls(e,r,Ha(a),t)})}else Re(r)&&e.callbacks_.push(function(){const i=Le(e);e.type_===3?i.has(r)&&Br(r,n.handledSet_,n):da(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Br(da(e.copy_,t,e.type_),n.handledSet_,n)})}function Br(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||xe(e)||t.has(e)||!Re(e)||mn(e)||(t.add(e),cn(e,(n,a)=>{if(xe(a)){const i=a[ve];vn(i,r)&&(Fr(e,n,Ha(i),e.type_),Fs(i))}else Re(a)&&Br(a,t,r)})),e}function Gc(e,t){const r=un(e),n={type_:r?1:0,scope_:t?t.scope_:Ms(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,i=Ur;r&&(a=[n],i=Mt);const{revoke:s,proxy:d}=Proxy.revocable(a,i);return n.draft_=d,n.revoke_=s,[d,n]}var Ur={get(e,t){if(t===ve)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const a=Le(e);if(!Vi(a,t,e.type_))return Hc(e,a,t);const i=a[t];if(e.finalized_||!Re(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Fc(t))return i;if(i===zn(e.base_,t)){Nr(e);const s=e.type_===1?+t:t,d=ha(e.scope_,i,e,s);return e.copy_[s]=d}return i},has(e,t){return t in Le(e)},ownKeys(e){return Reflect.ownKeys(Le(e))},set(e,t,r){const n=Us(Le(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=zn(Le(e),t),i=a?.[ve];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Mc(r,a)&&(r!==void 0||Vi(e.base_,t,e.type_)))return!0;Nr(e),pa(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Wc(e,t,r)),!0},deleteProperty(e,t){return Nr(e),zn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pa(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Le(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[br]:!0,[sa]:e.type_!==1||t!=="length",[Mr]:n[Mr],[Rt]:r[t]}},defineProperty(){Ne(11)},getPrototypeOf(e){return yt(e.base_)},setPrototypeOf(){Ne(12)}},Mt={};for(let e in Ur){let t=Ur[e];Mt[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Mt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Ne(13),Mt.set.call(this,e,t,void 0)};Mt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Ne(14),Ur.set.call(this,e[0],t,r,e[0])};function zn(e,t){const r=e[ve];return(r?Le(r):e)[t]}function Hc(e,t,r){const n=Us(t,r);return n?Rt in n?n[Rt]:n.get?.call(e.draft_):void 0}function Us(e,t){if(!(t in e))return;let r=yt(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=yt(r)}}function pa(e){e.modified_||(e.modified_=!0,e.parent_&&pa(e.parent_))}function Nr(e){e.copy_||(e.assigned_=new Map,e.copy_=la(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Kc=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Ze(t)&&!Ze(r)){const i=r;r=t;const s=this;return function(l=i,...c){return s.produce(l,u=>r.call(this,u,...c))}}Ze(r)||Ne(6),n!==void 0&&!Ze(n)&&Ne(7);let a;if(Re(t)){const i=Gi(this),s=ha(i,t,void 0);let d=!0;try{a=r(s),d=!1}finally{d?ua(i):fa(i)}return Wi(i,n),Hi(a,i)}else if(!t||!Ga(t)){if(a=r(t),a===void 0&&(a=t),a===ks&&(a=void 0),this.autoFreeze_&&hn(a,!0),n){const i=[],s=[];tt(ca).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),n(i,s)}return a}else Ne(1,t)},this.produceWithPatches=(t,r)=>{if(Ze(t))return(i,...s)=>this.produceWithPatches(i,d=>t(d,...s));let n,a;return[this.produce(t,r,(i,s)=>{n=i,a=s}),n,a]},Vn(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Vn(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Vn(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Re(e)||Ne(8),xe(e)&&(e=yn(e));const t=Gi(this),r=ha(t,e,void 0);return r[ve].isManual_=!0,fa(t),r}finishDraft(e,t){const r=e&&e[ve];(!r||!r.isManual_)&&Ne(9);const{scope_:n}=r;return Wi(n,t),Hi(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=tt(ca).applyPatches_;return xe(e)?n(e,t):this.produce(e,a=>n(a,t))}};function ha(e,t,r,n){const[a,i]=fn(t)?tt(Lr).proxyMap_(t,r):pn(t)?tt(Lr).proxySet_(t,r):Gc(t,r);return(r?.scope_??Ms()).drafts_.push(a),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?qc(r,i,n):i.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:l}=d;i.modified_&&l&&l.generatePatches_(i,[],d)}),a}function yn(e){return xe(e)||Ne(10,e),Vs(e)}function Vs(e){if(!Re(e)||mn(e))return e;const t=e[ve];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=la(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=la(e,!0);return cn(r,(a,i)=>{Fr(r,a,Vs(i))},n),t&&(t.finalized_=!1),r}var Yc=new Kc,gn=Yc.produce,Xc=(e,t,r)=>{if(t.length===1&&t[0]===r){let n=!1;try{const a={};e(a)===a&&(n=!0)}catch{}if(n){let a;try{throw new Error}catch(i){({stack:a}=i)}console.warn(`The result function returned its own inputs without modification. e.g
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var xc=Object.create,kr=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,wc=Object.getOwnPropertyNames,Ec=Object.getPrototypeOf,Pc=Object.prototype.hasOwnProperty,Oe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Is=(e,t)=>{let r={};for(var n in e)kr(r,n,{get:e[n],enumerable:!0});return t||kr(r,Symbol.toStringTag,{value:"Module"}),r},ia=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=wc(t),i=0,s=a.length,d;i<s;i++)d=a[i],!Pc.call(e,d)&&d!==r&&kr(e,d,{get:(l=>t[l]).bind(null,d),enumerable:!(n=_c(t,d))||n.enumerable});return e},Oc=(e,t,r)=>(ia(e,t,"default"),r&&ia(r,t,"default")),Jt=(e,t,r)=>(r=e!=null?xc(Ec(e)):{},ia(t||!e||!e.__esModule?kr(r,"default",{value:e,enumerable:!0}):r,e));let Rr=require("react"),S=Jt(Rr,1);Rr=Jt(Rr);let M=require("react-redux"),Ne=require("redux"),We=require("redux-persist"),o=require("react/jsx-runtime"),me=require("luxon"),J=require("react-toastify"),Ue=require("react-hook-form"),jc=require("lodash");function yr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yr=function(r){return typeof r}:yr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},yr(e)}function Tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ac(e,t,r){return t&&Bi(e.prototype,t),r&&Bi(e,r),e}function Ic(e,t){return t&&(yr(t)==="object"||typeof t=="function")?t:gr(e)}function oa(e){return oa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},oa(e)}function gr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sa(e,t)}function sa(e,t){return sa=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},sa(e,t)}function $r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ks=(function(e){kc(t,e);function t(){var r,n;Tc(this,t);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=Ic(this,(r=oa(t)).call.apply(r,[this].concat(i))),$r(gr(n),"state",{bootstrapped:!1}),$r(gr(n),"_unsubscribe",void 0),$r(gr(n),"handlePersistorState",function(){n.props.persistor.getState().bootstrapped&&(n.props.onBeforeLift?Promise.resolve(n.props.onBeforeLift()).finally(function(){return n.setState({bootstrapped:!0})}):n.setState({bootstrapped:!0}),n._unsubscribe&&n._unsubscribe())}),n}return Ac(t,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return process.env.NODE_ENV!=="production"&&typeof this.props.children=="function"&&this.props.loading&&console.error("redux-persist: PersistGate expects either a function child or loading prop, but not both. The loading prop will be ignored."),typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),t})(Rr.PureComponent);$r(ks,"defaultProps",{children:null,loading:null});var Rs=Symbol.for("immer-nothing"),Ui=Symbol.for("immer-draftable"),ve=Symbol.for("immer-state"),Rc=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Se(e,...t){if(process.env.NODE_ENV!=="production"){const r=Rc[e],n=Ze(r)?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var we=Object,yt=we.getPrototypeOf,Dr="constructor",ln="prototype",da="configurable",Mr="enumerable",br="writable",Rt="value",xe=e=>!!e&&!!e[ve];function De(e){return e?Ds(e)||un(e)||!!e[Ui]||!!e[Dr]?.[Ui]||fn(e)||pn(e):!1}var Dc=we[ln][Dr].toString(),Vi=new WeakMap;function Ds(e){if(!e||!Ha(e))return!1;const t=yt(e);if(t===null||t===we[ln])return!0;const r=we.hasOwnProperty.call(t,Dr)&&t[Dr];if(r===Object)return!0;if(!Ze(r))return!1;let n=Vi.get(r);return n===void 0&&(n=Function.toString.call(r),Vi.set(r,n)),n===Dc}function Mc(e){return xe(e)||Se(15,e),e[ve].base_}function cn(e,t,r=!0){Qt(e)===0?(r?Reflect.ownKeys(e):we.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,a)=>t(a,n,e))}function Qt(e){const t=e[ve];return t?t.type_:un(e)?1:fn(e)?2:pn(e)?3:0}var zi=(e,t,r=Qt(e))=>r===2?e.has(t):we[ln].hasOwnProperty.call(e,t),la=(e,t,r=Qt(e))=>r===2?e.get(t):e[t],Fr=(e,t,r,n=Qt(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Fc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var un=Array.isArray,fn=e=>e instanceof Map,pn=e=>e instanceof Set,Ha=e=>typeof e=="object",Ze=e=>typeof e=="function",Vn=e=>typeof e=="boolean";function Lc(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Le=e=>e.copy_||e.base_,Ka=e=>e.modified_?e.copy_:e.base_;function ca(e,t){if(fn(e))return new Map(e);if(pn(e))return new Set(e);if(un(e))return Array[ln].slice.call(e);const r=Ds(e);if(t===!0||t==="class_only"&&!r){const n=we.getOwnPropertyDescriptors(e);delete n[ve];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const s=a[i],d=n[s];d[br]===!1&&(d[br]=!0,d[da]=!0),(d.get||d.set)&&(n[s]={[da]:!0,[br]:!0,[Mr]:d[Mr],[Rt]:e[s]})}return we.create(yt(e),n)}else{const n=yt(e);if(n!==null&&r)return{...e};const a=we.create(n);return we.assign(a,e)}}function hn(e,t=!1){return mn(e)||xe(e)||!De(e)||(Qt(e)>1&&we.defineProperties(e,{set:ir,add:ir,clear:ir,delete:ir}),we.freeze(e),t&&cn(e,(r,n)=>{hn(n,!0)},!1)),e}function Bc(){Se(2)}var ir={[Rt]:Bc};function mn(e){return e===null||!Ha(e)?!0:we.isFrozen(e)}var Lr="MapSet",ua="Patches",qi="ArrayMethods",Ms={};function tt(e){const t=Ms[e];return t||Se(0,e),t}var Wi=e=>!!Ms[e],Dt,Fs=()=>Dt,Uc=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Wi(Lr)?tt(Lr):void 0,arrayMethodsPlugin_:Wi(qi)?tt(qi):void 0});function Gi(e,t){t&&(e.patchPlugin_=tt(ua),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fa(e){pa(e),e.drafts_.forEach(Vc),e.drafts_=null}function pa(e){e===Dt&&(Dt=e.parent_)}var Hi=e=>Dt=Uc(Dt,e);function Vc(e){const t=e[ve];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ki(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[ve].modified_&&(fa(t),Se(4)),De(e)&&(e=Yi(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[ve].base_,e,t)}else e=Yi(t,r);return zc(t,e,!0),fa(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Rs?e:void 0}function Yi(e,t){if(mn(t))return t;const r=t[ve];if(!r)return Br(t,e.handledSet_,e);if(!vn(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Us(r,e)}return r.copy_}function zc(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hn(t,r)}function Ls(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var vn=(e,t)=>e.scope_===t,qc=[];function Bs(e,t,r,n){const a=Le(e),i=e.type_;if(n!==void 0&&la(a,n,i)===t){Fr(a,n,r,i);return}if(!e.draftLocations_){const d=e.draftLocations_=new Map;cn(a,(l,c)=>{if(xe(c)){const u=d.get(c)||[];u.push(l),d.set(c,u)}})}const s=e.draftLocations_.get(t)??qc;for(const d of s)Fr(a,d,r,i)}function Wc(e,t,r){e.callbacks_.push(function(a){const i=t;if(!i||!vn(i,a))return;a.mapSetPlugin_?.fixSetContents(i);const s=Ka(i);Bs(e,i.draft_??i,s,r),Us(i,a)})}function Us(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}Ls(e)}}function Gc(e,t,r){const{scope_:n}=e;if(xe(r)){const a=r[ve];vn(a,n)&&a.callbacks_.push(function(){Nr(e),Bs(e,r,Ka(a),t)})}else De(r)&&e.callbacks_.push(function(){const i=Le(e);e.type_===3?i.has(r)&&Br(r,n.handledSet_,n):la(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Br(la(e.copy_,t,e.type_),n.handledSet_,n)})}function Br(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||xe(e)||t.has(e)||!De(e)||mn(e)||(t.add(e),cn(e,(n,a)=>{if(xe(a)){const i=a[ve];vn(i,r)&&(Fr(e,n,Ka(i),e.type_),Ls(i))}else De(a)&&Br(a,t,r)})),e}function Hc(e,t){const r=un(e),n={type_:r?1:0,scope_:t?t.scope_:Fs(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,i=Ur;r&&(a=[n],i=Mt);const{revoke:s,proxy:d}=Proxy.revocable(a,i);return n.draft_=d,n.revoke_=s,[d,n]}var Ur={get(e,t){if(t===ve)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const a=Le(e);if(!zi(a,t,e.type_))return Kc(e,a,t);const i=a[t];if(e.finalized_||!De(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Lc(t))return i;if(i===zn(e.base_,t)){Nr(e);const s=e.type_===1?+t:t,d=ma(e.scope_,i,e,s);return e.copy_[s]=d}return i},has(e,t){return t in Le(e)},ownKeys(e){return Reflect.ownKeys(Le(e))},set(e,t,r){const n=Vs(Le(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=zn(Le(e),t),i=a?.[ve];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Fc(r,a)&&(r!==void 0||zi(e.base_,t,e.type_)))return!0;Nr(e),ha(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Gc(e,t,r)),!0},deleteProperty(e,t){return Nr(e),zn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ha(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Le(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[br]:!0,[da]:e.type_!==1||t!=="length",[Mr]:n[Mr],[Rt]:r[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return yt(e.base_)},setPrototypeOf(){Se(12)}},Mt={};for(let e in Ur){let t=Ur[e];Mt[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Mt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Se(13),Mt.set.call(this,e,t,void 0)};Mt.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Se(14),Ur.set.call(this,e[0],t,r,e[0])};function zn(e,t){const r=e[ve];return(r?Le(r):e)[t]}function Kc(e,t,r){const n=Vs(t,r);return n?Rt in n?n[Rt]:n.get?.call(e.draft_):void 0}function Vs(e,t){if(!(t in e))return;let r=yt(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=yt(r)}}function ha(e){e.modified_||(e.modified_=!0,e.parent_&&ha(e.parent_))}function Nr(e){e.copy_||(e.assigned_=new Map,e.copy_=ca(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Yc=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Ze(t)&&!Ze(r)){const i=r;r=t;const s=this;return function(l=i,...c){return s.produce(l,u=>r.call(this,u,...c))}}Ze(r)||Se(6),n!==void 0&&!Ze(n)&&Se(7);let a;if(De(t)){const i=Hi(this),s=ma(i,t,void 0);let d=!0;try{a=r(s),d=!1}finally{d?fa(i):pa(i)}return Gi(i,n),Ki(a,i)}else if(!t||!Ha(t)){if(a=r(t),a===void 0&&(a=t),a===Rs&&(a=void 0),this.autoFreeze_&&hn(a,!0),n){const i=[],s=[];tt(ua).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),n(i,s)}return a}else Se(1,t)},this.produceWithPatches=(t,r)=>{if(Ze(t))return(i,...s)=>this.produceWithPatches(i,d=>t(d,...s));let n,a;return[this.produce(t,r,(i,s)=>{n=i,a=s}),n,a]},Vn(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Vn(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Vn(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){De(e)||Se(8),xe(e)&&(e=yn(e));const t=Hi(this),r=ma(t,e,void 0);return r[ve].isManual_=!0,pa(t),r}finishDraft(e,t){const r=e&&e[ve];(!r||!r.isManual_)&&Se(9);const{scope_:n}=r;return Gi(n,t),Ki(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=tt(ua).applyPatches_;return xe(e)?n(e,t):this.produce(e,a=>n(a,t))}};function ma(e,t,r,n){const[a,i]=fn(t)?tt(Lr).proxyMap_(t,r):pn(t)?tt(Lr).proxySet_(t,r):Hc(t,r);return(r?.scope_??Fs()).drafts_.push(a),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Wc(r,i,n):i.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:l}=d;i.modified_&&l&&l.generatePatches_(i,[],d)}),a}function yn(e){return xe(e)||Se(10,e),zs(e)}function zs(e){if(!De(e)||mn(e))return e;const t=e[ve];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ca(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=ca(e,!0);return cn(r,(a,i)=>{Fr(r,a,zs(i))},n),t&&(t.finalized_=!1),r}var Xc=new Yc,gn=Xc.produce,Zc=(e,t,r)=>{if(t.length===1&&t[0]===r){let n=!1;try{const a={};e(a)===a&&(n=!0)}catch{}if(n){let a;try{throw new Error}catch(i){({stack:a}=i)}console.warn(`The result function returned its own inputs without modification. e.g
2
2
  \`createSelector([state => state.todos], todos => todos)\`
3
3
  This could lead to inefficient memoization and unnecessary re-renders.
4
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:a})}}},Zc=(e,t,r)=>{const{memoize:n,memoizeOptions:a}=t,{inputSelectorResults:i,inputSelectorResultsCopy:s}=e,d=n(()=>({}),...a);if(d.apply(null,i)!==d.apply(null,s)){let l;try{throw new Error}catch(c){({stack:l}=c)}console.warn(`An input selector returned a different result when passed same arguments.
4
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:a})}}},Jc=(e,t,r)=>{const{memoize:n,memoizeOptions:a}=t,{inputSelectorResults:i,inputSelectorResultsCopy:s}=e,d=n(()=>({}),...a);if(d.apply(null,i)!==d.apply(null,s)){let l;try{throw new Error}catch(c){({stack:l}=c)}console.warn(`An input selector returned a different result when passed same arguments.
5
5
  This means your output selector will likely run more frequently than intended.
6
6
  Avoid returning a new reference inside your input selector, e.g.
7
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:r,firstInputs:i,secondInputs:s,stack:l})}},Jc={inputStabilityCheck:"once",identityFunctionCheck:"once"},Vr=Symbol("NOT_FOUND");function Qc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eu(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Yi=e=>Array.isArray(e)?e:[e];function tu(e){const t=Array.isArray(e[0])?e[0]:e;return eu(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Xi(e,t){const r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var ru=(e,t)=>{const{identityFunctionCheck:r,inputStabilityCheck:n}={...Jc,...t};return{identityFunctionCheck:{shouldRun:r==="always"||r==="once"&&e,run:Xc},inputStabilityCheck:{shouldRun:n==="always"||n==="once"&&e,run:Zc}}};function nu(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Vr},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function au(e,t){let r=[];function n(d){const l=r.findIndex(c=>t(d,c.key));if(l>-1){const c=r[l];return l>0&&(r.splice(l,1),r.unshift(c)),c.value}return Vr}function a(d,l){n(d)===Vr&&(r.unshift({key:d,value:l}),r.length>e&&r.pop())}function i(){return r}function s(){r=[]}return{get:n,put:a,getEntries:i,clear:s}}var iu=(e,t)=>e===t;function ou(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;const{length:a}=r;for(let i=0;i<a;i++)if(!e(r[i],n[i]))return!1;return!0}}function su(e,t){const{equalityCheck:r=iu,maxSize:n=1,resultEqualityCheck:a}=typeof t=="object"?t:{equalityCheck:t},i=ou(r);let s=0;const d=n<=1?nu(i):au(n,i);function l(){let c=d.get(arguments);if(c===Vr){if(c=e.apply(null,arguments),s++,a){const u=d.getEntries().find(f=>a(f.value,c));u&&(c=u.value,s!==0&&s--)}d.put(arguments,c)}return c}return l.clearCache=()=>{d.clear(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}var du=class{constructor(e){this.value=e}deref(){return this.value}},lu=()=>typeof WeakRef>"u"?du:WeakRef,zs=lu(),cu=0,Zi=1;function or(){return{s:cu,v:void 0,o:null,p:null}}function uu(e){return e instanceof zs?e.deref():e}function $n(e,t={}){let r=or();const{resultEqualityCheck:n}=t;let a,i=0;function s(){let d=r;const{length:l}=arguments;for(let f=0,m=l;f<m;f++){const h=arguments[f];if(typeof h=="function"||typeof h=="object"&&h!==null){let p=d.o;p===null&&(d.o=p=new WeakMap);const v=p.get(h);v===void 0?(d=or(),p.set(h,d)):d=v}else{let p=d.p;p===null&&(d.p=p=new Map);const v=p.get(h);v===void 0?(d=or(),p.set(h,d)):d=v}}const c=d;let u;if(d.s===Zi)u=d.v;else if(u=e.apply(null,arguments),i++,n){const f=uu(a);f!=null&&n(f,u)&&(u=f,i!==0&&i--),a=typeof u=="object"&&u!==null||typeof u=="function"?new zs(u):u}return c.s=Zi,c.v=u,u}return s.clearCache=()=>{r=or(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function Ka(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let i=0,s=0,d,l={},c=a.pop();typeof c=="object"&&(l=c,c=a.pop()),Qc(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...r,...l},{memoize:f,memoizeOptions:m=[],argsMemoize:h=$n,argsMemoizeOptions:p=[]}=u,v=Yi(m),y=Yi(p),$=tu(a),g=f(function(){return i++,c.apply(null,arguments)},...v);let x=!0;const C=h(function(){s++;const b=Xi($,arguments);if(d=g.apply(null,b),process.env.NODE_ENV!=="production"){const{devModeChecks:T={}}=u,{identityFunctionCheck:R,inputStabilityCheck:G}=ru(x,T);if(R.shouldRun&&R.run(c,b,d),G.shouldRun){const J=Xi($,arguments);G.run({inputSelectorResults:b,inputSelectorResultsCopy:J},{memoize:f,memoizeOptions:v},arguments)}x&&(x=!1)}return d},...y);return Object.assign(C,{resultFunc:c,memoizedResultFunc:g,dependencies:$,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>d,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var fu=Ka($n);function qs(e){return({dispatch:r,getState:n})=>a=>i=>typeof i=="function"?i(r,n,e):a(i)}var pu=qs(),hu=qs,ma=As({ReducerType:()=>vd,SHOULD_AUTOBATCH:()=>Za,TaskAbortError:()=>rr,Tuple:()=>Ya,addListener:()=>ei,asyncThunkCreator:()=>wu,autoBatchEnhancer:()=>ad,buildCreateSlice:()=>yd,clearAllListeners:()=>Pd,combineSlices:()=>uf,configureStore:()=>id,createAction:()=>Ae,createActionCreatorInvariantMiddleware:()=>Xs,createAsyncThunk:()=>Nn,createDraftSafeSelector:()=>Gs,createDraftSafeSelectorCreator:()=>Ws,createDynamicMiddleware:()=>tf,createEntityAdapter:()=>Vu,createImmutableStateInvariantMiddleware:()=>td,createListenerMiddleware:()=>Ju,createNextState:()=>gn,createReducer:()=>sd,createSelector:()=>fu,createSelectorCreator:()=>Ka,createSerializableStateInvariantMiddleware:()=>nd,createSlice:()=>He,current:()=>yn,findNonSerializableValue:()=>zr,formatProdErrorMessage:()=>H,freeze:()=>hn,isActionCreator:()=>Ks,isAllOf:()=>qr,isAnyOf:()=>xt,isAsyncThunkAction:()=>fd,isDraft:()=>xe,isFluxStandardAction:()=>Ys,isFulfilled:()=>ud,isImmutableDefault:()=>Js,isPending:()=>ld,isPlain:()=>Xa,isRejected:()=>Wr,isRejectedWithValue:()=>cd,lruMemoize:()=>su,miniSerializeError:()=>pd,nanoid:()=>tr,original:()=>Dc,prepareAutoBatched:()=>bu,removeListener:()=>ti,unwrapResult:()=>hd,weakMapMemoize:()=>$n});Pc(ma,require("redux"));var Ws=(...e)=>{const t=Ka(...e),r=Object.assign((...n)=>{const a=t(...n),i=(s,...d)=>a(xe(s)?yn(s):s,...d);return Object.assign(i,a),i},{withTypes:()=>r});return r},Gs=Ws($n),mu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?be.compose:be.compose.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Hs=e=>e&&typeof e.match=="function";function Ae(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(process.env.NODE_ENV==="production"?H(0):"prepareAction did not return an object");return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>(0,be.isAction)(n)&&n.type===e,r}function Ks(e){return typeof e=="function"&&"type"in e&&Hs(e)}function Ys(e){return(0,be.isAction)(e)&&Object.keys(e).every(vu)}function vu(e){return["type","payload","error","meta"].indexOf(e)>-1}function yu(e){const t=e?`${e}`.split("/"):[],r=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
8
- Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${r}())\` instead of \`dispatch(${r})\`. This is necessary even if the action has no payload.`}function Xs(e={}){if(process.env.NODE_ENV==="production")return()=>r=>n=>r(n);const{isActionCreator:t=Ks}=e;return()=>r=>n=>(t(n)&&console.warn(yu(n.type)),r(n))}function Zs(e,t){let r=0;return{measureTime(n){const a=Date.now();try{return n()}finally{r+=Date.now()-a}},warnIfExceeded(){r>e&&console.warn(`${t} took ${r}ms, which is more than the warning threshold of ${e}ms.
7
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:r,firstInputs:i,secondInputs:s,stack:l})}},Qc={inputStabilityCheck:"once",identityFunctionCheck:"once"},Vr=Symbol("NOT_FOUND");function eu(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function tu(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Xi=e=>Array.isArray(e)?e:[e];function ru(e){const t=Array.isArray(e[0])?e[0]:e;return tu(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Zi(e,t){const r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var nu=(e,t)=>{const{identityFunctionCheck:r,inputStabilityCheck:n}={...Qc,...t};return{identityFunctionCheck:{shouldRun:r==="always"||r==="once"&&e,run:Zc},inputStabilityCheck:{shouldRun:n==="always"||n==="once"&&e,run:Jc}}};function au(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Vr},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function iu(e,t){let r=[];function n(d){const l=r.findIndex(c=>t(d,c.key));if(l>-1){const c=r[l];return l>0&&(r.splice(l,1),r.unshift(c)),c.value}return Vr}function a(d,l){n(d)===Vr&&(r.unshift({key:d,value:l}),r.length>e&&r.pop())}function i(){return r}function s(){r=[]}return{get:n,put:a,getEntries:i,clear:s}}var ou=(e,t)=>e===t;function su(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;const{length:a}=r;for(let i=0;i<a;i++)if(!e(r[i],n[i]))return!1;return!0}}function du(e,t){const{equalityCheck:r=ou,maxSize:n=1,resultEqualityCheck:a}=typeof t=="object"?t:{equalityCheck:t},i=su(r);let s=0;const d=n<=1?au(i):iu(n,i);function l(){let c=d.get(arguments);if(c===Vr){if(c=e.apply(null,arguments),s++,a){const u=d.getEntries().find(f=>a(f.value,c));u&&(c=u.value,s!==0&&s--)}d.put(arguments,c)}return c}return l.clearCache=()=>{d.clear(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}var lu=class{constructor(e){this.value=e}deref(){return this.value}},cu=()=>typeof WeakRef>"u"?lu:WeakRef,qs=cu(),uu=0,Ji=1;function or(){return{s:uu,v:void 0,o:null,p:null}}function fu(e){return e instanceof qs?e.deref():e}function $n(e,t={}){let r=or();const{resultEqualityCheck:n}=t;let a,i=0;function s(){let d=r;const{length:l}=arguments;for(let f=0,m=l;f<m;f++){const h=arguments[f];if(typeof h=="function"||typeof h=="object"&&h!==null){let p=d.o;p===null&&(d.o=p=new WeakMap);const v=p.get(h);v===void 0?(d=or(),p.set(h,d)):d=v}else{let p=d.p;p===null&&(d.p=p=new Map);const v=p.get(h);v===void 0?(d=or(),p.set(h,d)):d=v}}const c=d;let u;if(d.s===Ji)u=d.v;else if(u=e.apply(null,arguments),i++,n){const f=fu(a);f!=null&&n(f,u)&&(u=f,i!==0&&i--),a=typeof u=="object"&&u!==null||typeof u=="function"?new qs(u):u}return c.s=Ji,c.v=u,u}return s.clearCache=()=>{r=or(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function Ya(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let i=0,s=0,d,l={},c=a.pop();typeof c=="object"&&(l=c,c=a.pop()),eu(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...r,...l},{memoize:f,memoizeOptions:m=[],argsMemoize:h=$n,argsMemoizeOptions:p=[]}=u,v=Xi(m),y=Xi(p),$=ru(a),g=f(function(){return i++,c.apply(null,arguments)},...v);let C=!0;const x=h(function(){s++;const b=Zi($,arguments);if(d=g.apply(null,b),process.env.NODE_ENV!=="production"){const{devModeChecks:T={}}=u,{identityFunctionCheck:R,inputStabilityCheck:W}=nu(C,T);if(R.shouldRun&&R.run(c,b,d),W.shouldRun){const Q=Zi($,arguments);W.run({inputSelectorResults:b,inputSelectorResultsCopy:Q},{memoize:f,memoizeOptions:v},arguments)}C&&(C=!1)}return d},...y);return Object.assign(x,{resultFunc:c,memoizedResultFunc:g,dependencies:$,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>d,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var pu=Ya($n);function Ws(e){return({dispatch:r,getState:n})=>a=>i=>typeof i=="function"?i(r,n,e):a(i)}var hu=Ws(),mu=Ws,va=Is({ReducerType:()=>yd,SHOULD_AUTOBATCH:()=>Ja,TaskAbortError:()=>rr,Tuple:()=>Xa,addListener:()=>ti,asyncThunkCreator:()=>Eu,autoBatchEnhancer:()=>id,buildCreateSlice:()=>gd,clearAllListeners:()=>Od,combineSlices:()=>ff,configureStore:()=>od,createAction:()=>Ie,createActionCreatorInvariantMiddleware:()=>Zs,createAsyncThunk:()=>Nn,createDraftSafeSelector:()=>Hs,createDraftSafeSelectorCreator:()=>Gs,createDynamicMiddleware:()=>rf,createEntityAdapter:()=>zu,createImmutableStateInvariantMiddleware:()=>rd,createListenerMiddleware:()=>Qu,createNextState:()=>gn,createReducer:()=>dd,createSelector:()=>pu,createSelectorCreator:()=>Ya,createSerializableStateInvariantMiddleware:()=>ad,createSlice:()=>He,current:()=>yn,findNonSerializableValue:()=>zr,formatProdErrorMessage:()=>H,freeze:()=>hn,isActionCreator:()=>Ys,isAllOf:()=>qr,isAnyOf:()=>Ct,isAsyncThunkAction:()=>pd,isDraft:()=>xe,isFluxStandardAction:()=>Xs,isFulfilled:()=>fd,isImmutableDefault:()=>Qs,isPending:()=>cd,isPlain:()=>Za,isRejected:()=>Wr,isRejectedWithValue:()=>ud,lruMemoize:()=>du,miniSerializeError:()=>hd,nanoid:()=>tr,original:()=>Mc,prepareAutoBatched:()=>Nu,removeListener:()=>ri,unwrapResult:()=>md,weakMapMemoize:()=>$n});Oc(va,require("redux"));var Gs=(...e)=>{const t=Ya(...e),r=Object.assign((...n)=>{const a=t(...n),i=(s,...d)=>a(xe(s)?yn(s):s,...d);return Object.assign(i,a),i},{withTypes:()=>r});return r},Hs=Gs($n),vu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ne.compose:Ne.compose.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Ks=e=>e&&typeof e.match=="function";function Ie(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(process.env.NODE_ENV==="production"?H(0):"prepareAction did not return an object");return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>(0,Ne.isAction)(n)&&n.type===e,r}function Ys(e){return typeof e=="function"&&"type"in e&&Ks(e)}function Xs(e){return(0,Ne.isAction)(e)&&Object.keys(e).every(yu)}function yu(e){return["type","payload","error","meta"].indexOf(e)>-1}function gu(e){const t=e?`${e}`.split("/"):[],r=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
8
+ Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${r}())\` instead of \`dispatch(${r})\`. This is necessary even if the action has no payload.`}function Zs(e={}){if(process.env.NODE_ENV==="production")return()=>r=>n=>r(n);const{isActionCreator:t=Ys}=e;return()=>r=>n=>(t(n)&&console.warn(gu(n.type)),r(n))}function Js(e,t){let r=0;return{measureTime(n){const a=Date.now();try{return n()}finally{r+=Date.now()-a}},warnIfExceeded(){r>e&&console.warn(`${t} took ${r}ms, which is more than the warning threshold of ${e}ms.
9
9
  If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
10
- It is disabled in production builds, so you don't need to worry about that.`)}}}var Ya=class At extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,At.prototype)}static get[Symbol.species](){return At}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new At(...t[0].concat(this)):new At(...t.concat(this))}};function Ji(e){return Re(e)?gn(e,()=>{}):e}function Je(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Js(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function gu(e,t,r){const n=Qs(e,t,r);return{detectMutations(){return ed(e,t,n,r)}}}function Qs(e,t=[],r,n="",a=new Set){const i={value:r};if(!e(r)&&!a.has(r)){a.add(r),i.children={};const s=t.length>0;for(const d in r){const l=n?n+"."+d:d;s&&t.some(c=>c instanceof RegExp?c.test(l):l===c)||(i.children[d]=Qs(e,t,r[d],l))}}return i}function ed(e,t=[],r,n,a=!1,i=""){const s=r?r.value:void 0,d=s===n;if(a&&!d&&!Number.isNaN(n))return{wasMutated:!0,path:i};if(e(s)||e(n))return{wasMutated:!1};const l={};for(let u in r.children)l[u]=!0;for(let u in n)l[u]=!0;const c=t.length>0;for(let u in l){const f=i?i+"."+u:u;if(c&&t.some(h=>h instanceof RegExp?h.test(f):f===h))continue;const m=ed(e,t,r.children[u],n[u],d,f);if(m.wasMutated)return m}return{wasMutated:!1}}function td(e={}){if(process.env.NODE_ENV==="production")return()=>t=>r=>t(r);{let t=function(d,l,c,u){return JSON.stringify(d,r(l,u),c)},r=function(d,l){let c=[],u=[];return l||(l=function(f,m){return c[0]===m?"[Circular ~]":"[Circular ~."+u.slice(0,c.indexOf(m)).join(".")+"]"}),function(f,m){if(c.length>0){var h=c.indexOf(this);~h?c.splice(h+1):c.push(this),~h?u.splice(h,1/0,f):u.push(f),~c.indexOf(m)&&(m=l.call(this,f,m))}else c.push(m);return d==null?m:d.call(this,f,m)}},{isImmutable:n=Js,ignoredPaths:a,warnAfter:i=32}=e;const s=gu.bind(null,n,a);return({getState:d})=>{let l=d(),c=s(l),u;return f=>m=>{const h=Zs(i,"ImmutableStateInvariantMiddleware");h.measureTime(()=>{if(l=d(),u=c.detectMutations(),c=s(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?H(19):`A state mutation was detected between dispatches, in the path '${u.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const p=f(m);return h.measureTime(()=>{if(l=d(),u=c.detectMutations(),c=s(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?H(20):`A state mutation was detected inside a dispatch, in the path: ${u.path||""}. Take a look at the reducer(s) handling the action ${t(m)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),h.warnIfExceeded(),p}}}}function Xa(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||(0,be.isPlainObject)(e)}function zr(e,t="",r=Xa,n,a=[],i){let s;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||i?.has(e))return!1;const d=n!=null?n(e):Object.entries(e),l=a.length>0;for(const[c,u]of d){const f=t?t+"."+c:c;if(!(l&&a.some(m=>m instanceof RegExp?m.test(f):f===m))){if(!r(u))return{keyPath:f,value:u};if(typeof u=="object"&&(s=zr(u,f,r,n,a,i),s))return s}}return i&&rd(e)&&i.add(e),!1}function rd(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!rd(t))return!1;return!0}function nd(e={}){if(process.env.NODE_ENV==="production")return()=>t=>r=>t(r);{const{isSerializable:t=Xa,getEntries:r,ignoredActions:n=[],ignoredActionPaths:a=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:d=!1,ignoreActions:l=!1,disableCache:c=!1}=e,u=!c&&WeakSet?new WeakSet:void 0;return f=>m=>h=>{if(!(0,be.isAction)(h))return m(h);const p=m(h),v=Zs(s,"SerializableStateInvariantMiddleware");return!l&&!(n.length&&n.indexOf(h.type)!==-1)&&v.measureTime(()=>{const y=zr(h,"",t,r,a,u);if(y){const{keyPath:$,value:g}=y;console.error(`A non-serializable value was detected in an action, in the path: \`${$}\`. Value:`,g,`
10
+ It is disabled in production builds, so you don't need to worry about that.`)}}}var Xa=class At extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,At.prototype)}static get[Symbol.species](){return At}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new At(...t[0].concat(this)):new At(...t.concat(this))}};function Qi(e){return De(e)?gn(e,()=>{}):e}function Je(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Qs(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function $u(e,t,r){const n=ed(e,t,r);return{detectMutations(){return td(e,t,n,r)}}}function ed(e,t=[],r,n="",a=new Set){const i={value:r};if(!e(r)&&!a.has(r)){a.add(r),i.children={};const s=t.length>0;for(const d in r){const l=n?n+"."+d:d;s&&t.some(c=>c instanceof RegExp?c.test(l):l===c)||(i.children[d]=ed(e,t,r[d],l))}}return i}function td(e,t=[],r,n,a=!1,i=""){const s=r?r.value:void 0,d=s===n;if(a&&!d&&!Number.isNaN(n))return{wasMutated:!0,path:i};if(e(s)||e(n))return{wasMutated:!1};const l={};for(let u in r.children)l[u]=!0;for(let u in n)l[u]=!0;const c=t.length>0;for(let u in l){const f=i?i+"."+u:u;if(c&&t.some(h=>h instanceof RegExp?h.test(f):f===h))continue;const m=td(e,t,r.children[u],n[u],d,f);if(m.wasMutated)return m}return{wasMutated:!1}}function rd(e={}){if(process.env.NODE_ENV==="production")return()=>t=>r=>t(r);{let t=function(d,l,c,u){return JSON.stringify(d,r(l,u),c)},r=function(d,l){let c=[],u=[];return l||(l=function(f,m){return c[0]===m?"[Circular ~]":"[Circular ~."+u.slice(0,c.indexOf(m)).join(".")+"]"}),function(f,m){if(c.length>0){var h=c.indexOf(this);~h?c.splice(h+1):c.push(this),~h?u.splice(h,1/0,f):u.push(f),~c.indexOf(m)&&(m=l.call(this,f,m))}else c.push(m);return d==null?m:d.call(this,f,m)}},{isImmutable:n=Qs,ignoredPaths:a,warnAfter:i=32}=e;const s=$u.bind(null,n,a);return({getState:d})=>{let l=d(),c=s(l),u;return f=>m=>{const h=Js(i,"ImmutableStateInvariantMiddleware");h.measureTime(()=>{if(l=d(),u=c.detectMutations(),c=s(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?H(19):`A state mutation was detected between dispatches, in the path '${u.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const p=f(m);return h.measureTime(()=>{if(l=d(),u=c.detectMutations(),c=s(l),u.wasMutated)throw new Error(process.env.NODE_ENV==="production"?H(20):`A state mutation was detected inside a dispatch, in the path: ${u.path||""}. Take a look at the reducer(s) handling the action ${t(m)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),h.warnIfExceeded(),p}}}}function Za(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||(0,Ne.isPlainObject)(e)}function zr(e,t="",r=Za,n,a=[],i){let s;if(!r(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||i?.has(e))return!1;const d=n!=null?n(e):Object.entries(e),l=a.length>0;for(const[c,u]of d){const f=t?t+"."+c:c;if(!(l&&a.some(m=>m instanceof RegExp?m.test(f):f===m))){if(!r(u))return{keyPath:f,value:u};if(typeof u=="object"&&(s=zr(u,f,r,n,a,i),s))return s}}return i&&nd(e)&&i.add(e),!1}function nd(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!nd(t))return!1;return!0}function ad(e={}){if(process.env.NODE_ENV==="production")return()=>t=>r=>t(r);{const{isSerializable:t=Za,getEntries:r,ignoredActions:n=[],ignoredActionPaths:a=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:d=!1,ignoreActions:l=!1,disableCache:c=!1}=e,u=!c&&WeakSet?new WeakSet:void 0;return f=>m=>h=>{if(!(0,Ne.isAction)(h))return m(h);const p=m(h),v=Js(s,"SerializableStateInvariantMiddleware");return!l&&!(n.length&&n.indexOf(h.type)!==-1)&&v.measureTime(()=>{const y=zr(h,"",t,r,a,u);if(y){const{keyPath:$,value:g}=y;console.error(`A non-serializable value was detected in an action, in the path: \`${$}\`. Value:`,g,`
11
11
  Take a look at the logic that dispatched this action: `,h,`
12
12
  (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
13
13
  (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),d||(v.measureTime(()=>{const y=zr(f.getState(),"",t,r,i,u);if(y){const{keyPath:$,value:g}=y;console.error(`A non-serializable value was detected in the state, in the path: \`${$}\`. Value:`,g,`
14
14
  Take a look at the reducer(s) handling this action type: ${h.type}.
15
- (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),v.warnIfExceeded()),p}}}function sr(e){return typeof e=="boolean"}var $u=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{};let s=new Ya;if(r&&(sr(r)?s.push(pu):s.push(hu(r.extraArgument))),process.env.NODE_ENV!=="production"){if(n){let d={};sr(n)||(d=n),s.unshift(td(d))}if(a){let d={};sr(a)||(d=a),s.push(nd(d))}if(i){let d={};sr(i)||(d=i),s.unshift(Xs(d))}}return s},Za="RTK_autoBatch",bu=()=>e=>({payload:e,meta:{[Za]:!0}}),Qi=e=>t=>{setTimeout(t,e)},ad=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let a=!0,i=!1,s=!1;const d=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Qi(10):e.type==="callback"?e.queueNotification:Qi(e.timeout),c=()=>{s=!1,i&&(i=!1,d.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>a&&u(),m=n.subscribe(f);return d.add(u),()=>{m(),d.delete(u)}},dispatch(u){try{return a=!u?.meta?.[Za],i=!a,i&&(s||(s=!0,l(c))),n.dispatch(u)}finally{a=!0}}})},Nu=e=>function(r){const{autoBatch:n=!0}=r??{};let a=new Ya(e);return n&&a.push(ad(typeof n=="object"?n:void 0)),a};function id(e){const t=$u(),{reducer:r=void 0,middleware:n,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:d=void 0}=e||{};let l;if(typeof r=="function")l=r;else if((0,be.isPlainObject)(r))l=(0,be.combineReducers)(r);else throw new Error(process.env.NODE_ENV==="production"?H(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&n&&typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?H(2):"`middleware` field must be a callback");let c;if(typeof n=="function"){if(c=n(t),process.env.NODE_ENV!=="production"&&!Array.isArray(c))throw new Error(process.env.NODE_ENV==="production"?H(3):"when using a middleware builder function, an array of middleware must be returned")}else c=t();if(process.env.NODE_ENV!=="production"&&c.some(v=>typeof v!="function"))throw new Error(process.env.NODE_ENV==="production"?H(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&i){let v=new Set;c.forEach(y=>{if(v.has(y))throw new Error(process.env.NODE_ENV==="production"?H(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");v.add(y)})}let u=be.compose;a&&(u=mu({trace:process.env.NODE_ENV!=="production",...typeof a=="object"&&a}));const f=(0,be.applyMiddleware)(...c),m=Nu(f);if(process.env.NODE_ENV!=="production"&&d&&typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?H(5):"`enhancers` field must be a callback");let h=typeof d=="function"?d(m):m();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?H(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(v=>typeof v!="function"))throw new Error(process.env.NODE_ENV==="production"?H(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&c.length&&!h.includes(f)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=u(...h);return(0,be.createStore)(l,s,p)}function od(e){const t={},r=[];let n;const a={addCase(i,s){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error(process.env.NODE_ENV==="production"?H(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error(process.env.NODE_ENV==="production"?H(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const d=typeof i=="string"?i:i.type;if(!d)throw new Error(process.env.NODE_ENV==="production"?H(28):"`builder.addCase` cannot be called with an empty action type");if(d in t)throw new Error(process.env.NODE_ENV==="production"?H(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${d}'`);return t[d]=s,a},addAsyncThunk(i,s){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&r.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:s}),a},addDefaultCase(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(31):"`builder.addDefaultCase` can only be called once");return n=i,a}};return e(a),[t,r,n]}function Su(e){return typeof e=="function"}function sd(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?H(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[r,n,a]=od(t),i;if(Su(e))i=()=>Ji(e());else{const d=Ji(e);i=()=>d}function s(d=i(),l){let c=[r[l.type],...n.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[a]),c.reduce((u,f)=>{if(f)if(xe(u)){const m=f(u,l);return m===void 0?u:m}else{if(Re(u))return gn(u,m=>f(m,l));{const m=f(u,l);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},d)}return s.getInitialState=i,s}var dd=(e,t)=>Hs(e)?e.match(t):e(t);function xt(...e){return t=>e.some(r=>dd(r,t))}function qr(...e){return t=>e.every(r=>dd(r,t))}function bn(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function er(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ld(...e){return e.length===0?t=>bn(t,["pending"]):er(e)?xt(...e.map(t=>t.pending)):ld()(e[0])}function Wr(...e){return e.length===0?t=>bn(t,["rejected"]):er(e)?xt(...e.map(t=>t.rejected)):Wr()(e[0])}function cd(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qr(Wr(...e),t):er(e)?qr(Wr(...e),t):cd()(e[0])}function ud(...e){return e.length===0?t=>bn(t,["fulfilled"]):er(e)?xt(...e.map(t=>t.fulfilled)):ud()(e[0])}function fd(...e){return e.length===0?t=>bn(t,["pending","fulfilled","rejected"]):er(e)?xt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):fd()(e[0])}var xu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",tr=(e=21)=>{let t="",r=e;for(;r--;)t+=xu[Math.random()*64|0];return t},Cu=["name","message","stack","code"],qn=class{constructor(e,t){this.payload=e,this.meta=t}_type},eo=class{constructor(e,t){this.payload=e,this.meta=t}_type},pd=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of Cu)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},to="External signal was aborted",Nn=(()=>{function e(t,r,n){const a=Ae(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:{...f||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),i=Ae(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=Ae(t+"/rejected",(l,c,u,f,m)=>({payload:f,error:(n&&n.serializeError||pd)(l||"Rejected"),meta:{...m||{},arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function d(l,{signal:c}={}){return(u,f,m)=>{const h=n?.idGenerator?n.idGenerator(l):tr(),p=new AbortController;let v,y;function $(x){y=x,p.abort()}c&&(c.aborted?$(to):c.addEventListener("abort",()=>$(to),{once:!0}));const g=(async function(){let x;try{let C=n?.condition?.(l,{getState:f,extra:m});if(_u(C)&&(C=await C),C===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const N=new Promise((b,T)=>{v=()=>{T({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",v,{once:!0})});u(i(h,l,n?.getPendingMeta?.({requestId:h,arg:l},{getState:f,extra:m}))),x=await Promise.race([N,Promise.resolve(r(l,{dispatch:u,getState:f,extra:m,requestId:h,signal:p.signal,abort:$,rejectWithValue:(b,T)=>new qn(b,T),fulfillWithValue:(b,T)=>new eo(b,T)})).then(b=>{if(b instanceof qn)throw b;return b instanceof eo?a(b.payload,h,l,b.meta):a(b,h,l)})])}catch(C){x=C instanceof qn?s(null,h,l,C.payload,C.meta):s(C,h,l)}finally{v&&p.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(x)&&x.meta.condition||u(x),x})();return Object.assign(g,{abort:$,requestId:h,arg:l,unwrap(){return g.then(hd)}})}}return Object.assign(d,{pending:i,rejected:s,fulfilled:a,settled:xt(s,a),typePrefix:t})}return e.withTypes=()=>e,e})();function hd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function _u(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var md=Symbol.for("rtk-slice-createasyncthunk"),wu={[md]:Nn},vd=(e=>(e.reducer="reducer",e.reducerWithPrepare="reducerWithPrepare",e.asyncThunk="asyncThunk",e))(vd||{});function Eu(e,t){return`${e}/${t}`}function yd({creators:e}={}){const t=e?.asyncThunk?.[md];return function(n){const{name:a,reducerPath:i=a}=n;if(!a)throw new Error(process.env.NODE_ENV==="production"?H(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&n.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const s=(typeof n.reducers=="function"?n.reducers(Ou()):n.reducers)||{},d=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(x,C){const N=typeof x=="string"?x:x.type;if(!N)throw new Error(process.env.NODE_ENV==="production"?H(12):"`context.addCase` cannot be called with an empty action type");if(N in l.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?H(13):"`context.addCase` cannot be called with two reducers for the same action type: "+N);return l.sliceCaseReducersByType[N]=C,c},addMatcher(x,C){return l.sliceMatchers.push({matcher:x,reducer:C}),c},exposeAction(x,C){return l.actionCreators[x]=C,c},exposeCaseReducer(x,C){return l.sliceCaseReducersByName[x]=C,c}};d.forEach(x=>{const C=s[x],N={reducerName:x,type:Eu(a,x),createNotation:typeof n.reducers=="function"};Tu(C)?Iu(N,C,c,t):ju(N,C,c)});function u(){if(process.env.NODE_ENV!=="production"&&typeof n.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?H(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[x={},C=[],N=void 0]=typeof n.extraReducers=="function"?od(n.extraReducers):[n.extraReducers],b={...x,...l.sliceCaseReducersByType};return sd(n.initialState,T=>{for(let R in b)T.addCase(R,b[R]);for(let R of l.sliceMatchers)T.addMatcher(R.matcher,R.reducer);for(let R of C)T.addMatcher(R.matcher,R.reducer);N&&T.addDefaultCase(N)})}const f=x=>x,m=new Map,h=new WeakMap;let p;function v(x,C){return p||(p=u()),p(x,C)}function y(){return p||(p=u()),p.getInitialState()}function $(x,C=!1){function N(T){let R=T[x];if(typeof R>"u"){if(C)R=Je(h,N,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?H(15):"selectSlice returned undefined for an uninjected slice reducer")}return R}function b(T=f){return Je(Je(m,C,()=>new WeakMap),T,()=>{const R={};for(const[G,J]of Object.entries(n.selectors??{}))R[G]=Pu(J,T,()=>Je(h,T,y),C);return R})}return{reducerPath:x,getSelectors:b,get selectors(){return b(N)},selectSlice:N}}const g={name:a,reducer:v,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:y,...$(i),injectInto(x,{reducerPath:C,...N}={}){const b=C??i;return x.inject({reducerPath:b,reducer:v},N),{...g,...$(b,!0)}}};return g}}function Pu(e,t,r,n){function a(i,...s){let d=t(i);if(typeof d>"u"){if(n)d=r();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?H(16):"selectState returned undefined for an uninjected slice reducer")}return e(d,...s)}return a.unwrapped=e,a}var He=yd();function Ou(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function ju({type:e,reducerName:t,createNotation:r},n,a){let i,s;if("reducer"in n){if(r&&!Au(n))throw new Error(process.env.NODE_ENV==="production"?H(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=n.reducer,s=n.prepare}else i=n;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Ae(e,s):Ae(e))}function Tu(e){return e._reducerDefinitionType==="asyncThunk"}function Au(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Iu({type:e,reducerName:t},r,n,a){if(!a)throw new Error(process.env.NODE_ENV==="production"?H(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:s,pending:d,rejected:l,settled:c,options:u}=r,f=a(e,i,u);n.exposeAction(t,f),s&&n.addCase(f.fulfilled,s),d&&n.addCase(f.pending,d),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:s||dr,pending:d||dr,rejected:l||dr,settled:c||dr})}function dr(){}function ku(){return{ids:[],entities:{}}}function Ru(e){function t(r={},n){const a=Object.assign(ku(),r);return n?e.setAll(a,n):a}return{getInitialState:t}}function Du(){function e(t,r={}){const{createSelector:n=Gs}=r,a=f=>f.ids,i=f=>f.entities,s=n(a,i,(f,m)=>f.map(h=>m[h])),d=(f,m)=>m,l=(f,m)=>f[m],c=n(a,f=>f.length);if(!t)return{selectIds:a,selectEntities:i,selectAll:s,selectTotal:c,selectById:n(i,d,l)};const u=n(t,i);return{selectIds:n(t,a),selectEntities:u,selectAll:n(t,s),selectTotal:n(t,c),selectById:n(u,d,l)}}return{getSelectors:e}}var Mu=xe;function Fu(e){const t=ie((r,n)=>e(n));return function(n){return t(n,void 0)}}function ie(e){return function(r,n){function a(s){return Ys(s)}const i=s=>{a(n)?e(n.payload,s):e(n,s)};return Mu(r)?(i(r),r):gn(r,i)}}function dt(e,t){const r=t(e);return process.env.NODE_ENV!=="production"&&r===void 0&&console.warn("The entity passed to the `selectId` implementation returned undefined.","You should probably provide your own `selectId` implementation.","The entity that was passed:",e,"The `selectId` implementation:",t.toString()),r}function Ge(e){return Array.isArray(e)||(e=Object.values(e)),e}function Sr(e){return xe(e)?yn(e):e}function gd(e,t,r){e=Ge(e);const n=Sr(r.ids),a=new Set(n),i=[],s=new Set([]),d=[];for(const l of e){const c=dt(l,t);a.has(c)||s.has(c)?d.push({id:c,changes:l}):(s.add(c),i.push(l))}return[i,d,n]}function $d(e){function t(p,v){const y=dt(p,e);y in v.entities||(v.ids.push(y),v.entities[y]=p)}function r(p,v){p=Ge(p);for(const y of p)t(y,v)}function n(p,v){const y=dt(p,e);y in v.entities||v.ids.push(y),v.entities[y]=p}function a(p,v){p=Ge(p);for(const y of p)n(y,v)}function i(p,v){p=Ge(p),v.ids=[],v.entities={},r(p,v)}function s(p,v){return d([p],v)}function d(p,v){let y=!1;p.forEach($=>{$ in v.entities&&(delete v.entities[$],y=!0)}),y&&(v.ids=v.ids.filter($=>$ in v.entities))}function l(p){Object.assign(p,{ids:[],entities:{}})}function c(p,v,y){const $=y.entities[v.id];if($===void 0)return!1;const g=Object.assign({},$,v.changes),x=dt(g,e),C=x!==v.id;return C&&(p[v.id]=x,delete y.entities[v.id]),y.entities[x]=g,C}function u(p,v){return f([p],v)}function f(p,v){const y={},$={};p.forEach(g=>{g.id in v.entities&&($[g.id]={id:g.id,changes:{...$[g.id]?.changes,...g.changes}})}),p=Object.values($),p.length>0&&p.filter(g=>c(y,g,v)).length>0&&(v.ids=Object.values(v.entities).map(g=>dt(g,e)))}function m(p,v){return h([p],v)}function h(p,v){const[y,$]=gd(p,e,v);r(y,v),f($,v)}return{removeAll:Fu(l),addOne:ie(t),addMany:ie(r),setOne:ie(n),setMany:ie(a),setAll:ie(i),updateOne:ie(u),updateMany:ie(f),upsertOne:ie(m),upsertMany:ie(h),removeOne:ie(s),removeMany:ie(d)}}function Lu(e,t,r){let n=0,a=e.length;for(;n<a;){let i=n+a>>>1;const s=e[i];r(t,s)>=0?n=i+1:a=i}return n}function Bu(e,t,r){const n=Lu(e,t,r);return e.splice(n,0,t),e}function Uu(e,t){const{removeOne:r,removeMany:n,removeAll:a}=$d(e);function i(y,$){return s([y],$)}function s(y,$,g){y=Ge(y);const x=new Set(g??Sr($.ids)),C=new Set,N=y.filter(b=>{const T=dt(b,e),R=!C.has(T);return R&&C.add(T),!x.has(T)&&R});N.length!==0&&v($,N)}function d(y,$){return l([y],$)}function l(y,$){let g={};if(y=Ge(y),y.length!==0){for(const x of y){const C=e(x);g[C]=x,delete $.entities[C]}y=Ge(g),v($,y)}}function c(y,$){y=Ge(y),$.entities={},$.ids=[],s(y,$,[])}function u(y,$){return f([y],$)}function f(y,$){let g=!1,x=!1;for(let C of y){const N=$.entities[C.id];if(!N)continue;g=!0,Object.assign(N,C.changes);const b=e(N);if(C.id!==b){x=!0,delete $.entities[C.id];const T=$.ids.indexOf(C.id);$.ids[T]=b,$.entities[b]=N}}g&&v($,[],g,x)}function m(y,$){return h([y],$)}function h(y,$){const[g,x,C]=gd(y,e,$);g.length&&s(g,$,C),x.length&&f(x,$)}function p(y,$){if(y.length!==$.length)return!1;for(let g=0;g<y.length;g++)if(y[g]!==$[g])return!1;return!0}const v=(y,$,g,x)=>{const C=Sr(y.entities),N=Sr(y.ids),b=y.entities;let T=N;x&&(T=new Set(N));let R=[];for(const oe of T){const Q=C[oe];Q&&R.push(Q)}const G=R.length===0;for(const oe of $)b[e(oe)]=oe,G||Bu(R,oe,t);G?R=$.slice().sort(t):g&&R.sort(t);const J=R.map(e);p(N,J)||(y.ids=J)};return{removeOne:r,removeMany:n,removeAll:a,addOne:ie(i),updateOne:ie(u),upsertOne:ie(m),setOne:ie(d),setMany:ie(l),setAll:ie(c),addMany:ie(s),updateMany:ie(f),upsertMany:ie(h)}}function Vu(e={}){const{selectId:t,sortComparer:r}={sortComparer:!1,selectId:s=>s.id,...e},n=r?Uu(t,r):$d(t),a=Ru(n),i=Du();return{selectId:t,sortComparer:r,...a,...i,...n}}var zu="task",bd="listener",Nd="completed",Ja="cancelled",qu=`task-${Ja}`,Wu=`task-${Nd}`,va=`${bd}-${Ja}`,Gu=`${bd}-${Nd}`,rr=class{constructor(e){this.code=e,this.message=`${zu} ${Ja} (reason: ${e})`}name="TaskAbortError";message},Qa=(e,t)=>{if(typeof e!="function")throw new TypeError(process.env.NODE_ENV==="production"?H(32):`${t} is not a function`)},Gr=()=>{},Sd=(e,t=Gr)=>(e.catch(t),e),xd=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Qe=e=>{if(e.aborted)throw new rr(e.reason)};function Cd(e,t){let r=Gr;return new Promise((n,a)=>{const i=()=>a(new rr(e.reason));if(e.aborted){i();return}r=xd(e,i),t.finally(()=>r()).then(n,a)}).finally(()=>{r=Gr})}var Hu=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof rr?"cancelled":"rejected",error:r}}finally{t?.()}},Hr=e=>t=>Sd(Cd(e,t).then(r=>(Qe(e),r))),_d=e=>{const t=Hr(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ct}=Object,ro={},nr="listenerMiddleware",Ku=(e,t)=>{const r=n=>xd(e,()=>n.abort(e.reason));return(n,a)=>{Qa(n,"taskExecutor");const i=new AbortController;r(i);const s=Hu(async()=>{Qe(e),Qe(i.signal);const d=await n({pause:Hr(i.signal),delay:_d(i.signal),signal:i.signal});return Qe(i.signal),d},()=>i.abort(Wu));return a?.autoJoin&&t.push(s.catch(Gr)),{result:Hr(e)(s),cancel(){i.abort(qu)}}}},Yu=(e,t)=>{const r=async(n,a)=>{Qe(t);let i=()=>{};const s=[new Promise((d,l)=>{let c=e({predicate:n,effect:(u,f)=>{f.unsubscribe(),d([u,f.getState(),f.getOriginalState()])}});i=()=>{c(),l()}})];a!=null&&s.push(new Promise(d=>setTimeout(d,a,null)));try{const d=await Cd(t,Promise.race(s));return Qe(t),d}finally{i()}};return(n,a)=>Sd(r(n,a))},wd=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:i}=e;if(t)a=Ae(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(process.env.NODE_ENV==="production"?H(21):"Creating or removing a listener requires one of the known fields for matching an action");return Qa(i,"options.listener"),{predicate:a,type:t,effect:i}},Ed=ct(e=>{const{type:t,predicate:r,effect:n}=wd(e);return{id:tr(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(process.env.NODE_ENV==="production"?H(22):"Unsubscribe not initialized")}}},{withTypes:()=>Ed}),no=(e,t)=>{const{type:r,effect:n,predicate:a}=wd(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===a)&&i.effect===n)},ya=e=>{e.pending.forEach(t=>{t.abort(va)})},Xu=(e,t)=>()=>{for(const r of t.keys())ya(r);e.clear()},ao=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},ei=ct(Ae(`${nr}/add`),{withTypes:()=>ei}),Pd=Ae(`${nr}/removeAll`),ti=ct(Ae(`${nr}/remove`),{withTypes:()=>ti}),Zu=(...e)=>{console.error(`${nr}/error`,...e)},Ju=(e={})=>{const t=new Map,r=new Map,n=h=>{const p=r.get(h)??0;r.set(h,p+1)},a=h=>{const p=r.get(h)??1;p===1?r.delete(h):r.set(h,p-1)},{extra:i,onError:s=Zu}=e;Qa(s,"onError");const d=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),p=>{h.unsubscribe(),p?.cancelActive&&ya(h)}),l=h=>d(no(t,h)??Ed(h));ct(l,{withTypes:()=>l});const c=h=>{const p=no(t,h);return p&&(p.unsubscribe(),h.cancelActive&&ya(p)),!!p};ct(c,{withTypes:()=>c});const u=async(h,p,v,y)=>{const $=new AbortController,g=Yu(l,$.signal),x=[];try{h.pending.add($),n(h),await Promise.resolve(h.effect(p,ct({},v,{getOriginalState:y,condition:(C,N)=>g(C,N).then(Boolean),take:g,delay:_d($.signal),pause:Hr($.signal),extra:i,signal:$.signal,fork:Ku($.signal,x),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((C,N,b)=>{C!==$&&(C.abort(va),b.delete(C))})},cancel:()=>{$.abort(va),h.pending.delete($)},throwIfCancelled:()=>{Qe($.signal)}})))}catch(C){C instanceof rr||ao(s,C,{raisedBy:"effect"})}finally{await Promise.all(x),$.abort(Gu),a(h),h.pending.delete($)}},f=Xu(t,r);return{middleware:h=>p=>v=>{if(!(0,be.isAction)(v))return p(v);if(ei.match(v))return l(v.payload);if(Pd.match(v)){f();return}if(ti.match(v))return c(v.payload);let y=h.getState();const $=()=>{if(y===ro)throw new Error(process.env.NODE_ENV==="production"?H(23):`${nr}: getOriginalState can only be called synchronously`);return y};let g;try{if(g=p(v),t.size>0){const x=h.getState(),C=Array.from(t.values());for(const N of C){let b=!1;try{b=N.predicate(v,x,y)}catch(T){b=!1,ao(s,T,{raisedBy:"predicate"})}b&&u(N,v,h,$)}}}finally{y=ro}return g},startListening:l,stopListening:c,clearListeners:f}},Qu=e=>({middleware:e,applied:new Map}),ef=e=>t=>t?.meta?.instanceId===e,tf=()=>{const e=tr(),t=new Map,r=Object.assign(Ae("dynamicMiddleware/add",(...d)=>({payload:d,meta:{instanceId:e}})),{withTypes:()=>r}),n=Object.assign(function(...l){l.forEach(c=>{Je(t,c,Qu)})},{withTypes:()=>n}),a=d=>(0,be.compose)(...Array.from(t.values()).map(l=>Je(l.applied,d,l.middleware))),i=qr(r,ef(e));return{middleware:d=>l=>c=>i(c)?(n(...c.payload),d.dispatch):a(d)(l)(c),addMiddleware:n,withMiddleware:r,instanceId:e}},rf=e=>"reducerPath"in e&&typeof e.reducerPath=="string",nf=e=>e.flatMap(t=>rf(t)?[[t.reducerPath,t.reducer]]:Object.entries(t)),ri=Symbol.for("rtk-state-proxy-original"),af=e=>!!e&&!!e[ri],of=new WeakMap,sf=(e,t,r)=>Je(of,e,()=>new Proxy(e,{get:(n,a,i)=>{if(a===ri)return n;const s=Reflect.get(n,a,i);if(typeof s>"u"){const d=r[a];if(typeof d<"u")return d;const l=t[a];if(l){const c=l(void 0,{type:tr()});if(typeof c>"u")throw new Error(process.env.NODE_ENV==="production"?H(24):`The slice reducer for key "${a.toString()}" returned undefined when called for selector(). If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);return r[a]=c,c}}return s}})),df=e=>{if(!af(e))throw new Error(process.env.NODE_ENV==="production"?H(25):"original must be used on state Proxy");return e[ri]},lf={},cf=(e=lf)=>e;function uf(...e){const t=Object.fromEntries(nf(e)),r=()=>Object.keys(t).length?(0,be.combineReducers)(t):cf;let n=r();function a(l,c){return n(l,c)}a.withLazyLoadedSlices=()=>a;const i={},s=(l,c={})=>{const{reducerPath:u,reducer:f}=l,m=t[u];return!c.overrideExisting&&m&&m!==f?(typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`inject\` to override already-existing reducer ${u} without specifying \`overrideExisting: true\``),a):(c.overrideExisting&&m!==f&&delete i[u],t[u]=f,n=r(),a)},d=Object.assign(function(c,u){return function(m,...h){return c(sf(u?u(m,...h):m,t,i),...h)}},{original:df});return Object.assign(a,{inject:s,selector:d})}function H(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function xr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xr=function(r){return typeof r}:xr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},xr(e)}function Wn(){}var ff={getItem:Wn,setItem:Wn,removeItem:Wn};function pf(e){if((typeof self>"u"?"undefined":xr(self))!=="object"||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch{return process.env.NODE_ENV!=="production"&&console.warn("redux-persist ".concat(e," test failed, persistence will be disabled.")),!1}return!0}function hf(e){var t="".concat(e,"Storage");return pf(t)?self[t]:(process.env.NODE_ENV!=="production"&&console.error("redux-persist failed to create sync storage. falling back to noop storage."),ff)}function mf(e){var t=hf(e);return{getItem:function(n){return new Promise(function(a,i){a(t.getItem(n))})},setItem:function(n,a){return new Promise(function(i,s){i(t.setItem(n,a))})},removeItem:function(n){return new Promise(function(a,i){a(t.removeItem(n))})}}}var lr=e=>e?["services","professionals","time","confirm","success"]:["professionals","services","time","confirm","success"],vf={currentStep:"services",completedSteps:["services"],isOrder:!0},Od=He({name:"breadcrumbs",initialState:vf,reducers:{setIsOrder:(e,t)=>{e.isOrder=t.payload},goToStep:(e,t)=>{const r=lr(e.isOrder),n=t.payload,a=r.indexOf(e.currentStep),i=r.indexOf(n);if(i<=a){e.currentStep=n;return}const s=r[i-1];e.completedSteps.includes(s)&&(e.currentStep=n)},completeStep:(e,t)=>{const r=t.payload;e.completedSteps.includes(r)||e.completedSteps.push(r)},nextStep:e=>{const t=lr(e.isOrder),r=t[t.indexOf(e.currentStep)+1];r&&(e.completedSteps.includes(e.currentStep)||e.completedSteps.push(e.currentStep),e.currentStep=r)},prevStep:e=>{const t=lr(e.isOrder),r=t[t.indexOf(e.currentStep)-1];r&&(e.currentStep=r)},clearSteps:e=>{e.currentStep="services",e.completedSteps=["services"]},resetCompletedStepsFrom:(e,t)=>{const r=t.payload,n=lr(e.isOrder),a=n.indexOf(r);e.completedSteps=e.completedSteps.filter(i=>n.indexOf(i)<=a)}}}),{setIsOrder:yf,goToStep:ga,completeStep:rg,nextStep:Se,prevStep:ng,clearSteps:ag,resetCompletedStepsFrom:io}=Od.actions,gf=Od.reducer,oo={id:"",outletName:"",timeZone:"",image:"",tenantId:"",address:"",isOpen:!1,outletTimeZoneDate:"",outletTimeZoneYear:"",createdAt:"",isService:!0,currency:"",token:""},jd=He({name:"outletDetails",initialState:oo,reducers:{clearBooking:()=>oo,setOutletData:(e,t)=>({...e,...t.payload}),setOutletToken:(e,t)=>{e.token=t.payload}}}),{clearBooking:$f,setOutletData:bf,setOutletToken:Nf}=jd.actions,Sf=jd.reducer,Td=He({name:"service",initialState:{superCategories:[],staff:[],selectedCategory:null,selectedServices:[],selectedProfessional:null},reducers:{setServicePayload:(e,t)=>{e.superCategories=t.payload.superCategories,e.staff=t.payload.staff},setCategory:(e,t)=>{e.selectedCategory=t.payload},toggleService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload.id);r?r.qty<5&&(r.qty+=1):e.selectedServices.push({...t.payload,qty:1})},incrementService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload);r&&r.qty<5&&(r.qty+=1)},decrementService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload);r&&(r.qty===1?e.selectedServices=e.selectedServices.filter(n=>n.id!==t.payload):r.qty-=1)},toggleProfessional:(e,t)=>{e.selectedProfessional=t.payload},clearSelectedServices:e=>{e.selectedServices=[]},clearSelectedProfessional:e=>{e.selectedProfessional=null}}}),{setServicePayload:xf,setCategory:ig,toggleService:Kr,clearSelectedServices:so,clearSelectedProfessional:lo,incrementService:Ad,decrementService:Yr,toggleProfessional:ni}=Td.actions,Cf=Td.reducer,qe="https://prod.aaravpos.com/api/v1",Ke=()=>({"Content-Type":"application/json",Authorization:`Bearer ${Sn.getState()?.booking.outletDetails?.token}`}),co=async(e,t,r)=>{const n=new URLSearchParams({available_online:"true",is_available_online_category:"true"});t&&n.append("tenantId",t),r&&n.append("outletId",r);const a=`${qe}/integration/service/code/${e}?${n}`,i=await fetch(a,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Failed to fetch services");return await i.json()},_f=async(e,t,r)=>{const n=await fetch(`${qe}/integration/slot/tenant/${e}/staff/${t}/online?date=${r}`,{method:"GET",headers:Ke()});if(!n.ok)throw new Error("Failed to fetch services");return await n.json()},wf=async e=>{const t=await fetch(`${qe}/integration/appointment/create`,{method:"POST",headers:Ke(),body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to fetch services");return await t.json()},Ef=async(e,t)=>{const r=await fetch(`${qe}/integration/appointment/details?tenantId=${t}&appointmentId=${e}`,{method:"GET",headers:Ke()});if(!r.ok)throw new Error("Failed to fetch appointment details");return await r.json()},Pf=async({search:e,tenantId:t})=>{const r=await fetch(`${qe}/integration/customer/drop-down/list?tenantId=${t}&search=${encodeURIComponent(e||"")}`,{method:"GET",headers:Ke()});if(!r.ok)throw new Error("Failed to fetch customers");return await r.json()},Of=async e=>{try{const t=await fetch(`${qe}/payment/pay/customer/direct`,{method:"POST",headers:Ke(),body:JSON.stringify(e)}),r=await t.json();if(!t.ok)throw r;return r}catch(t){throw t}},jf=async e=>{try{const t=await fetch(`${qe}/payment/orders/${e}/invoicing/finalize`,{method:"POST",headers:Ke()}),r=await t.json();if(!t.ok)throw r;return r}catch(t){throw t}},uo=e=>{const t=e?.consent_rule?.frequency??e?.consentFrequency??e?.frequency??"EVERY_VISIT";return t==="EVERY_X_DAYS"||t==="ONCE_PER_CUSTOMER"||t==="EVERY_VISIT"?t:"EVERY_VISIT"},ai=e=>{const t=!!(e?.requires_consent??e?.requiresConsent),r=String(e?.consent_form_id??e?.consentFormId??"").trim();return t&&!!r},fo=e=>{const t=e?.consent_rule?.channelRules||e?.consent_rule?.channel_rules||[],r=(Array.isArray(t)?t.find(n=>String(n?.channel||"").toUpperCase()==="ONLINE_BOOKING"):null)?.method||e?.enforcement?.ONLINE_BOOKING||e?.enforcement?.online_booking;return r==="DRAW_SIGNATURE"||r==="TYPED_NAME"||r==="CHECKBOX_ONLY"?r:null},po=async(e,t,r)=>{const n=await fetch(`${qe}/concent/check/${e}/${t}?serviceId=${r}`,{method:"GET",headers:Ke()});if(!n.ok)throw new Error("Failed to check consent requirement");return n.json()},Tf=async e=>{const{tenantId:t,outletId:r,appointmentId:n,customerId:a,serviceId:i,formId:s,staffId:d,signatureType:l,isChecked:c,typedName:u,imageUrl:f}=e,m={tenantId:t,appointmentId:n,customerId:a,serviceIds:[i],outletId:r,concentFormId:s,signatureType:l,channel:"Online_Web",staffId:d};l==="CHECKBOX_ONLY"&&(m.isChecked=c??!0),u&&(m.typedName=u),f&&(m.imageUrl=f);const h=await fetch(`${qe}/concent/customer-sign`,{method:"POST",headers:Ke(),body:JSON.stringify(m)}),p=await h.json();if(!h.ok)throw p;return p},Cr=Nn("slots/getStaffSlots",async({tenantId:e,staffId:t,date:r})=>await _f(e,t,r)),Id=He({name:"slots",initialState:{selectedSlotIndexes:[],selectedSlotIds:[],selectedDate:null,selectedTime:null,slots:{morning:[],afternoon:[],evening:[]},loading:!1},reducers:{setSelectedSlots:(e,t)=>{e.selectedSlotIndexes=t.payload.indexes,e.selectedSlotIds=t.payload.ids},setSelectedDate:(e,t)=>{e.selectedDate=t.payload},setSelectedTime:(e,t)=>{e.selectedTime=t.payload},clearSlots:e=>{e.slots={morning:[],afternoon:[],evening:[]},e.selectedSlotIndexes=[],e.selectedSlotIds=[],e.selectedDate=null,e.selectedTime=null}},extraReducers:e=>{e.addCase(Cr.pending,t=>{t.loading=!0}).addCase(Cr.fulfilled,(t,r)=>{t.loading=!1,t.slots=r.payload?.data?.groups||{morning:[],afternoon:[],evening:[]}}).addCase(Cr.rejected,t=>{t.loading=!1})}}),{setSelectedSlots:cr,clearSlots:ut,setSelectedDate:ft,setSelectedTime:ur}=Id.actions,Af=Id.reducer,kd=He({name:"theme",initialState:{button:{bg:"#d7263d",text:"#ffffff",bgHover:"#1f2937",textHover:"#ffffff"},colors:{bg:"#fafaf8",link:"#385b5a",text:"#e09898",bgHover:"#4c6f6e",textHover:"#ffffff"},isOpenSidebar:!1},reducers:{setTheme:(e,t)=>{e.button=t.payload?.button,e.colors=t.payload?.colors},setSidebarOpen:(e,t)=>{e.isOpenSidebar=t.payload}}}),{setTheme:If,setSidebarOpen:Ie}=kd.actions,kf=kd.reducer,_r=Nn("appointment/create",async(e,{rejectWithValue:t})=>{try{return await wf(e)}catch(r){return t(r?.message||r?.error||r?.data?.message||r?.response?.data?.message||"Failed to create appointment")}}),ho={loading:!1,success:!1,error:null,data:null,appointmentId:null,customerId:null,userDetails:null,tipPct:0,bookingMode:"booking",payType:""},Rd=He({name:"appointment",initialState:ho,reducers:{resetAppointment:()=>ho,setBookingMode:(e,t)=>{e.bookingMode=t.payload},setUserDetails:(e,t)=>{e.userDetails=t.payload},setPayType:(e,t)=>{e.payType=t.payload},setTips:(e,t)=>{e.tipPct=t.payload},setAppointmentId:(e,t)=>{e.appointmentId=t.payload},clearUserDetails:e=>{e.userDetails=null}},extraReducers:e=>{e.addCase(_r.pending,t=>{t.loading=!0,t.error=null}).addCase(_r.fulfilled,(t,r)=>{t.loading=!1,t.success=!0,t.data=r.payload;const n=r.payload;t.appointmentId=n?.id||null,t.customerId=n?.customerId||n?.customer?.id||null}).addCase(_r.rejected,(t,r)=>{t.loading=!1,t.error=r.payload||"Appointment failed"})}}),{resetAppointment:pt,setBookingMode:og,setUserDetails:Gn,setTips:Rf,setAppointmentId:fr,clearUserDetails:Df,setPayType:sg}=Rd.actions,Mf=Rd.reducer,Dd=He({name:"outletList",initialState:{outlets:[]},reducers:{setOutletList:(e,t)=>{e.outlets=t.payload},clearOutletList:e=>{e.outlets=[]}}}),{setOutletList:Ff,clearOutletList:dg}=Dd.actions,Lf=Dd.reducer,Bf=(0,ma.combineReducers)({booking:(0,ma.combineReducers)({breadcrumbs:gf,outletDetails:Sf,service:Cf,slots:Af,appointment:Mf,outletList:Lf,theme:kf})}),Uf=(e,t)=>(t.type==="RESET_ALL"&&(e=void 0),Bf(e,t)),Vf=()=>({getItem(){return Promise.resolve(null)},setItem(e,t){return Promise.resolve(t)},removeItem(){return Promise.resolve()}}),zf=(0,We.persistReducer)({key:"booking",storage:typeof window<"u"?mf("session"):Vf()},Uf),Sn=id({reducer:zf,devTools:process.env.NODE_ENV!=="production",middleware:e=>e({serializableCheck:{ignoredActions:[We.FLUSH,We.REHYDRATE,We.PAUSE,We.PERSIST,We.PURGE,We.REGISTER]}})}),ii=(0,We.persistStore)(Sn),lg=Sn.getState,De=Object.create(null);De.open="0";De.close="1";De.ping="2";De.pong="3";De.message="4";De.upgrade="5";De.noop="6";var wr=Object.create(null);Object.keys(De).forEach(e=>{wr[De[e]]=e});var $a={type:"error",data:"parser error"},Md=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fd=typeof ArrayBuffer=="function",Ld=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,oi=({type:e,data:t},r,n)=>Md&&t instanceof Blob?r?n(t):mo(t,n):Fd&&(t instanceof ArrayBuffer||Ld(t))?r?n(t):mo(new Blob([t]),n):n(De[e]+(t||"")),mo=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function vo(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Hn;function qf(e,t){if(Md&&e.data instanceof Blob)return e.data.arrayBuffer().then(vo).then(t);if(Fd&&(e.data instanceof ArrayBuffer||Ld(e.data)))return t(vo(e.data));oi(e,!1,r=>{Hn||(Hn=new TextEncoder),t(Hn.encode(r))})}var Wf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",It=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<64;e++)It[Wf.charCodeAt(e)]=e;var Gf=e=>{let t=e.length*.75,r=e.length,n,a=0,i,s,d,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)i=It[e.charCodeAt(n)],s=It[e.charCodeAt(n+1)],d=It[e.charCodeAt(n+2)],l=It[e.charCodeAt(n+3)],u[a++]=i<<2|s>>4,u[a++]=(s&15)<<4|d>>2,u[a++]=(d&3)<<6|l&63;return c},Hf=typeof ArrayBuffer=="function",si=(e,t)=>{if(typeof e!="string")return{type:"message",data:Bd(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Kf(e.substring(1),t)}:wr[r]?e.length>1?{type:wr[r],data:e.substring(1)}:{type:wr[r]}:$a},Kf=(e,t)=>Hf?Bd(Gf(e),t):{base64:!0,data:e},Bd=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Ud="",Yf=(e,t)=>{const r=e.length,n=new Array(r);let a=0;e.forEach((i,s)=>{oi(i,!1,d=>{n[s]=d,++a===r&&t(n.join(Ud))})})},Xf=(e,t)=>{const r=e.split(Ud),n=[];for(let a=0;a<r.length;a++){const i=si(r[a],t);if(n.push(i),i.type==="error")break}return n};function Zf(){return new TransformStream({transform(e,t){qf(e,r=>{const n=r.length;let a;if(n<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,n);else if(n<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(r)})}})}var Kn;function pr(e){return e.reduce((t,r)=>t+r.length,0)}function hr(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let a=0;a<t;a++)r[a]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function Jf(e,t){Kn||(Kn=new TextDecoder);const r=[];let n=0,a=-1,i=!1;return new TransformStream({transform(s,d){for(r.push(s);;){if(n===0){if(pr(r)<1)break;const l=hr(r,1);i=(l[0]&128)===128,a=l[0]&127,a<126?n=3:a===126?n=1:n=2}else if(n===1){if(pr(r)<2)break;const l=hr(r,2);a=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(pr(r)<8)break;const l=hr(r,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){d.enqueue($a);break}a=u*Math.pow(2,32)+c.getUint32(4),n=3}else{if(pr(r)<a)break;const l=hr(r,a);d.enqueue(si(i?l:Kn.decode(l),t)),n=0}if(a===0||a>e){d.enqueue($a);break}}}})}function se(e){if(e)return Qf(e)}function Qf(e){for(var t in se.prototype)e[t]=se.prototype[t];return e}se.prototype.on=se.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};se.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};se.prototype.off=se.prototype.removeListener=se.prototype.removeAllListeners=se.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,a=0;a<r.length;a++)if(n=r[a],n===t||n.fn===t){r.splice(a,1);break}return r.length===0&&delete this._callbacks["$"+e],this};se.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,a=r.length;n<a;++n)r[n].apply(this,t)}return this};se.prototype.emitReserved=se.prototype.emit;se.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};se.prototype.hasListeners=function(e){return!!this.listeners(e).length};var xn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Ee=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),e0="arraybuffer";function Vd(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}var t0=Ee.setTimeout,r0=Ee.clearTimeout;function Cn(e,t){t.useNativeTimers?(e.setTimeoutFn=t0.bind(Ee),e.clearTimeoutFn=r0.bind(Ee)):(e.setTimeoutFn=Ee.setTimeout.bind(Ee),e.clearTimeoutFn=Ee.clearTimeout.bind(Ee))}var n0=1.33;function a0(e){return typeof e=="string"?i0(e):Math.ceil((e.byteLength||e.size)*n0)}function i0(e){let t=0,r=0;for(let n=0,a=e.length;n<a;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}function zd(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function o0(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function s0(e){let t={},r=e.split("&");for(let n=0,a=r.length;n<a;n++){let i=r[n].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}var d0=class extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}},di=class extends se{constructor(e){super(),this.writable=!1,Cn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new d0(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=si(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=o0(e);return t.length?"?"+t:""}},l0=class extends di{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Xf(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Yf(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=zd()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},qd=!1;try{qd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var c0=qd;function u0(){}var f0=class extends l0{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let r=location.port;r||(r=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(n,a)=>{this.onError("xhr post error",n,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}},ht=class Er extends se{constructor(t,r,n){super(),this.createRequest=t,Cn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=Vd(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&n.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var a;n.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Er.requestsCount++,Er.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=u0,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Er.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ht.requestsCount=0;ht.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",yo);else if(typeof addEventListener=="function"){const e="onpagehide"in Ee?"pagehide":"unload";addEventListener(e,yo,!1)}}function yo(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}var p0=(function(){const e=Wd({xdomain:!1});return e&&e.responseType!==null})(),h0=class extends f0{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=p0&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ht(Wd,this.uri(),e)}};function Wd(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||c0))return new XMLHttpRequest}catch{}if(!t)try{return new Ee[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Gd=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",m0=class extends di{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,r=Gd?{}:Vd(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;oi(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}n&&xn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=zd()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Yn=Ee.WebSocket||Ee.MozWebSocket,v0=class extends m0{createSocket(e,t,r){return Gd?new Yn(e,t,r):t?new Yn(e,t):new Yn(e)}doWrite(e,t){this.ws.send(t)}},y0=class extends di{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Jf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),n=Zf();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const a=()=>{r.read().then(({done:s,value:d})=>{s||(this.onPacket(d),a())}).catch(s=>{})};a();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&xn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}},g0={websocket:v0,webtransport:y0,polling:h0},$0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,b0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ba(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let a=$0.exec(e||""),i={},s=14;for(;s--;)i[b0[s]]=a[s]||"";return r!=-1&&n!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=N0(i,i.path),i.queryKey=S0(i,i.query),i}function N0(e,t){const r=t.replace(/\/{2,9}/g,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function S0(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,a,i){a&&(r[a]=i)}),r}var Na=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pr=[];Na&&addEventListener("offline",()=>{Pr.forEach(e=>e())},!1);var Or=class jr extends se{constructor(t,r){if(super(),this.binaryType=e0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=ba(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=ba(r.host).host);Cn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const a=n.prototype.name;this.transports.push(a),this._transportsByName[a]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=s0(this.opts.query)),Na&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Pr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=4,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&jr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",jr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const n=this.writeBuffer[r].data;if(n&&(t+=a0(n)),r>0&&t>this._maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,xn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,a){if(typeof r=="function"&&(a=r,r=void 0),typeof n=="function"&&(a=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const i={type:t,data:r,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(jr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Na&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Pr.indexOf(this._offlineEventListener);n!==-1&&Pr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}};Or.protocol=4;var x0=class extends Or{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;Or.priorWebsocketSuccess=!1;const n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Or.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=t.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),t.close(),t=null)}const i=u=>{const f=new Error("probe error: "+u);f.transport=t.name,a(),this.emitReserved("upgradeError",f)};function s(){i("transport closed")}function d(){i("socket closed")}function l(u){t&&u.name!==t.name&&a()}const c=()=>{t.removeListener("open",n),t.removeListener("error",i),t.removeListener("close",s),this.off("close",d),this.off("upgrading",l)};t.once("open",n),t.once("error",i),t.once("close",s),this.once("close",d),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}},Hd=class extends x0{constructor(e,t={}){const r=typeof e=="object",n=r?{...e}:{...t};(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(a=>g0[a]).filter(a=>!!a)),super(r?n:e,n)}},cg=Hd.protocol;function C0(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=ba(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(r&&r.port===n.port?"":":"+n.port),n}var _0=typeof ArrayBuffer=="function",w0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Kd=Object.prototype.toString,E0=typeof Blob=="function"||typeof Blob<"u"&&Kd.call(Blob)==="[object BlobConstructor]",P0=typeof File=="function"||typeof File<"u"&&Kd.call(File)==="[object FileConstructor]";function li(e){return _0&&(e instanceof ArrayBuffer||w0(e))||E0&&e instanceof Blob||P0&&e instanceof File}function Tr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(Tr(e[r]))return!0;return!1}if(li(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Tr(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&Tr(e[r]))return!0;return!1}function O0(e){const t=[],r=e.data,n=e;return n.data=Sa(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Sa(e,t){if(!e)return e;if(li(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Sa(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Sa(e[n],t));return r}return e}function j0(e,t){return e.data=xa(e.data,t),delete e.attachments,e}function xa(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=xa(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=xa(e[r],t));return e}var T0=As({Decoder:()=>I0,Encoder:()=>A0,PacketType:()=>W,isPacketValid:()=>F0,protocol:()=>5}),Yd=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var W;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(W||(W={}));var A0=class{constructor(e){this.replacer=e}encode(e){return(e.type===W.EVENT||e.type===W.ACK)&&Tr(e)?this.encodeAsBinary({type:e.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===W.BINARY_EVENT||e.type===W.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=O0(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}},I0=class Xd extends se{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===W.BINARY_EVENT;n||r.type===W.BINARY_ACK?(r.type=n?W.EVENT:W.ACK,this.reconstructor=new k0(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(li(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(W[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===W.BINARY_EVENT||n.type===W.BINARY_ACK){const i=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const s=t.substring(i,r);if(s!=Number(s)||t.charAt(r)!=="-")throw new Error("Illegal attachments");const d=Number(s);if(!Zd(d)||d<0)throw new Error("Illegal attachments");if(d>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=d}if(t.charAt(r+1)==="/"){const i=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(i,r)}else n.nsp="/";const a=t.charAt(r+1);if(a!==""&&Number(a)==a){const i=r+1;for(;++r;){const s=t.charAt(r);if(s==null||Number(s)!=s){--r;break}if(r===t.length)break}n.id=Number(t.substring(i,r+1))}if(t.charAt(++r)){const i=this.tryParse(t.substr(r));if(Xd.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case W.CONNECT:return Xr(r);case W.DISCONNECT:return r===void 0;case W.CONNECT_ERROR:return typeof r=="string"||Xr(r);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Yd.indexOf(r[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},k0=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=j0(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function R0(e){return typeof e=="string"}var Zd=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function D0(e){return e===void 0||Zd(e)}function Xr(e){return Object.prototype.toString.call(e)==="[object Object]"}function M0(e,t){switch(e){case W.CONNECT:return t===void 0||Xr(t);case W.DISCONNECT:return t===void 0;case W.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Yd.indexOf(t[0])===-1);case W.ACK:return Array.isArray(t);case W.CONNECT_ERROR:return typeof t=="string"||Xr(t);default:return!1}}function F0(e){return R0(e.nsp)&&D0(e.id)&&M0(e.type,e.data)}function Te(e,t,r){return e.on(t,r),function(){e.off(t,r)}}var L0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Jd=class extends se{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Te(e,"open",this.onopen.bind(this)),Te(e,"packet",this.onpacket.bind(this)),Te(e,"error",this.onerror.bind(this)),Te(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,a;if(L0.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:W.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const l=this.ids++,c=t.pop();this._registerAckCallback(l,c),i.id=l}const s=(n=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||n===void 0?void 0:n.writable,d=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(d?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var r;const n=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);t.call(this,new Error("operation has timed out"))},n),i=(...s)=>{this.io.clearTimeoutFn(a),t.apply(this,s)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((r,n)=>{const a=(i,s)=>i?n(i):r(s);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...a)=>(this._queue[0],n!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:W.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case W.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case W.EVENT:case W.BINARY_EVENT:this.onevent(e);break;case W.ACK:case W.BINARY_ACK:this.onack(e);break;case W.DISCONNECT:this.ondisconnect();break;case W.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,t.packet({type:W.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:W.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}};function Ct(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ct.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Ct.prototype.reset=function(){this.attempts=0};Ct.prototype.setMin=function(e){this.ms=e};Ct.prototype.setMax=function(e){this.max=e};Ct.prototype.setJitter=function(e){this.jitter=e};var Ca=class extends se{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Cn(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ct({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||T0;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Hd(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=Te(t,"open",function(){r.onopen(),e&&e()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),e?e(s):this.maybeReconnectOnOpen()},i=Te(t,"error",a);if(this._timeout!==!1){const s=this._timeout,d=this.setTimeoutFn(()=>{n(),a(new Error("timeout")),t.close()},s);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Te(e,"ping",this.onping.bind(this)),Te(e,"data",this.ondata.bind(this)),Te(e,"error",this.onerror.bind(this)),Te(e,"close",this.onclose.bind(this)),Te(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){xn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Jd(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}},Tt={};function Ar(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=C0(e,t.path||"/socket.io"),n=r.source,a=r.id,i=r.path,s=Tt[a]&&i in Tt[a].nsps,d=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return d?l=new Ca(n,t):(Tt[a]||(Tt[a]=new Ca(n,t)),l=Tt[a]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}Object.assign(Ar,{Manager:Ca,Socket:Jd,io:Ar,connect:Ar});var B0="https://prod.aaravpos.com",Qd=(0,S.createContext)(void 0),U0=({children:e})=>{const{selectedProfessional:t}=(0,M.useSelector)(a=>a.booking.service),[r]=(0,S.useState)(()=>Ar(B0,{path:"/socket.io",transports:["websocket"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:3e3})),n=a=>{r.connected||r.connect(),r.off("connect"),r.on("connect",()=>{r.emit("joinStaff",a)})};return(0,S.useEffect)(()=>{t?.id&&n({staffId:t.id,roomId:t.id,room:t.id,id:t.id})},[t?.id]),(0,o.jsx)(Qd.Provider,{value:{socket:r,connectSocket:n},children:e})},V0=()=>{const e=(0,S.useContext)(Qd);if(!e)throw new Error("useSocket must be used within SocketProvider");return e};function z0({children:e}){return(0,o.jsx)(M.Provider,{store:Sn,children:(0,o.jsx)(Is,{loading:null,persistor:ii,children:(0,o.jsx)(U0,{children:e})})})}var q0=e=>{if(!e)return;const t=document.documentElement;e?.button?.bg&&t.style.setProperty("--btn-bg",e.button.bg),e.button?.text&&t.style.setProperty("--btn-text",e.button.text),e.button?.bgHover&&t.style.setProperty("--btn-bg-hover",e.button.bgHover),e.button?.textHover&&t.style.setProperty("--btn-text-hover",e.button.textHover),e.colors?.bg&&t.style.setProperty("--app-bg",e.colors.bg),e.colors?.link&&t.style.setProperty("--app-link",e.colors.link),e.colors?.text&&t.style.setProperty("--app-text",e.colors.text),e.colors?.bgHover&&t.style.setProperty("--app-bg-hover",e.colors.bgHover),e.colors?.textHover&&t.style.setProperty("--app-text-hover",e.colors.textHover)},el=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),W0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),go=e=>{const t=G0(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},H0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},K0=(0,S.createContext)({}),Y0=()=>(0,S.useContext)(K0),X0=(0,S.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...d},l)=>{const{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:m="currentColor",className:h=""}=Y0()??{},p=n??f?Number(r??u)*24/Number(t??c):r??u;return(0,S.createElement)("svg",{ref:l,...Xn,width:t??c??Xn.width,height:t??c??Xn.height,stroke:e??m,strokeWidth:p,className:el("lucide",h,a),...!i&&!H0(d)&&{"aria-hidden":"true"},...d},[...s.map(([v,y])=>(0,S.createElement)(v,y)),...Array.isArray(i)?i:[i]])}),X=(e,t)=>{const r=(0,S.forwardRef)(({className:n,...a},i)=>(0,S.createElement)(X0,{ref:i,iconNode:t,className:el(`lucide-${W0(go(e))}`,`lucide-${e}`,n),...a}));return r.displayName=go(e),r},Z0=[["path",{d:"M11 14h1v4",key:"fy54vd"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],J0=X("calendar-1",Z0),Q0=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],ep=X("calendar-days",Q0),tp=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ci=X("check",tp),rp=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ui=X("chevron-down",rp),np=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Zr=X("chevron-left",np),ap=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_t=X("chevron-right",ap),ip=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_a=X("circle-check",ip),op=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],gt=X("clock-3",op),sp=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],tl=X("dollar-sign",sp),dp=[["path",{d:"M4 10h12",key:"1y6xl8"}],["path",{d:"M4 14h9",key:"1loblj"}],["path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",key:"1j6lzo"}]],lp=X("euro",dp),cp=[["path",{d:"M6 3h12",key:"ggurg9"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"m6 13 8.5 8",key:"u1kupk"}],["path",{d:"M6 13h3",key:"wdp6ag"}],["path",{d:"M9 13c6.667 0 6.667-10 0-10",key:"1nkvk2"}]],up=X("indian-rupee",cp),fp=[["path",{d:"M5 12h14",key:"1ays0h"}]],rl=X("minus",fp),pp=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],hp=X("moon",pp),mp=[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]],$o=X("move-left",mp),vp=[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]],yp=X("move-right",vp),gp=[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]],Jr=X("package-2",gp),$p=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fi=X("plus",$p),bp=[["path",{d:"M18 7c0-5.333-8-5.333-8 0",key:"1prm2n"}],["path",{d:"M10 7v14",key:"18tmcs"}],["path",{d:"M6 21h12",key:"4dkmi1"}],["path",{d:"M6 13h10",key:"ybwr4a"}]],Np=X("pound-sterling",bp),Sp=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],xp=X("rotate-cw",Sp),Cp=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],nl=X("scissors",Cp),_p=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pi=X("search",_p),wp=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],Ep=X("shopping-cart",wp),Pp=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],Op=X("store",Pp),jp=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Tp=X("sun",jp),Ap=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Ip=X("sunrise",Ap),kp=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],al=X("user",kp),Rp=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ye=X("x",Rp),Dp=({status:e})=>(0,o.jsx)("span",{className:`aaravpos-status-badge ${e?"aaravpos-status-open":"aaravpos-status-closed"}`,children:e?"Open":"Closed"}),Mp=({item:e,onSelect:t,selected:r})=>(0,o.jsxs)("div",{className:`aaravpos-outlet-card
15
+ (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),v.warnIfExceeded()),p}}}function sr(e){return typeof e=="boolean"}var bu=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{};let s=new Xa;if(r&&(sr(r)?s.push(hu):s.push(mu(r.extraArgument))),process.env.NODE_ENV!=="production"){if(n){let d={};sr(n)||(d=n),s.unshift(rd(d))}if(a){let d={};sr(a)||(d=a),s.push(ad(d))}if(i){let d={};sr(i)||(d=i),s.unshift(Zs(d))}}return s},Ja="RTK_autoBatch",Nu=()=>e=>({payload:e,meta:{[Ja]:!0}}),eo=e=>t=>{setTimeout(t,e)},id=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let a=!0,i=!1,s=!1;const d=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:eo(10):e.type==="callback"?e.queueNotification:eo(e.timeout),c=()=>{s=!1,i&&(i=!1,d.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>a&&u(),m=n.subscribe(f);return d.add(u),()=>{m(),d.delete(u)}},dispatch(u){try{return a=!u?.meta?.[Ja],i=!a,i&&(s||(s=!0,l(c))),n.dispatch(u)}finally{a=!0}}})},Su=e=>function(r){const{autoBatch:n=!0}=r??{};let a=new Xa(e);return n&&a.push(id(typeof n=="object"?n:void 0)),a};function od(e){const t=bu(),{reducer:r=void 0,middleware:n,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:d=void 0}=e||{};let l;if(typeof r=="function")l=r;else if((0,Ne.isPlainObject)(r))l=(0,Ne.combineReducers)(r);else throw new Error(process.env.NODE_ENV==="production"?H(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&n&&typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?H(2):"`middleware` field must be a callback");let c;if(typeof n=="function"){if(c=n(t),process.env.NODE_ENV!=="production"&&!Array.isArray(c))throw new Error(process.env.NODE_ENV==="production"?H(3):"when using a middleware builder function, an array of middleware must be returned")}else c=t();if(process.env.NODE_ENV!=="production"&&c.some(v=>typeof v!="function"))throw new Error(process.env.NODE_ENV==="production"?H(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&i){let v=new Set;c.forEach(y=>{if(v.has(y))throw new Error(process.env.NODE_ENV==="production"?H(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");v.add(y)})}let u=Ne.compose;a&&(u=vu({trace:process.env.NODE_ENV!=="production",...typeof a=="object"&&a}));const f=(0,Ne.applyMiddleware)(...c),m=Su(f);if(process.env.NODE_ENV!=="production"&&d&&typeof d!="function")throw new Error(process.env.NODE_ENV==="production"?H(5):"`enhancers` field must be a callback");let h=typeof d=="function"?d(m):m();if(process.env.NODE_ENV!=="production"&&!Array.isArray(h))throw new Error(process.env.NODE_ENV==="production"?H(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&h.some(v=>typeof v!="function"))throw new Error(process.env.NODE_ENV==="production"?H(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&c.length&&!h.includes(f)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=u(...h);return(0,Ne.createStore)(l,s,p)}function sd(e){const t={},r=[];let n;const a={addCase(i,s){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error(process.env.NODE_ENV==="production"?H(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error(process.env.NODE_ENV==="production"?H(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const d=typeof i=="string"?i:i.type;if(!d)throw new Error(process.env.NODE_ENV==="production"?H(28):"`builder.addCase` cannot be called with an empty action type");if(d in t)throw new Error(process.env.NODE_ENV==="production"?H(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${d}'`);return t[d]=s,a},addAsyncThunk(i,s){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&r.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:s}),a},addDefaultCase(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?H(31):"`builder.addDefaultCase` can only be called once");return n=i,a}};return e(a),[t,r,n]}function Cu(e){return typeof e=="function"}function dd(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?H(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[r,n,a]=sd(t),i;if(Cu(e))i=()=>Qi(e());else{const d=Qi(e);i=()=>d}function s(d=i(),l){let c=[r[l.type],...n.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[a]),c.reduce((u,f)=>{if(f)if(xe(u)){const m=f(u,l);return m===void 0?u:m}else{if(De(u))return gn(u,m=>f(m,l));{const m=f(u,l);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},d)}return s.getInitialState=i,s}var ld=(e,t)=>Ks(e)?e.match(t):e(t);function Ct(...e){return t=>e.some(r=>ld(r,t))}function qr(...e){return t=>e.every(r=>ld(r,t))}function bn(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function er(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function cd(...e){return e.length===0?t=>bn(t,["pending"]):er(e)?Ct(...e.map(t=>t.pending)):cd()(e[0])}function Wr(...e){return e.length===0?t=>bn(t,["rejected"]):er(e)?Ct(...e.map(t=>t.rejected)):Wr()(e[0])}function ud(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?qr(Wr(...e),t):er(e)?qr(Wr(...e),t):ud()(e[0])}function fd(...e){return e.length===0?t=>bn(t,["fulfilled"]):er(e)?Ct(...e.map(t=>t.fulfilled)):fd()(e[0])}function pd(...e){return e.length===0?t=>bn(t,["pending","fulfilled","rejected"]):er(e)?Ct(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):pd()(e[0])}var xu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",tr=(e=21)=>{let t="",r=e;for(;r--;)t+=xu[Math.random()*64|0];return t},_u=["name","message","stack","code"],qn=class{constructor(e,t){this.payload=e,this.meta=t}_type},to=class{constructor(e,t){this.payload=e,this.meta=t}_type},hd=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of _u)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},ro="External signal was aborted",Nn=(()=>{function e(t,r,n){const a=Ie(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:{...f||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),i=Ie(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=Ie(t+"/rejected",(l,c,u,f,m)=>({payload:f,error:(n&&n.serializeError||hd)(l||"Rejected"),meta:{...m||{},arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function d(l,{signal:c}={}){return(u,f,m)=>{const h=n?.idGenerator?n.idGenerator(l):tr(),p=new AbortController;let v,y;function $(C){y=C,p.abort()}c&&(c.aborted?$(ro):c.addEventListener("abort",()=>$(ro),{once:!0}));const g=(async function(){let C;try{let x=n?.condition?.(l,{getState:f,extra:m});if(wu(x)&&(x=await x),x===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const N=new Promise((b,T)=>{v=()=>{T({name:"AbortError",message:y||"Aborted"})},p.signal.addEventListener("abort",v,{once:!0})});u(i(h,l,n?.getPendingMeta?.({requestId:h,arg:l},{getState:f,extra:m}))),C=await Promise.race([N,Promise.resolve(r(l,{dispatch:u,getState:f,extra:m,requestId:h,signal:p.signal,abort:$,rejectWithValue:(b,T)=>new qn(b,T),fulfillWithValue:(b,T)=>new to(b,T)})).then(b=>{if(b instanceof qn)throw b;return b instanceof to?a(b.payload,h,l,b.meta):a(b,h,l)})])}catch(x){C=x instanceof qn?s(null,h,l,x.payload,x.meta):s(x,h,l)}finally{v&&p.signal.removeEventListener("abort",v)}return n&&!n.dispatchConditionRejection&&s.match(C)&&C.meta.condition||u(C),C})();return Object.assign(g,{abort:$,requestId:h,arg:l,unwrap(){return g.then(md)}})}}return Object.assign(d,{pending:i,rejected:s,fulfilled:a,settled:Ct(s,a),typePrefix:t})}return e.withTypes=()=>e,e})();function md(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function wu(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var vd=Symbol.for("rtk-slice-createasyncthunk"),Eu={[vd]:Nn},yd=(e=>(e.reducer="reducer",e.reducerWithPrepare="reducerWithPrepare",e.asyncThunk="asyncThunk",e))(yd||{});function Pu(e,t){return`${e}/${t}`}function gd({creators:e}={}){const t=e?.asyncThunk?.[vd];return function(n){const{name:a,reducerPath:i=a}=n;if(!a)throw new Error(process.env.NODE_ENV==="production"?H(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&n.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const s=(typeof n.reducers=="function"?n.reducers(ju()):n.reducers)||{},d=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(C,x){const N=typeof C=="string"?C:C.type;if(!N)throw new Error(process.env.NODE_ENV==="production"?H(12):"`context.addCase` cannot be called with an empty action type");if(N in l.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?H(13):"`context.addCase` cannot be called with two reducers for the same action type: "+N);return l.sliceCaseReducersByType[N]=x,c},addMatcher(C,x){return l.sliceMatchers.push({matcher:C,reducer:x}),c},exposeAction(C,x){return l.actionCreators[C]=x,c},exposeCaseReducer(C,x){return l.sliceCaseReducersByName[C]=x,c}};d.forEach(C=>{const x=s[C],N={reducerName:C,type:Pu(a,C),createNotation:typeof n.reducers=="function"};Au(x)?ku(N,x,c,t):Tu(N,x,c)});function u(){if(process.env.NODE_ENV!=="production"&&typeof n.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?H(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[C={},x=[],N=void 0]=typeof n.extraReducers=="function"?sd(n.extraReducers):[n.extraReducers],b={...C,...l.sliceCaseReducersByType};return dd(n.initialState,T=>{for(let R in b)T.addCase(R,b[R]);for(let R of l.sliceMatchers)T.addMatcher(R.matcher,R.reducer);for(let R of x)T.addMatcher(R.matcher,R.reducer);N&&T.addDefaultCase(N)})}const f=C=>C,m=new Map,h=new WeakMap;let p;function v(C,x){return p||(p=u()),p(C,x)}function y(){return p||(p=u()),p.getInitialState()}function $(C,x=!1){function N(T){let R=T[C];if(typeof R>"u"){if(x)R=Je(h,N,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?H(15):"selectSlice returned undefined for an uninjected slice reducer")}return R}function b(T=f){return Je(Je(m,x,()=>new WeakMap),T,()=>{const R={};for(const[W,Q]of Object.entries(n.selectors??{}))R[W]=Ou(Q,T,()=>Je(h,T,y),x);return R})}return{reducerPath:C,getSelectors:b,get selectors(){return b(N)},selectSlice:N}}const g={name:a,reducer:v,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:y,...$(i),injectInto(C,{reducerPath:x,...N}={}){const b=x??i;return C.inject({reducerPath:b,reducer:v},N),{...g,...$(b,!0)}}};return g}}function Ou(e,t,r,n){function a(i,...s){let d=t(i);if(typeof d>"u"){if(n)d=r();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?H(16):"selectState returned undefined for an uninjected slice reducer")}return e(d,...s)}return a.unwrapped=e,a}var He=gd();function ju(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Tu({type:e,reducerName:t,createNotation:r},n,a){let i,s;if("reducer"in n){if(r&&!Iu(n))throw new Error(process.env.NODE_ENV==="production"?H(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=n.reducer,s=n.prepare}else i=n;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Ie(e,s):Ie(e))}function Au(e){return e._reducerDefinitionType==="asyncThunk"}function Iu(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ku({type:e,reducerName:t},r,n,a){if(!a)throw new Error(process.env.NODE_ENV==="production"?H(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:s,pending:d,rejected:l,settled:c,options:u}=r,f=a(e,i,u);n.exposeAction(t,f),s&&n.addCase(f.fulfilled,s),d&&n.addCase(f.pending,d),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:s||dr,pending:d||dr,rejected:l||dr,settled:c||dr})}function dr(){}function Ru(){return{ids:[],entities:{}}}function Du(e){function t(r={},n){const a=Object.assign(Ru(),r);return n?e.setAll(a,n):a}return{getInitialState:t}}function Mu(){function e(t,r={}){const{createSelector:n=Hs}=r,a=f=>f.ids,i=f=>f.entities,s=n(a,i,(f,m)=>f.map(h=>m[h])),d=(f,m)=>m,l=(f,m)=>f[m],c=n(a,f=>f.length);if(!t)return{selectIds:a,selectEntities:i,selectAll:s,selectTotal:c,selectById:n(i,d,l)};const u=n(t,i);return{selectIds:n(t,a),selectEntities:u,selectAll:n(t,s),selectTotal:n(t,c),selectById:n(u,d,l)}}return{getSelectors:e}}var Fu=xe;function Lu(e){const t=ie((r,n)=>e(n));return function(n){return t(n,void 0)}}function ie(e){return function(r,n){function a(s){return Xs(s)}const i=s=>{a(n)?e(n.payload,s):e(n,s)};return Fu(r)?(i(r),r):gn(r,i)}}function dt(e,t){const r=t(e);return process.env.NODE_ENV!=="production"&&r===void 0&&console.warn("The entity passed to the `selectId` implementation returned undefined.","You should probably provide your own `selectId` implementation.","The entity that was passed:",e,"The `selectId` implementation:",t.toString()),r}function Ge(e){return Array.isArray(e)||(e=Object.values(e)),e}function Sr(e){return xe(e)?yn(e):e}function $d(e,t,r){e=Ge(e);const n=Sr(r.ids),a=new Set(n),i=[],s=new Set([]),d=[];for(const l of e){const c=dt(l,t);a.has(c)||s.has(c)?d.push({id:c,changes:l}):(s.add(c),i.push(l))}return[i,d,n]}function bd(e){function t(p,v){const y=dt(p,e);y in v.entities||(v.ids.push(y),v.entities[y]=p)}function r(p,v){p=Ge(p);for(const y of p)t(y,v)}function n(p,v){const y=dt(p,e);y in v.entities||v.ids.push(y),v.entities[y]=p}function a(p,v){p=Ge(p);for(const y of p)n(y,v)}function i(p,v){p=Ge(p),v.ids=[],v.entities={},r(p,v)}function s(p,v){return d([p],v)}function d(p,v){let y=!1;p.forEach($=>{$ in v.entities&&(delete v.entities[$],y=!0)}),y&&(v.ids=v.ids.filter($=>$ in v.entities))}function l(p){Object.assign(p,{ids:[],entities:{}})}function c(p,v,y){const $=y.entities[v.id];if($===void 0)return!1;const g=Object.assign({},$,v.changes),C=dt(g,e),x=C!==v.id;return x&&(p[v.id]=C,delete y.entities[v.id]),y.entities[C]=g,x}function u(p,v){return f([p],v)}function f(p,v){const y={},$={};p.forEach(g=>{g.id in v.entities&&($[g.id]={id:g.id,changes:{...$[g.id]?.changes,...g.changes}})}),p=Object.values($),p.length>0&&p.filter(g=>c(y,g,v)).length>0&&(v.ids=Object.values(v.entities).map(g=>dt(g,e)))}function m(p,v){return h([p],v)}function h(p,v){const[y,$]=$d(p,e,v);r(y,v),f($,v)}return{removeAll:Lu(l),addOne:ie(t),addMany:ie(r),setOne:ie(n),setMany:ie(a),setAll:ie(i),updateOne:ie(u),updateMany:ie(f),upsertOne:ie(m),upsertMany:ie(h),removeOne:ie(s),removeMany:ie(d)}}function Bu(e,t,r){let n=0,a=e.length;for(;n<a;){let i=n+a>>>1;const s=e[i];r(t,s)>=0?n=i+1:a=i}return n}function Uu(e,t,r){const n=Bu(e,t,r);return e.splice(n,0,t),e}function Vu(e,t){const{removeOne:r,removeMany:n,removeAll:a}=bd(e);function i(y,$){return s([y],$)}function s(y,$,g){y=Ge(y);const C=new Set(g??Sr($.ids)),x=new Set,N=y.filter(b=>{const T=dt(b,e),R=!x.has(T);return R&&x.add(T),!C.has(T)&&R});N.length!==0&&v($,N)}function d(y,$){return l([y],$)}function l(y,$){let g={};if(y=Ge(y),y.length!==0){for(const C of y){const x=e(C);g[x]=C,delete $.entities[x]}y=Ge(g),v($,y)}}function c(y,$){y=Ge(y),$.entities={},$.ids=[],s(y,$,[])}function u(y,$){return f([y],$)}function f(y,$){let g=!1,C=!1;for(let x of y){const N=$.entities[x.id];if(!N)continue;g=!0,Object.assign(N,x.changes);const b=e(N);if(x.id!==b){C=!0,delete $.entities[x.id];const T=$.ids.indexOf(x.id);$.ids[T]=b,$.entities[b]=N}}g&&v($,[],g,C)}function m(y,$){return h([y],$)}function h(y,$){const[g,C,x]=$d(y,e,$);g.length&&s(g,$,x),C.length&&f(C,$)}function p(y,$){if(y.length!==$.length)return!1;for(let g=0;g<y.length;g++)if(y[g]!==$[g])return!1;return!0}const v=(y,$,g,C)=>{const x=Sr(y.entities),N=Sr(y.ids),b=y.entities;let T=N;C&&(T=new Set(N));let R=[];for(const oe of T){const ee=x[oe];ee&&R.push(ee)}const W=R.length===0;for(const oe of $)b[e(oe)]=oe,W||Uu(R,oe,t);W?R=$.slice().sort(t):g&&R.sort(t);const Q=R.map(e);p(N,Q)||(y.ids=Q)};return{removeOne:r,removeMany:n,removeAll:a,addOne:ie(i),updateOne:ie(u),upsertOne:ie(m),setOne:ie(d),setMany:ie(l),setAll:ie(c),addMany:ie(s),updateMany:ie(f),upsertMany:ie(h)}}function zu(e={}){const{selectId:t,sortComparer:r}={sortComparer:!1,selectId:s=>s.id,...e},n=r?Vu(t,r):bd(t),a=Du(n),i=Mu();return{selectId:t,sortComparer:r,...a,...i,...n}}var qu="task",Nd="listener",Sd="completed",Qa="cancelled",Wu=`task-${Qa}`,Gu=`task-${Sd}`,ya=`${Nd}-${Qa}`,Hu=`${Nd}-${Sd}`,rr=class{constructor(e){this.code=e,this.message=`${qu} ${Qa} (reason: ${e})`}name="TaskAbortError";message},ei=(e,t)=>{if(typeof e!="function")throw new TypeError(process.env.NODE_ENV==="production"?H(32):`${t} is not a function`)},Gr=()=>{},Cd=(e,t=Gr)=>(e.catch(t),e),xd=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Qe=e=>{if(e.aborted)throw new rr(e.reason)};function _d(e,t){let r=Gr;return new Promise((n,a)=>{const i=()=>a(new rr(e.reason));if(e.aborted){i();return}r=xd(e,i),t.finally(()=>r()).then(n,a)}).finally(()=>{r=Gr})}var Ku=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof rr?"cancelled":"rejected",error:r}}finally{t?.()}},Hr=e=>t=>Cd(_d(e,t).then(r=>(Qe(e),r))),wd=e=>{const t=Hr(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ct}=Object,no={},nr="listenerMiddleware",Yu=(e,t)=>{const r=n=>xd(e,()=>n.abort(e.reason));return(n,a)=>{ei(n,"taskExecutor");const i=new AbortController;r(i);const s=Ku(async()=>{Qe(e),Qe(i.signal);const d=await n({pause:Hr(i.signal),delay:wd(i.signal),signal:i.signal});return Qe(i.signal),d},()=>i.abort(Gu));return a?.autoJoin&&t.push(s.catch(Gr)),{result:Hr(e)(s),cancel(){i.abort(Wu)}}}},Xu=(e,t)=>{const r=async(n,a)=>{Qe(t);let i=()=>{};const s=[new Promise((d,l)=>{let c=e({predicate:n,effect:(u,f)=>{f.unsubscribe(),d([u,f.getState(),f.getOriginalState()])}});i=()=>{c(),l()}})];a!=null&&s.push(new Promise(d=>setTimeout(d,a,null)));try{const d=await _d(t,Promise.race(s));return Qe(t),d}finally{i()}};return(n,a)=>Cd(r(n,a))},Ed=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:i}=e;if(t)a=Ie(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(process.env.NODE_ENV==="production"?H(21):"Creating or removing a listener requires one of the known fields for matching an action");return ei(i,"options.listener"),{predicate:a,type:t,effect:i}},Pd=ct(e=>{const{type:t,predicate:r,effect:n}=Ed(e);return{id:tr(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(process.env.NODE_ENV==="production"?H(22):"Unsubscribe not initialized")}}},{withTypes:()=>Pd}),ao=(e,t)=>{const{type:r,effect:n,predicate:a}=Ed(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===a)&&i.effect===n)},ga=e=>{e.pending.forEach(t=>{t.abort(ya)})},Zu=(e,t)=>()=>{for(const r of t.keys())ga(r);e.clear()},io=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},ti=ct(Ie(`${nr}/add`),{withTypes:()=>ti}),Od=Ie(`${nr}/removeAll`),ri=ct(Ie(`${nr}/remove`),{withTypes:()=>ri}),Ju=(...e)=>{console.error(`${nr}/error`,...e)},Qu=(e={})=>{const t=new Map,r=new Map,n=h=>{const p=r.get(h)??0;r.set(h,p+1)},a=h=>{const p=r.get(h)??1;p===1?r.delete(h):r.set(h,p-1)},{extra:i,onError:s=Ju}=e;ei(s,"onError");const d=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),p=>{h.unsubscribe(),p?.cancelActive&&ga(h)}),l=h=>d(ao(t,h)??Pd(h));ct(l,{withTypes:()=>l});const c=h=>{const p=ao(t,h);return p&&(p.unsubscribe(),h.cancelActive&&ga(p)),!!p};ct(c,{withTypes:()=>c});const u=async(h,p,v,y)=>{const $=new AbortController,g=Xu(l,$.signal),C=[];try{h.pending.add($),n(h),await Promise.resolve(h.effect(p,ct({},v,{getOriginalState:y,condition:(x,N)=>g(x,N).then(Boolean),take:g,delay:wd($.signal),pause:Hr($.signal),extra:i,signal:$.signal,fork:Yu($.signal,C),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((x,N,b)=>{x!==$&&(x.abort(ya),b.delete(x))})},cancel:()=>{$.abort(ya),h.pending.delete($)},throwIfCancelled:()=>{Qe($.signal)}})))}catch(x){x instanceof rr||io(s,x,{raisedBy:"effect"})}finally{await Promise.all(C),$.abort(Hu),a(h),h.pending.delete($)}},f=Zu(t,r);return{middleware:h=>p=>v=>{if(!(0,Ne.isAction)(v))return p(v);if(ti.match(v))return l(v.payload);if(Od.match(v)){f();return}if(ri.match(v))return c(v.payload);let y=h.getState();const $=()=>{if(y===no)throw new Error(process.env.NODE_ENV==="production"?H(23):`${nr}: getOriginalState can only be called synchronously`);return y};let g;try{if(g=p(v),t.size>0){const C=h.getState(),x=Array.from(t.values());for(const N of x){let b=!1;try{b=N.predicate(v,C,y)}catch(T){b=!1,io(s,T,{raisedBy:"predicate"})}b&&u(N,v,h,$)}}}finally{y=no}return g},startListening:l,stopListening:c,clearListeners:f}},ef=e=>({middleware:e,applied:new Map}),tf=e=>t=>t?.meta?.instanceId===e,rf=()=>{const e=tr(),t=new Map,r=Object.assign(Ie("dynamicMiddleware/add",(...d)=>({payload:d,meta:{instanceId:e}})),{withTypes:()=>r}),n=Object.assign(function(...l){l.forEach(c=>{Je(t,c,ef)})},{withTypes:()=>n}),a=d=>(0,Ne.compose)(...Array.from(t.values()).map(l=>Je(l.applied,d,l.middleware))),i=qr(r,tf(e));return{middleware:d=>l=>c=>i(c)?(n(...c.payload),d.dispatch):a(d)(l)(c),addMiddleware:n,withMiddleware:r,instanceId:e}},nf=e=>"reducerPath"in e&&typeof e.reducerPath=="string",af=e=>e.flatMap(t=>nf(t)?[[t.reducerPath,t.reducer]]:Object.entries(t)),ni=Symbol.for("rtk-state-proxy-original"),of=e=>!!e&&!!e[ni],sf=new WeakMap,df=(e,t,r)=>Je(sf,e,()=>new Proxy(e,{get:(n,a,i)=>{if(a===ni)return n;const s=Reflect.get(n,a,i);if(typeof s>"u"){const d=r[a];if(typeof d<"u")return d;const l=t[a];if(l){const c=l(void 0,{type:tr()});if(typeof c>"u")throw new Error(process.env.NODE_ENV==="production"?H(24):`The slice reducer for key "${a.toString()}" returned undefined when called for selector(). If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);return r[a]=c,c}}return s}})),lf=e=>{if(!of(e))throw new Error(process.env.NODE_ENV==="production"?H(25):"original must be used on state Proxy");return e[ni]},cf={},uf=(e=cf)=>e;function ff(...e){const t=Object.fromEntries(af(e)),r=()=>Object.keys(t).length?(0,Ne.combineReducers)(t):uf;let n=r();function a(l,c){return n(l,c)}a.withLazyLoadedSlices=()=>a;const i={},s=(l,c={})=>{const{reducerPath:u,reducer:f}=l,m=t[u];return!c.overrideExisting&&m&&m!==f?(typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`inject\` to override already-existing reducer ${u} without specifying \`overrideExisting: true\``),a):(c.overrideExisting&&m!==f&&delete i[u],t[u]=f,n=r(),a)},d=Object.assign(function(c,u){return function(m,...h){return c(df(u?u(m,...h):m,t,i),...h)}},{original:lf});return Object.assign(a,{inject:s,selector:d})}function H(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function Cr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(r){return typeof r}:Cr=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Cr(e)}function Wn(){}var pf={getItem:Wn,setItem:Wn,removeItem:Wn};function hf(e){if((typeof self>"u"?"undefined":Cr(self))!=="object"||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch{return process.env.NODE_ENV!=="production"&&console.warn("redux-persist ".concat(e," test failed, persistence will be disabled.")),!1}return!0}function mf(e){var t="".concat(e,"Storage");return hf(t)?self[t]:(process.env.NODE_ENV!=="production"&&console.error("redux-persist failed to create sync storage. falling back to noop storage."),pf)}function vf(e){var t=mf(e);return{getItem:function(n){return new Promise(function(a,i){a(t.getItem(n))})},setItem:function(n,a){return new Promise(function(i,s){i(t.setItem(n,a))})},removeItem:function(n){return new Promise(function(a,i){a(t.removeItem(n))})}}}var lr=e=>e?["services","professionals","time","confirm","success"]:["professionals","services","time","confirm","success"],yf={currentStep:"services",completedSteps:["services"],isOrder:!0},jd=He({name:"breadcrumbs",initialState:yf,reducers:{setIsOrder:(e,t)=>{e.isOrder=t.payload},goToStep:(e,t)=>{const r=lr(e.isOrder),n=t.payload,a=r.indexOf(e.currentStep),i=r.indexOf(n);if(i<=a){e.currentStep=n;return}const s=r[i-1];e.completedSteps.includes(s)&&(e.currentStep=n)},completeStep:(e,t)=>{const r=t.payload;e.completedSteps.includes(r)||e.completedSteps.push(r)},nextStep:e=>{const t=lr(e.isOrder),r=t[t.indexOf(e.currentStep)+1];r&&(e.completedSteps.includes(e.currentStep)||e.completedSteps.push(e.currentStep),e.currentStep=r)},prevStep:e=>{const t=lr(e.isOrder),r=t[t.indexOf(e.currentStep)-1];r&&(e.currentStep=r)},clearSteps:e=>{e.currentStep="services",e.completedSteps=["services"]},resetCompletedStepsFrom:(e,t)=>{const r=t.payload,n=lr(e.isOrder),a=n.indexOf(r);e.completedSteps=e.completedSteps.filter(i=>n.indexOf(i)<=a)}}}),{setIsOrder:gf,goToStep:$a,completeStep:ng,nextStep:Ce,prevStep:ag,clearSteps:ig,resetCompletedStepsFrom:oo}=jd.actions,$f=jd.reducer,so={id:"",outletName:"",timeZone:"",image:"",tenantId:"",address:"",isOpen:!1,outletTimeZoneDate:"",outletTimeZoneYear:"",createdAt:"",isService:!0,currency:"",token:""},Td=He({name:"outletDetails",initialState:so,reducers:{clearBooking:()=>so,setOutletData:(e,t)=>({...e,...t.payload}),setOutletToken:(e,t)=>{e.token=t.payload}}}),{clearBooking:bf,setOutletData:Nf,setOutletToken:Sf}=Td.actions,Cf=Td.reducer,Ad=He({name:"service",initialState:{superCategories:[],staff:[],selectedCategory:null,selectedServices:[],selectedProfessional:null},reducers:{setServicePayload:(e,t)=>{e.superCategories=t.payload.superCategories,e.staff=t.payload.staff},setCategory:(e,t)=>{e.selectedCategory=t.payload},toggleService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload.id);r?r.qty<5&&(r.qty+=1):e.selectedServices.push({...t.payload,qty:1})},incrementService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload);r&&r.qty<5&&(r.qty+=1)},decrementService:(e,t)=>{const r=e.selectedServices.find(n=>n.id===t.payload);r&&(r.qty===1?e.selectedServices=e.selectedServices.filter(n=>n.id!==t.payload):r.qty-=1)},toggleProfessional:(e,t)=>{e.selectedProfessional=t.payload},clearSelectedServices:e=>{e.selectedServices=[]},clearSelectedProfessional:e=>{e.selectedProfessional=null}}}),{setServicePayload:xf,setCategory:og,toggleService:Kr,clearSelectedServices:lo,clearSelectedProfessional:co,incrementService:Id,decrementService:Yr,toggleProfessional:ai}=Ad.actions,_f=Ad.reducer,qe="https://prod.aaravpos.com/api/v1",Ke=()=>({"Content-Type":"application/json",Authorization:`Bearer ${Sn.getState()?.booking.outletDetails?.token}`}),uo=async(e,t,r)=>{const n=new URLSearchParams({available_online:"true",is_available_online_category:"true"});t&&n.append("tenantId",t),r&&n.append("outletId",r);const a=`${qe}/integration/service/code/${e}?${n}`,i=await fetch(a,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Failed to fetch services");return await i.json()},wf=async(e,t,r)=>{const n=await fetch(`${qe}/integration/slot/tenant/${e}/staff/${t}/online?date=${r}`,{method:"GET",headers:Ke()});if(!n.ok)throw new Error("Failed to fetch services");return await n.json()},Ef=async e=>{const t=await fetch(`${qe}/integration/appointment/create`,{method:"POST",headers:Ke(),body:JSON.stringify(e)});if(!t.ok)throw new Error("Failed to fetch services");return await t.json()},Pf=async(e,t)=>{const r=await fetch(`${qe}/integration/appointment/details?tenantId=${t}&appointmentId=${e}`,{method:"GET",headers:Ke()});if(!r.ok)throw new Error("Failed to fetch appointment details");return await r.json()},Of=async({search:e,tenantId:t})=>{const r=await fetch(`${qe}/integration/customer/drop-down/list?tenantId=${t}&search=${encodeURIComponent(e||"")}`,{method:"GET",headers:Ke()});if(!r.ok)throw new Error("Failed to fetch customers");return await r.json()},jf=async e=>{try{const t=await fetch(`${qe}/payment/pay/customer/direct`,{method:"POST",headers:Ke(),body:JSON.stringify(e)}),r=await t.json();if(!t.ok)throw r;return r}catch(t){throw t}},Tf=async e=>{try{const t=await fetch(`${qe}/payment/orders/${e}/invoicing/finalize`,{method:"POST",headers:Ke()}),r=await t.json();if(!t.ok)throw r;return r}catch(t){throw t}},fo=e=>{const t=e?.consent_rule?.frequency??e?.consentFrequency??e?.frequency??"EVERY_VISIT";return t==="EVERY_X_DAYS"||t==="ONCE_PER_CUSTOMER"||t==="EVERY_VISIT"?t:"EVERY_VISIT"},ii=e=>{const t=!!(e?.requires_consent??e?.requiresConsent),r=String(e?.consent_form_id??e?.consentFormId??"").trim();return t&&!!r},po=e=>{const t=e?.consent_rule?.channelRules||e?.consent_rule?.channel_rules||[],r=(Array.isArray(t)?t.find(n=>String(n?.channel||"").toUpperCase()==="ONLINE_BOOKING"):null)?.method||e?.enforcement?.ONLINE_BOOKING||e?.enforcement?.online_booking;return r==="DRAW_SIGNATURE"||r==="TYPED_NAME"||r==="CHECKBOX_ONLY"?r:null},ho=async(e,t,r)=>{const n=await fetch(`${qe}/concent/check/${e}/${t}?serviceId=${r}`,{method:"GET",headers:Ke()});if(!n.ok)throw new Error("Failed to check consent requirement");return n.json()},Af=async e=>{const{tenantId:t,outletId:r,appointmentId:n,customerId:a,serviceId:i,formId:s,staffId:d,signatureType:l,isChecked:c,typedName:u,imageUrl:f}=e,m={tenantId:t,appointmentId:n,customerId:a,serviceIds:[i],outletId:r,concentFormId:s,signatureType:l,channel:"Online_Web",staffId:d};l==="CHECKBOX_ONLY"&&(m.isChecked=c??!0),u&&(m.typedName=u),f&&(m.imageUrl=f);const h=await fetch(`${qe}/concent/customer-sign`,{method:"POST",headers:Ke(),body:JSON.stringify(m)}),p=await h.json();if(!h.ok)throw p;return p},xr=Nn("slots/getStaffSlots",async({tenantId:e,staffId:t,date:r})=>await wf(e,t,r)),kd=He({name:"slots",initialState:{selectedSlotIndexes:[],selectedSlotIds:[],selectedDate:null,selectedTime:null,slots:{morning:[],afternoon:[],evening:[]},loading:!1},reducers:{setSelectedSlots:(e,t)=>{e.selectedSlotIndexes=t.payload.indexes,e.selectedSlotIds=t.payload.ids},setSelectedDate:(e,t)=>{e.selectedDate=t.payload},setSelectedTime:(e,t)=>{e.selectedTime=t.payload},clearSlots:e=>{e.slots={morning:[],afternoon:[],evening:[]},e.selectedSlotIndexes=[],e.selectedSlotIds=[],e.selectedDate=null,e.selectedTime=null}},extraReducers:e=>{e.addCase(xr.pending,t=>{t.loading=!0}).addCase(xr.fulfilled,(t,r)=>{t.loading=!1,t.slots=r.payload?.data?.groups||{morning:[],afternoon:[],evening:[]}}).addCase(xr.rejected,t=>{t.loading=!1})}}),{setSelectedSlots:cr,clearSlots:ut,setSelectedDate:ft,setSelectedTime:ur}=kd.actions,If=kd.reducer,Rd=He({name:"theme",initialState:{button:{bg:"#d7263d",text:"#ffffff",bgHover:"#1f2937",textHover:"#ffffff"},colors:{bg:"#fafaf8",link:"#385b5a",text:"#e09898",bgHover:"#4c6f6e",textHover:"#ffffff"},isOpenSidebar:!1},reducers:{setTheme:(e,t)=>{e.button=t.payload?.button,e.colors=t.payload?.colors},setSidebarOpen:(e,t)=>{e.isOpenSidebar=t.payload}}}),{setTheme:kf,setSidebarOpen:ke}=Rd.actions,Rf=Rd.reducer,_r=Nn("appointment/create",async(e,{rejectWithValue:t})=>{try{return await Ef(e)}catch(r){return t(r?.message||r?.error||r?.data?.message||r?.response?.data?.message||"Failed to create appointment")}}),mo={loading:!1,success:!1,error:null,data:null,appointmentId:null,customerId:null,userDetails:null,tipPct:0,bookingMode:"booking",payType:""},Dd=He({name:"appointment",initialState:mo,reducers:{resetAppointment:()=>mo,setBookingMode:(e,t)=>{e.bookingMode=t.payload},setUserDetails:(e,t)=>{e.userDetails=t.payload},setPayType:(e,t)=>{e.payType=t.payload},setTips:(e,t)=>{e.tipPct=t.payload},setAppointmentId:(e,t)=>{e.appointmentId=t.payload},clearUserDetails:e=>{e.userDetails=null}},extraReducers:e=>{e.addCase(_r.pending,t=>{t.loading=!0,t.error=null}).addCase(_r.fulfilled,(t,r)=>{t.loading=!1,t.success=!0,t.data=r.payload;const n=r.payload;t.appointmentId=n?.id||null,t.customerId=n?.customerId||n?.customer?.id||null}).addCase(_r.rejected,(t,r)=>{t.loading=!1,t.error=r.payload||"Appointment failed"})}}),{resetAppointment:pt,setBookingMode:sg,setUserDetails:Gn,setTips:Df,setAppointmentId:fr,clearUserDetails:Mf,setPayType:dg}=Dd.actions,Ff=Dd.reducer,Md=He({name:"outletList",initialState:{outlets:[]},reducers:{setOutletList:(e,t)=>{e.outlets=t.payload},clearOutletList:e=>{e.outlets=[]}}}),{setOutletList:Lf,clearOutletList:lg}=Md.actions,Bf=Md.reducer,Uf=(0,va.combineReducers)({booking:(0,va.combineReducers)({breadcrumbs:$f,outletDetails:Cf,service:_f,slots:If,appointment:Ff,outletList:Bf,theme:Rf})}),Vf=(e,t)=>(t.type==="RESET_ALL"&&(e=void 0),Uf(e,t)),zf=()=>({getItem(){return Promise.resolve(null)},setItem(e,t){return Promise.resolve(t)},removeItem(){return Promise.resolve()}}),qf=(0,We.persistReducer)({key:"booking",storage:typeof window<"u"?vf("session"):zf()},Vf),Sn=od({reducer:qf,devTools:process.env.NODE_ENV!=="production",middleware:e=>e({serializableCheck:{ignoredActions:[We.FLUSH,We.REHYDRATE,We.PAUSE,We.PERSIST,We.PURGE,We.REGISTER]}})}),oi=(0,We.persistStore)(Sn),cg=Sn.getState,Me=Object.create(null);Me.open="0";Me.close="1";Me.ping="2";Me.pong="3";Me.message="4";Me.upgrade="5";Me.noop="6";var wr=Object.create(null);Object.keys(Me).forEach(e=>{wr[Me[e]]=e});var ba={type:"error",data:"parser error"},Fd=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ld=typeof ArrayBuffer=="function",Bd=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,si=({type:e,data:t},r,n)=>Fd&&t instanceof Blob?r?n(t):vo(t,n):Ld&&(t instanceof ArrayBuffer||Bd(t))?r?n(t):vo(new Blob([t]),n):n(Me[e]+(t||"")),vo=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function yo(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Hn;function Wf(e,t){if(Fd&&e.data instanceof Blob)return e.data.arrayBuffer().then(yo).then(t);if(Ld&&(e.data instanceof ArrayBuffer||Bd(e.data)))return t(yo(e.data));si(e,!1,r=>{Hn||(Hn=new TextEncoder),t(Hn.encode(r))})}var Gf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",It=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<64;e++)It[Gf.charCodeAt(e)]=e;var Hf=e=>{let t=e.length*.75,r=e.length,n,a=0,i,s,d,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)i=It[e.charCodeAt(n)],s=It[e.charCodeAt(n+1)],d=It[e.charCodeAt(n+2)],l=It[e.charCodeAt(n+3)],u[a++]=i<<2|s>>4,u[a++]=(s&15)<<4|d>>2,u[a++]=(d&3)<<6|l&63;return c},Kf=typeof ArrayBuffer=="function",di=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ud(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Yf(e.substring(1),t)}:wr[r]?e.length>1?{type:wr[r],data:e.substring(1)}:{type:wr[r]}:ba},Yf=(e,t)=>Kf?Ud(Hf(e),t):{base64:!0,data:e},Ud=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,Vd="",Xf=(e,t)=>{const r=e.length,n=new Array(r);let a=0;e.forEach((i,s)=>{si(i,!1,d=>{n[s]=d,++a===r&&t(n.join(Vd))})})},Zf=(e,t)=>{const r=e.split(Vd),n=[];for(let a=0;a<r.length;a++){const i=di(r[a],t);if(n.push(i),i.type==="error")break}return n};function Jf(){return new TransformStream({transform(e,t){Wf(e,r=>{const n=r.length;let a;if(n<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,n);else if(n<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(r)})}})}var Kn;function pr(e){return e.reduce((t,r)=>t+r.length,0)}function hr(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let a=0;a<t;a++)r[a]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function Qf(e,t){Kn||(Kn=new TextDecoder);const r=[];let n=0,a=-1,i=!1;return new TransformStream({transform(s,d){for(r.push(s);;){if(n===0){if(pr(r)<1)break;const l=hr(r,1);i=(l[0]&128)===128,a=l[0]&127,a<126?n=3:a===126?n=1:n=2}else if(n===1){if(pr(r)<2)break;const l=hr(r,2);a=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(pr(r)<8)break;const l=hr(r,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){d.enqueue(ba);break}a=u*Math.pow(2,32)+c.getUint32(4),n=3}else{if(pr(r)<a)break;const l=hr(r,a);d.enqueue(di(i?l:Kn.decode(l),t)),n=0}if(a===0||a>e){d.enqueue(ba);break}}}})}function se(e){if(e)return e0(e)}function e0(e){for(var t in se.prototype)e[t]=se.prototype[t];return e}se.prototype.on=se.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};se.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};se.prototype.off=se.prototype.removeListener=se.prototype.removeAllListeners=se.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,a=0;a<r.length;a++)if(n=r[a],n===t||n.fn===t){r.splice(a,1);break}return r.length===0&&delete this._callbacks["$"+e],this};se.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,a=r.length;n<a;++n)r[n].apply(this,t)}return this};se.prototype.emitReserved=se.prototype.emit;se.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};se.prototype.hasListeners=function(e){return!!this.listeners(e).length};var Cn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Pe=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),t0="arraybuffer";function zd(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}var r0=Pe.setTimeout,n0=Pe.clearTimeout;function xn(e,t){t.useNativeTimers?(e.setTimeoutFn=r0.bind(Pe),e.clearTimeoutFn=n0.bind(Pe)):(e.setTimeoutFn=Pe.setTimeout.bind(Pe),e.clearTimeoutFn=Pe.clearTimeout.bind(Pe))}var a0=1.33;function i0(e){return typeof e=="string"?o0(e):Math.ceil((e.byteLength||e.size)*a0)}function o0(e){let t=0,r=0;for(let n=0,a=e.length;n<a;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}function qd(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function s0(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function d0(e){let t={},r=e.split("&");for(let n=0,a=r.length;n<a;n++){let i=r[n].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}var l0=class extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}},li=class extends se{constructor(e){super(),this.writable=!1,xn(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new l0(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=di(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=s0(e);return t.length?"?"+t:""}},c0=class extends li{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Zf(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Xf(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=qd()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},Wd=!1;try{Wd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var u0=Wd;function f0(){}var p0=class extends c0{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let r=location.port;r||(r=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(n,a)=>{this.onError("xhr post error",n,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}},ht=class Er extends se{constructor(t,r,n){super(),this.createRequest=t,xn(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=zd(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&n.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var a;n.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Er.requestsCount++,Er.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=f0,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Er.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ht.requestsCount=0;ht.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",go);else if(typeof addEventListener=="function"){const e="onpagehide"in Pe?"pagehide":"unload";addEventListener(e,go,!1)}}function go(){for(let e in ht.requests)ht.requests.hasOwnProperty(e)&&ht.requests[e].abort()}var h0=(function(){const e=Gd({xdomain:!1});return e&&e.responseType!==null})(),m0=class extends p0{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=h0&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ht(Gd,this.uri(),e)}};function Gd(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||u0))return new XMLHttpRequest}catch{}if(!t)try{return new Pe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Hd=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",v0=class extends li{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,r=Hd?{}:zd(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;si(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}n&&Cn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=qd()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Yn=Pe.WebSocket||Pe.MozWebSocket,y0=class extends v0{createSocket(e,t,r){return Hd?new Yn(e,t,r):t?new Yn(e,t):new Yn(e)}doWrite(e,t){this.ws.send(t)}},g0=class extends li{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Qf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),n=Jf();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const a=()=>{r.read().then(({done:s,value:d})=>{s||(this.onPacket(d),a())}).catch(s=>{})};a();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&Cn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}},$0={websocket:y0,webtransport:g0,polling:m0},b0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,N0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Na(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let a=b0.exec(e||""),i={},s=14;for(;s--;)i[N0[s]]=a[s]||"";return r!=-1&&n!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=S0(i,i.path),i.queryKey=C0(i,i.query),i}function S0(e,t){const r=t.replace(/\/{2,9}/g,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function C0(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,a,i){a&&(r[a]=i)}),r}var Sa=typeof addEventListener=="function"&&typeof removeEventListener=="function",Pr=[];Sa&&addEventListener("offline",()=>{Pr.forEach(e=>e())},!1);var Or=class jr extends se{constructor(t,r){if(super(),this.binaryType=t0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=Na(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Na(r.host).host);xn(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const a=n.prototype.name;this.transports.push(a),this._transportsByName[a]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=d0(this.opts.query)),Sa&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Pr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=4,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&jr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",jr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const n=this.writeBuffer[r].data;if(n&&(t+=i0(n)),r>0&&t>this._maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Cn(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,a){if(typeof r=="function"&&(a=r,r=void 0),typeof n=="function"&&(a=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const i={type:t,data:r,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(jr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Sa&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Pr.indexOf(this._offlineEventListener);n!==-1&&Pr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}};Or.protocol=4;var x0=class extends Or{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;Or.priorWebsocketSuccess=!1;const n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Or.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=t.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),t.close(),t=null)}const i=u=>{const f=new Error("probe error: "+u);f.transport=t.name,a(),this.emitReserved("upgradeError",f)};function s(){i("transport closed")}function d(){i("socket closed")}function l(u){t&&u.name!==t.name&&a()}const c=()=>{t.removeListener("open",n),t.removeListener("error",i),t.removeListener("close",s),this.off("close",d),this.off("upgrading",l)};t.once("open",n),t.once("error",i),t.once("close",s),this.once("close",d),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}},Kd=class extends x0{constructor(e,t={}){const r=typeof e=="object",n=r?{...e}:{...t};(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(a=>$0[a]).filter(a=>!!a)),super(r?n:e,n)}},ug=Kd.protocol;function _0(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=Na(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(r&&r.port===n.port?"":":"+n.port),n}var w0=typeof ArrayBuffer=="function",E0=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Yd=Object.prototype.toString,P0=typeof Blob=="function"||typeof Blob<"u"&&Yd.call(Blob)==="[object BlobConstructor]",O0=typeof File=="function"||typeof File<"u"&&Yd.call(File)==="[object FileConstructor]";function ci(e){return w0&&(e instanceof ArrayBuffer||E0(e))||P0&&e instanceof Blob||O0&&e instanceof File}function Tr(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(Tr(e[r]))return!0;return!1}if(ci(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Tr(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&Tr(e[r]))return!0;return!1}function j0(e){const t=[],r=e.data,n=e;return n.data=Ca(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Ca(e,t){if(!e)return e;if(ci(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ca(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Ca(e[n],t));return r}return e}function T0(e,t){return e.data=xa(e.data,t),delete e.attachments,e}function xa(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=xa(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=xa(e[r],t));return e}var A0=Is({Decoder:()=>k0,Encoder:()=>I0,PacketType:()=>q,isPacketValid:()=>L0,protocol:()=>5}),Xd=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var q;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(q||(q={}));var I0=class{constructor(e){this.replacer=e}encode(e){return(e.type===q.EVENT||e.type===q.ACK)&&Tr(e)?this.encodeAsBinary({type:e.type===q.EVENT?q.BINARY_EVENT:q.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===q.BINARY_EVENT||e.type===q.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=j0(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}},k0=class Zd extends se{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===q.BINARY_EVENT;n||r.type===q.BINARY_ACK?(r.type=n?q.EVENT:q.ACK,this.reconstructor=new R0(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(ci(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(q[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===q.BINARY_EVENT||n.type===q.BINARY_ACK){const i=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const s=t.substring(i,r);if(s!=Number(s)||t.charAt(r)!=="-")throw new Error("Illegal attachments");const d=Number(s);if(!Jd(d)||d<0)throw new Error("Illegal attachments");if(d>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=d}if(t.charAt(r+1)==="/"){const i=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(i,r)}else n.nsp="/";const a=t.charAt(r+1);if(a!==""&&Number(a)==a){const i=r+1;for(;++r;){const s=t.charAt(r);if(s==null||Number(s)!=s){--r;break}if(r===t.length)break}n.id=Number(t.substring(i,r+1))}if(t.charAt(++r)){const i=this.tryParse(t.substr(r));if(Zd.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case q.CONNECT:return Xr(r);case q.DISCONNECT:return r===void 0;case q.CONNECT_ERROR:return typeof r=="string"||Xr(r);case q.EVENT:case q.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Xd.indexOf(r[0])===-1);case q.ACK:case q.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},R0=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=T0(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function D0(e){return typeof e=="string"}var Jd=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function M0(e){return e===void 0||Jd(e)}function Xr(e){return Object.prototype.toString.call(e)==="[object Object]"}function F0(e,t){switch(e){case q.CONNECT:return t===void 0||Xr(t);case q.DISCONNECT:return t===void 0;case q.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Xd.indexOf(t[0])===-1);case q.ACK:return Array.isArray(t);case q.CONNECT_ERROR:return typeof t=="string"||Xr(t);default:return!1}}function L0(e){return D0(e.nsp)&&M0(e.id)&&F0(e.type,e.data)}function Ae(e,t,r){return e.on(t,r),function(){e.off(t,r)}}var B0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Qd=class extends se{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ae(e,"open",this.onopen.bind(this)),Ae(e,"packet",this.onpacket.bind(this)),Ae(e,"error",this.onerror.bind(this)),Ae(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,a;if(B0.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:q.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const l=this.ids++,c=t.pop();this._registerAckCallback(l,c),i.id=l}const s=(n=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||n===void 0?void 0:n.writable,d=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(d?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var r;const n=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);t.call(this,new Error("operation has timed out"))},n),i=(...s)=>{this.io.clearTimeoutFn(a),t.apply(this,s)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((r,n)=>{const a=(i,s)=>i?n(i):r(s);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...a)=>(this._queue[0],n!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:q.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case q.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case q.EVENT:case q.BINARY_EVENT:this.onevent(e);break;case q.ACK:case q.BINARY_ACK:this.onack(e);break;case q.DISCONNECT:this.ondisconnect();break;case q.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,t.packet({type:q.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:q.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}};function xt(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}xt.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};xt.prototype.reset=function(){this.attempts=0};xt.prototype.setMin=function(e){this.ms=e};xt.prototype.setMax=function(e){this.max=e};xt.prototype.setJitter=function(e){this.jitter=e};var _a=class extends se{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,xn(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new xt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||A0;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Kd(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=Ae(t,"open",function(){r.onopen(),e&&e()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),e?e(s):this.maybeReconnectOnOpen()},i=Ae(t,"error",a);if(this._timeout!==!1){const s=this._timeout,d=this.setTimeoutFn(()=>{n(),a(new Error("timeout")),t.close()},s);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ae(e,"ping",this.onping.bind(this)),Ae(e,"data",this.ondata.bind(this)),Ae(e,"error",this.onerror.bind(this)),Ae(e,"close",this.onclose.bind(this)),Ae(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Cn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Qd(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}},Tt={};function Ar(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=_0(e,t.path||"/socket.io"),n=r.source,a=r.id,i=r.path,s=Tt[a]&&i in Tt[a].nsps,d=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return d?l=new _a(n,t):(Tt[a]||(Tt[a]=new _a(n,t)),l=Tt[a]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}Object.assign(Ar,{Manager:_a,Socket:Qd,io:Ar,connect:Ar});var U0="https://prod.aaravpos.com",el=(0,S.createContext)(void 0),V0=({children:e})=>{const{selectedProfessional:t}=(0,M.useSelector)(a=>a.booking.service),[r]=(0,S.useState)(()=>Ar(U0,{path:"/socket.io",transports:["websocket"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:3e3})),n=a=>{r.connected||r.connect(),r.off("connect"),r.on("connect",()=>{r.emit("joinStaff",a)})};return(0,S.useEffect)(()=>{t?.id&&n({staffId:t.id,roomId:t.id,room:t.id,id:t.id})},[t?.id]),(0,o.jsx)(el.Provider,{value:{socket:r,connectSocket:n},children:e})},z0=()=>{const e=(0,S.useContext)(el);if(!e)throw new Error("useSocket must be used within SocketProvider");return e};function q0({children:e}){return(0,o.jsx)(M.Provider,{store:Sn,children:(0,o.jsx)(ks,{loading:null,persistor:oi,children:(0,o.jsx)(V0,{children:e})})})}var W0=e=>{if(!e)return;const t=document.documentElement;e?.button?.bg&&t.style.setProperty("--btn-bg",e.button.bg),e.button?.text&&t.style.setProperty("--btn-text",e.button.text),e.button?.bgHover&&t.style.setProperty("--btn-bg-hover",e.button.bgHover),e.button?.textHover&&t.style.setProperty("--btn-text-hover",e.button.textHover),e.colors?.bg&&t.style.setProperty("--app-bg",e.colors.bg),e.colors?.link&&t.style.setProperty("--app-link",e.colors.link),e.colors?.text&&t.style.setProperty("--app-text",e.colors.text),e.colors?.bgHover&&t.style.setProperty("--app-bg-hover",e.colors.bgHover),e.colors?.textHover&&t.style.setProperty("--app-text-hover",e.colors.textHover)},tl=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),G0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),$o=e=>{const t=H0(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},K0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Y0=(0,S.createContext)({}),X0=()=>(0,S.useContext)(Y0),Z0=(0,S.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...d},l)=>{const{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:m="currentColor",className:h=""}=X0()??{},p=n??f?Number(r??u)*24/Number(t??c):r??u;return(0,S.createElement)("svg",{ref:l,...Xn,width:t??c??Xn.width,height:t??c??Xn.height,stroke:e??m,strokeWidth:p,className:tl("lucide",h,a),...!i&&!K0(d)&&{"aria-hidden":"true"},...d},[...s.map(([v,y])=>(0,S.createElement)(v,y)),...Array.isArray(i)?i:[i]])}),Z=(e,t)=>{const r=(0,S.forwardRef)(({className:n,...a},i)=>(0,S.createElement)(Z0,{ref:i,iconNode:t,className:tl(`lucide-${G0($o(e))}`,`lucide-${e}`,n),...a}));return r.displayName=$o(e),r},J0=[["path",{d:"M11 14h1v4",key:"fy54vd"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],Q0=Z("calendar-1",J0),ep=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],tp=Z("calendar-days",ep),rp=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ui=Z("check",rp),np=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fi=Z("chevron-down",np),ap=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Zr=Z("chevron-left",ap),ip=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_t=Z("chevron-right",ip),op=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wa=Z("circle-check",op),sp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],gt=Z("clock-3",sp),dp=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],rl=Z("dollar-sign",dp),lp=[["path",{d:"M4 10h12",key:"1y6xl8"}],["path",{d:"M4 14h9",key:"1loblj"}],["path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",key:"1j6lzo"}]],cp=Z("euro",lp),up=[["path",{d:"M6 3h12",key:"ggurg9"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"m6 13 8.5 8",key:"u1kupk"}],["path",{d:"M6 13h3",key:"wdp6ag"}],["path",{d:"M9 13c6.667 0 6.667-10 0-10",key:"1nkvk2"}]],fp=Z("indian-rupee",up),pp=[["path",{d:"M5 12h14",key:"1ays0h"}]],nl=Z("minus",pp),hp=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],mp=Z("moon",hp),vp=[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]],bo=Z("move-left",vp),yp=[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]],gp=Z("move-right",yp),$p=[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]],Jr=Z("package-2",$p),bp=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pi=Z("plus",bp),Np=[["path",{d:"M18 7c0-5.333-8-5.333-8 0",key:"1prm2n"}],["path",{d:"M10 7v14",key:"18tmcs"}],["path",{d:"M6 21h12",key:"4dkmi1"}],["path",{d:"M6 13h10",key:"ybwr4a"}]],Sp=Z("pound-sterling",Np),Cp=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],xp=Z("rotate-cw",Cp),_p=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],al=Z("scissors",_p),wp=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hi=Z("search",wp),Ep=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],Pp=Z("shopping-cart",Ep),Op=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],jp=Z("store",Op),Tp=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ap=Z("sun",Tp),Ip=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],kp=Z("sunrise",Ip),Rp=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],il=Z("user",Rp),Dp=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ye=Z("x",Dp),Mp=({status:e})=>(0,o.jsx)("span",{className:`aaravpos-status-badge ${e?"aaravpos-status-open":"aaravpos-status-closed"}`,children:e?"Open":"Closed"}),Fp=({item:e,onSelect:t,selected:r})=>(0,o.jsxs)("div",{className:`aaravpos-outlet-card
16
16
  ${r?"selected":""}
17
17
  ${e.isOpen?"":"closed"}
18
- `,onClick:()=>t(String(e?.id)),children:[(0,o.jsx)("div",{className:"aaravpos-outlet-card-top",children:(0,o.jsx)(Dp,{status:e.isOpen})}),(0,o.jsx)("div",{className:"aaravpos-outlet-card-content",children:(0,o.jsxs)("div",{className:"aaravpos-outlet-card-inner",children:[(0,o.jsx)("h2",{className:"aaravpos-outlet-card-title",children:e.outletName}),(0,o.jsx)("p",{className:"aaravpos-outlet-card-address",children:e.address})]})})]});function Fp({outlets:e,onSelectOutlet:t}){const[r,n]=(0,S.useState)(null),[a,i]=(0,S.useState)(""),s=l=>{n(l);const c=e.find(u=>u.id==l);c&&setTimeout(()=>{t(c)},100)},d=(0,S.useMemo)(()=>{if(!a.trim())return e;const l=a.toLowerCase();return e.filter(c=>c.outletName?.toLowerCase().includes(l)||c.address?.toLowerCase().includes(l))},[e,a]);return(0,o.jsxs)("div",{className:"aaravpos-container",children:[(0,o.jsxs)("div",{className:"aaravpos-header",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-title",children:"Choose Your Outlet"}),(0,o.jsx)("div",{className:"aaravpos-outlet-divider"})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(pi,{size:14})}),(0,o.jsx)("input",{type:"text",placeholder:"Search outlet...",value:a,onChange:l=>i(l.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:a&&(0,o.jsx)("button",{onClick:()=>i(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{className:"aaravpos-outlet-list-wrapper",children:d.length>0?(0,o.jsx)("div",{className:"aaravpos-outlet-grid",children:d.map((l,c)=>(0,o.jsx)("div",{children:(0,o.jsx)(Mp,{item:l,onSelect:s,selected:r===l.id})},c))}):(0,o.jsx)("div",{className:"aaravpos-empty-state",children:(0,o.jsxs)("div",{className:"aaravpos-empty-content",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-title",children:"No outlets found"}),(0,o.jsx)("p",{className:"aaravpos-empty-text",children:"Try searching with a different keyword"})]})})})]})}var Lp={USD:tl,INR:up,EUR:lp,GBP:Np},re=({size:e=20})=>{const t=(0,M.useSelector)(r=>r.booking.outletDetails?.currency);return(0,o.jsx)(t?Lp[t]:tl,{size:e})},nt=(e="")=>{const t=e.trim().split(" ").filter(Boolean);return t.length===0?"":((t[0]?.[0]??"")+(t.length>1?t[t.length-1]?.[0]??"":"")).toUpperCase()},Bp=e=>Number(e.price||e.min_price||0),bo=(e,{perUnit:t=!1}={})=>{const r=Bp(e),n=t?1:e.qty||1;return!e.taxRows||!e.taxRows.length?0:e.taxRows.reduce((a,i)=>i.isActive?i.taxType==="FIXED"?a+(i.taxRate||0)*n:i.taxType==="PERCENTAGE"?a+r*n*(i.taxRate||0)/100:a:a,0)};function Up(){const[e,t]=(0,S.useState)({width:0,height:0});return(0,S.useEffect)(()=>{const r=()=>{t({width:window.innerWidth,height:window.innerHeight})};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),e}var Vp={services:[lo,ut,pt],professionals:[lo,ut,pt],time:[ut,pt],confirm:[]},zp={professionals:[ut,so,pt],services:[so,ut,pt],time:[ut,pt],confirm:[]},qp=[{label:"Services",page:"services",icon:(0,o.jsx)(nl,{size:16})},{label:"Professional",page:"professionals",icon:(0,o.jsx)(al,{size:16})},{label:"Time Slot",page:"time",icon:(0,o.jsx)(gt,{size:16})},{label:"Confirmation",page:"confirm",icon:(0,o.jsx)(_a,{size:16})}],Wp=[{label:"Professional",page:"professionals",icon:(0,o.jsx)(al,{size:16})},{label:"Service",page:"services",icon:(0,o.jsx)(nl,{size:16})},{label:"Time",page:"time",icon:(0,o.jsx)(gt,{size:16})},{label:(0,o.jsxs)("span",{className:"flex items-center gap-1",children:["Done ",(0,o.jsx)(_a,{size:13})]}),page:"confirm",icon:(0,o.jsx)(_a,{size:16})}];function wt(){const e=(0,M.useDispatch)(),{width:t}=Up(),{isOpenSidebar:r}=(0,M.useSelector)(x=>x.booking.theme),{isService:n}=(0,M.useSelector)(x=>x.booking.outletDetails),{selectedServices:a}=(0,M.useSelector)(x=>x.booking.service),i=(0,M.useSelector)(x=>x.booking.outletList.outlets),{currentStep:s,completedSteps:d}=(0,M.useSelector)(x=>x.booking.breadcrumbs),l=n?Vp:zp,c=n?qp:Wp,u=c.findIndex(x=>x.page===s),f=()=>{ii.purge(),e({type:"RESET_ALL"})},m=()=>{if(u===0&&i.length>1){f(),e($f());return}if(u<=0)return;const x=c[u-1].page;l[x]?.forEach(C=>{e(C())}),e(io(x)),e(ga(x))},h=m,p=m,v=c[u],y=t<991,$=a?.reduce((x,C)=>x+C.qty,0),g=Array.isArray(i)&&i.length>1;return(0,o.jsx)(o.Fragment,{children:y?(0,o.jsxs)("div",{className:"aaravpos-mobile-stepper",children:[(0,o.jsx)("button",{onClick:h,className:"aaravpos-mobile-back-btn",children:(0,o.jsx)(Zr,{size:22})}),(0,o.jsx)("span",{className:"aaravpos-mobile-step-label",children:v?.label})]}):(0,o.jsxs)("div",{className:"aaravpos-desktop-stepper",children:[(0,o.jsx)("button",{onClick:g?p:h,className:"aaravpos-desktop-back-btn",children:(0,o.jsx)(Zr,{size:20})}),(0,o.jsx)("nav",{className:"aaravpos-step-nav",children:c.map((x,C)=>{const N=s===x.page,b=d?.includes(x.page)||C<=u;return(0,o.jsxs)("button",{onClick:()=>{if(!b)return;const T=x.page;c.findIndex(R=>R.page===T)<u&&(l[T]?.forEach(R=>{e(R())}),e(io(T))),e(ga(T))},className:`aaravpos-step-btn ${b?"clickable":"disabled"} ${N?"active":"inactive"}`,children:[(0,o.jsx)("span",{className:`aaravpos-step-icon ${N?"active":"inactive"}`,children:x.icon}),(0,o.jsx)("span",{children:x.label})]},x.page)})}),!r&&(0,o.jsxs)("button",{className:"aaravpos-cart-btn",onClick:()=>e(Ie(!0)),children:[(0,o.jsx)("span",{className:"aaravpos-count",children:$}),(0,o.jsx)(Ep,{size:18})]})]})})}function Et({children:e,sidebar:t,renderButton:r}){const{isOpenSidebar:n}=(0,M.useSelector)(a=>a.booking.theme);return(0,o.jsxs)("div",{className:"aaravpos-main-layout",children:[(0,o.jsxs)("div",{className:n?"aaravpos-layout-wrapper":"",children:[(0,o.jsxs)("main",{className:"aaravpos-main-content",children:[e,r]}),(0,o.jsx)("aside",{className:`aaravpos-sidebar ${n?"open":""}`,children:t})]}),n&&(0,o.jsx)("div",{className:"aaravpos-sidebar-mobile",children:(0,o.jsx)("div",{className:"aaravpos-sidebar-mobile-content",children:t})})]})}var il=({pro:e,selectedStaffServices:t=[],totalPrice:r=0,totalDuration:n=0,goToStep:a})=>{const i=(0,M.useDispatch)(),{outletName:s,isService:d}=(0,M.useSelector)(c=>c.booking.outletDetails),{selectedServices:l}=(0,M.useSelector)(c=>c.booking.service);return(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsx)("p",{className:"aaravpos-order-title",children:"Your Order"}),(0,o.jsxs)("p",{className:"aaravpos-order-subtitle",children:[s||"-"," Outlet"]}),(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>i(Ie(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-body",children:[e?.id&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"aaravpos-order-section-title",style:{marginBottom:8},children:"Selected Professional"}),(0,o.jsxs)("div",{className:"aaravpos-pro-card aaravpos-display-flex aaravpos-mb-10 aaravpos-tp-10",children:[e.imageUrl?(0,o.jsx)("img",{src:e.imageUrl,alt:e.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:e.color||"#111"},children:nt(e.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:e.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:e.staff_type})]})]})]}),(0,o.jsx)("p",{className:"aaravpos-order-section-title",children:"Selected Services"}),(0,o.jsx)("ul",{className:d?d&&e?.id?"aaravpos-pro-order-list":"aaravpos-pro-order-list-single":"aaravpos-pro-order-list-pro",children:t?.length>0?(0,o.jsx)(o.Fragment,{children:t.map(c=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:c.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:c.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[c.min_time||c.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),c.price||c.min_price]})]})]},c.id))}):(0,o.jsx)(o.Fragment,{children:l?.length>0&&l?.map(c=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:c.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:c.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[c.min_time||c.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),c.price||c.min_price]})]})]},c.id))})})]}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-footer",children:[d&&e?.id&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Subtotal"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),r]})]}),(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Duration"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[n," min"]})]})]}),(0,o.jsx)("button",{disabled:d?!t.length:!e,onClick:()=>a("time"),className:"aaravpos-common-btn",children:(0,o.jsxs)("span",{className:"aaravpos-common-btn-content",children:[d?"Choose Time":"Choose Services",(0,o.jsx)(_t,{size:16})]})})]})]})]})]})};function Gp(){const e=(0,M.useDispatch)(),{staff:t,selectedProfessional:r}=(0,M.useSelector)(i=>i.booking.service),n=!t||t.length===0,a=i=>{if(!i?.futureLeaveDates?.length)return{isOnLeave:!1,availableFrom:null};const s=new Date,d=i.futureLeaveDates.find(l=>{if(l.status!=="APPROVED"||l.leaveType!=="FULL_DAY")return!1;const c=new Date(l.startDate),u=new Date(l.endDate);return s>=c&&s<=u});return d?.returnDate?.date?{isOnLeave:!0,availableFrom:new Date(d.returnDate.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})}:{isOnLeave:!1,availableFrom:null}};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(il,{pro:r,goToStep:()=>e(Se())}),children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Professional"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Available based on selected services"}),n&&(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No staff Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No staff available for selected services"})]}),(0,o.jsx)("div",{className:"aaravpos-staff-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-staff-grid",children:t?.map((i,s)=>{const{isOnLeave:d,availableFrom:l}=a(i);return(0,o.jsxs)("div",{onClick:()=>{e(ni(i)),e(ft(null)),e(Se())},className:`aaravpos-pro-card ${r?.id===i.id?"active":""}`,children:[(0,o.jsxs)("div",{className:"aaravpos-display-flex",children:[i.imageUrl?(0,o.jsx)("img",{src:i.imageUrl,alt:i.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:i.color||"#111"},children:nt(i.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:i.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:i.staff_type})]})]}),d&&l&&(0,o.jsxs)("div",{className:"aaravpos-available-badge",children:[(0,o.jsx)("span",{className:"aaravpos-available-dot"}),(0,o.jsxs)("p",{className:"aaravpos-available-text",children:["Available from ",l]})]})]},s)})})})]})]})}var Hp=e=>Number(e.price||e.min_price||0),wa=(e,{perUnit:t=!1}={})=>{const r=Hp(e),n=t?1:e.qty||1;return!e.taxRows||!e.taxRows.length?0:e.taxRows.reduce((a,i)=>i.isActive?i.taxType==="FIXED"?a+i.taxRate*n:i.taxType==="PERCENTAGE"?a+r*n*i.taxRate/100:a:a,0)};function Kp(){const e=(0,M.useDispatch)(),{staff:t,selectedServices:r,selectedProfessional:n}=(0,M.useSelector)(h=>h.booking.service),[a,i]=(0,S.useState)(!1),s=r.map(h=>h.id),d=(0,S.useMemo)(()=>{if(!n?.id)return[];const h=t.find(p=>p.id===n.id);return h?r.map(p=>{const v=h?.assignments?.find($=>$.id===p?.id),y={...p,price:v?.price||p.price||p.min_price||0,duration:v?.duration||p.estimated_time||p.min_time||0};return{...y,tax:wa(y)}}):[]},[n,t,r]),l=d.reduce((h,p)=>h+Number(p.price||p.min_price||0)*p.qty,0),c=d.reduce((h,p)=>h+(p?.duration||0)*p.qty,0),u=(0,S.useMemo)(()=>s.length?t.filter(h=>{const p=h.assignments??[];return s?.every(v=>p.some(y=>String(y.id)===String(v)&&!!y?.assigned))}):[],[t,s]),f=s.length>0;(0,S.useEffect)(()=>{if(f&&u.length===0){const h=setTimeout(()=>i(!0),300);return()=>clearTimeout(h)}else i(!1)},[f,u]);const m=h=>{if(!h?.futureLeaveDates?.length)return{isOnLeave:!1,availableFrom:null};const p=new Date,v=h.futureLeaveDates.find(y=>{if(y.status!=="APPROVED"||y.leaveType!=="FULL_DAY")return!1;const $=new Date(y.startDate),g=new Date(y.endDate);return p>=$&&p<=g});return v?.returnDate?.date?{isOnLeave:!0,availableFrom:new Date(v.returnDate.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})}:{isOnLeave:!1,availableFrom:null}};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(il,{pro:n,selectedStaffServices:d,totalPrice:l,totalDuration:c,goToStep:()=>e(Se())}),renderButton:null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Professional"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Available based on selected services"}),a&&(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No staff Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No staff available for selected services"})]}),(0,o.jsx)("div",{className:"aaravpos-staff-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-staff-grid",children:u.map((h,p)=>{const{isOnLeave:v,availableFrom:y}=m(h);return(0,o.jsxs)("div",{onClick:()=>{e(ni(h)),e(ft(null)),e(Se())},className:`aaravpos-pro-card ${n?.id===h.id?"active":""}`,children:[(0,o.jsxs)("div",{className:"aaravpos-display-flex",children:[h.imageUrl?(0,o.jsx)("img",{src:h.imageUrl,alt:h.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:h.color||"#111"},children:nt(h.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:h.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:h.staff_type})]})]}),v&&y&&(0,o.jsxs)("div",{className:"aaravpos-available-badge",children:[(0,o.jsx)("span",{className:"aaravpos-available-dot"}),(0,o.jsxs)("p",{className:"aaravpos-available-text",children:["Available from ",y]})]})]},p)})})})]})]})}function ol({selectedServices:e,totalPrice:t,goToStep:r}){const n=(0,M.useDispatch)(),{outletName:a,isService:i}=(0,M.useSelector)(s=>s.booking?.outletDetails);return(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsx)("p",{className:"aaravpos-order-title",children:"Your Order"}),(0,o.jsxs)("p",{className:"aaravpos-order-subtitle",children:[a||"-"," Outlet"]}),(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>n(Ie(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-body",children:[(0,o.jsx)("p",{className:"aaravpos-order-section-title",children:"SELECTED SERVICES"}),(0,o.jsx)("ul",{className:"aaravpos-order-list",children:e?.length>0&&e?.map(s=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:s.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:s.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[s.min_time||s.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),s.price||s.min_price]})]})]},s.id))})]}),(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-footer",children:[(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Subtotal"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),t]})]}),(0,o.jsx)("div",{children:(0,o.jsx)("button",{onClick:()=>r("professionals"),disabled:!e.length,className:"aaravpos-common-btn",children:(0,o.jsxs)("span",{className:"aaravpos-common-btn-content",children:[i?"Choose Professional":"Choose Time",(0,o.jsx)(_t,{size:16})]})})})]})]})]})}function sl(){return(0,o.jsx)("div",{className:"aaravpos-skeleton-card",children:(0,o.jsx)("div",{className:"aaravpos-skeleton-shimmer",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent)",animation:"shimmer 1.2s infinite"}})})}function Yp(){const e=(0,M.useDispatch)(),t=(0,S.useRef)(null),r=(0,S.useRef)(null),{superCategories:n,selectedServices:a,selectedProfessional:i,loading:s}=(0,M.useSelector)(N=>N.booking.service),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(null),[f,m]=(0,S.useState)(""),h=new Set(i?i?.assignments?.map(N=>N.id):[]),p=new Set(i?i?.assignments?.map(N=>N.categoryId):[]),v=n?.map(N=>({...N,categories:N.categories?.map(b=>({...b,services:b.services?.filter(T=>h.has(T.id))||[]})).filter(b=>p.has(b.id)&&b.services.length>0)||[]})).filter(N=>N.categories.length>0)||[],y=(0,S.useMemo)(()=>d?c?c?.services||[]:d?.categories?.flatMap(N=>N.services||[])||[]:[],[d,c]),$=(0,S.useMemo)(()=>v?.flatMap(N=>N.categories?.flatMap(b=>b.services||[]))||[],[v]),g=(0,S.useMemo)(()=>{const N=f.trim().toLowerCase();return N?$.filter(b=>b.name?.toLowerCase().includes(N)||b.description?.toLowerCase().includes(N)):y},[f,$,y]),x=N=>N.taxRows?.some(b=>b.isActive)||!1,C=a.reduce((N,b)=>N+Number(b.price||b.min_price||0)*b.qty,0);return(0,S.useEffect)(()=>{if(!v?.length)return;const N=v.find(b=>b?.categories?.some(T=>T?.services?.length>0));N&&!d&&(l(N),u(null))},[v,d]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(ol,{selectedServices:a,totalPrice:C,goToStep:()=>e(Se())}),renderButton:g?.length>0?(0,o.jsx)("button",{onClick:()=>e(Se()),disabled:!a.length,className:"aaravpos-btn",children:(0,o.jsxs)("span",{className:"aaravpos-btn-content",children:["Choose Professional ",(0,o.jsx)(_t,{size:16})]})}):null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsxs)("div",{className:"aaravpos-navbar-form",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Service"}),(0,o.jsxs)("p",{className:"aaravpos-sub-title",children:["Select from ",i?.name,"'s available services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(pi,{size:14})}),(0,o.jsx)("input",{id:"search",name:"search",type:"text",placeholder:"Search services...",value:f,onChange:N=>m(N.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:f&&(0,o.jsx)("button",{onClick:()=>m(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{ref:t,onWheel:N=>{t.current&&(t.current.scrollLeft+=N.deltaY)},className:"aaravpos-supercategory-wrapper",children:v?.map(N=>(0,o.jsx)("button",{onClick:()=>{l(N),u(null)},className:`aaravpos-supercategory-btn ${d?.id===N.id?"active":""}`,children:(0,o.jsx)("h3",{className:"aaravpos-supercategory-title",children:N?.isStandAloneCategory?"Standalone":N.name})},N.id))}),d?.categories?.some(N=>N?.services?.length>0)&&(0,o.jsxs)("div",{ref:r,onWheel:N=>{r.current&&(r.current.scrollLeft+=N.deltaY)},className:"aaravpos-supercategory-wrapper",children:[(0,o.jsxs)("button",{onClick:()=>u(null),className:`aaravpos-supercategory-btn ${c?"":"active"}`,children:["All Services (",d?.categories?.reduce((N,b)=>N+(b?.services?.length||0),0),")"]}),d?.categories?.map(N=>(0,o.jsxs)("button",{onClick:()=>u(N),className:`aaravpos-supercategory-btn ${c?.id===N.id?"active":""}`,children:[N.name," (",N.services.length,")"]},N.id))]}),(0,o.jsx)("div",{className:"aaravpos-services-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-services-grid",children:s?Array.from({length:10}).map((N,b)=>(0,o.jsx)(sl,{},b)):(0,o.jsx)(o.Fragment,{children:g?.length?g?.map((N,b)=>(0,o.jsxs)("div",{onClick:()=>{const T=a.find(R=>R.id===N.id);T&&T.qty===1?e(Yr(String(N.id))):e(Kr({...N,price:N.price?Number(N.price):void 0})),window.innerWidth>991&&e(Ie(!0))},className:`aaravpos-service-card ${a.some(T=>T.id===N.id)?"active":""}`,children:[x(N)&&(0,o.jsx)("span",{className:"aaravpos-tax-badge",children:"TAX"}),ai(N)&&(0,o.jsx)("span",{className:"aaravpos-consent-badge",children:"CONSENT"}),(0,o.jsx)("p",{className:"aaravpos-service-title",children:N.name}),(0,o.jsxs)("div",{className:"aaravpos-service-description-wrapper",children:[(0,o.jsx)("p",{className:"aaravpos-service-description",children:N.description}),N.description&&N.description.length>30&&(0,o.jsx)("div",{className:"aaravpos-service-tooltip",children:N.description})]}),(0,o.jsxs)("p",{className:"aaravpos-service-price",children:[(0,o.jsx)("span",{children:N.estimated_time?`${N.estimated_time} min`:`${N.min_time}-${N.max_time} min`}),(0,o.jsx)("span",{className:"aaravpos-service-price-right",children:N.price?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14})," ",N.price]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14})," ",N.min_price," - ",(0,o.jsx)(re,{size:14})," ",N.max_price]})})]}),(0,o.jsxs)("div",{className:"aaravpos-service-actions",children:[(0,o.jsx)("button",{onClick:T=>{T.stopPropagation(),e(Yr(String(N.id))),window.innerWidth>991&&e(Ie(!0))},className:"aaravpos-service-action-btn",children:(0,o.jsx)(rl,{size:14})}),(0,o.jsx)("span",{className:"aaravpos-service-qty",children:a.find(T=>T.id===N.id)?.qty||0}),(0,o.jsx)("button",{onClick:T=>{T.stopPropagation(),a.find(R=>R.id===N.id)?e(Ad(String(N.id))):e(Kr({...N,price:N.price?Number(N.price):void 0})),window.innerWidth>991&&e(Ie(!0))},className:"aaravpos-service-action-btn plus",children:(0,o.jsx)(fi,{size:14})})]})]},b)):(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Services Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:f?"No services found for your search.":"No services are available for this professional."})]})})})})]})]})}function Xp(){const e=(0,M.useDispatch)(),t=(0,S.useRef)(null),r=(0,S.useRef)(null),{superCategories:n,selectedServices:a,loading:i}=(0,M.useSelector)(g=>g.booking.service),{outletName:s}=(0,M.useSelector)(g=>g.booking?.outletDetails),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(null),[f,m]=(0,S.useState)(""),h=(0,S.useMemo)(()=>d?c?c?.services||[]:d?.categories?.flatMap(g=>g.services||[])||[]:[],[d,c]),p=(0,S.useMemo)(()=>n?.flatMap(g=>g?.categories?.flatMap(x=>x.services||[]))||[],[n]),v=(0,S.useMemo)(()=>{const g=f.trim().toLowerCase();return g?p.filter(x=>x.name?.toLowerCase().includes(g)||x.description?.toLowerCase().includes(g)):h},[f,p,h]),y=g=>g.taxRows?.some(x=>x.isActive)||!1,$=a.reduce((g,x)=>g+Number(x.price||x.min_price||0)*x.qty,0);return(0,S.useEffect)(()=>{if(!n?.length)return;const g=n.find(x=>x?.categories?.some(C=>C?.services?.length>0));g&&!d&&(l(g),u(null))},[n,d]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(ol,{selectedServices:a,totalPrice:$,goToStep:()=>e(Se())}),renderButton:v?.length>0?(0,o.jsx)("button",{onClick:()=>e(Se()),disabled:!a.length,className:"aaravpos-btn",children:(0,o.jsxs)("span",{className:"aaravpos-btn-content",children:["Choose Professional ",(0,o.jsx)(_t,{size:16})]})}):null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsxs)("div",{className:"aaravpos-navbar-form",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Book A Service"}),(0,o.jsxs)("p",{className:"aaravpos-sub-title",children:["Select from"," ",(0,o.jsx)("span",{className:"aaravpos-text-bold",children:s})," Outlet's available services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(pi,{size:14})}),(0,o.jsx)("input",{type:"text",placeholder:"Search services...",value:f,onChange:g=>m(g.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:f&&(0,o.jsx)("button",{onClick:()=>m(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{ref:t,onWheel:g=>{t.current&&(t.current.scrollLeft+=g.deltaY)},className:"aaravpos-supercategory-wrapper",children:n?.filter(g=>g?.categories?.some(x=>x?.services?.length>0))?.map(g=>(0,o.jsx)("button",{onClick:()=>{l(g),u(null)},className:`aaravpos-supercategory-btn ${d?.id===g.id?"active":""}`,children:(0,o.jsx)("h3",{className:"aaravpos-supercategory-title",children:g?.isStandAloneCategory?"Standalone":g.name})},g.id))}),d?.categories?.some(g=>g?.services?.length>0)&&(0,o.jsxs)("div",{ref:r,onWheel:g=>{r.current&&(r.current.scrollLeft+=g.deltaY)},className:"aaravpos-supercategory-wrapper",children:[(0,o.jsxs)("button",{onClick:()=>u(null),className:`aaravpos-supercategory-btn ${c?"":"active"}`,children:["All Services (",d?.categories?.reduce((g,x)=>g+(x?.services?.length||0),0),")"]}),d?.categories?.filter(g=>g?.services?.length>0)?.map(g=>(0,o.jsxs)("button",{onClick:()=>u(g),className:`aaravpos-supercategory-btn ${c?.id===g.id?"active":""}`,children:[g.name," (",g.services.length,")"]},g.id))]}),(0,o.jsx)("div",{className:"aaravpos-services-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-services-grid",children:i?Array.from({length:10}).map((g,x)=>(0,o.jsx)(sl,{},x)):(0,o.jsx)(o.Fragment,{children:v?.length?v?.map((g,x)=>(0,o.jsxs)("div",{onClick:()=>{const C=a.find(N=>N.id===g.id);C&&C.qty===1?e(Yr(String(g.id))):e(Kr(g)),window.innerWidth>991&&e(Ie(!0))},className:`aaravpos-service-card ${a.some(C=>C.id===g.id)?"active":""}`,children:[y(g)&&(0,o.jsx)("span",{className:"aaravpos-tax-badge",children:"TAX"}),ai(g)&&(0,o.jsx)("span",{className:"aaravpos-consent-badge",children:"CONSENT"}),(0,o.jsx)("p",{className:"aaravpos-service-title",children:g.name}),(0,o.jsxs)("div",{className:"aaravpos-service-description-wrapper",children:[(0,o.jsx)("p",{className:"aaravpos-service-description",children:g.description}),g.description&&g.description.length>30&&(0,o.jsx)("div",{className:"aaravpos-service-tooltip",children:g.description})]}),(0,o.jsxs)("p",{className:"aaravpos-service-price",children:[(0,o.jsx)("span",{children:g.estimated_time?`${g.estimated_time} min`:`${g.min_time}-${g.max_time} min`}),(0,o.jsx)("span",{className:"aaravpos-service-price-right",children:g.price?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),g.price]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),g.min_price," - ",(0,o.jsx)(re,{size:14}),g.max_price]})})]}),(0,o.jsxs)("div",{className:"aaravpos-service-actions",children:[(0,o.jsx)("button",{onClick:C=>{C.stopPropagation(),e(Yr(String(g.id))),window.innerWidth>991&&e(Ie(!0))},className:"aaravpos-service-action-btn",children:(0,o.jsx)(rl,{size:14})}),(0,o.jsx)("span",{className:"aaravpos-service-qty",children:a.find(C=>C.id===g.id)?.qty||0}),(0,o.jsx)("button",{onClick:C=>{C.stopPropagation(),a.find(N=>N.id===g.id)?e(Ad(String(g.id))):e(Kr(g)),window.innerWidth>991&&e(Ie(!0))},className:"aaravpos-service-action-btn plus",children:(0,o.jsx)(fi,{size:14})})]})]},x)):(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Services Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:f?"No services found for your search.":"No services are available for selected category."})]})})})})]})]})}var kt=({dateObj:e,selectedProfessional:t,outletTimeZone:r})=>{if(!t)return!1;const n=he.DateTime.fromObject({year:e.year,month:e.month,day:e.day},{zone:r}),a=n.toISODate();if((t?.futureLeaveDates||[]).some(c=>{if(c.status!=="APPROVED"||c.leaveType!=="FULL_DAY")return!1;const u=c?.leavePeriod?.date;return u?he.DateTime.fromISO(u,{zone:"utc"}).toISODate()===a:!1}))return!0;const i=(t?.dateOverrides||[]).find(c=>he.DateTime.fromISO(c.date,{zone:"utc"}).toISODate()===a);if(i?.type==="CLOSED")return!0;if(i?.type==="TIME")return!1;const s=t?.weeklyHours?.weeklyJson||{},d={1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat",7:"sun"}[n.weekday],l=s?.[d];return!l||!!l.isClosed},Zp=e=>{try{if(!e)throw new Error("Missing timezone");const t=he.DateTime.now().setZone(e);if(!t.isValid)throw new Error("Invalid timezone");return Array.from({length:4},(r,n)=>{const a=t.plus({months:n}).startOf("month");return{label:a.toFormat("LLLL yyyy"),monthIdx:a.month,year:a.year,startDow:a.startOf("month").weekday%7,days:a.daysInMonth||0}})}catch(t){return console.error("generateMonths error:",t),[]}},Jp=["S","M","T","W","T","F","S"];function Qp({isOpen:e,onClose:t}){const r=(0,M.useDispatch)(),{selectedDate:n}=(0,M.useSelector)(p=>p.booking.slots),{selectedProfessional:a}=(0,M.useSelector)(p=>p.booking.service),{timeZone:i}=(0,M.useSelector)(p=>p.booking.outletDetails),[s]=(0,S.useState)(Zp(i||"")),d=()=>{if(!n)return 0;const p=s.findIndex(v=>v.monthIdx===n.month&&v.year===n.year);return p>=0?p:0},[l,c]=(0,S.useState)(d());(0,S.useEffect)(()=>{if(!e||!n||!s.length)return;const p=s.findIndex(v=>v.monthIdx===n.month&&v.year===n.year);p>=0&&c(p)},[e,n,s]);const u=s[l];if(!e)return null;const f=he.DateTime.now().setZone(i??"UTC").startOf("day"),m=f.plus({months:3}).minus({days:1}),h=(p,v)=>{const y=he.DateTime.fromObject({year:u.year,month:p,day:v},{zone:i||"UTC"}),$={day:v,month:p,year:u.year,fullDate:y.toISODate()||""},g=y.startOf("day");g<f||g>m||kt({dateObj:$,selectedProfessional:a,outletTimeZone:i||"UTC"})||(r(ft({month:p,day:v,year:u.year})),t())};return(0,o.jsx)("div",{className:"aaravpos-date-modal-overlay",onClick:p=>p.target===p.currentTarget&&t(),children:(0,o.jsxs)("div",{className:"aaravpos-date-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-date-modal-header",children:[(0,o.jsx)("h2",{className:"aaravpos-date-modal-title",children:"Pick a Date"}),(0,o.jsx)("button",{onClick:t,className:"aaravpos-date-close-btn",children:(0,o.jsx)(Ye,{})})]}),(0,o.jsxs)("div",{className:"aaravpos-date-modal-body",children:[(0,o.jsxs)("div",{className:"aaravpos-date-nav",children:[(0,o.jsx)("button",{disabled:l===0,onClick:()=>c(p=>Math.max(p-1,0)),className:"aaravpos-date-nav-btn",children:(0,o.jsx)(Zr,{})}),(0,o.jsx)("div",{className:"aaravpos-date-month-label",children:u?.label}),(0,o.jsx)("button",{disabled:l===s.length-1,onClick:()=>c(p=>Math.min(p+1,s.length-1)),className:"aaravpos-date-nav-btn",children:(0,o.jsx)(_t,{})})]}),(0,o.jsxs)("div",{className:"aaravpos-calendar-grid",children:[Jp.map((p,v)=>(0,o.jsx)("div",{className:"aaravpos-calendar-weekday",children:p},v)),Array.from({length:u?.startDow||0}).map((p,v)=>(0,o.jsx)("div",{},`e${v}`)),Array.from({length:u?.days||0},(p,v)=>v+1).map(p=>{const v=n?.month===u?.monthIdx&&n?.day===p,y=u?.monthIdx===f.month&&p===f.day,$=he.DateTime.fromObject({year:u.year,month:u.monthIdx,day:p},{zone:i||"UTC"}),g={day:p,month:u.monthIdx,year:u.year,fullDate:$.toISODate()||""},x=$.startOf("day"),C=x<f,N=x>m,b=kt({dateObj:g,selectedProfessional:a,outletTimeZone:i||"UTC"});return(0,o.jsxs)("div",{onClick:()=>{b||h(u.monthIdx,p)},className:["aaravpos-calendar-day",!v&&!b&&"aaravpos-calendar-day-active",y&&!v&&"aaravpos-calendar-day-today",v&&"aaravpos-calendar-day-selected",b&&"aaravpos-calendar-day-disabled",(C||N)&&"aaravpos-calendar-day-disabled"].filter(Boolean).join(" "),children:[b&&(0,o.jsx)("div",{className:"aaravpos-calendar-day-slash"}),(0,o.jsx)("span",{className:"aaravpos-calendar-day-text",children:p})]},p)})]})]})]})})}var eh=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dl({buttonText:e,onButtonClick:t,showTaxesOnlyIfTime:r=!1,showTip:n=!1,tipPct:a=0,onTipChange:i,consentRequired:s=!1,consentCompleted:d=0,totalConsents:l=0,checkingConsent:c=!1,loading:u=!1}){const f=(0,M.useDispatch)(),{selectedSlotIndexes:m,slots:h,selectedDate:p}=(0,M.useSelector)(_=>_.booking.slots),{staff:v,selectedServices:y,selectedProfessional:$}=(0,M.useSelector)(_=>_.booking.service),{timeZone:g}=(0,M.useSelector)(_=>_.booking.outletDetails),x=he.DateTime.now().setZone(g??"UTC"),[C,N]=(0,S.useState)(""),[b,T]=(0,S.useState)(!1),R=(0,S.useRef)(null),G=(0,S.useRef)(null),[J,oe]=(0,S.useState)(0),Q=[0,5,10,15,20],fe=(0,S.useMemo)(()=>[...h?.morning||[],...h?.afternoon||[],...h?.evening||[]],[h]),ge=15,ne=(0,S.useMemo)(()=>{if(!$?.id)return[];const _=v?.find(j=>j.id===$.id);return _?y.map(j=>{const D=_.assignments?.find(K=>K.id===j.id),A={...j,price:D?.price||j.price||j.min_price||0,duration:D?.duration||j.estimated_time||j.min_time||0};return{...A,tax:wa(A),unitTax:wa(A,{perUnit:!0})}}):[]},[$,v,y]),ce=ne.reduce((_,j)=>_+Number(j.price||j.min_price)*(j.qty||1),0),ue=ne.reduce((_,j)=>_+Number(j.duration)*(j.qty||1),0),ae=Math.ceil(ue/ge),pe=_=>{if(!fe.length)return"";const j=fe[_]?.start_time_12h,D=fe[_+ae-1];return!j||!D?"":`${j} - ${D.end_time_12h??D.start_time_12h}`},Oe=p||{day:x.day,month:x.month,year:x.year},$e=m?.[0],O=$e!==void 0?pe($e):null,k=Oe.month??0,B=O?`${eh[k-1]} ${Oe.day} at ${O}`:null,q=ne.reduce((_,j)=>_+j.tax,0),L=Number(a)||0,U=n?ce*L/100:0,F=ce+q+U;(0,S.useEffect)(()=>{n&&a==null&&i?.(0)},[n,a,i]);const w=(0,S.useMemo)(()=>u?"Processing...":c?"Checking consents...":s&&d<l?`Sign Consents (${d}/${l})`:(0,o.jsxs)(o.Fragment,{children:[e||"Book Appointment",(0,o.jsx)(yp,{})]}),[u,c,s,d,l,e]);return(0,S.useEffect)(()=>{const _=()=>{const D=R.current?.offsetHeight||0,A=G.current?.offsetHeight||0,K=(D+(window.innerWidth<=991?190:205)||0)+A;oe(window.innerHeight-K)};_();const j=new ResizeObserver(()=>{_()});return G.current&&j.observe(G.current),R.current&&j.observe(R.current),window.addEventListener("resize",_),()=>{j.disconnect(),window.removeEventListener("resize",_)}},[ne,n,d,l,b]),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsxs)("p",{className:"aaravpos-order-title",children:["Your Order",(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>f(Ie(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),$?.id&&(0,o.jsxs)("div",{className:"aaravpos-pro-card aaravpos-display-flex aaravpos-mb-10 aaravpos-tp-10",children:[$.imageUrl?(0,o.jsx)("img",{src:$.imageUrl,alt:$.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:$.color||"#111"},children:nt($.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:$.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:$.staff_type})]})]}),(0,o.jsxs)("div",{className:"aaravpos-date-time",children:[(0,o.jsx)("span",{className:"aaravpos-date-time-label",children:"Date & Time:"}),B?(0,o.jsx)("span",{className:"aaravpos-date-time-value",children:B}):(0,o.jsx)("span",{className:"aaravpos-date-time-empty",children:"No time selected"})]})]}),(0,o.jsx)("ul",{className:"aaravpos-order-list",style:{height:`${J}px`},children:ne?.length>0&&ne.map(_=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:_.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:_.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[_.min_time||_.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),_.price||_.min_price]})]})]},_.id))}),(0,o.jsxs)("div",{className:"third",ref:G,children:[n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"aaravpos-tip-title",children:"Add Tip"}),(0,o.jsx)("div",{className:"aaravpos-tip-options",children:[...Q,"custom"].map((_,j)=>{const D=_==="custom",A=D?b:L===_,K=j===0,le=j===[...Q,"custom"].length-1;return(0,o.jsx)("button",{onClick:()=>{D?(T(!0),i?.(Number(C)||0)):(T(!1),N(""),i?.(Number(_)))},className:`aaravpos-tip-btn
19
- ${K||le?"aaravpos-tip-btn-fixed":"aaravpos-tip-btn-flex"} ${A?"aaravpos-tip-btn-active":""}`,children:D?"Custom":_===0?"No tip":`${_}%`},_)})}),b&&(0,o.jsx)("div",{className:"aaravpos-tip-input-wrapper",children:(0,o.jsx)("input",{id:"number",name:"number",type:"number",placeholder:"Enter %",value:C,onChange:_=>{const j=_.target.value;(j===""||Number(j)>=0&&Number(j)<=100)&&(N(j),i?.(Number(j)||0))},className:"aaravpos-tip-input"})})]}),s&&d<l&&(0,o.jsxs)("div",{className:"aaravpos-consent-box",children:[(0,o.jsxs)("p",{className:"aaravpos-consent-text",children:["Consent Required: ",d,"/",l," completed"]}),(0,o.jsx)("div",{className:"aaravpos-consent-progress",children:(0,o.jsx)("div",{className:"aaravpos-consent-progress-bar",style:{width:`${d/l*100}%`}})})]}),(0,o.jsxs)("div",{className:"aaravpos-mt-auto",children:[(0,o.jsx)(Zn,{label:"Service",value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),ce.toFixed(2)]})}),n&&(0,o.jsx)(Zn,{label:`Tip (${L}%)`,value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),U.toFixed(2)]})}),(!r||O)&&(0,o.jsx)(Zn,{label:"Taxes",value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),q.toFixed(2)]})}),(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Total"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),F.toFixed(2)]})]}),(0,o.jsx)("button",{onClick:t,className:"aaravpos-common-btn aaravpos-padding-btn",style:{height:42},children:(0,o.jsx)("span",{className:"aaravpos-common-btn-content",children:w})})]})]})]})}function Zn({label:e,value:t}){return(0,o.jsxs)("div",{className:"aaravpos-summary-row",children:[(0,o.jsx)("span",{className:"aaravpos-summary-label",children:e}),(0,o.jsx)("span",{className:"aaravpos-summary-value",children:t})]})}function th(){return(0,o.jsx)("div",{className:"aaravpos-barber-scroll-area",children:Array.from({length:3}).map((e,t)=>(0,o.jsx)("div",{className:"aaravpos-barber-slot-section",children:(0,o.jsxs)("div",{className:"aaravpos-barber-slot-section-header",children:[(0,o.jsx)("div",{className:"aaravpos-barber-slot-skeleton-title shimmer"}),(0,o.jsx)("div",{className:"aaravpos-barber-slot-skeleton-arrow shimmer"})]})},t))})}var No=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function nh(){const e=(0,M.useDispatch)(),{socket:t}=V0(),[r,n]=(0,S.useState)(11),{staff:a,selectedServices:i,selectedProfessional:s}=(0,M.useSelector)(w=>w.booking.service),{isService:d}=(0,M.useSelector)(w=>w.booking.outletDetails),{tenantId:l,timeZone:c}=(0,M.useSelector)(w=>w?.booking?.outletDetails),{selectedSlotIndexes:u,selectedDate:f,selectedTime:m,slots:h,loading:p}=(0,M.useSelector)(w=>w.booking.slots),[v,y]=(0,S.useState)(!1),[$,g]=(0,S.useState)(0),x=15,C=(0,S.useMemo)(()=>[h.morning,h.afternoon,h.evening].flat(),[h]),N=(0,S.useMemo)(()=>he.DateTime.now().setZone(c).startOf("day"),[c]),b=(0,S.useMemo)(()=>N.plus({months:3}).minus({days:1}),[N]),T=i.map(w=>w.id),R=(0,S.useMemo)(()=>T.length?a.filter(w=>T.every(_=>w?.assignments?.some(j=>j.id===_&&j.assigned)??!1)):[],[a,T]),G=(0,S.useMemo)(()=>R.filter(w=>w.id!==s?.id),[R,s]),J=w=>{w.id!==s?.id&&(e(ni(w)),e(ft(null)),e(ur(null)),e(cr({indexes:[],ids:[]})))},oe=(w,_)=>{try{if(!w.isValid||!_.isValid)throw new Error("Invalid timezone or date range");const j=Math.floor(_.diff(w,"days").days)+1;return Array.from({length:j},(D,A)=>{const K=w.plus({days:A});return{day:K.day,month:K.month,year:K.year,fullDate:K.toISODate()}})}catch(j){return console.error("generateDates error:",j),[]}},Q=(0,S.useMemo)(()=>oe(N,b),[N,b]),fe=(0,S.useMemo)(()=>{if(!s?.id)return[];const w=a?.find(_=>_.id===s.id);return w?i.map(_=>{const j=w.assignments?.find(D=>D.id===_.id);return{..._,price:j?.price||_.price||_.min_price||0,duration:j?.duration||_.estimated_time||_.min_time||0,qty:j?.qty||1}}):[]},[s,a,i]),ge=fe.reduce((w,_)=>w+Number(_.duration)*(_.qty||1),0),ne=Math.ceil(ge/x),ce=f?he.DateTime.fromObject(f).toFormat("yyyy-MM-dd"):null,ue=(0,S.useCallback)(()=>{!s?.id||!ce||e(Cr({tenantId:l,staffId:s.id,date:ce}))},[e,l,s?.id,ce]);(0,S.useEffect)(()=>{ue()},[ue]),(0,S.useEffect)(()=>{if(!t)return;const w=_=>{_.staffId===s?.id&&ue()};return t.on("appointment:updated",w),()=>{t.off("appointment:updated",w)}},[t,s?.id,ue]);const ae=w=>{g(_=>Math.max(0,Math.min(Q.length-r,_+w*4)))},pe=()=>Q.find(w=>!kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"}));(0,S.useEffect)(()=>{if(f||!s)return;const w=pe();w&&e(ft({day:w.day,month:w.month,year:w.year}))},[f,s,Q,c,e]),(0,S.useEffect)(()=>{if(!f||!Q.length)return;const w=Q.findIndex(_=>_.day===f.day&&_.month===f.month&&_.year===f.year);w!==-1&&g(Math.max(0,Math.min(Q.length-r,w-Math.floor(r/2))))},[f,Q,r]);const Oe=w=>{const _=he.DateTime.fromISO(w.fullDate||"",{zone:c||"UTC"}).startOf("day");if(_<N||_>b||kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"})){Z.toast.warning("Staff is unavailable on this date");return}e(ft({day:w.day,month:w.month,year:w.year})),e(ur(null))},$e=w=>{if(!C.length)return;const _=C.slice(w,w+ne);if(_.length<ne){Z.toast.warning("You don't have sufficient time for selected service");return}if(_.some(D=>D.isBooked||D.status!=="AVAILABLE"||D.disabled)){Z.toast.warning("Selected time range is not fully available");return}e(ur(C[w].start_time));const j=Array.from({length:ne},(D,A)=>w+A);e(cr({indexes:j,ids:j.map(D=>C[D]?.id)})),setTimeout(()=>{e(Se())},200)};(0,S.useEffect)(()=>{if(!m||!C.length)return;const w=C.findIndex(j=>j.start_time===m);if(w===-1)return;const _=Array.from({length:ne},(j,D)=>w+D);_.length===u.length&&_.every((j,D)=>j===u[D])||e(cr({indexes:_,ids:_.map(j=>C[j]?.id)}))},[m,C,ne,u]),(0,S.useEffect)(()=>{const w=()=>{const _=window.innerWidth;_<350?n(2):_<420?n(3):_<575?n(4):_<680?n(6):_<991?n(8):_<1280?n(10):n(12)};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[]);const O=h?.morning||[],k=h?.afternoon||[],B=h?.evening||[],q=w=>w.some(_=>!_.isBooked&&_.status==="AVAILABLE"&&!_.disabled),L=()=>q(O)?"morning":q(k)?"afternoon":q(B)?"evening":null,[U,F]=(0,S.useState)(L());return(0,S.useEffect)(()=>{const w=C[u[0]];w&&(O.some(_=>_.id===w.id)?F("morning"):k.some(_=>_.id===w.id)?F("afternoon"):B.some(_=>_.id===w.id)&&F("evening"))},[u,C,O,k,B]),(0,S.useEffect)(()=>{e(ur(null)),e(cr({indexes:[],ids:[]}))},[f,e]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)("div",{className:"aaravpos-aside",children:(0,o.jsx)(dl,{buttonText:"Fill Details",onButtonClick:()=>{if(!m||!u.length){Z.toast.warning("Please select a time slot");return}e(Se())},showTaxesOnlyIfTime:!0})}),children:[(0,o.jsx)(wt,{}),(0,o.jsx)("div",{style:{marginTop:15},children:(0,o.jsx)("h1",{className:"aaravpos-page-title",style:{marginBottom:10},children:"Choose a Time"})}),(0,o.jsxs)("div",{className:"aaravpos-date-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-date-strip",children:[(0,o.jsx)(So,{onClick:()=>ae(-1),children:(0,o.jsx)(Zr,{size:20})}),Q.slice($,$+r).map(w=>{const _=he.DateTime.fromObject({year:w.year,month:w.month,day:w.day},{zone:c||"UTC"}),j=_.weekday%7,D=he.DateTime.now().setZone(c).startOf("day"),A=_.hasSame(D,"day"),K=f?.day===w.day&&f?.month===w.month&&f?.year===w.year,le=_.startOf("day"),Me=le<N,Ot=le>b,at=Me||Ot||kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"});return(0,o.jsxs)("div",{onClick:()=>{at||Oe(w)},className:["aaravpos-date-card",Me||Ot||at?"aaravpos-date-card-disabled":K?"aaravpos-date-card-active":"aaravpos-date-card-default"].filter(Boolean).join(" "),children:[at&&(0,o.jsx)("div",{className:"aaravpos-date-disabled-slash"}),(0,o.jsx)("span",{className:"aaravpos-date-week",children:rh[j]}),(0,o.jsx)("span",{className:"aaravpos-date-day",children:w.day}),A&&(0,o.jsx)("span",{className:"aaravpos-date-today",children:"TODAY"}),at&&(0,o.jsx)("span",{className:"aaravpos-date-unavailable",children:"UNAVAILABLE"})]},`${w.day}-${w.month}-${w.year}`)}),(0,o.jsx)(So,{onClick:()=>ae(1),children:(0,o.jsx)(_t,{size:20})})]}),(0,o.jsxs)("button",{onClick:()=>y(!0),className:"aaravpos-calendar-btn",children:[(0,o.jsx)(J0,{size:16}),f?.month!=null?`${No[f.month-1]} ${f.year}`:`${No[N.month-1]} ${N.year}`]})]}),(0,o.jsxs)("div",{className:"aaravpos-professional-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-selected-professional",children:[s?.imageUrl?(0,o.jsx)("img",{src:s.imageUrl,alt:s.name,className:"aaravpos-selected-professional-image"}):(0,o.jsx)("div",{className:"aaravpos-selected-professional-avatar",style:{background:s?.color||"#111"},children:nt(s?.name)}),(0,o.jsxs)("div",{className:"aaravpos-selected-professional-content",children:[(0,o.jsx)("p",{className:"aaravpos-selected-professional-name",children:s?.name}),(0,o.jsxs)("p",{className:"aaravpos-selected-professional-services",children:[fe.map(w=>w.name).join(", ")," ·"," ",ge," min"]})]})]}),d&&G.length>0&&(0,o.jsx)(ah,{professionals:R,selectedProfessional:s,onSelect:J})]}),(0,o.jsxs)("div",{className:"aaravpos-scroll-area",style:p?{height:300}:{},children:[p?(0,o.jsx)(th,{}):(0,o.jsx)(o.Fragment,{children:C?.length?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Jn,{label:"Morning",icon:(0,o.jsx)(Ip,{size:18,className:"aaravpos-slot-icon"}),slots:O,allSlots:C,selectedSlotIndexes:u,handleSlotSelect:$e,isOpen:U==="morning",onToggle:()=>F(U==="morning"?null:"morning")}),(0,o.jsx)(Jn,{label:"Afternoon",icon:(0,o.jsx)(Tp,{size:18,className:"aaravpos-slot-icon"}),slots:k,allSlots:C,selectedSlotIndexes:u,handleSlotSelect:$e,isOpen:U==="afternoon",onToggle:()=>F(U==="afternoon"?null:"afternoon")}),(0,o.jsx)(Jn,{label:"Evening",icon:(0,o.jsx)(hp,{size:18,className:"aaravpos-slot-icon"}),slots:B,allSlots:C,selectedSlotIndexes:u,handleSlotSelect:$e,isOpen:U==="evening",onToggle:()=>F(U==="evening"?null:"evening")})," "]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"aaravpos-supercategory-wrapper"}),(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Slots Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No slots available for selected date. Please choose a different date."})]})]})}),(0,o.jsx)(Qp,{isOpen:v,onClose:()=>y(!1)})]})]})}function So({onClick:e,children:t}){return(0,o.jsx)("button",{onClick:e,className:"aaravpos-date-nav-btn",children:t})}function Jn({icon:e,label:t,slots:r,allSlots:n,selectedSlotIndexes:a,handleSlotSelect:i,isOpen:s,onToggle:d}){return!r||r?.length===0?null:(0,o.jsxs)("div",{className:"aaravpos-slot-section",children:[(0,o.jsxs)("div",{onClick:d,className:"aaravpos-slot-section-header",children:[(0,o.jsxs)("div",{className:"aaravpos-slot-section-title",children:[(0,o.jsx)("span",{children:e}),t]}),(0,o.jsx)("span",{className:`aaravpos-slot-section-arrow ${s?"aaravpos-slot-section-arrow-open":""}`,children:(0,o.jsx)(ui,{})})]}),s&&(0,o.jsx)("div",{className:"aaravpos-slot-section-content",children:(0,o.jsx)("div",{className:"aaravpos-slot-grid",children:r.map(l=>{const c=n.findIndex(h=>h.id===l.id),u=a.includes(c),f=l.disabled,m=l.isBooked||l.status!=="AVAILABLE"||f;return(0,o.jsxs)("div",{onClick:()=>{m||i(c)},className:`aaravpos-slot-card ${m?"aaravpos-slot-card-disabled":u?"aaravpos-slot-card-selected":"aaravpos-slot-card-default"}`,children:[(0,o.jsx)("span",{className:"aaravpos-slot-time",children:l.start_time_12h}),(0,o.jsx)("span",{className:"aaravpos-slot-status",children:l.disabled?"":l.isBooked?"Booked":"Available"})]},l.id)})})})]})}function ah({professionals:e,selectedProfessional:t,onSelect:r}){const[n,a]=(0,S.useState)(!1);return(0,o.jsxs)("div",{className:"aaravpos-professional-dropdown",children:[(0,o.jsxs)("button",{onClick:()=>a(i=>!i),className:"aaravpos-professional-dropdown-btn",children:[(0,o.jsx)("span",{className:"aaravpos-professional-dropdown-text",children:"Choose Professional"}),(0,o.jsx)(ui,{size:18,className:`aaravpos-professional-dropdown-icon ${n?"aaravpos-professional-dropdown-icon-open":""}`})]}),n&&(0,o.jsx)("div",{className:"aaravpos-professional-dropdown-menu",children:e.filter(i=>i.id!==t?.id).map((i,s,d)=>(0,o.jsxs)("div",{onClick:()=>{r(i),a(!1)},className:`aaravpos-professional-dropdown-item ${s!==d.length-1?"aaravpos-professional-dropdown-item-border":""}`,children:[i.imageUrl?(0,o.jsx)("img",{src:i.imageUrl,className:"aaravpos-professional-dropdown-avatar",alt:i.name}):(0,o.jsx)("div",{className:"aaravpos-professional-dropdown-avatar-placeholder",style:{background:i.color||"#111"},children:nt(i.name)}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"aaravpos-professional-dropdown-name",children:i.name}),(0,o.jsx)("p",{className:"aaravpos-professional-dropdown-type",children:i.staff_type})]})]},i.id))})]})}var ih=e=>e.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim(),oh=e=>{const t=e.replace(/\D/g,"").slice(0,4);return t.length>=3?`${t.slice(0,2)}/${t.slice(2)}`:t},sh=e=>e.replace(/\D/g,"").slice(0,3);function dh({onClose:e,onPay:t,amount:r}){const{timeZone:n}=(0,M.useSelector)(u=>u.booking?.outletDetails),{control:a,handleSubmit:i,reset:s,formState:{errors:d,isSubmitting:l}}=(0,Ue.useForm)({defaultValues:{name:"",number:"",expiry:"",cvv:""}}),c=async u=>{await t({name:u.name.trim(),number:u.number.trim(),expiry:u.expiry,cvv:u.cvv})&&e()};return(0,o.jsx)("div",{className:"aaravpos-payment-overlay",children:(0,o.jsx)("form",{onSubmit:i(c),className:"aaravpos-payment-form",children:(0,o.jsxs)("div",{className:"aaravpos-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-payment-header",children:[(0,o.jsx)("h2",{className:"aaravpos-payment-title",children:"Make a payment"}),(0,o.jsxs)("span",{className:"aaravpos-payment-amount",children:[(0,o.jsx)(re,{size:14}),r?.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-fields",children:[(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"name",className:"aaravpos-payment-label",children:["Card Holder Name ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"name",control:a,rules:{required:"Name required",pattern:{value:/^[A-Za-z ]+$/,message:"Only letters allowed"}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"name",autoComplete:"cc-name",placeholder:"Card Holder Name",onChange:f=>{const m=f.target.value.replace(/[^A-Za-z ]/g,"");u.onChange(m)},className:"aaravpos-custom-input"})}),d.name&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.name.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"number",className:"aaravpos-payment-label",children:["Card Number ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"number",control:a,rules:{required:"Card number required",validate:u=>u.replace(/\s/g,"").length===16||"Must be 16 digits"},render:({field:u})=>(0,o.jsx)("input",{...u,id:"number",placeholder:"4242 4242 4242 4242",onChange:f=>{u.onChange(ih(f.target.value))},className:"aaravpos-custom-input"})}),d.number&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.number.message})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"expiry",className:"aaravpos-payment-label",children:["Expiry Date ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"expiry",control:a,rules:{required:"Expiry required",validate:u=>{if(!/^\d{2}\/\d{2}$/.test(u))return"Invalid format";const[f,m]=u.split("/").map(Number);if(f<1||f>12)return"Invalid month";const h=he.DateTime.now().setZone(n),p=h.year%100,v=h.month;return m<p||m===p&&f<v?"Card expired":!0}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"expiry",placeholder:"MM/YY",onChange:f=>{u.onChange(oh(f.target.value))},className:"aaravpos-custom-input"})}),d.expiry&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.expiry.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"cvv",className:"aaravpos-payment-label",children:["CVV ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"cvv",control:a,rules:{required:"CVV required",minLength:{value:3,message:"3 digits required"}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"cvv",placeholder:"CVV",onChange:f=>{u.onChange(sh(f.target.value))},className:"aaravpos-custom-input"})}),d.cvv&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.cvv.message})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-btn-grid",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{s(),e()},className:"aaravpos-payment-cancel-btn",children:"Cancel"}),(0,o.jsx)("button",{type:"submit",disabled:l,className:"aaravpos-payment-submit-btn",children:l?"Processing...":"Proceed"})]})]})})})}function Ea(){return Ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ea.apply(null,arguments)}function lh(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ch(e,t){if(e==null)return{};var r,n,a=lh(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function $t(e){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(e)}function uh(e,t){if($t(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($t(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fh(e){var t=uh(e,"string");return $t(t)=="symbol"?t:t+""}function xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fh(n.key),n)}}function ph(e,t,r){return t&&xo(e.prototype,t),r&&xo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pa(e,t){return Pa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Pa(e,t)}function mh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pa(e,t)}function Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(e)}function ll(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ll=function(){return!!e})()}function vh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yh(e,t){if(t&&($t(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vh(e)}function gh(e){var t=ll();return function(){var r,n=Qr(e);if(t){var a=Qr(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return yh(this,r)}}var $h=Pe((e=>{var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,a=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,d=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,v=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,$=t?Symbol.for("react.fundamental"):60117,g=t?Symbol.for("react.responder"):60118,x=t?Symbol.for("react.scope"):60119;function C(b){if(typeof b=="object"&&b!==null){var T=b.$$typeof;switch(T){case r:switch(b=b.type,b){case c:case u:case a:case s:case i:case m:return b;default:switch(b=b&&b.$$typeof,b){case l:case f:case v:case p:case d:return b;default:return T}}case n:return T}}}function N(b){return C(b)===u}e.AsyncMode=c,e.ConcurrentMode=u,e.ContextConsumer=l,e.ContextProvider=d,e.Element=r,e.ForwardRef=f,e.Fragment=a,e.Lazy=v,e.Memo=p,e.Portal=n,e.Profiler=s,e.StrictMode=i,e.Suspense=m,e.isAsyncMode=function(b){return N(b)||C(b)===c},e.isConcurrentMode=N,e.isContextConsumer=function(b){return C(b)===l},e.isContextProvider=function(b){return C(b)===d},e.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===r},e.isForwardRef=function(b){return C(b)===f},e.isFragment=function(b){return C(b)===a},e.isLazy=function(b){return C(b)===v},e.isMemo=function(b){return C(b)===p},e.isPortal=function(b){return C(b)===n},e.isProfiler=function(b){return C(b)===s},e.isStrictMode=function(b){return C(b)===i},e.isSuspense=function(b){return C(b)===m},e.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===a||b===u||b===s||b===i||b===m||b===h||typeof b=="object"&&b!==null&&(b.$$typeof===v||b.$$typeof===p||b.$$typeof===d||b.$$typeof===l||b.$$typeof===f||b.$$typeof===$||b.$$typeof===g||b.$$typeof===x||b.$$typeof===y)},e.typeOf=C})),bh=Pe((e=>{process.env.NODE_ENV!=="production"&&(function(){"use strict";var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,a=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,d=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,v=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,$=t?Symbol.for("react.fundamental"):60117,g=t?Symbol.for("react.responder"):60118,x=t?Symbol.for("react.scope"):60119;function C(A){return typeof A=="string"||typeof A=="function"||A===a||A===u||A===s||A===i||A===m||A===h||typeof A=="object"&&A!==null&&(A.$$typeof===v||A.$$typeof===p||A.$$typeof===d||A.$$typeof===l||A.$$typeof===f||A.$$typeof===$||A.$$typeof===g||A.$$typeof===x||A.$$typeof===y)}function N(A){if(typeof A=="object"&&A!==null){var K=A.$$typeof;switch(K){case r:var le=A.type;switch(le){case c:case u:case a:case s:case i:case m:return le;default:var Me=le&&le.$$typeof;switch(Me){case l:case f:case v:case p:case d:return Me;default:return K}}case n:return K}}}var b=c,T=u,R=l,G=d,J=r,oe=f,Q=a,fe=v,ge=p,ne=n,ce=s,ue=i,ae=m,pe=!1;function Oe(A){return pe||(pe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$e(A)||N(A)===c}function $e(A){return N(A)===u}function O(A){return N(A)===l}function k(A){return N(A)===d}function B(A){return typeof A=="object"&&A!==null&&A.$$typeof===r}function q(A){return N(A)===f}function L(A){return N(A)===a}function U(A){return N(A)===v}function F(A){return N(A)===p}function w(A){return N(A)===n}function _(A){return N(A)===s}function j(A){return N(A)===i}function D(A){return N(A)===m}e.AsyncMode=b,e.ConcurrentMode=T,e.ContextConsumer=R,e.ContextProvider=G,e.Element=J,e.ForwardRef=oe,e.Fragment=Q,e.Lazy=fe,e.Memo=ge,e.Portal=ne,e.Profiler=ce,e.StrictMode=ue,e.Suspense=ae,e.isAsyncMode=Oe,e.isConcurrentMode=$e,e.isContextConsumer=O,e.isContextProvider=k,e.isElement=B,e.isForwardRef=q,e.isFragment=L,e.isLazy=U,e.isMemo=F,e.isPortal=w,e.isProfiler=_,e.isStrictMode=j,e.isSuspense=D,e.isValidElementType=C,e.typeOf=N})()})),cl=Pe(((e,t)=>{process.env.NODE_ENV==="production"?t.exports=$h():t.exports=bh()})),Nh=Pe(((e,t)=>{var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(d){if(d==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(d)}function s(){try{if(!Object.assign)return!1;var d=new String("abc");if(d[5]="de",Object.getOwnPropertyNames(d)[0]==="5")return!1;for(var l={},c=0;c<10;c++)l["_"+String.fromCharCode(c)]=c;if(Object.getOwnPropertyNames(l).map(function(f){return l[f]}).join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}t.exports=s()?Object.assign:function(d,l){for(var c,u=i(d),f,m=1;m<arguments.length;m++){c=Object(arguments[m]);for(var h in c)n.call(c,h)&&(u[h]=c[h]);if(r){f=r(c);for(var p=0;p<f.length;p++)a.call(c,f[p])&&(u[f[p]]=c[f[p]])}}return u}})),hi=Pe(((e,t)=>{var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r})),ul=Pe(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),Sh=Pe(((e,t)=>{var r=function(){};if(process.env.NODE_ENV!=="production"){var n=hi(),a={},i=ul();r=function(d){var l="Warning: "+d;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function s(d,l,c,u,f){if(process.env.NODE_ENV!=="production"){for(var m in d)if(i(d,m)){var h;try{if(typeof d[m]!="function"){var p=Error((u||"React class")+": "+c+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=d[m](l,m,u,c,null,n)}catch(y){h=y}if(h&&!(h instanceof Error)&&r((u||"React class")+": type specification of "+c+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in a)){a[h.message]=!0;var v=f?f():"";r("Failed "+c+" type: "+h.message+(v??""))}}}}s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},t.exports=s})),xh=Pe(((e,t)=>{var r=cl(),n=Nh(),a=hi(),i=ul(),s=Sh(),d=function(){};process.env.NODE_ENV!=="production"&&(d=function(c){var u="Warning: "+c;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function l(){return null}t.exports=function(c,u){var f=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function h(O){var k=O&&(f&&O[f]||O[m]);if(typeof k=="function")return k}var p="<<anonymous>>",v={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:C(),arrayOf:N,element:b(),elementType:T(),instanceOf:R,node:Q(),objectOf:J,oneOf:G,oneOfType:oe,shape:ge,exact:ne};function y(O,k){return O===k?O!==0||1/O===1/k:O!==O&&k!==k}function $(O,k){this.message=O,this.data=k&&typeof k=="object"?k:{},this.stack=""}$.prototype=Error.prototype;function g(O){if(process.env.NODE_ENV!=="production")var k={},B=0;function q(U,F,w,_,j,D,A){if(_=_||p,D=D||w,A!==a){if(u){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=_+":"+w;!k[le]&&B<3&&(d("You are manually calling a React.PropTypes validation function for the `"+D+"` prop on `"+_+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[le]=!0,B++)}}return F[w]==null?U?F[w]===null?new $("The "+j+" `"+D+"` is marked as required "+("in `"+_+"`, but its value is `null`.")):new $("The "+j+" `"+D+"` is marked as required in "+("`"+_+"`, but its value is `undefined`.")):null:O(F,w,_,j,D)}var L=q.bind(null,!1);return L.isRequired=q.bind(null,!0),L}function x(O){function k(B,q,L,U,F,w){var _=B[q];if(ae(_)!==O){var j=pe(_);return new $("Invalid "+U+" `"+F+"` of type "+("`"+j+"` supplied to `"+L+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return g(k)}function C(){return g(l)}function N(O){function k(B,q,L,U,F){if(typeof O!="function")return new $("Property `"+F+"` of component `"+L+"` has invalid PropType notation inside arrayOf.");var w=B[q];if(!Array.isArray(w)){var _=ae(w);return new $("Invalid "+U+" `"+F+"` of type "+("`"+_+"` supplied to `"+L+"`, expected an array."))}for(var j=0;j<w.length;j++){var D=O(w,j,L,U,F+"["+j+"]",a);if(D instanceof Error)return D}return null}return g(k)}function b(){function O(k,B,q,L,U){var F=k[B];if(!c(F)){var w=ae(F);return new $("Invalid "+L+" `"+U+"` of type "+("`"+w+"` supplied to `"+q+"`, expected a single ReactElement."))}return null}return g(O)}function T(){function O(k,B,q,L,U){var F=k[B];if(!r.isValidElementType(F)){var w=ae(F);return new $("Invalid "+L+" `"+U+"` of type "+("`"+w+"` supplied to `"+q+"`, expected a single ReactElement type."))}return null}return g(O)}function R(O){function k(B,q,L,U,F){if(!(B[q]instanceof O)){var w=O.name||p,_=$e(B[q]);return new $("Invalid "+U+" `"+F+"` of type "+("`"+_+"` supplied to `"+L+"`, expected ")+("instance of `"+w+"`."))}return null}return g(k)}function G(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?d("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):d("Invalid argument supplied to oneOf, expected an array.")),l;function k(B,q,L,U,F){for(var w=B[q],_=0;_<O.length;_++)if(y(w,O[_]))return null;var j=JSON.stringify(O,function(A,K){return pe(K)==="symbol"?String(K):K});return new $("Invalid "+U+" `"+F+"` of value `"+String(w)+"` "+("supplied to `"+L+"`, expected one of "+j+"."))}return g(k)}function J(O){function k(B,q,L,U,F){if(typeof O!="function")return new $("Property `"+F+"` of component `"+L+"` has invalid PropType notation inside objectOf.");var w=B[q],_=ae(w);if(_!=="object")return new $("Invalid "+U+" `"+F+"` of type "+("`"+_+"` supplied to `"+L+"`, expected an object."));for(var j in w)if(i(w,j)){var D=O(w,j,L,U,F+"."+j,a);if(D instanceof Error)return D}return null}return g(k)}function oe(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&d("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var k=0;k<O.length;k++){var B=O[k];if(typeof B!="function")return d("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Oe(B)+" at index "+k+"."),l}function q(L,U,F,w,_){for(var j=[],D=0;D<O.length;D++){var A=O[D],K=A(L,U,F,w,_,a);if(K==null)return null;K.data&&i(K.data,"expectedType")&&j.push(K.data.expectedType)}var le=j.length>0?", expected one of type ["+j.join(", ")+"]":"";return new $("Invalid "+w+" `"+_+"` supplied to "+("`"+F+"`"+le+"."))}return g(q)}function Q(){function O(k,B,q,L,U){return ce(k[B])?null:new $("Invalid "+L+" `"+U+"` supplied to "+("`"+q+"`, expected a ReactNode."))}return g(O)}function fe(O,k,B,q,L){return new $((O||"React class")+": "+k+" type `"+B+"."+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+L+"`.")}function ge(O){function k(B,q,L,U,F){var w=B[q],_=ae(w);if(_!=="object")return new $("Invalid "+U+" `"+F+"` of type `"+_+"` "+("supplied to `"+L+"`, expected `object`."));for(var j in O){var D=O[j];if(typeof D!="function")return fe(L,U,F,j,pe(D));var A=D(w,j,L,U,F+"."+j,a);if(A)return A}return null}return g(k)}function ne(O){function k(B,q,L,U,F){var w=B[q],_=ae(w);if(_!=="object")return new $("Invalid "+U+" `"+F+"` of type `"+_+"` "+("supplied to `"+L+"`, expected `object`."));for(var j in n({},B[q],O)){var D=O[j];if(i(O,j)&&typeof D!="function")return fe(L,U,F,j,pe(D));if(!D)return new $("Invalid "+U+" `"+F+"` key `"+j+"` supplied to `"+L+"`.\nBad object: "+JSON.stringify(B[q],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(O),null," "));var A=D(w,j,L,U,F+"."+j,a);if(A)return A}return null}return g(k)}function ce(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(ce);if(O===null||c(O))return!0;var k=h(O);if(k){var B=k.call(O),q;if(k!==O.entries){for(;!(q=B.next()).done;)if(!ce(q.value))return!1}else for(;!(q=B.next()).done;){var L=q.value;if(L&&!ce(L[1]))return!1}}else return!1;return!0;default:return!1}}function ue(O,k){return O==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function ae(O){var k=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":ue(k,O)?"symbol":k}function pe(O){if(typeof O>"u"||O===null)return""+O;var k=ae(O);if(k==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return k}function Oe(O){var k=pe(O);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function $e(O){return!O.constructor||!O.constructor.name?p:O.constructor.name}return v.checkPropTypes=s,v.resetWarningCache=s.resetWarningCache,v.PropTypes=v,v}})),Ch=Pe(((e,t)=>{var r=hi();function n(){}function a(){}a.resetWarningCache=n,t.exports=function(){function i(l,c,u,f,m,h){if(h!==r){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}i.isRequired=i;function s(){return i}var d={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:a,resetWarningCache:n};return d.PropTypes=d,d}})),_h=Pe(((e,t)=>{if(process.env.NODE_ENV!=="production"){var r=cl(),n=!0;t.exports=xh()(r.isElement,n)}else t.exports=Ch()()})),P=Jt(_h(),1);function rt(e,t,r){this.x=e,this.y=t,this.time=r||new Date().getTime()}rt.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};rt.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};rt.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function mi(e,t,r,n){this.startPoint=e,this.control1=t,this.control2=r,this.endPoint=n}mi.prototype.length=function(){for(var e=10,t=0,r=void 0,n=void 0,a=0;a<=e;a+=1){var i=a/e,s=this._point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),d=this._point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(a>0){var l=s-r,c=d-n;t+=Math.sqrt(l*l+c*c)}r=s,n=d}return t};mi.prototype._point=function(e,t,r,n,a){return t*(1-e)*(1-e)*(1-e)+3*r*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e};function wh(e,t,r){var n,a,i,s=null,d=0;r||(r={});var l=function(){d=r.leading===!1?0:Date.now(),s=null,i=e.apply(n,a),s||(n=a=null)};return function(){var c=Date.now();!d&&r.leading===!1&&(d=c);var u=t-(c-d);return n=this,a=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),d=c,i=e.apply(n,a),s||(n=a=null)):!s&&r.trailing!==!1&&(s=setTimeout(l,u)),i}}function Y(e,t){var r=this,n=t||{};this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle="throttle"in n?n.throttle:16,this.minDistance="minDistance"in n?n.minDistance:5,this.throttle?this._strokeMoveUpdate=wh(Y.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=Y.prototype._strokeUpdate,this.dotSize=n.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.onBegin=n.onBegin,this.onEnd=n.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(a){a.which===1&&(r._mouseButtonDown=!0,r._strokeBegin(a))},this._handleMouseMove=function(a){r._mouseButtonDown&&r._strokeMoveUpdate(a)},this._handleMouseUp=function(a){a.which===1&&r._mouseButtonDown&&(r._mouseButtonDown=!1,r._strokeEnd(a))},this._handleTouchStart=function(a){if(a.targetTouches.length===1){var i=a.changedTouches[0];r._strokeBegin(i)}},this._handleTouchMove=function(a){a.preventDefault();var i=a.targetTouches[0];r._strokeMoveUpdate(i)},this._handleTouchEnd=function(a){a.target===r._canvas&&(a.preventDefault(),r._strokeEnd(a))},this.on()}Y.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0};Y.prototype.fromDataURL=function(e){var t=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new Image,a=r.ratio||window.devicePixelRatio||1,i=r.width||this._canvas.width/a,s=r.height||this._canvas.height/a;this._reset(),n.src=e,n.onload=function(){t._ctx.drawImage(n,0,0,i,s)},this._isEmpty=!1};Y.prototype.toDataURL=function(e){var t;switch(e){case"image/svg+xml":return this._toSVG();default:for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return(t=this._canvas).toDataURL.apply(t,[e].concat(n))}};Y.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()};Y.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)};Y.prototype.isEmpty=function(){return this._isEmpty};Y.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)};Y.prototype._strokeUpdate=function(e){var t=e.clientX,r=e.clientY,n=this._createPoint(t,r),a=this._data[this._data.length-1],i=a&&a[a.length-1],s=i&&n.distanceTo(i)<this.minDistance;if(!(i&&s)){var d=this._addPoint(n),l=d.curve,c=d.widths;l&&c&&this._drawCurve(l,c.start,c.end),this._data[this._data.length-1].push({x:n.x,y:n.y,time:n.time,color:this.penColor})}};Y.prototype._strokeEnd=function(e){var t=this.points.length>2,r=this.points[0];if(!t&&r&&this._drawDot(r),r){var n=this._data[this._data.length-1],a=n[n.length-1];r.equals(a)||n.push({x:r.x,y:r.y,time:r.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};Y.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};Y.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};Y.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};Y.prototype._createPoint=function(e,t,r){var n=this._canvas.getBoundingClientRect();return new rt(e-n.left,t-n.top,r||new Date().getTime())};Y.prototype._addPoint=function(e){var t=this.points,r=void 0;if(t.push(e),t.length>2){t.length===3&&t.unshift(t[0]),r=this._calculateCurveControlPoints(t[0],t[1],t[2]);var n=r.c2;r=this._calculateCurveControlPoints(t[1],t[2],t[3]);var a=r.c1,i=new mi(t[1],n,a,t[2]),s=this._calculateCurveWidths(i);return t.shift(),{curve:i,widths:s}}return{}};Y.prototype._calculateCurveControlPoints=function(e,t,r){var n=e.x-t.x,a=e.y-t.y,i=t.x-r.x,s=t.y-r.y,d={x:(e.x+t.x)/2,y:(e.y+t.y)/2},l={x:(t.x+r.x)/2,y:(t.y+r.y)/2},c=Math.sqrt(n*n+a*a),u=Math.sqrt(i*i+s*s),f=d.x-l.x,m=d.y-l.y,h=u/(c+u),p={x:l.x+f*h,y:l.y+m*h},v=t.x-p.x,y=t.y-p.y;return{c1:new rt(d.x+v,d.y+y),c2:new rt(l.x+v,l.y+y)}};Y.prototype._calculateCurveWidths=function(e){var t=e.startPoint,r=e.endPoint,n={start:null,end:null},a=this.velocityFilterWeight*r.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(a);return n.start=this._lastWidth,n.end=i,this._lastVelocity=a,this._lastWidth=i,n};Y.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};Y.prototype._drawPoint=function(e,t,r){var n=this._ctx;n.moveTo(e,t),n.arc(e,t,r,0,2*Math.PI,!1),this._isEmpty=!1};Y.prototype._drawCurve=function(e,t,r){var n=this._ctx,a=r-t,i=Math.floor(e.length());n.beginPath();for(var s=0;s<i;s+=1){var d=s/i,l=d*d,c=l*d,u=1-d,f=u*u,m=f*u,h=m*e.startPoint.x;h+=3*f*d*e.control1.x,h+=3*u*l*e.control2.x,h+=c*e.endPoint.x;var p=m*e.startPoint.y;p+=3*f*d*e.control1.y,p+=3*u*l*e.control2.y,p+=c*e.endPoint.y;var v=t+c*a;this._drawPoint(h,p,v)}n.closePath(),n.fill()};Y.prototype._drawDot=function(e){var t=this._ctx,r=typeof this.dotSize=="function"?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,r),t.closePath(),t.fill()};Y.prototype._fromData=function(e,t,r){for(var n=0;n<e.length;n+=1){var a=e[n];if(a.length>1)for(var i=0;i<a.length;i+=1){var s=a[i],d=new rt(s.x,s.y,s.time),l=s.color;if(i===0)this.penColor=l,this._reset(),this._addPoint(d);else if(i!==a.length-1){var c=this._addPoint(d),u=c.curve,f=c.widths;u&&f&&t(u,f,l)}}else{this._reset();var m=a[0];r(m)}}};Y.prototype._toSVG=function(){var e=this,t=this._data,r=this._canvas,n=Math.max(window.devicePixelRatio||1,1),a=0,i=0,s=r.width/n,d=r.height/n,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttributeNS(null,"width",r.width),l.setAttributeNS(null,"height",r.height),this._fromData(t,function(y,$,g){var x=document.createElement("path");if(!isNaN(y.control1.x)&&!isNaN(y.control1.y)&&!isNaN(y.control2.x)&&!isNaN(y.control2.y)){var C="M "+y.startPoint.x.toFixed(3)+","+y.startPoint.y.toFixed(3)+" "+("C "+y.control1.x.toFixed(3)+","+y.control1.y.toFixed(3)+" ")+(y.control2.x.toFixed(3)+","+y.control2.y.toFixed(3)+" ")+(y.endPoint.x.toFixed(3)+","+y.endPoint.y.toFixed(3));x.setAttribute("d",C),x.setAttribute("stroke-width",($.end*2.25).toFixed(3)),x.setAttribute("stroke",g),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),l.appendChild(x)}},function(y){var $=document.createElement("circle"),g=typeof e.dotSize=="function"?e.dotSize():e.dotSize;$.setAttribute("r",g),$.setAttribute("cx",y.x),$.setAttribute("cy",y.y),$.setAttribute("fill",y.color),l.appendChild($)});var c="data:image/svg+xml;base64,",u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewBox="'+a+" "+i+" "+s+" "+d+'"')+(' width="'+s+'"')+(' height="'+d+'"')+">",f=l.innerHTML;if(f===void 0){var m=document.createElement("dummy"),h=l.childNodes;m.innerHTML="";for(var p=0;p<h.length;p+=1)m.appendChild(h[p].cloneNode(!0));f=m.innerHTML}var v=u+f+"</svg>";return c+btoa(v)};Y.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,function(r,n){return t._drawCurve(r,n.start,n.end)},function(r){return t._drawDot(r)}),this._data=e};Y.prototype.toData=function(){return this._data};var Eh=Pe(((e,t)=>{(function(r,n){typeof e=="object"&&typeof t=="object"?t.exports=n():typeof define=="function"&&define.amd?define([],n):typeof e=="object"?e.trimCanvas=n():r.trimCanvas=n()})(e,function(){return(function(r){function n(i){if(a[i])return a[i].exports;var s=a[i]={exports:{},id:i,loaded:!1};return r[i].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}var a={};return n.m=r,n.c=a,n.p="",n(0)})([function(r,n){"use strict";function a(c){var u=c.getContext("2d"),f=c.width,m=c.height,h=u.getImageData(0,0,f,m).data,p=d(!0,f,m,h),v=d(!1,f,m,h),y=l(!0,f,m,h),$=l(!1,f,m,h)-y+1,g=v-p+1,x=u.getImageData(y,p,$,g);return c.width=$,c.height=g,u.clearRect(0,0,$,g),u.putImageData(x,0,0),c}function i(c,u,f,m){return{red:m[4*(f*u+c)],green:m[4*(f*u+c)+1],blue:m[4*(f*u+c)+2],alpha:m[4*(f*u+c)+3]}}function s(c,u,f,m){return i(c,u,f,m).alpha}function d(c,u,f,m){for(var h=c?1:-1,p=c?0:f-1;c?p<f:p>-1;p+=h)for(var v=0;v<u;v++)if(s(v,p,u,m))return p;return null}function l(c,u,f,m){for(var h=c?1:-1,p=c?0:u-1;c?p<u:p>-1;p+=h)for(var v=0;v<f;v++)if(s(p,v,u,m))return p;return null}Object.defineProperty(n,"__esModule",{value:!0}),n.default=a}])})})),Ph=Jt(Eh(),1),Oh=["canvasProps","clearOnResize"],_n=(function(e){mh(r,e);var t=gh(r);function r(){var n;hh(this,r);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=t.call.apply(t,[this].concat(i)),n.staticThis=n.constructor,n._sigPad=null,n._canvas=null,n.setRef=function(d){n._canvas=d,n._canvas===null&&(n._sigPad=null)},n._excludeOurProps=function(){var d=n.props;return d.canvasProps,d.clearOnResize,ch(d,Oh)},n.componentDidMount=function(){var d=n.getCanvas();n._sigPad=new Y(d,n._excludeOurProps()),n._resizeCanvas(),n.on()},n.componentWillUnmount=function(){n.off()},n.componentDidUpdate=function(){Object.assign(n._sigPad,n._excludeOurProps())},n.getCanvas=function(){if(n._canvas===null)throw n.staticThis.refNullError;return n._canvas},n.getTrimmedCanvas=function(){var d=n.getCanvas(),l=document.createElement("canvas");return l.width=d.width,l.height=d.height,l.getContext("2d").drawImage(d,0,0),(0,Ph.default)(l)},n.getSignaturePad=function(){if(n._sigPad===null)throw n.staticThis.refNullError;return n._sigPad},n._checkClearOnResize=function(){n.props.clearOnResize&&n._resizeCanvas()},n._resizeCanvas=function(){var d,l,c=(d=n.props.canvasProps)!==null&&d!==void 0?d:{},u=c.width,f=c.height;if(!(typeof u<"u"&&typeof f<"u")){var m=n.getCanvas(),h=Math.max((l=window.devicePixelRatio)!==null&&l!==void 0?l:1,1);typeof u>"u"&&(m.width=m.offsetWidth*h),typeof f>"u"&&(m.height=m.offsetHeight*h),m.getContext("2d").scale(h,h),n.clear()}},n.render=function(){var d=n.props.canvasProps;return S.default.createElement("canvas",Ea({ref:n.setRef},d))},n.on=function(){return window.addEventListener("resize",n._checkClearOnResize),n.getSignaturePad().on()},n.off=function(){return window.removeEventListener("resize",n._checkClearOnResize),n.getSignaturePad().off()},n.clear=function(){return n.getSignaturePad().clear()},n.isEmpty=function(){return n.getSignaturePad().isEmpty()},n.fromDataURL=function(d,l){return n.getSignaturePad().fromDataURL(d,l)},n.toDataURL=function(d,l){return n.getSignaturePad().toDataURL(d,l)},n.fromData=function(d){return n.getSignaturePad().fromData(d)},n.toData=function(){return n.getSignaturePad().toData()},n}return ph(r)})(S.Component);_n.propTypes={velocityFilterWeight:P.default.number,minWidth:P.default.number,maxWidth:P.default.number,minDistance:P.default.number,dotSize:P.default.oneOfType([P.default.number,P.default.func]),penColor:P.default.string,throttle:P.default.number,onEnd:P.default.func,onBegin:P.default.func,canvasProps:P.default.object,clearOnResize:P.default.bool};_n.defaultProps={clearOnResize:!0};_n.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");var jh=({onClose:e,onConfirm:t,enforcement:r,heading:n,consent:a})=>{const i=(0,S.useRef)(null),{register:s,handleSubmit:d,control:l,reset:c,watch:u,setValue:f,formState:{errors:m,isSubmitting:h}}=(0,Ue.useForm)({defaultValues:{accepted:!1,typedName:"",signatureDataUrl:"",emailMe:!1},mode:"onChange"}),p=u("accepted"),v=u("typedName"),y=u("signatureDataUrl"),$=()=>{c(),r==="DRAW_SIGNATURE"&&i.current?.clear()},g=()=>{$(),e()},x=()=>{i.current?.clear(),f("signatureDataUrl","")},C=b=>{let T="";if(r==="DRAW_SIGNATURE"){const R=i.current;if(R&&!R.isEmpty())T=R.getCanvas().toDataURL("image/png");else return}t({accepted:r==="CHECKBOX_ONLY"?b.accepted:!1,typedName:r==="TYPED_NAME"?b.typedName.trim():"",signatureDataUrl:T,emailMe:b.emailMe}),$(),e()},N=!h&&(r==="CHECKBOX_ONLY"?p:r==="TYPED_NAME"?v?.trim().length>2:r==="DRAW_SIGNATURE"?!!y:!1);return(0,o.jsxs)("div",{className:"aaravpos-consent-overlay",children:[(0,o.jsx)("div",{className:"aaravpos-consent-backdrop"}),(0,o.jsxs)("div",{className:"aaravpos-consent-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-consent-header",children:[(0,o.jsx)("h3",{className:"aaravpos-consent-title",children:n||"Consent Form"}),(0,o.jsx)("button",{onClick:g,className:"aaravpos-consent-close-btn",children:(0,o.jsx)(Ye,{})})]}),(0,o.jsx)("div",{className:"aaravpos-consent-content-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-consent-content-box",children:(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:a},className:"aaravpos-consent-content"})})}),(0,o.jsxs)("form",{onSubmit:d(C),children:[r==="CHECKBOX_ONLY"&&(0,o.jsxs)("label",{className:"aaravpos-consent-checkbox-label",htmlFor:"accepted",children:[(0,o.jsx)("input",{type:"checkbox",...s("accepted",{required:"You must accept terms"}),id:"accepted",className:"aaravpos-consent-checkbox"}),(0,o.jsx)("span",{className:"aaravpos-consent-checkbox-text",children:"I have read and agree to the terms above"})]}),r==="TYPED_NAME"&&(0,o.jsxs)("div",{className:"aaravpos-consent-typed-wrapper",children:[(0,o.jsxs)("label",{className:"aaravpos-consent-input-label",htmlFor:"typedName",children:["Full Name",(0,o.jsx)("span",{className:"aaravpos-consent-required",children:"*"})]}),(0,o.jsx)("input",{...s("typedName",{required:"Name is required",validate:b=>b.trim().length>2||"Enter full name"}),id:"typedName",placeholder:"Type your full name",className:`aaravpos-consent-input ${m.typedName?"aaravpos-consent-input-error":"aaravpos-consent-input-normal"}`}),(0,o.jsx)("p",{className:"aaravpos-consent-helper-text",children:"By typing your name, you agree to the consent above"}),m.typedName&&(0,o.jsx)("p",{className:"aaravpos-consent-error",children:m.typedName.message})]}),r==="DRAW_SIGNATURE"&&(0,o.jsx)(Ue.Controller,{control:l,name:"signatureDataUrl",rules:{validate:()=>i.current&&!i.current.isEmpty()?!0:"Signature required"},render:({field:b})=>(0,o.jsxs)("div",{className:"aaravpos-consent-signature-wrapper",children:[(0,o.jsx)(_n,{ref:i,canvasProps:{className:"aaravpos-consent-signature-canvas"},onEnd:()=>{const T=i.current;if(!T)return;const R=T.getCanvas().toDataURL("image/png");b.onChange(R)}}),m.signatureDataUrl&&(0,o.jsx)("p",{className:"aaravpos-consent-error aaravpos-consent-error-signature",children:m.signatureDataUrl.message}),(0,o.jsxs)("div",{className:"aaravpos-consent-signature-actions",children:[(0,o.jsxs)("button",{type:"button",onClick:x,className:"aaravpos-consent-clear-btn",children:[(0,o.jsx)(xp,{size:14}),"Clear"]}),(0,o.jsxs)("label",{className:"aaravpos-consent-email-label",htmlFor:"emailme",children:[(0,o.jsx)("input",{type:"checkbox",...s("emailMe"),id:"emailme",className:"aaravpos-consent-email-checkbox"}),(0,o.jsx)("span",{className:"aaravpos-consent-email-text",children:"Email me"})]})]})]})}),(0,o.jsxs)("div",{className:"aaravpos-consent-footer",children:[(0,o.jsx)("button",{type:"button",onClick:g,className:"aaravpos-consent-cancel-btn",children:"Cancel"}),(0,o.jsxs)("button",{type:"submit",disabled:!N,className:`aaravpos-consent-submit-btn ${N?"aaravpos-consent-submit-active":"aaravpos-consent-submit-disabled"}`,children:[(0,o.jsx)(ci,{}),r==="DRAW_SIGNATURE"||r==="TYPED_NAME"?"Sign & Continue":"I Agree"]})]})]})]})]})},fl={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-579]|61)","5(?:[0-579]|61[06])","5(?:[0-579]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}},Th=Pe(((e,t)=>{(function(){"use strict";var r={}.hasOwnProperty;function n(){for(var s="",d=0;d<arguments.length;d++){var l=arguments[d];l&&(s=i(s,a(l)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var d="";for(var l in s)r.call(s,l)&&s[l]&&(d=i(d,l));return d}function i(s,d){return d?s?s+" "+d:s+d:s}typeof t<"u"&&t.exports?(n.default=n,t.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()}));function Ah(e,t,r){switch(r){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1);break}return{value:e,caret:t}}function Ih(e,t,r){for(var n={},a="",i=0,s=0;s<e.length;){var d=r(e[s],a,n);d!==void 0&&(a+=d,t!==void 0&&(t===s?i=a.length-1:t>s&&(i=a.length))),s++}return t===void 0&&(i=a.length),{value:a,caret:i}}function kh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Rh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rh(e,t){if(e){if(typeof e=="string")return Co(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Co(e,t)}}function Co(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oa(e,t){for(var r=0,n=kh(t.split("")),a;!(a=n()).done;)a.value===e&&r++;return r}function Dh(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"x",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",a=e.length,i=Oa("(",e)-Oa(")",e);i>0&&a<t.length;)e+=t[a].replace(r,n),t[a]===")"&&i--,a++;return e}function Mh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Fh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fh(e,t){if(e){if(typeof e=="string")return _o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _o(e,t)}}function _o(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",r=arguments.length>2?arguments[2]:void 0;if(!e)return function(a){return{text:a}};var n=Oa(t,e);return function(a){if(!a)return{text:"",template:e};for(var i=0,s="",d=Mh(e.split("")),l;!(l=d()).done;){var c=l.value;if(c!==t){s+=c;continue}if(s+=a[i],i++,i===a.length&&a.length<n)break}return r&&(s=Dh(s,e)),{text:s,template:e}}}function Bh(e,t,r){typeof r=="string"&&(r=Lh(r));var n=r(e)||{},a=n.text,i=n.template;if(a===void 0&&(a=e),i)if(t===void 0)t=a.length;else{for(var s=0,d=!1,l=-1;s<a.length&&s<i.length;){if(a[s]!==i[s]){if(t===0){d=!0,t=s;break}l=s,t--}s++}d||(t=l+1)}return{text:a,caret:t}}function Uh(e){return e.hasAttribute("readonly")}function Vh(e){if(e.selectionStart!==e.selectionEnd)return{start:e.selectionStart,end:e.selectionEnd}}var wo={Backspace:8,Delete:46};function zh(e){switch(e.keyCode){case wo.Backspace:return"Backspace";case wo.Delete:return"Delete"}}function qh(e){return e.selectionStart}function pl(e,t){t!==void 0&&(Wh()?setTimeout(function(){return e.setSelectionRange(t,t)},0):e.setSelectionRange(t,t))}function Wh(){if(typeof navigator<"u")return Gh.test(navigator.userAgent)}var Gh=/Android/i;function Hh(e,t,r,n,a){ja(t,r,n,void 0,a)}function Kh(e,t,r,n,a){if(!Uh(t)){var i=zh(e);switch(i){case"Delete":case"Backspace":e.preventDefault();var s=Vh(t);return s?(Yh(t,s),ja(t,r,n,void 0,a)):ja(t,r,n,i,a);default:}}}function Yh(e,t){var r=e.value;r=r.slice(0,t.start)+r.slice(t.end),e.value=r,pl(e,t.start)}function ja(e,t,r,n,a){var i=Ih(e.value,qh(e),t),s=i.value,d=i.caret;if(n){var l=Ah(s,d,n);s=l.value,d=l.caret}var c=Bh(s,d,r),u=c.text;d=c.caret,e.value=u,pl(e,d),a&&a(s)}var Xh=["ref","parse","format","value","defaultValue","controlled","onChange","onKeyDown"];function Eo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Eo(Object(r),!0).forEach(function(n){Zh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jh(e,t){if(e==null)return{};var r=Qh(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qh(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function e1(e){var t=e.ref,r=e.parse,n=e.format,a=e.value,i=e.defaultValue,s=e.controlled,d=s===void 0?!0:s,l=e.onChange,c=e.onKeyDown,u=Jh(e,Xh),f=(0,S.useRef)(),m=(0,S.useCallback)(function(y){f.current=y,t&&(typeof t=="function"?t(y):t.current=y)},[t]),h=(0,S.useCallback)(function(y){return Hh(y,f.current,r,n,l)},[f,r,n,l]),p=(0,S.useCallback)(function(y){if(c&&c(y),!y.defaultPrevented)return Kh(y,f.current,r,n,l)},[f,r,n,l,c]),v=ot(ot({},u),{},{ref:m,onChange:h,onKeyDown:p});return d?ot(ot({},v),{},{value:n(Po(a)?"":a).text}):ot(ot({},v),{},{defaultValue:n(Po(i)?"":i).text})}function Po(e){return e==null}var t1=["inputComponent","parse","format","value","defaultValue","onChange","controlled","onKeyDown","type"];function Oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oo(Object(r),!0).forEach(function(n){n1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a1(e,t){if(e==null)return{};var r=i1(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function i1(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function en(e,t){var r=e.inputComponent,n=r===void 0?"input":r,a=e.parse,i=e.format,s=e.value,d=e.defaultValue,l=e.onChange,c=e.controlled,u=e.onKeyDown,f=e.type,m=f===void 0?"text":f,h=a1(e,t1),p=e1(r1({ref:t,parse:a,format:i,value:s,defaultValue:d,onChange:l,controlled:c,onKeyDown:u,type:m},h));return S.default.createElement(n,p)}en=S.default.forwardRef(en);en.propTypes={parse:P.default.func.isRequired,format:P.default.func.isRequired,inputComponent:P.default.elementType,type:P.default.string,value:P.default.string,defaultValue:P.default.string,onChange:P.default.func,controlled:P.default.bool,onKeyDown:P.default.func,onCut:P.default.func,onPaste:P.default.func};var o1=en;function jo(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),a=0;a<3;a++){var i=Number(r[a]),s=Number(n[a]);if(i>s)return 1;if(s>i)return-1;if(!isNaN(i)&&isNaN(s))return 1;if(isNaN(i)&&!isNaN(s))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var s1={}.constructor;function et(e){return e!=null&&e.constructor===s1}function bt(e){"@babel/helpers - typeof";return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(e)}function wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function To(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d1(n.key),n)}}function En(e,t,r){return t&&To(e.prototype,t),r&&To(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d1(e){var t=l1(e,"string");return bt(t)=="symbol"?t:t+""}function l1(e,t){if(bt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c1="1.2.0",u1="1.7.35",Ao=" ext. ",f1=/^\d+$/,de=(function(){function e(t){wn(this,e),hl(t),this.metadata=t,vl.call(this,t)}return En(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(r){return r!=="001"})}},{key:"getCountryMetadata",value:function(r){return this.metadata.countries[r]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(r){return this.getCountryMetadata(r)!==void 0}},{key:"hasCallingCode",value:function(r){if(this.getCountryCodesForCallingCode(r))return!0;if(this.nonGeographic()){if(this.nonGeographic()[r])return!0}else{var n=this.countryCallingCodes()[r];if(n&&n.length===1&&n[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(r){return this.nonGeographic()?!!this.nonGeographic()[r]:!this.getCountryCodesForCallingCode(r)}},{key:"country",value:function(r){return this.selectNumberingPlan(r)}},{key:"selectNumberingPlan",value:function(r,n){if(r&&f1.test(r)&&(n=r,r=null),r&&r!=="001"){if(!this.hasCountry(r))throw new Error("Unknown country: ".concat(r));this.numberingPlan=new Io(this.getCountryMetadata(r),this)}else if(n){if(!this.hasCallingCode(n))throw new Error("Unknown calling code: ".concat(n));this.numberingPlan=new Io(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(r){var n=this.countryCallingCodes()[r];if(n)return n.length===1&&n[0].length===3?void 0:n}},{key:"getCountryCodeForCallingCode",value:function(r){var n=this.getCountryCodesForCallingCode(r);if(n)return n[0]}},{key:"getNumberingPlanMetadata",value:function(r){var n=this.getCountryCodeForCallingCode(r);if(n)return this.getCountryMetadata(n);if(this.nonGeographic()){var a=this.nonGeographic()[r];if(a)return a}else{var i=this.countryCallingCodes()[r];if(i&&i.length===1&&i[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(r){return this.numberingPlan.type(r)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(r){return this.selectNumberingPlan(r)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),Io=(function(){function e(t,r){wn(this,e),this.globalMetadataObject=r,this.metadata=t,vl.call(this,r.metadata)}return En(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(r){return r[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var r=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(n){return new p1(n,r)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(r){return r[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(r){if(this.hasTypes()&&ko(this.types(),r))return new m1(ko(this.types(),r),this)}},{key:"ext",value:function(){return this.v1||this.v2?Ao:this.metadata[13]||Ao}}])})(),p1=(function(){function e(t,r){wn(this,e),this._format=t,this.metadata=r}return En(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!h1.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),h1=/^\(?\$1\)?$/,m1=(function(){function e(t,r){wn(this,e),this.type=t,this.metadata=r}return En(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function ko(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function hl(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!et(e)||!et(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(et(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+v1(e)+": "+e,"."))}var v1=function(t){return bt(t)};function Xe(e,t){if(t=new de(t),t.hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function ml(e,t){return t.countries.hasOwnProperty(e)}function vl(e){var t=e.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?jo(t,c1)===-1?this.v2=!0:jo(t,u1)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function y1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=g1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g1(e,t){if(e){if(typeof e=="string")return Ro(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ro(e,t):void 0}}function Ro(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function $1(e,t){for(var r=e.slice(),n=y1(t),a;!(a=n()).done;){var i=a.value;e.indexOf(i)<0&&r.push(i)}return r.sort(function(s,d){return s-d})}function Pn(e,t,r){return yl(e,t,void 0,r)}function yl(e,t,r,n){t&&(n=new de(n.metadata),n.selectNumberingPlan(t));var a=n.type(r),i=a&&a.possibleLengths()||n.possibleLengths();if(!i)return"IS_POSSIBLE";if(r==="FIXED_LINE_OR_MOBILE"){if(!n.type("FIXED_LINE"))return yl(e,t,"MOBILE",n);var s=n.type("MOBILE");s&&(i=$1(i,s.possibleLengths()))}else if(r&&!a)return"INVALID_LENGTH";var d=e.length,l=i[0];return l===d?"IS_POSSIBLE":l>d?"TOO_SHORT":i[i.length-1]<d?"TOO_LONG":i.indexOf(d,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function b1(e,t,r){if(t===void 0&&(t={}),r=new de(r),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return gl(e.phone||e.nationalNumber,e.country,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function gl(e,t,r){return Pn(e,t,r)==="IS_POSSIBLE"}function ze(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function N1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=S1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S1(e,t){if(e){if(typeof e=="string")return Do(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Do(e,t):void 0}}function Do(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var x1=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function vi(e,t,r){if(t=t||{},!(!e.country&&!e.countryCallingCode)){r=new de(r),r.selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(ze(n,r.nationalNumberPattern())){if(Qn(n,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||Qn(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var a=N1(x1),i;!(i=a()).done;){var s=i.value;if(Qn(n,s,r))return s}}}}function Qn(e,t,r){var n=r.type(t);return!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(e.length)<0?!1:ze(e,n.pattern())}function C1(e,t,r){return t=t||{},r=new de(r),r.selectNumberingPlan(e.country,e.countryCallingCode),r.hasTypes()?vi(e,t,r.metadata)!==void 0:ze(t.v2?e.nationalNumber:e.phone,r.nationalNumberPattern())}function _1(e,t,r){var n=new de(r).getCountryCodesForCallingCode(e);return n?n.filter(function(a){return w1(t,a,r)}):[]}function w1(e,t,r){var n=new de(r);return n.selectNumberingPlan(t),n.numberingPlan.possibleLengths().indexOf(e.length)>=0}var ye="0-90-9٠-٩۰-۹",E1="-‐-―−ー-",P1="//",O1="..",j1="  ­​⁠ ",T1="()()[]\\[\\]",A1="~⁓∼~",ke="".concat(E1).concat(P1).concat(O1).concat(j1).concat(T1).concat(A1),On="++",I1=new RegExp("(["+ye+"])");function $l(e,t,r,n){if(t){var a=new de(n);a.selectNumberingPlan(t,r);var i=new RegExp(a.IDDPrefix());if(e.search(i)===0){e=e.slice(e.match(i)[0].length);var s=e.match(I1);if(!(s&&s[1]!=null&&s[1].length>0&&s[1]==="0"))return e}}}function Ta(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var a,i,s=n.length-1,d=s>0&&n[s];if(t.nationalPrefixTransformRule()&&d)a=e.replace(r,t.nationalPrefixTransformRule()),s>1&&(i=n[1]);else{var l=n[0];a=e.slice(l.length),d&&(i=n[1])}var c;if(d){var u=e.indexOf(n[1]);e.slice(0,u)===t.numberingPlan.nationalPrefix()&&(c=t.numberingPlan.nationalPrefix())}else c=n[0];return{nationalNumber:a,nationalPrefix:c,carrierCode:i}}}return{nationalNumber:e}}function k1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=R1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R1(e,t){if(e){if(typeof e=="string")return Mo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mo(e,t):void 0}}function Mo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function bl(e,t){var r=t.countries,n=t.metadata;n=new de(n);for(var a=k1(r),i;!(i=a()).done;){var s=i.value;if(n.selectNumberingPlan(s),n.leadingDigits()){if(e&&e.search(n.leadingDigits())===0)return s}else if(vi({phone:e,country:s},void 0,n.metadata))return s}}var D1=!1;function yi(e,t){var r=t.nationalNumber,n=t.metadata;if(D1&&n.isNonGeographicCallingCode(e))return"001";var a=n.getCountryCodesForCallingCode(e);if(a)return a.length===1?a[0]:bl(r,{countries:a,metadata:n.metadata})}function Aa(e,t,r){var n=Ta(e,r),a=n.carrierCode,i=n.nationalNumber;if(i!==e){if(!M1(e,i,r))return{nationalNumber:e};if(r.numberingPlan.possibleLengths()&&(t||(t=yi(r.numberingPlan.callingCode(),{nationalNumber:i,metadata:r})),!F1(i,t,r)))return{nationalNumber:e}}return{nationalNumber:i,carrierCode:a}}function M1(e,t,r){return!(ze(e,r.nationalNumberPattern())&&!ze(t,r.nationalNumberPattern()))}function F1(e,t,r){switch(Pn(e,t,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Nl(e,t,r,n,a){var i=t||r?Xe(t||r,a):n;if(e.indexOf(i)===0){a=new de(a),a.selectNumberingPlan(t||r,i);var s=e.slice(i.length),d=Aa(s,t,a).nationalNumber,l=Aa(e,t,a).nationalNumber;if(!ze(l,a.nationalNumberPattern())&&ze(d,a.nationalNumberPattern())||Pn(l,t,a)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:e}}function gi(e,t,r,n,a){if(!e)return{};var i;if(e[0]!=="+"){var s=$l(e,t||r,n,a);if(s&&s!==e)i=!0,e="+"+s;else{if(t||r||n){var d=Nl(e,t,r,n,a),l=d.countryCallingCode,c=d.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:c}}return{number:e}}}if(e[1]==="0")return{};a=new de(a);for(var u=2;u-1<=3&&u<=e.length;){var f=e.slice(1,u);if(a.hasCallingCode(f))return a.selectNumberingPlan(f),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:e.slice(u)};u++}return{}}function Sl(e){return e.replace(new RegExp("[".concat(ke,"]+"),"g")," ").trim()}var xl=/(\$\d)/;function Cl(e,t,r){var n=r.useInternationalFormat,a=r.withNationalPrefix;r.carrierCode,r.metadata;var i=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(xl,t.nationalPrefixFormattingRule()):t.format());return n?Sl(i):i}var L1=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function B1(e,t,r){var n=new de(r);if(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(L1.test(n.IDDPrefix()))return n.IDDPrefix()}var U1=";ext=",st=function(t){return"([".concat(ye,"]{1,").concat(t,"})")};function _l(e){var t="20",r="15",n="9",a="6",i="[  \\t,]*",s="[:\\..]?[  \\t,-]*",d="#?",l="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",c="(?:[xx##~~]|int|int)",u="[- ]+",f="[  \\t]*",m="(?:,{2}|;)",h=U1+st(t),p=i+l+s+st(t)+d,v=i+c+s+st(n)+d,y=u+st(a)+"#",$=f+m+s+st(r)+d,g=f+"(?:,)+"+s+st(n)+d;return h+"|"+p+"|"+v+"|"+y+"|"+$+"|"+g}var V1="["+ye+"]{2}",z1="["+On+"]{0,1}(?:["+ke+"]*["+ye+"]){3,}["+ke+ye+"]*",q1=new RegExp("^["+On+"]{0,1}(?:["+ke+"]*["+ye+"]){1,2}$","i"),W1=z1+"(?:"+_l()+")?",G1=new RegExp("^"+V1+"$|^"+W1+"$","i");function H1(e){return e.length>=2&&G1.test(e)}function K1(e){return q1.test(e)}function Y1(e){var t=e.number,r=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}var Fo={formatExtension:function(t,r,n){return"".concat(t).concat(n.ext()).concat(r)}};function X1(e,t,r,n){if(r?r=Q1({},Fo,r):r=Fo,n=new de(n),e.country&&e.country!=="001"){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else if(e.countryCallingCode)n.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var a=n.countryCallingCode(),i=r.v2?e.nationalNumber:e.phone,s;switch(t){case"NATIONAL":return i?(s=tn(i,e.carrierCode,"NATIONAL",n,r),ea(s,e.ext,n,r.formatExtension)):"";case"INTERNATIONAL":return i?(s=tn(i,null,"INTERNATIONAL",n,r),s="+".concat(a," ").concat(s),ea(s,e.ext,n,r.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(i);case"RFC3966":return Y1({number:"+".concat(a).concat(i),ext:e.ext});case"IDD":if(!r.fromCountry)return;var d=J1(i,e.carrierCode,a,r.fromCountry,n);return d?ea(d,e.ext,n,r.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function tn(e,t,r,n,a){var i=Z1(n.formats(),e);return i?Cl(e,i,{useInternationalFormat:r==="INTERNATIONAL",withNationalPrefix:!(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1),carrierCode:t,metadata:n}):e}function Z1(e,t){return em(e,function(r){if(r.leadingDigitsPatterns().length>0){var n=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(t.search(n)!==0)return!1}return ze(t,r.pattern())})}function ea(e,t,r,n){return t?n(e,t,r):e}function J1(e,t,r,n,a){if(Xe(n,a.metadata)===r){var i=tn(e,t,"NATIONAL",a);return r==="1"?r+" "+i:i}var s=B1(n,void 0,a.metadata);if(s)return"".concat(s," ").concat(r," ").concat(tn(e,null,"INTERNATIONAL",a))}function Q1(){for(var e=1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;e<r.length;){if(r[e])for(var a in r[e])r[0][a]=r[e][a];e++}return r[0]}function em(e,t){for(var r=0;r<e.length;){if(t(e[r]))return e[r];r++}}function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lo(Object(r),!0).forEach(function(n){tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tm(e,t,r){return(t=wl(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wl(n.key),n)}}function nm(e,t,r){return t&&Uo(e.prototype,t),r&&Uo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wl(e){var t=am(e,"string");return Ft(t)=="symbol"?t:t+""}function am(e,t){if(Ft(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var im=!1,El=(function(){function e(t,r,n){if(rm(this,e),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!r)throw new TypeError("`metadata` argument not passed");if(et(r)&&et(r.countries)){n=r;var a=t;if(!dm.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var i=gi(a,void 0,void 0,void 0,n),s=i.countryCallingCode;if(r=i.number,t=s,!r)throw new Error("Invalid `number` argument passed: too short")}if(!r)throw new TypeError("`nationalNumber` argument is required");if(typeof r!="string")throw new TypeError("`nationalNumber` argument must be a string");hl(n);var d=sm(t,n),l=d.country,c=d.countryCallingCode;this.country=l,this.countryCallingCode=c,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return nm(e,[{key:"setExt",value:function(r){this.ext=r}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:_1(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return b1(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return C1(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new de(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(r){return this.number===r.number&&this.ext===r.ext}},{key:"getType",value:function(){return vi(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(r,n){return X1(this,r,n?Bo(Bo({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(r){return this.format("NATIONAL",r)}},{key:"formatInternational",value:function(r){return this.format("INTERNATIONAL",r)}},{key:"getURI",value:function(r){return this.format("RFC3966",r)}}])})(),om=function(t){return/^[A-Z]{2}$/.test(t)};function sm(e,t){var r,n,a=new de(t);return om(e)?(r=e,a.selectNumberingPlan(r),n=a.countryCallingCode()):(n=e,im&&a.isNonGeographicCallingCode(n)&&(r="001")),{country:r,countryCallingCode:n}}var dm=/^\+\d+$/;function Nt(e){"@babel/helpers - typeof";return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(e)}function Vo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cm(n.key),n)}}function lm(e,t,r){return t&&Vo(e.prototype,t),r&&Vo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cm(e){var t=um(e,"string");return Nt(t)=="symbol"?t:t+""}function um(e,t){if(Nt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pm(e,t,r){return t=Bt(t),hm(e,$i()?Reflect.construct(t,r||[],Bt(e).constructor):t.apply(e,r))}function hm(e,t){if(t&&(Nt(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mm(e)}function mm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lt(e,t)}function Ia(e){var t=typeof Map=="function"?new Map:void 0;return Ia=function(n){if(n===null||!gm(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,a)}function a(){return ym(n,arguments,Bt(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Lt(a,n)},Ia(e)}function ym(e,t,r){if($i())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var a=new(e.bind.apply(e,n));return r&&Lt(a,r.prototype),a}function $i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($i=function(){return!!e})()}function gm(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function Lt(e,t){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Lt(e,t)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(e)}var Be=(function(e){function t(r){var n;return fm(this,t),n=pm(this,t,[r]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return vm(t,e),lm(t)})(Ia(Error)),zo=new RegExp("(?:"+_l()+")$","i");function $m(e){var t=e.search(zo);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(zo),a=1;a<n.length;){if(n[a])return{number:r,ext:n[a]};a++}}function bm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Nm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nm(e,t){if(e){if(typeof e=="string")return qo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qo(e,t):void 0}}function qo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Sm={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Pl(e){return Sm[e]}function rn(e){for(var t="",r=bm(e.split("")),n;!(n=r()).done;){var a=n.value,i=Pl(a);i&&(t+=i)}return t}function xm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Cm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cm(e,t){if(e){if(typeof e=="string")return Wo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wo(e,t):void 0}}function Wo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ka(e){for(var t="",r=xm(e.split("")),n;!(n=r()).done;){var a=n.value;t+=Ol(a,t)||""}return t}function Ol(e,t,r){if(e==="+"){if(t){typeof r=="function"&&r("end");return}return"+"}return Pl(e)}var Go="(["+ye+"]|[\\-\\.\\(\\)]?)",_m="^\\+"+Go+"*["+ye+"]"+Go+"*$",wm=new RegExp(_m,"g"),Ra=ye,Em="["+Ra+"]+((\\-)*["+Ra+"])*",Pm="[a-zA-Z]+((\\-)*["+Ra+"])*",Om="^("+Em+"\\.)*"+Pm+"\\.?$",jm=new RegExp(Om,"g"),Ho="tel:",Da=";phone-context=",Tm=";isub=";function Am(e){var t=e.indexOf(Da);if(t<0)return null;var r=t+Da.length;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function Im(e){return e===null?!0:e.length===0?!1:wm.test(e)||jm.test(e)}function km(e,t){var r=t.extractFormattedPhoneNumber,n=Am(e);if(!Im(n))throw new Be("NOT_A_NUMBER");var a;if(n===null)a=r(e)||"";else{a="",n.charAt(0)==="+"&&(a+=n);var i=e.indexOf(Ho),s;i>=0?s=i+Ho.length:s=0;var d=e.indexOf(Da);a+=e.substring(s,d)}var l=a.indexOf(Tm);if(l>0&&(a=a.substring(0,l)),a!=="")return a}var Rm=250,Dm=new RegExp("["+On+ye+"]"),Mm=new RegExp("[^"+ye+"#]+$"),Fm=!1;function Lm(e,t,r){if(t=t||{},r=new de(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new Be("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var n=Um(e,t.v2,t.extract),a=n.number,i=n.ext,s=n.error;if(!a){if(t.v2)throw s==="TOO_SHORT"?new Be("TOO_SHORT"):new Be("NOT_A_NUMBER");return{}}var d=zm(a,t.defaultCountry,t.defaultCallingCode,r),l=d.country,c=d.nationalNumber,u=d.countryCallingCode,f=d.countryCallingCodeSource,m=d.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Be("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new Be("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new Be("TOO_LONG");return{}}if(t.v2){var h=new El(u,c,r.metadata);return l&&(h.country=l),m&&(h.carrierCode=m),i&&(h.ext=i),h.__countryCallingCodeSource=f,h}var p=(t.extended?r.hasSelectedNumberingPlan():l)?ze(c,r.nationalNumberPattern()):!1;return t.extended?{country:l,countryCallingCode:u,carrierCode:m,valid:p,possible:p?!0:!!(t.extended===!0&&r.possibleLengths()&&gl(c,l,r)),phone:c,ext:i}:p?Vm(l,c,i):{}}function Bm(e,t,r){if(e){if(e.length>Rm){if(r)throw new Be("TOO_LONG");return}if(t===!1)return e;var n=e.search(Dm);if(!(n<0))return e.slice(n).replace(Mm,"")}}function Um(e,t,r){var n=km(e,{extractFormattedPhoneNumber:function(s){return Bm(s,r,t)}});if(!n)return{};if(!H1(n))return K1(n)?{error:"TOO_SHORT"}:{};var a=$m(n);return a.ext?a:{number:n}}function Vm(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function zm(e,t,r,n){var a=gi(ka(e),void 0,t,r,n.metadata),i=a.countryCallingCodeSource,s=a.countryCallingCode,d=a.number,l;if(s)n.selectNumberingPlan(s);else if(d&&(t||r))n.selectNumberingPlan(t,r),t?l=t:Fm&&n.isNonGeographicCallingCode(r)&&(l="001"),s=r||Xe(t,n.metadata);else return{};if(!d)return{countryCallingCodeSource:i,countryCallingCode:s};var c=Aa(ka(d),l,n),u=c.nationalNumber,f=c.carrierCode,m=yi(s,{nationalNumber:u,metadata:n});return m&&(l=m,m==="001"||n.selectNumberingPlan(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:i,nationalNumber:u,carrierCode:f}}function Ut(e){"@babel/helpers - typeof";return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(e)}function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ko(Object(r),!0).forEach(function(n){qm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qm(e,t,r){return(t=Wm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wm(e){var t=Gm(e,"string");return Ut(t)=="symbol"?t:t+""}function Gm(e,t){if(Ut(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ut(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hm(e,t,r){return Lm(e,Yo(Yo({},t),{},{v2:!0}),r)}function Vt(e){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(e)}function Xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Km(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xo(Object(r),!0).forEach(function(n){Ym(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ym(e,t,r){return(t=Xm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xm(e){var t=Zm(e,"string");return Vt(t)=="symbol"?t:t+""}function Zm(e,t){if(Vt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jm(e,t){return r2(e)||t2(e,t)||e2(e,t)||Qm()}function Qm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e2(e,t){if(e){if(typeof e=="string")return Zo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zo(e,t):void 0}}function Zo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function r2(e){if(Array.isArray(e))return e}function jl(e){var t=Jm(Array.prototype.slice.call(e),4),r=t[0],n=t[1],a=t[2],i=t[3],s,d,l;if(typeof r=="string")s=r;else throw new TypeError("A text for parsing must be a string.");if(!n||typeof n=="string")i?(d=a,l=i):(d=void 0,l=a),n&&(d=Km({defaultCountry:n},d));else if(et(n))a?(d=n,l=a):l=n;else throw new Error("Invalid second argument: ".concat(n));return{text:s,options:d,metadata:l}}function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jo(Object(r),!0).forEach(function(n){n2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n2(e,t,r){return(t=a2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a2(e){var t=i2(e,"string");return zt(t)=="symbol"?t:t+""}function i2(e,t){if(zt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tl(e,t,r){t&&t.defaultCountry&&!ml(t.defaultCountry,r)&&(t=Qo(Qo({},t),{},{defaultCountry:void 0}));try{return Hm(e,t,r)}catch(n){if(!(n instanceof Be))throw n}}function o2(){var e=jl(arguments),t=e.text,r=e.options,n=e.metadata;return Tl(t,r,n)}function qt(e){"@babel/helpers - typeof";return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(e)}function es(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ts(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?es(Object(r),!0).forEach(function(n){s2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):es(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function s2(e,t,r){return(t=d2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d2(e){var t=l2(e,"string");return qt(t)=="symbol"?t:t+""}function l2(e,t){if(qt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c2(){var e=jl(arguments),t=e.text,r=e.options,n=e.metadata;r=ts(ts({},r),{},{extract:!1});var a=Tl(t,r,n);return a&&a.isValid()||!1}function Wt(e){"@babel/helpers - typeof";return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(e)}function u2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p2(n.key),n)}}function f2(e,t,r){return t&&rs(e.prototype,t),r&&rs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p2(e){var t=h2(e,"string");return Wt(t)=="symbol"?t:t+""}function h2(e,t){if(Wt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Wt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var m2=(function(){function e(t){var r=t.onCountryChange,n=t.onCallingCodeChange;u2(this,e),this.onCountryChange=r,this.onCallingCodeChange=n}return f2(e,[{key:"reset",value:function(r){var n=r.country,a=r.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(n,a)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(r){for(var n=0,a=Object.keys(r);n<a.length;n++){var i=a[n];this[i]=r[i]}}},{key:"initCountryAndCallingCode",value:function(r,n){this.setCountry(r),this.setCallingCode(n)}},{key:"setCountry",value:function(r){this.country=r,this.onCountryChange(r)}},{key:"setCallingCode",value:function(r){this.callingCode=r,this.onCallingCodeChange(r,this.country)}},{key:"startInternationalNumber",value:function(r,n){this.international=!0,this.initCountryAndCallingCode(r,n)}},{key:"appendDigits",value:function(r){this.digits+=r}},{key:"appendNationalSignificantNumberDigits",value:function(r){this.nationalSignificantNumber+=r}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();function v2(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=y2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y2(e,t){if(e){if(typeof e=="string")return ns(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ns(e,t):void 0}}function ns(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ta=new RegExp("x");function Ir(e,t){if(t<1)return"";for(var r="";t>1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function as(e,t){return e[t]===")"&&t++,g2(e.slice(0,t))}function g2(e){for(var t=[],r=0;r<e.length;)e[r]==="("?t.push(r):e[r]===")"&&t.pop(),r++;var n=0,a="";t.push(e.length);for(var i=0,s=t;i<s.length;i++){var d=s[i];a+=e.slice(n,d),n=d+1}return a}function $2(e,t,r){for(var n=v2(r.split("")),a;!(a=n()).done;){var i=a.value;if(e.slice(t+1).search(ta)<0)return;t=e.search(ta),e=e.replace(ta,i)}return[e,t]}function b2(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return S2(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:i})}function N2(e,t,r){return Pn(e,t,r)==="IS_POSSIBLE"}function S2(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,a(t)){var s=is(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:i,metadata:n});if(s)return s}return is(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:i,metadata:n})}function is(e,t,r){var n=r.metadata,a=r.useNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix,s=Cl(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:n});if(a||(e.nationalPrefix?s=e.nationalPrefix+i(t)+s:e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(s=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+s)),x2(s,e))return s}function x2(e,t){return rn(e)===t.getNationalDigits()}function Gt(e){"@babel/helpers - typeof";return Gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(e)}function C2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function os(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w2(n.key),n)}}function _2(e,t,r){return t&&os(e.prototype,t),r&&os(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function w2(e){var t=E2(e,"string");return Gt(t)=="symbol"?t:t+""}function E2(e,t){if(Gt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Gt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P2=(function(){function e(){C2(this,e)}return _2(e,[{key:"parse",value:function(r){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(r),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var n=this.context[0],a=n.branches,i=n.instructions;if(a)return{op:"|",args:a.concat([ra(i)])};if(i.length===0)throw new Error("Pattern is required");return i.length===1?i[0]:i}},{key:"startContext",value:function(r){this.context.push(r)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(r){if(!r)throw new Error("Pattern is required");var n=r.match(T2);if(!n){if(j2.test(r))throw new Error("Illegal characters found in a pattern: ".concat(r));this.getContext().instructions=this.getContext().instructions.concat(r.split(""));return}var a=n[1],i=r.slice(0,n.index),s=r.slice(n.index+a.length);switch(a){case"(?:":i&&this.parsePattern(i),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(i&&this.parsePattern(i),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var d=this.getContext().branches;d.push(ra(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:d});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(i&&this.parsePattern(i),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(ra(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":i&&this.parsePattern(i),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:O2(i)});break;default:throw new Error("Unknown operator: ".concat(a))}s&&this.parsePattern(s)}}])})();function O2(e){for(var t=[],r=0;r<e.length;){if(e[r]==="-"){if(r===0||r===e.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,a=e[r+1].charCodeAt(0)-1,i=n;i<=a;)t.push(String.fromCharCode(i)),i++}else t.push(e[r]);r++}return t}var j2=/[\(\)\[\]\?\:\|]/,T2=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function ra(e){return e.length===1?e[0]:e}function ss(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=A2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A2(e,t){if(e){if(typeof e=="string")return ds(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ds(e,t):void 0}}function ds(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ht(e){"@babel/helpers - typeof";return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(e)}function I2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ls(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R2(n.key),n)}}function k2(e,t,r){return t&&ls(e.prototype,t),r&&ls(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function R2(e){var t=D2(e,"string");return Ht(t)=="symbol"?t:t+""}function D2(e,t){if(Ht(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ht(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var M2=(function(){function e(t){I2(this,e),this.matchTree=new P2().parse(t)}return k2(e,[{key:"match",value:function(r){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).allowOverflow;if(!r)throw new Error("String is required");var a=Ma(r.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!n))return a}}])})();function Ma(e,t,r){if(typeof t=="string"){var n=e.join("");return t.indexOf(n)===0?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:n.indexOf(t)===0?r&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var a=e.slice(),i=0;i<t.length;){var s=t[i],d=Ma(a,s,r&&i===t.length-1);if(d){if(d.overflow)return d;if(d.match){if(a=a.slice(d.matchedChars.length),a.length===0)return i===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0}}else{if(d.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result:
31
- `.concat(JSON.stringify(d,null,2)))}}else return;i++}return r?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(t.op){case"|":for(var l,c=ss(t.args),u;!(u=c()).done;){var f=u.value,m=Ma(e,f,r);if(m){if(m.overflow)return m;if(m.match)return{match:!0,matchedChars:m.matchedChars};if(m.partialMatch)l=!0;else throw new Error(`Unsupported match result:
32
- `.concat(JSON.stringify(m,null,2)))}}return l?{partialMatch:!0}:void 0;case"[]":for(var h=ss(t.args),p;!(p=h()).done;){var v=p.value;if(e[0]===v)return e.length===1?{match:!0,matchedChars:e}:r?{overflow:!0}:{match:!0,matchedChars:[v]}}return;default:throw new Error("Unsupported instruction tree: ".concat(t))}}function Kt(e){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(e)}function cs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=F2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F2(e,t){if(e){if(typeof e=="string")return us(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?us(e,t):void 0}}function us(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function L2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U2(n.key),n)}}function B2(e,t,r){return t&&fs(e.prototype,t),r&&fs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function U2(e){var t=V2(e,"string");return Kt(t)=="symbol"?t:t+""}function V2(e,t){if(Kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Kt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fa="9",z2=Ir(Fa,15),q2=/[- ]/,nn=!0,W2=nn&&function(){return/\[([^\[\]])*\]/g},G2=nn&&function(){return/\d(?=[^,}][^,}])/g},H2=new RegExp("["+ke+"]*\\$1["+ke+"]*(\\$\\d["+ke+"]*)*$"),ps=3,K2=(function(){function e(t){t.state;var r=t.metadata;L2(this,e),this.metadata=r,this.resetFormat()}return B2(e,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(r,n){this.resetFormat(),r?(this.isNANP=r.callingCode()==="1",this.matchingFormats=r.formats(),n.nationalSignificantNumber&&this.narrowDownMatchingFormats(n)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(r,n){var a=this;if(N2(n.nationalSignificantNumber,n.country,this.metadata))for(var i=cs(this.matchingFormats),s;!(s=i()).done;){var d=s.value,l=b2(n,d,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return a.shouldTryNationalPrefixFormattingRule(u,{international:n.international,nationalPrefix:n.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return a.getSeparatorAfterNationalPrefix(u)}});if(l)return this.resetFormat(),this.chosenFormat=d,this.setNationalNumberTemplate(l.replace(/\d/g,"x"),n),this.populatedNationalNumberTemplate=l,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),l}return this.formatNationalNumberWithNextDigits(r,n)}},{key:"formatNationalNumberWithNextDigits",value:function(r,n){var a=this.chosenFormat,i=this.chooseFormat(n);if(i)return i===a?this.formatNextNationalNumberDigits(r):this.formatNextNationalNumberDigits(n.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(r){var n=this,a=r.nationalSignificantNumber,i=r.nationalPrefix,s=r.international,d=a,l=d.length-ps;l<0&&(l=0),this.matchingFormats=this.matchingFormats.filter(function(c){return n.formatSuits(c,s,i)&&n.formatMatches(c,d,l)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(r,n,a){return!(a&&!r.usesNationalPrefix()&&!r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!n&&!a&&r.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(r,n,a){var i=r.leadingDigitsPatterns().length;if(i===0)return!0;a=Math.min(a,i-1);var s=r.leadingDigitsPatterns()[a];if(n.length<ps)try{return new M2(s).match(n,{allowOverflow:!0})!==void 0}catch(d){return console.error(d),!0}return new RegExp("^(".concat(s,")")).test(n)}},{key:"getFormatFormat",value:function(r,n){return n?r.internationalFormat():r.format()}},{key:"chooseFormat",value:function(r){for(var n=this,a=function(){var c=d.value;return n.chosenFormat===c?0:H2.test(n.getFormatFormat(c,r.international))?n.createTemplateForFormat(c,r)?(n.chosenFormat=c,0):(n.matchingFormats=n.matchingFormats.filter(function(u){return u!==c}),1):1},i,s=cs(this.matchingFormats.slice()),d;!(d=s()).done&&(i=a(),i!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(r,n){if(!(nn&&r.pattern().indexOf("|")>=0)){var a=this.getTemplateForFormat(r,n);if(a)return this.setNationalNumberTemplate(a,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&q2.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var a=r.IDDPrefix,i=r.missingPlus;return a?n&&n.spacing===!1?a:a+" ":i?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,a=0,i=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";a<i.length+r.getDigitsWithoutInternationalPrefix().length;)n=this.template.indexOf("x",n+1),a++;return as(this.template,n+1)}}},{key:"setNationalNumberTemplate",value:function(r,n){this.nationalNumberTemplate=r,this.populatedNationalNumberTemplate=r,this.populatedNationalNumberTemplatePosition=-1,n.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(n).replace(/[\d\+]/g,"x")+Ir("x",n.callingCode.length)+" "+r:this.template=r}},{key:"getTemplateForFormat",value:function(r,n){var a=n.nationalSignificantNumber,i=n.international,s=n.nationalPrefix,d=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,l=r.pattern();nn&&(l=l.replace(W2(),"\\d").replace(G2(),"\\d"));var c=z2.match(l)[0];if(!(a.length>c.length)){var u=new RegExp("^"+l+"$"),f=a.replace(/\d/g,Fa);u.test(f)&&(c=f);var m=this.getFormatFormat(r,i),h;if(this.shouldTryNationalPrefixFormattingRule(r,{international:i,nationalPrefix:s})){var p=m.replace(xl,r.nationalPrefixFormattingRule());if(rn(r.nationalPrefixFormattingRule())===(s||"")+rn("$1")&&(m=p,h=!0,s))for(var v=s.length;v>0;)m=m.replace(/\d/,"x"),v--}var y=c.replace(new RegExp(l),m).replace(new RegExp(Fa,"g"),"x");return h||(d?y=Ir("x",d.length)+" "+y:s&&(y=Ir("x",s.length)+this.getSeparatorAfterNationalPrefix(r)+y)),i&&(y=Sl(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=$2(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],as(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var a=n.international,i=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var s=r.usesNationalPrefix();if(s&&i||!s&&!a)return!0}}}])})();function Yt(e){"@babel/helpers - typeof";return Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(e)}function Al(e,t){return J2(e)||Z2(e,t)||X2(e,t)||Y2()}function Y2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
34
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X2(e,t){if(e){if(typeof e=="string")return hs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hs(e,t):void 0}}function hs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Z2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function J2(e){if(Array.isArray(e))return e}function Q2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ms(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tv(n.key),n)}}function ev(e,t,r){return t&&ms(e.prototype,t),r&&ms(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tv(e){var t=rv(e,"string");return Yt(t)=="symbol"?t:t+""}function rv(e,t){if(Yt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Yt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nv="["+ke+ye+"]+",av=new RegExp("^"+nv+"$","i"),iv="(?:["+On+"]["+ke+ye+"]*|["+ke+ye+"]+)",ov=new RegExp("[^"+ke+ye+"]+.*$"),sv=/[^\d\[\]]/,dv=(function(){function e(t){var r=t.defaultCountry,n=t.defaultCallingCode,a=t.metadata,i=t.onNationalSignificantNumberChange;Q2(this,e),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=a,this.onNationalSignificantNumberChange=i}return ev(e,[{key:"input",value:function(r,n){var a=Al(uv(r),2),i=a[0],s=a[1],d=rn(i),l;return s&&(n.digits||(n.startInternationalNumber(void 0,void 0),d||(l=!0))),d&&this.inputDigits(d,n),{digits:d,justLeadingPlus:l}}},{key:"inputDigits",value:function(r,n){var a=n.digits,i=a.length<3&&a.length+r.length>=3;if(n.appendDigits(r),i&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(s){return n.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,a=r.callingCode;return n&&!a}},{key:"extractCountryCallingCode",value:function(r){var n=gi("+"+r.getDigitsWithoutInternationalPrefix(),r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),a=n.countryCallingCode,i=n.number;if(a)return r.setCallingCode(a),r.update({nationalSignificantNumber:i}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&sv.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var a=Ta(r,this.metadata),i=a.nationalPrefix,s=a.nationalNumber,d=a.carrierCode;if(s!==r)return this.onExtractedNationalNumber(i,d,s,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,a){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,a);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var i=Ta(r,this.metadata),s=i.nationalPrefix,d=i.nationalNumber,l=i.carrierCode;if(d!==n)return this.onExtractedNationalNumber(s,l,d,r,a),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,a,i,s){var d=!1,l,c=i.lastIndexOf(a);if(c<0||c!==i.length-a.length)d=!0;else{var u=i.slice(0,c);u&&u!==r&&(l=u)}s({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:a,nationalSignificantNumberIsModified:d,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:l}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,a=r.IDDPrefix,i=r.digits;if(r.nationalSignificantNumber,!(n||a)){var s=$l(i,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==i)return r.update({IDDPrefix:i.slice(0,i.length-s.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=Nl(r.digits,r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(n)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:n}),!0}}},{key:"startInternationalNumber",value:function(r,n){var a=n.country,i=n.callingCode;r.startInternationalNumber(a,i),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}])})();function lv(e){var t=e.search(iv);if(!(t<0)){e=e.slice(t);var r;return e[0]==="+"&&(r=!0,e=e.slice(1)),e=e.replace(ov,""),r&&(e="+"+e),e}}function cv(e){var t=lv(e)||"";return t[0]==="+"?[t.slice(1),!0]:[t]}function uv(e){var t=Al(cv(e),2),r=t[0],n=t[1];return av.test(r)||(r=""),[r,n]}function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function fv(e,t){return vv(e)||mv(e,t)||hv(e,t)||pv()}function pv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hv(e,t){if(e){if(typeof e=="string")return vs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vs(e,t):void 0}}function vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function mv(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function vv(e){if(Array.isArray(e))return e}function yv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ys(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$v(n.key),n)}}function gv(e,t,r){return t&&ys(e.prototype,t),r&&ys(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $v(e){var t=bv(e,"string");return Xt(t)=="symbol"?t:t+""}function bv(e,t){if(Xt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gs=!1,Pt=(function(){function e(t,r){yv(this,e),this.metadata=new de(r);var n=fv(this.getCountryAndCallingCode(t),2),a=n[0],i=n[1];this.defaultCountry=a,this.defaultCallingCode=i,this.reset()}return gv(e,[{key:"getCountryAndCallingCode",value:function(r){var n,a;return r&&(et(r)?(n=r.defaultCountry,a=r.defaultCallingCode):n=r),n&&!this.metadata.hasCountry(n)&&(n=void 0),a&&gs&&this.metadata.isNonGeographicCallingCode(a)&&(n="001"),[n,a]}},{key:"input",value:function(r){var n=this.parser.input(r,this.state),a=n.digits;if(n.justLeadingPlus)this.formattedOutput="+";else if(a){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var i;if(this.metadata.hasSelectedNumberingPlan()&&(i=this.formatter.format(a,this.state)),i===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var s=this.state.getNationalDigits();s&&(i=this.formatter.format(s,this.state))}this.formattedOutput=i?this.getFullNumber(i):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var r=this;return this.state=new m2({onCountryChange:function(a){r.country=a},onCallingCodeChange:function(a,i){r.metadata.selectNumberingPlan(i,a),r.formatter.reset(r.metadata.numberingPlan,r.state),r.parser.reset(r.metadata.numberingPlan)}}),this.formatter=new K2({state:this.state,metadata:this.metadata}),this.parser=new dv({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){r.determineTheCountryIfNeeded(),r.formatter.reset(r.metadata.numberingPlan,r.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){var r=this.state.country;if(!(gs&&r==="001"))return r}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(r){var n=this;if(this.isInternational()){var a=function(d){return n.formatter.getInternationalPrefixBeforeCountryCallingCode(n.state,{spacing:!!d})+d},i=this.state.callingCode;return a(i?r?"".concat(i," ").concat(r):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return r}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var r=this.state,n=r.nationalSignificantNumber,a=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,i=r.nationalPrefix,s=n,d=a||i;return d&&(s=d+s),s}},{key:"getNonFormattedNumber",value:function(){var r=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(r?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var r=this.getNonFormattedNumber();if(r)return r.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var r=this.state.callingCode,n=this.metadata.getCountryCodesForCallingCode(r);return n&&n.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(yi(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,a=r.callingCode,i=r.country,s=r.nationalSignificantNumber;if(n){if(this.isInternational())return a?"+"+a+s:"+"+n;if(i||a)return"+"+(i?this.metadata.countryCallingCode():a)+s}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,a=r.carrierCode,i=r.callingCode,s=this._getCountry();if(n&&!(!s&&!i)){if(s&&s===this.defaultCountry){var d=new de(this.metadata.metadata);d.selectNumberingPlan(s);var l=d.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=bl(n,{countries:c,metadata:this.metadata.metadata});u&&(s=u)}}var f=new El(s||i,n,this.metadata.metadata);return a&&(f.carrierCode=a),f}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function $s(e){return new de(e).getCountries()}function Nv(e,t,r){return r||(r=t,t=void 0),new Pt(t,r).input(e)}var an=Jt(Th(),1);function Il(e){var t=e.inputFormat,r=e.country,n=e.metadata;return t==="NATIONAL_PART_OF_INTERNATIONAL"?"+".concat(Xe(r,n)):""}function La(e,t){return t&&(e=e.slice(t.length),e[0]===" "&&(e=e.slice(1))),e}function Sv(e,t,r){if(!(r&&r.ignoreRest))return Ol(e,t,function(a){r&&a==="end"&&(r.ignoreRest=!0)})}function kl(e){var t=e.onKeyDown,r=e.inputFormat;return(0,S.useCallback)(function(n){if(n.keyCode===Cv&&r==="INTERNATIONAL"&&n.target instanceof HTMLInputElement&&xv(n.target)===_v.length){n.preventDefault();return}t&&t(n)},[t,r])}function xv(e){return e.selectionStart}var Cv=8,_v="+",wv=["onKeyDown","country","inputFormat","metadata","international","withCountryCallingCode"];function Ba(){return Ba=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ba.apply(this,arguments)}function Ev(e,t){if(e==null)return{};var r=Pv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Ov(e){function t(r,n){var a=r.onKeyDown,i=r.country,s=r.inputFormat,d=r.metadata,l=d===void 0?e:d;r.international,r.withCountryCallingCode;var c=Ev(r,wv),u=(0,S.useCallback)(function(m){var h=new Pt(i,l),p=Il({inputFormat:s,country:i,metadata:l}),v=h.input(p+m),y=h.getTemplate();return p&&(v=La(v,p),y&&(y=La(y,p))),{text:v,template:y}},[i,l]),f=kl({onKeyDown:a,inputFormat:s});return S.default.createElement(o1,Ba({},c,{ref:n,parse:Sv,format:u,onKeyDown:f}))}return t=S.default.forwardRef(t),t.propTypes={value:P.default.string.isRequired,onChange:P.default.func.isRequired,onKeyDown:P.default.func,country:P.default.string,inputFormat:P.default.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:P.default.object},t}var jv=Ov(),Tv=["value","onChange","onKeyDown","country","inputFormat","metadata","inputComponent","international","withCountryCallingCode"];function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ua.apply(this,arguments)}function Av(e,t){if(e==null)return{};var r=Iv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Iv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function kv(e){function t(r,n){var a=r.value,i=r.onChange,s=r.onKeyDown,d=r.country,l=r.inputFormat,c=r.metadata,u=c===void 0?e:c,f=r.inputComponent,m=f===void 0?"input":f;r.international,r.withCountryCallingCode;var h=Av(r,Tv),p=Il({inputFormat:l,country:d,metadata:u}),v=(0,S.useCallback)(function($){var g=ka($.target.value);g===a&&bs(p,g,d,u).indexOf($.target.value)===0&&(g=g.slice(0,-1)),i(g)},[p,a,i,d,u]),y=kl({onKeyDown:s,inputFormat:l});return S.default.createElement(m,Ua({},h,{ref:n,value:bs(p,a,d,u),onChange:v,onKeyDown:y}))}return t=S.default.forwardRef(t),t.propTypes={value:P.default.string.isRequired,onChange:P.default.func.isRequired,onKeyDown:P.default.func,country:P.default.string,inputFormat:P.default.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:P.default.object,inputComponent:P.default.elementType},t}var Rv=kv();function bs(e,t,r,n){return La(Nv(e+t,r,n),e)}function Dv(e){return Ns(e[0])+Ns(e[1])}function Ns(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var Mv=["value","onChange","options","disabled","readOnly"],Fv=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function Lv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Bv(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
36
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bv(e,t){if(e){if(typeof e=="string")return Ss(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ss(e,t)}}function Ss(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},on.apply(this,arguments)}function Rl(e,t){if(e==null)return{};var r=Uv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Uv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Dl(e){var t=e.value,r=e.onChange,n=e.options,a=e.disabled,i=e.readOnly,s=Rl(e,Mv),d=(0,S.useCallback)(function(l){var c=l.target.value;r(c==="ZZ"?void 0:c)},[r]);return(0,S.useMemo)(function(){return Fl(n,t)},[n,t]),S.default.createElement("select",on({},s,{disabled:a||i,readOnly:i,value:t||"ZZ",onChange:d}),n.map(function(l){var c=l.value,u=l.label,f=l.divider;return S.default.createElement("option",{key:f?"|":c||"ZZ",value:f?"|":c||"ZZ",disabled:!!f,style:f?Vv:void 0},u)}))}Dl.propTypes={value:P.default.string,onChange:P.default.func.isRequired,options:P.default.arrayOf(P.default.shape({value:P.default.string,label:P.default.string,divider:P.default.bool})).isRequired,disabled:P.default.bool,readOnly:P.default.bool};var Vv={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function Ml(e){var t=e.value,r=e.options,n=e.className,a=e.iconComponent;e.getIconAspectRatio;var i=e.arrowComponent,s=i===void 0?zv:i,d=e.unicodeFlags,l=Rl(e,Fv),c=(0,S.useMemo)(function(){return Fl(r,t)},[r,t]);return S.default.createElement("div",{className:"PhoneInputCountry"},S.default.createElement(Dl,on({},l,{value:t,options:r,className:(0,an.default)("PhoneInputCountrySelect",n)})),c&&(d&&t?S.default.createElement("div",{className:"PhoneInputCountryIconUnicode"},Dv(t)):S.default.createElement(a,{"aria-hidden":!0,country:t,label:c.label,aspectRatio:d?1:void 0})),S.default.createElement(s,null))}Ml.propTypes={iconComponent:P.default.elementType,arrowComponent:P.default.elementType,unicodeFlags:P.default.bool};function zv(){return S.default.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function Fl(e,t){for(var r=Lv(e),n;!(n=r()).done;){var a=n.value;if(!a.divider&&qv(a.value,t))return a}}function qv(e,t){return e==null?t==null:e===t}var Wv=["country","countryName","flags","flagUrl"];function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Va.apply(this,arguments)}function Gv(e,t){if(e==null)return{};var r=Hv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function bi(e){var t=e.country,r=e.countryName,n=e.flags,a=e.flagUrl,i=Gv(e,Wv);return n&&n[t]?n[t]({title:r}):S.default.createElement("img",Va({},i,{alt:r,role:r?void 0:"presentation",src:a.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}bi.propTypes={country:P.default.string.isRequired,countryName:P.default.string.isRequired,flags:P.default.objectOf(P.default.elementType),flagUrl:P.default.string.isRequired};var Kv=["aspectRatio"],Yv=["title"],Xv=["title"];function sn(){return sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sn.apply(this,arguments)}function Ni(e,t){if(e==null)return{};var r=Zv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function jn(e){var t=e.aspectRatio,r=Ni(e,Kv);return t===1?S.default.createElement(Bl,r):S.default.createElement(Ll,r)}jn.propTypes={title:P.default.string.isRequired,aspectRatio:P.default.number};function Ll(e){var t=e.title,r=Ni(e,Yv);return S.default.createElement("svg",sn({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),S.default.createElement("title",null,t),S.default.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},S.default.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),S.default.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),S.default.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),S.default.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),S.default.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),S.default.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),S.default.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}Ll.propTypes={title:P.default.string.isRequired};function Bl(e){var t=e.title,r=Ni(e,Xv);return S.default.createElement("svg",sn({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),S.default.createElement("title",null,t),S.default.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},S.default.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),S.default.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),S.default.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),S.default.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),S.default.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),S.default.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),S.default.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}Bl.propTypes={title:P.default.string.isRequired};function Jv(e){if(e.length<2||e[0]!=="+")return!1;for(var t=1;t<e.length;){var r=e.charCodeAt(t);if(!(r>=48&&r<=57))return!1;t++}return!0}function Ul(e){Jv(e)||console.error("[react-phone-number-input] Expected the initial `value` to be a E.164 phone number. Got",e)}function Qv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ey(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ey(e,t){if(e){if(typeof e=="string")return xs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xs(e,t)}}function xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ty(e,t){if(!t)return e;for(var r=[],n=[],a=r,i=function(){var c=d.value;if(c==="|")a.push({divider:!0});else if(c==="..."||c==="…")a=n;else{var u;c==="🌐"?u=void 0:u=c;var f=e.indexOf(e.filter(function(h){return h.value===u})[0]),m=e[f];e.splice(f,1),a.push(m)}},s=Qv(t),d;!(d=s()).done;)i();return r.concat(e).concat(n)}function ry(e,t){if(e&&(e=e.filter(function(r){switch(r){case"🌐":case"|":case"...":case"…":return!0;default:return Tn(r,t)}}),e.length>0))return e}function Tn(e,t){return ml(e,t)?!0:(console.error("Country not found: ".concat(e)),!1)}function Vl(e,t){return e&&(e=e.filter(function(r){return Tn(r,t)}),e.length===0&&(e=void 0)),e}var ny=["country","label","aspectRatio"];function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},za.apply(this,arguments)}function ay(e,t){if(e==null)return{};var r=iy(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iy(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function zl(e){var t=e.flags,r=e.flagUrl,n=e.flagComponent,a=e.internationalIcon;function i(s){var d=s.country,l=s.label,c=s.aspectRatio,u=ay(s,ny),f=a===jn?c:void 0;return S.default.createElement("div",za({},u,{className:(0,an.default)("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":f===1,"PhoneInputCountryIcon--border":d})}),d?S.default.createElement(n,{country:d,countryName:l,flags:t,flagUrl:r,className:"PhoneInputCountryIconImg"}):S.default.createElement(a,{title:l,aspectRatio:f,className:"PhoneInputCountryIconImg"}))}return i.propTypes={country:P.default.string,label:P.default.string.isRequired,aspectRatio:P.default.number},i}var ug=zl({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:bi,internationalIcon:jn});function oy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=sy(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sy(e,t){if(e){if(typeof e=="string")return Cs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cs(e,t)}}function Cs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dy(e,t){for(var r=oy(e),n;!(n=r()).done;){var a=n.value;a&&ly(a,t)}}function ly(e,t){typeof e=="function"?e(t):e.current=t}var ql=P.default.shape({country_calling_codes:P.default.object.isRequired,countries:P.default.object.isRequired}),Wl=P.default.objectOf(P.default.string);function Ve(e,t){return"+"+Xe(e,t)}function cy(e){var t=e.value,r=e.phoneNumber,n=e.defaultCountry,a=e.getAnyCountry,i=e.countries,s=e.required,d=e.metadata,l;return r&&r.country?l=r.country:n&&(!t||mt(t,n,d))&&(l=n),i&&i.indexOf(l)<0&&(l=void 0),!l&&s&&i&&i.length>0&&(l=a()),l}function uy(e){var t=e.countries,r=e.countryNames,n=e.addInternationalOption,a=e.compareStringsLocales,i=e.compareStrings;i||(i=gy);var s=t.map(function(d){return{value:d,label:r[d]||d}});return s.sort(function(d,l){return i(d.label,l.label,a)}),n&&s.unshift({label:r.ZZ}),s}function Gl(e,t){return o2(e||"",t)}function fy(e){return e.formatNational().replace(/\D/g,"")}function py(e,t){var r=t.prevCountry,n=t.newCountry,a=t.metadata,i=t.useNationalFormat;if(r===n)return e;if(!e)return i?"":n?Ve(n,a):"";if(n){if(e[0]==="+"){if(i)return e.indexOf("+"+Xe(n,a))===0?$y(e,n,a):"";if(r){var s=Ve(n,a);return e.indexOf(s)===0?e:s}else{var d=Ve(n,a);return e.indexOf(d)===0?e:d}}}else if(e[0]!=="+")return lt(e,r,a)||"";return e}function lt(e,t,r){if(e){if(e[0]==="+"){if(e==="+")return;var n=new Pt(t,r);return n.input(e),n.getNumberValue()}if(t){var a=Kl(e,t,r);return"+".concat(Xe(t,r)).concat(a||"")}}}function hy(e,t,r){var n=Kl(e,t,r);if(n){var a=n.length-my(t,r);if(a>0)return e.slice(0,e.length-a)}return e}function my(e,t){return t=new de(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function Hl(e,t){var r=t.country,n=t.countries,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.required,d=t.metadata;if(e==="+")return r;var l=yy(e,d);if(l)return!n||n.indexOf(l)>=0?l:void 0;if(r){if(mt(e,r,d)){if(i&&mt(e,i,d))return i;if(a&&mt(e,a,d))return a;if(!s)return}else if(!s)return}return r}function vy(e,t){var r=t.prevPhoneDigits,n=t.country,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,d=t.getAnyCountry,l=t.countries,c=t.international,u=t.limitMaxLength,f=t.countryCallingCodeEditable,m=t.metadata;if(c&&f===!1&&n){var h=Ve(n,m);if(e.indexOf(h)!==0){var p;return e&&e[0]!=="+"?(e=h+e,p=lt(e,n,m)):e=h,{phoneDigits:e,value:p,country:n}}}c===!1&&n&&e&&e[0]==="+"&&(e=_s(e,n,m)),e&&n&&u&&(e=hy(e,n,m)),e&&e[0]!=="+"&&(!n||c)&&(e="+"+e),!e&&r&&r[0]==="+"&&(c?n=void 0:n=a),e==="+"&&r&&r[0]==="+"&&r.length>1&&(n=void 0);var v;return e&&(e[0]==="+"&&(e==="+"||n&&Ve(n,m).indexOf(e)===0)?v=void 0:v=lt(e,n,m)),v&&(n=Hl(v,{country:n,countries:l,defaultCountry:a,latestCountrySelectedByUser:i,required:!1,metadata:m}),c===!1&&n&&e&&e[0]==="+"&&(e=_s(e,n,m),v=lt(e,n,m))),!n&&s&&(n=a||d()),{phoneDigits:e,country:n,value:v}}function _s(e,t,r){if(e.indexOf(Ve(t,r))===0){var n=new Pt(t,r);n.input(e);var a=n.getNumber();return a?a.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function yy(e,t){var r=new Pt(null,t);return r.input(e),r.getCountry()}function gy(e,t,r){return String.prototype.localeCompare?e.localeCompare(t,r):e<t?-1:e>t?1:0}function $y(e,t,r){if(t){var n="+"+Xe(t,r);if(e.length<n.length){if(n.indexOf(e)===0)return""}else if(e.indexOf(n)===0)return e.slice(n.length)}for(var a=0,i=Object.keys(r.country_calling_codes);a<i.length;a++){var s=i[a];if(e.indexOf(s)===1)return e.slice(1+s.length)}return""}function Kl(e,t,r){var n=new Pt(t,r);n.input(e);var a=n.getNumber();return a&&a.nationalNumber}function mt(e,t,r){for(var n=Ve(t,r),a=0;a<e.length&&a<n.length;){if(e[a]!==n[a])return!1;a++}return!0}function Yl(e){var t=e.value,r=e.phoneNumber,n=e.defaultCountry,a=e.international,i=e.useNationalFormat,s=e.metadata;return(a===!1||i)&&r&&r.country?fy(r):!t&&a&&n?Ve(n,s):t}function Zt(e){"@babel/helpers - typeof";return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(e)}function ws(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ws(Object(r),!0).forEach(function(n){by(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ws(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function by(e,t,r){return t=Ny(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ny(e){var t=Sy(e,"string");return Zt(t)=="symbol"?t:t+""}function Sy(e,t){if(Zt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xy(e,t,r){var n=e.metadata,a=e.countries,i=e.defaultCountry,s=e.value,d=e.reset,l=e.international,c=e.displayInitialValueAsLocalNumber,u=e.initialValueFormat,f=t.defaultCountry,m=t.value,h=t.reset;r.country;var p=r.value,v=r.hasUserSelectedACountry,y=r.latestCountrySelectedByUser,$=function(G){return Yl(mr(mr({},G),{},{international:l,useNationalFormat:c||u==="national",metadata:n}))};if(d!==h)return{phoneDigits:$({value:void 0,defaultCountry:i}),value:void 0,country:i,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(i!==f){var g=!i||Tn(i,n),x=!p||l&&p===$({value:void 0,defaultCountry:f});if(!v&&g&&!s&&x)return{country:i,phoneDigits:$({value:void 0,defaultCountry:i}),value:void 0}}if(!Es(s,m)&&!Es(s,p)){var C,N;if(s){s&&Ul(s),C=Gl(s,n);var b=Vl(a,n);C&&C.country?(!b||b.indexOf(C.country)>=0)&&(N=C.country):(N=Hl(s,{country:void 0,countries:b,metadata:n}),N||i&&s.indexOf(Ve(i,n))===0&&(N=i))}var T;return s?y&&((N?y===N:mt(s,y,n))?N||(N=y):T={latestCountrySelectedByUser:void 0}):T={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0},mr(mr({},T),{},{phoneDigits:$({phoneNumber:C,value:s,defaultCountry:i}),value:s,country:s?N:i})}}function Es(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var Cy=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function St(e){"@babel/helpers - typeof";return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function Ps(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ps(Object(r),!0).forEach(function(n){je(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ps(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vt.apply(this,arguments)}function _y(e,t){if(e==null)return{};var r=wy(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wy(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Ey(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Os(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jl(n.key),n)}}function Py(e,t,r){return t&&Os(e.prototype,t),r&&Os(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oy(e,t,r){return t=dn(t),jy(e,Zl()?Reflect.construct(t,r||[],dn(e).constructor):t.apply(e,r))}function jy(e,t){if(t&&(St(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ty(e)}function Ty(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zl=function(){return!!e})()}function dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dn(e)}function Ay(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qa(e,t)}function qa(e,t){return qa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},qa(e,t)}function je(e,t,r){return t=Jl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jl(e){var t=Iy(e,"string");return St(t)=="symbol"?t:t+""}function Iy(e,t){if(St(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ky=(function(e){function t(r){var n;Ey(this,t),n=Oy(this,t,[r]),je(n,"setInputRef",function(y){dy([n.props.inputRef,n.inputRef],y)}),je(n,"isCountrySupportedWithError",function(y){var $=n.props.metadata;return Tn(y,$)}),je(n,"onCountryChange",function(y){var $=n.props,g=$.international,x=$.metadata,C=$.onChange,N=$.focusInputOnCountrySelection,b=n.state,T=b.phoneDigits,R=b.country,G=py(T,{prevCountry:R,newCountry:y,metadata:x,useNationalFormat:!g}),J=lt(G,y,x);N&&n.inputRef.current.focus(),n.setState({country:y,latestCountrySelectedByUser:y,hasUserSelectedACountry:!0,phoneDigits:G,value:J},function(){C(J)})}),je(n,"onChange",function(y){var $=n.props,g=$.defaultCountry,x=$.onChange,C=$.addInternationalOption,N=$.international,b=$.limitMaxLength,T=$.countryCallingCodeEditable,R=$.metadata,G=n.state,J=G.countries,oe=G.phoneDigits,Q=G.country,fe=G.latestCountrySelectedByUser,ge=vy(y,{prevPhoneDigits:oe,country:Q,countryRequired:!C,defaultCountry:g,latestCountrySelectedByUser:fe,getAnyCountry:function(){return n.getFirstSupportedCountry({countries:J})},countries:J,international:N,limitMaxLength:b,countryCallingCodeEditable:T,metadata:R}),ne=ge.phoneDigits,ce=ge.country,ue=ge.value,ae={phoneDigits:ne,value:ue,country:ce};fe&&ue&&!mt(ue,fe,R)&&(ae.latestCountrySelectedByUser=void 0),T===!1&&!ue&&ne===n.state.phoneDigits&&(ae.forceRerender={}),n.setState(ae,function(){return x(ue)})}),je(n,"_onFocus",function(){return n.setState({isFocused:!0})}),je(n,"_onBlur",function(){return n.setState({isFocused:!1})}),je(n,"onFocus",function(y){n._onFocus();var $=n.props.onFocus;$&&$(y)}),je(n,"onBlur",function(y){var $=n.props.onBlur;n._onBlur(),$&&$(y)}),je(n,"onCountryFocus",function(y){n._onFocus();var $=n.props.countrySelectProps;if($){var g=$.onFocus;g&&g(y)}}),je(n,"onCountryBlur",function(y){n._onBlur();var $=n.props.countrySelectProps;if($){var g=$.onBlur;g&&g(y)}}),n.inputRef=S.default.createRef();var a=n.props,i=a.value;a.labels;var s=a.international,d=a.addInternationalOption,l=a.displayInitialValueAsLocalNumber,c=a.initialValueFormat,u=a.metadata,f=n.props,m=f.defaultCountry,h=f.countries;m&&(n.isCountrySupportedWithError(m)||(m=void 0)),i&&Ul(i),h=Vl(h,u);var p=Gl(i,u);n.CountryIcon=zl(n.props);var v=cy({value:i,phoneNumber:p,defaultCountry:m,required:!d,countries:h||$s(u),getAnyCountry:function(){return n.getFirstSupportedCountry({countries:h})},metadata:u});return n.state={props:n.props,country:v,countries:h,phoneDigits:Yl({value:i,phoneNumber:p,defaultCountry:m,international:s,useNationalFormat:l||c==="national",metadata:u}),value:i},n}return Ay(t,e),Py(t,[{key:"componentDidMount",value:function(){var n=this.props.onCountryChange,a=this.props.defaultCountry,i=this.state.country;n&&(a&&(this.isCountrySupportedWithError(a)||(a=void 0)),i!==a&&n(i))}},{key:"componentDidUpdate",value:function(n,a){var i=this.props.onCountryChange,s=this.state.country;i&&s!==a.country&&i(s)}},{key:"getCountrySelectOptions",value:function(n){var a=n.countries,i=this.props,s=i.international,d=i.countryCallingCodeEditable,l=i.countryOptionsOrder,c=i.addInternationalOption,u=i.labels,f=i.locales,m=i.metadata;return this.useMemoCountrySelectOptions(function(){return ty(uy({countries:a||$s(m),countryNames:u,addInternationalOption:s&&d===!1?!1:c,compareStringsLocales:f}),ry(l,m))},[a,l,c,u,m])}},{key:"useMemoCountrySelectOptions",value:function(n,a){return(!this.countrySelectOptionsMemoDependencies||!Dy(a,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=n(),this.countrySelectOptionsMemoDependencies=a),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(n){var a=n.countries;return this.getCountrySelectOptions({countries:a})[0].value}},{key:"render",value:function(){var n=this.props,a=n.name,i=n.disabled,s=n.readOnly,d=n.autoComplete,l=n.style,c=n.className;n.inputRef;var u=n.inputComponent,f=n.numberInputProps,m=n.smartCaret,h=n.countrySelectComponent,p=n.countrySelectProps,v=n.containerComponent,y=n.containerComponentProps;n.defaultCountry,n.countries,n.countryOptionsOrder;var $=n.labels;n.flags,n.flagComponent,n.flagUrl,n.addInternationalOption,n.internationalIcon,n.displayInitialValueAsLocalNumber,n.initialValueFormat,n.onCountryChange,n.limitMaxLength,n.countryCallingCodeEditable,n.focusInputOnCountrySelection,n.reset;var g=n.metadata,x=n.international;n.locales;var C=_y(n,Cy),N=this.state,b=N.country,T=N.countries,R=N.phoneDigits,G=N.isFocused,J=m?jv:Rv,oe=this.getCountrySelectOptions({countries:T});return S.default.createElement(v,vt({style:l,className:(0,an.default)(c,"PhoneInput",{"PhoneInput--focus":G,"PhoneInput--disabled":i,"PhoneInput--readOnly":s})},y),S.default.createElement(h,vt({name:a?"".concat(a,"Country"):void 0,"aria-label":$.country},p,{value:b,options:oe,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:i||p&&p.disabled,readOnly:s||p&&p.readOnly,iconComponent:this.CountryIcon})),S.default.createElement(J,vt({ref:this.setInputRef,type:"tel",autoComplete:d},f,C,{inputFormat:x===!0?"INTERNATIONAL":x===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:x?!0:void 0,withCountryCallingCode:x?!0:void 0,name:a,metadata:g,country:b,value:R||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:i,readOnly:s,inputComponent:u,className:(0,an.default)("PhoneInputInput",f&&f.className,C.className)})))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return Xl({props:n},xy(n,a.props,a))}}])})(S.default.PureComponent),Ql=S.default.forwardRef(function(e,t){return S.default.createElement(ky,vt({},Ry(e),{inputRef:t}))});Ql.propTypes={value:P.default.string,onChange:P.default.func.isRequired,onFocus:P.default.func,onBlur:P.default.func,disabled:P.default.bool,readOnly:P.default.bool,autoComplete:P.default.string,initialValueFormat:P.default.oneOf(["national"]),displayInitialValueAsLocalNumber:P.default.bool,defaultCountry:P.default.string,countries:P.default.arrayOf(P.default.string),labels:Wl,locales:P.default.oneOfType([P.default.string,P.default.arrayOf(P.default.string)]),flagUrl:P.default.string,flags:P.default.objectOf(P.default.elementType),flagComponent:P.default.elementType,addInternationalOption:P.default.bool,internationalIcon:P.default.elementType,countryOptionsOrder:P.default.arrayOf(P.default.string),style:P.default.object,className:P.default.string,countrySelectComponent:P.default.elementType,countrySelectProps:P.default.object,inputComponent:P.default.elementType,numberInputProps:P.default.object,containerComponent:P.default.elementType,containerComponentProps:P.default.object,smartCaret:P.default.bool,international:P.default.bool,limitMaxLength:P.default.bool,countryCallingCodeEditable:P.default.bool,metadata:ql,onCountryChange:P.default.func,focusInputOnCountrySelection:P.default.bool};var js={autoComplete:"tel",countrySelectComponent:Ml,flagComponent:bi,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:jn,inputComponent:"input",containerComponent:"div",reset:P.default.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function Ry(e){e=Xl({},e);for(var t in js)e[t]===void 0&&(e[t]=js[t]);return e}function Dy(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;){if(e[r]!==t[r])return!1;r++}return!0}var My={ext:"ext.",country:"Phone number country",phone:"Phone",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XA:"Abkhazia",XK:"Kosovo",XO:"South Ossetia",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"},Fy=["metadata","labels"];function Wa(){return Wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wa.apply(this,arguments)}function Ly(e,t){if(e==null)return{};var r=By(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function By(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ec(e){var t=S.default.forwardRef(function(r,n){var a=r.metadata,i=a===void 0?e:a,s=r.labels,d=s===void 0?My:s,l=Ly(r,Fy);return S.default.createElement(Ql,Wa({},l,{ref:n,metadata:i,labels:d}))});return t.propTypes={metadata:ql,labels:Wl},t}var fg=ec();function Uy(e,t){var r=Array.prototype.slice.call(t);return r.push(fl),e.apply(this,r)}var Vy=ec(fl);function na(){return Uy(c2,arguments)}var zy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vr="consentDraftByService",qy=15,Wy=["IN","US","CA","PH","NZ","AU","CN"],Gy=e=>{const[t,r]=e.split("/");return+`${t}${r}`};function Hy(){const e=(0,M.useDispatch)(),{tenantId:t,id:r}=(0,M.useSelector)(E=>E.booking.outletDetails),{timeZone:n,image:a,outletName:i,address:s}=(0,M.useSelector)(E=>E.booking.outletDetails),{staff:d,selectedServices:l,selectedProfessional:c}=(0,M.useSelector)(E=>E.booking.service),{selectedSlotIds:u,selectedDate:f,selectedTime:m}=(0,M.useSelector)(E=>E.booking.slots),{userDetails:h,bookingMode:p,tipPct:v}=(0,M.useSelector)(E=>E.booking.appointment),y=Array.isArray(l)?l:[l],{selectedSlotIndexes:$,slots:g}=(0,M.useSelector)(E=>E.booking.slots),[x,C]=(0,S.useState)(!1),[N,b]=(0,S.useState)(!1),[T,R]=(0,S.useState)(null),[G,J]=(0,S.useState)("person"),[oe,Q]=(0,S.useState)(!1),[fe,ge]=(0,S.useState)(""),[ne,ce]=(0,S.useState)(""),[ue,ae]=(0,S.useState)(null),[pe,Oe]=(0,S.useState)(null),[$e,O]=(0,S.useState)({}),[k,B]=(0,S.useState)({}),[q,L]=(0,S.useState)(!1),U=(0,S.useRef)(!1),F=(0,S.useRef)(""),w=he.DateTime.now().setZone(n??"UTC"),[_,j]=(0,S.useState)(null),[D,A]=(0,S.useState)(!1),K=(0,S.useRef)(""),le=(0,S.useRef)(null),{register:Me,handleSubmit:Ot,control:at,watch:Si,reset:An,trigger:xi,setValue:jt,formState:{errors:it,isSubmitted:Ci,isSubmitting:tc}}=(0,Ue.useForm)({defaultValues:{firstName:h?.firstName||"",lastName:h?.lastName||"",phone:h?.phone||"",email:h?.email||""},mode:"onChange",reValidateMode:"onChange"}),In=Si("phone"),kn=Si("email"),Rn=E=>E?.replace(/\s+/g,"")||"",rc=E=>/^\S+@\S+\.\S+$/.test(E),Dn=y.map(E=>{const I=d?.find(z=>z.id===c?.id)?.assignments?.find(z=>z.id===E.id),V={...E,price:I?.price??E.price??E.min_price??0,duration:I?.duration??E.estimated_time??E.min_time??0};return{...V,duration:I?.duration??E.estimated_time??E.min_time??0,tax:bo(V),unitTax:bo(V,{perUnit:!0})}}),Mn=[...g?.morning??[],...g?.afternoon??[],...g?.evening??[]],nc=Dn.reduce((E,I)=>E+Number(I.duration??0),0),ac=Math.ceil(nc/qy),ic=E=>{if(!Mn.length)return"";const I=Mn[E]?.start_time_12h,V=Mn[E+ac-1];return!I||!V?"":`${I} - ${V.end_time_12h??V.start_time_12h}`},_i={day:Number(f?.day??w.day),month:Number(f?.month??w.month),year:Number(f?.year??w.year)},wi=$?.[0],Ei=wi!==void 0?ic(wi):null,oc=Ei?`${zy[_i.month-1]} ${_i.day} at ${Ei}`:null,Fn=Dn.reduce((E,I)=>E+Number(I.price)*(I.qty??1),0),Pi=Dn.reduce((E,I)=>E+I.tax,0),sc=Math.round(Pi*100),Oi=Fn*v/100,dc=Math.round(Oi*100),ji=Fn+Oi+Pi,we=(0,S.useMemo)(()=>y.filter(E=>!(!ai(E)||(E?.consent_rule?.enforcementMode??E?.enforcementMode)==="FIXED")),[y]),lc=(0,S.useMemo)(()=>we.map(E=>String(E.id)).filter(Boolean),[we]),cc=E=>{const I=E?.consent_template??E?.consentTemplate??null;return{heading:String(I?.heading??"").trim(),consent:String(I?.consent??"").trim()}},Ln=E=>{O(I=>({...I,[String(E)]:!0}))};(0,S.useEffect)(()=>{h&&we?.length>0&&fc()},[h,we?.length]),(0,S.useEffect)(()=>{An({...h,phone:h?.phone||""},{keepErrors:!0,keepDirty:!1})},[h,An]),(0,S.useEffect)(()=>{Ci&&xi(["phone","email"])},[In,kn,Ci,xi]);const Ti=(0,S.useCallback)(async({value:E,type:I})=>{if(!E)return;let V="";if(I==="phone"){if(!na(E))return;V=Rn(E)}if(I==="email"){if(!rc(E))return;V=E.trim()}if(V&&!(K.current===V&&D)){K.current=V,C(!0),j(I);try{const z=(await Pf({search:V,tenantId:t}))?.data?.[0];z?(jt("firstName",z.first_name||"",{shouldValidate:!0}),jt("lastName",z.last_name||""),z.phone&&na(z.phone)&&jt("phone",z.phone),z.email&&jt("email",z.email),e(Gn({email:z.email,firstName:z.first_name,lastName:z.last_name,phone:z.phone})),A(!0)):A(!1)}catch(z){console.error(z)}finally{C(!1),j(null)}}},[e,jt,t,D]);(0,S.useEffect)(()=>(le.current=(0,Oc.debounce)(Ti,800),()=>{le.current?.cancel?.()}),[Ti]);const Ai=(E,I,V)=>{if(I&&I(E),!E){le.current?.cancel?.(),K.current="",A(!1),j(null);return}j(V),le.current?.({value:E,type:V})},uc=()=>{An({firstName:"",lastName:"",email:"",phone:""}),A(!1),K.current="",e(Df())},fc=async()=>{const E=h?.id;if(E){L(!0);try{const I={};for(const V of we){const z=String(V.id),te=String(V.consent_form_id??"");if(!z||!te)continue;const ee=uo(V);if(!(ee==="EVERY_X_DAYS"||ee==="ONCE_PER_CUSTOMER")){I[z]={data:{checked:!0,needsSignature:!0}};continue}const Ce=!!(await po(E,te,z))?.data?.needsSignature;I[z]={data:{checked:!0,needsSignature:Ce}},Ce||Ln(z)}B(I)}catch(I){console.error(I)}finally{L(!1)}}},Bn=(0,S.useMemo)(()=>we.filter(E=>{const I=String(E.id);if($e[I])return!1;const V=k[I];return!(V?.data?.checked&&V?.data?.needsSignature===!1)}),[we,$e,k]),Ii=lc.length,ki=Ii-Bn.length,Ri=Bn.length===0,Di=async()=>{if(!U.current){U.current=!0;try{if(!h?.firstName){Z.toast.warn("Please enter First Name before signing consent.");return}if(!h?.email&&!h?.phone){Z.toast.warn("Please enter Email or Mobile Number before signing consent.");return}const E=Bn[0];if(!E){await Un();return}const I=String(E.id);if(F.current===I&&oe)return;F.current=I;const V=String(E.consent_form_id??"");if(!V){Z.toast.error("Consent form missing.");return}const z=fo(E);if(!z){Z.toast.error("Consent enforcement method not found.");return}const te=h?.id;if(uo(E)!=="EVERY_VISIT"&&te){const Fe=!!(await po(te,V,I))?.data?.needsSignature;if(B(ar=>({...ar,[I]:{data:{checked:!0,needsSignature:Fe}}})),!Fe){Ln(I),Z.toast.success("Consent already signed for this service."),setTimeout(()=>Di(),250);return}}else B(Ce=>({...Ce,[I]:{data:{checked:!0,needsSignature:!0}}}));const{heading:ee,consent:me}=cc(E);if(!ee||!me){Z.toast.error("Consent template missing.");return}ge(ee),ce(me),ae(z),Oe(I),Q(!0)}catch(E){console.error(E),Z.toast.error(E?.message??"Consent check failed")}finally{U.current=!1}}},pc=(E,I)=>{try{const V=localStorage.getItem(vr),z=V?JSON.parse(V):{};z[String(E)]=I,localStorage.setItem(vr,JSON.stringify(z))}catch(V){console.error("Failed to save consent draft",V)}},hc=()=>{try{return JSON.parse(localStorage.getItem(vr)??"{}")}catch{return{}}},mc=E=>{const I=String(pe);if(!I)return;const V=we.find(me=>String(me.id)===I);if(!V)return;const z=String(V.consent_form_id??""),te=fo(V);if(!z||!te){Z.toast.error("Consent form/method missing.");return}let ee="CHECKBOX_ONLY";te==="TYPED_NAME"?ee="TYPED_NAME":te==="DRAW_SIGNATURE"&&(ee="SIGNATURE_IMAGE"),pc(I,{serviceId:I,concentFormId:z,signatureType:ee,typedName:E?.typedName,isChecked:E?.accepted,signatureDataUrl:E?.signatureDataUrl,emailMe:E?.emailMe}),Ln(I),Q(!1),F.current="",Z.toast.success("Consent captured.")},vc=()=>{Q(!1),Oe(null)},yc=async(E,I,V)=>{const z=hc(),te=Object.entries(z).map(([ee,me])=>({serviceId:ee,concentFormId:me.concentFormId,captured:me})).filter(ee=>ee.serviceId&&ee.concentFormId);for(const ee of te){const{serviceId:me,concentFormId:Ce,captured:Fe}=ee,ar=Fe.signatureType||(Fe.typedName?"TYPED_NAME":Fe.signatureDataUrl?"SIGNATURE_IMAGE":"CHECKBOX_ONLY"),Fi={tenantId:t,outletId:r,appointmentId:E,customerId:I,serviceId:me,formId:Ce,staffId:V,signatureType:ar,typedName:Fe.typedName,imageUrl:Fe.signatureDataUrl};ar==="CHECKBOX_ONLY"&&(Fi.isChecked=Fe.isChecked??!0),await Tf(Fi)}localStorage.removeItem(vr)};let Mi="";f&&(Mi=`${f?.year}-${String(f?.month).padStart(2,"0")}-${String(f?.day).padStart(2,"0")}`);const Un=async E=>{const I=E||h,V={tenantId:t,outletId:r,staffId:c?.id,date:Mi,startTime:m,serviceIds:y.map(z=>z.id),slotIds:u,isWalkIn:!1,requiresConsent:we.length>0,customer:{first_name:I?.firstName,last_name:I?.lastName,email:I?.email,phone:I?.phone}};if(we.length&&!Ri){Z.toast.warn("Please complete all consent forms first");return}try{C(!0);const z=await e(_r(V)).unwrap(),te=z?.data??z,ee=te.id||"",me=te.customerId||te.customer?.id||"",Ce=te.staffId||c?.id||"";p==="booking"&&ki>0&&await yc(ee,me,Ce),G==="card"?(R({appointmentId:ee,customerId:me}),b(!0)):(e(fr(String(ee))),e(Se()))}catch(z){const te=z?.payload?.message||z?.data?.message||z?.message||"Staff not working on this day";Z.toast.error(te)}finally{C(!1)}},gc=async E=>{const I={...E,phone:E?.phone??""};if(!G){Z.toast.error("Select payment method");return}if(!m&&p==="booking"){Z.toast.error("Select time");return}e(Gn(I)),we.length>0?Ri?await Un(I):await Di():await Un(I)},$c=async E=>{const I={...E,phone:E?.phone??""};if(!G){Z.toast.error("Select payment method");return}if(!m&&p==="booking"){Z.toast.error("Select time");return}e(Gn(I)),e(Ie(!0))},bc=E=>{const I=E.replace(/\s/g,"");return/^4/.test(I)?"VISA":/^5[1-5]/.test(I)?"MASTERCARD":/^3[47]/.test(I)?"AMEX":/^6/.test(I)?"DISCOVER":"UNKNOWN"},Nc=async E=>{try{C(!0);const I=T?.appointmentId,V=String(T?.customerId);if(!I||!r)return Z.toast.error("Something went wrong."),!1;const z=bc(E.number),te=await Of({appointmentId:I,customerId:V,outletId:r,referenceNo:I,currency:"USD",amountCents:Math.round(ji*100),tipAmountCents:G==="card"?dc:0,taxAmountCents:G==="card"?sc:0,transactionBody:{transactionOrigin:3,transactionCode:"WEB",isDebit:!0,processMethod:3,channelType:3,tenderInfo:{cardHolderName:E.name,cardNumber:E.number.replace(/\s/g,""),cardType:z,cardExpiry:Gy(E.expiry),cvData:E.cvv},billingContact:{name:{firstName:h?.firstName??"",lastName:h?.lastName??""},email:h?.email??""}}}),ee=te?.data?.data??te?.data??te??{},me=ee?.orderId;if(String(ee?.mappedStatus).toLowerCase()==="succeeded"||String(ee?.reasonMessage).toLowerCase()==="success"){if(Z.toast.success("Payment successful!"),me)try{await jf(me)}catch(Ce){Z.toast.warning(Ce instanceof Error?Ce.message:String(Ce??"Payment done, but finalize failed"))}}else Z.toast.warning("Payment pending");return b(!1),e(fr(String(T?.appointmentId))),e(Se()),!0}catch(I){return Z.toast.warning(I instanceof Error?I.message:"Payment failed, but appointment is booked"),b(!1),e(fr(String(T?.appointmentId))),e(Se()),!0}finally{C(!1)}},Sc=()=>{b(!1),Z.toast.warning("Appointment booked. Payment was cancelled."),e(fr(String(T?.appointmentId))),e(Se())};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)("div",{className:"aaravpos-aside",children:(0,o.jsx)(dl,{buttonText:"Book Appointment",onButtonClick:Ot(gc),showTip:G==="card",tipPct:v,onTipChange:E=>e(Rf(E??0)),consentRequired:we?.length>0,consentCompleted:ki,totalConsents:Ii,checkingConsent:q,loading:x})}),children:[(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Confirm Booking"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Review your appointment details before booking"}),(0,o.jsxs)("div",{className:"aaravpos-booking-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-outlet-info",children:[a&&(0,o.jsx)("div",{className:"aaravpos-outlet-logo",children:(0,o.jsx)("img",{src:a??"/logo.svg",alt:"Logo",className:"aaravpos-outlet-logo-img"})}),(0,o.jsxs)("div",{className:"aaravpos-outlet-content",children:[(0,o.jsx)("p",{className:"aaravpos-outlet-name",children:i??"-"}),(0,o.jsxs)("p",{className:"aaravpos-outlet-address",children:[s??"-",(0,o.jsx)("br",{})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-booking-scroll",children:[(0,o.jsxs)("div",{className:"aaravpos-booking-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-booking-column",children:[(0,o.jsx)(Ts,{children:"Appointment"}),(0,o.jsxs)(Ky,{children:[(0,o.jsxs)("div",{className:"aaravpos-appointment-header",children:[(0,o.jsx)(Yy,{pro:c}),(0,o.jsxs)("div",{className:"aaravpos-appointment-content",children:[(0,o.jsx)("p",{className:"aaravpos-appointment-name",children:c?.name}),(0,o.jsx)("p",{className:"aaravpos-appointment-services",children:y.map(E=>E.name).join(", ")})]}),(0,o.jsxs)("span",{className:"aaravpos-appointment-price",children:[(0,o.jsx)(re,{size:14}),Fn]})]}),(0,o.jsxs)("div",{className:"aaravpos-appointment-date",children:[(0,o.jsx)(ep,{size:18}),(0,o.jsx)("span",{className:"aaravpos-appointment-date-text",children:oc??"No time selected"})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-booking-column",children:[(0,o.jsx)(Ts,{children:"Payment Method"}),(0,o.jsx)(Xy,{icon:(0,o.jsx)(Op,{size:18}),label:"Pay in person",selected:G==="person",onClick:()=>J("person")})]})]}),G&&(0,o.jsxs)("form",{className:"aaravpos-tp-10",onSubmit:Ot($c),children:[(0,o.jsxs)("div",{className:"aaravpos-details-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{className:"aaravpos-form-label",htmlFor:"phone",children:["Phone"," ",!kn&&(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{control:at,name:"phone",rules:{validate:E=>{const I=!!Rn(E),V=!!kn?.trim();return!I&&!V?"Enter phone or email":I&&!na(E)?"Enter valid phone number":!0}},render:({field:E})=>(0,o.jsxs)("div",{className:"aaravpos-input-wrapper",children:[(0,o.jsx)(Vy,{...E,id:"phone",international:!0,countries:Wy,defaultCountry:"US",value:E.value||"",onChange:I=>Ai(I??"",E.onChange,"phone"),countryCallingCodeEditable:!1,className:"aaravpos-custom-input"}),x&&_==="phone"&&(0,o.jsx)("div",{className:"arravpos-loader-wrapper",children:(0,o.jsx)("div",{className:"arravpos-loader"})})]})}),it.phone&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.phone.message}),D&&(0,o.jsxs)("div",{className:"aaravpos-autofill-text",children:["Using existing customer"," ",(0,o.jsx)("span",{onClick:uc,className:"aaravpos-clear-text",children:"Clear"})]})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{htmlFor:"email",className:"aaravpos-form-label",children:["Email"," ",!In&&(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)("input",{id:"email",...Me("email",{validate:E=>{const I=!!E?.trim(),V=!!Rn(In);return!I&&!V?"Enter phone or email":I&&!/^\S+@\S+\.\S+$/.test(E)?"Invalid email":!0},onChange:E=>{Ai(E.target.value,null,"email")}}),autoComplete:"email",placeholder:"Email address",className:"aaravpos-custom-input"}),it.firstName&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.firstName.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{htmlFor:"first_name",className:"aaravpos-form-label",children:["First Name ",(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)("input",{id:"first_name",...Me("firstName",{required:"First name required",pattern:{value:/^[A-Za-z\s]+$/,message:"Only letters are allowed"}}),autoComplete:"given-name",placeholder:"First Name",className:"aaravpos-custom-input"}),it.firstName&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.firstName.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsx)("label",{htmlFor:"last_name",className:"aaravpos-form-label",children:"Last Name"}),(0,o.jsx)("input",{id:"last_name",autoComplete:"family-name",...Me("lastName"),placeholder:"Last Name",className:"aaravpos-custom-input"})]})]}),(0,o.jsx)("div",{className:"aaravpos-center-items",children:(0,o.jsx)("button",{type:"submit",disabled:tc,className:"aaravpos-form-btn",children:(0,o.jsx)("span",{className:"aaravpos-btn-content",children:"Confirm Details"})})})]})]})]})]})]}),N&&(0,o.jsx)(dh,{onClose:Sc,onPay:Nc,amount:ji}),oe&&pe&&(0,o.jsx)(jh,{enforcement:ue,heading:fe,consent:ne,onClose:vc,onConfirm:mc},pe??"consent")]})}function Ky({children:e}){return(0,o.jsx)("div",{className:"aaravpos-card-box",children:e})}function Yy({pro:e}){return(0,o.jsx)(o.Fragment,{children:e.imageUrl?(0,o.jsx)("img",{src:e.imageUrl,alt:e.name,className:"aaravpos-profile-image"}):(0,o.jsx)("div",{className:"aaravpos-profile-avatar",style:{background:e.color??"#111"},children:nt(e.name)})})}function Ts({children:e}){return(0,o.jsx)("p",{className:"aaravpos-section-label",children:e})}function Xy({icon:e,label:t,selected:r,onClick:n}){return(0,o.jsx)("div",{className:"aaravpos-paymentcard-wrapper",onClick:n,children:(0,o.jsx)("div",{className:"aaravpos-paymentcard-container",children:(0,o.jsx)("div",{className:`${r?"aaravpos-paymentcard-card active":"aaravpos-paymentcard-card"}`,children:(0,o.jsxs)("div",{className:"aaravpos-paymentcard-content",children:[(0,o.jsx)("div",{className:"aaravpos-paymentcard-icon",children:e}),(0,o.jsx)("div",{className:"aaravpos-paymentcard-info",children:(0,o.jsxs)("div",{className:"aaravpos-paymentcard-header",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"aaravpos-paymentcard-title",children:t}),(0,o.jsx)("p",{className:"aaravpos-paymentcard-description",children:"Payment will be collected at the outlet during your appointment."})]}),r&&(0,o.jsx)("div",{className:"aaravpos-paymentcard-check",children:(0,o.jsx)(ci,{size:18})})]})})]})})})})}function Zy(){const e=(0,M.useDispatch)(),t=(0,M.useSelector)(b=>b.booking.appointment.appointmentId),{tenantId:r}=(0,M.useSelector)(b=>b.booking.outletDetails),[n,a]=(0,S.useState)(null),[i,s]=(0,S.useState)(!0),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(!1);(0,S.useEffect)(()=>{if(!t){l("No appointment ID provided"),s(!1);return}(async()=>{try{const T=await Ef(t,r);T.success?a(T?.data?.appointment):l("Failed to load appointment details")}catch(T){console.error(T),l("An error occurred while fetching appointment details")}finally{s(!1)}})()},[t]);const f=()=>{ii.purge(),e({type:"RESET_ALL"})};if(i)return(0,o.jsx)("div",{className:"aaravpos-loading-container",children:(0,o.jsx)("p",{className:"aaravpos-loading-text",children:"Loading appointment details..."})});if(d||!n)return(0,o.jsxs)("div",{className:"aaravpos-error-container",children:[(0,o.jsx)("p",{className:"aaravpos-error-text",children:d||"Appointment not found"}),(0,o.jsxs)("button",{onClick:f,className:"aaravpos-book-btn",children:[(0,o.jsx)($o,{}),"Book Another Appointment"]})]});const{staff:m,outlet:h,services:p}=n,v=p?.reduce((b,T)=>b+Number(T.price||T.min_price||0),0),y=(n.tipsCents||0)/100,$=(n.taxCents||0)/100,g=(n.totalCents||0)/100,x=g>0?g.toFixed(2):(v+y+$).toFixed(2),C=c?p:p.slice(0,5),N=p.length-5;return(0,o.jsx)("div",{className:"aaravpos-success-wrapper",children:(0,o.jsxs)("div",{className:"aaravpos-success-motion",children:[(0,o.jsx)("div",{className:"aaravpos-success-icon success-pulse",children:(0,o.jsx)(ci,{})}),(0,o.jsx)("h1",{className:"aaravpos-success-title",children:"You're Booked!"}),(0,o.jsxs)("p",{className:"aaravpos-success-description",children:["Your appointment has been confirmed.",(0,o.jsx)("br",{}),"A confirmation has been sent to your email."]}),(0,o.jsxs)("div",{className:"aaravpos-success-content",children:[(0,o.jsxs)("div",{className:"aaravpos-success-card",children:[(0,o.jsxs)("div",{className:"aaravpos-success-row aaravpos-success-row-first",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Outlet Name"}),(0,o.jsx)("span",{className:"aaravpos-value",children:h?.outletName||"-"})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Professional"}),(0,o.jsx)("span",{className:"aaravpos-value",children:m?`${m?.firstName} ${m?.lastName}`:"-"})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row aaravpos-services-header",children:[(0,o.jsxs)("span",{className:"aaravpos-services-label",children:["Services (",p.length,")"]}),p.length>5&&(0,o.jsx)("button",{onClick:()=>u(b=>!b),className:"aaravpos-show-btn",children:c?"Hide":(0,o.jsxs)("span",{className:"aaravpos-show-btn-inner",children:["Show",(0,o.jsx)(ui,{size:16})]})})]}),(0,o.jsxs)("div",{className:"aaravpos-services-list",children:[C?.map(b=>(0,o.jsxs)("div",{className:"aaravpos-service-row",children:[(0,o.jsx)("span",{className:"aaravpos-service-name",children:b.serviceName}),(0,o.jsxs)("span",{className:"aaravpos-service-price",children:[(0,o.jsx)(re,{size:14}),Number(b.price).toFixed(2)]})]},b.id)),!c&&N>0&&(0,o.jsxs)("div",{className:"aaravpos-more-services",children:[(0,o.jsx)(fi,{size:14}),N," more services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Date & Time"}),(0,o.jsxs)("span",{className:"aaravpos-value",children:[n.appointmentDate," at"," ",n.start_time_12h]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Tip"}),(0,o.jsxs)("span",{className:"aaravpos-price",children:[(0,o.jsx)(re,{size:14}),y.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Tax"}),(0,o.jsxs)("span",{className:"aaravpos-price",children:[(0,o.jsx)(re,{size:14}),$.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-total-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Total Amount"}),(0,o.jsxs)("span",{className:"aaravpos-total-price",children:[(0,o.jsx)(re,{size:14}),x]})]})]}),(0,o.jsxs)("button",{onClick:f,className:"aaravpos-book-btn",children:[(0,o.jsx)($o,{}),"Book Another Appointment"]})]})]})})}function Jy(){const{currentStep:e}=(0,M.useSelector)(n=>n.booking.breadcrumbs),{isService:t}=(0,M.useSelector)(n=>n.booking.outletDetails),r={services:t?Xp:Yp,professionals:t?Kp:Gp,time:nh,confirm:Hy,success:Zy}[e];return(0,o.jsx)("div",{className:"aaravpos-layout",children:(0,o.jsx)("div",{className:"aaravpos-layout-content",children:(0,o.jsx)("div",{className:"aaravpos-layout-page",children:(0,o.jsx)(r,{})},e)})})}function Qy(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Jy,{}),(0,o.jsx)(Z.ToastContainer,{position:"top-right",autoClose:3e3})]})}var eg=({bookingCode:e})=>{const t=(0,M.useDispatch)(),r=(0,M.useSelector)(m=>m.booking.outletList.outlets),n=(0,M.useSelector)(m=>m.booking.theme),[a,i]=(0,S.useState)(!1),[s,d]=(0,S.useState)(null),{id:l}=(0,M.useSelector)(m=>m.booking.outletDetails),c=(0,S.useCallback)(async()=>{try{i(!0),d(null);const m=await co(e);if(m?.success){const h=m?.data?.data?.outlets||[];t(Ff(h)),t(If(m?.data?.result)),h.length===1&&f(h[0])}else d(m?.message||"Failed to fetch data")}catch(m){console.error(m),d(m?.message||"Something went wrong")}finally{i(!1)}},[e,t]),u=async(m,h)=>{try{const p=await co(e,m,h);p?.success||d(p?.message||"Failed to fetch outlet data"),t(Nf(p?.data?.token)),t(yf(p?.data?.data?.outlets[0]?.isService)),t(xf({superCategories:p?.data?.data?.superCategories,staff:p?.data?.data?.staff}))}catch(p){console.error(p),d(p?.message||"Something went wrong")}finally{i(!1)}},f=async m=>{m&&(await u(String(m?.tenantId),String(m?.id)),t(bf({...m,tenantId:m.tenantId??"",currency:m.currency??"",outletTimeZoneDate:he.DateTime.now().setZone(m?.timeZone).toFormat("yyyy-MM-dd"),outletTimeZoneYear:he.DateTime.fromISO(m?.createdAt,{zone:"utc"}).setZone(m?.timeZone).year})),t(ga(m?.isService?"services":"professionals")))};return(0,S.useEffect)(()=>{Array.isArray(r)&&r.length===0&&c()},[r?.length,c]),(0,S.useEffect)(()=>{n&&q0(n)},[n]),s?(0,o.jsx)("div",{className:"aaravpos-error-box",children:s}):!r.length&&a?(0,o.jsx)("div",{className:"aaravpos-loader-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-loader"})}):(0,o.jsx)("div",{className:"aaravpos-overflow-hidden",children:r.length>1&&!l?(0,o.jsx)(Fp,{outlets:r,onSelectOutlet:m=>{m?.id&&f(m)}}):(0,o.jsx)(Qy,{})})},tg=({...e})=>(0,o.jsx)(z0,{children:(0,o.jsx)(eg,{...e})});exports.AppointmentBookingPlugin=tg;
18
+ `,onClick:()=>t(String(e?.id)),children:[(0,o.jsx)("div",{className:"aaravpos-outlet-card-top",children:(0,o.jsx)(Mp,{status:e.isOpen})}),(0,o.jsx)("div",{className:"aaravpos-outlet-card-content",children:(0,o.jsxs)("div",{className:"aaravpos-outlet-card-inner",children:[(0,o.jsx)("h2",{className:"aaravpos-outlet-card-title",children:e.outletName}),(0,o.jsx)("p",{className:"aaravpos-outlet-card-address",children:e.address})]})})]});function Lp({outlets:e,onSelectOutlet:t}){const[r,n]=(0,S.useState)(null),[a,i]=(0,S.useState)(""),s=l=>{n(l);const c=e.find(u=>u.id==l);c&&setTimeout(()=>{t(c)},100)},d=(0,S.useMemo)(()=>{if(!a.trim())return e;const l=a.toLowerCase();return e.filter(c=>c.outletName?.toLowerCase().includes(l)||c.address?.toLowerCase().includes(l))},[e,a]);return(0,o.jsxs)("div",{className:"aaravpos-container",children:[(0,o.jsxs)("div",{className:"aaravpos-header",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-title",children:"Choose Your Outlet"}),(0,o.jsx)("div",{className:"aaravpos-outlet-divider"})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(hi,{size:14})}),(0,o.jsx)("input",{type:"text",placeholder:"Search outlet...",value:a,onChange:l=>i(l.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:a&&(0,o.jsx)("button",{onClick:()=>i(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{className:"aaravpos-outlet-list-wrapper",children:d.length>0?(0,o.jsx)("div",{className:"aaravpos-outlet-grid",children:d.map((l,c)=>(0,o.jsx)("div",{children:(0,o.jsx)(Fp,{item:l,onSelect:s,selected:r===l.id})},c))}):(0,o.jsx)("div",{className:"aaravpos-empty-state",children:(0,o.jsxs)("div",{className:"aaravpos-empty-content",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-title",children:"No outlets found"}),(0,o.jsx)("p",{className:"aaravpos-empty-text",children:"Try searching with a different keyword"})]})})})]})}var Bp={USD:rl,INR:fp,EUR:cp,GBP:Sp},re=({size:e=20})=>{const t=(0,M.useSelector)(r=>r.booking.outletDetails?.currency);return(0,o.jsx)(t?Bp[t]:rl,{size:e})},nt=(e="")=>{const t=e.trim().split(" ").filter(Boolean);return t.length===0?"":((t[0]?.[0]??"")+(t.length>1?t[t.length-1]?.[0]??"":"")).toUpperCase()},Up=e=>Number(e.price||e.min_price||0),No=(e,{perUnit:t=!1}={})=>{const r=Up(e),n=t?1:e.qty||1;return!e.taxRows||!e.taxRows.length?0:e.taxRows.reduce((a,i)=>i.isActive?i.taxType==="FIXED"?a+(i.taxRate||0)*n:i.taxType==="PERCENTAGE"?a+r*n*(i.taxRate||0)/100:a:a,0)},Zn=async()=>{try{const e=await fetch("https://api.ipify.org?format=json");if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return(await e.json()).ip}catch(e){return console.error("Failed to fetch public IP:",e),null}};function Vp(){const[e,t]=(0,S.useState)({width:0,height:0});return(0,S.useEffect)(()=>{const r=()=>{t({width:window.innerWidth,height:window.innerHeight})};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),e}var zp={services:[co,ut,pt],professionals:[co,ut,pt],time:[ut,pt],confirm:[]},qp={professionals:[ut,lo,pt],services:[lo,ut,pt],time:[ut,pt],confirm:[]},Wp=[{label:"Services",page:"services",icon:(0,o.jsx)(al,{size:16})},{label:"Professional",page:"professionals",icon:(0,o.jsx)(il,{size:16})},{label:"Time Slot",page:"time",icon:(0,o.jsx)(gt,{size:16})},{label:"Confirmation",page:"confirm",icon:(0,o.jsx)(wa,{size:16})}],Gp=[{label:"Professional",page:"professionals",icon:(0,o.jsx)(il,{size:16})},{label:"Service",page:"services",icon:(0,o.jsx)(al,{size:16})},{label:"Time",page:"time",icon:(0,o.jsx)(gt,{size:16})},{label:(0,o.jsxs)("span",{className:"flex items-center gap-1",children:["Done ",(0,o.jsx)(wa,{size:13})]}),page:"confirm",icon:(0,o.jsx)(wa,{size:16})}];function wt(){const e=(0,M.useDispatch)(),{width:t}=Vp(),{isOpenSidebar:r}=(0,M.useSelector)(C=>C.booking.theme),{isService:n}=(0,M.useSelector)(C=>C.booking.outletDetails),{selectedServices:a}=(0,M.useSelector)(C=>C.booking.service),i=(0,M.useSelector)(C=>C.booking.outletList.outlets),{currentStep:s,completedSteps:d}=(0,M.useSelector)(C=>C.booking.breadcrumbs),l=n?zp:qp,c=n?Wp:Gp,u=c.findIndex(C=>C.page===s),f=()=>{oi.purge(),e({type:"RESET_ALL"})},m=()=>{if(u===0&&i.length>1){f(),e(bf());return}if(u<=0)return;const C=c[u-1].page;l[C]?.forEach(x=>{e(x())}),e(oo(C)),e($a(C))},h=m,p=m,v=c[u],y=t<991,$=a?.reduce((C,x)=>C+x.qty,0),g=Array.isArray(i)&&i.length>1;return(0,o.jsx)(o.Fragment,{children:y?(0,o.jsxs)("div",{className:"aaravpos-mobile-stepper",children:[(0,o.jsx)("button",{onClick:h,className:"aaravpos-mobile-back-btn",children:(0,o.jsx)(Zr,{size:22})}),(0,o.jsx)("span",{className:"aaravpos-mobile-step-label",children:v?.label})]}):(0,o.jsxs)("div",{className:"aaravpos-desktop-stepper",children:[(0,o.jsx)("button",{onClick:g?p:h,className:"aaravpos-desktop-back-btn",children:(0,o.jsx)(Zr,{size:20})}),(0,o.jsx)("nav",{className:"aaravpos-step-nav",children:c.map((C,x)=>{const N=s===C.page,b=d?.includes(C.page)||x<=u;return(0,o.jsxs)("button",{onClick:()=>{if(!b)return;const T=C.page;c.findIndex(R=>R.page===T)<u&&(l[T]?.forEach(R=>{e(R())}),e(oo(T))),e($a(T))},className:`aaravpos-step-btn ${b?"clickable":"disabled"} ${N?"active":"inactive"}`,children:[(0,o.jsx)("span",{className:`aaravpos-step-icon ${N?"active":"inactive"}`,children:C.icon}),(0,o.jsx)("span",{children:C.label})]},C.page)})}),!r&&(0,o.jsxs)("button",{className:"aaravpos-cart-btn",onClick:()=>e(ke(!0)),children:[(0,o.jsx)("span",{className:"aaravpos-count",children:$}),(0,o.jsx)(Pp,{size:18})]})]})})}function Et({children:e,sidebar:t,renderButton:r}){const{isOpenSidebar:n}=(0,M.useSelector)(a=>a.booking.theme);return(0,o.jsxs)("div",{className:"aaravpos-main-layout",children:[(0,o.jsxs)("div",{className:n?"aaravpos-layout-wrapper":"",children:[(0,o.jsxs)("main",{className:"aaravpos-main-content",children:[e,r]}),(0,o.jsx)("aside",{className:`aaravpos-sidebar ${n?"open":""}`,children:t})]}),n&&(0,o.jsx)("div",{className:"aaravpos-sidebar-mobile",children:(0,o.jsx)("div",{className:"aaravpos-sidebar-mobile-content",children:t})})]})}var ol=({pro:e,selectedStaffServices:t=[],totalPrice:r=0,totalDuration:n=0,goToStep:a})=>{const i=(0,M.useDispatch)(),{outletName:s,isService:d}=(0,M.useSelector)(c=>c.booking.outletDetails),{selectedServices:l}=(0,M.useSelector)(c=>c.booking.service);return(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsx)("p",{className:"aaravpos-order-title",children:"Your Order"}),(0,o.jsxs)("p",{className:"aaravpos-order-subtitle",children:[s||"-"," Outlet"]}),(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>i(ke(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-body",children:[e?.id&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"aaravpos-order-section-title",style:{marginBottom:8},children:"Selected Professional"}),(0,o.jsxs)("div",{className:"aaravpos-pro-card aaravpos-display-flex aaravpos-mb-10 aaravpos-tp-10",children:[e.imageUrl?(0,o.jsx)("img",{src:e.imageUrl,alt:e.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:e.color||"#111"},children:nt(e.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:e.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:e.staff_type})]})]})]}),(0,o.jsx)("p",{className:"aaravpos-order-section-title",children:"Selected Services"}),(0,o.jsx)("ul",{className:d?d&&e?.id?"aaravpos-pro-order-list":"aaravpos-pro-order-list-single":"aaravpos-pro-order-list-pro",children:t?.length>0?(0,o.jsx)(o.Fragment,{children:t.map(c=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:c.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:c.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[c.min_time||c.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),c.price||c.min_price]})]})]},c.id))}):(0,o.jsx)(o.Fragment,{children:l?.length>0&&l?.map(c=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:c.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:c.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[c.min_time||c.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),c.price||c.min_price]})]})]},c.id))})})]}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-footer",children:[d&&e?.id&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Subtotal"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),r]})]}),(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Duration"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[n," min"]})]})]}),(0,o.jsx)("button",{disabled:d?!t.length:!e,onClick:()=>a("time"),className:"aaravpos-common-btn",children:(0,o.jsxs)("span",{className:"aaravpos-common-btn-content",children:[d?"Choose Time":"Choose Services",(0,o.jsx)(_t,{size:16})]})})]})]})]})]})};function Hp(){const e=(0,M.useDispatch)(),{staff:t,selectedProfessional:r}=(0,M.useSelector)(i=>i.booking.service),n=!t||t.length===0,a=i=>{if(!i?.futureLeaveDates?.length)return{isOnLeave:!1,availableFrom:null};const s=new Date,d=i.futureLeaveDates.find(l=>{if(l.status!=="APPROVED"||l.leaveType!=="FULL_DAY")return!1;const c=new Date(l.startDate),u=new Date(l.endDate);return s>=c&&s<=u});return d?.returnDate?.date?{isOnLeave:!0,availableFrom:new Date(d.returnDate.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})}:{isOnLeave:!1,availableFrom:null}};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(ol,{pro:r,goToStep:()=>e(Ce())}),children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Professional"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Available based on selected services"}),n&&(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No staff Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No staff available for selected services"})]}),(0,o.jsx)("div",{className:"aaravpos-staff-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-staff-grid",children:t?.map((i,s)=>{const{isOnLeave:d,availableFrom:l}=a(i);return(0,o.jsxs)("div",{onClick:()=>{e(ai(i)),e(ft(null)),e(Ce())},className:`aaravpos-pro-card ${r?.id===i.id?"active":""}`,children:[(0,o.jsxs)("div",{className:"aaravpos-display-flex",children:[i.imageUrl?(0,o.jsx)("img",{src:i.imageUrl,alt:i.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:i.color||"#111"},children:nt(i.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:i.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:i.staff_type})]})]}),d&&l&&(0,o.jsxs)("div",{className:"aaravpos-available-badge",children:[(0,o.jsx)("span",{className:"aaravpos-available-dot"}),(0,o.jsxs)("p",{className:"aaravpos-available-text",children:["Available from ",l]})]})]},s)})})})]})]})}var Kp=e=>Number(e.price||e.min_price||0),Ea=(e,{perUnit:t=!1}={})=>{const r=Kp(e),n=t?1:e.qty||1;return!e.taxRows||!e.taxRows.length?0:e.taxRows.reduce((a,i)=>i.isActive?i.taxType==="FIXED"?a+i.taxRate*n:i.taxType==="PERCENTAGE"?a+r*n*i.taxRate/100:a:a,0)};function Yp(){const e=(0,M.useDispatch)(),{staff:t,selectedServices:r,selectedProfessional:n}=(0,M.useSelector)(h=>h.booking.service),[a,i]=(0,S.useState)(!1),s=r.map(h=>h.id),d=(0,S.useMemo)(()=>{if(!n?.id)return[];const h=t.find(p=>p.id===n.id);return h?r.map(p=>{const v=h?.assignments?.find($=>$.id===p?.id),y={...p,price:v?.price||p.price||p.min_price||0,duration:v?.duration||p.estimated_time||p.min_time||0};return{...y,tax:Ea(y)}}):[]},[n,t,r]),l=d.reduce((h,p)=>h+Number(p.price||p.min_price||0)*p.qty,0),c=d.reduce((h,p)=>h+(p?.duration||0)*p.qty,0),u=(0,S.useMemo)(()=>s.length?t.filter(h=>{const p=h.assignments??[];return s?.every(v=>p.some(y=>String(y.id)===String(v)&&!!y?.assigned))}):[],[t,s]),f=s.length>0;(0,S.useEffect)(()=>{if(f&&u.length===0){const h=setTimeout(()=>i(!0),300);return()=>clearTimeout(h)}else i(!1)},[f,u]);const m=h=>{if(!h?.futureLeaveDates?.length)return{isOnLeave:!1,availableFrom:null};const p=new Date,v=h.futureLeaveDates.find(y=>{if(y.status!=="APPROVED"||y.leaveType!=="FULL_DAY")return!1;const $=new Date(y.startDate),g=new Date(y.endDate);return p>=$&&p<=g});return v?.returnDate?.date?{isOnLeave:!0,availableFrom:new Date(v.returnDate.date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})}:{isOnLeave:!1,availableFrom:null}};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(ol,{pro:n,selectedStaffServices:d,totalPrice:l,totalDuration:c,goToStep:()=>e(Ce())}),renderButton:null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Professional"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Available based on selected services"}),a&&(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No staff Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No staff available for selected services"})]}),(0,o.jsx)("div",{className:"aaravpos-staff-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-staff-grid",children:u.map((h,p)=>{const{isOnLeave:v,availableFrom:y}=m(h);return(0,o.jsxs)("div",{onClick:()=>{e(ai(h)),e(ft(null)),e(Ce())},className:`aaravpos-pro-card ${n?.id===h.id?"active":""}`,children:[(0,o.jsxs)("div",{className:"aaravpos-display-flex",children:[h.imageUrl?(0,o.jsx)("img",{src:h.imageUrl,alt:h.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:h.color||"#111"},children:nt(h.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:h.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:h.staff_type})]})]}),v&&y&&(0,o.jsxs)("div",{className:"aaravpos-available-badge",children:[(0,o.jsx)("span",{className:"aaravpos-available-dot"}),(0,o.jsxs)("p",{className:"aaravpos-available-text",children:["Available from ",y]})]})]},p)})})})]})]})}function sl({selectedServices:e,totalPrice:t,goToStep:r}){const n=(0,M.useDispatch)(),{outletName:a,isService:i}=(0,M.useSelector)(s=>s.booking?.outletDetails);return(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsx)("p",{className:"aaravpos-order-title",children:"Your Order"}),(0,o.jsxs)("p",{className:"aaravpos-order-subtitle",children:[a||"-"," Outlet"]}),(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>n(ke(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-body",children:[(0,o.jsx)("p",{className:"aaravpos-order-section-title",children:"SELECTED SERVICES"}),(0,o.jsx)("ul",{className:"aaravpos-order-list",children:e?.length>0&&e?.map(s=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:s.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:s.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[s.min_time||s.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),s.price||s.min_price]})]})]},s.id))})]}),(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-footer",children:[(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Subtotal"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),t]})]}),(0,o.jsx)("div",{children:(0,o.jsx)("button",{onClick:()=>r("professionals"),disabled:!e.length,className:"aaravpos-common-btn",children:(0,o.jsxs)("span",{className:"aaravpos-common-btn-content",children:[i?"Choose Professional":"Choose Time",(0,o.jsx)(_t,{size:16})]})})})]})]})]})}function dl(){return(0,o.jsx)("div",{className:"aaravpos-skeleton-card",children:(0,o.jsx)("div",{className:"aaravpos-skeleton-shimmer",style:{background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent)",animation:"shimmer 1.2s infinite"}})})}function Xp(){const e=(0,M.useDispatch)(),t=(0,S.useRef)(null),r=(0,S.useRef)(null),{superCategories:n,selectedServices:a,selectedProfessional:i,loading:s}=(0,M.useSelector)(N=>N.booking.service),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(null),[f,m]=(0,S.useState)(""),h=new Set(i?i?.assignments?.map(N=>N.id):[]),p=new Set(i?i?.assignments?.map(N=>N.categoryId):[]),v=n?.map(N=>({...N,categories:N.categories?.map(b=>({...b,services:b.services?.filter(T=>h.has(T.id))||[]})).filter(b=>p.has(b.id)&&b.services.length>0)||[]})).filter(N=>N.categories.length>0)||[],y=(0,S.useMemo)(()=>d?c?c?.services||[]:d?.categories?.flatMap(N=>N.services||[])||[]:[],[d,c]),$=(0,S.useMemo)(()=>v?.flatMap(N=>N.categories?.flatMap(b=>b.services||[]))||[],[v]),g=(0,S.useMemo)(()=>{const N=f.trim().toLowerCase();return N?$.filter(b=>b.name?.toLowerCase().includes(N)||b.description?.toLowerCase().includes(N)):y},[f,$,y]),C=N=>N.taxRows?.some(b=>b.isActive)||!1,x=a.reduce((N,b)=>N+Number(b.price||b.min_price||0)*b.qty,0);return(0,S.useEffect)(()=>{if(!v?.length)return;const N=v.find(b=>b?.categories?.some(T=>T?.services?.length>0));N&&!d&&(l(N),u(null))},[v,d]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(sl,{selectedServices:a,totalPrice:x,goToStep:()=>e(Ce())}),renderButton:g?.length>0?(0,o.jsx)("button",{onClick:()=>e(Ce()),disabled:!a.length,className:"aaravpos-btn",children:(0,o.jsxs)("span",{className:"aaravpos-btn-content",children:["Choose Professional ",(0,o.jsx)(_t,{size:16})]})}):null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsxs)("div",{className:"aaravpos-navbar-form",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Choose a Service"}),(0,o.jsxs)("p",{className:"aaravpos-sub-title",children:["Select from ",i?.name,"'s available services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(hi,{size:14})}),(0,o.jsx)("input",{id:"search",name:"search",type:"text",placeholder:"Search services...",value:f,onChange:N=>m(N.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:f&&(0,o.jsx)("button",{onClick:()=>m(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{ref:t,onWheel:N=>{t.current&&(t.current.scrollLeft+=N.deltaY)},className:"aaravpos-supercategory-wrapper",children:v?.map(N=>(0,o.jsx)("button",{onClick:()=>{l(N),u(null)},className:`aaravpos-supercategory-btn ${d?.id===N.id?"active":""}`,children:(0,o.jsx)("h3",{className:"aaravpos-supercategory-title",children:N?.isStandAloneCategory?"Standalone":N.name})},N.id))}),d?.categories?.some(N=>N?.services?.length>0)&&(0,o.jsxs)("div",{ref:r,onWheel:N=>{r.current&&(r.current.scrollLeft+=N.deltaY)},className:"aaravpos-supercategory-wrapper",children:[(0,o.jsxs)("button",{onClick:()=>u(null),className:`aaravpos-supercategory-btn ${c?"":"active"}`,children:["All Services (",d?.categories?.reduce((N,b)=>N+(b?.services?.length||0),0),")"]}),d?.categories?.map(N=>(0,o.jsxs)("button",{onClick:()=>u(N),className:`aaravpos-supercategory-btn ${c?.id===N.id?"active":""}`,children:[N.name," (",N.services.length,")"]},N.id))]}),(0,o.jsx)("div",{className:"aaravpos-services-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-services-grid",children:s?Array.from({length:10}).map((N,b)=>(0,o.jsx)(dl,{},b)):(0,o.jsx)(o.Fragment,{children:g?.length?g?.map((N,b)=>(0,o.jsxs)("div",{onClick:()=>{const T=a.find(R=>R.id===N.id);T&&T.qty===1?e(Yr(String(N.id))):e(Kr({...N,price:N.price?Number(N.price):void 0})),window.innerWidth>991&&e(ke(!0))},className:`aaravpos-service-card ${a.some(T=>T.id===N.id)?"active":""}`,children:[C(N)&&(0,o.jsx)("span",{className:"aaravpos-tax-badge",children:"TAX"}),ii(N)&&(0,o.jsx)("span",{className:"aaravpos-consent-badge",children:"CONSENT"}),(0,o.jsx)("p",{className:"aaravpos-service-title",children:N.name}),(0,o.jsxs)("div",{className:"aaravpos-service-description-wrapper",children:[(0,o.jsx)("p",{className:"aaravpos-service-description",children:N.description}),N.description&&N.description.length>30&&(0,o.jsx)("div",{className:"aaravpos-service-tooltip",children:N.description})]}),(0,o.jsxs)("p",{className:"aaravpos-service-price",children:[(0,o.jsx)("span",{children:N.estimated_time?`${N.estimated_time} min`:`${N.min_time}-${N.max_time} min`}),(0,o.jsx)("span",{className:"aaravpos-service-price-right",children:N.price?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14})," ",N.price]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14})," ",N.min_price," - ",(0,o.jsx)(re,{size:14})," ",N.max_price]})})]}),(0,o.jsxs)("div",{className:"aaravpos-service-actions",children:[(0,o.jsx)("button",{onClick:T=>{T.stopPropagation(),e(Yr(String(N.id))),window.innerWidth>991&&e(ke(!0))},className:"aaravpos-service-action-btn",children:(0,o.jsx)(nl,{size:14})}),(0,o.jsx)("span",{className:"aaravpos-service-qty",children:a.find(T=>T.id===N.id)?.qty||0}),(0,o.jsx)("button",{onClick:T=>{T.stopPropagation(),a.find(R=>R.id===N.id)?e(Id(String(N.id))):e(Kr({...N,price:N.price?Number(N.price):void 0})),window.innerWidth>991&&e(ke(!0))},className:"aaravpos-service-action-btn plus",children:(0,o.jsx)(pi,{size:14})})]})]},b)):(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Services Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:f?"No services found for your search.":"No services are available for this professional."})]})})})})]})]})}function Zp(){const e=(0,M.useDispatch)(),t=(0,S.useRef)(null),r=(0,S.useRef)(null),{superCategories:n,selectedServices:a,loading:i}=(0,M.useSelector)(g=>g.booking.service),{outletName:s}=(0,M.useSelector)(g=>g.booking?.outletDetails),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(null),[f,m]=(0,S.useState)(""),h=(0,S.useMemo)(()=>d?c?c?.services||[]:d?.categories?.flatMap(g=>g.services||[])||[]:[],[d,c]),p=(0,S.useMemo)(()=>n?.flatMap(g=>g?.categories?.flatMap(C=>C.services||[]))||[],[n]),v=(0,S.useMemo)(()=>{const g=f.trim().toLowerCase();return g?p.filter(C=>C.name?.toLowerCase().includes(g)||C.description?.toLowerCase().includes(g)):h},[f,p,h]),y=g=>g.taxRows?.some(C=>C.isActive)||!1,$=a.reduce((g,C)=>g+Number(C.price||C.min_price||0)*C.qty,0);return(0,S.useEffect)(()=>{if(!n?.length)return;const g=n.find(C=>C?.categories?.some(x=>x?.services?.length>0));g&&!d&&(l(g),u(null))},[n,d]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)(sl,{selectedServices:a,totalPrice:$,goToStep:()=>e(Ce())}),renderButton:v?.length>0?(0,o.jsx)("button",{onClick:()=>e(Ce()),disabled:!a.length,className:"aaravpos-btn",children:(0,o.jsxs)("span",{className:"aaravpos-btn-content",children:["Choose Professional ",(0,o.jsx)(_t,{size:16})]})}):null,children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsxs)("div",{className:"aaravpos-navbar-form",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Book A Service"}),(0,o.jsxs)("p",{className:"aaravpos-sub-title",children:["Select from"," ",(0,o.jsx)("span",{className:"aaravpos-text-bold",children:s})," Outlet's available services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-search-wrapper",children:[(0,o.jsx)("span",{className:"aaravpos-search-icon",children:(0,o.jsx)(hi,{size:14})}),(0,o.jsx)("input",{type:"text",placeholder:"Search services...",value:f,onChange:g=>m(g.target.value),className:"aaravpos-search-input"}),(0,o.jsx)("div",{className:"aaravpos-search-actions",children:f&&(0,o.jsx)("button",{onClick:()=>m(""),className:"aaravpos-search-clear",children:(0,o.jsx)(Ye,{size:16})})})]})]}),(0,o.jsx)("div",{ref:t,onWheel:g=>{t.current&&(t.current.scrollLeft+=g.deltaY)},className:"aaravpos-supercategory-wrapper",children:n?.filter(g=>g?.categories?.some(C=>C?.services?.length>0))?.map(g=>(0,o.jsx)("button",{onClick:()=>{l(g),u(null)},className:`aaravpos-supercategory-btn ${d?.id===g.id?"active":""}`,children:(0,o.jsx)("h3",{className:"aaravpos-supercategory-title",children:g?.isStandAloneCategory?"Standalone":g.name})},g.id))}),d?.categories?.some(g=>g?.services?.length>0)&&(0,o.jsxs)("div",{ref:r,onWheel:g=>{r.current&&(r.current.scrollLeft+=g.deltaY)},className:"aaravpos-supercategory-wrapper",children:[(0,o.jsxs)("button",{onClick:()=>u(null),className:`aaravpos-supercategory-btn ${c?"":"active"}`,children:["All Services (",d?.categories?.reduce((g,C)=>g+(C?.services?.length||0),0),")"]}),d?.categories?.filter(g=>g?.services?.length>0)?.map(g=>(0,o.jsxs)("button",{onClick:()=>u(g),className:`aaravpos-supercategory-btn ${c?.id===g.id?"active":""}`,children:[g.name," (",g.services.length,")"]},g.id))]}),(0,o.jsx)("div",{className:"aaravpos-services-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-services-grid",children:i?Array.from({length:10}).map((g,C)=>(0,o.jsx)(dl,{},C)):(0,o.jsx)(o.Fragment,{children:v?.length?v?.map((g,C)=>(0,o.jsxs)("div",{onClick:()=>{const x=a.find(N=>N.id===g.id);x&&x.qty===1?e(Yr(String(g.id))):e(Kr(g)),window.innerWidth>991&&e(ke(!0))},className:`aaravpos-service-card ${a.some(x=>x.id===g.id)?"active":""}`,children:[y(g)&&(0,o.jsx)("span",{className:"aaravpos-tax-badge",children:"TAX"}),ii(g)&&(0,o.jsx)("span",{className:"aaravpos-consent-badge",children:"CONSENT"}),(0,o.jsx)("p",{className:"aaravpos-service-title",children:g.name}),(0,o.jsxs)("div",{className:"aaravpos-service-description-wrapper",children:[(0,o.jsx)("p",{className:"aaravpos-service-description",children:g.description}),g.description&&g.description.length>30&&(0,o.jsx)("div",{className:"aaravpos-service-tooltip",children:g.description})]}),(0,o.jsxs)("p",{className:"aaravpos-service-price",children:[(0,o.jsx)("span",{children:g.estimated_time?`${g.estimated_time} min`:`${g.min_time}-${g.max_time} min`}),(0,o.jsx)("span",{className:"aaravpos-service-price-right",children:g.price?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),g.price]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),g.min_price," - ",(0,o.jsx)(re,{size:14}),g.max_price]})})]}),(0,o.jsxs)("div",{className:"aaravpos-service-actions",children:[(0,o.jsx)("button",{onClick:x=>{x.stopPropagation(),e(Yr(String(g.id))),window.innerWidth>991&&e(ke(!0))},className:"aaravpos-service-action-btn",children:(0,o.jsx)(nl,{size:14})}),(0,o.jsx)("span",{className:"aaravpos-service-qty",children:a.find(x=>x.id===g.id)?.qty||0}),(0,o.jsx)("button",{onClick:x=>{x.stopPropagation(),a.find(N=>N.id===g.id)?e(Id(String(g.id))):e(Kr(g)),window.innerWidth>991&&e(ke(!0))},className:"aaravpos-service-action-btn plus",children:(0,o.jsx)(pi,{size:14})})]})]},C)):(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Services Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:f?"No services found for your search.":"No services are available for selected category."})]})})})})]})]})}var kt=({dateObj:e,selectedProfessional:t,outletTimeZone:r})=>{if(!t)return!1;const n=me.DateTime.fromObject({year:e.year,month:e.month,day:e.day},{zone:r}),a=n.toISODate();if((t?.futureLeaveDates||[]).some(c=>{if(c.status!=="APPROVED"||c.leaveType!=="FULL_DAY")return!1;const u=c?.leavePeriod?.date;return u?me.DateTime.fromISO(u,{zone:"utc"}).toISODate()===a:!1}))return!0;const i=(t?.dateOverrides||[]).find(c=>me.DateTime.fromISO(c.date,{zone:"utc"}).toISODate()===a);if(i?.type==="CLOSED")return!0;if(i?.type==="TIME")return!1;const s=t?.weeklyHours?.weeklyJson||{},d={1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat",7:"sun"}[n.weekday],l=s?.[d];return!l||!!l.isClosed},Jp=e=>{try{if(!e)throw new Error("Missing timezone");const t=me.DateTime.now().setZone(e);if(!t.isValid)throw new Error("Invalid timezone");return Array.from({length:4},(r,n)=>{const a=t.plus({months:n}).startOf("month");return{label:a.toFormat("LLLL yyyy"),monthIdx:a.month,year:a.year,startDow:a.startOf("month").weekday%7,days:a.daysInMonth||0}})}catch(t){return console.error("generateMonths error:",t),[]}},Qp=["S","M","T","W","T","F","S"];function eh({isOpen:e,onClose:t}){const r=(0,M.useDispatch)(),{selectedDate:n}=(0,M.useSelector)(p=>p.booking.slots),{selectedProfessional:a}=(0,M.useSelector)(p=>p.booking.service),{timeZone:i}=(0,M.useSelector)(p=>p.booking.outletDetails),s=(0,S.useMemo)(()=>i?Jp(i):[],[i]),d=()=>{if(!n)return 0;const p=s.findIndex(v=>v.monthIdx===n.month&&v.year===n.year);return p>=0?p:0},[l,c]=(0,S.useState)(d());(0,S.useEffect)(()=>{if(!e||!n||!s.length)return;const p=s.findIndex(v=>v.monthIdx===n.month&&v.year===n.year);p>=0&&c(p)},[e,n,s]);const u=s[l];if(!e)return null;const f=me.DateTime.now().setZone(i??"UTC").startOf("day"),m=f.plus({months:3}).minus({days:1}),h=(p,v)=>{const y=me.DateTime.fromObject({year:u.year,month:p,day:v},{zone:i||"UTC"}),$={day:v,month:p,year:u.year,fullDate:y.toISODate()||""},g=y.startOf("day");g<f||g>m||kt({dateObj:$,selectedProfessional:a,outletTimeZone:i||"UTC"})||(r(ft({month:p,day:v,year:u.year})),t())};return(0,o.jsx)("div",{className:"aaravpos-date-modal-overlay",onClick:p=>p.target===p.currentTarget&&t(),children:(0,o.jsxs)("div",{className:"aaravpos-date-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-date-modal-header",children:[(0,o.jsx)("h2",{className:"aaravpos-date-modal-title",children:"Pick a Date"}),(0,o.jsx)("button",{onClick:t,className:"aaravpos-date-close-btn",children:(0,o.jsx)(Ye,{})})]}),(0,o.jsxs)("div",{className:"aaravpos-date-modal-body",children:[(0,o.jsxs)("div",{className:"aaravpos-date-nav",children:[(0,o.jsx)("button",{disabled:l===0,onClick:()=>c(p=>Math.max(p-1,0)),className:"aaravpos-date-nav-btn",children:(0,o.jsx)(Zr,{})}),(0,o.jsx)("div",{className:"aaravpos-date-month-label",children:u?.label}),(0,o.jsx)("button",{disabled:l===s.length-1,onClick:()=>c(p=>Math.min(p+1,s.length-1)),className:"aaravpos-date-nav-btn",children:(0,o.jsx)(_t,{})})]}),(0,o.jsxs)("div",{className:"aaravpos-calendar-grid",children:[Qp.map((p,v)=>(0,o.jsx)("div",{className:"aaravpos-calendar-weekday",children:p},v)),Array.from({length:u?.startDow||0}).map((p,v)=>(0,o.jsx)("div",{},`e${v}`)),Array.from({length:u?.days||0},(p,v)=>v+1).map(p=>{const v=n?.month===u?.monthIdx&&n?.day===p,y=u?.monthIdx===f.month&&p===f.day,$=me.DateTime.fromObject({year:u.year,month:u.monthIdx,day:p},{zone:i||"UTC"}),g={day:p,month:u.monthIdx,year:u.year,fullDate:$.toISODate()||""},C=$.startOf("day"),x=C<f,N=C>m,b=kt({dateObj:g,selectedProfessional:a,outletTimeZone:i||"UTC"});return(0,o.jsxs)("div",{onClick:()=>{b||h(u.monthIdx,p)},className:["aaravpos-calendar-day",!v&&!b&&"aaravpos-calendar-day-active",y&&!v&&"aaravpos-calendar-day-today",v&&"aaravpos-calendar-day-selected",b&&"aaravpos-calendar-day-disabled",(x||N)&&"aaravpos-calendar-day-disabled"].filter(Boolean).join(" "),children:[b&&(0,o.jsx)("div",{className:"aaravpos-calendar-day-slash"}),(0,o.jsx)("span",{className:"aaravpos-calendar-day-text",children:p})]},p)})]})]})]})})}var th=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ll({buttonText:e,onButtonClick:t,showTaxesOnlyIfTime:r=!1,showTip:n=!1,tipPct:a=0,onTipChange:i,consentRequired:s=!1,consentCompleted:d=0,totalConsents:l=0,checkingConsent:c=!1,loading:u=!1}){const f=(0,M.useDispatch)(),{selectedSlotIndexes:m,slots:h,selectedDate:p}=(0,M.useSelector)(_=>_.booking.slots),{staff:v,selectedServices:y,selectedProfessional:$}=(0,M.useSelector)(_=>_.booking.service),{timeZone:g}=(0,M.useSelector)(_=>_.booking.outletDetails),C=me.DateTime.now().setZone(g??"UTC"),[x,N]=(0,S.useState)(""),[b,T]=(0,S.useState)(!1),R=(0,S.useRef)(null),W=(0,S.useRef)(null),[Q,oe]=(0,S.useState)(0),ee=[0,5,10,15,20],pe=(0,S.useMemo)(()=>[...h?.morning||[],...h?.afternoon||[],...h?.evening||[]],[h]),$e=15,ne=(0,S.useMemo)(()=>{if(!$?.id)return[];const _=v?.find(j=>j.id===$.id);return _?y.map(j=>{const D=_.assignments?.find(K=>K.id===j.id),A={...j,price:D?.price||j.price||j.min_price||0,duration:D?.duration||j.estimated_time||j.min_time||0};return{...A,tax:Ea(A),unitTax:Ea(A,{perUnit:!0})}}):[]},[$,v,y]),ce=ne.reduce((_,j)=>_+Number(j.price||j.min_price)*(j.qty||1),0),ue=ne.reduce((_,j)=>_+Number(j.duration)*(j.qty||1),0),ae=Math.ceil(ue/$e),he=_=>{if(!pe.length)return"";const j=pe[_]?.start_time_12h,D=pe[_+ae-1];return!j||!D?"":`${j} - ${D.end_time_12h??D.start_time_12h}`},je=p||{day:C.day,month:C.month,year:C.year},be=m?.[0],O=be!==void 0?he(be):null,k=je.month??0,U=O?`${th[k-1]} ${je.day} at ${O}`:null,z=ne.reduce((_,j)=>_+j.tax,0),B=Number(a)||0,V=n?ce*B/100:0,F=ce+z+V;(0,S.useEffect)(()=>{n&&a==null&&i?.(0)},[n,a,i]);const w=(0,S.useMemo)(()=>u?"Processing...":c?"Checking consents...":s&&d<l?`Sign Consents (${d}/${l})`:(0,o.jsxs)(o.Fragment,{children:[e||"Book Appointment",(0,o.jsx)(gp,{})]}),[u,c,s,d,l,e]);return(0,S.useEffect)(()=>{const _=()=>{const D=R.current?.offsetHeight||0,A=W.current?.offsetHeight||0,K=(D+(window.innerWidth<=991?190:205)||0)+A;oe(window.innerHeight-K)};_();const j=new ResizeObserver(()=>{_()});return W.current&&j.observe(W.current),R.current&&j.observe(R.current),window.addEventListener("resize",_),()=>{j.disconnect(),window.removeEventListener("resize",_)}},[ne,n,d,l,b]),(0,o.jsxs)("div",{className:"aaravpos-order-sidebar",children:[(0,o.jsxs)("div",{className:"aaravpos-order-header",children:[(0,o.jsxs)("p",{className:"aaravpos-order-title",children:["Your Order",(0,o.jsx)("button",{className:"aaravpos-sidebar-close-btn",onClick:()=>f(ke(!1)),children:(0,o.jsx)(Ye,{size:18})})]}),$?.id&&(0,o.jsxs)("div",{className:"aaravpos-pro-card aaravpos-display-flex aaravpos-mb-10 aaravpos-tp-10",children:[$.imageUrl?(0,o.jsx)("img",{src:$.imageUrl,alt:$.name,className:"aaravpos-pro-image"}):(0,o.jsx)("div",{className:"aaravpos-pro-avatar",style:{background:$.color||"#111"},children:nt($.name)}),(0,o.jsxs)("div",{className:"aaravpos-pro-info",children:[(0,o.jsx)("p",{className:"aaravpos-pro-name",children:$.name}),(0,o.jsx)("p",{className:"aaravpos-pro-type",children:$.staff_type})]})]}),(0,o.jsxs)("div",{className:"aaravpos-date-time",children:[(0,o.jsx)("span",{className:"aaravpos-date-time-label",children:"Date & Time:"}),U?(0,o.jsx)("span",{className:"aaravpos-date-time-value",children:U}):(0,o.jsx)("span",{className:"aaravpos-date-time-empty",children:"No time selected"})]})]}),(0,o.jsx)("ul",{className:"aaravpos-order-list",style:{height:`${Q}px`},children:ne?.length>0&&ne.map(_=>(0,o.jsxs)("li",{className:"aaravpos-order-item",children:[(0,o.jsx)("div",{className:"aaravpos-main-text",children:(0,o.jsx)("p",{className:"aaravpos-order-service-name",children:_.name})}),(0,o.jsxs)("div",{className:"aaravpos-order-details",children:[(0,o.jsxs)("div",{className:"aaravpos-order-detail",children:[(0,o.jsx)(Jr,{size:13}),(0,o.jsx)("span",{children:_.qty})]}),(0,o.jsxs)("div",{className:"aaravpos-order-detail center",children:[(0,o.jsx)(gt,{size:13}),(0,o.jsxs)("span",{children:[_.min_time||_.estimated_time," min"]})]}),(0,o.jsxs)("p",{className:"aaravpos-order-detail right",children:[(0,o.jsx)(re,{size:12}),_.price||_.min_price]})]})]},_.id))}),(0,o.jsxs)("div",{className:"third",ref:W,children:[n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"aaravpos-tip-title",children:"Add Tip"}),(0,o.jsx)("div",{className:"aaravpos-tip-options",children:[...ee,"custom"].map((_,j)=>{const D=_==="custom",A=D?b:B===_,K=j===0,le=j===[...ee,"custom"].length-1;return(0,o.jsx)("button",{onClick:()=>{D?(T(!0),i?.(Number(x)||0)):(T(!1),N(""),i?.(Number(_)))},className:`aaravpos-tip-btn
19
+ ${K||le?"aaravpos-tip-btn-fixed":"aaravpos-tip-btn-flex"} ${A?"aaravpos-tip-btn-active":""}`,children:D?"Custom":_===0?"No tip":`${_}%`},_)})}),b&&(0,o.jsx)("div",{className:"aaravpos-tip-input-wrapper",children:(0,o.jsx)("input",{id:"number",name:"number",type:"number",placeholder:"Enter %",value:x,onChange:_=>{const j=_.target.value;(j===""||Number(j)>=0&&Number(j)<=100)&&(N(j),i?.(Number(j)||0))},className:"aaravpos-tip-input"})})]}),s&&d<l&&(0,o.jsxs)("div",{className:"aaravpos-consent-box",children:[(0,o.jsxs)("p",{className:"aaravpos-consent-text",children:["Consent Required: ",d,"/",l," completed"]}),(0,o.jsx)("div",{className:"aaravpos-consent-progress",children:(0,o.jsx)("div",{className:"aaravpos-consent-progress-bar",style:{width:`${d/l*100}%`}})})]}),(0,o.jsxs)("div",{className:"aaravpos-mt-auto",children:[(0,o.jsx)(Jn,{label:"Service",value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),ce.toFixed(2)]})}),n&&(0,o.jsx)(Jn,{label:`Tip (${B}%)`,value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),V.toFixed(2)]})}),(!r||O)&&(0,o.jsx)(Jn,{label:"Taxes",value:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(re,{size:14}),z.toFixed(2)]})}),(0,o.jsx)("div",{className:"aaravpos-divider"}),(0,o.jsxs)("div",{className:"aaravpos-order-subtotal",children:[(0,o.jsx)("span",{className:"aaravpos-order-subtotal-label",children:"Total"}),(0,o.jsxs)("span",{className:"aaravpos-order-subtotal-price",children:[(0,o.jsx)(re,{size:16}),F.toFixed(2)]})]}),(0,o.jsx)("button",{onClick:t,className:"aaravpos-common-btn aaravpos-padding-btn",style:{height:42},children:(0,o.jsx)("span",{className:"aaravpos-common-btn-content",children:w})})]})]})]})}function Jn({label:e,value:t}){return(0,o.jsxs)("div",{className:"aaravpos-summary-row",children:[(0,o.jsx)("span",{className:"aaravpos-summary-label",children:e}),(0,o.jsx)("span",{className:"aaravpos-summary-value",children:t})]})}function rh(){return(0,o.jsx)("div",{className:"aaravpos-barber-scroll-area",children:Array.from({length:3}).map((e,t)=>(0,o.jsx)("div",{className:"aaravpos-barber-slot-section",children:(0,o.jsxs)("div",{className:"aaravpos-barber-slot-section-header",children:[(0,o.jsx)("div",{className:"aaravpos-barber-slot-skeleton-title shimmer"}),(0,o.jsx)("div",{className:"aaravpos-barber-slot-skeleton-arrow shimmer"})]})},t))})}var So=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ah(){const e=(0,M.useDispatch)(),{socket:t}=z0(),[r,n]=(0,S.useState)(11),{staff:a,selectedServices:i,selectedProfessional:s}=(0,M.useSelector)(w=>w.booking.service),{isService:d}=(0,M.useSelector)(w=>w.booking.outletDetails),{tenantId:l,timeZone:c}=(0,M.useSelector)(w=>w?.booking?.outletDetails),{selectedSlotIndexes:u,selectedDate:f,selectedTime:m,slots:h,loading:p}=(0,M.useSelector)(w=>w.booking.slots),[v,y]=(0,S.useState)(!1),[$,g]=(0,S.useState)(0),C=15,x=(0,S.useMemo)(()=>[h.morning,h.afternoon,h.evening].flat(),[h]),N=(0,S.useMemo)(()=>me.DateTime.now().setZone(c).startOf("day"),[c]),b=(0,S.useMemo)(()=>N.plus({months:3}).minus({days:1}),[N]),T=i.map(w=>w.id),R=(0,S.useMemo)(()=>T.length?a.filter(w=>T.every(_=>w?.assignments?.some(j=>j.id===_&&j.assigned)??!1)):[],[a,T]),W=(0,S.useMemo)(()=>R.filter(w=>w.id!==s?.id),[R,s]),Q=w=>{w.id!==s?.id&&(e(ai(w)),e(ft(null)),e(ur(null)),e(cr({indexes:[],ids:[]})))},oe=(w,_)=>{try{if(!w.isValid||!_.isValid)throw new Error("Invalid timezone or date range");const j=Math.floor(_.diff(w,"days").days)+1;return Array.from({length:j},(D,A)=>{const K=w.plus({days:A});return{day:K.day,month:K.month,year:K.year,fullDate:K.toISODate()}})}catch(j){return console.error("generateDates error:",j),[]}},ee=(0,S.useMemo)(()=>oe(N,b),[N,b]),pe=(0,S.useMemo)(()=>{if(!s?.id)return[];const w=a?.find(_=>_.id===s.id);return w?i.map(_=>{const j=w.assignments?.find(D=>D.id===_.id);return{..._,price:j?.price||_.price||_.min_price||0,duration:j?.duration||_.estimated_time||_.min_time||0,qty:j?.qty||1}}):[]},[s,a,i]),$e=pe.reduce((w,_)=>w+Number(_.duration)*(_.qty||1),0),ne=Math.ceil($e/C),ce=f?me.DateTime.fromObject(f).toFormat("yyyy-MM-dd"):null,ue=(0,S.useCallback)(()=>{!s?.id||!ce||e(xr({tenantId:l,staffId:s.id,date:ce}))},[e,l,s?.id,ce]);(0,S.useEffect)(()=>{ue()},[ue]),(0,S.useEffect)(()=>{if(!t)return;const w=_=>{_.staffId===s?.id&&ue()};return t.on("appointment:updated",w),()=>{t.off("appointment:updated",w)}},[t,s?.id,ue]);const ae=w=>{g(_=>Math.max(0,Math.min(ee.length-r,_+w*4)))},he=()=>ee.find(w=>!kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"}));(0,S.useEffect)(()=>{if(f||!s)return;const w=he();w&&e(ft({day:w.day,month:w.month,year:w.year}))},[f,s,ee,c,e]),(0,S.useEffect)(()=>{if(!f||!ee.length)return;const w=ee.findIndex(_=>_.day===f.day&&_.month===f.month&&_.year===f.year);w!==-1&&g(Math.max(0,Math.min(ee.length-r,w-Math.floor(r/2))))},[f,ee,r]);const je=w=>{const _=me.DateTime.fromISO(w.fullDate||"",{zone:c||"UTC"}).startOf("day");if(_<N||_>b||kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"})){J.toast.warning("Staff is unavailable on this date");return}e(ft({day:w.day,month:w.month,year:w.year})),e(ur(null))},be=w=>{if(!x.length)return;const _=x.slice(w,w+ne);if(_.length<ne){J.toast.warning("You don't have sufficient time for selected service");return}if(_.some(D=>D.isBooked||D.status!=="AVAILABLE"||D.disabled)){J.toast.warning("Selected time range is not fully available");return}e(ur(x[w].start_time));const j=Array.from({length:ne},(D,A)=>w+A);e(cr({indexes:j,ids:j.map(D=>x[D]?.id)})),setTimeout(()=>{e(Ce())},200)};(0,S.useEffect)(()=>{if(!m||!x.length)return;const w=x.findIndex(j=>j.start_time===m);if(w===-1)return;const _=Array.from({length:ne},(j,D)=>w+D);_.length===u.length&&_.every((j,D)=>j===u[D])||e(cr({indexes:_,ids:_.map(j=>x[j]?.id)}))},[m,x,ne,u]),(0,S.useEffect)(()=>{const w=()=>{const _=window.innerWidth;_<350?n(2):_<420?n(3):_<575?n(4):_<680?n(6):_<991?n(8):_<1280?n(10):n(12)};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[]);const O=h?.morning||[],k=h?.afternoon||[],U=h?.evening||[],z=w=>w.some(_=>!_.isBooked&&_.status==="AVAILABLE"&&!_.disabled),B=()=>z(O)?"morning":z(k)?"afternoon":z(U)?"evening":null,[V,F]=(0,S.useState)(B());return(0,S.useEffect)(()=>{const w=x[u[0]];w&&(O.some(_=>_.id===w.id)?F("morning"):k.some(_=>_.id===w.id)?F("afternoon"):U.some(_=>_.id===w.id)&&F("evening"))},[u,x,O,k,U]),(0,S.useEffect)(()=>{e(ur(null)),e(cr({indexes:[],ids:[]}))},[f,e]),(0,o.jsxs)(Et,{sidebar:(0,o.jsx)("div",{className:"aaravpos-aside",children:(0,o.jsx)(ll,{buttonText:"Fill Details",onButtonClick:()=>{if(!m||!u.length){J.toast.warning("Please select a time slot");return}e(Ce())},showTaxesOnlyIfTime:!0})}),children:[(0,o.jsx)(wt,{}),(0,o.jsx)("div",{style:{marginTop:15},children:(0,o.jsx)("h1",{className:"aaravpos-page-title",style:{marginBottom:10},children:"Choose a Time"})}),(0,o.jsxs)("div",{className:"aaravpos-date-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-date-strip",children:[(0,o.jsx)(Co,{onClick:()=>ae(-1),children:(0,o.jsx)(Zr,{size:20})}),ee.slice($,$+r).map(w=>{const _=me.DateTime.fromObject({year:w.year,month:w.month,day:w.day},{zone:c||"UTC"}),j=_.weekday%7,D=me.DateTime.now().setZone(c).startOf("day"),A=_.hasSame(D,"day"),K=f?.day===w.day&&f?.month===w.month&&f?.year===w.year,le=_.startOf("day"),Fe=le<N,Ot=le>b,at=Fe||Ot||kt({dateObj:w,selectedProfessional:s,outletTimeZone:c||"UTC"});return(0,o.jsxs)("div",{onClick:()=>{at||je(w)},className:["aaravpos-date-card",Fe||Ot||at?"aaravpos-date-card-disabled":K?"aaravpos-date-card-active":"aaravpos-date-card-default"].filter(Boolean).join(" "),children:[at&&(0,o.jsx)("div",{className:"aaravpos-date-disabled-slash"}),(0,o.jsx)("span",{className:"aaravpos-date-week",children:nh[j]}),(0,o.jsx)("span",{className:"aaravpos-date-day",children:w.day}),A&&(0,o.jsx)("span",{className:"aaravpos-date-today",children:"TODAY"}),at&&(0,o.jsx)("span",{className:"aaravpos-date-unavailable",children:"UNAVAILABLE"})]},`${w.day}-${w.month}-${w.year}`)}),(0,o.jsx)(Co,{onClick:()=>ae(1),children:(0,o.jsx)(_t,{size:20})})]}),(0,o.jsxs)("button",{onClick:()=>y(!0),className:"aaravpos-calendar-btn",children:[(0,o.jsx)(Q0,{size:16}),f?.month!=null?`${So[f.month-1]} ${f.year}`:`${So[N.month-1]} ${N.year}`]})]}),(0,o.jsxs)("div",{className:"aaravpos-professional-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-selected-professional",children:[s?.imageUrl?(0,o.jsx)("img",{src:s.imageUrl,alt:s.name,className:"aaravpos-selected-professional-image"}):(0,o.jsx)("div",{className:"aaravpos-selected-professional-avatar",style:{background:s?.color||"#111"},children:nt(s?.name)}),(0,o.jsxs)("div",{className:"aaravpos-selected-professional-content",children:[(0,o.jsx)("p",{className:"aaravpos-selected-professional-name",children:s?.name}),(0,o.jsxs)("p",{className:"aaravpos-selected-professional-services",children:[pe.map(w=>w.name).join(", ")," ·"," ",$e," min"]})]})]}),d&&W.length>0&&(0,o.jsx)(ih,{professionals:R,selectedProfessional:s,onSelect:Q})]}),(0,o.jsxs)("div",{className:"aaravpos-scroll-area",style:p?{height:300}:{},children:[p?(0,o.jsx)(rh,{}):(0,o.jsx)(o.Fragment,{children:x?.length?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Qn,{label:"Morning",icon:(0,o.jsx)(kp,{size:18,className:"aaravpos-slot-icon"}),slots:O,allSlots:x,selectedSlotIndexes:u,handleSlotSelect:be,isOpen:V==="morning",onToggle:()=>F(V==="morning"?null:"morning")}),(0,o.jsx)(Qn,{label:"Afternoon",icon:(0,o.jsx)(Ap,{size:18,className:"aaravpos-slot-icon"}),slots:k,allSlots:x,selectedSlotIndexes:u,handleSlotSelect:be,isOpen:V==="afternoon",onToggle:()=>F(V==="afternoon"?null:"afternoon")}),(0,o.jsx)(Qn,{label:"Evening",icon:(0,o.jsx)(mp,{size:18,className:"aaravpos-slot-icon"}),slots:U,allSlots:x,selectedSlotIndexes:u,handleSlotSelect:be,isOpen:V==="evening",onToggle:()=>F(V==="evening"?null:"evening")})," "]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"aaravpos-supercategory-wrapper"}),(0,o.jsxs)("div",{className:"aaravpos-empty-services",children:[(0,o.jsx)("h3",{className:"aaravpos-empty-services-title",children:"No Slots Found"}),(0,o.jsx)("p",{className:"aaravpos-empty-services-text",children:"No slots available for selected date. Please choose a different date."})]})]})}),(0,o.jsx)(eh,{isOpen:v,onClose:()=>y(!1)})]})]})}function Co({onClick:e,children:t}){return(0,o.jsx)("button",{onClick:e,className:"aaravpos-date-nav-btn",children:t})}function Qn({icon:e,label:t,slots:r,allSlots:n,selectedSlotIndexes:a,handleSlotSelect:i,isOpen:s,onToggle:d}){return!r||r?.length===0?null:(0,o.jsxs)("div",{className:"aaravpos-slot-section",children:[(0,o.jsxs)("div",{onClick:d,className:"aaravpos-slot-section-header",children:[(0,o.jsxs)("div",{className:"aaravpos-slot-section-title",children:[(0,o.jsx)("span",{children:e}),t]}),(0,o.jsx)("span",{className:`aaravpos-slot-section-arrow ${s?"aaravpos-slot-section-arrow-open":""}`,children:(0,o.jsx)(fi,{})})]}),s&&(0,o.jsx)("div",{className:"aaravpos-slot-section-content",children:(0,o.jsx)("div",{className:"aaravpos-slot-grid",children:r.map(l=>{const c=n.findIndex(h=>h.id===l.id),u=a.includes(c),f=l.disabled,m=l.isBooked||l.status!=="AVAILABLE"||f;return(0,o.jsxs)("div",{onClick:()=>{m||i(c)},className:`aaravpos-slot-card ${m?"aaravpos-slot-card-disabled":u?"aaravpos-slot-card-selected":"aaravpos-slot-card-default"}`,children:[(0,o.jsx)("span",{className:"aaravpos-slot-time",children:l.start_time_12h}),(0,o.jsx)("span",{className:"aaravpos-slot-status",children:l.disabled?"":l.isBooked?"Booked":"Available"})]},l.id)})})})]})}function ih({professionals:e,selectedProfessional:t,onSelect:r}){const[n,a]=(0,S.useState)(!1);return(0,o.jsxs)("div",{className:"aaravpos-professional-dropdown",children:[(0,o.jsxs)("button",{onClick:()=>a(i=>!i),className:"aaravpos-professional-dropdown-btn",children:[(0,o.jsx)("span",{className:"aaravpos-professional-dropdown-text",children:"Choose Professional"}),(0,o.jsx)(fi,{size:18,className:`aaravpos-professional-dropdown-icon ${n?"aaravpos-professional-dropdown-icon-open":""}`})]}),n&&(0,o.jsx)("div",{className:"aaravpos-professional-dropdown-menu",children:e.filter(i=>i.id!==t?.id).map((i,s,d)=>(0,o.jsxs)("div",{onClick:()=>{r(i),a(!1)},className:`aaravpos-professional-dropdown-item ${s!==d.length-1?"aaravpos-professional-dropdown-item-border":""}`,children:[i.imageUrl?(0,o.jsx)("img",{src:i.imageUrl,className:"aaravpos-professional-dropdown-avatar",alt:i.name}):(0,o.jsx)("div",{className:"aaravpos-professional-dropdown-avatar-placeholder",style:{background:i.color||"#111"},children:nt(i.name)}),(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"aaravpos-professional-dropdown-name",children:i.name}),(0,o.jsx)("p",{className:"aaravpos-professional-dropdown-type",children:i.staff_type})]})]},i.id))})]})}var oh=e=>e.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim(),sh=e=>{const t=e.replace(/\D/g,"").slice(0,4);return t.length>=3?`${t.slice(0,2)}/${t.slice(2)}`:t},dh=e=>e.replace(/\D/g,"").slice(0,3);function lh({onClose:e,onPay:t,amount:r}){const{timeZone:n}=(0,M.useSelector)(u=>u.booking?.outletDetails),{control:a,handleSubmit:i,reset:s,formState:{errors:d,isSubmitting:l}}=(0,Ue.useForm)({defaultValues:{name:"",number:"",expiry:"",cvv:""}}),c=async u=>{await t({name:u.name.trim(),number:u.number.trim(),expiry:u.expiry,cvv:u.cvv})&&e()};return(0,o.jsx)("div",{className:"aaravpos-payment-overlay",children:(0,o.jsx)("form",{onSubmit:i(c),className:"aaravpos-payment-form",children:(0,o.jsxs)("div",{className:"aaravpos-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-payment-header",children:[(0,o.jsx)("h2",{className:"aaravpos-payment-title",children:"Make a payment"}),(0,o.jsxs)("span",{className:"aaravpos-payment-amount",children:[(0,o.jsx)(re,{size:14}),r?.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-fields",children:[(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"name",className:"aaravpos-payment-label",children:["Card Holder Name ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"name",control:a,rules:{required:"Name required",pattern:{value:/^[A-Za-z ]+$/,message:"Only letters allowed"}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"name",autoComplete:"cc-name",placeholder:"Card Holder Name",onChange:f=>{const m=f.target.value.replace(/[^A-Za-z ]/g,"");u.onChange(m)},className:"aaravpos-custom-input"})}),d.name&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.name.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"number",className:"aaravpos-payment-label",children:["Card Number ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"number",control:a,rules:{required:"Card number required",validate:u=>u.replace(/\s/g,"").length===16||"Must be 16 digits"},render:({field:u})=>(0,o.jsx)("input",{...u,id:"number",placeholder:"4242 4242 4242 4242",onChange:f=>{u.onChange(oh(f.target.value))},className:"aaravpos-custom-input"})}),d.number&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.number.message})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"expiry",className:"aaravpos-payment-label",children:["Expiry Date ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"expiry",control:a,rules:{required:"Expiry required",validate:u=>{if(!/^\d{2}\/\d{2}$/.test(u))return"Invalid format";const[f,m]=u.split("/").map(Number);if(f<1||f>12)return"Invalid month";const h=me.DateTime.now().setZone(n),p=h.year%100,v=h.month;return m<p||m===p&&f<v?"Card expired":!0}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"expiry",placeholder:"MM/YY",onChange:f=>{u.onChange(sh(f.target.value))},className:"aaravpos-custom-input"})}),d.expiry&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.expiry.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-control",children:[(0,o.jsxs)("label",{htmlFor:"cvv",className:"aaravpos-payment-label",children:["CVV ",(0,o.jsx)("span",{className:"aaravpos-payment-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{name:"cvv",control:a,rules:{required:"CVV required",minLength:{value:3,message:"3 digits required"}},render:({field:u})=>(0,o.jsx)("input",{...u,id:"cvv",placeholder:"CVV",onChange:f=>{u.onChange(dh(f.target.value))},className:"aaravpos-custom-input"})}),d.cvv&&(0,o.jsx)("p",{className:"aaravpos-payment-error",children:d.cvv.message})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-payment-btn-grid",children:[(0,o.jsx)("button",{type:"button",onClick:()=>{s(),e()},className:"aaravpos-payment-cancel-btn",children:"Cancel"}),(0,o.jsx)("button",{type:"submit",disabled:l,className:"aaravpos-payment-submit-btn",children:l?"Processing...":"Proceed"})]})]})})})}function Pa(){return Pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pa.apply(null,arguments)}function ch(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function uh(e,t){if(e==null)return{};var r,n,a=ch(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function $t(e){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(e)}function fh(e,t){if($t(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($t(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ph(e){var t=fh(e,"string");return $t(t)=="symbol"?t:t+""}function xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ph(n.key),n)}}function hh(e,t,r){return t&&xo(e.prototype,t),r&&xo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(e,t){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oa(e,t)}function vh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oa(e,t)}function Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(e)}function cl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cl=function(){return!!e})()}function yh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gh(e,t){if(t&&($t(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yh(e)}function $h(e){var t=cl();return function(){var r,n=Qr(e);if(t){var a=Qr(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return gh(this,r)}}var bh=Oe((e=>{var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,a=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,d=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,v=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,$=t?Symbol.for("react.fundamental"):60117,g=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function x(b){if(typeof b=="object"&&b!==null){var T=b.$$typeof;switch(T){case r:switch(b=b.type,b){case c:case u:case a:case s:case i:case m:return b;default:switch(b=b&&b.$$typeof,b){case l:case f:case v:case p:case d:return b;default:return T}}case n:return T}}}function N(b){return x(b)===u}e.AsyncMode=c,e.ConcurrentMode=u,e.ContextConsumer=l,e.ContextProvider=d,e.Element=r,e.ForwardRef=f,e.Fragment=a,e.Lazy=v,e.Memo=p,e.Portal=n,e.Profiler=s,e.StrictMode=i,e.Suspense=m,e.isAsyncMode=function(b){return N(b)||x(b)===c},e.isConcurrentMode=N,e.isContextConsumer=function(b){return x(b)===l},e.isContextProvider=function(b){return x(b)===d},e.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===r},e.isForwardRef=function(b){return x(b)===f},e.isFragment=function(b){return x(b)===a},e.isLazy=function(b){return x(b)===v},e.isMemo=function(b){return x(b)===p},e.isPortal=function(b){return x(b)===n},e.isProfiler=function(b){return x(b)===s},e.isStrictMode=function(b){return x(b)===i},e.isSuspense=function(b){return x(b)===m},e.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===a||b===u||b===s||b===i||b===m||b===h||typeof b=="object"&&b!==null&&(b.$$typeof===v||b.$$typeof===p||b.$$typeof===d||b.$$typeof===l||b.$$typeof===f||b.$$typeof===$||b.$$typeof===g||b.$$typeof===C||b.$$typeof===y)},e.typeOf=x})),Nh=Oe((e=>{process.env.NODE_ENV!=="production"&&(function(){"use strict";var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,a=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,d=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,v=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,$=t?Symbol.for("react.fundamental"):60117,g=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function x(A){return typeof A=="string"||typeof A=="function"||A===a||A===u||A===s||A===i||A===m||A===h||typeof A=="object"&&A!==null&&(A.$$typeof===v||A.$$typeof===p||A.$$typeof===d||A.$$typeof===l||A.$$typeof===f||A.$$typeof===$||A.$$typeof===g||A.$$typeof===C||A.$$typeof===y)}function N(A){if(typeof A=="object"&&A!==null){var K=A.$$typeof;switch(K){case r:var le=A.type;switch(le){case c:case u:case a:case s:case i:case m:return le;default:var Fe=le&&le.$$typeof;switch(Fe){case l:case f:case v:case p:case d:return Fe;default:return K}}case n:return K}}}var b=c,T=u,R=l,W=d,Q=r,oe=f,ee=a,pe=v,$e=p,ne=n,ce=s,ue=i,ae=m,he=!1;function je(A){return he||(he=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),be(A)||N(A)===c}function be(A){return N(A)===u}function O(A){return N(A)===l}function k(A){return N(A)===d}function U(A){return typeof A=="object"&&A!==null&&A.$$typeof===r}function z(A){return N(A)===f}function B(A){return N(A)===a}function V(A){return N(A)===v}function F(A){return N(A)===p}function w(A){return N(A)===n}function _(A){return N(A)===s}function j(A){return N(A)===i}function D(A){return N(A)===m}e.AsyncMode=b,e.ConcurrentMode=T,e.ContextConsumer=R,e.ContextProvider=W,e.Element=Q,e.ForwardRef=oe,e.Fragment=ee,e.Lazy=pe,e.Memo=$e,e.Portal=ne,e.Profiler=ce,e.StrictMode=ue,e.Suspense=ae,e.isAsyncMode=je,e.isConcurrentMode=be,e.isContextConsumer=O,e.isContextProvider=k,e.isElement=U,e.isForwardRef=z,e.isFragment=B,e.isLazy=V,e.isMemo=F,e.isPortal=w,e.isProfiler=_,e.isStrictMode=j,e.isSuspense=D,e.isValidElementType=x,e.typeOf=N})()})),ul=Oe(((e,t)=>{process.env.NODE_ENV==="production"?t.exports=bh():t.exports=Nh()})),Sh=Oe(((e,t)=>{var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(d){if(d==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(d)}function s(){try{if(!Object.assign)return!1;var d=new String("abc");if(d[5]="de",Object.getOwnPropertyNames(d)[0]==="5")return!1;for(var l={},c=0;c<10;c++)l["_"+String.fromCharCode(c)]=c;if(Object.getOwnPropertyNames(l).map(function(f){return l[f]}).join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}t.exports=s()?Object.assign:function(d,l){for(var c,u=i(d),f,m=1;m<arguments.length;m++){c=Object(arguments[m]);for(var h in c)n.call(c,h)&&(u[h]=c[h]);if(r){f=r(c);for(var p=0;p<f.length;p++)a.call(c,f[p])&&(u[f[p]]=c[f[p]])}}return u}})),mi=Oe(((e,t)=>{var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r})),fl=Oe(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),Ch=Oe(((e,t)=>{var r=function(){};if(process.env.NODE_ENV!=="production"){var n=mi(),a={},i=fl();r=function(d){var l="Warning: "+d;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function s(d,l,c,u,f){if(process.env.NODE_ENV!=="production"){for(var m in d)if(i(d,m)){var h;try{if(typeof d[m]!="function"){var p=Error((u||"React class")+": "+c+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}h=d[m](l,m,u,c,null,n)}catch(y){h=y}if(h&&!(h instanceof Error)&&r((u||"React class")+": type specification of "+c+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in a)){a[h.message]=!0;var v=f?f():"";r("Failed "+c+" type: "+h.message+(v??""))}}}}s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},t.exports=s})),xh=Oe(((e,t)=>{var r=ul(),n=Sh(),a=mi(),i=fl(),s=Ch(),d=function(){};process.env.NODE_ENV!=="production"&&(d=function(c){var u="Warning: "+c;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function l(){return null}t.exports=function(c,u){var f=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function h(O){var k=O&&(f&&O[f]||O[m]);if(typeof k=="function")return k}var p="<<anonymous>>",v={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:x(),arrayOf:N,element:b(),elementType:T(),instanceOf:R,node:ee(),objectOf:Q,oneOf:W,oneOfType:oe,shape:$e,exact:ne};function y(O,k){return O===k?O!==0||1/O===1/k:O!==O&&k!==k}function $(O,k){this.message=O,this.data=k&&typeof k=="object"?k:{},this.stack=""}$.prototype=Error.prototype;function g(O){if(process.env.NODE_ENV!=="production")var k={},U=0;function z(V,F,w,_,j,D,A){if(_=_||p,D=D||w,A!==a){if(u){var K=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=_+":"+w;!k[le]&&U<3&&(d("You are manually calling a React.PropTypes validation function for the `"+D+"` prop on `"+_+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[le]=!0,U++)}}return F[w]==null?V?F[w]===null?new $("The "+j+" `"+D+"` is marked as required "+("in `"+_+"`, but its value is `null`.")):new $("The "+j+" `"+D+"` is marked as required in "+("`"+_+"`, but its value is `undefined`.")):null:O(F,w,_,j,D)}var B=z.bind(null,!1);return B.isRequired=z.bind(null,!0),B}function C(O){function k(U,z,B,V,F,w){var _=U[z];if(ae(_)!==O){var j=he(_);return new $("Invalid "+V+" `"+F+"` of type "+("`"+j+"` supplied to `"+B+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return g(k)}function x(){return g(l)}function N(O){function k(U,z,B,V,F){if(typeof O!="function")return new $("Property `"+F+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var w=U[z];if(!Array.isArray(w)){var _=ae(w);return new $("Invalid "+V+" `"+F+"` of type "+("`"+_+"` supplied to `"+B+"`, expected an array."))}for(var j=0;j<w.length;j++){var D=O(w,j,B,V,F+"["+j+"]",a);if(D instanceof Error)return D}return null}return g(k)}function b(){function O(k,U,z,B,V){var F=k[U];if(!c(F)){var w=ae(F);return new $("Invalid "+B+" `"+V+"` of type "+("`"+w+"` supplied to `"+z+"`, expected a single ReactElement."))}return null}return g(O)}function T(){function O(k,U,z,B,V){var F=k[U];if(!r.isValidElementType(F)){var w=ae(F);return new $("Invalid "+B+" `"+V+"` of type "+("`"+w+"` supplied to `"+z+"`, expected a single ReactElement type."))}return null}return g(O)}function R(O){function k(U,z,B,V,F){if(!(U[z]instanceof O)){var w=O.name||p,_=be(U[z]);return new $("Invalid "+V+" `"+F+"` of type "+("`"+_+"` supplied to `"+B+"`, expected ")+("instance of `"+w+"`."))}return null}return g(k)}function W(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?d("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):d("Invalid argument supplied to oneOf, expected an array.")),l;function k(U,z,B,V,F){for(var w=U[z],_=0;_<O.length;_++)if(y(w,O[_]))return null;var j=JSON.stringify(O,function(A,K){return he(K)==="symbol"?String(K):K});return new $("Invalid "+V+" `"+F+"` of value `"+String(w)+"` "+("supplied to `"+B+"`, expected one of "+j+"."))}return g(k)}function Q(O){function k(U,z,B,V,F){if(typeof O!="function")return new $("Property `"+F+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var w=U[z],_=ae(w);if(_!=="object")return new $("Invalid "+V+" `"+F+"` of type "+("`"+_+"` supplied to `"+B+"`, expected an object."));for(var j in w)if(i(w,j)){var D=O(w,j,B,V,F+"."+j,a);if(D instanceof Error)return D}return null}return g(k)}function oe(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&d("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var k=0;k<O.length;k++){var U=O[k];if(typeof U!="function")return d("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+je(U)+" at index "+k+"."),l}function z(B,V,F,w,_){for(var j=[],D=0;D<O.length;D++){var A=O[D],K=A(B,V,F,w,_,a);if(K==null)return null;K.data&&i(K.data,"expectedType")&&j.push(K.data.expectedType)}var le=j.length>0?", expected one of type ["+j.join(", ")+"]":"";return new $("Invalid "+w+" `"+_+"` supplied to "+("`"+F+"`"+le+"."))}return g(z)}function ee(){function O(k,U,z,B,V){return ce(k[U])?null:new $("Invalid "+B+" `"+V+"` supplied to "+("`"+z+"`, expected a ReactNode."))}return g(O)}function pe(O,k,U,z,B){return new $((O||"React class")+": "+k+" type `"+U+"."+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function $e(O){function k(U,z,B,V,F){var w=U[z],_=ae(w);if(_!=="object")return new $("Invalid "+V+" `"+F+"` of type `"+_+"` "+("supplied to `"+B+"`, expected `object`."));for(var j in O){var D=O[j];if(typeof D!="function")return pe(B,V,F,j,he(D));var A=D(w,j,B,V,F+"."+j,a);if(A)return A}return null}return g(k)}function ne(O){function k(U,z,B,V,F){var w=U[z],_=ae(w);if(_!=="object")return new $("Invalid "+V+" `"+F+"` of type `"+_+"` "+("supplied to `"+B+"`, expected `object`."));for(var j in n({},U[z],O)){var D=O[j];if(i(O,j)&&typeof D!="function")return pe(B,V,F,j,he(D));if(!D)return new $("Invalid "+V+" `"+F+"` key `"+j+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(U[z],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var A=D(w,j,B,V,F+"."+j,a);if(A)return A}return null}return g(k)}function ce(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(ce);if(O===null||c(O))return!0;var k=h(O);if(k){var U=k.call(O),z;if(k!==O.entries){for(;!(z=U.next()).done;)if(!ce(z.value))return!1}else for(;!(z=U.next()).done;){var B=z.value;if(B&&!ce(B[1]))return!1}}else return!1;return!0;default:return!1}}function ue(O,k){return O==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function ae(O){var k=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":ue(k,O)?"symbol":k}function he(O){if(typeof O>"u"||O===null)return""+O;var k=ae(O);if(k==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return k}function je(O){var k=he(O);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function be(O){return!O.constructor||!O.constructor.name?p:O.constructor.name}return v.checkPropTypes=s,v.resetWarningCache=s.resetWarningCache,v.PropTypes=v,v}})),_h=Oe(((e,t)=>{var r=mi();function n(){}function a(){}a.resetWarningCache=n,t.exports=function(){function i(l,c,u,f,m,h){if(h!==r){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}i.isRequired=i;function s(){return i}var d={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:a,resetWarningCache:n};return d.PropTypes=d,d}})),wh=Oe(((e,t)=>{if(process.env.NODE_ENV!=="production"){var r=ul(),n=!0;t.exports=xh()(r.isElement,n)}else t.exports=_h()()})),P=Jt(wh(),1);function rt(e,t,r){this.x=e,this.y=t,this.time=r||new Date().getTime()}rt.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};rt.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};rt.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function vi(e,t,r,n){this.startPoint=e,this.control1=t,this.control2=r,this.endPoint=n}vi.prototype.length=function(){for(var e=10,t=0,r=void 0,n=void 0,a=0;a<=e;a+=1){var i=a/e,s=this._point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),d=this._point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(a>0){var l=s-r,c=d-n;t+=Math.sqrt(l*l+c*c)}r=s,n=d}return t};vi.prototype._point=function(e,t,r,n,a){return t*(1-e)*(1-e)*(1-e)+3*r*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e};function Eh(e,t,r){var n,a,i,s=null,d=0;r||(r={});var l=function(){d=r.leading===!1?0:Date.now(),s=null,i=e.apply(n,a),s||(n=a=null)};return function(){var c=Date.now();!d&&r.leading===!1&&(d=c);var u=t-(c-d);return n=this,a=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),d=c,i=e.apply(n,a),s||(n=a=null)):!s&&r.trailing!==!1&&(s=setTimeout(l,u)),i}}function X(e,t){var r=this,n=t||{};this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle="throttle"in n?n.throttle:16,this.minDistance="minDistance"in n?n.minDistance:5,this.throttle?this._strokeMoveUpdate=Eh(X.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=X.prototype._strokeUpdate,this.dotSize=n.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.onBegin=n.onBegin,this.onEnd=n.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(a){a.which===1&&(r._mouseButtonDown=!0,r._strokeBegin(a))},this._handleMouseMove=function(a){r._mouseButtonDown&&r._strokeMoveUpdate(a)},this._handleMouseUp=function(a){a.which===1&&r._mouseButtonDown&&(r._mouseButtonDown=!1,r._strokeEnd(a))},this._handleTouchStart=function(a){if(a.targetTouches.length===1){var i=a.changedTouches[0];r._strokeBegin(i)}},this._handleTouchMove=function(a){a.preventDefault();var i=a.targetTouches[0];r._strokeMoveUpdate(i)},this._handleTouchEnd=function(a){a.target===r._canvas&&(a.preventDefault(),r._strokeEnd(a))},this.on()}X.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0};X.prototype.fromDataURL=function(e){var t=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new Image,a=r.ratio||window.devicePixelRatio||1,i=r.width||this._canvas.width/a,s=r.height||this._canvas.height/a;this._reset(),n.src=e,n.onload=function(){t._ctx.drawImage(n,0,0,i,s)},this._isEmpty=!1};X.prototype.toDataURL=function(e){var t;switch(e){case"image/svg+xml":return this._toSVG();default:for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return(t=this._canvas).toDataURL.apply(t,[e].concat(n))}};X.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()};X.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)};X.prototype.isEmpty=function(){return this._isEmpty};X.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)};X.prototype._strokeUpdate=function(e){var t=e.clientX,r=e.clientY,n=this._createPoint(t,r),a=this._data[this._data.length-1],i=a&&a[a.length-1],s=i&&n.distanceTo(i)<this.minDistance;if(!(i&&s)){var d=this._addPoint(n),l=d.curve,c=d.widths;l&&c&&this._drawCurve(l,c.start,c.end),this._data[this._data.length-1].push({x:n.x,y:n.y,time:n.time,color:this.penColor})}};X.prototype._strokeEnd=function(e){var t=this.points.length>2,r=this.points[0];if(!t&&r&&this._drawDot(r),r){var n=this._data[this._data.length-1],a=n[n.length-1];r.equals(a)||n.push({x:r.x,y:r.y,time:r.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};X.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};X.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};X.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};X.prototype._createPoint=function(e,t,r){var n=this._canvas.getBoundingClientRect();return new rt(e-n.left,t-n.top,r||new Date().getTime())};X.prototype._addPoint=function(e){var t=this.points,r=void 0;if(t.push(e),t.length>2){t.length===3&&t.unshift(t[0]),r=this._calculateCurveControlPoints(t[0],t[1],t[2]);var n=r.c2;r=this._calculateCurveControlPoints(t[1],t[2],t[3]);var a=r.c1,i=new vi(t[1],n,a,t[2]),s=this._calculateCurveWidths(i);return t.shift(),{curve:i,widths:s}}return{}};X.prototype._calculateCurveControlPoints=function(e,t,r){var n=e.x-t.x,a=e.y-t.y,i=t.x-r.x,s=t.y-r.y,d={x:(e.x+t.x)/2,y:(e.y+t.y)/2},l={x:(t.x+r.x)/2,y:(t.y+r.y)/2},c=Math.sqrt(n*n+a*a),u=Math.sqrt(i*i+s*s),f=d.x-l.x,m=d.y-l.y,h=u/(c+u),p={x:l.x+f*h,y:l.y+m*h},v=t.x-p.x,y=t.y-p.y;return{c1:new rt(d.x+v,d.y+y),c2:new rt(l.x+v,l.y+y)}};X.prototype._calculateCurveWidths=function(e){var t=e.startPoint,r=e.endPoint,n={start:null,end:null},a=this.velocityFilterWeight*r.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(a);return n.start=this._lastWidth,n.end=i,this._lastVelocity=a,this._lastWidth=i,n};X.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};X.prototype._drawPoint=function(e,t,r){var n=this._ctx;n.moveTo(e,t),n.arc(e,t,r,0,2*Math.PI,!1),this._isEmpty=!1};X.prototype._drawCurve=function(e,t,r){var n=this._ctx,a=r-t,i=Math.floor(e.length());n.beginPath();for(var s=0;s<i;s+=1){var d=s/i,l=d*d,c=l*d,u=1-d,f=u*u,m=f*u,h=m*e.startPoint.x;h+=3*f*d*e.control1.x,h+=3*u*l*e.control2.x,h+=c*e.endPoint.x;var p=m*e.startPoint.y;p+=3*f*d*e.control1.y,p+=3*u*l*e.control2.y,p+=c*e.endPoint.y;var v=t+c*a;this._drawPoint(h,p,v)}n.closePath(),n.fill()};X.prototype._drawDot=function(e){var t=this._ctx,r=typeof this.dotSize=="function"?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,r),t.closePath(),t.fill()};X.prototype._fromData=function(e,t,r){for(var n=0;n<e.length;n+=1){var a=e[n];if(a.length>1)for(var i=0;i<a.length;i+=1){var s=a[i],d=new rt(s.x,s.y,s.time),l=s.color;if(i===0)this.penColor=l,this._reset(),this._addPoint(d);else if(i!==a.length-1){var c=this._addPoint(d),u=c.curve,f=c.widths;u&&f&&t(u,f,l)}}else{this._reset();var m=a[0];r(m)}}};X.prototype._toSVG=function(){var e=this,t=this._data,r=this._canvas,n=Math.max(window.devicePixelRatio||1,1),a=0,i=0,s=r.width/n,d=r.height/n,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttributeNS(null,"width",r.width),l.setAttributeNS(null,"height",r.height),this._fromData(t,function(y,$,g){var C=document.createElement("path");if(!isNaN(y.control1.x)&&!isNaN(y.control1.y)&&!isNaN(y.control2.x)&&!isNaN(y.control2.y)){var x="M "+y.startPoint.x.toFixed(3)+","+y.startPoint.y.toFixed(3)+" "+("C "+y.control1.x.toFixed(3)+","+y.control1.y.toFixed(3)+" ")+(y.control2.x.toFixed(3)+","+y.control2.y.toFixed(3)+" ")+(y.endPoint.x.toFixed(3)+","+y.endPoint.y.toFixed(3));C.setAttribute("d",x),C.setAttribute("stroke-width",($.end*2.25).toFixed(3)),C.setAttribute("stroke",g),C.setAttribute("fill","none"),C.setAttribute("stroke-linecap","round"),l.appendChild(C)}},function(y){var $=document.createElement("circle"),g=typeof e.dotSize=="function"?e.dotSize():e.dotSize;$.setAttribute("r",g),$.setAttribute("cx",y.x),$.setAttribute("cy",y.y),$.setAttribute("fill",y.color),l.appendChild($)});var c="data:image/svg+xml;base64,",u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewBox="'+a+" "+i+" "+s+" "+d+'"')+(' width="'+s+'"')+(' height="'+d+'"')+">",f=l.innerHTML;if(f===void 0){var m=document.createElement("dummy"),h=l.childNodes;m.innerHTML="";for(var p=0;p<h.length;p+=1)m.appendChild(h[p].cloneNode(!0));f=m.innerHTML}var v=u+f+"</svg>";return c+btoa(v)};X.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,function(r,n){return t._drawCurve(r,n.start,n.end)},function(r){return t._drawDot(r)}),this._data=e};X.prototype.toData=function(){return this._data};var Ph=Oe(((e,t)=>{(function(r,n){typeof e=="object"&&typeof t=="object"?t.exports=n():typeof define=="function"&&define.amd?define([],n):typeof e=="object"?e.trimCanvas=n():r.trimCanvas=n()})(e,function(){return(function(r){function n(i){if(a[i])return a[i].exports;var s=a[i]={exports:{},id:i,loaded:!1};return r[i].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}var a={};return n.m=r,n.c=a,n.p="",n(0)})([function(r,n){"use strict";function a(c){var u=c.getContext("2d"),f=c.width,m=c.height,h=u.getImageData(0,0,f,m).data,p=d(!0,f,m,h),v=d(!1,f,m,h),y=l(!0,f,m,h),$=l(!1,f,m,h)-y+1,g=v-p+1,C=u.getImageData(y,p,$,g);return c.width=$,c.height=g,u.clearRect(0,0,$,g),u.putImageData(C,0,0),c}function i(c,u,f,m){return{red:m[4*(f*u+c)],green:m[4*(f*u+c)+1],blue:m[4*(f*u+c)+2],alpha:m[4*(f*u+c)+3]}}function s(c,u,f,m){return i(c,u,f,m).alpha}function d(c,u,f,m){for(var h=c?1:-1,p=c?0:f-1;c?p<f:p>-1;p+=h)for(var v=0;v<u;v++)if(s(v,p,u,m))return p;return null}function l(c,u,f,m){for(var h=c?1:-1,p=c?0:u-1;c?p<u:p>-1;p+=h)for(var v=0;v<f;v++)if(s(p,v,u,m))return p;return null}Object.defineProperty(n,"__esModule",{value:!0}),n.default=a}])})})),Oh=Jt(Ph(),1),jh=["canvasProps","clearOnResize"],_n=(function(e){vh(r,e);var t=$h(r);function r(){var n;mh(this,r);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return n=t.call.apply(t,[this].concat(i)),n.staticThis=n.constructor,n._sigPad=null,n._canvas=null,n.setRef=function(d){n._canvas=d,n._canvas===null&&(n._sigPad=null)},n._excludeOurProps=function(){var d=n.props;return d.canvasProps,d.clearOnResize,uh(d,jh)},n.componentDidMount=function(){var d=n.getCanvas();n._sigPad=new X(d,n._excludeOurProps()),n._resizeCanvas(),n.on()},n.componentWillUnmount=function(){n.off()},n.componentDidUpdate=function(){Object.assign(n._sigPad,n._excludeOurProps())},n.getCanvas=function(){if(n._canvas===null)throw n.staticThis.refNullError;return n._canvas},n.getTrimmedCanvas=function(){var d=n.getCanvas(),l=document.createElement("canvas");return l.width=d.width,l.height=d.height,l.getContext("2d").drawImage(d,0,0),(0,Oh.default)(l)},n.getSignaturePad=function(){if(n._sigPad===null)throw n.staticThis.refNullError;return n._sigPad},n._checkClearOnResize=function(){n.props.clearOnResize&&n._resizeCanvas()},n._resizeCanvas=function(){var d,l,c=(d=n.props.canvasProps)!==null&&d!==void 0?d:{},u=c.width,f=c.height;if(!(typeof u<"u"&&typeof f<"u")){var m=n.getCanvas(),h=Math.max((l=window.devicePixelRatio)!==null&&l!==void 0?l:1,1);typeof u>"u"&&(m.width=m.offsetWidth*h),typeof f>"u"&&(m.height=m.offsetHeight*h),m.getContext("2d").scale(h,h),n.clear()}},n.render=function(){var d=n.props.canvasProps;return S.default.createElement("canvas",Pa({ref:n.setRef},d))},n.on=function(){return window.addEventListener("resize",n._checkClearOnResize),n.getSignaturePad().on()},n.off=function(){return window.removeEventListener("resize",n._checkClearOnResize),n.getSignaturePad().off()},n.clear=function(){return n.getSignaturePad().clear()},n.isEmpty=function(){return n.getSignaturePad().isEmpty()},n.fromDataURL=function(d,l){return n.getSignaturePad().fromDataURL(d,l)},n.toDataURL=function(d,l){return n.getSignaturePad().toDataURL(d,l)},n.fromData=function(d){return n.getSignaturePad().fromData(d)},n.toData=function(){return n.getSignaturePad().toData()},n}return hh(r)})(S.Component);_n.propTypes={velocityFilterWeight:P.default.number,minWidth:P.default.number,maxWidth:P.default.number,minDistance:P.default.number,dotSize:P.default.oneOfType([P.default.number,P.default.func]),penColor:P.default.string,throttle:P.default.number,onEnd:P.default.func,onBegin:P.default.func,canvasProps:P.default.object,clearOnResize:P.default.bool};_n.defaultProps={clearOnResize:!0};_n.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");var Th=({onClose:e,onConfirm:t,enforcement:r,heading:n,consent:a})=>{const i=(0,S.useRef)(null),{register:s,handleSubmit:d,control:l,reset:c,watch:u,setValue:f,formState:{errors:m,isSubmitting:h}}=(0,Ue.useForm)({defaultValues:{accepted:!1,typedName:"",signatureDataUrl:"",emailMe:!1},mode:"onChange"}),p=u("accepted"),v=u("typedName"),y=u("signatureDataUrl"),$=()=>{c(),r==="DRAW_SIGNATURE"&&i.current?.clear()},g=()=>{$(),e()},C=()=>{i.current?.clear(),f("signatureDataUrl","")},x=b=>{let T="";if(r==="DRAW_SIGNATURE"){const R=i.current;if(R&&!R.isEmpty())T=R.getCanvas().toDataURL("image/png");else return}t({accepted:r==="CHECKBOX_ONLY"?b.accepted:!1,typedName:r==="TYPED_NAME"?b.typedName.trim():"",signatureDataUrl:T,emailMe:b.emailMe}),$(),e()},N=!h&&(r==="CHECKBOX_ONLY"?p:r==="TYPED_NAME"?v?.trim().length>2:r==="DRAW_SIGNATURE"?!!y:!1);return(0,o.jsxs)("div",{className:"aaravpos-consent-overlay",children:[(0,o.jsx)("div",{className:"aaravpos-consent-backdrop"}),(0,o.jsxs)("div",{className:"aaravpos-consent-modal",children:[(0,o.jsxs)("div",{className:"aaravpos-consent-header",children:[(0,o.jsx)("h3",{className:"aaravpos-consent-title",children:n||"Consent Form"}),(0,o.jsx)("button",{onClick:g,className:"aaravpos-consent-close-btn",children:(0,o.jsx)(Ye,{})})]}),(0,o.jsx)("div",{className:"aaravpos-consent-content-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-consent-content-box",children:(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:a},className:"aaravpos-consent-content"})})}),(0,o.jsxs)("form",{onSubmit:d(x),children:[r==="CHECKBOX_ONLY"&&(0,o.jsxs)("label",{className:"aaravpos-consent-checkbox-label",htmlFor:"accepted",children:[(0,o.jsx)("input",{type:"checkbox",...s("accepted",{required:"You must accept terms"}),id:"accepted",className:"aaravpos-consent-checkbox"}),(0,o.jsx)("span",{className:"aaravpos-consent-checkbox-text",children:"I have read and agree to the terms above"})]}),r==="TYPED_NAME"&&(0,o.jsxs)("div",{className:"aaravpos-consent-typed-wrapper",children:[(0,o.jsxs)("label",{className:"aaravpos-consent-input-label",htmlFor:"typedName",children:["Full Name",(0,o.jsx)("span",{className:"aaravpos-consent-required",children:"*"})]}),(0,o.jsx)("input",{...s("typedName",{required:"Name is required",validate:b=>b.trim().length>2||"Enter full name"}),id:"typedName",placeholder:"Type your full name",className:`aaravpos-consent-input ${m.typedName?"aaravpos-consent-input-error":"aaravpos-consent-input-normal"}`}),(0,o.jsx)("p",{className:"aaravpos-consent-helper-text",children:"By typing your name, you agree to the consent above"}),m.typedName&&(0,o.jsx)("p",{className:"aaravpos-consent-error",children:m.typedName.message})]}),r==="DRAW_SIGNATURE"&&(0,o.jsx)(Ue.Controller,{control:l,name:"signatureDataUrl",rules:{validate:()=>i.current&&!i.current.isEmpty()?!0:"Signature required"},render:({field:b})=>(0,o.jsxs)("div",{className:"aaravpos-consent-signature-wrapper",children:[(0,o.jsx)(_n,{ref:i,canvasProps:{className:"aaravpos-consent-signature-canvas"},onEnd:()=>{const T=i.current;if(!T)return;const R=T.getCanvas().toDataURL("image/png");b.onChange(R)}}),m.signatureDataUrl&&(0,o.jsx)("p",{className:"aaravpos-consent-error aaravpos-consent-error-signature",children:m.signatureDataUrl.message}),(0,o.jsxs)("div",{className:"aaravpos-consent-signature-actions",children:[(0,o.jsxs)("button",{type:"button",onClick:C,className:"aaravpos-consent-clear-btn",children:[(0,o.jsx)(xp,{size:14}),"Clear"]}),(0,o.jsxs)("label",{className:"aaravpos-consent-email-label",htmlFor:"emailme",children:[(0,o.jsx)("input",{type:"checkbox",...s("emailMe"),id:"emailme",className:"aaravpos-consent-email-checkbox"}),(0,o.jsx)("span",{className:"aaravpos-consent-email-text",children:"Email me"})]})]})]})}),(0,o.jsxs)("div",{className:"aaravpos-consent-footer",children:[(0,o.jsx)("button",{type:"button",onClick:g,className:"aaravpos-consent-cancel-btn",children:"Cancel"}),(0,o.jsxs)("button",{type:"submit",disabled:!N,className:`aaravpos-consent-submit-btn ${N?"aaravpos-consent-submit-active":"aaravpos-consent-submit-disabled"}`,children:[(0,o.jsx)(ui,{}),r==="DRAW_SIGNATURE"||r==="TYPED_NAME"?"Sign & Continue":"I Agree"]})]})]})]})]})},pl={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-579]|61)","5(?:[0-579]|61[06])","5(?:[0-579]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}},Ah=Oe(((e,t)=>{(function(){"use strict";var r={}.hasOwnProperty;function n(){for(var s="",d=0;d<arguments.length;d++){var l=arguments[d];l&&(s=i(s,a(l)))}return s}function a(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var d="";for(var l in s)r.call(s,l)&&s[l]&&(d=i(d,l));return d}function i(s,d){return d?s?s+" "+d:s+d:s}typeof t<"u"&&t.exports?(n.default=n,t.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()}));function Ih(e,t,r){switch(r){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1);break}return{value:e,caret:t}}function kh(e,t,r){for(var n={},a="",i=0,s=0;s<e.length;){var d=r(e[s],a,n);d!==void 0&&(a+=d,t!==void 0&&(t===s?i=a.length-1:t>s&&(i=a.length))),s++}return t===void 0&&(i=a.length),{value:a,caret:i}}function Rh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Dh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
21
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dh(e,t){if(e){if(typeof e=="string")return _o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _o(e,t)}}function _o(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ja(e,t){for(var r=0,n=Rh(t.split("")),a;!(a=n()).done;)a.value===e&&r++;return r}function Mh(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"x",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",a=e.length,i=ja("(",e)-ja(")",e);i>0&&a<t.length;)e+=t[a].replace(r,n),t[a]===")"&&i--,a++;return e}function Fh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Lh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lh(e,t){if(e){if(typeof e=="string")return wo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wo(e,t)}}function wo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",r=arguments.length>2?arguments[2]:void 0;if(!e)return function(a){return{text:a}};var n=ja(t,e);return function(a){if(!a)return{text:"",template:e};for(var i=0,s="",d=Fh(e.split("")),l;!(l=d()).done;){var c=l.value;if(c!==t){s+=c;continue}if(s+=a[i],i++,i===a.length&&a.length<n)break}return r&&(s=Mh(s,e)),{text:s,template:e}}}function Uh(e,t,r){typeof r=="string"&&(r=Bh(r));var n=r(e)||{},a=n.text,i=n.template;if(a===void 0&&(a=e),i)if(t===void 0)t=a.length;else{for(var s=0,d=!1,l=-1;s<a.length&&s<i.length;){if(a[s]!==i[s]){if(t===0){d=!0,t=s;break}l=s,t--}s++}d||(t=l+1)}return{text:a,caret:t}}function Vh(e){return e.hasAttribute("readonly")}function zh(e){if(e.selectionStart!==e.selectionEnd)return{start:e.selectionStart,end:e.selectionEnd}}var Eo={Backspace:8,Delete:46};function qh(e){switch(e.keyCode){case Eo.Backspace:return"Backspace";case Eo.Delete:return"Delete"}}function Wh(e){return e.selectionStart}function hl(e,t){t!==void 0&&(Gh()?setTimeout(function(){return e.setSelectionRange(t,t)},0):e.setSelectionRange(t,t))}function Gh(){if(typeof navigator<"u")return Hh.test(navigator.userAgent)}var Hh=/Android/i;function Kh(e,t,r,n,a){Ta(t,r,n,void 0,a)}function Yh(e,t,r,n,a){if(!Vh(t)){var i=qh(e);switch(i){case"Delete":case"Backspace":e.preventDefault();var s=zh(t);return s?(Xh(t,s),Ta(t,r,n,void 0,a)):Ta(t,r,n,i,a);default:}}}function Xh(e,t){var r=e.value;r=r.slice(0,t.start)+r.slice(t.end),e.value=r,hl(e,t.start)}function Ta(e,t,r,n,a){var i=kh(e.value,Wh(e),t),s=i.value,d=i.caret;if(n){var l=Ih(s,d,n);s=l.value,d=l.caret}var c=Uh(s,d,r),u=c.text;d=c.caret,e.value=u,hl(e,d),a&&a(s)}var Zh=["ref","parse","format","value","defaultValue","controlled","onChange","onKeyDown"];function Po(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Po(Object(r),!0).forEach(function(n){Jh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Po(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qh(e,t){if(e==null)return{};var r=e1(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function e1(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function t1(e){var t=e.ref,r=e.parse,n=e.format,a=e.value,i=e.defaultValue,s=e.controlled,d=s===void 0?!0:s,l=e.onChange,c=e.onKeyDown,u=Qh(e,Zh),f=(0,S.useRef)(),m=(0,S.useCallback)(function(y){f.current=y,t&&(typeof t=="function"?t(y):t.current=y)},[t]),h=(0,S.useCallback)(function(y){return Kh(y,f.current,r,n,l)},[f,r,n,l]),p=(0,S.useCallback)(function(y){if(c&&c(y),!y.defaultPrevented)return Yh(y,f.current,r,n,l)},[f,r,n,l,c]),v=ot(ot({},u),{},{ref:m,onChange:h,onKeyDown:p});return d?ot(ot({},v),{},{value:n(Oo(a)?"":a).text}):ot(ot({},v),{},{defaultValue:n(Oo(i)?"":i).text})}function Oo(e){return e==null}var r1=["inputComponent","parse","format","value","defaultValue","onChange","controlled","onKeyDown","type"];function jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function n1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jo(Object(r),!0).forEach(function(n){a1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a1(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i1(e,t){if(e==null)return{};var r=o1(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o1(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function en(e,t){var r=e.inputComponent,n=r===void 0?"input":r,a=e.parse,i=e.format,s=e.value,d=e.defaultValue,l=e.onChange,c=e.controlled,u=e.onKeyDown,f=e.type,m=f===void 0?"text":f,h=i1(e,r1),p=t1(n1({ref:t,parse:a,format:i,value:s,defaultValue:d,onChange:l,controlled:c,onKeyDown:u,type:m},h));return S.default.createElement(n,p)}en=S.default.forwardRef(en);en.propTypes={parse:P.default.func.isRequired,format:P.default.func.isRequired,inputComponent:P.default.elementType,type:P.default.string,value:P.default.string,defaultValue:P.default.string,onChange:P.default.func,controlled:P.default.bool,onKeyDown:P.default.func,onCut:P.default.func,onPaste:P.default.func};var s1=en;function To(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),a=0;a<3;a++){var i=Number(r[a]),s=Number(n[a]);if(i>s)return 1;if(s>i)return-1;if(!isNaN(i)&&isNaN(s))return 1;if(isNaN(i)&&!isNaN(s))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var d1={}.constructor;function et(e){return e!=null&&e.constructor===d1}function bt(e){"@babel/helpers - typeof";return bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(e)}function wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ao(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l1(n.key),n)}}function En(e,t,r){return t&&Ao(e.prototype,t),r&&Ao(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l1(e){var t=c1(e,"string");return bt(t)=="symbol"?t:t+""}function c1(e,t){if(bt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var u1="1.2.0",f1="1.7.35",Io=" ext. ",p1=/^\d+$/,de=(function(){function e(t){wn(this,e),ml(t),this.metadata=t,yl.call(this,t)}return En(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(r){return r!=="001"})}},{key:"getCountryMetadata",value:function(r){return this.metadata.countries[r]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(r){return this.getCountryMetadata(r)!==void 0}},{key:"hasCallingCode",value:function(r){if(this.getCountryCodesForCallingCode(r))return!0;if(this.nonGeographic()){if(this.nonGeographic()[r])return!0}else{var n=this.countryCallingCodes()[r];if(n&&n.length===1&&n[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(r){return this.nonGeographic()?!!this.nonGeographic()[r]:!this.getCountryCodesForCallingCode(r)}},{key:"country",value:function(r){return this.selectNumberingPlan(r)}},{key:"selectNumberingPlan",value:function(r,n){if(r&&p1.test(r)&&(n=r,r=null),r&&r!=="001"){if(!this.hasCountry(r))throw new Error("Unknown country: ".concat(r));this.numberingPlan=new ko(this.getCountryMetadata(r),this)}else if(n){if(!this.hasCallingCode(n))throw new Error("Unknown calling code: ".concat(n));this.numberingPlan=new ko(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(r){var n=this.countryCallingCodes()[r];if(n)return n.length===1&&n[0].length===3?void 0:n}},{key:"getCountryCodeForCallingCode",value:function(r){var n=this.getCountryCodesForCallingCode(r);if(n)return n[0]}},{key:"getNumberingPlanMetadata",value:function(r){var n=this.getCountryCodeForCallingCode(r);if(n)return this.getCountryMetadata(n);if(this.nonGeographic()){var a=this.nonGeographic()[r];if(a)return a}else{var i=this.countryCallingCodes()[r];if(i&&i.length===1&&i[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(r){return this.numberingPlan.type(r)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(r){return this.selectNumberingPlan(r)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),ko=(function(){function e(t,r){wn(this,e),this.globalMetadataObject=r,this.metadata=t,yl.call(this,r.metadata)}return En(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(r){return r[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var r=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(n){return new h1(n,r)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(r){return r[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(r){if(this.hasTypes()&&Ro(this.types(),r))return new v1(Ro(this.types(),r),this)}},{key:"ext",value:function(){return this.v1||this.v2?Io:this.metadata[13]||Io}}])})(),h1=(function(){function e(t,r){wn(this,e),this._format=t,this.metadata=r}return En(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!m1.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),m1=/^\(?\$1\)?$/,v1=(function(){function e(t,r){wn(this,e),this.type=t,this.metadata=r}return En(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function Ro(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}function ml(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!et(e)||!et(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(et(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+y1(e)+": "+e,"."))}var y1=function(t){return bt(t)};function Xe(e,t){if(t=new de(t),t.hasCountry(e))return t.selectNumberingPlan(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function vl(e,t){return t.countries.hasOwnProperty(e)}function yl(e){var t=e.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?To(t,u1)===-1?this.v2=!0:To(t,f1)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function g1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=$1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $1(e,t){if(e){if(typeof e=="string")return Do(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Do(e,t):void 0}}function Do(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b1(e,t){for(var r=e.slice(),n=g1(t),a;!(a=n()).done;){var i=a.value;e.indexOf(i)<0&&r.push(i)}return r.sort(function(s,d){return s-d})}function Pn(e,t,r){return gl(e,t,void 0,r)}function gl(e,t,r,n){t&&(n=new de(n.metadata),n.selectNumberingPlan(t));var a=n.type(r),i=a&&a.possibleLengths()||n.possibleLengths();if(!i)return"IS_POSSIBLE";if(r==="FIXED_LINE_OR_MOBILE"){if(!n.type("FIXED_LINE"))return gl(e,t,"MOBILE",n);var s=n.type("MOBILE");s&&(i=b1(i,s.possibleLengths()))}else if(r&&!a)return"INVALID_LENGTH";var d=e.length,l=i[0];return l===d?"IS_POSSIBLE":l>d?"TOO_SHORT":i[i.length-1]<d?"TOO_LONG":i.indexOf(d,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function N1(e,t,r){if(t===void 0&&(t={}),r=new de(r),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return $l(e.phone||e.nationalNumber,e.country,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function $l(e,t,r){return Pn(e,t,r)==="IS_POSSIBLE"}function ze(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function S1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=C1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C1(e,t){if(e){if(typeof e=="string")return Mo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mo(e,t):void 0}}function Mo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var x1=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function yi(e,t,r){if(t=t||{},!(!e.country&&!e.countryCallingCode)){r=new de(r),r.selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(ze(n,r.nationalNumberPattern())){if(ea(n,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||ea(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var a=S1(x1),i;!(i=a()).done;){var s=i.value;if(ea(n,s,r))return s}}}}function ea(e,t,r){var n=r.type(t);return!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(e.length)<0?!1:ze(e,n.pattern())}function _1(e,t,r){return t=t||{},r=new de(r),r.selectNumberingPlan(e.country,e.countryCallingCode),r.hasTypes()?yi(e,t,r.metadata)!==void 0:ze(t.v2?e.nationalNumber:e.phone,r.nationalNumberPattern())}function w1(e,t,r){var n=new de(r).getCountryCodesForCallingCode(e);return n?n.filter(function(a){return E1(t,a,r)}):[]}function E1(e,t,r){var n=new de(r);return n.selectNumberingPlan(t),n.numberingPlan.possibleLengths().indexOf(e.length)>=0}var ge="0-90-9٠-٩۰-۹",P1="-‐-―−ー-",O1="//",j1="..",T1="  ­​⁠ ",A1="()()[]\\[\\]",I1="~⁓∼~",Re="".concat(P1).concat(O1).concat(j1).concat(T1).concat(A1).concat(I1),On="++",k1=new RegExp("(["+ge+"])");function bl(e,t,r,n){if(t){var a=new de(n);a.selectNumberingPlan(t,r);var i=new RegExp(a.IDDPrefix());if(e.search(i)===0){e=e.slice(e.match(i)[0].length);var s=e.match(k1);if(!(s&&s[1]!=null&&s[1].length>0&&s[1]==="0"))return e}}}function Aa(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var a,i,s=n.length-1,d=s>0&&n[s];if(t.nationalPrefixTransformRule()&&d)a=e.replace(r,t.nationalPrefixTransformRule()),s>1&&(i=n[1]);else{var l=n[0];a=e.slice(l.length),d&&(i=n[1])}var c;if(d){var u=e.indexOf(n[1]);e.slice(0,u)===t.numberingPlan.nationalPrefix()&&(c=t.numberingPlan.nationalPrefix())}else c=n[0];return{nationalNumber:a,nationalPrefix:c,carrierCode:i}}}return{nationalNumber:e}}function R1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=D1(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D1(e,t){if(e){if(typeof e=="string")return Fo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fo(e,t):void 0}}function Fo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Nl(e,t){var r=t.countries,n=t.metadata;n=new de(n);for(var a=R1(r),i;!(i=a()).done;){var s=i.value;if(n.selectNumberingPlan(s),n.leadingDigits()){if(e&&e.search(n.leadingDigits())===0)return s}else if(yi({phone:e,country:s},void 0,n.metadata))return s}}var M1=!1;function gi(e,t){var r=t.nationalNumber,n=t.metadata;if(M1&&n.isNonGeographicCallingCode(e))return"001";var a=n.getCountryCodesForCallingCode(e);if(a)return a.length===1?a[0]:Nl(r,{countries:a,metadata:n.metadata})}function Ia(e,t,r){var n=Aa(e,r),a=n.carrierCode,i=n.nationalNumber;if(i!==e){if(!F1(e,i,r))return{nationalNumber:e};if(r.numberingPlan.possibleLengths()&&(t||(t=gi(r.numberingPlan.callingCode(),{nationalNumber:i,metadata:r})),!L1(i,t,r)))return{nationalNumber:e}}return{nationalNumber:i,carrierCode:a}}function F1(e,t,r){return!(ze(e,r.nationalNumberPattern())&&!ze(t,r.nationalNumberPattern()))}function L1(e,t,r){switch(Pn(e,t,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Sl(e,t,r,n,a){var i=t||r?Xe(t||r,a):n;if(e.indexOf(i)===0){a=new de(a),a.selectNumberingPlan(t||r,i);var s=e.slice(i.length),d=Ia(s,t,a).nationalNumber,l=Ia(e,t,a).nationalNumber;if(!ze(l,a.nationalNumberPattern())&&ze(d,a.nationalNumberPattern())||Pn(l,t,a)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:e}}function $i(e,t,r,n,a){if(!e)return{};var i;if(e[0]!=="+"){var s=bl(e,t||r,n,a);if(s&&s!==e)i=!0,e="+"+s;else{if(t||r||n){var d=Sl(e,t,r,n,a),l=d.countryCallingCode,c=d.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:c}}return{number:e}}}if(e[1]==="0")return{};a=new de(a);for(var u=2;u-1<=3&&u<=e.length;){var f=e.slice(1,u);if(a.hasCallingCode(f))return a.selectNumberingPlan(f),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:e.slice(u)};u++}return{}}function Cl(e){return e.replace(new RegExp("[".concat(Re,"]+"),"g")," ").trim()}var xl=/(\$\d)/;function _l(e,t,r){var n=r.useInternationalFormat,a=r.withNationalPrefix;r.carrierCode,r.metadata;var i=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(xl,t.nationalPrefixFormattingRule()):t.format());return n?Cl(i):i}var B1=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function U1(e,t,r){var n=new de(r);if(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(B1.test(n.IDDPrefix()))return n.IDDPrefix()}var V1=";ext=",st=function(t){return"([".concat(ge,"]{1,").concat(t,"})")};function wl(e){var t="20",r="15",n="9",a="6",i="[  \\t,]*",s="[:\\..]?[  \\t,-]*",d="#?",l="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",c="(?:[xx##~~]|int|int)",u="[- ]+",f="[  \\t]*",m="(?:,{2}|;)",h=V1+st(t),p=i+l+s+st(t)+d,v=i+c+s+st(n)+d,y=u+st(a)+"#",$=f+m+s+st(r)+d,g=f+"(?:,)+"+s+st(n)+d;return h+"|"+p+"|"+v+"|"+y+"|"+$+"|"+g}var z1="["+ge+"]{2}",q1="["+On+"]{0,1}(?:["+Re+"]*["+ge+"]){3,}["+Re+ge+"]*",W1=new RegExp("^["+On+"]{0,1}(?:["+Re+"]*["+ge+"]){1,2}$","i"),G1=q1+"(?:"+wl()+")?",H1=new RegExp("^"+z1+"$|^"+G1+"$","i");function K1(e){return e.length>=2&&H1.test(e)}function Y1(e){return W1.test(e)}function X1(e){var t=e.number,r=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}var Lo={formatExtension:function(t,r,n){return"".concat(t).concat(n.ext()).concat(r)}};function Z1(e,t,r,n){if(r?r=em({},Lo,r):r=Lo,n=new de(n),e.country&&e.country!=="001"){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.selectNumberingPlan(e.country)}else if(e.countryCallingCode)n.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var a=n.countryCallingCode(),i=r.v2?e.nationalNumber:e.phone,s;switch(t){case"NATIONAL":return i?(s=tn(i,e.carrierCode,"NATIONAL",n,r),ta(s,e.ext,n,r.formatExtension)):"";case"INTERNATIONAL":return i?(s=tn(i,null,"INTERNATIONAL",n,r),s="+".concat(a," ").concat(s),ta(s,e.ext,n,r.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(i);case"RFC3966":return X1({number:"+".concat(a).concat(i),ext:e.ext});case"IDD":if(!r.fromCountry)return;var d=Q1(i,e.carrierCode,a,r.fromCountry,n);return d?ta(d,e.ext,n,r.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function tn(e,t,r,n,a){var i=J1(n.formats(),e);return i?_l(e,i,{useInternationalFormat:r==="INTERNATIONAL",withNationalPrefix:!(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&a&&a.nationalPrefix===!1),carrierCode:t,metadata:n}):e}function J1(e,t){return tm(e,function(r){if(r.leadingDigitsPatterns().length>0){var n=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(t.search(n)!==0)return!1}return ze(t,r.pattern())})}function ta(e,t,r,n){return t?n(e,t,r):e}function Q1(e,t,r,n,a){if(Xe(n,a.metadata)===r){var i=tn(e,t,"NATIONAL",a);return r==="1"?r+" "+i:i}var s=U1(n,void 0,a.metadata);if(s)return"".concat(s," ").concat(r," ").concat(tn(e,null,"INTERNATIONAL",a))}function em(){for(var e=1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;e<r.length;){if(r[e])for(var a in r[e])r[0][a]=r[e][a];e++}return r[0]}function tm(e,t){for(var r=0;r<e.length;){if(t(e[r]))return e[r];r++}}function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Bo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Uo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bo(Object(r),!0).forEach(function(n){rm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rm(e,t,r){return(t=El(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,El(n.key),n)}}function am(e,t,r){return t&&Vo(e.prototype,t),r&&Vo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function El(e){var t=im(e,"string");return Ft(t)=="symbol"?t:t+""}function im(e,t){if(Ft(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var om=!1,Pl=(function(){function e(t,r,n){if(nm(this,e),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!r)throw new TypeError("`metadata` argument not passed");if(et(r)&&et(r.countries)){n=r;var a=t;if(!lm.test(a))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var i=$i(a,void 0,void 0,void 0,n),s=i.countryCallingCode;if(r=i.number,t=s,!r)throw new Error("Invalid `number` argument passed: too short")}if(!r)throw new TypeError("`nationalNumber` argument is required");if(typeof r!="string")throw new TypeError("`nationalNumber` argument must be a string");ml(n);var d=dm(t,n),l=d.country,c=d.countryCallingCode;this.country=l,this.countryCallingCode=c,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return am(e,[{key:"setExt",value:function(r){this.ext=r}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:w1(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return N1(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return _1(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new de(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(r){return this.number===r.number&&this.ext===r.ext}},{key:"getType",value:function(){return yi(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(r,n){return Z1(this,r,n?Uo(Uo({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(r){return this.format("NATIONAL",r)}},{key:"formatInternational",value:function(r){return this.format("INTERNATIONAL",r)}},{key:"getURI",value:function(r){return this.format("RFC3966",r)}}])})(),sm=function(t){return/^[A-Z]{2}$/.test(t)};function dm(e,t){var r,n,a=new de(t);return sm(e)?(r=e,a.selectNumberingPlan(r),n=a.countryCallingCode()):(n=e,om&&a.isNonGeographicCallingCode(n)&&(r="001")),{country:r,countryCallingCode:n}}var lm=/^\+\d+$/;function Nt(e){"@babel/helpers - typeof";return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(e)}function zo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,um(n.key),n)}}function cm(e,t,r){return t&&zo(e.prototype,t),r&&zo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function um(e){var t=fm(e,"string");return Nt(t)=="symbol"?t:t+""}function fm(e,t){if(Nt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hm(e,t,r){return t=Bt(t),mm(e,bi()?Reflect.construct(t,r||[],Bt(e).constructor):t.apply(e,r))}function mm(e,t){if(t&&(Nt(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vm(e)}function vm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ym(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lt(e,t)}function ka(e){var t=typeof Map=="function"?new Map:void 0;return ka=function(n){if(n===null||!$m(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,a)}function a(){return gm(n,arguments,Bt(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Lt(a,n)},ka(e)}function gm(e,t,r){if(bi())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var a=new(e.bind.apply(e,n));return r&&Lt(a,r.prototype),a}function bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bi=function(){return!!e})()}function $m(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function Lt(e,t){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Lt(e,t)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(e)}var Be=(function(e){function t(r){var n;return pm(this,t),n=hm(this,t,[r]),Object.setPrototypeOf(n,t.prototype),n.name=n.constructor.name,n}return ym(t,e),cm(t)})(ka(Error)),qo=new RegExp("(?:"+wl()+")$","i");function bm(e){var t=e.search(qo);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(qo),a=1;a<n.length;){if(n[a])return{number:r,ext:n[a]};a++}}function Nm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Sm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(e,t){if(e){if(typeof e=="string")return Wo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wo(e,t):void 0}}function Wo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Cm={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function Ol(e){return Cm[e]}function rn(e){for(var t="",r=Nm(e.split("")),n;!(n=r()).done;){var a=n.value,i=Ol(a);i&&(t+=i)}return t}function xm(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_m(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _m(e,t){if(e){if(typeof e=="string")return Go(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Go(e,t):void 0}}function Go(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ra(e){for(var t="",r=xm(e.split("")),n;!(n=r()).done;){var a=n.value;t+=jl(a,t)||""}return t}function jl(e,t,r){if(e==="+"){if(t){typeof r=="function"&&r("end");return}return"+"}return Ol(e)}var Ho="(["+ge+"]|[\\-\\.\\(\\)]?)",wm="^\\+"+Ho+"*["+ge+"]"+Ho+"*$",Em=new RegExp(wm,"g"),Da=ge,Pm="["+Da+"]+((\\-)*["+Da+"])*",Om="[a-zA-Z]+((\\-)*["+Da+"])*",jm="^("+Pm+"\\.)*"+Om+"\\.?$",Tm=new RegExp(jm,"g"),Ko="tel:",Ma=";phone-context=",Am=";isub=";function Im(e){var t=e.indexOf(Ma);if(t<0)return null;var r=t+Ma.length;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function km(e){return e===null?!0:e.length===0?!1:Em.test(e)||Tm.test(e)}function Rm(e,t){var r=t.extractFormattedPhoneNumber,n=Im(e);if(!km(n))throw new Be("NOT_A_NUMBER");var a;if(n===null)a=r(e)||"";else{a="",n.charAt(0)==="+"&&(a+=n);var i=e.indexOf(Ko),s;i>=0?s=i+Ko.length:s=0;var d=e.indexOf(Ma);a+=e.substring(s,d)}var l=a.indexOf(Am);if(l>0&&(a=a.substring(0,l)),a!=="")return a}var Dm=250,Mm=new RegExp("["+On+ge+"]"),Fm=new RegExp("[^"+ge+"#]+$"),Lm=!1;function Bm(e,t,r){if(t=t||{},r=new de(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new Be("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var n=Vm(e,t.v2,t.extract),a=n.number,i=n.ext,s=n.error;if(!a){if(t.v2)throw s==="TOO_SHORT"?new Be("TOO_SHORT"):new Be("NOT_A_NUMBER");return{}}var d=qm(a,t.defaultCountry,t.defaultCallingCode,r),l=d.country,c=d.nationalNumber,u=d.countryCallingCode,f=d.countryCallingCodeSource,m=d.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Be("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new Be("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new Be("TOO_LONG");return{}}if(t.v2){var h=new Pl(u,c,r.metadata);return l&&(h.country=l),m&&(h.carrierCode=m),i&&(h.ext=i),h.__countryCallingCodeSource=f,h}var p=(t.extended?r.hasSelectedNumberingPlan():l)?ze(c,r.nationalNumberPattern()):!1;return t.extended?{country:l,countryCallingCode:u,carrierCode:m,valid:p,possible:p?!0:!!(t.extended===!0&&r.possibleLengths()&&$l(c,l,r)),phone:c,ext:i}:p?zm(l,c,i):{}}function Um(e,t,r){if(e){if(e.length>Dm){if(r)throw new Be("TOO_LONG");return}if(t===!1)return e;var n=e.search(Mm);if(!(n<0))return e.slice(n).replace(Fm,"")}}function Vm(e,t,r){var n=Rm(e,{extractFormattedPhoneNumber:function(s){return Um(s,r,t)}});if(!n)return{};if(!K1(n))return Y1(n)?{error:"TOO_SHORT"}:{};var a=bm(n);return a.ext?a:{number:n}}function zm(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function qm(e,t,r,n){var a=$i(Ra(e),void 0,t,r,n.metadata),i=a.countryCallingCodeSource,s=a.countryCallingCode,d=a.number,l;if(s)n.selectNumberingPlan(s);else if(d&&(t||r))n.selectNumberingPlan(t,r),t?l=t:Lm&&n.isNonGeographicCallingCode(r)&&(l="001"),s=r||Xe(t,n.metadata);else return{};if(!d)return{countryCallingCodeSource:i,countryCallingCode:s};var c=Ia(Ra(d),l,n),u=c.nationalNumber,f=c.carrierCode,m=gi(s,{nationalNumber:u,metadata:n});return m&&(l=m,m==="001"||n.selectNumberingPlan(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:i,nationalNumber:u,carrierCode:f}}function Ut(e){"@babel/helpers - typeof";return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(e)}function Yo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yo(Object(r),!0).forEach(function(n){Wm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wm(e,t,r){return(t=Gm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gm(e){var t=Hm(e,"string");return Ut(t)=="symbol"?t:t+""}function Hm(e,t){if(Ut(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ut(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Km(e,t,r){return Bm(e,Xo(Xo({},t),{},{v2:!0}),r)}function Vt(e){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(e)}function Zo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ym(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zo(Object(r),!0).forEach(function(n){Xm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xm(e,t,r){return(t=Zm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zm(e){var t=Jm(e,"string");return Vt(t)=="symbol"?t:t+""}function Jm(e,t){if(Vt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Vt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qm(e,t){return n2(e)||r2(e,t)||t2(e,t)||e2()}function e2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t2(e,t){if(e){if(typeof e=="string")return Jo(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jo(e,t):void 0}}function Jo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function n2(e){if(Array.isArray(e))return e}function Tl(e){var t=Qm(Array.prototype.slice.call(e),4),r=t[0],n=t[1],a=t[2],i=t[3],s,d,l;if(typeof r=="string")s=r;else throw new TypeError("A text for parsing must be a string.");if(!n||typeof n=="string")i?(d=a,l=i):(d=void 0,l=a),n&&(d=Ym({defaultCountry:n},d));else if(et(n))a?(d=n,l=a):l=n;else throw new Error("Invalid second argument: ".concat(n));return{text:s,options:d,metadata:l}}function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function Qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qo(Object(r),!0).forEach(function(n){a2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a2(e,t,r){return(t=i2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i2(e){var t=o2(e,"string");return zt(t)=="symbol"?t:t+""}function o2(e,t){if(zt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Al(e,t,r){t&&t.defaultCountry&&!vl(t.defaultCountry,r)&&(t=es(es({},t),{},{defaultCountry:void 0}));try{return Km(e,t,r)}catch(n){if(!(n instanceof Be))throw n}}function s2(){var e=Tl(arguments),t=e.text,r=e.options,n=e.metadata;return Al(t,r,n)}function qt(e){"@babel/helpers - typeof";return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(e)}function ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ts(Object(r),!0).forEach(function(n){d2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ts(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function d2(e,t,r){return(t=l2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l2(e){var t=c2(e,"string");return qt(t)=="symbol"?t:t+""}function c2(e,t){if(qt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u2(){var e=Tl(arguments),t=e.text,r=e.options,n=e.metadata;r=rs(rs({},r),{},{extract:!1});var a=Al(t,r,n);return a&&a.isValid()||!1}function Wt(e){"@babel/helpers - typeof";return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(e)}function f2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ns(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h2(n.key),n)}}function p2(e,t,r){return t&&ns(e.prototype,t),r&&ns(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function h2(e){var t=m2(e,"string");return Wt(t)=="symbol"?t:t+""}function m2(e,t){if(Wt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Wt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v2=(function(){function e(t){var r=t.onCountryChange,n=t.onCallingCodeChange;f2(this,e),this.onCountryChange=r,this.onCallingCodeChange=n}return p2(e,[{key:"reset",value:function(r){var n=r.country,a=r.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(n,a)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(r){for(var n=0,a=Object.keys(r);n<a.length;n++){var i=a[n];this[i]=r[i]}}},{key:"initCountryAndCallingCode",value:function(r,n){this.setCountry(r),this.setCallingCode(n)}},{key:"setCountry",value:function(r){this.country=r,this.onCountryChange(r)}},{key:"setCallingCode",value:function(r){this.callingCode=r,this.onCallingCodeChange(r,this.country)}},{key:"startInternationalNumber",value:function(r,n){this.international=!0,this.initCountryAndCallingCode(r,n)}},{key:"appendDigits",value:function(r){this.digits+=r}},{key:"appendNationalSignificantNumberDigits",value:function(r){this.nationalSignificantNumber+=r}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();function y2(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=g2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g2(e,t){if(e){if(typeof e=="string")return as(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?as(e,t):void 0}}function as(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ra=new RegExp("x");function Ir(e,t){if(t<1)return"";for(var r="";t>1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function is(e,t){return e[t]===")"&&t++,$2(e.slice(0,t))}function $2(e){for(var t=[],r=0;r<e.length;)e[r]==="("?t.push(r):e[r]===")"&&t.pop(),r++;var n=0,a="";t.push(e.length);for(var i=0,s=t;i<s.length;i++){var d=s[i];a+=e.slice(n,d),n=d+1}return a}function b2(e,t,r){for(var n=y2(r.split("")),a;!(a=n()).done;){var i=a.value;if(e.slice(t+1).search(ra)<0)return;t=e.search(ra),e=e.replace(ra,i)}return[e,t]}function N2(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return C2(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:i})}function S2(e,t,r){return Pn(e,t,r)==="IS_POSSIBLE"}function C2(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,a(t)){var s=os(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:i,metadata:n});if(s)return s}return os(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:i,metadata:n})}function os(e,t,r){var n=r.metadata,a=r.useNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix,s=_l(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:n});if(a||(e.nationalPrefix?s=e.nationalPrefix+i(t)+s:e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(s=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+s)),x2(s,e))return s}function x2(e,t){return rn(e)===t.getNationalDigits()}function Gt(e){"@babel/helpers - typeof";return Gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(e)}function _2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ss(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E2(n.key),n)}}function w2(e,t,r){return t&&ss(e.prototype,t),r&&ss(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function E2(e){var t=P2(e,"string");return Gt(t)=="symbol"?t:t+""}function P2(e,t){if(Gt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Gt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O2=(function(){function e(){_2(this,e)}return w2(e,[{key:"parse",value:function(r){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(r),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var n=this.context[0],a=n.branches,i=n.instructions;if(a)return{op:"|",args:a.concat([na(i)])};if(i.length===0)throw new Error("Pattern is required");return i.length===1?i[0]:i}},{key:"startContext",value:function(r){this.context.push(r)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(r){if(!r)throw new Error("Pattern is required");var n=r.match(A2);if(!n){if(T2.test(r))throw new Error("Illegal characters found in a pattern: ".concat(r));this.getContext().instructions=this.getContext().instructions.concat(r.split(""));return}var a=n[1],i=r.slice(0,n.index),s=r.slice(n.index+a.length);switch(a){case"(?:":i&&this.parsePattern(i),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(i&&this.parsePattern(i),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var d=this.getContext().branches;d.push(na(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:d});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(i&&this.parsePattern(i),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(na(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":i&&this.parsePattern(i),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:j2(i)});break;default:throw new Error("Unknown operator: ".concat(a))}s&&this.parsePattern(s)}}])})();function j2(e){for(var t=[],r=0;r<e.length;){if(e[r]==="-"){if(r===0||r===e.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,a=e[r+1].charCodeAt(0)-1,i=n;i<=a;)t.push(String.fromCharCode(i)),i++}else t.push(e[r]);r++}return t}var T2=/[\(\)\[\]\?\:\|]/,A2=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function na(e){return e.length===1?e[0]:e}function ds(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=I2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I2(e,t){if(e){if(typeof e=="string")return ls(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ls(e,t):void 0}}function ls(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ht(e){"@babel/helpers - typeof";return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(e)}function k2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D2(n.key),n)}}function R2(e,t,r){return t&&cs(e.prototype,t),r&&cs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function D2(e){var t=M2(e,"string");return Ht(t)=="symbol"?t:t+""}function M2(e,t){if(Ht(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ht(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F2=(function(){function e(t){k2(this,e),this.matchTree=new O2().parse(t)}return R2(e,[{key:"match",value:function(r){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).allowOverflow;if(!r)throw new Error("String is required");var a=Fa(r.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!n))return a}}])})();function Fa(e,t,r){if(typeof t=="string"){var n=e.join("");return t.indexOf(n)===0?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:n.indexOf(t)===0?r&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var a=e.slice(),i=0;i<t.length;){var s=t[i],d=Fa(a,s,r&&i===t.length-1);if(d){if(d.overflow)return d;if(d.match){if(a=a.slice(d.matchedChars.length),a.length===0)return i===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0}}else{if(d.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result:
31
+ `.concat(JSON.stringify(d,null,2)))}}else return;i++}return r?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-a.length)}}switch(t.op){case"|":for(var l,c=ds(t.args),u;!(u=c()).done;){var f=u.value,m=Fa(e,f,r);if(m){if(m.overflow)return m;if(m.match)return{match:!0,matchedChars:m.matchedChars};if(m.partialMatch)l=!0;else throw new Error(`Unsupported match result:
32
+ `.concat(JSON.stringify(m,null,2)))}}return l?{partialMatch:!0}:void 0;case"[]":for(var h=ds(t.args),p;!(p=h()).done;){var v=p.value;if(e[0]===v)return e.length===1?{match:!0,matchedChars:e}:r?{overflow:!0}:{match:!0,matchedChars:[v]}}return;default:throw new Error("Unsupported instruction tree: ".concat(t))}}function Kt(e){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(e)}function us(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=L2(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L2(e,t){if(e){if(typeof e=="string")return fs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fs(e,t):void 0}}function fs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function B2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ps(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V2(n.key),n)}}function U2(e,t,r){return t&&ps(e.prototype,t),r&&ps(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function V2(e){var t=z2(e,"string");return Kt(t)=="symbol"?t:t+""}function z2(e,t){if(Kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Kt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var La="9",q2=Ir(La,15),W2=/[- ]/,nn=!0,G2=nn&&function(){return/\[([^\[\]])*\]/g},H2=nn&&function(){return/\d(?=[^,}][^,}])/g},K2=new RegExp("["+Re+"]*\\$1["+Re+"]*(\\$\\d["+Re+"]*)*$"),hs=3,Y2=(function(){function e(t){t.state;var r=t.metadata;B2(this,e),this.metadata=r,this.resetFormat()}return U2(e,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(r,n){this.resetFormat(),r?(this.isNANP=r.callingCode()==="1",this.matchingFormats=r.formats(),n.nationalSignificantNumber&&this.narrowDownMatchingFormats(n)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(r,n){var a=this;if(S2(n.nationalSignificantNumber,n.country,this.metadata))for(var i=us(this.matchingFormats),s;!(s=i()).done;){var d=s.value,l=N2(n,d,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return a.shouldTryNationalPrefixFormattingRule(u,{international:n.international,nationalPrefix:n.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return a.getSeparatorAfterNationalPrefix(u)}});if(l)return this.resetFormat(),this.chosenFormat=d,this.setNationalNumberTemplate(l.replace(/\d/g,"x"),n),this.populatedNationalNumberTemplate=l,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),l}return this.formatNationalNumberWithNextDigits(r,n)}},{key:"formatNationalNumberWithNextDigits",value:function(r,n){var a=this.chosenFormat,i=this.chooseFormat(n);if(i)return i===a?this.formatNextNationalNumberDigits(r):this.formatNextNationalNumberDigits(n.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(r){var n=this,a=r.nationalSignificantNumber,i=r.nationalPrefix,s=r.international,d=a,l=d.length-hs;l<0&&(l=0),this.matchingFormats=this.matchingFormats.filter(function(c){return n.formatSuits(c,s,i)&&n.formatMatches(c,d,l)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(r,n,a){return!(a&&!r.usesNationalPrefix()&&!r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!n&&!a&&r.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(r,n,a){var i=r.leadingDigitsPatterns().length;if(i===0)return!0;a=Math.min(a,i-1);var s=r.leadingDigitsPatterns()[a];if(n.length<hs)try{return new F2(s).match(n,{allowOverflow:!0})!==void 0}catch(d){return console.error(d),!0}return new RegExp("^(".concat(s,")")).test(n)}},{key:"getFormatFormat",value:function(r,n){return n?r.internationalFormat():r.format()}},{key:"chooseFormat",value:function(r){for(var n=this,a=function(){var c=d.value;return n.chosenFormat===c?0:K2.test(n.getFormatFormat(c,r.international))?n.createTemplateForFormat(c,r)?(n.chosenFormat=c,0):(n.matchingFormats=n.matchingFormats.filter(function(u){return u!==c}),1):1},i,s=us(this.matchingFormats.slice()),d;!(d=s()).done&&(i=a(),i!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(r,n){if(!(nn&&r.pattern().indexOf("|")>=0)){var a=this.getTemplateForFormat(r,n);if(a)return this.setNationalNumberTemplate(a,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&W2.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var a=r.IDDPrefix,i=r.missingPlus;return a?n&&n.spacing===!1?a:a+" ":i?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,a=0,i=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";a<i.length+r.getDigitsWithoutInternationalPrefix().length;)n=this.template.indexOf("x",n+1),a++;return is(this.template,n+1)}}},{key:"setNationalNumberTemplate",value:function(r,n){this.nationalNumberTemplate=r,this.populatedNationalNumberTemplate=r,this.populatedNationalNumberTemplatePosition=-1,n.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(n).replace(/[\d\+]/g,"x")+Ir("x",n.callingCode.length)+" "+r:this.template=r}},{key:"getTemplateForFormat",value:function(r,n){var a=n.nationalSignificantNumber,i=n.international,s=n.nationalPrefix,d=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,l=r.pattern();nn&&(l=l.replace(G2(),"\\d").replace(H2(),"\\d"));var c=q2.match(l)[0];if(!(a.length>c.length)){var u=new RegExp("^"+l+"$"),f=a.replace(/\d/g,La);u.test(f)&&(c=f);var m=this.getFormatFormat(r,i),h;if(this.shouldTryNationalPrefixFormattingRule(r,{international:i,nationalPrefix:s})){var p=m.replace(xl,r.nationalPrefixFormattingRule());if(rn(r.nationalPrefixFormattingRule())===(s||"")+rn("$1")&&(m=p,h=!0,s))for(var v=s.length;v>0;)m=m.replace(/\d/,"x"),v--}var y=c.replace(new RegExp(l),m).replace(new RegExp(La,"g"),"x");return h||(d?y=Ir("x",d.length)+" "+y:s&&(y=Ir("x",s.length)+this.getSeparatorAfterNationalPrefix(r)+y)),i&&(y=Cl(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=b2(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],is(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var a=n.international,i=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var s=r.usesNationalPrefix();if(s&&i||!s&&!a)return!0}}}])})();function Yt(e){"@babel/helpers - typeof";return Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(e)}function Il(e,t){return Q2(e)||J2(e,t)||Z2(e,t)||X2()}function X2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
34
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z2(e,t){if(e){if(typeof e=="string")return ms(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ms(e,t):void 0}}function ms(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function J2(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function Q2(e){if(Array.isArray(e))return e}function ev(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rv(n.key),n)}}function tv(e,t,r){return t&&vs(e.prototype,t),r&&vs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rv(e){var t=nv(e,"string");return Yt(t)=="symbol"?t:t+""}function nv(e,t){if(Yt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Yt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var av="["+Re+ge+"]+",iv=new RegExp("^"+av+"$","i"),ov="(?:["+On+"]["+Re+ge+"]*|["+Re+ge+"]+)",sv=new RegExp("[^"+Re+ge+"]+.*$"),dv=/[^\d\[\]]/,lv=(function(){function e(t){var r=t.defaultCountry,n=t.defaultCallingCode,a=t.metadata,i=t.onNationalSignificantNumberChange;ev(this,e),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=a,this.onNationalSignificantNumberChange=i}return tv(e,[{key:"input",value:function(r,n){var a=Il(fv(r),2),i=a[0],s=a[1],d=rn(i),l;return s&&(n.digits||(n.startInternationalNumber(void 0,void 0),d||(l=!0))),d&&this.inputDigits(d,n),{digits:d,justLeadingPlus:l}}},{key:"inputDigits",value:function(r,n){var a=n.digits,i=a.length<3&&a.length+r.length>=3;if(n.appendDigits(r),i&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(s){return n.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,a=r.callingCode;return n&&!a}},{key:"extractCountryCallingCode",value:function(r){var n=$i("+"+r.getDigitsWithoutInternationalPrefix(),r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),a=n.countryCallingCode,i=n.number;if(a)return r.setCallingCode(a),r.update({nationalSignificantNumber:i}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&dv.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var a=Aa(r,this.metadata),i=a.nationalPrefix,s=a.nationalNumber,d=a.carrierCode;if(s!==r)return this.onExtractedNationalNumber(i,d,s,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,a){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,a);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var i=Aa(r,this.metadata),s=i.nationalPrefix,d=i.nationalNumber,l=i.carrierCode;if(d!==n)return this.onExtractedNationalNumber(s,l,d,r,a),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,a,i,s){var d=!1,l,c=i.lastIndexOf(a);if(c<0||c!==i.length-a.length)d=!0;else{var u=i.slice(0,c);u&&u!==r&&(l=u)}s({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:a,nationalSignificantNumberIsModified:d,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:l}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,a=r.IDDPrefix,i=r.digits;if(r.nationalSignificantNumber,!(n||a)){var s=bl(i,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==i)return r.update({IDDPrefix:i.slice(0,i.length-s.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=Sl(r.digits,r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(n)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:n}),!0}}},{key:"startInternationalNumber",value:function(r,n){var a=n.country,i=n.callingCode;r.startInternationalNumber(a,i),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}])})();function cv(e){var t=e.search(ov);if(!(t<0)){e=e.slice(t);var r;return e[0]==="+"&&(r=!0,e=e.slice(1)),e=e.replace(sv,""),r&&(e="+"+e),e}}function uv(e){var t=cv(e)||"";return t[0]==="+"?[t.slice(1),!0]:[t]}function fv(e){var t=Il(uv(e),2),r=t[0],n=t[1];return iv.test(r)||(r=""),[r,n]}function Xt(e){"@babel/helpers - typeof";return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(e)}function pv(e,t){return yv(e)||vv(e,t)||mv(e,t)||hv()}function hv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mv(e,t){if(e){if(typeof e=="string")return ys(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ys(e,t):void 0}}function ys(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function vv(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,d=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(d.push(n.value),d.length!==t);l=!0);}catch(u){c=!0,a=u}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return d}}function yv(e){if(Array.isArray(e))return e}function gv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gs(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bv(n.key),n)}}function $v(e,t,r){return t&&gs(e.prototype,t),r&&gs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function bv(e){var t=Nv(e,"string");return Xt(t)=="symbol"?t:t+""}function Nv(e,t){if(Xt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $s=!1,Pt=(function(){function e(t,r){gv(this,e),this.metadata=new de(r);var n=pv(this.getCountryAndCallingCode(t),2),a=n[0],i=n[1];this.defaultCountry=a,this.defaultCallingCode=i,this.reset()}return $v(e,[{key:"getCountryAndCallingCode",value:function(r){var n,a;return r&&(et(r)?(n=r.defaultCountry,a=r.defaultCallingCode):n=r),n&&!this.metadata.hasCountry(n)&&(n=void 0),a&&$s&&this.metadata.isNonGeographicCallingCode(a)&&(n="001"),[n,a]}},{key:"input",value:function(r){var n=this.parser.input(r,this.state),a=n.digits;if(n.justLeadingPlus)this.formattedOutput="+";else if(a){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var i;if(this.metadata.hasSelectedNumberingPlan()&&(i=this.formatter.format(a,this.state)),i===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var s=this.state.getNationalDigits();s&&(i=this.formatter.format(s,this.state))}this.formattedOutput=i?this.getFullNumber(i):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var r=this;return this.state=new v2({onCountryChange:function(a){r.country=a},onCallingCodeChange:function(a,i){r.metadata.selectNumberingPlan(i,a),r.formatter.reset(r.metadata.numberingPlan,r.state),r.parser.reset(r.metadata.numberingPlan)}}),this.formatter=new Y2({state:this.state,metadata:this.metadata}),this.parser=new lv({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){r.determineTheCountryIfNeeded(),r.formatter.reset(r.metadata.numberingPlan,r.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){var r=this.state.country;if(!($s&&r==="001"))return r}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(r){var n=this;if(this.isInternational()){var a=function(d){return n.formatter.getInternationalPrefixBeforeCountryCallingCode(n.state,{spacing:!!d})+d},i=this.state.callingCode;return a(i?r?"".concat(i," ").concat(r):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return r}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var r=this.state,n=r.nationalSignificantNumber,a=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,i=r.nationalPrefix,s=n,d=a||i;return d&&(s=d+s),s}},{key:"getNonFormattedNumber",value:function(){var r=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(r?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var r=this.getNonFormattedNumber();if(r)return r.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var r=this.state.callingCode,n=this.metadata.getCountryCodesForCallingCode(r);return n&&n.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(gi(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,a=r.callingCode,i=r.country,s=r.nationalSignificantNumber;if(n){if(this.isInternational())return a?"+"+a+s:"+"+n;if(i||a)return"+"+(i?this.metadata.countryCallingCode():a)+s}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,a=r.carrierCode,i=r.callingCode,s=this._getCountry();if(n&&!(!s&&!i)){if(s&&s===this.defaultCountry){var d=new de(this.metadata.metadata);d.selectNumberingPlan(s);var l=d.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=Nl(n,{countries:c,metadata:this.metadata.metadata});u&&(s=u)}}var f=new Pl(s||i,n,this.metadata.metadata);return a&&(f.carrierCode=a),f}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function bs(e){return new de(e).getCountries()}function Sv(e,t,r){return r||(r=t,t=void 0),new Pt(t,r).input(e)}var an=Jt(Ah(),1);function kl(e){var t=e.inputFormat,r=e.country,n=e.metadata;return t==="NATIONAL_PART_OF_INTERNATIONAL"?"+".concat(Xe(r,n)):""}function Ba(e,t){return t&&(e=e.slice(t.length),e[0]===" "&&(e=e.slice(1))),e}function Cv(e,t,r){if(!(r&&r.ignoreRest))return jl(e,t,function(a){r&&a==="end"&&(r.ignoreRest=!0)})}function Rl(e){var t=e.onKeyDown,r=e.inputFormat;return(0,S.useCallback)(function(n){if(n.keyCode===_v&&r==="INTERNATIONAL"&&n.target instanceof HTMLInputElement&&xv(n.target)===wv.length){n.preventDefault();return}t&&t(n)},[t,r])}function xv(e){return e.selectionStart}var _v=8,wv="+",Ev=["onKeyDown","country","inputFormat","metadata","international","withCountryCallingCode"];function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ua.apply(this,arguments)}function Pv(e,t){if(e==null)return{};var r=Ov(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ov(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function jv(e){function t(r,n){var a=r.onKeyDown,i=r.country,s=r.inputFormat,d=r.metadata,l=d===void 0?e:d;r.international,r.withCountryCallingCode;var c=Pv(r,Ev),u=(0,S.useCallback)(function(m){var h=new Pt(i,l),p=kl({inputFormat:s,country:i,metadata:l}),v=h.input(p+m),y=h.getTemplate();return p&&(v=Ba(v,p),y&&(y=Ba(y,p))),{text:v,template:y}},[i,l]),f=Rl({onKeyDown:a,inputFormat:s});return S.default.createElement(s1,Ua({},c,{ref:n,parse:Cv,format:u,onKeyDown:f}))}return t=S.default.forwardRef(t),t.propTypes={value:P.default.string.isRequired,onChange:P.default.func.isRequired,onKeyDown:P.default.func,country:P.default.string,inputFormat:P.default.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:P.default.object},t}var Tv=jv(),Av=["value","onChange","onKeyDown","country","inputFormat","metadata","inputComponent","international","withCountryCallingCode"];function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Va.apply(this,arguments)}function Iv(e,t){if(e==null)return{};var r=kv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Rv(e){function t(r,n){var a=r.value,i=r.onChange,s=r.onKeyDown,d=r.country,l=r.inputFormat,c=r.metadata,u=c===void 0?e:c,f=r.inputComponent,m=f===void 0?"input":f;r.international,r.withCountryCallingCode;var h=Iv(r,Av),p=kl({inputFormat:l,country:d,metadata:u}),v=(0,S.useCallback)(function($){var g=Ra($.target.value);g===a&&Ns(p,g,d,u).indexOf($.target.value)===0&&(g=g.slice(0,-1)),i(g)},[p,a,i,d,u]),y=Rl({onKeyDown:s,inputFormat:l});return S.default.createElement(m,Va({},h,{ref:n,value:Ns(p,a,d,u),onChange:v,onKeyDown:y}))}return t=S.default.forwardRef(t),t.propTypes={value:P.default.string.isRequired,onChange:P.default.func.isRequired,onKeyDown:P.default.func,country:P.default.string,inputFormat:P.default.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:P.default.object,inputComponent:P.default.elementType},t}var Dv=Rv();function Ns(e,t,r,n){return Ba(Sv(e+t,r,n),e)}function Mv(e){return Ss(e[0])+Ss(e[1])}function Ss(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var Fv=["value","onChange","options","disabled","readOnly"],Lv=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function Bv(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Uv(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uv(e,t){if(e){if(typeof e=="string")return Cs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cs(e,t)}}function Cs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},on.apply(this,arguments)}function Dl(e,t){if(e==null)return{};var r=Vv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Ml(e){var t=e.value,r=e.onChange,n=e.options,a=e.disabled,i=e.readOnly,s=Dl(e,Fv),d=(0,S.useCallback)(function(l){var c=l.target.value;r(c==="ZZ"?void 0:c)},[r]);return(0,S.useMemo)(function(){return Ll(n,t)},[n,t]),S.default.createElement("select",on({},s,{disabled:a||i,readOnly:i,value:t||"ZZ",onChange:d}),n.map(function(l){var c=l.value,u=l.label,f=l.divider;return S.default.createElement("option",{key:f?"|":c||"ZZ",value:f?"|":c||"ZZ",disabled:!!f,style:f?zv:void 0},u)}))}Ml.propTypes={value:P.default.string,onChange:P.default.func.isRequired,options:P.default.arrayOf(P.default.shape({value:P.default.string,label:P.default.string,divider:P.default.bool})).isRequired,disabled:P.default.bool,readOnly:P.default.bool};var zv={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function Fl(e){var t=e.value,r=e.options,n=e.className,a=e.iconComponent;e.getIconAspectRatio;var i=e.arrowComponent,s=i===void 0?qv:i,d=e.unicodeFlags,l=Dl(e,Lv),c=(0,S.useMemo)(function(){return Ll(r,t)},[r,t]);return S.default.createElement("div",{className:"PhoneInputCountry"},S.default.createElement(Ml,on({},l,{value:t,options:r,className:(0,an.default)("PhoneInputCountrySelect",n)})),c&&(d&&t?S.default.createElement("div",{className:"PhoneInputCountryIconUnicode"},Mv(t)):S.default.createElement(a,{"aria-hidden":!0,country:t,label:c.label,aspectRatio:d?1:void 0})),S.default.createElement(s,null))}Fl.propTypes={iconComponent:P.default.elementType,arrowComponent:P.default.elementType,unicodeFlags:P.default.bool};function qv(){return S.default.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function Ll(e,t){for(var r=Bv(e),n;!(n=r()).done;){var a=n.value;if(!a.divider&&Wv(a.value,t))return a}}function Wv(e,t){return e==null?t==null:e===t}var Gv=["country","countryName","flags","flagUrl"];function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},za.apply(this,arguments)}function Hv(e,t){if(e==null)return{};var r=Kv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Kv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Ni(e){var t=e.country,r=e.countryName,n=e.flags,a=e.flagUrl,i=Hv(e,Gv);return n&&n[t]?n[t]({title:r}):S.default.createElement("img",za({},i,{alt:r,role:r?void 0:"presentation",src:a.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}Ni.propTypes={country:P.default.string.isRequired,countryName:P.default.string.isRequired,flags:P.default.objectOf(P.default.elementType),flagUrl:P.default.string.isRequired};var Yv=["aspectRatio"],Xv=["title"],Zv=["title"];function sn(){return sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sn.apply(this,arguments)}function Si(e,t){if(e==null)return{};var r=Jv(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jv(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function jn(e){var t=e.aspectRatio,r=Si(e,Yv);return t===1?S.default.createElement(Ul,r):S.default.createElement(Bl,r)}jn.propTypes={title:P.default.string.isRequired,aspectRatio:P.default.number};function Bl(e){var t=e.title,r=Si(e,Xv);return S.default.createElement("svg",sn({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),S.default.createElement("title",null,t),S.default.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},S.default.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),S.default.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),S.default.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),S.default.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),S.default.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),S.default.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),S.default.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}Bl.propTypes={title:P.default.string.isRequired};function Ul(e){var t=e.title,r=Si(e,Zv);return S.default.createElement("svg",sn({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),S.default.createElement("title",null,t),S.default.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},S.default.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),S.default.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),S.default.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),S.default.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),S.default.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),S.default.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),S.default.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}Ul.propTypes={title:P.default.string.isRequired};function Qv(e){if(e.length<2||e[0]!=="+")return!1;for(var t=1;t<e.length;){var r=e.charCodeAt(t);if(!(r>=48&&r<=57))return!1;t++}return!0}function Vl(e){Qv(e)||console.error("[react-phone-number-input] Expected the initial `value` to be a E.164 phone number. Got",e)}function ey(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ty(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ty(e,t){if(e){if(typeof e=="string")return xs(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xs(e,t)}}function xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ry(e,t){if(!t)return e;for(var r=[],n=[],a=r,i=function(){var c=d.value;if(c==="|")a.push({divider:!0});else if(c==="..."||c==="…")a=n;else{var u;c==="🌐"?u=void 0:u=c;var f=e.indexOf(e.filter(function(h){return h.value===u})[0]),m=e[f];e.splice(f,1),a.push(m)}},s=ey(t),d;!(d=s()).done;)i();return r.concat(e).concat(n)}function ny(e,t){if(e&&(e=e.filter(function(r){switch(r){case"🌐":case"|":case"...":case"…":return!0;default:return Tn(r,t)}}),e.length>0))return e}function Tn(e,t){return vl(e,t)?!0:(console.error("Country not found: ".concat(e)),!1)}function zl(e,t){return e&&(e=e.filter(function(r){return Tn(r,t)}),e.length===0&&(e=void 0)),e}var ay=["country","label","aspectRatio"];function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qa.apply(this,arguments)}function iy(e,t){if(e==null)return{};var r=oy(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oy(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ql(e){var t=e.flags,r=e.flagUrl,n=e.flagComponent,a=e.internationalIcon;function i(s){var d=s.country,l=s.label,c=s.aspectRatio,u=iy(s,ay),f=a===jn?c:void 0;return S.default.createElement("div",qa({},u,{className:(0,an.default)("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":f===1,"PhoneInputCountryIcon--border":d})}),d?S.default.createElement(n,{country:d,countryName:l,flags:t,flagUrl:r,className:"PhoneInputCountryIconImg"}):S.default.createElement(a,{title:l,aspectRatio:f,className:"PhoneInputCountryIconImg"}))}return i.propTypes={country:P.default.string,label:P.default.string.isRequired,aspectRatio:P.default.number},i}var fg=ql({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:Ni,internationalIcon:jn});function sy(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=dy(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dy(e,t){if(e){if(typeof e=="string")return _s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _s(e,t)}}function _s(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ly(e,t){for(var r=sy(e),n;!(n=r()).done;){var a=n.value;a&&cy(a,t)}}function cy(e,t){typeof e=="function"?e(t):e.current=t}var Wl=P.default.shape({country_calling_codes:P.default.object.isRequired,countries:P.default.object.isRequired}),Gl=P.default.objectOf(P.default.string);function Ve(e,t){return"+"+Xe(e,t)}function uy(e){var t=e.value,r=e.phoneNumber,n=e.defaultCountry,a=e.getAnyCountry,i=e.countries,s=e.required,d=e.metadata,l;return r&&r.country?l=r.country:n&&(!t||mt(t,n,d))&&(l=n),i&&i.indexOf(l)<0&&(l=void 0),!l&&s&&i&&i.length>0&&(l=a()),l}function fy(e){var t=e.countries,r=e.countryNames,n=e.addInternationalOption,a=e.compareStringsLocales,i=e.compareStrings;i||(i=$y);var s=t.map(function(d){return{value:d,label:r[d]||d}});return s.sort(function(d,l){return i(d.label,l.label,a)}),n&&s.unshift({label:r.ZZ}),s}function Hl(e,t){return s2(e||"",t)}function py(e){return e.formatNational().replace(/\D/g,"")}function hy(e,t){var r=t.prevCountry,n=t.newCountry,a=t.metadata,i=t.useNationalFormat;if(r===n)return e;if(!e)return i?"":n?Ve(n,a):"";if(n){if(e[0]==="+"){if(i)return e.indexOf("+"+Xe(n,a))===0?by(e,n,a):"";if(r){var s=Ve(n,a);return e.indexOf(s)===0?e:s}else{var d=Ve(n,a);return e.indexOf(d)===0?e:d}}}else if(e[0]!=="+")return lt(e,r,a)||"";return e}function lt(e,t,r){if(e){if(e[0]==="+"){if(e==="+")return;var n=new Pt(t,r);return n.input(e),n.getNumberValue()}if(t){var a=Yl(e,t,r);return"+".concat(Xe(t,r)).concat(a||"")}}}function my(e,t,r){var n=Yl(e,t,r);if(n){var a=n.length-vy(t,r);if(a>0)return e.slice(0,e.length-a)}return e}function vy(e,t){return t=new de(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function Kl(e,t){var r=t.country,n=t.countries,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.required,d=t.metadata;if(e==="+")return r;var l=gy(e,d);if(l)return!n||n.indexOf(l)>=0?l:void 0;if(r){if(mt(e,r,d)){if(i&&mt(e,i,d))return i;if(a&&mt(e,a,d))return a;if(!s)return}else if(!s)return}return r}function yy(e,t){var r=t.prevPhoneDigits,n=t.country,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,d=t.getAnyCountry,l=t.countries,c=t.international,u=t.limitMaxLength,f=t.countryCallingCodeEditable,m=t.metadata;if(c&&f===!1&&n){var h=Ve(n,m);if(e.indexOf(h)!==0){var p;return e&&e[0]!=="+"?(e=h+e,p=lt(e,n,m)):e=h,{phoneDigits:e,value:p,country:n}}}c===!1&&n&&e&&e[0]==="+"&&(e=ws(e,n,m)),e&&n&&u&&(e=my(e,n,m)),e&&e[0]!=="+"&&(!n||c)&&(e="+"+e),!e&&r&&r[0]==="+"&&(c?n=void 0:n=a),e==="+"&&r&&r[0]==="+"&&r.length>1&&(n=void 0);var v;return e&&(e[0]==="+"&&(e==="+"||n&&Ve(n,m).indexOf(e)===0)?v=void 0:v=lt(e,n,m)),v&&(n=Kl(v,{country:n,countries:l,defaultCountry:a,latestCountrySelectedByUser:i,required:!1,metadata:m}),c===!1&&n&&e&&e[0]==="+"&&(e=ws(e,n,m),v=lt(e,n,m))),!n&&s&&(n=a||d()),{phoneDigits:e,country:n,value:v}}function ws(e,t,r){if(e.indexOf(Ve(t,r))===0){var n=new Pt(t,r);n.input(e);var a=n.getNumber();return a?a.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function gy(e,t){var r=new Pt(null,t);return r.input(e),r.getCountry()}function $y(e,t,r){return String.prototype.localeCompare?e.localeCompare(t,r):e<t?-1:e>t?1:0}function by(e,t,r){if(t){var n="+"+Xe(t,r);if(e.length<n.length){if(n.indexOf(e)===0)return""}else if(e.indexOf(n)===0)return e.slice(n.length)}for(var a=0,i=Object.keys(r.country_calling_codes);a<i.length;a++){var s=i[a];if(e.indexOf(s)===1)return e.slice(1+s.length)}return""}function Yl(e,t,r){var n=new Pt(t,r);n.input(e);var a=n.getNumber();return a&&a.nationalNumber}function mt(e,t,r){for(var n=Ve(t,r),a=0;a<e.length&&a<n.length;){if(e[a]!==n[a])return!1;a++}return!0}function Xl(e){var t=e.value,r=e.phoneNumber,n=e.defaultCountry,a=e.international,i=e.useNationalFormat,s=e.metadata;return(a===!1||i)&&r&&r.country?py(r):!t&&a&&n?Ve(n,s):t}function Zt(e){"@babel/helpers - typeof";return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(e)}function Es(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Es(Object(r),!0).forEach(function(n){Ny(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Es(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ny(e,t,r){return t=Sy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sy(e){var t=Cy(e,"string");return Zt(t)=="symbol"?t:t+""}function Cy(e,t){if(Zt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xy(e,t,r){var n=e.metadata,a=e.countries,i=e.defaultCountry,s=e.value,d=e.reset,l=e.international,c=e.displayInitialValueAsLocalNumber,u=e.initialValueFormat,f=t.defaultCountry,m=t.value,h=t.reset;r.country;var p=r.value,v=r.hasUserSelectedACountry,y=r.latestCountrySelectedByUser,$=function(W){return Xl(mr(mr({},W),{},{international:l,useNationalFormat:c||u==="national",metadata:n}))};if(d!==h)return{phoneDigits:$({value:void 0,defaultCountry:i}),value:void 0,country:i,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(i!==f){var g=!i||Tn(i,n),C=!p||l&&p===$({value:void 0,defaultCountry:f});if(!v&&g&&!s&&C)return{country:i,phoneDigits:$({value:void 0,defaultCountry:i}),value:void 0}}if(!Ps(s,m)&&!Ps(s,p)){var x,N;if(s){s&&Vl(s),x=Hl(s,n);var b=zl(a,n);x&&x.country?(!b||b.indexOf(x.country)>=0)&&(N=x.country):(N=Kl(s,{country:void 0,countries:b,metadata:n}),N||i&&s.indexOf(Ve(i,n))===0&&(N=i))}var T;return s?y&&((N?y===N:mt(s,y,n))?N||(N=y):T={latestCountrySelectedByUser:void 0}):T={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0},mr(mr({},T),{},{phoneDigits:$({phoneNumber:x,value:s,defaultCountry:i}),value:s,country:s?N:i})}}function Ps(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var _y=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function St(e){"@babel/helpers - typeof";return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function Os(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Os(Object(r),!0).forEach(function(n){Te(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vt.apply(this,arguments)}function wy(e,t){if(e==null)return{};var r=Ey(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ey(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Py(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function js(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ql(n.key),n)}}function Oy(e,t,r){return t&&js(e.prototype,t),r&&js(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jy(e,t,r){return t=dn(t),Ty(e,Jl()?Reflect.construct(t,r||[],dn(e).constructor):t.apply(e,r))}function Ty(e,t){if(t&&(St(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ay(e)}function Ay(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jl=function(){return!!e})()}function dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dn(e)}function Iy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wa(e,t)}function Wa(e,t){return Wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Wa(e,t)}function Te(e,t,r){return t=Ql(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ql(e){var t=ky(e,"string");return St(t)=="symbol"?t:t+""}function ky(e,t){if(St(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ry=(function(e){function t(r){var n;Py(this,t),n=jy(this,t,[r]),Te(n,"setInputRef",function(y){ly([n.props.inputRef,n.inputRef],y)}),Te(n,"isCountrySupportedWithError",function(y){var $=n.props.metadata;return Tn(y,$)}),Te(n,"onCountryChange",function(y){var $=n.props,g=$.international,C=$.metadata,x=$.onChange,N=$.focusInputOnCountrySelection,b=n.state,T=b.phoneDigits,R=b.country,W=hy(T,{prevCountry:R,newCountry:y,metadata:C,useNationalFormat:!g}),Q=lt(W,y,C);N&&n.inputRef.current.focus(),n.setState({country:y,latestCountrySelectedByUser:y,hasUserSelectedACountry:!0,phoneDigits:W,value:Q},function(){x(Q)})}),Te(n,"onChange",function(y){var $=n.props,g=$.defaultCountry,C=$.onChange,x=$.addInternationalOption,N=$.international,b=$.limitMaxLength,T=$.countryCallingCodeEditable,R=$.metadata,W=n.state,Q=W.countries,oe=W.phoneDigits,ee=W.country,pe=W.latestCountrySelectedByUser,$e=yy(y,{prevPhoneDigits:oe,country:ee,countryRequired:!x,defaultCountry:g,latestCountrySelectedByUser:pe,getAnyCountry:function(){return n.getFirstSupportedCountry({countries:Q})},countries:Q,international:N,limitMaxLength:b,countryCallingCodeEditable:T,metadata:R}),ne=$e.phoneDigits,ce=$e.country,ue=$e.value,ae={phoneDigits:ne,value:ue,country:ce};pe&&ue&&!mt(ue,pe,R)&&(ae.latestCountrySelectedByUser=void 0),T===!1&&!ue&&ne===n.state.phoneDigits&&(ae.forceRerender={}),n.setState(ae,function(){return C(ue)})}),Te(n,"_onFocus",function(){return n.setState({isFocused:!0})}),Te(n,"_onBlur",function(){return n.setState({isFocused:!1})}),Te(n,"onFocus",function(y){n._onFocus();var $=n.props.onFocus;$&&$(y)}),Te(n,"onBlur",function(y){var $=n.props.onBlur;n._onBlur(),$&&$(y)}),Te(n,"onCountryFocus",function(y){n._onFocus();var $=n.props.countrySelectProps;if($){var g=$.onFocus;g&&g(y)}}),Te(n,"onCountryBlur",function(y){n._onBlur();var $=n.props.countrySelectProps;if($){var g=$.onBlur;g&&g(y)}}),n.inputRef=S.default.createRef();var a=n.props,i=a.value;a.labels;var s=a.international,d=a.addInternationalOption,l=a.displayInitialValueAsLocalNumber,c=a.initialValueFormat,u=a.metadata,f=n.props,m=f.defaultCountry,h=f.countries;m&&(n.isCountrySupportedWithError(m)||(m=void 0)),i&&Vl(i),h=zl(h,u);var p=Hl(i,u);n.CountryIcon=ql(n.props);var v=uy({value:i,phoneNumber:p,defaultCountry:m,required:!d,countries:h||bs(u),getAnyCountry:function(){return n.getFirstSupportedCountry({countries:h})},metadata:u});return n.state={props:n.props,country:v,countries:h,phoneDigits:Xl({value:i,phoneNumber:p,defaultCountry:m,international:s,useNationalFormat:l||c==="national",metadata:u}),value:i},n}return Iy(t,e),Oy(t,[{key:"componentDidMount",value:function(){var n=this.props.onCountryChange,a=this.props.defaultCountry,i=this.state.country;n&&(a&&(this.isCountrySupportedWithError(a)||(a=void 0)),i!==a&&n(i))}},{key:"componentDidUpdate",value:function(n,a){var i=this.props.onCountryChange,s=this.state.country;i&&s!==a.country&&i(s)}},{key:"getCountrySelectOptions",value:function(n){var a=n.countries,i=this.props,s=i.international,d=i.countryCallingCodeEditable,l=i.countryOptionsOrder,c=i.addInternationalOption,u=i.labels,f=i.locales,m=i.metadata;return this.useMemoCountrySelectOptions(function(){return ry(fy({countries:a||bs(m),countryNames:u,addInternationalOption:s&&d===!1?!1:c,compareStringsLocales:f}),ny(l,m))},[a,l,c,u,m])}},{key:"useMemoCountrySelectOptions",value:function(n,a){return(!this.countrySelectOptionsMemoDependencies||!My(a,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=n(),this.countrySelectOptionsMemoDependencies=a),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(n){var a=n.countries;return this.getCountrySelectOptions({countries:a})[0].value}},{key:"render",value:function(){var n=this.props,a=n.name,i=n.disabled,s=n.readOnly,d=n.autoComplete,l=n.style,c=n.className;n.inputRef;var u=n.inputComponent,f=n.numberInputProps,m=n.smartCaret,h=n.countrySelectComponent,p=n.countrySelectProps,v=n.containerComponent,y=n.containerComponentProps;n.defaultCountry,n.countries,n.countryOptionsOrder;var $=n.labels;n.flags,n.flagComponent,n.flagUrl,n.addInternationalOption,n.internationalIcon,n.displayInitialValueAsLocalNumber,n.initialValueFormat,n.onCountryChange,n.limitMaxLength,n.countryCallingCodeEditable,n.focusInputOnCountrySelection,n.reset;var g=n.metadata,C=n.international;n.locales;var x=wy(n,_y),N=this.state,b=N.country,T=N.countries,R=N.phoneDigits,W=N.isFocused,Q=m?Tv:Dv,oe=this.getCountrySelectOptions({countries:T});return S.default.createElement(v,vt({style:l,className:(0,an.default)(c,"PhoneInput",{"PhoneInput--focus":W,"PhoneInput--disabled":i,"PhoneInput--readOnly":s})},y),S.default.createElement(h,vt({name:a?"".concat(a,"Country"):void 0,"aria-label":$.country},p,{value:b,options:oe,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:i||p&&p.disabled,readOnly:s||p&&p.readOnly,iconComponent:this.CountryIcon})),S.default.createElement(Q,vt({ref:this.setInputRef,type:"tel",autoComplete:d},f,x,{inputFormat:C===!0?"INTERNATIONAL":C===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:C?!0:void 0,withCountryCallingCode:C?!0:void 0,name:a,metadata:g,country:b,value:R||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:i,readOnly:s,inputComponent:u,className:(0,an.default)("PhoneInputInput",f&&f.className,x.className)})))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return Zl({props:n},xy(n,a.props,a))}}])})(S.default.PureComponent),ec=S.default.forwardRef(function(e,t){return S.default.createElement(Ry,vt({},Dy(e),{inputRef:t}))});ec.propTypes={value:P.default.string,onChange:P.default.func.isRequired,onFocus:P.default.func,onBlur:P.default.func,disabled:P.default.bool,readOnly:P.default.bool,autoComplete:P.default.string,initialValueFormat:P.default.oneOf(["national"]),displayInitialValueAsLocalNumber:P.default.bool,defaultCountry:P.default.string,countries:P.default.arrayOf(P.default.string),labels:Gl,locales:P.default.oneOfType([P.default.string,P.default.arrayOf(P.default.string)]),flagUrl:P.default.string,flags:P.default.objectOf(P.default.elementType),flagComponent:P.default.elementType,addInternationalOption:P.default.bool,internationalIcon:P.default.elementType,countryOptionsOrder:P.default.arrayOf(P.default.string),style:P.default.object,className:P.default.string,countrySelectComponent:P.default.elementType,countrySelectProps:P.default.object,inputComponent:P.default.elementType,numberInputProps:P.default.object,containerComponent:P.default.elementType,containerComponentProps:P.default.object,smartCaret:P.default.bool,international:P.default.bool,limitMaxLength:P.default.bool,countryCallingCodeEditable:P.default.bool,metadata:Wl,onCountryChange:P.default.func,focusInputOnCountrySelection:P.default.bool};var Ts={autoComplete:"tel",countrySelectComponent:Fl,flagComponent:Ni,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:jn,inputComponent:"input",containerComponent:"div",reset:P.default.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function Dy(e){e=Zl({},e);for(var t in Ts)e[t]===void 0&&(e[t]=Ts[t]);return e}function My(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;){if(e[r]!==t[r])return!1;r++}return!0}var Fy={ext:"ext.",country:"Phone number country",phone:"Phone",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XA:"Abkhazia",XK:"Kosovo",XO:"South Ossetia",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"},Ly=["metadata","labels"];function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ga.apply(this,arguments)}function By(e,t){if(e==null)return{};var r=Uy(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Uy(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function tc(e){var t=S.default.forwardRef(function(r,n){var a=r.metadata,i=a===void 0?e:a,s=r.labels,d=s===void 0?Fy:s,l=By(r,Ly);return S.default.createElement(ec,Ga({},l,{ref:n,metadata:i,labels:d}))});return t.propTypes={metadata:Wl,labels:Gl},t}var pg=tc();function Vy(e,t){var r=Array.prototype.slice.call(t);return r.push(pl),e.apply(this,r)}var zy=tc(pl);function aa(){return Vy(u2,arguments)}var qy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vr="consentDraftByService",Wy=15,Gy=["IN","US","CA","PH","NZ","AU","CN"],Hy=e=>{const[t,r]=e.split("/");return+`${t}${r}`};function Ky(){const e=(0,M.useDispatch)(),{tenantId:t,id:r}=(0,M.useSelector)(E=>E.booking.outletDetails),{timeZone:n,image:a,outletName:i,address:s}=(0,M.useSelector)(E=>E.booking.outletDetails),{staff:d,selectedServices:l,selectedProfessional:c}=(0,M.useSelector)(E=>E.booking.service),{selectedSlotIds:u,selectedDate:f,selectedTime:m}=(0,M.useSelector)(E=>E.booking.slots),{userDetails:h,bookingMode:p,tipPct:v}=(0,M.useSelector)(E=>E.booking.appointment),y=Array.isArray(l)?l:[l],{selectedSlotIndexes:$,slots:g}=(0,M.useSelector)(E=>E.booking.slots),[C,x]=(0,S.useState)(!1),[N,b]=(0,S.useState)(!1),[T,R]=(0,S.useState)(null),[W,Q]=(0,S.useState)("person"),[oe,ee]=(0,S.useState)(!1),[pe,$e]=(0,S.useState)(""),[ne,ce]=(0,S.useState)(""),[ue,ae]=(0,S.useState)(null),[he,je]=(0,S.useState)(null),[be,O]=(0,S.useState)({}),[k,U]=(0,S.useState)({}),[z,B]=(0,S.useState)(!1),V=(0,S.useRef)(!1),F=(0,S.useRef)(""),w=me.DateTime.now().setZone(n??"UTC"),[_,j]=(0,S.useState)(null),[D,A]=(0,S.useState)(!1),K=(0,S.useRef)(""),le=(0,S.useRef)(null),{register:Fe,handleSubmit:Ot,control:at,watch:Ci,reset:An,trigger:xi,setValue:jt,formState:{errors:it,isSubmitted:_i,isSubmitting:rc}}=(0,Ue.useForm)({defaultValues:{firstName:h?.firstName||"",lastName:h?.lastName||"",phone:h?.phone||"",email:h?.email||""},mode:"onChange",reValidateMode:"onChange"}),In=Ci("phone"),kn=Ci("email"),Rn=E=>E?.replace(/\s+/g,"")||"",nc=E=>/^\S+@\S+\.\S+$/.test(E),Dn=y.map(E=>{const I=d?.find(G=>G.id===c?.id)?.assignments?.find(G=>G.id===E.id),L={...E,price:I?.price??E.price??E.min_price??0,duration:I?.duration??E.estimated_time??E.min_time??0};return{...L,duration:I?.duration??E.estimated_time??E.min_time??0,tax:No(L),unitTax:No(L,{perUnit:!0})}}),Mn=[...g?.morning??[],...g?.afternoon??[],...g?.evening??[]],ac=Dn.reduce((E,I)=>E+Number(I.duration??0),0),ic=Math.ceil(ac/Wy),oc=E=>{if(!Mn.length)return"";const I=Mn[E]?.start_time_12h,L=Mn[E+ic-1];return!I||!L?"":`${I} - ${L.end_time_12h??L.start_time_12h}`},wi={day:Number(f?.day??w.day),month:Number(f?.month??w.month),year:Number(f?.year??w.year)},Ei=$?.[0],Pi=Ei!==void 0?oc(Ei):null,sc=Pi?`${qy[wi.month-1]} ${wi.day} at ${Pi}`:null,Fn=Dn.reduce((E,I)=>E+Number(I.price)*(I.qty??1),0),Oi=Dn.reduce((E,I)=>E+I.tax,0),dc=Math.round(Oi*100),ji=Fn*v/100,lc=Math.round(ji*100),Ti=Fn+ji+Oi,Ee=(0,S.useMemo)(()=>y.filter(E=>!(!ii(E)||(E?.consent_rule?.enforcementMode??E?.enforcementMode)==="FIXED")),[y]),cc=(0,S.useMemo)(()=>Ee.map(E=>String(E.id)).filter(Boolean),[Ee]),uc=E=>{const I=E?.consent_template??E?.consentTemplate??null;return{heading:String(I?.heading??"").trim(),consent:String(I?.consent??"").trim()}},Ln=E=>{O(I=>({...I,[String(E)]:!0}))};(0,S.useEffect)(()=>{h&&Ee?.length>0&&pc()},[h,Ee?.length]),(0,S.useEffect)(()=>{An({...h,phone:h?.phone||""},{keepErrors:!0,keepDirty:!1})},[h,An]),(0,S.useEffect)(()=>{_i&&xi(["phone","email"])},[In,kn,_i,xi]);const Ai=(0,S.useCallback)(async({value:E,type:I})=>{if(!E)return;let L="";if(I==="phone"){if(!aa(E))return;L=Rn(E)}if(I==="email"){if(!nc(E))return;L=E.trim()}if(L&&!(K.current===L&&D)){K.current=L,x(!0),j(I);try{const G=(await Of({search:L,tenantId:t}))?.data?.[0];G?(jt("firstName",G.first_name||"",{shouldValidate:!0}),jt("lastName",G.last_name||""),G.phone&&aa(G.phone)&&jt("phone",G.phone),G.email&&jt("email",G.email),e(Gn({email:G.email,firstName:G.first_name,lastName:G.last_name,phone:G.phone})),A(!0)):A(!1)}catch(G){console.error(G)}finally{x(!1),j(null)}}},[e,jt,t,D]);(0,S.useEffect)(()=>(le.current=(0,jc.debounce)(Ai,800),()=>{le.current?.cancel?.()}),[Ai]);const Ii=(E,I,L)=>{if(I&&I(E),!E){le.current?.cancel?.(),K.current="",A(!1),j(null);return}j(L),le.current?.({value:E,type:L})},fc=()=>{An({firstName:"",lastName:"",email:"",phone:""}),A(!1),K.current="",e(Mf())},pc=async()=>{const E=h?.id;if(E){B(!0);try{const I={};for(const L of Ee){const G=String(L.id),te=String(L.consent_form_id??"");if(!G||!te)continue;const Y=fo(L);if(!(Y==="EVERY_X_DAYS"||Y==="ONCE_PER_CUSTOMER")){I[G]={data:{checked:!0,needsSignature:!0}};continue}const _e=!!(await ho(E,te,G))?.data?.needsSignature;I[G]={data:{checked:!0,needsSignature:_e}},_e||Ln(G)}U(I)}catch(I){console.error(I)}finally{B(!1)}}},Bn=(0,S.useMemo)(()=>Ee.filter(E=>{const I=String(E.id);if(be[I])return!1;const L=k[I];return!(L?.data?.checked&&L?.data?.needsSignature===!1)}),[Ee,be,k]),ki=cc.length,Ri=ki-Bn.length,Di=Bn.length===0,Mi=async()=>{if(!V.current){V.current=!0;try{if(!h?.firstName){J.toast.warn("Please enter First Name before signing consent.");return}if(!h?.email&&!h?.phone){J.toast.warn("Please enter Email or Mobile Number before signing consent.");return}const E=Bn[0];if(!E){await Un();return}const I=String(E.id);if(F.current===I&&oe)return;F.current=I;const L=String(E.consent_form_id??"");if(!L){J.toast.error("Consent form missing.");return}const G=po(E);if(!G){J.toast.error("Consent enforcement method not found.");return}const te=h?.id;if(fo(E)!=="EVERY_VISIT"&&te){const ye=!!(await ho(te,L,I))?.data?.needsSignature;if(U(ar=>({...ar,[I]:{data:{checked:!0,needsSignature:ye}}})),!ye){Ln(I),J.toast.success("Consent already signed for this service."),setTimeout(()=>Mi(),250);return}}else U(_e=>({..._e,[I]:{data:{checked:!0,needsSignature:!0}}}));const{heading:Y,consent:fe}=uc(E);if(!Y||!fe){J.toast.error("Consent template missing.");return}$e(Y),ce(fe),ae(G),je(I),ee(!0)}catch(E){console.error(E),J.toast.error(E?.message??"Consent check failed")}finally{V.current=!1}}},hc=(E,I)=>{try{const L=localStorage.getItem(vr),G=L?JSON.parse(L):{};G[String(E)]=I,localStorage.setItem(vr,JSON.stringify(G))}catch(L){console.error("Failed to save consent draft",L)}},mc=()=>{try{return JSON.parse(localStorage.getItem(vr)??"{}")}catch{return{}}},vc=E=>{const I=String(he);if(!I)return;const L=Ee.find(fe=>String(fe.id)===I);if(!L)return;const G=String(L.consent_form_id??""),te=po(L);if(!G||!te){J.toast.error("Consent form/method missing.");return}let Y="CHECKBOX_ONLY";te==="TYPED_NAME"?Y="TYPED_NAME":te==="DRAW_SIGNATURE"&&(Y="SIGNATURE_IMAGE"),hc(I,{serviceId:I,concentFormId:G,signatureType:Y,typedName:E?.typedName,isChecked:E?.accepted,signatureDataUrl:E?.signatureDataUrl,emailMe:E?.emailMe}),Ln(I),ee(!1),F.current="",J.toast.success("Consent captured.")},yc=()=>{ee(!1),je(null)},gc=async(E,I,L)=>{const G=mc(),te=Object.entries(G).map(([Y,fe])=>({serviceId:Y,concentFormId:fe.concentFormId,captured:fe})).filter(Y=>Y.serviceId&&Y.concentFormId);for(const Y of te){const{serviceId:fe,concentFormId:_e,captured:ye}=Y,ar=ye.signatureType||(ye.typedName?"TYPED_NAME":ye.signatureDataUrl?"SIGNATURE_IMAGE":"CHECKBOX_ONLY"),Li={tenantId:t,outletId:r,appointmentId:E,customerId:I,serviceId:fe,formId:_e,staffId:L,signatureType:ar,typedName:ye.typedName,imageUrl:ye.signatureDataUrl};ar==="CHECKBOX_ONLY"&&(Li.isChecked=ye.isChecked??!0),await Af(Li)}localStorage.removeItem(vr)};let Fi="";f&&(Fi=`${f?.year}-${String(f?.month).padStart(2,"0")}-${String(f?.day).padStart(2,"0")}`);const Un=async E=>{const I=E||h,L={marketing:{utmSource:"website",utmMedium:"plugin",utmCampaign:"service-plugin",utmTerm:"",utmContent:"cta_book_now"},request:{ipAddress:await Zn(),userAgent:navigator.userAgent,referrer:window.location.hostname,landingPage:window.location.href}},G={tenantId:t,outletId:r,staffId:c?.id,date:Fi,startTime:m,serviceIds:y.map(te=>te.id),slotIds:u,isWalkIn:!1,requiresConsent:Ee.length>0,customer:{first_name:I?.firstName,last_name:I?.lastName,email:I?.email,phone:I?.phone},tracking:L};if(Ee.length&&!Di){J.toast.warn("Please complete all consent forms first");return}try{x(!0);const te=await e(_r(G)).unwrap(),Y=te?.data??te,fe=Y.id||"",_e=Y.customerId||Y.customer?.id||"",ye=Y.staffId||c?.id||"";p==="booking"&&Ri>0&&await gc(fe,_e,ye),W==="card"?(R({appointmentId:fe,customerId:_e}),b(!0)):(e(fr(String(fe))),e(Ce()))}catch(te){const Y=te?.payload?.message||te?.data?.message||te?.message||"Staff not working on this day";J.toast.error(Y)}finally{x(!1)}},$c=async E=>{const I={marketing:{utmSource:"website",utmMedium:"plugin",utmCampaign:"service-plugin",utmTerm:"",utmContent:"cta_book_now"},request:{ipAddress:await Zn(),userAgent:navigator.userAgent,referrer:window.location.hostname,landingPage:window.location.href}},L={...E,phone:E?.phone??"",tracking:I};if(!W){J.toast.error("Select payment method");return}if(!m&&p==="booking"){J.toast.error("Select time");return}e(Gn(L)),Ee.length>0?Di?await Un(L):await Mi():await Un(L)},bc=async E=>{const I={...E,phone:E?.phone??""};if(!W){J.toast.error("Select payment method");return}if(!m&&p==="booking"){J.toast.error("Select time");return}e(Gn(I)),e(ke(!0))},Nc=E=>{const I=E.replace(/\s/g,"");return/^4/.test(I)?"VISA":/^5[1-5]/.test(I)?"MASTERCARD":/^3[47]/.test(I)?"AMEX":/^6/.test(I)?"DISCOVER":"UNKNOWN"},Sc=async E=>{try{x(!0);const I=T?.appointmentId,L=String(T?.customerId);if(!I||!r)return J.toast.error("Something went wrong."),!1;const G=Nc(E.number),te={marketing:{utmSource:"website",utmMedium:"plugin",utmCampaign:"service-plugin",utmTerm:"",utmContent:"cta_book_now"},request:{ipAddress:await Zn(),userAgent:navigator.userAgent,referrer:window.location.hostname,landingPage:window.location.href}},Y=await jf({appointmentId:I,customerId:L,outletId:r,referenceNo:I,currency:"USD",amountCents:Math.round(Ti*100),tipAmountCents:W==="card"?lc:0,taxAmountCents:W==="card"?dc:0,transactionBody:{transactionOrigin:3,transactionCode:"WEB",isDebit:!0,processMethod:3,channelType:3,tenderInfo:{cardHolderName:E.name,cardNumber:E.number.replace(/\s/g,""),cardType:G,cardExpiry:Hy(E.expiry),cvData:E.cvv},billingContact:{name:{firstName:h?.firstName??"",lastName:h?.lastName??""},email:h?.email??""}},tracking:te}),fe=Y?.data?.data??Y?.data??Y??{},_e=fe?.orderId;if(String(fe?.mappedStatus).toLowerCase()==="succeeded"||String(fe?.reasonMessage).toLowerCase()==="success"){if(J.toast.success("Payment successful!"),_e)try{await Tf(_e)}catch(ye){J.toast.warning(ye instanceof Error?ye.message:String(ye??"Payment done, but finalize failed"))}}else J.toast.warning("Payment pending");return b(!1),e(fr(String(T?.appointmentId))),e(Ce()),!0}catch(I){return J.toast.warning(I instanceof Error?I.message:"Payment failed, but appointment is booked"),b(!1),e(fr(String(T?.appointmentId))),e(Ce()),!0}finally{x(!1)}},Cc=()=>{b(!1),J.toast.warning("Appointment booked. Payment was cancelled."),e(fr(String(T?.appointmentId))),e(Ce())};return(0,o.jsxs)(Et,{sidebar:(0,o.jsx)("div",{className:"aaravpos-aside",children:(0,o.jsx)(ll,{buttonText:"Book Appointment",onButtonClick:Ot($c),showTip:W==="card",tipPct:v,onTipChange:E=>e(Df(E??0)),consentRequired:Ee?.length>0,consentCompleted:Ri,totalConsents:ki,checkingConsent:z,loading:C})}),children:[(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wt,{}),(0,o.jsxs)("div",{className:"aaravpos-margin-top-20",children:[(0,o.jsx)("h1",{className:"aaravpos-page-title",children:"Confirm Booking"}),(0,o.jsx)("p",{className:"aaravpos-sub-title",children:"Review your appointment details before booking"}),(0,o.jsxs)("div",{className:"aaravpos-booking-wrapper",children:[(0,o.jsxs)("div",{className:"aaravpos-outlet-info",children:[a&&(0,o.jsx)("div",{className:"aaravpos-outlet-logo",children:(0,o.jsx)("img",{src:a??"/logo.svg",alt:"Logo",className:"aaravpos-outlet-logo-img"})}),(0,o.jsxs)("div",{className:"aaravpos-outlet-content",children:[(0,o.jsx)("p",{className:"aaravpos-outlet-name",children:i??"-"}),(0,o.jsxs)("p",{className:"aaravpos-outlet-address",children:[s??"-",(0,o.jsx)("br",{})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-booking-scroll",children:[(0,o.jsxs)("div",{className:"aaravpos-booking-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-booking-column",children:[(0,o.jsx)(As,{children:"Appointment"}),(0,o.jsxs)(Yy,{children:[(0,o.jsxs)("div",{className:"aaravpos-appointment-header",children:[(0,o.jsx)(Xy,{pro:c}),(0,o.jsxs)("div",{className:"aaravpos-appointment-content",children:[(0,o.jsx)("p",{className:"aaravpos-appointment-name",children:c?.name}),(0,o.jsx)("p",{className:"aaravpos-appointment-services",children:y.map(E=>E.name).join(", ")})]}),(0,o.jsxs)("span",{className:"aaravpos-appointment-price",children:[(0,o.jsx)(re,{size:14}),Fn]})]}),(0,o.jsxs)("div",{className:"aaravpos-appointment-date",children:[(0,o.jsx)(tp,{size:18}),(0,o.jsx)("span",{className:"aaravpos-appointment-date-text",children:sc??"No time selected"})]})]})]}),(0,o.jsxs)("div",{className:"aaravpos-booking-column",children:[(0,o.jsx)(As,{children:"Payment Method"}),(0,o.jsx)(Zy,{icon:(0,o.jsx)(jp,{size:18}),label:"Pay in person",selected:W==="person",onClick:()=>Q("person")})]})]}),W&&(0,o.jsxs)("form",{className:"aaravpos-tp-10",onSubmit:Ot(bc),children:[(0,o.jsxs)("div",{className:"aaravpos-details-grid",children:[(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{className:"aaravpos-form-label",htmlFor:"phone",children:["Phone"," ",!kn&&(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)(Ue.Controller,{control:at,name:"phone",rules:{validate:E=>{const I=!!Rn(E),L=!!kn?.trim();return!I&&!L?"Enter phone or email":I&&!aa(E)?"Enter valid phone number":!0}},render:({field:E})=>(0,o.jsxs)("div",{className:"aaravpos-input-wrapper",children:[(0,o.jsx)(zy,{...E,id:"phone",international:!0,countries:Gy,defaultCountry:"US",value:E.value||"",onChange:I=>Ii(I??"",E.onChange,"phone"),countryCallingCodeEditable:!1,className:"aaravpos-custom-input"}),C&&_==="phone"&&(0,o.jsx)("div",{className:"arravpos-loader-wrapper",children:(0,o.jsx)("div",{className:"arravpos-loader"})})]})}),it.phone&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.phone.message}),D&&(0,o.jsxs)("div",{className:"aaravpos-autofill-text",children:["Using existing customer"," ",(0,o.jsx)("span",{onClick:fc,className:"aaravpos-clear-text",children:"Clear"})]})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{htmlFor:"email",className:"aaravpos-form-label",children:["Email"," ",!In&&(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)("input",{id:"email",...Fe("email",{validate:E=>{const I=!!E?.trim(),L=!!Rn(In);return!I&&!L?"Enter phone or email":I&&!/^\S+@\S+\.\S+$/.test(E)?"Invalid email":!0},onChange:E=>{Ii(E.target.value,null,"email")}}),autoComplete:"email",placeholder:"Email address",className:"aaravpos-custom-input"}),it.email&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.email.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsxs)("label",{htmlFor:"first_name",className:"aaravpos-form-label",children:["First Name ",(0,o.jsx)("span",{className:"aaravpos-required",children:"*"})]}),(0,o.jsx)("input",{id:"first_name",...Fe("firstName",{required:"First name required",pattern:{value:/^[A-Za-z\s]+$/,message:"Only letters are allowed"}}),autoComplete:"given-name",placeholder:"First Name",className:"aaravpos-custom-input"}),it.firstName&&(0,o.jsx)("p",{className:"aaravpos-error-text",children:it.firstName.message})]}),(0,o.jsxs)("div",{className:"aaravpos-form-group",children:[(0,o.jsx)("label",{htmlFor:"last_name",className:"aaravpos-form-label",children:"Last Name"}),(0,o.jsx)("input",{id:"last_name",autoComplete:"family-name",...Fe("lastName"),placeholder:"Last Name",className:"aaravpos-custom-input"})]})]}),(0,o.jsx)("div",{className:"aaravpos-center-items",children:(0,o.jsx)("button",{type:"submit",disabled:rc,className:"aaravpos-form-btn",children:(0,o.jsx)("span",{className:"aaravpos-btn-content",children:"Confirm Details"})})})]})]})]})]})]}),N&&(0,o.jsx)(lh,{onClose:Cc,onPay:Sc,amount:Ti}),oe&&he&&(0,o.jsx)(Th,{enforcement:ue,heading:pe,consent:ne,onClose:yc,onConfirm:vc},he??"consent")]})}function Yy({children:e}){return(0,o.jsx)("div",{className:"aaravpos-card-box",children:e})}function Xy({pro:e}){return(0,o.jsx)(o.Fragment,{children:e.imageUrl?(0,o.jsx)("img",{src:e.imageUrl,alt:e.name,className:"aaravpos-profile-image"}):(0,o.jsx)("div",{className:"aaravpos-profile-avatar",style:{background:e.color??"#111"},children:nt(e.name)})})}function As({children:e}){return(0,o.jsx)("p",{className:"aaravpos-section-label",children:e})}function Zy({icon:e,label:t,selected:r,onClick:n}){return(0,o.jsx)("div",{className:"aaravpos-paymentcard-wrapper",onClick:n,children:(0,o.jsx)("div",{className:"aaravpos-paymentcard-container",children:(0,o.jsx)("div",{className:`${r?"aaravpos-paymentcard-card active":"aaravpos-paymentcard-card"}`,children:(0,o.jsxs)("div",{className:"aaravpos-paymentcard-content",children:[(0,o.jsx)("div",{className:"aaravpos-paymentcard-icon",children:e}),(0,o.jsx)("div",{className:"aaravpos-paymentcard-info",children:(0,o.jsxs)("div",{className:"aaravpos-paymentcard-header",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"aaravpos-paymentcard-title",children:t}),(0,o.jsx)("p",{className:"aaravpos-paymentcard-description",children:"Payment will be collected at the outlet during your appointment."})]}),r&&(0,o.jsx)("div",{className:"aaravpos-paymentcard-check",children:(0,o.jsx)(ui,{size:18})})]})})]})})})})}function Jy(){const e=(0,M.useDispatch)(),t=(0,M.useSelector)(b=>b.booking.appointment.appointmentId),{tenantId:r}=(0,M.useSelector)(b=>b.booking.outletDetails),[n,a]=(0,S.useState)(null),[i,s]=(0,S.useState)(!0),[d,l]=(0,S.useState)(null),[c,u]=(0,S.useState)(!1);(0,S.useEffect)(()=>{if(!t){l("No appointment ID provided"),s(!1);return}(async()=>{try{const T=await Pf(t,r);T.success?a(T?.data?.appointment):l("Failed to load appointment details")}catch(T){console.error(T),l("An error occurred while fetching appointment details")}finally{s(!1)}})()},[t]);const f=()=>{oi.purge(),e({type:"RESET_ALL"})};if(i)return(0,o.jsx)("div",{className:"aaravpos-loading-container",children:(0,o.jsx)("p",{className:"aaravpos-loading-text",children:"Loading appointment details..."})});if(d||!n)return(0,o.jsxs)("div",{className:"aaravpos-error-container",children:[(0,o.jsx)("p",{className:"aaravpos-error-text",children:d||"Appointment not found"}),(0,o.jsxs)("button",{onClick:f,className:"aaravpos-book-btn",children:[(0,o.jsx)(bo,{}),"Book Another Appointment"]})]});const{staff:m,outlet:h,services:p}=n,v=p?.reduce((b,T)=>b+Number(T.price||T.min_price||0),0),y=(n.tipsCents||0)/100,$=(n.taxCents||0)/100,g=(n.totalCents||0)/100,C=g>0?g.toFixed(2):(v+y+$).toFixed(2),x=c?p:p.slice(0,5),N=p.length-5;return(0,o.jsx)("div",{className:"aaravpos-success-wrapper",children:(0,o.jsxs)("div",{className:"aaravpos-success-motion",children:[(0,o.jsx)("div",{className:"aaravpos-success-icon success-pulse",children:(0,o.jsx)(ui,{})}),(0,o.jsx)("h1",{className:"aaravpos-success-title",children:"You're Booked!"}),(0,o.jsxs)("p",{className:"aaravpos-success-description",children:["Your appointment has been confirmed.",(0,o.jsx)("br",{}),"A confirmation has been sent to your email."]}),(0,o.jsxs)("div",{className:"aaravpos-success-content",children:[(0,o.jsxs)("div",{className:"aaravpos-success-card",children:[(0,o.jsxs)("div",{className:"aaravpos-success-row aaravpos-success-row-first",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Outlet Name"}),(0,o.jsx)("span",{className:"aaravpos-value",children:h?.outletName||"-"})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Professional"}),(0,o.jsx)("span",{className:"aaravpos-value",children:m?`${m?.firstName} ${m?.lastName}`:"-"})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row aaravpos-services-header",children:[(0,o.jsxs)("span",{className:"aaravpos-services-label",children:["Services (",p.length,")"]}),p.length>5&&(0,o.jsx)("button",{onClick:()=>u(b=>!b),className:"aaravpos-show-btn",children:c?"Hide":(0,o.jsxs)("span",{className:"aaravpos-show-btn-inner",children:["Show",(0,o.jsx)(fi,{size:16})]})})]}),(0,o.jsxs)("div",{className:"aaravpos-services-list",children:[x?.map(b=>(0,o.jsxs)("div",{className:"aaravpos-service-row",children:[(0,o.jsx)("span",{className:"aaravpos-service-name",children:b.serviceName}),(0,o.jsxs)("span",{className:"aaravpos-service-price",children:[(0,o.jsx)(re,{size:14}),Number(b.price).toFixed(2)]})]},b.id)),!c&&N>0&&(0,o.jsxs)("div",{className:"aaravpos-more-services",children:[(0,o.jsx)(pi,{size:14}),N," more services"]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Date & Time"}),(0,o.jsxs)("span",{className:"aaravpos-value",children:[n.appointmentDate," at"," ",n.start_time_12h]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Tip"}),(0,o.jsxs)("span",{className:"aaravpos-price",children:[(0,o.jsx)(re,{size:14}),y.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-success-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Tax"}),(0,o.jsxs)("span",{className:"aaravpos-price",children:[(0,o.jsx)(re,{size:14}),$.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"aaravpos-total-row",children:[(0,o.jsx)("span",{className:"aaravpos-label",children:"Total Amount"}),(0,o.jsxs)("span",{className:"aaravpos-total-price",children:[(0,o.jsx)(re,{size:14}),C]})]})]}),(0,o.jsxs)("button",{onClick:f,className:"aaravpos-book-btn",children:[(0,o.jsx)(bo,{}),"Book Another Appointment"]})]})]})})}function Qy(){const{currentStep:e}=(0,M.useSelector)(n=>n.booking.breadcrumbs),{isService:t}=(0,M.useSelector)(n=>n.booking.outletDetails),r={services:t?Zp:Xp,professionals:t?Yp:Hp,time:ah,confirm:Ky,success:Jy}[e];return(0,o.jsx)("div",{className:"aaravpos-layout",children:(0,o.jsx)("div",{className:"aaravpos-layout-content",children:(0,o.jsx)("div",{className:"aaravpos-layout-page",children:(0,o.jsx)(r,{})},e)})})}function eg(){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Qy,{}),(0,o.jsx)(J.ToastContainer,{position:"top-right",autoClose:3e3})]})}var tg=({bookingCode:e})=>{const t=(0,M.useDispatch)(),r=(0,M.useSelector)(m=>m.booking.outletList.outlets),n=(0,M.useSelector)(m=>m.booking.theme),[a,i]=(0,S.useState)(!1),[s,d]=(0,S.useState)(null),{id:l}=(0,M.useSelector)(m=>m.booking.outletDetails),c=(0,S.useCallback)(async()=>{try{i(!0),d(null);const m=await uo(e);if(m?.success){const h=m?.data?.data?.outlets||[];t(Lf(h)),t(kf(m?.data?.result)),h.length===1&&f(h[0])}else d(m?.message||"Failed to fetch data")}catch(m){console.error(m),d(m?.message||"Something went wrong")}finally{i(!1)}},[e,t]),u=async(m,h)=>{try{const p=await uo(e,m,h);p?.success||d(p?.message||"Failed to fetch outlet data"),t(Sf(p?.data?.token)),t(gf(p?.data?.data?.outlets[0]?.isService)),t(xf({superCategories:p?.data?.data?.superCategories,staff:p?.data?.data?.staff}))}catch(p){console.error(p),d(p?.message||"Something went wrong")}finally{i(!1)}},f=async m=>{m&&(await u(String(m?.tenantId),String(m?.id)),t(Nf({...m,tenantId:m.tenantId??"",currency:m.currency??"",outletTimeZoneDate:me.DateTime.now().setZone(m?.timeZone).toFormat("yyyy-MM-dd"),outletTimeZoneYear:me.DateTime.fromISO(m?.createdAt,{zone:"utc"}).setZone(m?.timeZone).year})),t($a(m?.isService?"services":"professionals")))};return(0,S.useEffect)(()=>{Array.isArray(r)&&r.length===0&&c()},[r?.length,c]),(0,S.useEffect)(()=>{n&&W0(n)},[n]),s?(0,o.jsx)("div",{className:"aaravpos-error-box",children:s}):!r.length&&a?(0,o.jsx)("div",{className:"aaravpos-loader-wrapper",children:(0,o.jsx)("div",{className:"aaravpos-loader"})}):(0,o.jsx)("div",{className:"aaravpos-overflow-hidden",children:r.length>1&&!l?(0,o.jsx)(Lp,{outlets:r,onSelectOutlet:m=>{m?.id&&f(m)}}):(0,o.jsx)(eg,{})})},rg=({...e})=>(0,o.jsx)(q0,{children:(0,o.jsx)(tg,{...e})});exports.AppointmentBookingPlugin=rg;