@one-payments/web-components 1.7.0 → 1.7.2

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.
@@ -1,6 +1,6 @@
1
1
  var OnePayments=function(t){"use strict";
2
2
  /*!
3
- * @one-payments/web-components v1.6.0
3
+ * @one-payments/web-components v1.7.2
4
4
  * Browser CDN Bundle (IIFE)
5
5
  *
6
6
  * This bundle is designed for direct browser usage via <script> tag.
@@ -8,7 +8,7 @@ var OnePayments=function(t){"use strict";
8
8
  *
9
9
  * (c) 2026 One Payments
10
10
  * Released under the MIT License
11
- */var e;const r=globalThis,i=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let o=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&s.set(e,t))}return t}toString(){return this.cssText}};const a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:u,getOwnPropertySymbols:h,getPrototypeOf:p}=Object,m=globalThis,g=m.trustedTypes,f=g?g.emptyScript:"",y=m.reactiveElementPolyfillSupport,v=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(i){r=null}}return r}},w=(t,e)=>!l(t,e),x={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);let k=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=x){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){const{get:i,set:n}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const s=null==i?void 0:i.call(this);null==n||n.call(this,e),this.requestUpdate(t,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...u(t),...h(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(i)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),n=r.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){var r;const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const s=(void 0!==(null==(r=i.converter)?void 0:r.toAttribute)?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(t,e){var r,i;const n=this.constructor,s=n._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=n.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(r=t.converter)?void 0:r.fromAttribute)?t.converter:b;this._$Em=s;const a=o.fromAttribute(e,t.type);this[s]=a??(null==(i=this._$Ej)?void 0:i.get(s))??a,this._$Em=null}}requestUpdate(t,e,r){var i;if(void 0!==t){const n=this.constructor,s=this[t];if(r??(r=n.getPropertyOptions(t)),!((r.hasChanged??w)(s,e)||r.useDefault&&r.reflect&&s===(null==(i=this._$Ej)?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:i,wrapped:n},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==n||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,r,i)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[v("elementProperties")]=new Map,k[v("finalized")]=new Map,null==y||y({ReactiveElement:k}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.1.1");const S=globalThis,P=S.trustedTypes,C=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,A="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+$,_=`<${E}>`,M=document,I=()=>M.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,D="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,U=/>/g,B=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,q=/"/g,z=/^(?:script|style|textarea|title)$/i,H=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),O=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),V=new WeakMap,Y=M.createTreeWalker(M,129);var Q;function K(t,e){if(!T(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}class G{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let n=0,s=0;const o=t.length-1,a=this.parts,[l,d]=((t,e)=>{const r=t.length-1,i=[];let n,s=2===e?"<svg>":3===e?"<math>":"",o=R;for(let a=0;a<r;a++){const e=t[a];let r,l,d=-1,c=0;for(;c<e.length&&(o.lastIndex=c,l=o.exec(e),null!==l);)c=o.lastIndex,o===R?"!--"===l[1]?o=L:void 0!==l[1]?o=U:void 0!==l[2]?(z.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=B):void 0!==l[3]&&(o=B):o===B?">"===l[0]?(o=n??R,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,r=l[1],o=void 0===l[3]?B:'"'===l[3]?q:F):o===q||o===F?o=B:o===L||o===U?o=R:(o=B,n=void 0);const u=o===B&&t[a+1].startsWith("/>")?" ":"";s+=o===R?e+_:d>=0?(i.push(r),e.slice(0,d)+A+e.slice(d)+$+u):e+$+(-2===d?a:u)}return[K(t,s+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(t,e);if(this.el=G.createElement(l,r),Y.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Y.nextNode())&&a.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(A)){const e=d[s++],r=i.getAttribute(t).split($),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:o[2],strings:r,ctor:"."===o[1]?tt:"?"===o[1]?et:"@"===o[1]?rt:X}),i.removeAttribute(t)}else t.startsWith($)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(z.test(i.tagName)){const t=i.textContent.split($),e=t.length-1;if(e>0){i.textContent=P?P.emptyScript:"";for(let r=0;r<e;r++)i.append(t[r],I()),Y.nextNode(),a.push({type:2,index:++n});i.append(t[e],I())}}}else if(8===i.nodeType)if(i.data===E)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf($,t+1));)a.push({type:7,index:n}),t+=$.length-1}n++}}static createElement(t,e){const r=M.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,i){var n,s;if(e===O)return e;let o=void 0!==i?null==(n=r._$Co)?void 0:n[i]:r._$Cl;const a=N(e)?void 0:e._$litDirective$;return(null==o?void 0:o.constructor)!==a&&(null==(s=null==o?void 0:o._$AO)||s.call(o,!1),void 0===a?o=void 0:(o=new a(t),o._$AT(t,r,i)),void 0!==i?(r._$Co??(r._$Co=[]))[i]=o:r._$Cl=o),void 0!==o&&(e=J(t,o._$AS(t,e.values),o,i)),e}class Z{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((null==t?void 0:t.creationScope)??M).importNode(e,!0);Y.currentNode=i;let n=Y.nextNode(),s=0,o=0,a=r[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new W(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new it(n,this,t)),this._$AV.push(e),a=r[++o]}s!==(null==a?void 0:a.index)&&(n=Y.nextNode(),s++)}return Y.currentNode=M,i}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class W{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),N(t)?t===j||null==t||""===t?(this._$AH!==j&&this._$AR(),this._$AH=j):t!==this._$AH&&t!==O&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==j&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){var e;const{values:r,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(K(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===n)this._$AH.p(r);else{const t=new Z(n,this),e=t.u(this.options);t.p(r),this.T(e),this._$AH=t}}_$AC(t){let e=V.get(t.strings);return void 0===e&&V.set(t.strings,e=new G(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const n of t)i===e.length?e.push(r=new W(this.O(I()),this.O(I()),this,this.options)):r=e[i],r._$AI(n),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for(null==(r=this._$AP)||r.call(this,!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,n){this.type=1,this._$AH=j,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=j}_$AI(t,e=this,r,i){const n=this.strings;let s=!1;if(void 0===n)t=J(this,t,e,0),s=!N(t)||t!==this._$AH&&t!==O,s&&(this._$AH=t);else{const i=t;let o,a;for(t=n[0],o=0;o<n.length-1;o++)a=J(this,i[r+o],e,o),a===O&&(a=this._$AH[o]),s||(s=!N(a)||a!==this._$AH[o]),a===j?t=j:t!==j&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}s&&!i&&this.j(t)}j(t){t===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class tt extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===j?void 0:t}}class et extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==j)}}class rt extends X{constructor(t,e,r,i,n){super(t,e,r,i,n),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??j)===O)return;const r=this._$AH,i=t===j&&r!==j||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==j&&(r===j||i);i&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const nt=S.litHtmlPolyfillSupport;null==nt||nt(G,W),(S.litHtmlVersions??(S.litHtmlVersions=[])).push("3.3.1");const st=globalThis;class ot extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const i=(null==r?void 0:r.renderBefore)??e;let n=i._$litPart$;if(void 0===n){const t=(null==r?void 0:r.renderBefore)??null;i._$litPart$=n=new W(e.insertBefore(I(),t),t,void 0,r??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return O}}ot._$litElement$=!0,ot.finalized=!0,null==(e=st.litElementHydrateSupport)||e.call(st,{LitElement:ot});const at=st.litElementPolyfillSupport;null==at||at({LitElement:ot}),(st.litElementVersions??(st.litElementVersions=[])).push("4.2.1");const lt={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},dt=(t=lt,e,r)=>{const{kind:i,metadata:n}=r;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),"accessor"===i){const{name:i}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(i,n,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=r;return function(r){const n=this[i];e.call(this,r),this.requestUpdate(i,n,t)}}throw Error("Unsupported decorator location: "+i)};function ct(t){return(e,r)=>"object"==typeof r?dt(t,e,r):((t,e,r)=>{const i=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),i?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}function ut(t){return ct({...t,state:!0,attribute:!1})}const ht="card",pt="paynow",mt="promptpay",gt="duitnow",ft="gopay",yt="boost",vt="shopeepay",bt="atom",wt="dana",xt="tng",kt="alipaycn",St="alipayhk",Pt="gcash",Ct="idle",At="initializing",$t="ready",Et="processing",_t="requires_action",Mt="succeeded",It="failed";class Nt{constructor(t,e,r,i,n={},s){this.isPolling=!1,this.attempts=0,this.startTime=0,this.pollTimeoutId=null,this.adapters=t,this.baseUrl=e,this.token=r,this.onStatusUpdate=i,this.onPollStart=s,this.config={interval:n.interval??3e3,maxAttempts:n.maxAttempts??60,timeout:n.timeout??18e4,ignore3DS:n.ignore3DS??!1,ignoreQR:n.ignoreQR??!1}}start(){this.isPolling||(this.isPolling=!0,this.attempts=0,this.startTime=this.adapters.timer.now(),this.scheduleNextPoll())}stop(){this.isPolling=!1,null!==this.pollTimeoutId&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}get active(){return this.isPolling}get attemptCount(){return this.attempts}scheduleNextPoll(){if(!this.isPolling)return;if(this.attempts>=this.config.maxAttempts)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_MAX_ATTEMPTS",message:`Maximum polling attempts (${this.config.maxAttempts}) exceeded`}});if(this.adapters.timer.now()-this.startTime>=this.config.timeout)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_TIMEOUT",message:`Polling timeout (${this.config.timeout}ms) exceeded`}});this.pollTimeoutId=setTimeout(()=>{this.poll()},this.config.interval)}async poll(){if(this.isPolling){this.attempts++,this.onPollStart&&this.onPollStart();try{const e=await this.adapters.http.get(`${this.baseUrl}/payment-intent/get-payment-data`,{"x-token":this.token}),r={status:(t=e.result.status,"paid"===t?"succeeded":t),paymentIntentId:e.result.paymentIntentId||"",...void 0!==e.result.amount&&{amount:e.result.amount},...void 0!==e.result.currency&&{currency:e.result.currency},...void 0!==e.result.metadata&&{metadata:e.result.metadata},...void 0!==e.result.nextActionUrl&&{nextActionUrl:e.result.nextActionUrl},...void 0!==e.result.qrCode&&{qrCode:e.result.qrCode}};if(e.result.nextActionUrl&&!this.config.ignore3DS)return this.stop(),void this.onStatusUpdate(r);if(e.result.qrCode&&!this.config.ignoreQR)return this.stop(),void this.onStatusUpdate(r);if("succeeded"===e.result.status||"failed"===e.result.status||"paid"===e.result.status)return this.stop(),void this.onStatusUpdate(r);this.scheduleNextPoll()}catch(e){const t={status:"processing",paymentIntentId:"",error:{code:"POLLING_ERROR",message:e instanceof Error?e.message:"Unknown polling error"}};this.onStatusUpdate(t),this.scheduleNextPoll()}var t}}}class Tt{constructor(t,e){this.state={status:Ct},this.subscribers=new Set,this.eventListeners={},this.paymentToken=null,this.paymentIntentId=null,this.pollingService=null,this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.config=t,this.adapters=e}getApiBaseUrl(){return this.config.apiBaseUrl??function(t){switch(t){case"prod":return"https://public.prod.one.ooo";case"demo":return"https://public.demo.one.ooo";default:return"https://public.dev.one.ooo"}}(this.config.environment)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),t(this.state),()=>{this.subscribers.delete(t)}}on(t,e){this.eventListeners[t]||(this.eventListeners[t]=[]);const r=this.eventListeners[t];return r.push(e),()=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)}}async initialize(t){this.setState({status:At}),this.emit({type:"initialize",payload:t});try{const e={amount:t.amount,currency:t.currency,notes:t.notes,orderId:t.orderId},r=JSON.stringify(e),i=await this.adapters.crypto.hmacSHA256(this.config.secretKey,r),n=await this.adapters.http.post(`${this.getApiBaseUrl()}/payment-intent/create`,e,{"x-api-key":this.config.apiKey,"x-signature":i}),s=new URL(n.result.redirectUrl).searchParams.get("token");if(!s)throw new Error("No token found in redirectUrl");this.paymentToken=s,this.paymentIntentId=n.result.paymentIntentId;const o=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/get-payment-data`,{"x-token":this.paymentToken}),a=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/available-methods`,{"x-token":this.paymentToken}),l={id:this.paymentIntentId,amount:o.result.customerAmount||t.amount,currency:o.result.currency||t.currency,status:$t,...t.metadata&&{metadata:t.metadata}},d=[];let c=0;return a.result.paymentMethods.forEach(t=>{const e=t.type.toLowerCase(),r=t.capabilities||[];e.includes("card")&&d.push({id:"card",enabled:!0,priority:c++}),(e.includes("paynow")||r.includes("payments_pay_now"))&&d.push({id:"paynow",enabled:!0,priority:c++}),(e.includes("promptpay")||e.includes("prompt pay")||r.includes("payments_prompt_pay"))&&d.push({id:"promptpay",enabled:!0,priority:c++}),(e.includes("duitnow")||e.includes("duit now")||r.includes("payments_duit_now"))&&d.push({id:"duitnow",enabled:!0,priority:c++}),(e.includes("gopay")||e.includes("go pay")||r.includes("payments_go_pay"))&&d.push({id:"gopay",enabled:!0,priority:c++}),(e.includes("boost")||r.includes("payments_boost"))&&d.push({id:"boost",enabled:!0,priority:c++}),(e.includes("shopeepay")||e.includes("shopee pay")||e.includes("shopee_pay")||r.includes("payments_shopee_pay"))&&d.push({id:"shopeepay",enabled:!0,priority:c++}),(e.includes("atom")||e.includes("atome")||r.includes("payments_atome"))&&d.push({id:"atom",enabled:!0,priority:c++}),(e.includes("dana")||r.includes("payments_dana"))&&d.push({id:"dana",enabled:!0,priority:c++}),(e.includes("tng")||e.includes("touch")||r.includes("payments_tng"))&&d.push({id:"tng",enabled:!0,priority:c++}),(e.includes("alipaycn")||e.includes("alipay cn")||e.includes("alipay_cn")||r.includes("payments_alipaycn"))&&d.push({id:"alipaycn",enabled:!0,priority:c++}),(e.includes("alipayhk")||e.includes("alipay hk")||e.includes("alipay_hk")||r.includes("payments_alipayhk"))&&d.push({id:"alipayhk",enabled:!0,priority:c++}),(e.includes("gcash")||e.includes("g cash")||r.includes("payments_gcash"))&&d.push({id:"gcash",enabled:!0,priority:c++})}),this.setState({status:$t,paymentIntent:l,availableMethods:d}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:o.result}}),l}catch(e){const t={code:"INITIALIZATION_FAILED",message:e instanceof Error?e.message:"Unknown error",timestamp:this.adapters.timer.now()};throw this.setState({status:It,error:t}),this.emit({type:"payment_failed",payload:{error:t}}),e}}async submitPayment(t,e){var r,i,n,s,o;const a=this.state;if("ready"!==a.status)throw new Error("Cannot submit payment: SDK not in ready state");if(!this.paymentToken)throw new Error("Cannot submit payment: No payment token available");this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.setState({status:Et,paymentIntent:a.paymentIntent,selectedMethod:t,availableMethods:a.availableMethods}),this.emit({type:"payment_processing",payload:{paymentIntent:a.paymentIntent,methodId:t}});try{const r=t=>{switch(t){case"paynow":default:return"qr";case"promptpay":return"prompt_pay";case"duitnow":return"duit_now";case"gopay":return"go_pay";case"boost":return"boost";case"shopeepay":return"shopee_pay";case"atom":return"atome";case"dana":return"dana";case"tng":return"tng";case"alipaycn":return"alipaycn";case"alipayhk":return"alipayhk";case"gcash":return"gcash"}},i={firstName:String(e.firstName),lastName:String(e.lastName),email:String(e.email),phoneNumber:String(e.phoneNumber),paymentMethod:"card"===t?{type:"card",card:{number:String(e.cardNumber),expiryMonth:String(e.expiryMonth),expiryYear:String(e.expiryYear),cvc:String(e.cvv)}}:{type:r(t)}};return await this.adapters.http.patch(`${this.getApiBaseUrl()}/payment-intent/confirm`,i,{"x-token":this.paymentToken}),this.startPolling(),{id:this.paymentIntentId||"",amount:a.paymentIntent.amount,currency:a.paymentIntent.currency,status:Et}}catch(l){let t="Unknown error",e="PAYMENT_FAILED";if(l instanceof Error)try{if(function(t){return t instanceof Error&&("response"in t&&"object"==typeof t.response&&null!==t.response||"data"in t&&"object"==typeof t.data&&null!==t.data)}(l)){const a=null==(r=l.response)?void 0:r.data,d=l.data;a?(t=a.message||(null==(i=a.error)?void 0:i.message)||l.message,e=a.code||(null==(n=a.error)?void 0:n.code)||e):d?(t=d.message||(null==(s=d.error)?void 0:s.message)||l.message,e=d.code||(null==(o=d.error)?void 0:o.code)||e):t=l.message}else t=l.message}catch{t=l.message}const d={code:e,message:t,timestamp:this.adapters.timer.now()};throw this.setState({status:It,error:d,paymentIntent:a.paymentIntent}),this.emit({type:"payment_failed",payload:{error:d,paymentIntent:a.paymentIntent}}),l}}resumePolling(){this.paymentToken&&(this.ignore3DSInPolling=!0,this.ignoreQRInPolling=!0,this.startPolling())}destroy(){this.stopPolling(),this.subscribers.clear(),Object.keys(this.eventListeners).forEach(t=>{delete this.eventListeners[t]})}startPolling(){this.paymentToken&&(this.stopPolling(),this.pollingService=new Nt(this.adapters,this.getApiBaseUrl(),this.paymentToken,this.handlePollingUpdate.bind(this),{interval:4e3,maxAttempts:100,timeout:4e5,ignore3DS:this.ignore3DSInPolling,ignoreQR:this.ignoreQRInPolling},this.handlePollStart.bind(this)),this.pollingService.start())}stopPolling(){this.pollingService&&(this.pollingService.stop(),this.pollingService=null)}handlePollStart(){this.emit({type:"poll_started",payload:{}})}handlePollingUpdate(t){if(t.error)return;const e=this.state;if("processing"!==e.status&&"requires_action"!==e.status)return void this.stopPolling();const r="promptpay"===e.selectedMethod||"duitnow"===e.selectedMethod||"gopay"===e.selectedMethod||"boost"===e.selectedMethod||"shopeepay"===e.selectedMethod||"atom"===e.selectedMethod||"dana"===e.selectedMethod||"tng"===e.selectedMethod||"alipaycn"===e.selectedMethod||"alipayhk"===e.selectedMethod||"gcash"===e.selectedMethod;if(t.qrCode&&!this.ignoreQRInPolling&&!r)return void this.emit({type:"qr_code_received",payload:{qrCode:t.qrCode,methodId:e.selectedMethod}});if(t.nextActionUrl&&!this.ignore3DSInPolling){if("promptpay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"promptpay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("duitnow"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"duitnow_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("gopay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"gopay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("boost"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"boost_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("shopeepay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"shopeepay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("atom"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"atom_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("dana"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"dana_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("tng"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"tng_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("alipaycn"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"alipaycn_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("alipayhk"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"alipayhk_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("gcash"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"gcash_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("paynow"===e.selectedMethod&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:t.nextActionUrl,methodId:e.selectedMethod}});const r={id:t.paymentIntentId,amount:t.amount??e.paymentIntent.amount,currency:t.currency??e.paymentIntent.currency,status:_t,...t.metadata&&{metadata:t.metadata}};return this.setState({status:_t,paymentIntent:r,actionUrl:t.nextActionUrl,selectedMethod:e.selectedMethod,availableMethods:e.availableMethods}),void this.emit({type:"payment_requires_action",payload:{paymentIntent:r,actionUrl:t.nextActionUrl,methodId:e.selectedMethod}})}const i={id:t.paymentIntentId,amount:t.amount??e.paymentIntent.amount,currency:t.currency??e.paymentIntent.currency,status:t.status,...t.metadata&&{metadata:t.metadata}};if("succeeded"===t.status)this.stopPolling(),this.setState({status:Mt,paymentIntent:i,selectedMethod:e.selectedMethod}),this.emit({type:"payment_succeeded",payload:{paymentIntent:i,methodId:e.selectedMethod}});else if("failed"===t.status){this.stopPolling();const e={code:"PAYMENT_FAILED",message:t.error&&"object"==typeof t.error&&null!==t.error&&"message"in t.error?String(t.error.message):"Payment failed",timestamp:this.adapters.timer.now()};this.setState({status:It,error:e,paymentIntent:i}),this.emit({type:"payment_failed",payload:{error:e,paymentIntent:i}})}}setState(t){const e=this.state.status;this.state=t,this.subscribers.forEach(t=>{t(this.state)}),e!==t.status&&this.emit({type:"state_changed",payload:{previousStatus:e,currentStatus:t.status}})}emit(t){const e=this.eventListeners[t.type];void 0!==e&&e.forEach(e=>{e(t)})}}var Dt="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Rt=function(t,e,r,i,n,s,o,a,l,d){var c=this;c.numeralDecimalMark=t||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=i||Rt.groupStyle.thousand,c.numeralPositiveOnly=!!n,c.stripLeadingZeroes=!1!==s,c.prefix=o||""===o?o:"",c.signBeforePrefix=!!a,c.tailPrefix=!!l,c.delimiter=d||""===d?d:",",c.delimiterRE=d?new RegExp("\\"+d,"g"):""};Rt.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Rt.prototype={getRawValue:function(t){return t.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(t){var e,r,i,n,s=this,o="";switch(t=t.replace(/[A-Za-z]/g,"").replace(s.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",s.numeralPositiveOnly?"":"-").replace("M",s.numeralDecimalMark),s.stripLeadingZeroes&&(t=t.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===t.slice(0,1)?"-":"",i=void 0!==s.prefix?s.signBeforePrefix?r+s.prefix:s.prefix+r:r,n=t,t.indexOf(s.numeralDecimalMark)>=0&&(n=(e=t.split(s.numeralDecimalMark))[0],o=s.numeralDecimalMark+e[1].slice(0,s.numeralDecimalScale)),"-"===r&&(n=n.slice(1)),s.numeralIntegerScale>0&&(n=n.slice(0,s.numeralIntegerScale)),s.numeralThousandsGroupStyle){case Rt.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+s.delimiter);break;case Rt.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+s.delimiter);break;case Rt.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+s.delimiter)}return s.tailPrefix?r+n.toString()+(s.numeralDecimalScale>0?o.toString():"")+s.prefix:i+n.toString()+(s.numeralDecimalScale>0?o.toString():"")}};var Lt=Rt,Ut=function(t,e,r){var i=this;i.date=[],i.blocks=[],i.datePattern=t,i.dateMin=e.split("-").reverse().map(function(t){return parseInt(t,10)}),2===i.dateMin.length&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(t){return parseInt(t,10)}),2===i.dateMax.length&&i.dateMax.unshift(0),i.initBlocks()};Ut.prototype={initBlocks:function(){var t=this;t.datePattern.forEach(function(e){"Y"===e?t.blocks.push(4):t.blocks.push(2)})},getISOFormatDate:function(){var t=this,e=t.date;return e[2]?e[2]+"-"+t.addLeadingZero(e[1])+"-"+t.addLeadingZero(e[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(t){var e=this,r="";return t=t.replace(/[^\d]/g,""),e.blocks.forEach(function(i,n){if(t.length>0){var s=t.slice(0,i),o=s.slice(0,1),a=t.slice(i);switch(e.datePattern[n]){case"d":"00"===s?s="01":parseInt(o,10)>3?s="0"+o:parseInt(s,10)>31&&(s="31");break;case"m":"00"===s?s="01":parseInt(o,10)>1?s="0"+o:parseInt(s,10)>12&&(s="12")}r+=s,t=a}}),this.getFixedDateString(r)},getFixedDateString:function(t){var e,r,i,n=this,s=n.datePattern,o=[],a=0,l=0,d=0,c=0,u=0,h=0,p=!1;return 4===t.length&&"y"!==s[0].toLowerCase()&&"y"!==s[1].toLowerCase()&&(u=2-(c="d"===s[0]?0:2),e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),o=this.getFixedDate(e,r,0)),8===t.length&&(s.forEach(function(t,e){switch(t){case"d":a=e;break;case"m":l=e;break;default:d=e}}),h=2*d,c=a<=d?2*a:2*a+2,u=l<=d?2*l:2*l+2,e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),i=parseInt(t.slice(h,h+4),10),p=4===t.slice(h,h+4).length,o=this.getFixedDate(e,r,i)),4!==t.length||"y"!==s[0]&&"y"!==s[1]||(h=2-(u="m"===s[0]?0:2),r=parseInt(t.slice(u,u+2),10),i=parseInt(t.slice(h,h+2),10),p=2===t.slice(h,h+2).length,o=[0,r,i]),6!==t.length||"Y"!==s[0]&&"Y"!==s[1]||(h=2-.5*(u="m"===s[0]?0:4),r=parseInt(t.slice(u,u+2),10),i=parseInt(t.slice(h,h+4),10),p=4===t.slice(h,h+4).length,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o,0===o.length?t:s.reduce(function(t,e){switch(e){case"d":return t+(0===o[0]?"":n.addLeadingZero(o[0]));case"m":return t+(0===o[1]?"":n.addLeadingZero(o[1]));case"y":return t+(p?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return t+(p?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(t){var e=this,r=e.datePattern,i=e.dateMin||[],n=e.dateMax||[];return!t.length||i.length<3&&n.length<3||r.find(function(t){return"y"===t.toLowerCase()})&&0===t[2]?t:n.length&&(n[2]<t[2]||n[2]===t[2]&&(n[1]<t[1]||n[1]===t[1]&&n[0]<t[0]))?n:i.length&&(i[2]>t[2]||i[2]===t[2]&&(i[1]>t[1]||i[1]===t[1]&&i[0]>t[0]))?i:t},getFixedDate:function(t,e,r){return t=Math.min(t,31),e=Math.min(e,12),r=parseInt(r||0,10),(e<7&&e%2==0||e>8&&e%2==1)&&(t=Math.min(t,2===e?this.isLeapYear(r)?29:28:30)),[t,e,r]},isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},addLeadingZero:function(t){return(t<10?"0":"")+t},addLeadingZeroForYear:function(t,e){return e?(t<10?"000":t<100?"00":t<1e3?"0":"")+t:(t<10?"0":"")+t}};var Bt=Ut,Ft=function(t,e){var r=this;r.time=[],r.blocks=[],r.timePattern=t,r.timeFormat=e,r.initBlocks()};Ft.prototype={initBlocks:function(){var t=this;t.timePattern.forEach(function(){t.blocks.push(2)})},getISOFormatTime:function(){var t=this,e=t.time;return e[2]?t.addLeadingZero(e[0])+":"+t.addLeadingZero(e[1])+":"+t.addLeadingZero(e[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(t){var e=this,r="";t=t.replace(/[^\d]/g,"");var i=e.getTimeFormatOptions();return e.blocks.forEach(function(n,s){if(t.length>0){var o=t.slice(0,n),a=o.slice(0,1),l=t.slice(n);switch(e.timePattern[s]){case"h":parseInt(a,10)>i.maxHourFirstDigit?o="0"+a:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(a,10)>i.maxMinutesFirstDigit?o="0"+a:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,t=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(t){var e,r,i,n=this,s=n.timePattern,o=[],a=0,l=0,d=0,c=0,u=0,h=0;return 6===t.length&&(s.forEach(function(t,e){switch(t){case"s":a=2*e;break;case"m":l=2*e;break;case"h":d=2*e}}),h=d,u=l,c=a,e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),i=parseInt(t.slice(h,h+2),10),o=this.getFixedTime(i,r,e)),4===t.length&&n.timePattern.indexOf("s")<0&&(s.forEach(function(t,e){switch(t){case"m":l=2*e;break;case"h":d=2*e}}),h=d,u=l,e=0,r=parseInt(t.slice(u,u+2),10),i=parseInt(t.slice(h,h+2),10),o=this.getFixedTime(i,r,e)),n.time=o,0===o.length?t:s.reduce(function(t,e){switch(e){case"s":return t+n.addLeadingZero(o[2]);case"m":return t+n.addLeadingZero(o[1]);case"h":return t+n.addLeadingZero(o[0])}},"")},getFixedTime:function(t,e,r){return r=Math.min(parseInt(r||0,10),60),e=Math.min(e,60),[t=Math.min(t,60),e,r]},addLeadingZero:function(t){return(t<10?"0":"")+t}};var qt=Ft,zt=function(t,e){var r=this;r.delimiter=e||""===e?e:" ",r.delimiterRE=e?new RegExp("\\"+e,"g"):"",r.formatter=t};zt.prototype={setFormatter:function(t){this.formatter=t},format:function(t){var e=this;e.formatter.clear();for(var r,i="",n=!1,s=0,o=(t=(t=(t=t.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(e.delimiterRE,"")).length;s<o;s++)r=e.formatter.inputDigit(t.charAt(s)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,e.delimiter)}};var Ht=zt,Ot={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(t){var e=t.reduce(function(t,e){return t+e},0);return t.concat(19-e)},getInfo:function(t,e){var r=Ot.blocks,i=Ot.re;for(var n in e=!!e,i)if(i[n].test(t)){var s=r[n];return{type:n,blocks:e?this.getStrictBlocks(s):s}}return{type:"unknown",blocks:e?this.getStrictBlocks(r.general):r.general}}},jt=Ot,Vt={noop:function(){},strip:function(t,e){return t.replace(e,"")},getPostDelimiter:function(t,e,r){if(0===r.length)return t.slice(-e.length)===e?e:"";var i="";return r.forEach(function(e){t.slice(-e.length)===e&&(i=e)}),i},getDelimiterREByDelimiter:function(t){return new RegExp(t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(t,e,r,i,n){return e.length===t?r.length:t+this.getPositionOffset(t,e,r,i,n)},getPositionOffset:function(t,e,r,i,n){var s,o,a;return s=this.stripDelimiters(e.slice(0,t),i,n),o=this.stripDelimiters(r.slice(0,t),i,n),0!==(a=s.length-o.length)?a/Math.abs(a):0},stripDelimiters:function(t,e,r){var i=this;if(0===r.length){var n=e?i.getDelimiterREByDelimiter(e):"";return t.replace(n,"")}return r.forEach(function(e){e.split("").forEach(function(e){t=t.replace(i.getDelimiterREByDelimiter(e),"")})}),t},headStr:function(t,e){return t.slice(0,e)},getMaxLength:function(t){return t.reduce(function(t,e){return t+e},0)},getPrefixStrippedValue:function(t,e,r,i,n,s,o,a,l){if(0===r)return t;if(t===e&&""!==t)return"";if(l&&"-"==t.slice(0,1)){var d="-"==i.slice(0,1)?i.slice(1):i;return"-"+this.getPrefixStrippedValue(t.slice(1),e,r,d,n,s,o,a,l)}if(i.slice(0,r)!==e&&!a)return o&&!i&&t?t:"";if(i.slice(-r)!==e&&a)return o&&!i&&t?t:"";var c=this.stripDelimiters(i,n,s);return t.slice(0,r)===e||a?t.slice(-r)!==e&&a?c.slice(0,-r-1):a?t.slice(0,-r):t.slice(r):c.slice(r)},getFirstDiffIndex:function(t,e){for(var r=0;t.charAt(r)===e.charAt(r);)if(""===t.charAt(r++))return-1;return r},getFormattedValue:function(t,e,r,i,n,s){var o="",a=n.length>0,l="";return 0===r?t:(e.forEach(function(e,d){if(t.length>0){var c=t.slice(0,e),u=t.slice(e);l=a?n[s?d-1:d]||l:i,s?(d>0&&(o+=l),o+=c):(o+=c,c.length===e&&d<r-1&&(o+=l)),t=u}}),o)},fixPrefixCursor:function(t,e,r,i){if(t){var n=t.value,s=r||i[0]||" ";if(t.setSelectionRange&&e&&!(e.length+s.length<=n.length)){var o=2*n.length;setTimeout(function(){t.setSelectionRange(o,o)},1)}}},checkFullSelection:function(t){try{return(window.getSelection()||document.getSelection()||{}).toString().length===t.length}catch(e){}return!1},setSelection:function(t,e,r){if(t===this.getActiveElement(r)&&!(t&&t.value.length<=e))if(t.createTextRange){var i=t.createTextRange();i.move("character",e),i.select()}else try{t.setSelectionRange(e,e)}catch(n){console.warn("The input element type does not support selection")}},getActiveElement:function(t){var e=t.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(t,e){return!!(this.isAndroid()&&t&&e)&&e===t.slice(0,-1)}},Yt={assign:function(t,e){return e=e||{},(t=t||{}).creditCard=!!e.creditCard,t.creditCardStrictMode=!!e.creditCardStrictMode,t.creditCardType="",t.onCreditCardTypeChanged=e.onCreditCardTypeChanged||function(){},t.phone=!!e.phone,t.phoneRegionCode=e.phoneRegionCode||"AU",t.phoneFormatter={},t.time=!!e.time,t.timePattern=e.timePattern||["h","m","s"],t.timeFormat=e.timeFormat||"24",t.timeFormatter={},t.date=!!e.date,t.datePattern=e.datePattern||["d","m","Y"],t.dateMin=e.dateMin||"",t.dateMax=e.dateMax||"",t.dateFormatter={},t.numeral=!!e.numeral,t.numeralIntegerScale=e.numeralIntegerScale>0?e.numeralIntegerScale:0,t.numeralDecimalScale=e.numeralDecimalScale>=0?e.numeralDecimalScale:2,t.numeralDecimalMark=e.numeralDecimalMark||".",t.numeralThousandsGroupStyle=e.numeralThousandsGroupStyle||"thousand",t.numeralPositiveOnly=!!e.numeralPositiveOnly,t.stripLeadingZeroes=!1!==e.stripLeadingZeroes,t.signBeforePrefix=!!e.signBeforePrefix,t.tailPrefix=!!e.tailPrefix,t.swapHiddenInput=!!e.swapHiddenInput,t.numericOnly=t.creditCard||t.date||!!e.numericOnly,t.uppercase=!!e.uppercase,t.lowercase=!!e.lowercase,t.prefix=t.creditCard||t.date?"":e.prefix||"",t.noImmediatePrefix=!!e.noImmediatePrefix,t.prefixLength=t.prefix.length,t.rawValueTrimPrefix=!!e.rawValueTrimPrefix,t.copyDelimiter=!!e.copyDelimiter,t.initValue=void 0!==e.initValue&&null!==e.initValue?e.initValue.toString():"",t.delimiter=e.delimiter||""===e.delimiter?e.delimiter:e.date?"/":e.time?":":e.numeral?",":(e.phone," "),t.delimiterLength=t.delimiter.length,t.delimiterLazyShow=!!e.delimiterLazyShow,t.delimiters=e.delimiters||[],t.blocks=e.blocks||[],t.blocksLength=t.blocks.length,t.root="object"==typeof Dt&&Dt?Dt:window,t.document=e.document||t.root.document,t.maxLength=0,t.backspace=!1,t.result="",t.onValueChanged=e.onValueChanged||function(){},t}},Qt=function(t,e){var r=this,i=!1;if("string"==typeof t?(r.element=document.querySelector(t),i=document.querySelectorAll(t).length>1):void 0!==t.length&&t.length>0?(r.element=t[0],i=t.length>1):r.element=t,!r.element)throw new Error("[cleave.js] Please check the element");if(i)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(n){}e.initValue=r.element.value,r.properties=Qt.DefaultProperties.assign({},e),r.init()};Qt.prototype={init:function(){var t=this,e=t.properties;e.numeral||e.phone||e.creditCard||e.time||e.date||0!==e.blocksLength||e.prefix?(e.maxLength=Qt.Util.getMaxLength(e.blocks),t.isAndroid=Qt.Util.isAndroid(),t.lastInputValue="",t.isBackward="",t.onChangeListener=t.onChange.bind(t),t.onKeyDownListener=t.onKeyDown.bind(t),t.onFocusListener=t.onFocus.bind(t),t.onCutListener=t.onCut.bind(t),t.onCopyListener=t.onCopy.bind(t),t.initSwapHiddenInput(),t.element.addEventListener("input",t.onChangeListener),t.element.addEventListener("keydown",t.onKeyDownListener),t.element.addEventListener("focus",t.onFocusListener),t.element.addEventListener("cut",t.onCutListener),t.element.addEventListener("copy",t.onCopyListener),t.initPhoneFormatter(),t.initDateFormatter(),t.initTimeFormatter(),t.initNumeralFormatter(),(e.initValue||e.prefix&&!e.noImmediatePrefix)&&t.onInput(e.initValue)):t.onInput(e.initValue)},initSwapHiddenInput:function(){var t=this;if(t.properties.swapHiddenInput){var e=t.element.cloneNode(!0);t.element.parentNode.insertBefore(e,t.element),t.elementSwapHidden=t.element,t.elementSwapHidden.type="hidden",t.element=e,t.element.id=""}},initNumeralFormatter:function(){var t=this.properties;t.numeral&&(t.numeralFormatter=new Qt.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.prefix,t.signBeforePrefix,t.tailPrefix,t.delimiter))},initTimeFormatter:function(){var t=this.properties;t.time&&(t.timeFormatter=new Qt.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=Qt.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new Qt.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=Qt.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new Qt.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(e){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(t){var e=this,r=t.which||t.keyCode;e.lastInputValue=e.element.value,e.isBackward=8===r},onChange:function(t){var e=this,r=e.properties,i=Qt.Util;e.isBackward=e.isBackward||"deleteContentBackward"===t.inputType;var n=i.getPostDelimiter(e.lastInputValue,r.delimiter,r.delimiters);e.isBackward&&n?r.postDelimiterBackspace=n:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var t=this,e=t.properties;t.lastInputValue=t.element.value,e.prefix&&e.noImmediatePrefix&&!t.element.value&&this.onInput(e.prefix),Qt.Util.fixPrefixCursor(t.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(t){Qt.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(t),this.onInput(""))},onCopy:function(t){Qt.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(t)},copyClipboardData:function(t){var e=this.properties,r=Qt.Util,i=this.element.value,n="";n=e.copyDelimiter?i:r.stripDelimiters(i,e.delimiter,e.delimiters);try{t.clipboardData?t.clipboardData.setData("Text",n):window.clipboardData.setData("Text",n),t.preventDefault()}catch(s){}},onInput:function(t){var e=this,r=e.properties,i=Qt.Util,n=i.getPostDelimiter(t,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||n||(t=i.headStr(t,t.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!t.length?r.result=r.phoneFormatter.format(t):r.result=r.prefix+r.phoneFormatter.format(t).slice(r.prefix.length),void e.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&0===t.length?r.result="":r.result=r.numeralFormatter.format(t),void e.updateValueState()):(r.date&&(t=r.dateFormatter.getValidatedDate(t)),r.time&&(t=r.timeFormatter.getValidatedTime(t)),t=i.stripDelimiters(t,r.delimiter,r.delimiters),t=i.getPrefixStrippedValue(t,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),t=r.numericOnly?i.strip(t,/[^\d]/g):t,t=r.uppercase?t.toUpperCase():t,t=r.lowercase?t.toLowerCase():t,r.prefix&&(r.tailPrefix?t+=r.prefix:t=r.prefix+t,0===r.blocksLength)?(r.result=t,void e.updateValueState()):(r.creditCard&&e.updateCreditCardPropsByValue(t),t=i.headStr(t,r.maxLength),r.result=i.getFormattedValue(t,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void e.updateValueState()))},updateCreditCardPropsByValue:function(t){var e,r=this.properties,i=Qt.Util;i.headStr(r.result,4)!==i.headStr(t,4)&&(e=Qt.CreditCardDetector.getInfo(t,r.creditCardStrictMode),r.blocks=e.blocks,r.blocksLength=r.blocks.length,r.maxLength=i.getMaxLength(r.blocks),r.creditCardType!==e.type&&(r.creditCardType=e.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var t=this,e=Qt.Util,r=t.properties;if(t.element){var i=t.element.selectionEnd,n=t.element.value,s=r.result;i=e.getNextCursorPosition(i,n,s,r.delimiter,r.delimiters),t.isAndroid?window.setTimeout(function(){t.element.value=s,e.setSelection(t.element,i,r.document,!1),t.callOnValueChanged()},1):(t.element.value=s,r.swapHiddenInput&&(t.elementSwapHidden.value=t.getRawValue()),e.setSelection(t.element,i,r.document,!1),t.callOnValueChanged())}},callOnValueChanged:function(){var t=this,e=t.properties;e.onValueChanged.call(t,{target:{name:t.element.name,value:e.result,rawValue:t.getRawValue()}})},setPhoneRegionCode:function(t){var e=this;e.properties.phoneRegionCode=t,e.initPhoneFormatter(),e.onChange()},setRawValue:function(t){var e=this,r=e.properties;t=null!=t?t.toString():"",r.numeral&&(t=t.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,e.element.value=t,e.onInput(t)},getRawValue:function(){var t=this.properties,e=Qt.Util,r=this.element.value;return t.rawValueTrimPrefix&&(r=e.getPrefixStrippedValue(r,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix)),r=t.numeral?t.numeralFormatter.getRawValue(r):e.stripDelimiters(r,t.delimiter,t.delimiters)},getISOFormatDate:function(){var t=this.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var t=this.properties;return t.time?t.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var t=this;t.element.removeEventListener("input",t.onChangeListener),t.element.removeEventListener("keydown",t.onKeyDownListener),t.element.removeEventListener("focus",t.onFocusListener),t.element.removeEventListener("cut",t.onCutListener),t.element.removeEventListener("copy",t.onCopyListener)},toString:function(){return"[Cleave Object]"}},Qt.NumeralFormatter=Lt,Qt.DateFormatter=Bt,Qt.TimeFormatter=qt,Qt.PhoneFormatter=Ht,Qt.CreditCardDetector=jt,Qt.Util=Vt,Qt.DefaultProperties=Yt,("object"==typeof Dt&&Dt?Dt:window).Cleave=Qt;var Kt=Qt,Gt={},Jt={},Zt={};let Wt;const Xt=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Zt.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},Zt.getSymbolTotalCodewords=function(t){return Xt[t]},Zt.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},Zt.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');Wt=t},Zt.isKanjiModeEnabled=function(){return void 0!==Wt},Zt.toSJIS=function(t){return Wt(t)};var te,ee={};function re(){this.buffer=[],this.length=0}(te=ee).L={bit:1},te.M={bit:0},te.Q={bit:3},te.H={bit:2},te.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},te.from=function(t,e){if(te.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return te.L;case"m":case"medium":return te.M;case"q":case"quartile":return te.Q;case"h":case"high":return te.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(r){return e}},re.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var ie=re;function ne(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}ne.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},ne.prototype.get=function(t,e){return this.data[t*this.size+e]},ne.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ne.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var se=ne,oe={};!function(t){const e=Zt.getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,i=e(t),n=145===i?26:2*Math.ceil((i-13)/(2*r-2)),s=[i-7];for(let e=1;e<r-1;e++)s[e]=s[e-1]-n;return s.push(6),s.reverse()},t.getPositions=function(e){const r=[],i=t.getRowColCoords(e),n=i.length;for(let t=0;t<n;t++)for(let e=0;e<n;e++)0===t&&0===e||0===t&&e===n-1||t===n-1&&0===e||r.push([i[t],i[e]]);return r}}(oe);var ae={};const le=Zt.getSymbolSize;ae.getPositions=function(t){const e=le(t);return[[0,0],[e-7,0],[0,e-7]]};var de={};!function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,r=3,i=40,n=10;function s(e,r,i){switch(e){case t.Patterns.PATTERN000:return(r+i)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return i%3==0;case t.Patterns.PATTERN011:return(r+i)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(i/3))%2==0;case t.Patterns.PATTERN101:return r*i%2+r*i%3==0;case t.Patterns.PATTERN110:return(r*i%2+r*i%3)%2==0;case t.Patterns.PATTERN111:return(r*i%3+(r+i)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const r=t.size;let i=0,n=0,s=0,o=null,a=null;for(let l=0;l<r;l++){n=s=0,o=a=null;for(let d=0;d<r;d++){let r=t.get(l,d);r===o?n++:(n>=5&&(i+=e+(n-5)),o=r,n=1),r=t.get(d,l),r===a?s++:(s>=5&&(i+=e+(s-5)),a=r,s=1)}n>=5&&(i+=e+(n-5)),s>=5&&(i+=e+(s-5))}return i},t.getPenaltyN2=function(t){const e=t.size;let i=0;for(let r=0;r<e-1;r++)for(let n=0;n<e-1;n++){const e=t.get(r,n)+t.get(r,n+1)+t.get(r+1,n)+t.get(r+1,n+1);4!==e&&0!==e||i++}return i*r},t.getPenaltyN3=function(t){const e=t.size;let r=0,n=0,s=0;for(let i=0;i<e;i++){n=s=0;for(let o=0;o<e;o++)n=n<<1&2047|t.get(i,o),o>=10&&(1488===n||93===n)&&r++,s=s<<1&2047|t.get(o,i),o>=10&&(1488===s||93===s)&&r++}return r*i},t.getPenaltyN4=function(t){let e=0;const r=t.data.length;for(let i=0;i<r;i++)e+=t.data[i];return Math.abs(Math.ceil(100*e/r/5)-10)*n},t.applyMask=function(t,e){const r=e.size;for(let i=0;i<r;i++)for(let n=0;n<r;n++)e.isReserved(n,i)||e.xor(n,i,s(t,n,i))},t.getBestMask=function(e,r){const i=Object.keys(t.Patterns).length;let n=0,s=1/0;for(let o=0;o<i;o++){r(o),t.applyMask(o,e);const i=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(o,e),i<s&&(s=i,n=o)}return n}}(de);var ce={};const ue=ee,he=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],pe=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ce.getBlocksCount=function(t,e){switch(e){case ue.L:return he[4*(t-1)+0];case ue.M:return he[4*(t-1)+1];case ue.Q:return he[4*(t-1)+2];case ue.H:return he[4*(t-1)+3];default:return}},ce.getTotalCodewordsCount=function(t,e){switch(e){case ue.L:return pe[4*(t-1)+0];case ue.M:return pe[4*(t-1)+1];case ue.Q:return pe[4*(t-1)+2];case ue.H:return pe[4*(t-1)+3];default:return}};var me={},ge={};const fe=new Uint8Array(512),ye=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)fe[e]=t,ye[t]=e,t<<=1,256&t&&(t^=285);for(let e=255;e<512;e++)fe[e]=fe[e-255]}(),ge.log=function(t){if(t<1)throw new Error("log("+t+")");return ye[t]},ge.exp=function(t){return fe[t]},ge.mul=function(t,e){return 0===t||0===e?0:fe[ye[t]+ye[e]]},function(t){const e=ge;t.mul=function(t,r){const i=new Uint8Array(t.length+r.length-1);for(let n=0;n<t.length;n++)for(let s=0;s<r.length;s++)i[n+s]^=e.mul(t[n],r[s]);return i},t.mod=function(t,r){let i=new Uint8Array(t);for(;i.length-r.length>=0;){const t=i[0];for(let s=0;s<r.length;s++)i[s]^=e.mul(r[s],t);let n=0;for(;n<i.length&&0===i[n];)n++;i=i.slice(n)}return i},t.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let n=0;n<r;n++)i=t.mul(i,new Uint8Array([1,e.exp(n)]));return i}}(me);const ve=me;function be(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}be.prototype.initialize=function(t){this.degree=t,this.genPoly=ve.generateECPolynomial(this.degree)},be.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const r=ve.mod(e,this.genPoly),i=this.degree-r.length;if(i>0){const t=new Uint8Array(this.degree);return t.set(r,i),t}return r};var we=be,xe={},ke={},Se={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},Pe={};const Ce="[0-9]+";let Ae="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ae=Ae.replace(/u/g,"\\u");const $e="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ae+")(?:.|[\r\n]))+";Pe.KANJI=new RegExp(Ae,"g"),Pe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Pe.BYTE=new RegExp($e,"g"),Pe.NUMERIC=new RegExp(Ce,"g"),Pe.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Ee=new RegExp("^"+Ae+"$"),_e=new RegExp("^"+Ce+"$"),Me=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Pe.testKanji=function(t){return Ee.test(t)},Pe.testNumeric=function(t){return _e.test(t)},Pe.testAlphanumeric=function(t){return Me.test(t)},function(t){const e=Se,r=Pe;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return r.testNumeric(e)?t.NUMERIC:r.testAlphanumeric(e)?t.ALPHANUMERIC:r.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(i){return r}}}(ke),function(t){const e=Zt,r=ce,i=ee,n=ke,s=Se,o=e.getBCHDigit(7973);function a(t,e){return n.getCharCountIndicator(t,e)+4}function l(t,e){let r=0;return t.forEach(function(t){const i=a(t.mode,e);r+=i+t.getBitsLength()}),r}t.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,i,o){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===o&&(o=n.BYTE);const l=8*(e.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,i));if(o===n.MIXED)return l;const d=l-a(o,t);switch(o){case n.NUMERIC:return Math.floor(d/10*3);case n.ALPHANUMERIC:return Math.floor(d/11*2);case n.KANJI:return Math.floor(d/13);case n.BYTE:default:return Math.floor(d/8)}},t.getBestVersionForData=function(e,r){let s;const o=i.from(r,i.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let i=1;i<=40;i++)if(l(e,i)<=t.getCapacity(i,r,n.MIXED))return i}(e,o);if(0===e.length)return 1;s=e[0]}else s=e;return function(e,r,i){for(let n=1;n<=40;n++)if(r<=t.getCapacity(n,i,e))return n}(s.mode,s.getLength(),o)},t.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;e.getBCHDigit(r)-o>=0;)r^=7973<<e.getBCHDigit(r)-o;return t<<12|r}}(xe);var Ie={};const Ne=Zt,Te=Ne.getBCHDigit(1335);Ie.getEncodedBits=function(t,e){const r=t.bit<<3|e;let i=r<<10;for(;Ne.getBCHDigit(i)-Te>=0;)i^=1335<<Ne.getBCHDigit(i)-Te;return 21522^(r<<10|i)};var De={};const Re=ke;function Le(t){this.mode=Re.NUMERIC,this.data=t.toString()}Le.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},Le.prototype.getLength=function(){return this.data.length},Le.prototype.getBitsLength=function(){return Le.getBitsLength(this.data.length)},Le.prototype.write=function(t){let e,r,i;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),i=parseInt(r,10),t.put(i,10);const n=this.data.length-e;n>0&&(r=this.data.substr(e),i=parseInt(r,10),t.put(i,3*n+1))};var Ue=Le;const Be=ke,Fe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function qe(t){this.mode=Be.ALPHANUMERIC,this.data=t}qe.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},qe.prototype.getLength=function(){return this.data.length},qe.prototype.getBitsLength=function(){return qe.getBitsLength(this.data.length)},qe.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*Fe.indexOf(this.data[e]);r+=Fe.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(Fe.indexOf(this.data[e]),6)};var ze=qe;const He=ke;function Oe(t){this.mode=He.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}Oe.getBitsLength=function(t){return 8*t},Oe.prototype.getLength=function(){return this.data.length},Oe.prototype.getBitsLength=function(){return Oe.getBitsLength(this.data.length)},Oe.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var je=Oe;const Ve=ke,Ye=Zt;function Qe(t){this.mode=Ve.KANJI,this.data=t}Qe.getBitsLength=function(t){return 13*t},Qe.prototype.getLength=function(){return this.data.length},Qe.prototype.getBitsLength=function(){return Qe.getBitsLength(this.data.length)},Qe.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=Ye.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}};var Ke,Ge=Qe,Je={exports:{}};Ke={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var s,o,a,l,d,c,u,h=Ke.PriorityQueue.make();for(h.push(e,0);!h.empty();)for(a in o=(s=h.pop()).value,l=s.cost,d=t[o]||{})d.hasOwnProperty(a)&&(c=l+d[a],u=n[a],(void 0===n[a]||u>c)&&(n[a]=c,h.push(a,c),i[a]=o));if(void 0!==r&&void 0===n[r]){var p=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],i=e;i;)r.push(i),t[i],i=t[i];return r.reverse(),r},find_path:function(t,e,r){var i=Ke.single_source_shortest_paths(t,e,r);return Ke.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=Ke.PriorityQueue,i={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}},Je.exports=Ke;var Ze=Je.exports;!function(t){const e=ke,r=Ue,i=ze,n=je,s=Ge,o=Pe,a=Zt,l=Ze;function d(t){return unescape(encodeURIComponent(t)).length}function c(t,e,r){const i=[];let n;for(;null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function u(t){const r=c(o.NUMERIC,e.NUMERIC,t),i=c(o.ALPHANUMERIC,e.ALPHANUMERIC,t);let n,s;a.isKanjiModeEnabled()?(n=c(o.BYTE,e.BYTE,t),s=c(o.KANJI,e.KANJI,t)):(n=c(o.BYTE_KANJI,e.BYTE,t),s=[]);return r.concat(i,n,s).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function h(t,o){switch(o){case e.NUMERIC:return r.getBitsLength(t);case e.ALPHANUMERIC:return i.getBitsLength(t);case e.KANJI:return s.getBitsLength(t);case e.BYTE:return n.getBitsLength(t)}}function p(t,o){let l;const d=e.getBestModeForData(t);if(l=e.from(o,d),l!==e.BYTE&&l.bit<d.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(l)+".\n Suggested mode is: "+e.toString(d));switch(l!==e.KANJI||a.isKanjiModeEnabled()||(l=e.BYTE),l){case e.NUMERIC:return new r(t);case e.ALPHANUMERIC:return new i(t);case e.KANJI:return new s(t);case e.BYTE:return new n(t)}}t.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(p(e,null)):e.data&&t.push(p(e.data,e.mode)),t},[])},t.fromString=function(r,i){const n=function(t){const r=[];for(let i=0;i<t.length;i++){const n=t[i];switch(n.mode){case e.NUMERIC:r.push([n,{data:n.data,mode:e.ALPHANUMERIC,length:n.length},{data:n.data,mode:e.BYTE,length:n.length}]);break;case e.ALPHANUMERIC:r.push([n,{data:n.data,mode:e.BYTE,length:n.length}]);break;case e.KANJI:r.push([n,{data:n.data,mode:e.BYTE,length:d(n.data)}]);break;case e.BYTE:r.push([{data:n.data,mode:e.BYTE,length:d(n.data)}])}}return r}(u(r,a.isKanjiModeEnabled())),s=function(t,r){const i={},n={start:{}};let s=["start"];for(let o=0;o<t.length;o++){const a=t[o],l=[];for(let t=0;t<a.length;t++){const d=a[t],c=""+o+t;l.push(c),i[c]={node:d,lastCount:0},n[c]={};for(let t=0;t<s.length;t++){const o=s[t];i[o]&&i[o].node.mode===d.mode?(n[o][c]=h(i[o].lastCount+d.length,d.mode)-h(i[o].lastCount,d.mode),i[o].lastCount+=d.length):(i[o]&&(i[o].lastCount=d.length),n[o][c]=h(d.length,d.mode)+4+e.getCharCountIndicator(d.mode,r))}}s=l}for(let e=0;e<s.length;e++)n[s[e]].end=0;return{map:n,table:i}}(n,i),o=l.find_path(s.map,"start","end"),c=[];for(let t=1;t<o.length-1;t++)c.push(s.table[o[t]].node);return t.fromArray(function(t){return t.reduce(function(t,e){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(c))},t.rawSplit=function(e){return t.fromArray(u(e,a.isKanjiModeEnabled()))}}(De);const We=Zt,Xe=ee,tr=ie,er=se,rr=oe,ir=ae,nr=de,sr=ce,or=we,ar=xe,lr=Ie,dr=ke,cr=De;function ur(t,e,r){const i=t.size,n=lr.getEncodedBits(e,r);let s,o;for(s=0;s<15;s++)o=1==(n>>s&1),s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(i-15+s,8,o,!0),s<8?t.set(8,i-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(i-8,8,1,!0)}function hr(t,e,r){const i=new tr;r.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),dr.getCharCountIndicator(e.mode,t)),e.write(i)});const n=8*(We.getSymbolTotalCodewords(t)-sr.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=n&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const s=(n-i.getLengthInBits())/8;for(let o=0;o<s;o++)i.put(o%2?17:236,8);return function(t,e,r){const i=We.getSymbolTotalCodewords(e),n=sr.getTotalCodewordsCount(e,r),s=i-n,o=sr.getBlocksCount(e,r),a=i%o,l=o-a,d=Math.floor(i/o),c=Math.floor(s/o),u=c+1,h=d-c,p=new or(h);let m=0;const g=new Array(o),f=new Array(o);let y=0;const v=new Uint8Array(t.buffer);for(let S=0;S<o;S++){const t=S<l?c:u;g[S]=v.slice(m,m+t),f[S]=p.encode(g[S]),m+=t,y=Math.max(y,t)}const b=new Uint8Array(i);let w,x,k=0;for(w=0;w<y;w++)for(x=0;x<o;x++)w<g[x].length&&(b[k++]=g[x][w]);for(w=0;w<h;w++)for(x=0;x<o;x++)b[k++]=f[x][w];return b}(i,t,e)}function pr(t,e,r,i){let n;if(Array.isArray(t))n=cr.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let i=e;if(!i){const e=cr.rawSplit(t);i=ar.getBestVersionForData(e,r)}n=cr.fromString(t,i||40)}}const s=ar.getBestVersionForData(n,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<s)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+s+".\n")}else e=s;const o=hr(e,r,n),a=We.getSymbolSize(e),l=new er(a);return function(t,e){const r=t.size,i=ir.getPositions(e);for(let n=0;n<i.length;n++){const e=i[n][0],s=i[n][1];for(let i=-1;i<=7;i++)if(!(e+i<=-1||r<=e+i))for(let n=-1;n<=7;n++)s+n<=-1||r<=s+n||(i>=0&&i<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===i||6===i)||i>=2&&i<=4&&n>=2&&n<=4?t.set(e+i,s+n,!0,!0):t.set(e+i,s+n,!1,!0))}}(l,e),function(t){const e=t.size;for(let r=8;r<e-8;r++){const e=r%2==0;t.set(r,6,e,!0),t.set(6,r,e,!0)}}(l),function(t,e){const r=rr.getPositions(e);for(let i=0;i<r.length;i++){const e=r[i][0],n=r[i][1];for(let r=-2;r<=2;r++)for(let i=-2;i<=2;i++)-2===r||2===r||-2===i||2===i||0===r&&0===i?t.set(e+r,n+i,!0,!0):t.set(e+r,n+i,!1,!0)}}(l,e),ur(l,r,0),e>=7&&function(t,e){const r=t.size,i=ar.getEncodedBits(e);let n,s,o;for(let a=0;a<18;a++)n=Math.floor(a/3),s=a%3+r-8-3,o=1==(i>>a&1),t.set(n,s,o,!0),t.set(s,n,o,!0)}(l,e),function(t,e){const r=t.size;let i=-1,n=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!t.isReserved(n,a-r)){let i=!1;o<e.length&&(i=1==(e[o]>>>s&1)),t.set(n,a-r,i),s--,-1===s&&(o++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}(l,o),isNaN(i)&&(i=nr.getBestMask(l,ur.bind(null,l,r))),nr.applyMask(i,l),ur(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}Jt.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let r,i,n=Xe.M;return void 0!==e&&(n=Xe.from(e.errorCorrectionLevel,Xe.M),r=ar.from(e.version),i=nr.from(e.maskPattern),e.toSJISFunc&&We.setToSJISFunction(e.toSJISFunc)),pr(t,r,n,i)};var mr={},gr={};!function(t){function e(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");const r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,i=t.width&&t.width>=21?t.width:void 0,n=t.scale||4;return{width:i,scale:i?4:n,margin:r,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},t.getImageWidth=function(e,r){const i=t.getScale(e,r);return Math.floor((e+2*r.margin)*i)},t.qrToImageData=function(e,r,i){const n=r.modules.size,s=r.modules.data,o=t.getScale(n,i),a=Math.floor((n+2*i.margin)*o),l=i.margin*o,d=[i.color.light,i.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let c=4*(t*a+r),u=i.color.light;if(t>=l&&r>=l&&t<a-l&&r<a-l){u=d[s[Math.floor((t-l)/o)*n+Math.floor((r-l)/o)]?1:0]}e[c++]=u.r,e[c++]=u.g,e[c++]=u.b,e[c]=u.a}}}(gr),function(t){const e=gr;t.render=function(t,r,i){let n=i,s=r;void 0!==n||r&&r.getContext||(n=r,r=void 0),r||(s=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=e.getOptions(n);const o=e.getImageWidth(t.modules.size,n),a=s.getContext("2d"),l=a.createImageData(o,o);return e.qrToImageData(l.data,t,n),function(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px"}(a,s,o),a.putImageData(l,0,0),s},t.renderToDataURL=function(e,r,i){let n=i;void 0!==n||r&&r.getContext||(n=r,r=void 0),n||(n={});const s=t.render(e,r,n),o=n.type||"image/png",a=n.rendererOpts||{};return s.toDataURL(o,a.quality)}}(mr);var fr={};const yr=gr;function vr(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function br(t,e,r){let i=t+e;return void 0!==r&&(i+=" "+r),i}fr.render=function(t,e,r){const i=yr.getOptions(e),n=t.modules.size,s=t.modules.data,o=n+2*i.margin,a=i.color.light.a?"<path "+vr(i.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",l="<path "+vr(i.color.dark,"stroke")+' d="'+function(t,e,r){let i="",n=0,s=!1,o=0;for(let a=0;a<t.length;a++){const l=Math.floor(a%e),d=Math.floor(a/e);l||s||(s=!0),t[a]?(o++,a>0&&l>0&&t[a-1]||(i+=s?br("M",l+r,.5+d+r):br("m",n,0),n=0,s=!1),l+1<e&&t[a+1]||(i+=br("h",o),o=0)):n++}return i}(s,n,i.margin)+'"/>',d='viewBox="0 0 '+o+" "+o+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+d+' shape-rendering="crispEdges">'+a+l+"</svg>\n";return"function"==typeof r&&r(null,c),c};const wr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},xr=Jt,kr=mr,Sr=fr;function Pr(t,e,r,i,n){const s=[].slice.call(arguments,1),o=s.length,a="function"==typeof s[o-1];if(!a&&!wr())throw new Error("Callback required as last argument");if(!a){if(o<1)throw new Error("Too few arguments provided");return 1===o?(r=e,e=i=void 0):2!==o||e.getContext||(i=r,r=e,e=void 0),new Promise(function(n,s){try{const s=xr.create(r,i);n(t(s,e,i))}catch(o){s(o)}})}if(o<2)throw new Error("Too few arguments provided");2===o?(n=r,r=e,e=i=void 0):3===o&&(e.getContext&&void 0===n?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0));try{const s=xr.create(r,i);n(null,t(s,e,i))}catch(l){n(l)}}Gt.create=xr.create,Gt.toCanvas=Pr.bind(null,kr.render),Gt.toDataURL=Pr.bind(null,kr.renderToDataURL),Gt.toString=Pr.bind(null,function(t,e,r){return Sr.render(t,r)});var Cr=Object.defineProperty,Ar=Object.getOwnPropertyDescriptor,$r=(t,e,r,i)=>{for(var n,s=i>1?void 0:i?Ar(e,r):e,o=t.length-1;o>=0;o--)(n=t[o])&&(s=(i?n(e,r,s):n(s))||s);return i&&s&&Cr(e,r,s),s};let Er=class extends ot{constructor(){super(...arguments),this.currentState={status:"idle"},this.selectedMethod=null,this.cardFormData={cardNumber:"",expiry:"",cvv:"",cardholderName:""},this.formErrors={},this.paymentData=null,this.feesExpanded=!1,this.isInitializing=!0,this.cardBrand="unknown",this.paymentLocked=!1,this.show3DSModal=!1,this.showQRModal=!1,this.nextActionUrl=null,this.qrCode=null,this.qrCodeDataUrl=null,this.qrAutoResumeTimer=null,this.qrPollingInProgress=!1,this.sdk=null,this.isInitialized=!1,this.cardNumberCleave=null,this.expiryCleave=null,this.leaveEventsCounter=0,this.previousState=null,this.cssVariableMap={colorPrimary:"--op-color-primary",colorPrimaryHover:"--op-color-primary-hover",colorPrimaryText:"--op-color-primary-text",colorBackground:"--op-color-background",colorSurface:"--op-color-surface",colorText:"--op-color-text",colorTextSecondary:"--op-color-text-secondary",colorDanger:"--op-color-danger",colorSuccess:"--op-color-success",colorWarning:"--op-color-warning",colorBorder:"--op-color-border",colorBorderFocus:"--op-color-border-focus",fontFamily:"--op-font-family",fontSize:"--op-font-size",fontSizeSmall:"--op-font-size-sm",borderRadius:"--op-border-radius",borderRadiusLarge:"--op-border-radius-lg",spacingUnit:"--op-spacing-unit",boxShadow:"--op-box-shadow",boxShadowLarge:"--op-box-shadow-lg"},this.themeMediaQuery=null,this.themeMediaQueryHandler=null,this.handle3DSPostMessage=t=>{"ON_AWX_3DS_START_PAGE_LEAVE"===t.data&&(this.leaveEventsCounter++,this.leaveEventsCounter>1&&this.handle3DSComplete())}}hasAllRequiredProps(){return!!(this.config&&this.adapters&&this.amount&&this.currency&&this.orderId)&&(!(!this.firstName||"string"!=typeof this.firstName||""===this.firstName.trim())&&(!(!this.lastName||"string"!=typeof this.lastName||""===this.lastName.trim())&&(!(!this.email||"string"!=typeof this.email||""===this.email.trim())&&!(!this.phoneNumber||"string"!=typeof this.phoneNumber||""===this.phoneNumber.trim()))))}applyAppearance(){if(!this.appearance)return void this.removeAttribute("data-theme");const{theme:t,variables:e}=this.appearance;if(t)if("auto"===t){const t=window.matchMedia("(prefers-color-scheme: dark)").matches;this.dataset.theme=t?"dark":"light",this.setupThemeMediaQueryListener()}else this.dataset.theme=t;e&&this.applyCssVariables(e)}applyCssVariables(t){for(const[e,r]of Object.entries(this.cssVariableMap)){const i=t[e];null!=i?this.style.setProperty(r,i):this.style.removeProperty(r)}}setupThemeMediaQueryListener(){this.cleanupThemeMediaQueryListener(),this.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.themeMediaQueryHandler=t=>{var e;"auto"===(null==(e=this.appearance)?void 0:e.theme)&&(this.dataset.theme=t.matches?"dark":"light")},this.themeMediaQuery.addEventListener("change",this.themeMediaQueryHandler)}cleanupThemeMediaQueryListener(){this.themeMediaQuery&&this.themeMediaQueryHandler&&(this.themeMediaQuery.removeEventListener("change",this.themeMediaQueryHandler),this.themeMediaQuery=null,this.themeMediaQueryHandler=null)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handle3DSPostMessage),this.addEventListener("force-close-3ds-modal",()=>{this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0)})}firstUpdated(){this.applyAppearance(),this.initializeSDK()}updated(t){super.updated(t),t.has("appearance")&&this.applyAppearance(),!this.isInitialized&&this.hasAllRequiredProps()&&(console.info("[OnePayment] All required props now available. Initializing SDK..."),this.initializeSDK())}disconnectedCallback(){var t;super.disconnectedCallback(),this.cleanupThemeMediaQueryListener(),null==(t=this.sdk)||t.destroy(),this.isInitialized=!1,this.destroyCleave(),window.removeEventListener("message",this.handle3DSPostMessage),null!==this.qrAutoResumeTimer&&clearTimeout(this.qrAutoResumeTimer)}setupCleave(){setTimeout(()=>{var t,e;const r=null==(t=this.shadowRoot)?void 0:t.querySelector("#cardNumber"),i=null==(e=this.shadowRoot)?void 0:e.querySelector("#expiry");r&&!this.cardNumberCleave&&(this.cardNumberCleave=new Kt(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:t=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[t]||"unknown"}})),i&&!this.expiryCleave&&(this.expiryCleave=new Kt(i,{date:!0,datePattern:["m","y"],delimiter:"/"}))},50)}destroyCleave(){this.cardNumberCleave&&(this.cardNumberCleave.destroy(),this.cardNumberCleave=null),this.expiryCleave&&(this.expiryCleave.destroy(),this.expiryCleave=null)}getFilteredPaymentMethods(){const t=("ready"===this.currentState.status||"processing"===this.currentState.status||"requires_action"===this.currentState.status)&&this.currentState.availableMethods||[];return 0===t.length?[]:t.filter(t=>{var e;return!(null==(e=this.excludePaymentMethods)?void 0:e.includes(t.id))}).map(t=>{if(t.id===pt){if("SGD"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"PayNow is only available for SGD currency"}}if(t.id===mt){if("THB"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"PromptPay is only available for THB currency"}}if(t.id===gt){if("MYR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"DuitNow is only available for MYR currency"}}if(t.id===ft){if("IDR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"GoPay is only available for IDR currency"}}if(t.id===yt){if("MYR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"Boost is only available for MYR currency"}}if(t.id===vt){if("MYR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"ShopeePay is only available for MYR currency"}}if(t.id===bt){const e=this.getTransactionData().currency;if("SGD"!==e&&"MYR"!==e)return{id:t.id,enabled:!1,disabledReason:"Atom is only available for SGD and MYR currencies"}}if(t.id===wt){if("IDR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"Dana is only available for IDR currency"}}if(t.id===xt){if("MYR"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"Touch 'n Go is only available for MYR currency"}}if(t.id===kt){if("CNY"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"Alipay is only available for CNY currency"}}if(t.id===St){if("HKD"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"AlipayHK is only available for HKD currency"}}if(t.id===Pt){if("PHP"!==this.getTransactionData().currency)return{id:t.id,enabled:!1,disabledReason:"GCash is only available for PHP currency"}}return{id:t.id,enabled:!0}})}initializeSDK(){var t;this.config&&this.adapters&&this.amount&&this.currency&&this.orderId?this.firstName&&"string"==typeof this.firstName&&""!==this.firstName.trim()?this.lastName&&"string"==typeof this.lastName&&""!==this.lastName.trim()?this.email&&"string"==typeof this.email&&""!==this.email.trim()?this.isInitialized||(this.isInitialized=!0,null==(t=this.sdk)||t.destroy(),this.sdk=new Tt(this.config,this.adapters),this.sdk.subscribe(t=>{var e;"requires_action"===(null==(e=this.previousState)?void 0:e.status)&&"requires_action"!==t.status&&this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()),this.previousState=t,this.currentState=t,this.dispatchEvent(new CustomEvent("state-change",{detail:{state:t},bubbles:!0,composed:!0}))}),this.sdk.on("payment_succeeded",t=>{this.dispatchEvent(new CustomEvent("payment-success",{detail:{paymentIntentId:t.payload.paymentIntent.id},bubbles:!0,composed:!0}))}),this.sdk.on("payment_failed",t=>{this.dispatchEvent(new CustomEvent("payment-error",{detail:{error:t.payload.error.message},bubbles:!0,composed:!0}))}),this.sdk.on("initialized",t=>{var e;if(this.paymentData=t.payload.paymentData,this.isInitializing=!1,null==(e=t.payload.paymentData)?void 0:e.sessionId){if(!document.getElementById("airwallex-fraud-api")){const e=document.createElement("script");e.src="https://static.airwallex.com/webapp/fraud/device-fingerprint/index.js",e.async=!0,e.setAttribute("data-order-session-id",t.payload.paymentData.sessionId),e.setAttribute("id","airwallex-fraud-api"),document.body.appendChild(e)}}}),this.sdk.on("payment_requires_action",t=>{this.nextActionUrl=t.payload.actionUrl,this.show3DSModal=!0,this.paymentLocked=!0,this.leaveEventsCounter=0}),this.sdk.on("poll_started",()=>{const t="undefined"!=typeof window&&"ReactNativeWebView"in window;this.show3DSModal&&t&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling())}),this.sdk.on("qr_code_received",async t=>{if(this.qrCode=t.payload.qrCode,!this.qrCode)return;const e=this.qrCode.startsWith("http://")||this.qrCode.startsWith("https://"),r=this.qrCode.startsWith("data:image");if(e||r)this.qrCodeDataUrl=this.qrCode;else try{const t=await Gt.toDataURL(this.qrCode,{width:300,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});this.qrCodeDataUrl=t}catch(i){this.qrCodeDataUrl=null}this.showQRModal=!0,this.paymentLocked=!0,this.qrAutoResumeTimer=window.setTimeout(()=>{this.handleQRScanned()},1e4)}),this.sdk.on("promptpay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("duitnow_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("gopay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("boost_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("shopeepay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("atom_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("dana_redirect",t=>{console.log("[WebComponent] dana_redirect event received:",t.payload);const{redirectUrl:e}=t.payload;e&&(console.log("[WebComponent] Redirecting to Dana URL:",e),window.location.href=e)}),this.sdk.on("tng_redirect",t=>{console.log("[WebComponent] tng_redirect event received:",t.payload);const{redirectUrl:e}=t.payload;e&&(console.log("[WebComponent] Redirecting to TnG URL:",e),window.location.href=e)}),this.sdk.on("alipaycn_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("alipayhk_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("gcash_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.initialize({amount:this.amount,currency:this.currency,orderId:this.orderId})):console.error("OnePayment: email is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: lastName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: firstName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: Missing required props. Ensure config, adapters, amount, currency, and orderId are provided.")}handleMethodSelect(t){this.paymentLocked||(this.selectedMethod=t)}handleQRScanned(){null!==this.qrAutoResumeTimer&&(clearTimeout(this.qrAutoResumeTimer),this.qrAutoResumeTimer=null),this.qrPollingInProgress=!0,this.sdk&&this.sdk.resumePolling()}handle3DSComplete(){this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()}handleInputChange(t,e){if(this.cardFormData={...this.cardFormData,[t]:e},this.formErrors[t]){const e={...this.formErrors};delete e[t],this.formErrors=e}}luhnCheck(t){const e=t.replace(/\s/g,"");if(!/^\d+$/.test(e))return!1;let r=0,i=!1;for(let n=e.length-1;n>=0;n--){const t=e.charAt(n);if(!t)continue;let s=parseInt(t,10);i&&(s*=2,s>9&&(s-=9)),r+=s,i=!i}return r%10==0}validateExpiry(t){const e=t.trim();if(!/^\d{1,2}\/\d{2}$/.test(e))return{valid:!1,error:"Invalid format (MM/YY)"};const r=e.split("/"),i=r[0],n=r[1];if(!i||!n)return{valid:!1,error:"Invalid format (MM/YY)"};const s=parseInt(i,10);if(s<1||s>12)return{valid:!1,error:"Invalid month (01-12)"};const o=new Date,a=o.getFullYear(),l=o.getMonth()+1;let d;if(2!==n.length)return{valid:!1,error:"Invalid year format"};{const t=parseInt(n,10),e=a%100,r=100*Math.floor(a/100);if(t<e){d=e-t>80?r+100+t:r+t}else d=r+t}return d<a||d===a&&s<l?{valid:!1,error:"Card has expired"}:{valid:!0}}validateCardForm(){const t={};if(this.cardFormData.cardNumber.trim()?this.luhnCheck(this.cardFormData.cardNumber)||(t.cardNumber="Invalid card number"):t.cardNumber="Please enter card number",this.cardFormData.expiry.trim()){const e=this.validateExpiry(this.cardFormData.expiry);e.valid||(t.expiry=e.error)}else t.expiry="Please enter expiry date";return this.cardFormData.cvv.trim()||(t.cvv="Please enter CVV"),this.cardFormData.cardholderName.trim()||(t.cardholderName="Please enter cardholder name"),this.formErrors=t,0===Object.keys(t).length}handleCardPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(!this.validateCardForm())return;this.paymentLocked=!0;const t=this.cardFormData.expiry.split("/"),e=(t[0]||"").trim(),r=`20${(t[1]||"").trim().substring(0,2)}`;this.sdk.submitPayment(ht,{cardNumber:this.cardFormData.cardNumber.replace(/\s/g,""),expiryMonth:e,expiryYear:r,cvv:this.cardFormData.cvv,firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber})}handlePayNowPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(pt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handlePromptPayPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(mt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleDuitNowPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(gt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleGoPayPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(ft,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleBoostPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(yt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleShopeePayPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(vt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleAtomPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(bt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleDanaPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(wt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleTngPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(xt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleAlipayCNPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(kt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleAlipayHKPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(St,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}handleGCashPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(Pt,{firstName:this.firstName,lastName:this.lastName,email:this.email,phoneNumber:this.phoneNumber}))}getPayButtonAmount(){const t=this.getTransactionData();return`${this.currency} ${t.netAmount.toFixed(2)}`}getTransactionData(){var t;const e=this.paymentData;if(!e)return{currency:this.currency,charge:this.amount,fees:0,feeBreakdown:{transactionFee:0,merchantFee:0,merchantFeeLabel:""},netAmount:this.amount};const r=null==(t=e.fees)?void 0:t.find(t=>"merchant"===t.owner),i="number"==typeof e.totalFee?e.totalFee:Number(e.totalFee)||0,n="number"==typeof e.totalSystemFee?e.totalSystemFee:Number(e.totalSystemFee)||0,s=null!=e.initialAmount?"number"==typeof e.initialAmount?e.initialAmount:Number(e.initialAmount)||0:this.amount,o=null!=e.customerAmount?"number"==typeof e.customerAmount?e.customerAmount:Number(e.customerAmount)||0:s,a=i-n;return{currency:e.currency||this.currency,charge:s,fees:i,feeBreakdown:{transactionFee:a,merchantFee:a,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:o}}renderTransactionDetailsSkeleton(){return H`
11
+ */var e;const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),a=new WeakMap;let o=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&a.set(e,t))}return t}toString(){return this.cssText}};const s=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:d,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:u,getOwnPropertySymbols:h,getPrototypeOf:p}=Object,m=globalThis,f=m.trustedTypes,$=f?f.emptyScript:"",g=m.reactiveElementPolyfillSupport,y=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(n){r=null}}return r}},b=(t,e)=>!d(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:b};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);let x=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&l(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:i}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const a=null==n?void 0:n.call(this);null==i||i.call(this,e),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const t=this.properties,e=[...u(t),...h(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const n of e){const e=document.createElement("style"),i=r.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){var r;const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const a=(void 0!==(null==(r=n.converter)?void 0:r.toAttribute)?n.converter:v).toAttribute(e,n.type);this._$Em=t,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(t,e){var r,n;const i=this.constructor,a=i._$Eh.get(t);if(void 0!==a&&this._$Em!==a){const t=i.getPropertyOptions(a),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(r=t.converter)?void 0:r.fromAttribute)?t.converter:v;this._$Em=a;const s=o.fromAttribute(e,t.type);this[a]=s??(null==(n=this._$Ej)?void 0:n.get(a))??s,this._$Em=null}}requestUpdate(t,e,r,n=!1,i){var a;if(void 0!==t){const o=this.constructor;if(!1===n&&(i=this[t]),r??(r=o.getPropertyOptions(t)),!((r.hasChanged??b)(i,e)||r.useDefault&&r.reflect&&i===(null==(a=this._$Ej)?void 0:a.get(t))&&!this.hasAttribute(o._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:i},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??e??this[t]),!0!==i||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[y("elementProperties")]=new Map,x[y("finalized")]=new Map,null==g||g({ReactiveElement:x}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.1.2");const P=globalThis,C=t=>t,k=P.trustedTypes,S=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,N="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+E,A=`<${I}>`,M=document,_=()=>M.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,D="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,L=/>/g,B=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,j=/"/g,H=/^(?:script|style|textarea|title)$/i,z=(Y=1,(t,...e)=>({_$litType$:Y,strings:t,values:e})),q=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),G=new WeakMap,K=M.createTreeWalker(M,129);var Y;function W(t,e){if(!O(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let i=0,a=0;const o=t.length-1,s=this.parts,[d,l]=((t,e)=>{const r=t.length-1,n=[];let i,a=2===e?"<svg>":3===e?"<math>":"",o=F;for(let s=0;s<r;s++){const e=t[s];let r,d,l=-1,c=0;for(;c<e.length&&(o.lastIndex=c,d=o.exec(e),null!==d);)c=o.lastIndex,o===F?"!--"===d[1]?o=R:void 0!==d[1]?o=L:void 0!==d[2]?(H.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=B):void 0!==d[3]&&(o=B):o===B?">"===d[0]?(o=i??F,l=-1):void 0===d[1]?l=-2:(l=o.lastIndex-d[2].length,r=d[1],o=void 0===d[3]?B:'"'===d[3]?j:U):o===j||o===U?o=B:o===R||o===L?o=F:(o=B,i=void 0);const u=o===B&&t[s+1].startsWith("/>")?" ":"";a+=o===F?e+A:l>=0?(n.push(r),e.slice(0,l)+N+e.slice(l)+E+u):e+E+(-2===l?s:u)}return[W(t,a+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]})(t,e);if(this.el=Q.createElement(d,r),K.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=K.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(N)){const e=l[a++],r=n.getAttribute(t).split(E),o=/([.?@])?(.*)/.exec(e);s.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?et:"?"===o[1]?rt:"@"===o[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(E)&&(s.push({type:6,index:i}),n.removeAttribute(t));if(H.test(n.tagName)){const t=n.textContent.split(E),e=t.length-1;if(e>0){n.textContent=k?k.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],_()),K.nextNode(),s.push({type:2,index:++i});n.append(t[e],_())}}}else if(8===n.nodeType)if(n.data===I)s.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(E,t+1));)s.push({type:7,index:i}),t+=E.length-1}i++}}static createElement(t,e){const r=M.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,n){var i,a;if(e===q)return e;let o=void 0!==n?null==(i=r._$Co)?void 0:i[n]:r._$Cl;const s=T(e)?void 0:e._$litDirective$;return(null==o?void 0:o.constructor)!==s&&(null==(a=null==o?void 0:o._$AO)||a.call(o,!1),void 0===s?o=void 0:(o=new s(t),o._$AT(t,r,n)),void 0!==n?(r._$Co??(r._$Co=[]))[n]=o:r._$Cl=o),void 0!==o&&(e=J(t,o._$AS(t,e.values),o,n)),e}class Z{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=((null==t?void 0:t.creationScope)??M).importNode(e,!0);K.currentNode=n;let i=K.nextNode(),a=0,o=0,s=r[0];for(;void 0!==s;){if(a===s.index){let e;2===s.type?e=new X(i,i.nextSibling,this,t):1===s.type?e=new s.ctor(i,s.name,s.strings,this,t):6===s.type&&(e=new it(i,this,t)),this._$AV.push(e),s=r[++o]}a!==(null==s?void 0:s.index)&&(i=K.nextNode(),a++)}return K.currentNode=M,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class X{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=(null==n?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),T(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==V&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){var e;const{values:r,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Q.createElement(W(n.h,n.h[0]),this.options)),n);if((null==(e=this._$AH)?void 0:e._$AD)===i)this._$AH.p(r);else{const t=new Z(i,this),e=t.u(this.options);t.p(r),this.T(e),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new Q(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const i of t)n===e.length?e.push(r=new X(this.O(_()),this.O(_()),this,this.options)):r=e[n],r._$AI(i),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var r;for(null==(r=this._$AP)||r.call(this,!1,!0,e);t!==this._$AB;){const e=C(t).nextSibling;C(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,i){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(t,e=this,r,n){const i=this.strings;let a=!1;if(void 0===i)t=J(this,t,e,0),a=!T(t)||t!==this._$AH&&t!==q,a&&(this._$AH=t);else{const n=t;let o,s;for(t=i[0],o=0;o<i.length-1;o++)s=J(this,n[r+o],e,o),s===q&&(s=this._$AH[o]),a||(a=!T(s)||s!==this._$AH[o]),s===V?t=V:t!==V&&(t+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!n&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==V)}}class nt extends tt{constructor(t,e,r,n,i){super(t,e,r,n,i),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??V)===q)return;const r=this._$AH,n=t===V&&r!==V||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==V&&(r===V||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class it{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const at=P.litHtmlPolyfillSupport;null==at||at(Q,X),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.3.2");const ot=globalThis;class st extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=(null==r?void 0:r.renderBefore)??e;let i=n._$litPart$;if(void 0===i){const t=(null==r?void 0:r.renderBefore)??null;n._$litPart$=i=new X(e.insertBefore(_(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return q}}st._$litElement$=!0,st.finalized=!0,null==(e=ot.litElementHydrateSupport)||e.call(ot,{LitElement:st});const dt=ot.litElementPolyfillSupport;null==dt||dt({LitElement:st}),(ot.litElementVersions??(ot.litElementVersions=[])).push("4.2.2");const lt={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:b},ct=(t=lt,e,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,i,t,!0,r)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];e.call(this,r),this.requestUpdate(n,i,t,!0,r)}}throw Error("Unsupported decorator location: "+n)};function ut(t){return(e,r)=>"object"==typeof r?ct(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}function ht(t){return ut({...t,state:!0,attribute:!1})}const pt="card",mt="paynow",ft="promptpay",$t="duitnow",gt="gopay",yt="boost",vt="shopeepay",bt="atom",wt="dana",xt="tng",Pt="alipaycn",Ct="alipayhk",kt="gcash",St="konbini",Nt="payeasy",Et="grabpay_sg",It="fpx",At="idle",Mt="initializing",_t="ready",Tt="processing",Ot="requires_action",Dt="succeeded",Ft="failed";class Rt{constructor(t,e,r,n,i={},a){this.isPolling=!1,this.attempts=0,this.startTime=0,this.pollTimeoutId=null,this.adapters=t,this.baseUrl=e,this.token=r,this.onStatusUpdate=n,this.onPollStart=a,this.config={interval:i.interval??3e3,maxAttempts:i.maxAttempts??60,timeout:i.timeout??18e4,ignore3DS:i.ignore3DS??!1,ignoreQR:i.ignoreQR??!1}}start(){this.isPolling||(this.isPolling=!0,this.attempts=0,this.startTime=this.adapters.timer.now(),this.scheduleNextPoll())}stop(){this.isPolling=!1,null!==this.pollTimeoutId&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}get active(){return this.isPolling}get attemptCount(){return this.attempts}scheduleNextPoll(){if(!this.isPolling)return;if(this.attempts>=this.config.maxAttempts)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_MAX_ATTEMPTS",message:`Maximum polling attempts (${this.config.maxAttempts}) exceeded`}});if(this.adapters.timer.now()-this.startTime>=this.config.timeout)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_TIMEOUT",message:`Polling timeout (${this.config.timeout}ms) exceeded`}});this.pollTimeoutId=setTimeout(()=>{this.poll()},this.config.interval)}async poll(){if(this.isPolling){this.attempts++,this.onPollStart&&this.onPollStart();try{const e=await this.adapters.http.get(`${this.baseUrl}/payment-intent/get-payment-data`,{"x-token":this.token}),r={status:(t=e.result.status,"paid"===t?"succeeded":t),paymentIntentId:e.result.paymentIntentId||"",...void 0!==e.result.amount&&{amount:e.result.amount},...void 0!==e.result.currency&&{currency:e.result.currency},...void 0!==e.result.metadata&&{metadata:e.result.metadata},...void 0!==e.result.nextActionUrl&&{nextActionUrl:e.result.nextActionUrl},...void 0!==e.result.qrCode&&{qrCode:e.result.qrCode}};if(e.result.nextActionUrl&&!this.config.ignore3DS)return this.stop(),void this.onStatusUpdate(r);if(e.result.qrCode&&!this.config.ignoreQR)return this.stop(),void this.onStatusUpdate(r);if("succeeded"===e.result.status||"failed"===e.result.status||"paid"===e.result.status)return this.stop(),void this.onStatusUpdate(r);this.scheduleNextPoll()}catch(e){const t={status:"processing",paymentIntentId:"",error:{code:"POLLING_ERROR",message:e instanceof Error?e.message:"Unknown polling error"}};this.onStatusUpdate(t),this.scheduleNextPoll()}var t}}}class Lt{constructor(t,e){this.state={status:At},this.subscribers=new Set,this.eventListeners={},this.paymentToken=null,this.paymentIntentId=null,this.pollingService=null,this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.config=t,this.adapters=e}getApiBaseUrl(){return this.config.apiBaseUrl??function(t){switch(t){case"prod":return"https://public.prod.one.ooo";case"demo":return"https://public.demo.one.ooo";default:return"https://public.dev.one.ooo"}}(this.config.environment)}getState(){return this.state}subscribe(t){return this.subscribers.add(t),t(this.state),()=>{this.subscribers.delete(t)}}on(t,e){this.eventListeners[t]||(this.eventListeners[t]=[]);const r=this.eventListeners[t];return r.push(e),()=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)}}async initialize(t){this.setState({status:Mt}),this.emit({type:"initialize",payload:t});try{const e={amount:t.amount,currency:t.currency,notes:t.notes,orderId:t.orderId},r=JSON.stringify(e),n=await this.adapters.crypto.hmacSHA256(this.config.secretKey,r),i=await this.adapters.http.post(`${this.getApiBaseUrl()}/payment-intent/create`,e,{"x-api-key":this.config.apiKey,"x-signature":n}),a=new URL(i.result.redirectUrl).searchParams.get("token");if(!a)throw new Error("No token found in redirectUrl");this.paymentToken=a,this.paymentIntentId=i.result.paymentIntentId;const o=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/get-payment-data`,{"x-token":this.paymentToken}),s=`${this.getApiBaseUrl()}/payment-intent/available-methods?currency=${t.currency}`;console.log("[SDK] Calling available-methods with URL:",s),console.log("[SDK] params.currency:",t.currency);const d=await this.adapters.http.get(s,{"x-token":this.paymentToken}),l={id:this.paymentIntentId,amount:o.result.customerAmount||t.amount,currency:o.result.currency||t.currency,status:_t,...t.metadata&&{metadata:t.metadata}},c=[];let u=0;return c.push({id:"card",enabled:!0,priority:u++}),d.result.paymentMethods.forEach(t=>{const e=t.type.toLowerCase(),r=t.capabilities||[];e.includes("card")||((e.includes("paynow")||r.includes("payments_pay_now"))&&c.push({id:"paynow",enabled:!0,priority:u++}),(e.includes("promptpay")||e.includes("prompt pay")||r.includes("payments_prompt_pay"))&&c.push({id:"promptpay",enabled:!0,priority:u++}),(e.includes("duitnow")||e.includes("duit now")||r.includes("payments_duit_now"))&&c.push({id:"duitnow",enabled:!0,priority:u++}),(e.includes("gopay")||e.includes("go pay")||r.includes("payments_go_pay"))&&c.push({id:"gopay",enabled:!0,priority:u++}),(e.includes("boost")||r.includes("payments_boost"))&&c.push({id:"boost",enabled:!0,priority:u++}),(e.includes("shopeepay")||e.includes("shopee pay")||e.includes("shopee_pay")||r.includes("payments_shopee_pay"))&&c.push({id:"shopeepay",enabled:!0,priority:u++}),(e.includes("atom")||e.includes("atome")||r.includes("payments_atome"))&&c.push({id:"atom",enabled:!0,priority:u++}),(e.includes("dana")||r.includes("payments_dana"))&&c.push({id:"dana",enabled:!0,priority:u++}),(e.includes("tng")||e.includes("touch")||r.includes("payments_tng"))&&c.push({id:"tng",enabled:!0,priority:u++}),(e.includes("alipaycn")||e.includes("alipay cn")||e.includes("alipay_cn")||r.includes("payments_alipaycn"))&&c.push({id:"alipaycn",enabled:!0,priority:u++}),(e.includes("alipayhk")||e.includes("alipay hk")||e.includes("alipay_hk")||r.includes("payments_alipayhk"))&&c.push({id:"alipayhk",enabled:!0,priority:u++}),(e.includes("gcash")||e.includes("g cash")||r.includes("payments_gcash"))&&c.push({id:"gcash",enabled:!0,priority:u++}),(e.includes("konbini")||r.includes("payments_konbini"))&&c.push({id:"konbini",enabled:!0,priority:u++}),(e.includes("payeasy")||e.includes("pay-easy")||e.includes("pay easy")||r.includes("payments_payeasy"))&&c.push({id:"payeasy",enabled:!0,priority:u++}),(e.includes("grabpay")||e.includes("grab pay")||r.includes("payments_grabpay_sg"))&&c.push({id:"grabpay_sg",enabled:!0,priority:u++}),(e.includes("fpx")||r.includes("payments_fpx"))&&c.push({id:"fpx",enabled:!0,priority:u++}))}),this.setState({status:_t,paymentIntent:l,availableMethods:c}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:o.result}}),l}catch(e){const t={code:"INITIALIZATION_FAILED",message:e instanceof Error?e.message:"Unknown error",timestamp:this.adapters.timer.now()};throw this.setState({status:Ft,error:t}),this.emit({type:"payment_failed",payload:{error:t}}),e}}async getBanks(t){if(!this.paymentToken)throw new Error("Cannot get banks: SDK not initialized");try{return(await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/banks?paymentMethodType=${encodeURIComponent(t)}`,{"x-token":this.paymentToken})).result.banks||[]}catch(e){return console.error("Error fetching banks:",e),[]}}async submitPayment(t,e){var r,n,i,a,o;const s=this.state;if("ready"!==s.status)throw new Error("Cannot submit payment: SDK not in ready state");if(!this.paymentToken)throw new Error("Cannot submit payment: No payment token available");this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.setState({status:Tt,paymentIntent:s.paymentIntent,selectedMethod:t,availableMethods:s.availableMethods}),this.emit({type:"payment_processing",payload:{paymentIntent:s.paymentIntent,methodId:t}});try{const r=t=>{switch(t){case"paynow":default:return"qr";case"promptpay":return"prompt_pay";case"duitnow":return"duit_now";case"gopay":return"go_pay";case"boost":return"boost";case"shopeepay":return"shopee_pay";case"atom":return"atome";case"dana":return"dana";case"tng":return"tng";case"alipaycn":return"alipaycn";case"alipayhk":return"alipayhk";case"gcash":return"gcash";case"konbini":return"konbini";case"payeasy":return"payeasy";case"grabpay_sg":return"grabpay_sg";case"fpx":return"fpx"}},n=(t,e)=>("konbini"===e||"payeasy"===e)&&t.startsWith("+81")?"0"+t.slice(3).replace(/\s/g,""):t,i=(t,e)=>{let r=t.toUpperCase(),n=e.toUpperCase();if(r.length+n.length>9){const t=Math.ceil(4.5);r=r.slice(0,t),n=n.slice(0,9-r.length)}return{firstName:r,lastName:n}};let a=String(e.firstName),o=String(e.lastName);if("payeasy"===t){const t=i(a,o);a=t.firstName,o=t.lastName}else a=a.toUpperCase(),o=o.toUpperCase();const d=e.bankName?String(e.bankName):void 0,l={firstName:a,lastName:o,email:String(e.email),phoneNumber:n(String(e.phoneNumber),t),paymentMethod:"card"===t?{type:"card",card:{number:String(e.cardNumber),expiryMonth:String(e.expiryMonth),expiryYear:String(e.expiryYear),cvc:String(e.cvv)}}:{type:r(t)},...d&&{bankName:d}};return await this.adapters.http.patch(`${this.getApiBaseUrl()}/payment-intent/confirm`,l,{"x-token":this.paymentToken}),this.startPolling(),{id:this.paymentIntentId||"",amount:s.paymentIntent.amount,currency:s.paymentIntent.currency,status:Tt}}catch(d){let t="Unknown error",e="PAYMENT_FAILED";if(d instanceof Error)try{if(function(t){return t instanceof Error&&("response"in t&&"object"==typeof t.response&&null!==t.response||"data"in t&&"object"==typeof t.data&&null!==t.data)}(d)){const s=null==(r=d.response)?void 0:r.data,l=d.data;s?(t=s.message||(null==(n=s.error)?void 0:n.message)||d.message,e=s.code||(null==(i=s.error)?void 0:i.code)||e):l?(t=l.message||(null==(a=l.error)?void 0:a.message)||d.message,e=l.code||(null==(o=l.error)?void 0:o.code)||e):t=d.message}else t=d.message}catch{t=d.message}const l={code:e,message:t,timestamp:this.adapters.timer.now()};throw this.setState({status:Ft,error:l,paymentIntent:s.paymentIntent}),this.emit({type:"payment_failed",payload:{error:l,paymentIntent:s.paymentIntent}}),d}}resumePolling(){this.paymentToken&&(this.ignore3DSInPolling=!0,this.ignoreQRInPolling=!0,this.startPolling())}destroy(){this.stopPolling(),this.subscribers.clear(),Object.keys(this.eventListeners).forEach(t=>{delete this.eventListeners[t]})}startPolling(){this.paymentToken&&(this.stopPolling(),this.pollingService=new Rt(this.adapters,this.getApiBaseUrl(),this.paymentToken,this.handlePollingUpdate.bind(this),{interval:4e3,maxAttempts:100,timeout:4e5,ignore3DS:this.ignore3DSInPolling,ignoreQR:this.ignoreQRInPolling},this.handlePollStart.bind(this)),this.pollingService.start())}stopPolling(){this.pollingService&&(this.pollingService.stop(),this.pollingService=null)}handlePollStart(){this.emit({type:"poll_started",payload:{}})}handlePollingUpdate(t){if(t.error)return;const e=this.state;if("processing"!==e.status&&"requires_action"!==e.status)return void this.stopPolling();const r="promptpay"===e.selectedMethod||"duitnow"===e.selectedMethod||"gopay"===e.selectedMethod||"boost"===e.selectedMethod||"shopeepay"===e.selectedMethod||"atom"===e.selectedMethod||"dana"===e.selectedMethod||"tng"===e.selectedMethod||"alipaycn"===e.selectedMethod||"alipayhk"===e.selectedMethod||"gcash"===e.selectedMethod||"konbini"===e.selectedMethod||"payeasy"===e.selectedMethod||"grabpay_sg"===e.selectedMethod||"fpx"===e.selectedMethod;if(t.qrCode&&!this.ignoreQRInPolling&&!r)return void this.emit({type:"qr_code_received",payload:{qrCode:t.qrCode,methodId:e.selectedMethod}});if(t.nextActionUrl&&!this.ignore3DSInPolling){if("promptpay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"promptpay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("duitnow"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"duitnow_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("gopay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"gopay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("boost"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"boost_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("shopeepay"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"shopeepay_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("atom"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"atom_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("dana"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"dana_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("tng"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"tng_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("alipaycn"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"alipaycn_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("alipayhk"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"alipayhk_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("gcash"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"gcash_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("konbini"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"konbini_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("payeasy"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"payeasy_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("grabpay_sg"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"grabpay_sg_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("fpx"===e.selectedMethod)return this.stopPolling(),void this.emit({type:"fpx_redirect",payload:{redirectUrl:t.nextActionUrl,methodId:e.selectedMethod}});if("paynow"===e.selectedMethod&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:t.nextActionUrl,methodId:e.selectedMethod}});const r={id:t.paymentIntentId,amount:t.amount??e.paymentIntent.amount,currency:t.currency??e.paymentIntent.currency,status:Ot,...t.metadata&&{metadata:t.metadata}};return this.setState({status:Ot,paymentIntent:r,actionUrl:t.nextActionUrl,selectedMethod:e.selectedMethod,availableMethods:e.availableMethods}),void this.emit({type:"payment_requires_action",payload:{paymentIntent:r,actionUrl:t.nextActionUrl,methodId:e.selectedMethod}})}const n={id:t.paymentIntentId,amount:t.amount??e.paymentIntent.amount,currency:t.currency??e.paymentIntent.currency,status:t.status,...t.metadata&&{metadata:t.metadata}};if("succeeded"===t.status)this.stopPolling(),this.setState({status:Dt,paymentIntent:n,selectedMethod:e.selectedMethod}),this.emit({type:"payment_succeeded",payload:{paymentIntent:n,methodId:e.selectedMethod}});else if("failed"===t.status){this.stopPolling();const e={code:"PAYMENT_FAILED",message:t.error&&"object"==typeof t.error&&null!==t.error&&"message"in t.error?String(t.error.message):"Payment failed",timestamp:this.adapters.timer.now()};this.setState({status:Ft,error:e,paymentIntent:n}),this.emit({type:"payment_failed",payload:{error:e,paymentIntent:n}})}}setState(t){const e=this.state.status;this.state=t,this.subscribers.forEach(t=>{t(this.state)}),e!==t.status&&this.emit({type:"state_changed",payload:{previousStatus:e,currentStatus:t.status}})}emit(t){const e=this.eventListeners[t.type];void 0!==e&&e.forEach(e=>{e(t)})}}var Bt="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ut=function(t,e,r,n,i,a,o,s,d,l){var c=this;c.numeralDecimalMark=t||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=n||Ut.groupStyle.thousand,c.numeralPositiveOnly=!!i,c.stripLeadingZeroes=!1!==a,c.prefix=o||""===o?o:"",c.signBeforePrefix=!!s,c.tailPrefix=!!d,c.delimiter=l||""===l?l:",",c.delimiterRE=l?new RegExp("\\"+l,"g"):""};Ut.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Ut.prototype={getRawValue:function(t){return t.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(t){var e,r,n,i,a=this,o="";switch(t=t.replace(/[A-Za-z]/g,"").replace(a.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",a.numeralPositiveOnly?"":"-").replace("M",a.numeralDecimalMark),a.stripLeadingZeroes&&(t=t.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===t.slice(0,1)?"-":"",n=void 0!==a.prefix?a.signBeforePrefix?r+a.prefix:a.prefix+r:r,i=t,t.indexOf(a.numeralDecimalMark)>=0&&(i=(e=t.split(a.numeralDecimalMark))[0],o=a.numeralDecimalMark+e[1].slice(0,a.numeralDecimalScale)),"-"===r&&(i=i.slice(1)),a.numeralIntegerScale>0&&(i=i.slice(0,a.numeralIntegerScale)),a.numeralThousandsGroupStyle){case Ut.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+a.delimiter);break;case Ut.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+a.delimiter);break;case Ut.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+a.delimiter)}return a.tailPrefix?r+i.toString()+(a.numeralDecimalScale>0?o.toString():"")+a.prefix:n+i.toString()+(a.numeralDecimalScale>0?o.toString():"")}};var jt=Ut,Ht=function(t,e,r){var n=this;n.date=[],n.blocks=[],n.datePattern=t,n.dateMin=e.split("-").reverse().map(function(t){return parseInt(t,10)}),2===n.dateMin.length&&n.dateMin.unshift(0),n.dateMax=r.split("-").reverse().map(function(t){return parseInt(t,10)}),2===n.dateMax.length&&n.dateMax.unshift(0),n.initBlocks()};Ht.prototype={initBlocks:function(){var t=this;t.datePattern.forEach(function(e){"Y"===e?t.blocks.push(4):t.blocks.push(2)})},getISOFormatDate:function(){var t=this,e=t.date;return e[2]?e[2]+"-"+t.addLeadingZero(e[1])+"-"+t.addLeadingZero(e[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(t){var e=this,r="";return t=t.replace(/[^\d]/g,""),e.blocks.forEach(function(n,i){if(t.length>0){var a=t.slice(0,n),o=a.slice(0,1),s=t.slice(n);switch(e.datePattern[i]){case"d":"00"===a?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":"00"===a?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,t=s}}),this.getFixedDateString(r)},getFixedDateString:function(t){var e,r,n,i=this,a=i.datePattern,o=[],s=0,d=0,l=0,c=0,u=0,h=0,p=!1;return 4===t.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(u=2-(c="d"===a[0]?0:2),e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),o=this.getFixedDate(e,r,0)),8===t.length&&(a.forEach(function(t,e){switch(t){case"d":s=e;break;case"m":d=e;break;default:l=e}}),h=2*l,c=s<=l?2*s:2*s+2,u=d<=l?2*d:2*d+2,e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),n=parseInt(t.slice(h,h+4),10),p=4===t.slice(h,h+4).length,o=this.getFixedDate(e,r,n)),4!==t.length||"y"!==a[0]&&"y"!==a[1]||(h=2-(u="m"===a[0]?0:2),r=parseInt(t.slice(u,u+2),10),n=parseInt(t.slice(h,h+2),10),p=2===t.slice(h,h+2).length,o=[0,r,n]),6!==t.length||"Y"!==a[0]&&"Y"!==a[1]||(h=2-.5*(u="m"===a[0]?0:4),r=parseInt(t.slice(u,u+2),10),n=parseInt(t.slice(h,h+4),10),p=4===t.slice(h,h+4).length,o=[0,r,n]),o=i.getRangeFixedDate(o),i.date=o,0===o.length?t:a.reduce(function(t,e){switch(e){case"d":return t+(0===o[0]?"":i.addLeadingZero(o[0]));case"m":return t+(0===o[1]?"":i.addLeadingZero(o[1]));case"y":return t+(p?i.addLeadingZeroForYear(o[2],!1):"");case"Y":return t+(p?i.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(t){var e=this,r=e.datePattern,n=e.dateMin||[],i=e.dateMax||[];return!t.length||n.length<3&&i.length<3||r.find(function(t){return"y"===t.toLowerCase()})&&0===t[2]?t:i.length&&(i[2]<t[2]||i[2]===t[2]&&(i[1]<t[1]||i[1]===t[1]&&i[0]<t[0]))?i:n.length&&(n[2]>t[2]||n[2]===t[2]&&(n[1]>t[1]||n[1]===t[1]&&n[0]>t[0]))?n:t},getFixedDate:function(t,e,r){return t=Math.min(t,31),e=Math.min(e,12),r=parseInt(r||0,10),(e<7&&e%2==0||e>8&&e%2==1)&&(t=Math.min(t,2===e?this.isLeapYear(r)?29:28:30)),[t,e,r]},isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},addLeadingZero:function(t){return(t<10?"0":"")+t},addLeadingZeroForYear:function(t,e){return e?(t<10?"000":t<100?"00":t<1e3?"0":"")+t:(t<10?"0":"")+t}};var zt=Ht,qt=function(t,e){var r=this;r.time=[],r.blocks=[],r.timePattern=t,r.timeFormat=e,r.initBlocks()};qt.prototype={initBlocks:function(){var t=this;t.timePattern.forEach(function(){t.blocks.push(2)})},getISOFormatTime:function(){var t=this,e=t.time;return e[2]?t.addLeadingZero(e[0])+":"+t.addLeadingZero(e[1])+":"+t.addLeadingZero(e[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(t){var e=this,r="";t=t.replace(/[^\d]/g,"");var n=e.getTimeFormatOptions();return e.blocks.forEach(function(i,a){if(t.length>0){var o=t.slice(0,i),s=o.slice(0,1),d=t.slice(i);switch(e.timePattern[a]){case"h":parseInt(s,10)>n.maxHourFirstDigit?o="0"+s:parseInt(o,10)>n.maxHours&&(o=n.maxHours+"");break;case"m":case"s":parseInt(s,10)>n.maxMinutesFirstDigit?o="0"+s:parseInt(o,10)>n.maxMinutes&&(o=n.maxMinutes+"")}r+=o,t=d}}),this.getFixedTimeString(r)},getFixedTimeString:function(t){var e,r,n,i=this,a=i.timePattern,o=[],s=0,d=0,l=0,c=0,u=0,h=0;return 6===t.length&&(a.forEach(function(t,e){switch(t){case"s":s=2*e;break;case"m":d=2*e;break;case"h":l=2*e}}),h=l,u=d,c=s,e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),n=parseInt(t.slice(h,h+2),10),o=this.getFixedTime(n,r,e)),4===t.length&&i.timePattern.indexOf("s")<0&&(a.forEach(function(t,e){switch(t){case"m":d=2*e;break;case"h":l=2*e}}),h=l,u=d,e=0,r=parseInt(t.slice(u,u+2),10),n=parseInt(t.slice(h,h+2),10),o=this.getFixedTime(n,r,e)),i.time=o,0===o.length?t:a.reduce(function(t,e){switch(e){case"s":return t+i.addLeadingZero(o[2]);case"m":return t+i.addLeadingZero(o[1]);case"h":return t+i.addLeadingZero(o[0])}},"")},getFixedTime:function(t,e,r){return r=Math.min(parseInt(r||0,10),60),e=Math.min(e,60),[t=Math.min(t,60),e,r]},addLeadingZero:function(t){return(t<10?"0":"")+t}};var Vt=qt,Gt=function(t,e){var r=this;r.delimiter=e||""===e?e:" ",r.delimiterRE=e?new RegExp("\\"+e,"g"):"",r.formatter=t};Gt.prototype={setFormatter:function(t){this.formatter=t},format:function(t){var e=this;e.formatter.clear();for(var r,n="",i=!1,a=0,o=(t=(t=(t=t.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(e.delimiterRE,"")).length;a<o;a++)r=e.formatter.inputDigit(t.charAt(a)),/[\s()-]/g.test(r)?(n=r,i=!0):i||(n=r);return n=(n=n.replace(/[()]/g,"")).replace(/[\s-]/g,e.delimiter)}};var Kt=Gt,Yt={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(t){var e=t.reduce(function(t,e){return t+e},0);return t.concat(19-e)},getInfo:function(t,e){var r=Yt.blocks,n=Yt.re;for(var i in e=!!e,n)if(n[i].test(t)){var a=r[i];return{type:i,blocks:e?this.getStrictBlocks(a):a}}return{type:"unknown",blocks:e?this.getStrictBlocks(r.general):r.general}}},Wt=Yt,Qt={noop:function(){},strip:function(t,e){return t.replace(e,"")},getPostDelimiter:function(t,e,r){if(0===r.length)return t.slice(-e.length)===e?e:"";var n="";return r.forEach(function(e){t.slice(-e.length)===e&&(n=e)}),n},getDelimiterREByDelimiter:function(t){return new RegExp(t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(t,e,r,n,i){return e.length===t?r.length:t+this.getPositionOffset(t,e,r,n,i)},getPositionOffset:function(t,e,r,n,i){var a,o,s;return a=this.stripDelimiters(e.slice(0,t),n,i),o=this.stripDelimiters(r.slice(0,t),n,i),0!==(s=a.length-o.length)?s/Math.abs(s):0},stripDelimiters:function(t,e,r){var n=this;if(0===r.length){var i=e?n.getDelimiterREByDelimiter(e):"";return t.replace(i,"")}return r.forEach(function(e){e.split("").forEach(function(e){t=t.replace(n.getDelimiterREByDelimiter(e),"")})}),t},headStr:function(t,e){return t.slice(0,e)},getMaxLength:function(t){return t.reduce(function(t,e){return t+e},0)},getPrefixStrippedValue:function(t,e,r,n,i,a,o,s,d){if(0===r)return t;if(t===e&&""!==t)return"";if(d&&"-"==t.slice(0,1)){var l="-"==n.slice(0,1)?n.slice(1):n;return"-"+this.getPrefixStrippedValue(t.slice(1),e,r,l,i,a,o,s,d)}if(n.slice(0,r)!==e&&!s)return o&&!n&&t?t:"";if(n.slice(-r)!==e&&s)return o&&!n&&t?t:"";var c=this.stripDelimiters(n,i,a);return t.slice(0,r)===e||s?t.slice(-r)!==e&&s?c.slice(0,-r-1):s?t.slice(0,-r):t.slice(r):c.slice(r)},getFirstDiffIndex:function(t,e){for(var r=0;t.charAt(r)===e.charAt(r);)if(""===t.charAt(r++))return-1;return r},getFormattedValue:function(t,e,r,n,i,a){var o="",s=i.length>0,d="";return 0===r?t:(e.forEach(function(e,l){if(t.length>0){var c=t.slice(0,e),u=t.slice(e);d=s?i[a?l-1:l]||d:n,a?(l>0&&(o+=d),o+=c):(o+=c,c.length===e&&l<r-1&&(o+=d)),t=u}}),o)},fixPrefixCursor:function(t,e,r,n){if(t){var i=t.value,a=r||n[0]||" ";if(t.setSelectionRange&&e&&!(e.length+a.length<=i.length)){var o=2*i.length;setTimeout(function(){t.setSelectionRange(o,o)},1)}}},checkFullSelection:function(t){try{return(window.getSelection()||document.getSelection()||{}).toString().length===t.length}catch(e){}return!1},setSelection:function(t,e,r){if(t===this.getActiveElement(r)&&!(t&&t.value.length<=e))if(t.createTextRange){var n=t.createTextRange();n.move("character",e),n.select()}else try{t.setSelectionRange(e,e)}catch(i){console.warn("The input element type does not support selection")}},getActiveElement:function(t){var e=t.activeElement;return e&&e.shadowRoot?this.getActiveElement(e.shadowRoot):e},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(t,e){return!!(this.isAndroid()&&t&&e)&&e===t.slice(0,-1)}},Jt={assign:function(t,e){return e=e||{},(t=t||{}).creditCard=!!e.creditCard,t.creditCardStrictMode=!!e.creditCardStrictMode,t.creditCardType="",t.onCreditCardTypeChanged=e.onCreditCardTypeChanged||function(){},t.phone=!!e.phone,t.phoneRegionCode=e.phoneRegionCode||"AU",t.phoneFormatter={},t.time=!!e.time,t.timePattern=e.timePattern||["h","m","s"],t.timeFormat=e.timeFormat||"24",t.timeFormatter={},t.date=!!e.date,t.datePattern=e.datePattern||["d","m","Y"],t.dateMin=e.dateMin||"",t.dateMax=e.dateMax||"",t.dateFormatter={},t.numeral=!!e.numeral,t.numeralIntegerScale=e.numeralIntegerScale>0?e.numeralIntegerScale:0,t.numeralDecimalScale=e.numeralDecimalScale>=0?e.numeralDecimalScale:2,t.numeralDecimalMark=e.numeralDecimalMark||".",t.numeralThousandsGroupStyle=e.numeralThousandsGroupStyle||"thousand",t.numeralPositiveOnly=!!e.numeralPositiveOnly,t.stripLeadingZeroes=!1!==e.stripLeadingZeroes,t.signBeforePrefix=!!e.signBeforePrefix,t.tailPrefix=!!e.tailPrefix,t.swapHiddenInput=!!e.swapHiddenInput,t.numericOnly=t.creditCard||t.date||!!e.numericOnly,t.uppercase=!!e.uppercase,t.lowercase=!!e.lowercase,t.prefix=t.creditCard||t.date?"":e.prefix||"",t.noImmediatePrefix=!!e.noImmediatePrefix,t.prefixLength=t.prefix.length,t.rawValueTrimPrefix=!!e.rawValueTrimPrefix,t.copyDelimiter=!!e.copyDelimiter,t.initValue=void 0!==e.initValue&&null!==e.initValue?e.initValue.toString():"",t.delimiter=e.delimiter||""===e.delimiter?e.delimiter:e.date?"/":e.time?":":e.numeral?",":(e.phone," "),t.delimiterLength=t.delimiter.length,t.delimiterLazyShow=!!e.delimiterLazyShow,t.delimiters=e.delimiters||[],t.blocks=e.blocks||[],t.blocksLength=t.blocks.length,t.root="object"==typeof Bt&&Bt?Bt:window,t.document=e.document||t.root.document,t.maxLength=0,t.backspace=!1,t.result="",t.onValueChanged=e.onValueChanged||function(){},t}},Zt=function(t,e){var r=this,n=!1;if("string"==typeof t?(r.element=document.querySelector(t),n=document.querySelectorAll(t).length>1):void 0!==t.length&&t.length>0?(r.element=t[0],n=t.length>1):r.element=t,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(i){}e.initValue=r.element.value,r.properties=Zt.DefaultProperties.assign({},e),r.init()};Zt.prototype={init:function(){var t=this,e=t.properties;e.numeral||e.phone||e.creditCard||e.time||e.date||0!==e.blocksLength||e.prefix?(e.maxLength=Zt.Util.getMaxLength(e.blocks),t.isAndroid=Zt.Util.isAndroid(),t.lastInputValue="",t.isBackward="",t.onChangeListener=t.onChange.bind(t),t.onKeyDownListener=t.onKeyDown.bind(t),t.onFocusListener=t.onFocus.bind(t),t.onCutListener=t.onCut.bind(t),t.onCopyListener=t.onCopy.bind(t),t.initSwapHiddenInput(),t.element.addEventListener("input",t.onChangeListener),t.element.addEventListener("keydown",t.onKeyDownListener),t.element.addEventListener("focus",t.onFocusListener),t.element.addEventListener("cut",t.onCutListener),t.element.addEventListener("copy",t.onCopyListener),t.initPhoneFormatter(),t.initDateFormatter(),t.initTimeFormatter(),t.initNumeralFormatter(),(e.initValue||e.prefix&&!e.noImmediatePrefix)&&t.onInput(e.initValue)):t.onInput(e.initValue)},initSwapHiddenInput:function(){var t=this;if(t.properties.swapHiddenInput){var e=t.element.cloneNode(!0);t.element.parentNode.insertBefore(e,t.element),t.elementSwapHidden=t.element,t.elementSwapHidden.type="hidden",t.element=e,t.element.id=""}},initNumeralFormatter:function(){var t=this.properties;t.numeral&&(t.numeralFormatter=new Zt.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.prefix,t.signBeforePrefix,t.tailPrefix,t.delimiter))},initTimeFormatter:function(){var t=this.properties;t.time&&(t.timeFormatter=new Zt.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=Zt.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new Zt.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=Zt.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new Zt.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(e){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(t){var e=this,r=t.which||t.keyCode;e.lastInputValue=e.element.value,e.isBackward=8===r},onChange:function(t){var e=this,r=e.properties,n=Zt.Util;e.isBackward=e.isBackward||"deleteContentBackward"===t.inputType;var i=n.getPostDelimiter(e.lastInputValue,r.delimiter,r.delimiters);e.isBackward&&i?r.postDelimiterBackspace=i:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var t=this,e=t.properties;t.lastInputValue=t.element.value,e.prefix&&e.noImmediatePrefix&&!t.element.value&&this.onInput(e.prefix),Zt.Util.fixPrefixCursor(t.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(t){Zt.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(t),this.onInput(""))},onCopy:function(t){Zt.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(t)},copyClipboardData:function(t){var e=this.properties,r=Zt.Util,n=this.element.value,i="";i=e.copyDelimiter?n:r.stripDelimiters(n,e.delimiter,e.delimiters);try{t.clipboardData?t.clipboardData.setData("Text",i):window.clipboardData.setData("Text",i),t.preventDefault()}catch(a){}},onInput:function(t){var e=this,r=e.properties,n=Zt.Util,i=n.getPostDelimiter(t,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||i||(t=n.headStr(t,t.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!t.length?r.result=r.phoneFormatter.format(t):r.result=r.prefix+r.phoneFormatter.format(t).slice(r.prefix.length),void e.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&0===t.length?r.result="":r.result=r.numeralFormatter.format(t),void e.updateValueState()):(r.date&&(t=r.dateFormatter.getValidatedDate(t)),r.time&&(t=r.timeFormatter.getValidatedTime(t)),t=n.stripDelimiters(t,r.delimiter,r.delimiters),t=n.getPrefixStrippedValue(t,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),t=r.numericOnly?n.strip(t,/[^\d]/g):t,t=r.uppercase?t.toUpperCase():t,t=r.lowercase?t.toLowerCase():t,r.prefix&&(r.tailPrefix?t+=r.prefix:t=r.prefix+t,0===r.blocksLength)?(r.result=t,void e.updateValueState()):(r.creditCard&&e.updateCreditCardPropsByValue(t),t=n.headStr(t,r.maxLength),r.result=n.getFormattedValue(t,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void e.updateValueState()))},updateCreditCardPropsByValue:function(t){var e,r=this.properties,n=Zt.Util;n.headStr(r.result,4)!==n.headStr(t,4)&&(e=Zt.CreditCardDetector.getInfo(t,r.creditCardStrictMode),r.blocks=e.blocks,r.blocksLength=r.blocks.length,r.maxLength=n.getMaxLength(r.blocks),r.creditCardType!==e.type&&(r.creditCardType=e.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var t=this,e=Zt.Util,r=t.properties;if(t.element){var n=t.element.selectionEnd,i=t.element.value,a=r.result;n=e.getNextCursorPosition(n,i,a,r.delimiter,r.delimiters),t.isAndroid?window.setTimeout(function(){t.element.value=a,e.setSelection(t.element,n,r.document,!1),t.callOnValueChanged()},1):(t.element.value=a,r.swapHiddenInput&&(t.elementSwapHidden.value=t.getRawValue()),e.setSelection(t.element,n,r.document,!1),t.callOnValueChanged())}},callOnValueChanged:function(){var t=this,e=t.properties;e.onValueChanged.call(t,{target:{name:t.element.name,value:e.result,rawValue:t.getRawValue()}})},setPhoneRegionCode:function(t){var e=this;e.properties.phoneRegionCode=t,e.initPhoneFormatter(),e.onChange()},setRawValue:function(t){var e=this,r=e.properties;t=null!=t?t.toString():"",r.numeral&&(t=t.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,e.element.value=t,e.onInput(t)},getRawValue:function(){var t=this.properties,e=Zt.Util,r=this.element.value;return t.rawValueTrimPrefix&&(r=e.getPrefixStrippedValue(r,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix)),r=t.numeral?t.numeralFormatter.getRawValue(r):e.stripDelimiters(r,t.delimiter,t.delimiters)},getISOFormatDate:function(){var t=this.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var t=this.properties;return t.time?t.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var t=this;t.element.removeEventListener("input",t.onChangeListener),t.element.removeEventListener("keydown",t.onKeyDownListener),t.element.removeEventListener("focus",t.onFocusListener),t.element.removeEventListener("cut",t.onCutListener),t.element.removeEventListener("copy",t.onCopyListener)},toString:function(){return"[Cleave Object]"}},Zt.NumeralFormatter=jt,Zt.DateFormatter=zt,Zt.TimeFormatter=Vt,Zt.PhoneFormatter=Kt,Zt.CreditCardDetector=Wt,Zt.Util=Qt,Zt.DefaultProperties=Jt,("object"==typeof Bt&&Bt?Bt:window).Cleave=Zt;var Xt=Zt,te={},ee={},re={};let ne;const ie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];re.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},re.getSymbolTotalCodewords=function(t){return ie[t]},re.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},re.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');ne=t},re.isKanjiModeEnabled=function(){return void 0!==ne},re.toSJIS=function(t){return ne(t)};var ae,oe={};function se(){this.buffer=[],this.length=0}(ae=oe).L={bit:1},ae.M={bit:0},ae.Q={bit:3},ae.H={bit:2},ae.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},ae.from=function(t,e){if(ae.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return ae.L;case"m":case"medium":return ae.M;case"q":case"quartile":return ae.Q;case"h":case"high":return ae.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(r){return e}},se.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var de=se;function le(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}le.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},le.prototype.get=function(t,e){return this.data[t*this.size+e]},le.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},le.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var ce=le,ue={};!function(t){const e=re.getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,n=e(t),i=145===n?26:2*Math.ceil((n-13)/(2*r-2)),a=[n-7];for(let e=1;e<r-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},t.getPositions=function(e){const r=[],n=t.getRowColCoords(e),i=n.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||r.push([n[t],n[e]]);return r}}(ue);var he={};const pe=re.getSymbolSize;he.getPositions=function(t){const e=pe(t);return[[0,0],[e-7,0],[0,e-7]]};var me={};!function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,r=3,n=40,i=10;function a(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const r=t.size;let n=0,i=0,a=0,o=null,s=null;for(let d=0;d<r;d++){i=a=0,o=s=null;for(let l=0;l<r;l++){let r=t.get(d,l);r===o?i++:(i>=5&&(n+=e+(i-5)),o=r,i=1),r=t.get(l,d),r===s?a++:(a>=5&&(n+=e+(a-5)),s=r,a=1)}i>=5&&(n+=e+(i-5)),a>=5&&(n+=e+(a-5))}return n},t.getPenaltyN2=function(t){const e=t.size;let n=0;for(let r=0;r<e-1;r++)for(let i=0;i<e-1;i++){const e=t.get(r,i)+t.get(r,i+1)+t.get(r+1,i)+t.get(r+1,i+1);4!==e&&0!==e||n++}return n*r},t.getPenaltyN3=function(t){const e=t.size;let r=0,i=0,a=0;for(let n=0;n<e;n++){i=a=0;for(let o=0;o<e;o++)i=i<<1&2047|t.get(n,o),o>=10&&(1488===i||93===i)&&r++,a=a<<1&2047|t.get(o,n),o>=10&&(1488===a||93===a)&&r++}return r*n},t.getPenaltyN4=function(t){let e=0;const r=t.data.length;for(let n=0;n<r;n++)e+=t.data[n];return Math.abs(Math.ceil(100*e/r/5)-10)*i},t.applyMask=function(t,e){const r=e.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)e.isReserved(i,n)||e.xor(i,n,a(t,i,n))},t.getBestMask=function(e,r){const n=Object.keys(t.Patterns).length;let i=0,a=1/0;for(let o=0;o<n;o++){r(o),t.applyMask(o,e);const n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(o,e),n<a&&(a=n,i=o)}return i}}(me);var fe={};const $e=oe,ge=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ye=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];fe.getBlocksCount=function(t,e){switch(e){case $e.L:return ge[4*(t-1)+0];case $e.M:return ge[4*(t-1)+1];case $e.Q:return ge[4*(t-1)+2];case $e.H:return ge[4*(t-1)+3];default:return}},fe.getTotalCodewordsCount=function(t,e){switch(e){case $e.L:return ye[4*(t-1)+0];case $e.M:return ye[4*(t-1)+1];case $e.Q:return ye[4*(t-1)+2];case $e.H:return ye[4*(t-1)+3];default:return}};var ve={},be={};const we=new Uint8Array(512),xe=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)we[e]=t,xe[t]=e,t<<=1,256&t&&(t^=285);for(let e=255;e<512;e++)we[e]=we[e-255]}(),be.log=function(t){if(t<1)throw new Error("log("+t+")");return xe[t]},be.exp=function(t){return we[t]},be.mul=function(t,e){return 0===t||0===e?0:we[xe[t]+xe[e]]},function(t){const e=be;t.mul=function(t,r){const n=new Uint8Array(t.length+r.length-1);for(let i=0;i<t.length;i++)for(let a=0;a<r.length;a++)n[i+a]^=e.mul(t[i],r[a]);return n},t.mod=function(t,r){let n=new Uint8Array(t);for(;n.length-r.length>=0;){const t=n[0];for(let a=0;a<r.length;a++)n[a]^=e.mul(r[a],t);let i=0;for(;i<n.length&&0===n[i];)i++;n=n.slice(i)}return n},t.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let i=0;i<r;i++)n=t.mul(n,new Uint8Array([1,e.exp(i)]));return n}}(ve);const Pe=ve;function Ce(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Ce.prototype.initialize=function(t){this.degree=t,this.genPoly=Pe.generateECPolynomial(this.degree)},Ce.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const r=Pe.mod(e,this.genPoly),n=this.degree-r.length;if(n>0){const t=new Uint8Array(this.degree);return t.set(r,n),t}return r};var ke=Ce,Se={},Ne={},Ee={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},Ie={};const Ae="[0-9]+";let Me="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Me=Me.replace(/u/g,"\\u");const _e="(?:(?![A-Z0-9 $%*+\\-./:]|"+Me+")(?:.|[\r\n]))+";Ie.KANJI=new RegExp(Me,"g"),Ie.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ie.BYTE=new RegExp(_e,"g"),Ie.NUMERIC=new RegExp(Ae,"g"),Ie.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Te=new RegExp("^"+Me+"$"),Oe=new RegExp("^"+Ae+"$"),De=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ie.testKanji=function(t){return Te.test(t)},Ie.testNumeric=function(t){return Oe.test(t)},Ie.testAlphanumeric=function(t){return De.test(t)},function(t){const e=Ee,r=Ie;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return r.testNumeric(e)?t.NUMERIC:r.testAlphanumeric(e)?t.ALPHANUMERIC:r.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(n){return r}}}(Ne),function(t){const e=re,r=fe,n=oe,i=Ne,a=Ee,o=e.getBCHDigit(7973);function s(t,e){return i.getCharCountIndicator(t,e)+4}function d(t,e){let r=0;return t.forEach(function(t){const n=s(t.mode,e);r+=n+t.getBitsLength()}),r}t.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,n,o){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===o&&(o=i.BYTE);const d=8*(e.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,n));if(o===i.MIXED)return d;const l=d-s(o,t);switch(o){case i.NUMERIC:return Math.floor(l/10*3);case i.ALPHANUMERIC:return Math.floor(l/11*2);case i.KANJI:return Math.floor(l/13);case i.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,r){let a;const o=n.from(r,n.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(d(e,n)<=t.getCapacity(n,r,i.MIXED))return n}(e,o);if(0===e.length)return 1;a=e[0]}else a=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(a.mode,a.getLength(),o)},t.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;e.getBCHDigit(r)-o>=0;)r^=7973<<e.getBCHDigit(r)-o;return t<<12|r}}(Se);var Fe={};const Re=re,Le=Re.getBCHDigit(1335);Fe.getEncodedBits=function(t,e){const r=t.bit<<3|e;let n=r<<10;for(;Re.getBCHDigit(n)-Le>=0;)n^=1335<<Re.getBCHDigit(n)-Le;return 21522^(r<<10|n)};var Be={};const Ue=Ne;function je(t){this.mode=Ue.NUMERIC,this.data=t.toString()}je.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},je.prototype.getLength=function(){return this.data.length},je.prototype.getBitsLength=function(){return je.getBitsLength(this.data.length)},je.prototype.write=function(t){let e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);const i=this.data.length-e;i>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*i+1))};var He=je;const ze=Ne,qe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ve(t){this.mode=ze.ALPHANUMERIC,this.data=t}Ve.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},Ve.prototype.getLength=function(){return this.data.length},Ve.prototype.getBitsLength=function(){return Ve.getBitsLength(this.data.length)},Ve.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*qe.indexOf(this.data[e]);r+=qe.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(qe.indexOf(this.data[e]),6)};var Ge=Ve;const Ke=Ne;function Ye(t){this.mode=Ke.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}Ye.getBitsLength=function(t){return 8*t},Ye.prototype.getLength=function(){return this.data.length},Ye.prototype.getBitsLength=function(){return Ye.getBitsLength(this.data.length)},Ye.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var We=Ye;const Qe=Ne,Je=re;function Ze(t){this.mode=Qe.KANJI,this.data=t}Ze.getBitsLength=function(t){return 13*t},Ze.prototype.getLength=function(){return this.data.length},Ze.prototype.getBitsLength=function(){return Ze.getBitsLength(this.data.length)},Ze.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=Je.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}};var Xe,tr=Ze,er={exports:{}};Xe={single_source_shortest_paths:function(t,e,r){var n={},i={};i[e]=0;var a,o,s,d,l,c,u,h=Xe.PriorityQueue.make();for(h.push(e,0);!h.empty();)for(s in o=(a=h.pop()).value,d=a.cost,l=t[o]||{})l.hasOwnProperty(s)&&(c=d+l[s],u=i[s],(void 0===i[s]||u>c)&&(i[s]=c,h.push(s,c),n[s]=o));if(void 0!==r&&void 0===i[r]){var p=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(p)}return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var n=Xe.single_source_shortest_paths(t,e,r);return Xe.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e,r=Xe.PriorityQueue,n={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(n[e]=r[e]);return n.queue=[],n.sorter=t.sorter||r.default_sorter,n},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}},er.exports=Xe;var rr=er.exports;!function(t){const e=Ne,r=He,n=Ge,i=We,a=tr,o=Ie,s=re,d=rr;function l(t){return unescape(encodeURIComponent(t)).length}function c(t,e,r){const n=[];let i;for(;null!==(i=t.exec(r));)n.push({data:i[0],index:i.index,mode:e,length:i[0].length});return n}function u(t){const r=c(o.NUMERIC,e.NUMERIC,t),n=c(o.ALPHANUMERIC,e.ALPHANUMERIC,t);let i,a;s.isKanjiModeEnabled()?(i=c(o.BYTE,e.BYTE,t),a=c(o.KANJI,e.KANJI,t)):(i=c(o.BYTE_KANJI,e.BYTE,t),a=[]);return r.concat(n,i,a).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function h(t,o){switch(o){case e.NUMERIC:return r.getBitsLength(t);case e.ALPHANUMERIC:return n.getBitsLength(t);case e.KANJI:return a.getBitsLength(t);case e.BYTE:return i.getBitsLength(t)}}function p(t,o){let d;const l=e.getBestModeForData(t);if(d=e.from(o,l),d!==e.BYTE&&d.bit<l.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(d)+".\n Suggested mode is: "+e.toString(l));switch(d!==e.KANJI||s.isKanjiModeEnabled()||(d=e.BYTE),d){case e.NUMERIC:return new r(t);case e.ALPHANUMERIC:return new n(t);case e.KANJI:return new a(t);case e.BYTE:return new i(t)}}t.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(p(e,null)):e.data&&t.push(p(e.data,e.mode)),t},[])},t.fromString=function(r,n){const i=function(t){const r=[];for(let n=0;n<t.length;n++){const i=t[n];switch(i.mode){case e.NUMERIC:r.push([i,{data:i.data,mode:e.ALPHANUMERIC,length:i.length},{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.ALPHANUMERIC:r.push([i,{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.KANJI:r.push([i,{data:i.data,mode:e.BYTE,length:l(i.data)}]);break;case e.BYTE:r.push([{data:i.data,mode:e.BYTE,length:l(i.data)}])}}return r}(u(r,s.isKanjiModeEnabled())),a=function(t,r){const n={},i={start:{}};let a=["start"];for(let o=0;o<t.length;o++){const s=t[o],d=[];for(let t=0;t<s.length;t++){const l=s[t],c=""+o+t;d.push(c),n[c]={node:l,lastCount:0},i[c]={};for(let t=0;t<a.length;t++){const o=a[t];n[o]&&n[o].node.mode===l.mode?(i[o][c]=h(n[o].lastCount+l.length,l.mode)-h(n[o].lastCount,l.mode),n[o].lastCount+=l.length):(n[o]&&(n[o].lastCount=l.length),i[o][c]=h(l.length,l.mode)+4+e.getCharCountIndicator(l.mode,r))}}a=d}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:n}}(i,n),o=d.find_path(a.map,"start","end"),c=[];for(let t=1;t<o.length-1;t++)c.push(a.table[o[t]].node);return t.fromArray(function(t){return t.reduce(function(t,e){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(c))},t.rawSplit=function(e){return t.fromArray(u(e,s.isKanjiModeEnabled()))}}(Be);const nr=re,ir=oe,ar=de,or=ce,sr=ue,dr=he,lr=me,cr=fe,ur=ke,hr=Se,pr=Fe,mr=Ne,fr=Be;function $r(t,e,r){const n=t.size,i=pr.getEncodedBits(e,r);let a,o;for(a=0;a<15;a++)o=1==(i>>a&1),a<6?t.set(a,8,o,!0):a<8?t.set(a+1,8,o,!0):t.set(n-15+a,8,o,!0),a<8?t.set(8,n-a-1,o,!0):a<9?t.set(8,15-a-1+1,o,!0):t.set(8,15-a-1,o,!0);t.set(n-8,8,1,!0)}function gr(t,e,r){const n=new ar;r.forEach(function(e){n.put(e.mode.bit,4),n.put(e.getLength(),mr.getCharCountIndicator(e.mode,t)),e.write(n)});const i=8*(nr.getSymbolTotalCodewords(t)-cr.getTotalCodewordsCount(t,e));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const a=(i-n.getLengthInBits())/8;for(let o=0;o<a;o++)n.put(o%2?17:236,8);return function(t,e,r){const n=nr.getSymbolTotalCodewords(e),i=cr.getTotalCodewordsCount(e,r),a=n-i,o=cr.getBlocksCount(e,r),s=n%o,d=o-s,l=Math.floor(n/o),c=Math.floor(a/o),u=c+1,h=l-c,p=new ur(h);let m=0;const f=new Array(o),$=new Array(o);let g=0;const y=new Uint8Array(t.buffer);for(let P=0;P<o;P++){const t=P<d?c:u;f[P]=y.slice(m,m+t),$[P]=p.encode(f[P]),m+=t,g=Math.max(g,t)}const v=new Uint8Array(n);let b,w,x=0;for(b=0;b<g;b++)for(w=0;w<o;w++)b<f[w].length&&(v[x++]=f[w][b]);for(b=0;b<h;b++)for(w=0;w<o;w++)v[x++]=$[w][b];return v}(n,t,e)}function yr(t,e,r,n){let i;if(Array.isArray(t))i=fr.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let n=e;if(!n){const e=fr.rawSplit(t);n=hr.getBestVersionForData(e,r)}i=fr.fromString(t,n||40)}}const a=hr.getBestVersionForData(i,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<a)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else e=a;const o=gr(e,r,i),s=nr.getSymbolSize(e),d=new or(s);return function(t,e){const r=t.size,n=dr.getPositions(e);for(let i=0;i<n.length;i++){const e=n[i][0],a=n[i][1];for(let n=-1;n<=7;n++)if(!(e+n<=-1||r<=e+n))for(let i=-1;i<=7;i++)a+i<=-1||r<=a+i||(n>=0&&n<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===n||6===n)||n>=2&&n<=4&&i>=2&&i<=4?t.set(e+n,a+i,!0,!0):t.set(e+n,a+i,!1,!0))}}(d,e),function(t){const e=t.size;for(let r=8;r<e-8;r++){const e=r%2==0;t.set(r,6,e,!0),t.set(6,r,e,!0)}}(d),function(t,e){const r=sr.getPositions(e);for(let n=0;n<r.length;n++){const e=r[n][0],i=r[n][1];for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)-2===r||2===r||-2===n||2===n||0===r&&0===n?t.set(e+r,i+n,!0,!0):t.set(e+r,i+n,!1,!0)}}(d,e),$r(d,r,0),e>=7&&function(t,e){const r=t.size,n=hr.getEncodedBits(e);let i,a,o;for(let s=0;s<18;s++)i=Math.floor(s/3),a=s%3+r-8-3,o=1==(n>>s&1),t.set(i,a,o,!0),t.set(a,i,o,!0)}(d,e),function(t,e){const r=t.size;let n=-1,i=r-1,a=7,o=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!t.isReserved(i,s-r)){let n=!1;o<e.length&&(n=1==(e[o]>>>a&1)),t.set(i,s-r,n),a--,-1===a&&(o++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(d,o),isNaN(n)&&(n=lr.getBestMask(d,$r.bind(null,d,r))),lr.applyMask(n,d),$r(d,r,n),{modules:d,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}ee.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let r,n,i=ir.M;return void 0!==e&&(i=ir.from(e.errorCorrectionLevel,ir.M),r=hr.from(e.version),n=lr.from(e.maskPattern),e.toSJISFunc&&nr.setToSJISFunction(e.toSJISFunc)),yr(t,r,i,n)};var vr={},br={};!function(t){function e(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");const r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const i=r.modules.size,a=r.modules.data,o=t.getScale(i,n),s=Math.floor((i+2*n.margin)*o),d=n.margin*o,l=[n.color.light,n.color.dark];for(let t=0;t<s;t++)for(let r=0;r<s;r++){let c=4*(t*s+r),u=n.color.light;if(t>=d&&r>=d&&t<s-d&&r<s-d){u=l[a[Math.floor((t-d)/o)*i+Math.floor((r-d)/o)]?1:0]}e[c++]=u.r,e[c++]=u.g,e[c++]=u.b,e[c]=u.a}}}(br),function(t){const e=br;t.render=function(t,r,n){let i=n,a=r;void 0!==i||r&&r.getContext||(i=r,r=void 0),r||(a=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=e.getOptions(i);const o=e.getImageWidth(t.modules.size,i),s=a.getContext("2d"),d=s.createImageData(o,o);return e.qrToImageData(d.data,t,i),function(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px"}(s,a,o),s.putImageData(d,0,0),a},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const a=t.render(e,r,i),o=i.type||"image/png",s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}}(vr);var wr={};const xr=br;function Pr(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Cr(t,e,r){let n=t+e;return void 0!==r&&(n+=" "+r),n}wr.render=function(t,e,r){const n=xr.getOptions(e),i=t.modules.size,a=t.modules.data,o=i+2*n.margin,s=n.color.light.a?"<path "+Pr(n.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",d="<path "+Pr(n.color.dark,"stroke")+' d="'+function(t,e,r){let n="",i=0,a=!1,o=0;for(let s=0;s<t.length;s++){const d=Math.floor(s%e),l=Math.floor(s/e);d||a||(a=!0),t[s]?(o++,s>0&&d>0&&t[s-1]||(n+=a?Cr("M",d+r,.5+l+r):Cr("m",i,0),i=0,a=!1),d+1<e&&t[s+1]||(n+=Cr("h",o),o=0)):i++}return n}(a,i,n.margin)+'"/>',l='viewBox="0 0 '+o+" "+o+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+l+' shape-rendering="crispEdges">'+s+d+"</svg>\n";return"function"==typeof r&&r(null,c),c};const kr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},Sr=ee,Nr=vr,Er=wr;function Ir(t,e,r,n,i){const a=[].slice.call(arguments,1),o=a.length,s="function"==typeof a[o-1];if(!s&&!kr())throw new Error("Callback required as last argument");if(!s){if(o<1)throw new Error("Too few arguments provided");return 1===o?(r=e,e=n=void 0):2!==o||e.getContext||(n=r,r=e,e=void 0),new Promise(function(i,a){try{const a=Sr.create(r,n);i(t(a,e,n))}catch(o){a(o)}})}if(o<2)throw new Error("Too few arguments provided");2===o?(i=r,r=e,e=n=void 0):3===o&&(e.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0));try{const a=Sr.create(r,n);i(null,t(a,e,n))}catch(d){i(d)}}te.create=Sr.create,te.toCanvas=Ir.bind(null,Nr.render),te.toDataURL=Ir.bind(null,Nr.renderToDataURL),te.toString=Ir.bind(null,function(t,e,r){return Er.render(t,r)});const Ar={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","(?:[025-7]\\d|44)\\d{6}",[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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|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{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[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(?:(?:2[14]|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|4[47])|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(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|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]|28|3[129]|4[1-35689]|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[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|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]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|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","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,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",["[12]1"],"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","(?:596\\d|7091)\\d{5}|(?:69|[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",["(?: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","(?: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","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"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,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?: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-8]\\d|90)\\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|30|[689]\\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-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|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{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?: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-247]|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","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?: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|51"]],["(\\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})|50\\d{3})\\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}"]]]}};function Mr(t,e){var r=Array.prototype.slice.call(e);return r.push(Ar),t.apply(this,r)}function _r(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var a=Number(r[i]),o=Number(n[i]);if(a>o)return 1;if(o>a)return-1;if(!isNaN(a)&&isNaN(o))return 1;if(isNaN(a)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Tr={}.constructor;function Or(t){return null!=t&&t.constructor===Tr}function Dr(t){return(Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rr(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Lr(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lr(t){var e=function(t,e){if("object"!=Dr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Dr(e)?e:e+""}var Br=" ext. ",Ur=/^\d+$/,jr=function(){return Rr(function t(e){Fr(this,t),Kr(e),this.metadata=e,Qr.call(this,e)},[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(t){return"001"!==t})}},{key:"getCountryMetadata",value:function(t){return this.metadata.countries[t]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(t){return void 0!==this.getCountryMetadata(t)}},{key:"hasCallingCode",value:function(t){if(this.getCountryCodesForCallingCode(t))return!0;if(this.nonGeographic()){if(this.nonGeographic()[t])return!0}else{var e=this.countryCallingCodes()[t];if(e&&1===e.length&&"001"===e[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(t){return this.nonGeographic()?!!this.nonGeographic()[t]:!this.getCountryCodesForCallingCode(t)}},{key:"country",value:function(t){return this.selectNumberingPlan(t)}},{key:"selectNumberingPlan",value:function(t,e){if(t&&Ur.test(t)&&(e=t,t=null),t&&"001"!==t){if(!this.hasCountry(t))throw new Error("Unknown country: ".concat(t));this.numberingPlan=new Hr(this.getCountryMetadata(t),this)}else if(e){if(!this.hasCallingCode(e))throw new Error("Unknown calling code: ".concat(e));this.numberingPlan=new Hr(this.getNumberingPlanMetadata(e),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(t){var e=this.countryCallingCodes()[t];if(e){if(1===e.length&&3===e[0].length)return;return e}}},{key:"getCountryCodeForCallingCode",value:function(t){var e=this.getCountryCodesForCallingCode(t);if(e)return e[0]}},{key:"getNumberingPlanMetadata",value:function(t){var e=this.getCountryCodeForCallingCode(t);if(e)return this.getCountryMetadata(e);if(this.nonGeographic()){var r=this.nonGeographic()[t];if(r)return r}else{var n=this.countryCallingCodes()[t];if(n&&1===n.length&&"001"===n[0])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(t){return this.numberingPlan.type(t)}},{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(t){return this.selectNumberingPlan(t)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}])}(),Hr=function(){return Rr(function t(e,r){Fr(this,t),this.globalMetadataObject=r,this.metadata=e,Qr.call(this,r.metadata)},[{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(t){return t[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var t=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(e){return new zr(e,t)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(t){return t[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()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(t){if(this.hasTypes()&&Gr(this.types(),t))return new Vr(Gr(this.types(),t),this)}},{key:"ext",value:function(){return this.v1||this.v2?Br:this.metadata[13]||Br}}])}(),zr=function(){return Rr(function t(e,r){Fr(this,t),this._format=e,this.metadata=r},[{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()||qr.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),qr=/^\(?\$1\)?$/,Vr=function(){return Rr(function t(e,r){Fr(this,t),this.type=e,this.metadata=r},[{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 Gr(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function Kr(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Or(t)||!Or(t.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(Or(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+Yr(t)+": "+t,"."))}var Yr=function(t){return Dr(t)};function Wr(t,e){if((e=new jr(e)).hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Qr(t){var e=t.version;"number"==typeof e?(this.v1=1===e,this.v2=2===e,this.v3=3===e,this.v4=4===e):e?-1===_r(e,"1.2.0")?this.v2=!0:-1===_r(e,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}function Jr(t,e,r){return function(t,e,r,n){e&&(n=new jr(n.metadata)).selectNumberingPlan(e);var i=n.type(r),a=i&&i.possibleLengths()||n.possibleLengths();if(!a)return"IS_POSSIBLE";var o=t.length,s=a[0];if(s===o)return"IS_POSSIBLE";if(s>o)return"TOO_SHORT";if(a[a.length-1]<o)return"TOO_LONG";return a.indexOf(o,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(t,e,void 0,r)}function Zr(t,e,r){return"IS_POSSIBLE"===Jr(t,e,r)}function Xr(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function tn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return en(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?en(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var rn=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function nn(t,e,r){if(e=e||{},t.country||t.countryCallingCode){(r=new jr(r)).selectNumberingPlan(t.country,t.countryCallingCode);var n=e.v2?t.nationalNumber:t.phone;if(Xr(n,r.nationalNumberPattern())){if(an(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?an(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i,a=tn(rn);!(i=a()).done;){var o=i.value;if(an(n,o,r))return o}}}}function an(t,e,r){var n=r.type(e);return!(!n||!n.pattern())&&(!(n.possibleLengths()&&n.possibleLengths().indexOf(t.length)<0)&&Xr(t,n.pattern()))}function on(t,e,r){var n=new jr(r).getCountryCodesForCallingCode(t);return n?n.filter(function(t){return function(t,e,r){var n=new jr(r);if(n.selectNumberingPlan(e),n.numberingPlan.possibleLengths().indexOf(t.length)>=0)return!0;return!1}(e,t,r)}):[]}var sn="0-90-9٠-٩۰-۹",dn="".concat("-‐-―−ー-").concat("//").concat("..").concat("  ­​⁠ ").concat("()()[]\\[\\]").concat("~⁓∼~"),ln=new RegExp("(["+sn+"])");function cn(t,e,r,n){if(e){var i=new jr(n);i.selectNumberingPlan(e,r);var a=new RegExp(i.IDDPrefix());if(0===t.search(a)){var o=(t=t.slice(t.match(a)[0].length)).match(ln);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return t}}}function un(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,a,o,s=n.length-1,d=s>0&&n[s];if(e.nationalPrefixTransformRule()&&d)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var l=n[0];i=t.slice(l.length),d&&(a=n[1])}if(d){var c=t.indexOf(n[1]);t.slice(0,c)===e.numberingPlan.nationalPrefix()&&(o=e.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:a}}}return{nationalNumber:t}}function hn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return pn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pn(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function mn(t,e){var r=e.countries,n=e.metadata;n=new jr(n);for(var i,a=hn(r);!(i=a()).done;){var o=i.value;if(n.selectNumberingPlan(o),n.leadingDigits()){if(t&&0===t.search(n.leadingDigits()))return o}else if(nn({phone:t,country:o},void 0,n.metadata))return o}}function fn(t,e){var r=e.nationalNumber,n=e.metadata,i=n.getCountryCodesForCallingCode(t);if(i)return 1===i.length?i[0]:mn(r,{countries:i,metadata:n.metadata})}function $n(t,e,r){var n=un(t,r),i=n.carrierCode,a=n.nationalNumber;if(a!==t){if(!function(t,e,r){if(Xr(t,r.nationalNumberPattern())&&!Xr(e,r.nationalNumberPattern()))return!1;return!0}(t,a,r))return{nationalNumber:t};if(r.numberingPlan.possibleLengths()&&(e||(e=fn(r.numberingPlan.callingCode(),{nationalNumber:a,metadata:r})),!function(t,e,r){switch(Jr(t,e,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(a,e,r)))return{nationalNumber:t}}return{nationalNumber:a,carrierCode:i}}function gn(t,e,r,n,i){var a=e||r?Wr(e||r,i):n;if(0===t.indexOf(a)){(i=new jr(i)).selectNumberingPlan(e||r,a);var o=t.slice(a.length),s=$n(o,e,i).nationalNumber,d=$n(t,e,i).nationalNumber;if(!Xr(d,i.nationalNumberPattern())&&Xr(s,i.nationalNumberPattern())||"TOO_LONG"===Jr(d,e,i))return{countryCallingCode:a,number:o}}return{number:t}}function yn(t,e,r,n,i){if(!t)return{};var a;if("+"!==t[0]){var o=cn(t,e||r,n,i);if(!o||o===t){if(e||r||n){var s=gn(t,e,r,n,i),d=s.countryCallingCode,l=s.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:l}}return{number:t}}a=!0,t="+"+o}if("0"===t[1])return{};i=new jr(i);for(var c=2;c-1<=3&&c<=t.length;){var u=t.slice(1,c);if(i.hasCallingCode(u))return i.selectNumberingPlan(u),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function vn(t){return t.replace(new RegExp("[".concat(dn,"]+"),"g")," ").trim()}var bn=/(\$\d)/;function wn(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(bn,e.nationalPrefixFormattingRule()):e.format());return n?vn(a):a}var xn=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;var Pn=function(t){return"([".concat(sn,"]{1,").concat(t,"})")};function Cn(t){var e="[  \\t,]*",r="[:\\..]?[  \\t,-]*",n="#?",i="[  \\t]*";return";ext="+Pn("20")+"|"+(e+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+r+Pn("20")+n)+"|"+(e+"(?:[xx##~~]|int|int)"+r+Pn("9")+n)+"|"+("[- ]+"+Pn("6")+"#")+"|"+(i+"(?:,{2}|;)"+r+Pn("15")+n)+"|"+(i+"(?:,)+"+r+Pn("9")+n)}var kn="["+sn+"]{2}",Sn="[++]{0,1}(?:["+dn+"]*["+sn+"]){3,}["+dn+sn+"]*",Nn=new RegExp("^[++]{0,1}(?:["+dn+"]*["+sn+"]){1,2}$","i"),En=Sn+"(?:"+Cn()+")?",In=new RegExp("^"+kn+"$|^"+En+"$","i");var An={formatExtension:function(t,e,r){return"".concat(t).concat(r.ext()).concat(e)}};function Mn(t,e,r,n){if(r=r?function(){for(var t=1,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(;t<r.length;){if(r[t])for(var i in r[t])r[0][i]=r[t][i];t++}return r[0]}({},An,r):An,n=new jr(n),t.country&&"001"!==t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)return t.phone||"";n.selectNumberingPlan(t.countryCallingCode)}var i,a=n.countryCallingCode(),o=r.v2?t.nationalNumber:t.phone;switch(e){case"NATIONAL":return o?Tn(i=_n(o,t.carrierCode,"NATIONAL",n,r),t.ext,n,r.formatExtension):"";case"INTERNATIONAL":return o?(i=_n(o,null,"INTERNATIONAL",n,r),Tn(i="+".concat(a," ").concat(i),t.ext,n,r.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(o);case"RFC3966":return function(t){var e=t.number,r=t.ext;if(!e)return"";if("+"!==e[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(r?";ext="+r:"")}({number:"+".concat(a).concat(o),ext:t.ext});case"IDD":if(!r.fromCountry)return;var s=function(t,e,r,n,i){var a=Wr(n,i.metadata);if(a===r){var o=_n(t,e,"NATIONAL",i);return"1"===r?r+" "+o:o}var s=function(t,e,r){var n=new jr(r);return n.selectNumberingPlan(t,e),n.defaultIDDPrefix()?n.defaultIDDPrefix():xn.test(n.IDDPrefix())?n.IDDPrefix():void 0}(n,void 0,i.metadata);if(s)return"".concat(s," ").concat(r," ").concat(_n(t,null,"INTERNATIONAL",i))}(o,t.carrierCode,a,r.fromCountry,n);if(!s)return;return Tn(s,t.ext,n,r.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function _n(t,e,r,n,i){var a,o,s=(a=n.formats(),o=t,function(t,e){for(var r=0;r<t.length;){if(e(t[r]))return t[r];r++}}(a,function(t){if(t.leadingDigitsPatterns().length>0){var e=t.leadingDigitsPatterns()[t.leadingDigitsPatterns().length-1];if(0!==o.search(e))return!1}return Xr(o,t.pattern())}));return s?wn(t,s,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:e,metadata:n}):t}function Tn(t,e,r,n){return e?n(t,e,r):t}function On(t){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Dn(Object(r),!0).forEach(function(e){Rn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Rn(t,e,r){return(e=Bn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ln(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bn(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bn(t){var e=function(t,e){if("object"!=On(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==On(e)?e:e+""}var Un=function(){return Ln(function t(e,r,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new TypeError("First argument is required");if("string"!=typeof e)throw new TypeError("First argument must be a string");if("+"===e[0]&&!r)throw new TypeError("`metadata` argument not passed");if(Or(r)&&Or(r.countries)){n=r;var i=e;if(!Hn.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=yn(i,void 0,void 0,void 0,n);if(e=a.countryCallingCode,!(r=a.number))throw new Error("Invalid `number` argument passed: too short")}if(!r)throw new TypeError("`nationalNumber` argument is required");if("string"!=typeof r)throw new TypeError("`nationalNumber` argument must be a string");Kr(n);var o=function(t,e){var r,n,i=new jr(e);jn(t)?(r=t,i.selectNumberingPlan(r),n=i.countryCallingCode()):n=t;return{country:r,countryCallingCode:n}}(e,n),s=o.country,d=o.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}},[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:on(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(t,e,r){if(void 0===e&&(e={}),r=new jr(r),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return Zr(t.phone||t.nationalNumber,t.country,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return t=this,e={v2:!0},r=this.getMetadata(),e=e||{},(r=new jr(r)).selectNumberingPlan(t.country,t.countryCallingCode),r.hasTypes()?void 0!==nn(t,e,r.metadata):Xr(e.v2?t.nationalNumber:t.phone,r.nationalNumberPattern());var t,e,r}},{key:"isNonGeographic",value:function(){return new jr(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return nn(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,e){return Mn(this,t,e?Fn(Fn({},e),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])}(),jn=function(t){return/^[A-Z]{2}$/.test(t)};var Hn=/^\+\d+$/;function zn(t){return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qn(t,e,r){return e=Yn(e),function(t,e){if(e&&("object"==zn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gn()?Reflect.construct(e,r||[],Yn(t).constructor):e.apply(t,r))}function Vn(t){var e="function"==typeof Map?new Map:void 0;return Vn=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(Gn())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Kn(i,r.prototype),i}(t,arguments,Yn(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Kn(r,t)},Vn(t)}function Gn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gn=function(){return!!t})()}function Kn(t,e){return(Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Yn(t){return(Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wn=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=qn(this,e,[t]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kn(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(Vn(Error)),Qn=new RegExp("(?:"+Cn()+")$","i");function Jn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Zn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zn(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Xn={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 ti(t){return Xn[t]}function ei(t){for(var e,r="",n=Jn(t.split(""));!(e=n()).done;){var i=ti(e.value);i&&(r+=i)}return r}function ri(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ni(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ni(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ii(t){for(var e,r="",n=ri(t.split(""));!(e=n()).done;){r+=ai(e.value,r)||""}return r}function ai(t,e,r){if("+"===t){if(e)return;return"+"}return ti(t)}var oi="(["+sn+"]|[\\-\\.\\(\\)]?)",si=new RegExp("^\\+"+oi+"*["+sn+"]"+oi+"*$","g"),di=new RegExp("^("+("["+sn+"]+((\\-)*["+sn+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+sn+"])*")+"\\.?$","g"),li="tel:",ci=";phone-context=";function ui(t,e){var r,n=e.extractFormattedPhoneNumber,i=function(t){var e=t.indexOf(ci);if(e<0)return null;var r=e+15;if(r>=t.length)return"";var n=t.indexOf(";",r);return n>=0?t.substring(r,n):t.substring(r)}(t);if(!function(t){return null===t||0!==t.length&&(si.test(t)||di.test(t))}(i))throw new Wn("NOT_A_NUMBER");if(null===i)r=n(t)||"";else{r="","+"===i.charAt(0)&&(r+=i);var a,o=t.indexOf(li);a=o>=0?o+4:0;var s=t.indexOf(ci);r+=t.substring(a,s)}var d=r.indexOf(";isub=");if(d>0&&(r=r.substring(0,d)),""!==r)return r}var hi=new RegExp("[++"+sn+"]"),pi=new RegExp("[^"+sn+"#]+$");function mi(t,e,r){if(e=e||{},r=new jr(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry)){if(e.v2)throw new Wn("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(e.defaultCountry))}var n=function(t,e,r){var n=ui(t,{extractFormattedPhoneNumber:function(t){return function(t,e,r){if(!t)return;if(t.length>250){if(r)throw new Wn("TOO_LONG");return}if(!1===e)return t;var n=t.search(hi);if(n<0)return;return t.slice(n).replace(pi,"")}(t,r,e)}});if(!n)return{};if(!function(t){return t.length>=2&&In.test(t)}(n))return function(t){return Nn.test(t)}(n)?{error:"TOO_SHORT"}:{};var i=function(t){var e=t.search(Qn);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(Qn),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}(n);if(i.ext)return i;return{number:n}}(t,e.v2,e.extract),i=n.number,a=n.ext,o=n.error;if(!i){if(e.v2){if("TOO_SHORT"===o)throw new Wn("TOO_SHORT");throw new Wn("NOT_A_NUMBER")}return{}}var s=function(t,e,r,n){var i,a=yn(ii(t),void 0,e,r,n.metadata),o=a.countryCallingCodeSource,s=a.countryCallingCode,d=a.number;if(s)n.selectNumberingPlan(s);else{if(!d||!e&&!r)return{};n.selectNumberingPlan(e,r),e&&(i=e),s=r||Wr(e,n.metadata)}if(!d)return{countryCallingCodeSource:o,countryCallingCode:s};var l=$n(ii(d),i,n),c=l.nationalNumber,u=l.carrierCode,h=fn(s,{nationalNumber:c,metadata:n});h&&(i=h,"001"===h||n.selectNumberingPlan(i));return{country:i,countryCallingCode:s,countryCallingCodeSource:o,nationalNumber:c,carrierCode:u}}(i,e.defaultCountry,e.defaultCallingCode,r),d=s.country,l=s.nationalNumber,c=s.countryCallingCode,u=s.countryCallingCodeSource,h=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new Wn("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(e.v2)throw new Wn("TOO_SHORT");return{}}if(l.length>17){if(e.v2)throw new Wn("TOO_LONG");return{}}if(e.v2){var p=new Un(c,l,r.metadata);return d&&(p.country=d),h&&(p.carrierCode=h),a&&(p.ext=a),p.__countryCallingCodeSource=u,p}var m=!!(e.extended?r.hasSelectedNumberingPlan():d)&&Xr(l,r.nationalNumberPattern());return e.extended?{country:d,countryCallingCode:c,carrierCode:h,valid:m,possible:!!m||!(!0!==e.extended||!r.possibleLengths()||!Zr(l,d,r)),phone:l,ext:a}:m?function(t,e,r){var n={country:t,phone:e};r&&(n.ext=r);return n}(d,l,a):{}}function fi(t){return(fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function gi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$i(Object(r),!0).forEach(function(e){yi(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function yi(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=fi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vi(t,e,r){return mi(t,gi(gi({},e),{},{v2:!0}),r)}function bi(t){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function xi(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=bi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==bi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],d=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e);else for(;!(d=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);d=!0);}catch(c){l=!0,i=c}finally{try{if(!d&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ci(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ci(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ki(t){var e,r,n,i=Pi(Array.prototype.slice.call(t),4),a=i[0],o=i[1],s=i[2],d=i[3];if("string"!=typeof a)throw new TypeError("A text for parsing must be a string.");if(e=a,o&&"string"!=typeof o){if(!Or(o))throw new Error("Invalid second argument: ".concat(o));s?(r=o,n=s):n=o}else d?(r=s,n=d):(r=void 0,n=s),o&&(r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wi(Object(r),!0).forEach(function(e){xi(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wi(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({defaultCountry:o},r));return{text:e,options:r,metadata:n}}function Si(){var t=ki(arguments);return vi(t.text,t.options,t.metadata)}function Ni(t){return(Ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ei(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ii(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ei(Object(r),!0).forEach(function(e){Ai(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ai(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Ni(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ni(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mi(t){return(Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ti(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_i(Object(r),!0).forEach(function(e){Oi(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Oi(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Mi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(){var t=ki(arguments),e=t.text,r=t.options,n=t.metadata,i=function(t,e,r){e&&e.defaultCountry&&!function(t,e){return e.countries.hasOwnProperty(t)}(e.defaultCountry,r)&&(e=Ii(Ii({},e),{},{defaultCountry:void 0}));try{return vi(t,e,r)}catch(n){if(!(n instanceof Wn))throw n}}(e,r=Ti(Ti({},r),{},{extract:!1}),n);return i&&i.isValid()||!1}function Fi(t){return(Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ri(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Li(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Li(t){var e=function(t,e){if("object"!=Fi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Fi(e)?e:e+""}var Bi=function(){return Ri(function t(e){var r=e.onCountryChange,n=e.onCallingCodeChange;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=r,this.onCallingCodeChange=n},[{key:"reset",value:function(t){var e=t.country,r=t.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(e,r)}},{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(t){for(var e=0,r=Object.keys(t);e<r.length;e++){var n=r[e];this[n]=t[n]}}},{key:"initCountryAndCallingCode",value:function(t,e){this.setCountry(t),this.setCallingCode(e)}},{key:"setCountry",value:function(t){this.country=t,this.onCountryChange(t)}},{key:"setCallingCode",value:function(t){this.callingCode=t,this.onCallingCodeChange(t,this.country)}},{key:"startInternationalNumber",value:function(t,e){this.international=!0,this.initCountryAndCallingCode(t,e)}},{key:"appendDigits",value:function(t){this.digits+=t}},{key:"appendNationalSignificantNumberDigits",value:function(t){this.nationalSignificantNumber+=t}},{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 Ui(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ji(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ji(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Hi="x",zi=new RegExp(Hi);function qi(t,e){if(e<1)return"";for(var r="";e>1;)1&e&&(r+=t),e>>=1,t+=t;return r+t}function Vi(t,e){return")"===t[e]&&e++,function(t){var e=[],r=0;for(;r<t.length;)"("===t[r]?e.push(r):")"===t[r]&&e.pop(),r++;var n=0,i="";e.push(t.length);for(var a=0,o=e;a<o.length;a++){var s=o[a];i+=t.slice(n,s),n=s+1}return i}(t.slice(0,e))}function Gi(t,e,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(e.pattern(),")$")).test(t.nationalSignificantNumber))return function(t,e,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var o=Ki(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:n});if(o)return o}return Ki(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:n})}(t,e,{metadata:n,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:a})}function Ki(t,e,r){var n=r.metadata,i=r.useNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix,o=wn(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:n});if(i||(t.nationalPrefix?o=t.nationalPrefix+a(e)+o:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(o=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+o)),function(t,e){return ei(t)===e.getNationalDigits()}(o,t))return o}function Yi(t){return(Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wi(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qi(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qi(t){var e=function(t,e){if("object"!=Yi(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Yi(e)?e:e+""}var Ji=function(){return Wi(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},[{key:"parse",value:function(t){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(t),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var e=this.context[0],r=e.branches,n=e.instructions;if(r)return{op:"|",args:r.concat([ea(n)])};if(0===n.length)throw new Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(t){this.context.push(t)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(t){if(!t)throw new Error("Pattern is required");var e=t.match(ta);if(e){var r=e[1],n=t.slice(0,e.index),i=t.slice(e.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(ea(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(ea(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),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:Zi(n)});break;default:throw new Error("Unknown operator: ".concat(r))}i&&this.parsePattern(i)}else{if(Xi.test(t))throw new Error("Illegal characters found in a pattern: ".concat(t));this.getContext().instructions=this.getContext().instructions.concat(t.split(""))}}}])}();function Zi(t){for(var e=[],r=0;r<t.length;){if("-"===t[r]){if(0===r||r===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var n=t[r-1].charCodeAt(0)+1,i=t[r+1].charCodeAt(0)-1,a=n;a<=i;)e.push(String.fromCharCode(a)),a++}else e.push(t[r]);r++}return e}var Xi=/[\(\)\[\]\?\:\|]/,ta=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function ea(t){return 1===t.length?t[0]:t}function ra(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return na(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?na(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function na(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ia(t){return(ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aa(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oa(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function oa(t){var e=function(t,e){if("object"!=ia(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=ia(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==ia(e)?e:e+""}var sa=function(){return aa(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.matchTree=(new Ji).parse(e)},[{key:"match",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!t)throw new Error("String is required");var r=da(t.split(""),this.matchTree,!0);if(r&&r.match&&delete r.matchedChars,!r||!r.overflow||e)return r}}])}();function da(t,e,r){if("string"==typeof e){var n=t.join("");return 0===e.indexOf(n)?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===n.indexOf(e)?r&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),a=0;a<e.length;){var o=da(i,e[a],r&&a===e.length-1);if(!o)return;if(o.overflow)return o;if(!o.match){if(o.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(o,null,2)))}if(0===(i=i.slice(o.matchedChars.length)).length)return a===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};a++}return r?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var s,d,l=ra(e.args);!(d=l()).done;){var c=da(t,d.value,r);if(c){if(c.overflow)return c;if(c.match)return{match:!0,matchedChars:c.matchedChars};if(!c.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(c,null,2)));s=!0}}return s?{partialMatch:!0}:void 0;case"[]":for(var u,h=ra(e.args);!(u=h()).done;){var p=u.value;if(t[0]===p)return 1===t.length?{match:!0,matchedChars:t}:r?{overflow:!0}:{match:!0,matchedChars:[p]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function la(t){return(la="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ca(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ua(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ua(t,e):void 0}}(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ua(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ha(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pa(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pa(t){var e=function(t,e){if("object"!=la(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=la(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==la(e)?e:e+""}var ma=qi("9",15),fa=/[- ]/,$a=new RegExp("["+dn+"]*\\$1["+dn+"]*(\\$\\d["+dn+"]*)*$"),ga=function(){return ha(function t(e){e.state;var r=e.metadata;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.metadata=r,this.resetFormat()},[{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(t,e){this.resetFormat(),t?(this.isNANP="1"===t.callingCode(),this.matchingFormats=t.formats(),e.nationalSignificantNumber&&this.narrowDownMatchingFormats(e)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(t,e){var r,n,i,a=this;if(r=e.nationalSignificantNumber,n=e.country,i=this.metadata,"IS_POSSIBLE"===Jr(r,n,i))for(var o,s=ca(this.matchingFormats);!(o=s()).done;){var d=o.value,l=Gi(e,d,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(t){return a.shouldTryNationalPrefixFormattingRule(t,{international:e.international,nationalPrefix:e.nationalPrefix})},getSeparatorAfterNationalPrefix:function(t){return a.getSeparatorAfterNationalPrefix(t)}});if(l)return this.resetFormat(),this.chosenFormat=d,this.setNationalNumberTemplate(l.replace(/\d/g,Hi),e),this.populatedNationalNumberTemplate=l,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(Hi),l}return this.formatNationalNumberWithNextDigits(t,e)}},{key:"formatNationalNumberWithNextDigits",value:function(t,e){var r=this.chosenFormat,n=this.chooseFormat(e);if(n)return n===r?this.formatNextNationalNumberDigits(t):this.formatNextNationalNumberDigits(e.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(t){var e=this,r=t.nationalSignificantNumber,n=t.nationalPrefix,i=t.international,a=r,o=a.length-3;o<0&&(o=0),this.matchingFormats=this.matchingFormats.filter(function(t){return e.formatSuits(t,i,n)&&e.formatMatches(t,a,o)}),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(t,e,r){return!(r&&!t.usesNationalPrefix()&&!t.nationalPrefixIsOptionalWhenFormattingInNationalFormat())&&!(!e&&!r&&t.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(t,e,r){var n=t.leadingDigitsPatterns().length;if(0===n)return!0;r=Math.min(r,n-1);var i=t.leadingDigitsPatterns()[r];if(e.length<3)try{return void 0!==new sa(i).match(e,{allowOverflow:!0})}catch(a){return console.error(a),!0}return new RegExp("^(".concat(i,")")).test(e)}},{key:"getFormatFormat",value:function(t,e){return e?t.internationalFormat():t.format()}},{key:"chooseFormat",value:function(t){for(var e,r=this,n=function(){var n=e.value;return r.chosenFormat===n?0:$a.test(r.getFormatFormat(n,t.international))?r.createTemplateForFormat(n,t)?(r.chosenFormat=n,0):(r.matchingFormats=r.matchingFormats.filter(function(t){return t!==n}),1):1},i=ca(this.matchingFormats.slice());!(e=i()).done&&0!==n(););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(t,e){if(!(t.pattern().indexOf("|")>=0)){var r=this.getTemplateForFormat(t,e);return r?(this.setNationalNumberTemplate(r,e),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(t){return this.isNANP||t&&t.nationalPrefixFormattingRule()&&fa.test(t.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(t,e){var r=t.IDDPrefix,n=t.missingPlus;return r?e&&!1===e.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(t){if(this.template){for(var e=-1,r=0,n=t.international?this.getInternationalPrefixBeforeCountryCallingCode(t,{spacing:!1}):"";r<n.length+t.getDigitsWithoutInternationalPrefix().length;)e=this.template.indexOf(Hi,e+1),r++;return Vi(this.template,e+1)}}},{key:"setNationalNumberTemplate",value:function(t,e){this.nationalNumberTemplate=t,this.populatedNationalNumberTemplate=t,this.populatedNationalNumberTemplatePosition=-1,e.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(e).replace(/[\d\+]/g,Hi)+qi(Hi,e.callingCode.length)+" "+t:this.template=t}},{key:"getTemplateForFormat",value:function(t,e){var r=e.nationalSignificantNumber,n=e.international,i=e.nationalPrefix,a=e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,o=t.pattern();o=o.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var s=ma.match(o)[0];if(!(r.length>s.length)){var d=new RegExp("^"+o+"$"),l=r.replace(/\d/g,"9");d.test(l)&&(s=l);var c,u=this.getFormatFormat(t,n);if(this.shouldTryNationalPrefixFormattingRule(t,{international:n,nationalPrefix:i})){var h=u.replace(bn,t.nationalPrefixFormattingRule());if(ei(t.nationalPrefixFormattingRule())===(i||"")+ei("$1")&&(u=h,c=!0,i))for(var p=i.length;p>0;)u=u.replace(/\d/,Hi),p--}var m=s.replace(new RegExp(o),u).replace(new RegExp("9","g"),Hi);return c||(a?m=qi(Hi,a.length)+" "+m:i&&(m=qi(Hi,i.length)+this.getSeparatorAfterNationalPrefix(t)+m)),n&&(m=vn(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(t){var e=function(t,e,r){for(var n,i=Ui(r.split(""));!(n=i()).done;){var a=n.value;if(t.slice(e+1).search(zi)<0)return;e=t.search(zi),t=t.replace(zi,a)}return[t,e]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,t);if(e)return this.populatedNationalNumberTemplate=e[0],this.populatedNationalNumberTemplatePosition=e[1],Vi(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(t,e){var r=e.international,n=e.nationalPrefix;if(t.nationalPrefixFormattingRule()){var i=t.usesNationalPrefix();if(i&&n||!i&&!r)return!0}}}])}();function ya(t){return(ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function va(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],d=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e);else for(;!(d=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);d=!0);}catch(c){l=!0,i=c}finally{try{if(!d&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ba(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ba(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wa(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xa(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xa(t){var e=function(t,e){if("object"!=ya(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==ya(e)?e:e+""}var Pa=new RegExp("^"+("["+dn+sn+"]+")+"$","i"),Ca="(?:[++]["+dn+sn+"]*|["+dn+sn+"]+)",ka=new RegExp("[^"+dn+sn+"]+.*$"),Sa=/[^\d\[\]]/,Na=function(){return wa(function t(e){var r=e.defaultCountry,n=e.defaultCallingCode,i=e.metadata,a=e.onNationalSignificantNumberChange;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=a},[{key:"input",value:function(t,e){var r,n=function(t){var e=function(t){var e=function(t){var e,r=t.search(Ca);if(r<0)return;t=t.slice(r),"+"===t[0]&&(e=!0,t=t.slice(1));t=t.replace(ka,""),e&&(t="+"+t);return t}(t)||"";if("+"===e[0])return[e.slice(1),!0];return[e]}(t),r=va(e,2),n=r[0],i=r[1];Pa.test(n)||(n="");return[n,i]}(t),i=va(n,2),a=i[0],o=i[1],s=ei(a);return o&&(e.digits||(e.startInternationalNumber(void 0,void 0),s||(r=!0))),s&&this.inputDigits(s,e),{digits:s,justLeadingPlus:r}}},{key:"inputDigits",value:function(t,e){var r=e.digits,n=r.length<3&&r.length+t.length>=3;if(e.appendDigits(t),n&&this.extractIddPrefix(e),this.isWaitingForCountryCallingCode(e)){if(!this.extractCountryCallingCode(e))return}else e.appendNationalSignificantNumberDigits(t);e.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}},{key:"isWaitingForCountryCallingCode",value:function(t){var e=t.international,r=t.callingCode;return e&&!r}},{key:"extractCountryCallingCode",value:function(t){var e=yn("+"+t.getDigitsWithoutInternationalPrefix(),t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=e.countryCallingCode,n=e.number;if(r)return t.setCallingCode(r),t.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(t){if(t){this.hasSelectedNumberingPlan=!0;var e=t._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=e&&Sa.test(e)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(t,e){if(this.hasSelectedNumberingPlan){var r=un(t,this.metadata),n=r.nationalPrefix,i=r.nationalNumber,a=r.carrierCode;if(i!==t)return this.onExtractedNationalNumber(n,a,i,t,e),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(t,e,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(t,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=un(t,this.metadata),i=n.nationalPrefix,a=n.nationalNumber,o=n.carrierCode;if(a!==e)return this.onExtractedNationalNumber(i,o,a,t,r),!0}}},{key:"onExtractedNationalNumber",value:function(t,e,r,n,i){var a,o=!1,s=n.lastIndexOf(r);if(s<0||s!==n.length-r.length)o=!0;else{var d=n.slice(0,s);d&&d!==t&&(a=d)}i({nationalPrefix:t,carrierCode:e,nationalSignificantNumber:r,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:a}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(t){return!!this.extractAnotherNationalSignificantNumber(t.getNationalDigits(),t.nationalSignificantNumber,function(e){return t.update(e)})||(this.extractIddPrefix(t)||this.fixMissingPlus(t)?(this.extractCallingCodeAndNationalSignificantNumber(t),!0):void 0)}},{key:"extractIddPrefix",value:function(t){var e=t.international,r=t.IDDPrefix,n=t.digits;if(t.nationalSignificantNumber,!e&&!r){var i=cn(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==i&&i!==n?(t.update({IDDPrefix:n.slice(0,n.length-i.length)}),this.startInternationalNumber(t,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(t){if(!t.international){var e=gn(t.digits,t.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata).countryCallingCode;if(e)return t.update({missingPlus:!0}),this.startInternationalNumber(t,{country:t.country,callingCode:e}),!0}}},{key:"startInternationalNumber",value:function(t,e){var r=e.country,n=e.callingCode;t.startInternationalNumber(r,n),t.nationalSignificantNumber&&(t.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(t){this.extractCountryCallingCode(t)&&this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}}])}();function Ea(t){return(Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ia(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a,o,s=[],d=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e);else for(;!(d=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);d=!0);}catch(c){l=!0,i=c}finally{try{if(!d&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Aa(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Aa(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ma(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_a(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _a(t){var e=function(t,e){if("object"!=Ea(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ea(e)?e:e+""}var Ta=function(){return Ma(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.metadata=new jr(r);var n=Ia(this.getCountryAndCallingCode(e),2),i=n[0],a=n[1];this.defaultCountry=i,this.defaultCallingCode=a,this.reset()},[{key:"getCountryAndCallingCode",value:function(t){var e,r;return t&&(Or(t)?(e=t.defaultCountry,r=t.defaultCallingCode):e=t),e&&!this.metadata.hasCountry(e)&&(e=void 0),[e,r]}},{key:"input",value:function(t){var e=this.parser.input(t,this.state),r=e.digits;if(e.justLeadingPlus)this.formattedOutput="+";else if(r){var n;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(n=this.formatter.format(r,this.state)),void 0===n&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var i=this.state.getNationalDigits();i&&(n=this.formatter.format(i,this.state))}this.formattedOutput=n?this.getFullNumber(n):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var t=this;return this.state=new Bi({onCountryChange:function(e){t.country=e},onCallingCodeChange:function(e,r){t.metadata.selectNumberingPlan(r,e),t.formatter.reset(t.metadata.numberingPlan,t.state),t.parser.reset(t.metadata.numberingPlan)}}),this.formatter=new ga({state:this.state,metadata:this.metadata}),this.parser=new Na({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){t.determineTheCountryIfNeeded(),t.formatter.reset(t.metadata.numberingPlan,t.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(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(t){var e=this;if(this.isInternational()){var r=function(t){return e.formatter.getInternationalPrefixBeforeCountryCallingCode(e.state,{spacing:!!t})+t},n=this.state.callingCode;return r(n?t?"".concat(n," ").concat(t):n:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return t}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var t=this.state,e=t.nationalSignificantNumber,r=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,n=t.nationalPrefix,i=e,a=r||n;return a&&(i=a+i),i}},{key:"getNonFormattedNumber",value:function(){var t=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(t?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var t=this.getNonFormattedNumber();if(t)return t.replace(/[\+\d]/g,Hi)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var t=this.state.callingCode,e=this.metadata.getCountryCodesForCallingCode(t);return e&&e.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(fn(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var t=this.state,e=t.digits,r=t.callingCode,n=t.country,i=t.nationalSignificantNumber;if(e)return this.isInternational()?r?"+"+r+i:"+"+e:n||r?"+"+(n?this.metadata.countryCallingCode():r)+i:void 0}},{key:"getNumber",value:function(){var t=this.state,e=t.nationalSignificantNumber,r=t.carrierCode,n=t.callingCode,i=this._getCountry();if(e&&(i||n)){if(i&&i===this.defaultCountry){var a=new jr(this.metadata.metadata);a.selectNumberingPlan(i);var o=a.numberingPlan.callingCode(),s=this.metadata.getCountryCodesForCallingCode(o);if(s.length>1){var d=mn(e,{countries:s,metadata:this.metadata.metadata});d&&(i=d)}}var l=new Un(i||n,e,this.metadata.metadata);return r&&(l.carrierCode=r),l}}},{key:"isPossible",value:function(){var t=this.getNumber();return!!t&&t.isPossible()}},{key:"isValid",value:function(){var t=this.getNumber();return!!t&&t.isValid()}},{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 Oa(t){return Ta.call(this,t,Ar)}Oa.prototype=Object.create(Ta.prototype,{}),Oa.prototype.constructor=Oa;var Da=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Ra=(t,e,r,n)=>{for(var i,a=n>1?void 0:n?Fa(e,r):e,o=t.length-1;o>=0;o--)(i=t[o])&&(a=(n?i(e,r,a):i(a))||a);return n&&a&&Da(e,r,a),a};let La=class extends st{constructor(){super(...arguments),this.currentState={status:"idle"},this.selectedMethod=null,this.cardFormData={cardNumber:"",expiry:"",cvv:"",cardholderName:""},this.formErrors={},this.paymentData=null,this.feesExpanded=!1,this.isInitializing=!0,this.cardBrand="unknown",this.paymentLocked=!1,this.show3DSModal=!1,this.showQRModal=!1,this.nextActionUrl=null,this.qrCode=null,this.qrCodeDataUrl=null,this.qrAutoResumeTimer=null,this.qrPollingInProgress=!1,this.availableBanks=[],this.selectedBank=null,this.banksLoading=!1,this.bankSearchQuery="",this.phoneInputValue="",this.phoneInputError="",this.selectedCountry="SG",this.sdk=null,this.isInitialized=!1,this.cardNumberCleave=null,this.expiryCleave=null,this.leaveEventsCounter=0,this.previousState=null,this.cssVariableMap={colorPrimary:"--op-color-primary",colorPrimaryHover:"--op-color-primary-hover",colorPrimaryText:"--op-color-primary-text",colorBackground:"--op-color-background",colorSurface:"--op-color-surface",colorText:"--op-color-text",colorTextSecondary:"--op-color-text-secondary",colorDanger:"--op-color-danger",colorSuccess:"--op-color-success",colorWarning:"--op-color-warning",colorBorder:"--op-color-border",colorBorderFocus:"--op-color-border-focus",fontFamily:"--op-font-family",fontSize:"--op-font-size",fontSizeSmall:"--op-font-size-sm",borderRadius:"--op-border-radius",borderRadiusLarge:"--op-border-radius-lg",spacingUnit:"--op-spacing-unit",boxShadow:"--op-box-shadow",boxShadowLarge:"--op-box-shadow-lg"},this.themeMediaQuery=null,this.themeMediaQueryHandler=null,this.handle3DSPostMessage=t=>{"ON_AWX_3DS_START_PAGE_LEAVE"===t.data&&(this.leaveEventsCounter++,this.leaveEventsCounter>1&&this.handle3DSComplete())},this.MIN_PHONE_LENGTH=8,this.JAPAN_ONLY_PHONE_METHODS=[St,Nt],this.COUNTRY_OPTIONS=[{code:"JP",name:"Japan",flag:"🇯🇵",dialCode:"+81"},{code:"SG",name:"Singapore",flag:"🇸🇬",dialCode:"+65"},{code:"MY",name:"Malaysia",flag:"🇲🇾",dialCode:"+60"},{code:"ID",name:"Indonesia",flag:"🇮🇩",dialCode:"+62"},{code:"TH",name:"Thailand",flag:"🇹🇭",dialCode:"+66"},{code:"PH",name:"Philippines",flag:"🇵🇭",dialCode:"+63"},{code:"HK",name:"Hong Kong",flag:"🇭🇰",dialCode:"+852"},{code:"CN",name:"China",flag:"🇨🇳",dialCode:"+86"}]}hasAllRequiredProps(){return!!(this.config&&this.adapters&&this.amount&&this.currency&&this.orderId)&&(!(!this.firstName||"string"!=typeof this.firstName||""===this.firstName.trim())&&(!(!this.lastName||"string"!=typeof this.lastName||""===this.lastName.trim())&&(!(!this.email||"string"!=typeof this.email||""===this.email.trim())&&!(!this.phoneNumber||"string"!=typeof this.phoneNumber||""===this.phoneNumber.trim()))))}applyAppearance(){if(!this.appearance)return void this.removeAttribute("data-theme");const{theme:t,variables:e}=this.appearance;if(t)if("auto"===t){const t=window.matchMedia("(prefers-color-scheme: dark)").matches;this.dataset.theme=t?"dark":"light",this.setupThemeMediaQueryListener()}else this.dataset.theme=t;e&&this.applyCssVariables(e)}applyCssVariables(t){for(const[e,r]of Object.entries(this.cssVariableMap)){const n=t[e];null!=n?this.style.setProperty(r,n):this.style.removeProperty(r)}}setupThemeMediaQueryListener(){this.cleanupThemeMediaQueryListener(),this.themeMediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.themeMediaQueryHandler=t=>{var e;"auto"===(null==(e=this.appearance)?void 0:e.theme)&&(this.dataset.theme=t.matches?"dark":"light")},this.themeMediaQuery.addEventListener("change",this.themeMediaQueryHandler)}cleanupThemeMediaQueryListener(){this.themeMediaQuery&&this.themeMediaQueryHandler&&(this.themeMediaQuery.removeEventListener("change",this.themeMediaQueryHandler),this.themeMediaQuery=null,this.themeMediaQueryHandler=null)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handle3DSPostMessage),this.addEventListener("force-close-3ds-modal",()=>{this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0)})}firstUpdated(){this.applyAppearance(),this.initializeSDK()}updated(t){super.updated(t),t.has("appearance")&&this.applyAppearance(),!this.isInitialized&&this.hasAllRequiredProps()&&this.initializeSDK()}disconnectedCallback(){var t;super.disconnectedCallback(),this.cleanupThemeMediaQueryListener(),null==(t=this.sdk)||t.destroy(),this.isInitialized=!1,this.destroyCleave(),window.removeEventListener("message",this.handle3DSPostMessage),null!==this.qrAutoResumeTimer&&clearTimeout(this.qrAutoResumeTimer)}setupCleave(){setTimeout(()=>{var t,e;const r=null==(t=this.shadowRoot)?void 0:t.querySelector("#cardNumber"),n=null==(e=this.shadowRoot)?void 0:e.querySelector("#expiry");r&&!this.cardNumberCleave&&(this.cardNumberCleave=new Xt(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:t=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[t]||"unknown"}})),n&&!this.expiryCleave&&(this.expiryCleave=new Xt(n,{date:!0,datePattern:["m","y"],delimiter:"/"}))},50)}destroyCleave(){this.cardNumberCleave&&(this.cardNumberCleave.destroy(),this.cardNumberCleave=null),this.expiryCleave&&(this.expiryCleave.destroy(),this.expiryCleave=null)}getFilteredPaymentMethods(){const t=("ready"===this.currentState.status||"processing"===this.currentState.status||"requires_action"===this.currentState.status)&&this.currentState.availableMethods||[];return 0===t.length?[]:t.filter(t=>{var e;return!(null==(e=this.excludePaymentMethods)?void 0:e.includes(t.id))}).map(t=>({id:t.id,enabled:!0}))}initializeSDK(){var t;this.config&&this.adapters&&this.amount&&this.currency&&this.orderId?this.firstName&&"string"==typeof this.firstName&&""!==this.firstName.trim()?this.lastName&&"string"==typeof this.lastName&&""!==this.lastName.trim()?this.email&&"string"==typeof this.email&&""!==this.email.trim()?this.isInitialized||(this.isInitialized=!0,null==(t=this.sdk)||t.destroy(),this.sdk=new Lt(this.config,this.adapters),this.sdk.subscribe(t=>{var e;"requires_action"===(null==(e=this.previousState)?void 0:e.status)&&"requires_action"!==t.status&&this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()),this.previousState=t,this.currentState=t,this.dispatchEvent(new CustomEvent("state-change",{detail:{state:t},bubbles:!0,composed:!0}))}),this.sdk.on("payment_succeeded",t=>{this.dispatchEvent(new CustomEvent("payment-success",{detail:{paymentIntentId:t.payload.paymentIntent.id},bubbles:!0,composed:!0}))}),this.sdk.on("payment_failed",t=>{this.dispatchEvent(new CustomEvent("payment-error",{detail:{error:t.payload.error.message},bubbles:!0,composed:!0}))}),this.sdk.on("initialized",t=>{var e,r,n;if(this.paymentData=t.payload.paymentData,this.isInitializing=!1,null==(e=t.payload.paymentData)?void 0:e.sessionId){if(!document.getElementById("airwallex-fraud-api")){const e=document.createElement("script"),i="demo"===(null==(r=this.config)?void 0:r.environment)||"dev"===(null==(n=this.config)?void 0:n.environment)?"http://static-demo.airwallex.com":"https://static.airwallex.com";e.src=`${i}/webapp/fraud/device-fingerprint/index.js`,e.async=!0,e.setAttribute("data-order-session-id",t.payload.paymentData.sessionId),e.setAttribute("id","airwallex-fraud-api"),document.body.appendChild(e)}}}),this.sdk.on("payment_requires_action",t=>{this.nextActionUrl=t.payload.actionUrl,this.show3DSModal=!0,this.paymentLocked=!0,this.leaveEventsCounter=0}),this.sdk.on("poll_started",()=>{const t="undefined"!=typeof window&&"ReactNativeWebView"in window;this.show3DSModal&&t&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling())}),this.sdk.on("qr_code_received",async t=>{if(this.qrCode=t.payload.qrCode,!this.qrCode)return;const e=this.qrCode.startsWith("http://")||this.qrCode.startsWith("https://"),r=this.qrCode.startsWith("data:image");if(e||r)this.qrCodeDataUrl=this.qrCode;else try{const t=await te.toDataURL(this.qrCode,{width:300,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});this.qrCodeDataUrl=t}catch(n){this.qrCodeDataUrl=null}this.showQRModal=!0,this.paymentLocked=!0,this.qrAutoResumeTimer=window.setTimeout(()=>{this.handleQRScanned()},1e4)}),this.sdk.on("promptpay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("duitnow_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("gopay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("boost_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("shopeepay_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("atom_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("dana_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("tng_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("alipaycn_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("alipayhk_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("gcash_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("konbini_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("payeasy_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("grabpay_sg_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.on("fpx_redirect",t=>{const{redirectUrl:e}=t.payload;e&&(window.location.href=e)}),this.sdk.initialize({amount:this.amount,currency:this.currency,orderId:this.orderId})):console.error("OnePayment: email is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: lastName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: firstName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: Missing required props. Ensure config, adapters, amount, currency, and orderId are provided.")}handleMethodSelect(t){this.paymentLocked||(this.selectedMethod=t)}handleQRScanned(){null!==this.qrAutoResumeTimer&&(clearTimeout(this.qrAutoResumeTimer),this.qrAutoResumeTimer=null),this.qrPollingInProgress=!0,this.sdk&&this.sdk.resumePolling()}handle3DSComplete(){this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()}handleInputChange(t,e){if(this.cardFormData={...this.cardFormData,[t]:e},this.formErrors[t]){const e={...this.formErrors};delete e[t],this.formErrors=e}}luhnCheck(t){const e=t.replace(/\s/g,"");if(!/^\d+$/.test(e))return!1;let r=0,n=!1;for(let i=e.length-1;i>=0;i--){const t=e.charAt(i);if(!t)continue;let a=parseInt(t,10);n&&(a*=2,a>9&&(a-=9)),r+=a,n=!n}return r%10==0}validateExpiry(t){const e=t.trim();if(!/^\d{1,2}\/\d{2}$/.test(e))return{valid:!1,error:"Invalid format (MM/YY)"};const r=e.split("/"),n=r[0],i=r[1];if(!n||!i)return{valid:!1,error:"Invalid format (MM/YY)"};const a=parseInt(n,10);if(a<1||a>12)return{valid:!1,error:"Invalid month (01-12)"};const o=new Date,s=o.getFullYear(),d=o.getMonth()+1;let l;if(2!==i.length)return{valid:!1,error:"Invalid year format"};{const t=parseInt(i,10),e=s%100,r=100*Math.floor(s/100);if(t<e){l=e-t>80?r+100+t:r+t}else l=r+t}return l<s||l===s&&a<d?{valid:!1,error:"Card has expired"}:{valid:!0}}validateCardForm(){const t={};if(this.cardFormData.cardNumber.trim()?this.luhnCheck(this.cardFormData.cardNumber)||(t.cardNumber="Invalid card number"):t.cardNumber="Please enter card number",this.cardFormData.expiry.trim()){const e=this.validateExpiry(this.cardFormData.expiry);e.valid||(t.expiry=e.error)}else t.expiry="Please enter expiry date";return this.cardFormData.cvv.trim()||(t.cvv="Please enter CVV"),this.cardFormData.cardholderName.trim()||(t.cardholderName="Please enter cardholder name"),this.formErrors=t,0===Object.keys(t).length}handleCardPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(!this.validateCardForm())return;this.paymentLocked=!0;const t=this.cardFormData.expiry.split("/"),e=(t[0]||"").trim(),r=`20${(t[1]||"").trim().substring(0,2)}`,n=this.formatNamesUppercase();this.sdk.submitPayment(pt,{cardNumber:this.cardFormData.cardNumber.replace(/\s/g,""),expiryMonth:e,expiryYear:r,cvv:this.cardFormData.cvv,firstName:n.firstName,lastName:n.lastName,email:this.email,phoneNumber:this.phoneNumber})}handlePayNowPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment(mt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber})}handlePromptPayPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment(ft,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber})}handleDuitNowPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment($t,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber})}handleGoPayPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment(gt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber})}handleBoostPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(yt);this.sdk.submitPayment(yt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleShopeePayPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(vt);this.sdk.submitPayment(vt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleAtomPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(bt);this.sdk.submitPayment(bt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleDanaPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(wt);this.sdk.submitPayment(wt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleTngPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(xt);this.sdk.submitPayment(xt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleAlipayCNPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(Pt);this.sdk.submitPayment(Pt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleAlipayHKPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(Ct);this.sdk.submitPayment(Ct,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleGCashPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(kt);this.sdk.submitPayment(kt,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handleKonbiniPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.formatNamesUppercase(),e=this.getEffectivePhoneNumber(St);this.sdk.submitPayment(St,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:e})}handlePayEasyPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(this.phoneInputValue&&!this.validatePhoneInput())return;this.paymentLocked=!0;const t=this.getEffectivePhoneNumber(Nt),e=this.formatNamesForPayEasy(this.firstName,this.lastName);this.sdk.submitPayment(Nt,{firstName:e.firstName,lastName:e.lastName,email:this.email,phoneNumber:t})}handleGrabPaySGPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment(Et,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber})}handleFPXPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(!this.selectedBank)return;this.paymentLocked=!0;const t=this.formatNamesUppercase();this.sdk.submitPayment(It,{firstName:t.firstName,lastName:t.lastName,email:this.email,phoneNumber:this.phoneNumber,bankName:this.selectedBank.bankName})}async fetchBanks(t){if(this.sdk){this.banksLoading=!0,this.availableBanks=[],this.selectedBank=null,this.bankSearchQuery="";try{const e=await this.sdk.getBanks(t);this.availableBanks=e}catch(e){console.error("Error fetching banks:",e),this.availableBanks=[]}finally{this.banksLoading=!1}}}handleBankSelect(t){this.selectedBank=t,this.bankSearchQuery=t.displayName}getFilteredBanks(){if(!this.bankSearchQuery.trim())return this.availableBanks;const t=this.bankSearchQuery.toLowerCase();return this.availableBanks.filter(e=>e.displayName.toLowerCase().includes(t)||e.bankName.toLowerCase().includes(t))}isJapanOnlyPhoneMethod(t){return this.JAPAN_ONLY_PHONE_METHODS.includes(t)}getFormattedPhoneWithCountryCode(){if(!this.phoneInputValue.trim())return"";try{const t=function(){return Mr(Si,arguments)}(this.phoneInputValue,this.selectedCountry);if(t)return t.formatInternational()}catch{}const t=this.COUNTRY_OPTIONS.find(t=>t.code===this.selectedCountry);return`${(null==t?void 0:t.dialCode)||"+65"} ${this.phoneInputValue.replace(/\D/g,"")}`}getEffectivePhoneNumber(t){if(this.phoneInputValue.trim()){const e=this.getFormattedPhoneWithCountryCode();return this.isJapanOnlyPhoneMethod(t)?this.formatPhoneForJapan(e):e}return this.phoneNumber||""}formatPhoneForJapan(t){return t?t.startsWith("+81")?"0"+t.slice(3).replace(/\s/g,""):t.replace(/\s/g,""):""}formatNamesForPayEasy(t,e){const r=t.toUpperCase(),n=e.toUpperCase();if(r.length+n.length<=9)return{firstName:r,lastName:n};const i=Math.floor(4.5);let a=r,o=n;return r.length<=i?o=n.slice(0,9-r.length):n.length<=i?a=r.slice(0,9-n.length):(a=r.slice(0,i),o=n.slice(0,9-i)),{firstName:a,lastName:o}}formatNamesUppercase(){return{firstName:this.firstName.toUpperCase(),lastName:this.lastName.toUpperCase()}}validatePhoneInput(){const t=this.phoneInputValue.trim();if(!t)return this.phoneInputError="Phone number is required",!1;if(t.replace(/\D/g,"").length<this.MIN_PHONE_LENGTH)return this.phoneInputError=`Phone number must be at least ${this.MIN_PHONE_LENGTH} digits`,!1;try{const e=function(){return Mr(Di,arguments)}(t,this.selectedCountry);if(!e)return this.phoneInputError="Please enter a valid phone number",!1}catch{return this.phoneInputError="Please enter a valid phone number",!1}return this.phoneInputError="",!0}handlePhoneInputChange(t){const e=t.target;let r=e.value.replace(/\D/g,"");const n={JP:11,CN:11,SG:8,MY:10,ID:12,TH:9,PH:10,HK:8}[this.selectedCountry]||15;r.length>n&&(r=r.slice(0,n)),"JP"===this.selectedCountry&&r.length>0&&!r.startsWith("0")&&(r="0"+r,r.length>n&&(r=r.slice(0,n)));const i=new Oa(this.selectedCountry).input(r);this.phoneInputValue=i,e.value=i,this.phoneInputError&&(this.phoneInputError="")}handleCountryChange(t){const e=t.target;this.selectedCountry=e.value,this.phoneInputValue="",this.phoneInputError=""}getPayButtonAmount(){const t=this.getTransactionData();return`${this.currency} ${t.netAmount.toFixed(2)}`}getTransactionData(){var t;const e=this.paymentData;if(!e)return{currency:this.currency,charge:this.amount,fees:0,feeBreakdown:{transactionFee:0,merchantFee:0,merchantFeeLabel:""},netAmount:this.amount};const r=null==(t=e.fees)?void 0:t.find(t=>"merchant"===t.owner),n="number"==typeof e.totalFee?e.totalFee:Number(e.totalFee)||0,i="number"==typeof e.totalSystemFee?e.totalSystemFee:Number(e.totalSystemFee)||0,a=null!=e.initialAmount?"number"==typeof e.initialAmount?e.initialAmount:Number(e.initialAmount)||0:this.amount,o=null!=e.customerAmount?"number"==typeof e.customerAmount?e.customerAmount:Number(e.customerAmount)||0:a,s=n-i;return{currency:e.currency||this.currency,charge:a,fees:n,feeBreakdown:{transactionFee:s,merchantFee:s,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:o}}renderTransactionDetailsSkeleton(){return z`
12
12
  <div class="skeleton-transaction">
13
13
  <div class="skeleton skeleton-title"></div>
14
14
  <div class="skeleton-row">
@@ -29,7 +29,7 @@ var OnePayments=function(t){"use strict";
29
29
  <div class="skeleton skeleton-net-value"></div>
30
30
  </div>
31
31
  </div>
32
- `}renderPaymentMethodsSkeleton(){return H`
32
+ `}renderPaymentMethodsSkeleton(){return z`
33
33
  <div>
34
34
  <div class="skeleton-method">
35
35
  <div class="skeleton skeleton-radio"></div>
@@ -42,13 +42,13 @@ var OnePayments=function(t){"use strict";
42
42
  <div class="skeleton skeleton-method-name"></div>
43
43
  </div>
44
44
  </div>
45
- `}renderSkeletons(){const t=[this.width?`--one-payment-width: ${this.width}`:"",this.maxWidth?`--one-payment-max-width: ${this.maxWidth}`:""].filter(Boolean).join("; ");return H`
45
+ `}renderSkeletons(){const t=[this.width?`--one-payment-width: ${this.width}`:"",this.maxWidth?`--one-payment-max-width: ${this.maxWidth}`:""].filter(Boolean).join("; ");return z`
46
46
  <div class="payment-element" style="${t}">
47
47
  ${this.renderTransactionDetailsSkeleton()}
48
48
  <div class="header">Select a payment method</div>
49
49
  ${this.renderPaymentMethodsSkeleton()}
50
50
  </div>
51
- `}renderTransactionDetails(){const t=this.getTransactionData(),e=t=>t.toFixed(2);return H`
51
+ `}renderTransactionDetails(){const t=this.getTransactionData(),e=t=>t.toFixed(2);return z`
52
52
  <div class="transaction-details">
53
53
  <h2 class="transaction-title">Transaction details</h2>
54
54
 
@@ -79,7 +79,7 @@ var OnePayments=function(t){"use strict";
79
79
  class="fee-breakdown"
80
80
  style=${`\n max-height: ${this.feesExpanded?"200px":"0"};\n opacity: ${this.feesExpanded?1:0};\n margin-top: ${this.feesExpanded?"0.625rem":"0"};\n `}
81
81
  >
82
- ${t.feeBreakdown?H`
82
+ ${t.feeBreakdown?z`
83
83
  <div class="fee-breakdown-inner">
84
84
  <div class="breakdown-row">
85
85
  <span class="breakdown-label">Transaction fee:</span>
@@ -105,7 +105,7 @@ var OnePayments=function(t){"use strict";
105
105
  <span class="net-value">${e(t.netAmount)}</span>
106
106
  </div>
107
107
  </div>
108
- `}renderCardForm(){setTimeout(()=>this.setupCleave(),0);const t="amex"===this.cardBrand?4:3,e="amex"===this.cardBrand?"1234":"123";return H`
108
+ `}renderCardForm(){setTimeout(()=>this.setupCleave(),0);const t="amex"===this.cardBrand?4:3,e="amex"===this.cardBrand?"1234":"123";return z`
109
109
  <div class="card-form">
110
110
  <h4 class="form-title">Card Information</h4>
111
111
  <div class="form-fields">
@@ -120,7 +120,7 @@ var OnePayments=function(t){"use strict";
120
120
  .value=${this.cardFormData.cardNumber}
121
121
  @input=${t=>this.handleInputChange("cardNumber",t.target.value)}
122
122
  />
123
- ${this.formErrors.cardNumber?H`<div class="error-message">${this.formErrors.cardNumber}</div>`:""}
123
+ ${this.formErrors.cardNumber?z`<div class="error-message">${this.formErrors.cardNumber}</div>`:""}
124
124
  </div>
125
125
 
126
126
  <!-- Single Expiry Field -->
@@ -134,7 +134,7 @@ var OnePayments=function(t){"use strict";
134
134
  .value=${this.cardFormData.expiry}
135
135
  @input=${t=>{const e=t.target;setTimeout(()=>{this.handleInputChange("expiry",e.value)},0)}}
136
136
  />
137
- ${this.formErrors.expiry?H`<div class="error-message">${this.formErrors.expiry}</div>`:""}
137
+ ${this.formErrors.expiry?z`<div class="error-message">${this.formErrors.expiry}</div>`:""}
138
138
  </div>
139
139
 
140
140
  <!-- CVV -->
@@ -148,7 +148,7 @@ var OnePayments=function(t){"use strict";
148
148
  .value=${this.cardFormData.cvv}
149
149
  @input=${t=>{const e=t.target.value.replace(/\D/g,"");t.target.value=e,this.handleInputChange("cvv",e)}}
150
150
  />
151
- ${this.formErrors.cvv?H`<div class="error-message">${this.formErrors.cvv}</div>`:""}
151
+ ${this.formErrors.cvv?z`<div class="error-message">${this.formErrors.cvv}</div>`:""}
152
152
  </div>
153
153
 
154
154
  <!-- Cardholder Name -->
@@ -161,7 +161,7 @@ var OnePayments=function(t){"use strict";
161
161
  .value=${this.cardFormData.cardholderName}
162
162
  @input=${t=>{const e=t.target.value.replace(/[^A-Za-z\s]/g,"").toUpperCase();t.target.value=e,this.handleInputChange("cardholderName",e)}}
163
163
  />
164
- ${this.formErrors.cardholderName?H`<div class="error-message">${this.formErrors.cardholderName}</div>`:""}
164
+ ${this.formErrors.cardholderName?z`<div class="error-message">${this.formErrors.cardholderName}</div>`:""}
165
165
  </div>
166
166
  </div>
167
167
 
@@ -175,7 +175,7 @@ var OnePayments=function(t){"use strict";
175
175
  </button>
176
176
  </div>
177
177
  </div>
178
- `}renderPayNowContent(){return this.showQRModal&&this.qrCodeDataUrl?H`
178
+ `}renderPayNowContent(){return this.showQRModal&&this.qrCodeDataUrl?z`
179
179
  <div class="paynow-container">
180
180
  <!-- Render generated QR code image -->
181
181
  <div class="qr-code-wrapper">
@@ -190,7 +190,7 @@ var OnePayments=function(t){"use strict";
190
190
  ${this.qrPollingInProgress?"Verifying...":"I Have Scanned the QR Code"}
191
191
  </button>
192
192
  </div>
193
- `:H`
193
+ `:z`
194
194
  <div class="paynow-container">
195
195
  <div class="paynow-instructions">
196
196
  <h3 class="instructions-title">How to Pay by QR:</h3>
@@ -218,7 +218,7 @@ var OnePayments=function(t){"use strict";
218
218
  </div>
219
219
  </div>
220
220
  </div>
221
- `}renderPromptPayContent(){return H`
221
+ `}renderPromptPayContent(){return z`
222
222
  <div class="paynow-container">
223
223
  <div class="paynow-instructions">
224
224
  <h3 class="instructions-title">How to Pay with PromptPay:</h3>
@@ -251,7 +251,7 @@ var OnePayments=function(t){"use strict";
251
251
  </div>
252
252
  </div>
253
253
  </div>
254
- `}renderDuitNowContent(){return H`
254
+ `}renderDuitNowContent(){return z`
255
255
  <div class="paynow-container">
256
256
  <div class="paynow-instructions">
257
257
  <h3 class="instructions-title">How to Pay with DuitNow:</h3>
@@ -284,7 +284,7 @@ var OnePayments=function(t){"use strict";
284
284
  </div>
285
285
  </div>
286
286
  </div>
287
- `}renderGoPayContent(){return H`
287
+ `}renderGoPayContent(){return z`
288
288
  <div class="paynow-container">
289
289
  <div class="paynow-instructions">
290
290
  <h3 class="instructions-title">How to Pay with GoPay:</h3>
@@ -317,11 +317,50 @@ var OnePayments=function(t){"use strict";
317
317
  </div>
318
318
  </div>
319
319
  </div>
320
- `}renderBoostContent(){return H`
320
+ `}renderPhoneInput(t){const e=this.isJapanOnlyPhoneMethod(t);return e&&"JP"!==this.selectedCountry&&(this.selectedCountry="JP"),z`
321
+ <div class="phone-input-section">
322
+ <label class="phone-input-label">
323
+ ${e?"Phone number (Japan)":"Phone number"}
324
+ <span style="color: var(--op-color-danger);">*</span>
325
+ </label>
326
+ <div class="phone-input-wrapper">
327
+ <select
328
+ class="country-code-select"
329
+ .value=${this.selectedCountry}
330
+ @change=${this.handleCountryChange}
331
+ ?disabled=${e}
332
+ >
333
+ ${e?z`<option value="JP">🇯🇵 +81</option>`:this.COUNTRY_OPTIONS.map(t=>z`
334
+ <option value=${t.code} ?selected=${this.selectedCountry===t.code}>
335
+ ${t.flag} ${t.dialCode}
336
+ </option>
337
+ `)}
338
+ </select>
339
+ <input
340
+ type="tel"
341
+ class="phone-input-field ${this.phoneInputError?"error":""}"
342
+ placeholder=${e?"Enter your Japanese phone number":"Enter your phone number"}
343
+ .value=${this.phoneInputValue}
344
+ @input=${this.handlePhoneInputChange}
345
+ @blur=${()=>this.validatePhoneInput()}
346
+ />
347
+ </div>
348
+ ${this.phoneInputError?z`<div class="phone-input-error">${this.phoneInputError}</div>`:""}
349
+ ${e?z`<div class="phone-japan-note">
350
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
351
+ <circle cx="12" cy="12" r="10"/>
352
+ <path d="M12 16v-4M12 8h.01"/>
353
+ </svg>
354
+ Phone number must be a valid Japanese number (+81)
355
+ </div>`:""}
356
+ </div>
357
+ `}renderBoostContent(){return z`
321
358
  <div class="paynow-container">
322
359
  <div class="paynow-instructions">
323
360
  <h3 class="instructions-title">How to Pay with Boost:</h3>
324
361
 
362
+ ${this.renderPhoneInput(yt)}
363
+
325
364
  <div class="instruction-steps">
326
365
  <div class="instruction-step">
327
366
  <div class="step-number">1</div>
@@ -350,11 +389,13 @@ var OnePayments=function(t){"use strict";
350
389
  </div>
351
390
  </div>
352
391
  </div>
353
- `}renderShopeePayContent(){return H`
392
+ `}renderShopeePayContent(){return z`
354
393
  <div class="paynow-container">
355
394
  <div class="paynow-instructions">
356
395
  <h3 class="instructions-title">How to Pay with ShopeePay:</h3>
357
396
 
397
+ ${this.renderPhoneInput(vt)}
398
+
358
399
  <div class="instruction-steps">
359
400
  <div class="instruction-step">
360
401
  <div class="step-number">1</div>
@@ -383,11 +424,13 @@ var OnePayments=function(t){"use strict";
383
424
  </div>
384
425
  </div>
385
426
  </div>
386
- `}renderAtomContent(){return H`
427
+ `}renderAtomContent(){return z`
387
428
  <div class="paynow-container">
388
429
  <div class="paynow-instructions">
389
430
  <h3 class="instructions-title">How to Pay with Atome:</h3>
390
431
 
432
+ ${this.renderPhoneInput(bt)}
433
+
391
434
  <div class="instruction-steps">
392
435
  <div class="instruction-step">
393
436
  <div class="step-number">1</div>
@@ -416,11 +459,13 @@ var OnePayments=function(t){"use strict";
416
459
  </div>
417
460
  </div>
418
461
  </div>
419
- `}renderDanaContent(){return H`
462
+ `}renderDanaContent(){return z`
420
463
  <div class="paynow-container">
421
464
  <div class="paynow-instructions">
422
465
  <h3 class="instructions-title">How to Pay with Dana:</h3>
423
466
 
467
+ ${this.renderPhoneInput(wt)}
468
+
424
469
  <div class="instruction-steps">
425
470
  <div class="instruction-step">
426
471
  <div class="step-number">1</div>
@@ -449,11 +494,13 @@ var OnePayments=function(t){"use strict";
449
494
  </div>
450
495
  </div>
451
496
  </div>
452
- `}renderTngContent(){return H`
497
+ `}renderTngContent(){return z`
453
498
  <div class="paynow-container">
454
499
  <div class="paynow-instructions">
455
500
  <h3 class="instructions-title">How to Pay with Touch 'n Go:</h3>
456
501
 
502
+ ${this.renderPhoneInput(xt)}
503
+
457
504
  <div class="instruction-steps">
458
505
  <div class="instruction-step">
459
506
  <div class="step-number">1</div>
@@ -482,11 +529,13 @@ var OnePayments=function(t){"use strict";
482
529
  </div>
483
530
  </div>
484
531
  </div>
485
- `}renderAlipayCNContent(){return H`
532
+ `}renderAlipayCNContent(){return z`
486
533
  <div class="paynow-container">
487
534
  <div class="paynow-instructions">
488
535
  <h3 class="instructions-title">How to Pay with Alipay:</h3>
489
536
 
537
+ ${this.renderPhoneInput(Pt)}
538
+
490
539
  <div class="instruction-steps">
491
540
  <div class="instruction-step">
492
541
  <div class="step-number">1</div>
@@ -515,11 +564,13 @@ var OnePayments=function(t){"use strict";
515
564
  </div>
516
565
  </div>
517
566
  </div>
518
- `}renderAlipayHKContent(){return H`
567
+ `}renderAlipayHKContent(){return z`
519
568
  <div class="paynow-container">
520
569
  <div class="paynow-instructions">
521
570
  <h3 class="instructions-title">How to Pay with AlipayHK:</h3>
522
571
 
572
+ ${this.renderPhoneInput(Ct)}
573
+
523
574
  <div class="instruction-steps">
524
575
  <div class="instruction-step">
525
576
  <div class="step-number">1</div>
@@ -548,11 +599,13 @@ var OnePayments=function(t){"use strict";
548
599
  </div>
549
600
  </div>
550
601
  </div>
551
- `}renderGCashContent(){return H`
602
+ `}renderGCashContent(){return z`
552
603
  <div class="paynow-container">
553
604
  <div class="paynow-instructions">
554
605
  <h3 class="instructions-title">How to Pay with GCash:</h3>
555
606
 
607
+ ${this.renderPhoneInput(kt)}
608
+
556
609
  <div class="instruction-steps">
557
610
  <div class="instruction-step">
558
611
  <div class="step-number">1</div>
@@ -581,7 +634,213 @@ var OnePayments=function(t){"use strict";
581
634
  </div>
582
635
  </div>
583
636
  </div>
584
- `}render3DSModal(){return this.show3DSModal&&this.nextActionUrl?H`
637
+ `}renderKonbiniContent(){return z`
638
+ <div class="paynow-container">
639
+ <div class="paynow-instructions">
640
+ <h3 class="instructions-title">How to Pay with Konbini:</h3>
641
+
642
+ ${this.renderPhoneInput(St)}
643
+
644
+ <div class="instruction-steps">
645
+ <div class="instruction-step">
646
+ <div class="step-number">1</div>
647
+ <p class="step-text">Click <strong>"Pay"</strong> to get your payment code.</p>
648
+ </div>
649
+
650
+ <div class="instruction-step">
651
+ <div class="step-number">2</div>
652
+ <p class="step-text">Visit any convenience store and show the code.</p>
653
+ </div>
654
+
655
+ <div class="instruction-step">
656
+ <div class="step-number">3</div>
657
+ <p class="step-text">Complete the payment at the register.</p>
658
+ </div>
659
+ </div>
660
+
661
+ <div class="submit-section">
662
+ <button
663
+ class="pay-button ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"loading":""}"
664
+ @click=${this.handleKonbiniPayment}
665
+ ?disabled=${"processing"===this.currentState.status||"requires_action"===this.currentState.status}
666
+ >
667
+ ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"Redirecting...":`Pay ${this.getPayButtonAmount()}`}
668
+ </button>
669
+ </div>
670
+ </div>
671
+ </div>
672
+ `}renderPayEasyContent(){return z`
673
+ <div class="paynow-container">
674
+ <div class="paynow-instructions">
675
+ <h3 class="instructions-title">How to Pay with Pay-Easy:</h3>
676
+
677
+ ${this.renderPhoneInput(Nt)}
678
+
679
+ <div class="instruction-steps">
680
+ <div class="instruction-step">
681
+ <div class="step-number">1</div>
682
+ <p class="step-text">Click <strong>"Pay"</strong> to get your payment details.</p>
683
+ </div>
684
+
685
+ <div class="instruction-step">
686
+ <div class="step-number">2</div>
687
+ <p class="step-text">
688
+ Use your bank's ATM or online banking to complete the transfer.
689
+ </p>
690
+ </div>
691
+
692
+ <div class="instruction-step">
693
+ <div class="step-number">3</div>
694
+ <p class="step-text">Enter the payment details provided.</p>
695
+ </div>
696
+ </div>
697
+
698
+ <div class="submit-section">
699
+ <button
700
+ class="pay-button ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"loading":""}"
701
+ @click=${this.handlePayEasyPayment}
702
+ ?disabled=${"processing"===this.currentState.status||"requires_action"===this.currentState.status}
703
+ >
704
+ ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"Redirecting...":`Pay ${this.getPayButtonAmount()}`}
705
+ </button>
706
+ </div>
707
+ </div>
708
+ </div>
709
+ `}renderGrabPaySGContent(){return z`
710
+ <div class="paynow-container">
711
+ <div class="paynow-instructions">
712
+ <h3 class="instructions-title">How to Pay with GrabPay:</h3>
713
+
714
+ <div class="instruction-steps">
715
+ <div class="instruction-step">
716
+ <div class="step-number">1</div>
717
+ <p class="step-text">Click <strong>"Pay"</strong> to open GrabPay.</p>
718
+ </div>
719
+
720
+ <div class="instruction-step">
721
+ <div class="step-number">2</div>
722
+ <p class="step-text">Log in to your GrabPay account.</p>
723
+ </div>
724
+
725
+ <div class="instruction-step">
726
+ <div class="step-number">3</div>
727
+ <p class="step-text">Confirm and complete your payment.</p>
728
+ </div>
729
+ </div>
730
+
731
+ <div class="submit-section">
732
+ <button
733
+ class="pay-button ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"loading":""}"
734
+ @click=${this.handleGrabPaySGPayment}
735
+ ?disabled=${"processing"===this.currentState.status||"requires_action"===this.currentState.status}
736
+ >
737
+ ${"processing"===this.currentState.status||"requires_action"===this.currentState.status?"Redirecting...":`Pay ${this.getPayButtonAmount()}`}
738
+ </button>
739
+ </div>
740
+ </div>
741
+ </div>
742
+ `}renderFPXContent(){0!==this.availableBanks.length||this.banksLoading||this.fetchBanks("fpx");const t=this.getFilteredBanks(),e="processing"===this.currentState.status||"requires_action"===this.currentState.status;return z`
743
+ <div class="fpx-container">
744
+ <div class="fpx-instructions">
745
+ <h3 class="instructions-title">Pay with FPX Online Banking</h3>
746
+ <p class="fpx-description">
747
+ Select your bank below and you'll be redirected to complete the payment securely.
748
+ </p>
749
+ </div>
750
+
751
+ <div class="bank-selection-wrapper">
752
+ <label class="form-label">Select Your Bank</label>
753
+ <div class="bank-search-container">
754
+ <input
755
+ type="text"
756
+ class="input bank-search-input"
757
+ placeholder="Search for your bank..."
758
+ .value=${this.bankSearchQuery}
759
+ @input=${t=>{const e=t.target;this.bankSearchQuery=e.value,this.selectedBank&&e.value!==this.selectedBank.displayName&&(this.selectedBank=null)}}
760
+ @focus=${()=>{this.selectedBank&&(this.bankSearchQuery="",this.selectedBank=null)}}
761
+ />
762
+ <div class="bank-search-icon">
763
+ <svg
764
+ width="20"
765
+ height="20"
766
+ viewBox="0 0 24 24"
767
+ fill="none"
768
+ xmlns="http://www.w3.org/2000/svg"
769
+ >
770
+ <path
771
+ d="M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z"
772
+ stroke="currentColor"
773
+ stroke-width="2"
774
+ stroke-linecap="round"
775
+ stroke-linejoin="round"
776
+ />
777
+ </svg>
778
+ </div>
779
+ </div>
780
+
781
+ ${this.banksLoading?z`
782
+ <div class="bank-loading">
783
+ <div class="bank-loading-spinner"></div>
784
+ <span>Loading banks...</span>
785
+ </div>
786
+ `:z`
787
+ <div class="bank-grid">
788
+ ${t.map(t=>{var e,r;return z`
789
+ <div
790
+ class="bank-card ${(null==(e=this.selectedBank)?void 0:e.bankName)===t.bankName?"selected":""}"
791
+ @click=${()=>this.handleBankSelect(t)}
792
+ >
793
+ <div class="bank-logo-wrapper">
794
+ ${t.logoUrl?z`<img
795
+ class="bank-logo"
796
+ src="${t.logoUrl}"
797
+ alt="${t.displayName}"
798
+ @error=${e=>{const r=e.target;r.style.display="none";const n=r.parentElement;n&&(n.innerHTML=`<div class="bank-logo-fallback">${t.displayName.charAt(0)}</div>`)}}
799
+ />`:z`<div class="bank-logo-fallback">
800
+ ${t.displayName.charAt(0)}
801
+ </div>`}
802
+ </div>
803
+ <span class="bank-name">${t.displayName}</span>
804
+ ${(null==(r=this.selectedBank)?void 0:r.bankName)===t.bankName?z`<div class="bank-check">
805
+ <svg
806
+ width="16"
807
+ height="16"
808
+ viewBox="0 0 24 24"
809
+ fill="none"
810
+ xmlns="http://www.w3.org/2000/svg"
811
+ >
812
+ <path
813
+ d="M20 6L9 17L4 12"
814
+ stroke="currentColor"
815
+ stroke-width="2"
816
+ stroke-linecap="round"
817
+ stroke-linejoin="round"
818
+ />
819
+ </svg>
820
+ </div>`:""}
821
+ </div>
822
+ `})}
823
+ </div>
824
+
825
+ ${0===t.length&&this.bankSearchQuery?z`
826
+ <div class="bank-no-results">
827
+ <p>No banks found matching "${this.bankSearchQuery}"</p>
828
+ </div>
829
+ `:""}
830
+ `}
831
+ </div>
832
+
833
+ <div class="submit-section">
834
+ <button
835
+ class="pay-button ${e?"loading":""}"
836
+ @click=${this.handleFPXPayment}
837
+ ?disabled=${e||!this.selectedBank}
838
+ >
839
+ ${e?"Redirecting to bank...":this.selectedBank?`Pay ${this.getPayButtonAmount()}`:"Select a bank to continue"}
840
+ </button>
841
+ </div>
842
+ </div>
843
+ `}render3DSModal(){return this.show3DSModal&&this.nextActionUrl?z`
585
844
  <div class="modal-overlay">
586
845
  <div class="modal-content iframe-modal">
587
846
  <iframe
@@ -592,7 +851,7 @@ var OnePayments=function(t){"use strict";
592
851
  ></iframe>
593
852
  </div>
594
853
  </div>
595
- `:null}renderStatusBlock(){if("succeeded"===this.currentState.status){const t=this.getTransactionData(),e=t.netAmount.toFixed(2);return H`
854
+ `:null}renderStatusBlock(){if("succeeded"===this.currentState.status){const t=this.getTransactionData(),e=t.netAmount.toFixed(2);return z`
596
855
  <div class="result-card success">
597
856
  <div class="result-icon-wrapper">
598
857
  <div class="result-icon">✓</div>
@@ -603,7 +862,7 @@ var OnePayments=function(t){"use strict";
603
862
  successfully.
604
863
  </p>
605
864
  </div>
606
- `}if("failed"===this.currentState.status){const t=this.currentState.error?this.currentState.error.message:"An error occurred while processing your payment";return H`
865
+ `}if("failed"===this.currentState.status){const t=this.currentState.error?this.currentState.error.message:"An error occurred while processing your payment";return z`
607
866
  <div class="result-card error">
608
867
  <div class="result-icon-wrapper">
609
868
  <div class="result-icon">✕</div>
@@ -611,16 +870,16 @@ var OnePayments=function(t){"use strict";
611
870
  <h2 class="result-title">Payment Failed</h2>
612
871
  <p class="result-message">${t}</p>
613
872
  </div>
614
- `}return null}render(){if(("idle"===this.currentState.status||"initializing"===this.currentState.status)&&this.isInitializing&&!this.paymentData)return this.renderSkeletons();const t="succeeded"===this.currentState.status||"failed"===this.currentState.status,e=!t,r=this.getFilteredPaymentMethods();if(r.length>0){const t=r.some(t=>t.id===this.selectedMethod&&t.enabled);if(!this.selectedMethod||!t){const t=r.find(t=>t.enabled);t&&this.selectedMethod!==t.id&&(this.selectedMethod=t.id)}}const i=[this.width?`--one-payment-width: ${this.width}`:"",this.maxWidth?`--one-payment-max-width: ${this.maxWidth}`:""].filter(Boolean).join("; ");return H`
615
- <div class="payment-element" style="${i}">
873
+ `}return null}render(){if(("idle"===this.currentState.status||"initializing"===this.currentState.status)&&this.isInitializing&&!this.paymentData)return this.renderSkeletons();const t="succeeded"===this.currentState.status||"failed"===this.currentState.status,e=!t,r=this.getFilteredPaymentMethods();if(r.length>0){const t=r.some(t=>t.id===this.selectedMethod&&t.enabled);if(!this.selectedMethod||!t){const t=r.find(t=>t.enabled);t&&this.selectedMethod!==t.id&&(this.selectedMethod=t.id)}}const n=[this.width?`--one-payment-width: ${this.width}`:"",this.maxWidth?`--one-payment-max-width: ${this.maxWidth}`:""].filter(Boolean).join("; ");return z`
874
+ <div class="payment-element" style="${n}">
616
875
  ${this.renderTransactionDetails()}
617
- ${e?H`
876
+ ${e?z`
618
877
  <div class="header">Select a payment method</div>
619
878
  <div class="payment-methods-list">
620
- ${r.map(t=>{const e=this.selectedMethod===t.id,r=!t.enabled||this.paymentLocked&&!e;return H`
879
+ ${r.map(t=>{const e=this.selectedMethod===t.id,r=!t.enabled||this.paymentLocked&&!e;return z`
621
880
  <div
622
881
  class="payment-method-item"
623
- ${t.disabledReason?H`data-tooltip="${t.disabledReason}"`:""}
882
+ ${t.disabledReason?z`data-tooltip="${t.disabledReason}"`:""}
624
883
  >
625
884
  <div
626
885
  class="method-header ${e?"selected":""} ${r?"disabled":""}"
@@ -634,8 +893,8 @@ var OnePayments=function(t){"use strict";
634
893
  ?disabled=${r}
635
894
  @click=${e=>{e.stopPropagation(),t.enabled&&this.handleMethodSelect(t.id)}}
636
895
  />
637
- <span class="method-name">${(t=>{switch(t){case ht:return"Card";case pt:return"PayNow";case mt:return"PromptPay";case gt:return"DuitNow";case ft:return"GoPay";case yt:return"Boost";case vt:return"ShopeePay";case bt:return"Atome";case wt:return"Dana";case xt:return"Touch 'n Go";case kt:return"Alipay";case St:return"AlipayHK";case Pt:return"GCash";default:return t}})(t.id)}</span>
638
- ${i=t.id,i===ht?H`
896
+ <span class="method-name">${(t=>{switch(t){case pt:return"Card";case mt:return"PayNow";case ft:return"PromptPay";case $t:return"DuitNow";case gt:return"GoPay";case yt:return"Boost";case vt:return"ShopeePay";case bt:return"Atome";case wt:return"Dana";case xt:return"Touch 'n Go";case Pt:return"Alipay";case Ct:return"AlipayHK";case kt:return"GCash";case St:return"Konbini";case Nt:return"Pay-Easy";case Et:return"GrabPay";case It:return"FPX Online Banking";default:return t}})(t.id)}</span>
897
+ ${n=t.id,n===pt?z`
639
898
  <div class="method-icon-right">
640
899
  <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
641
900
  <path
@@ -648,68 +907,100 @@ var OnePayments=function(t){"use strict";
648
907
  />
649
908
  </svg>
650
909
  </div>
651
- `:i===pt?H`
910
+ `:n===mt?z`
652
911
  <div class="method-icon-right">
653
912
  <img src="${"https://images.ctfassets.net/c3n7jozh84hr/2A5qlS6JkUsOyFVPzQ0KlK/22b497afd71030ef1a44a52394b15027/______2022-06-30_11.03.43.png"}" alt="PayNow" style="width: 45px; height: auto;" />
654
913
  </div>
655
- `:i===mt?H`
914
+ `:n===ft?z`
656
915
  <div class="method-icon-right">
657
- <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png"}" alt="PromptPay" style="width: 45px; height: auto;" />
916
+ <img
917
+ src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png"}"
918
+ alt="PromptPay"
919
+ style="width: 45px; height: auto;"
920
+ />
658
921
  </div>
659
- `:i===gt?H`
922
+ `:n===$t?z`
660
923
  <div class="method-icon-right">
661
924
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4Iq13VoxktB3amHFbQK1yb/f2fe12add0dac233d56c22cf5651c65c/image-20220630-030728.png"}" alt="DuitNow" style="width: 45px; height: auto;" />
662
925
  </div>
663
- `:i===ft?H`
926
+ `:n===gt?z`
664
927
  <div class="method-icon-right">
665
928
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/mjau5Tqscwu9tbhRLFbmJ/a66cd2894060b2d3a94b75d7f4e65355/______2022-07-04_17.05.18.png"}" alt="GoPay" style="width: 45px; height: auto;" />
666
929
  </div>
667
- `:i===yt?H`
930
+ `:n===yt?z`
668
931
  <div class="method-icon-right">
669
932
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1M4DBVFhOrkprPmjxZwS7M/c4a90840d3846b926d3a5524392435fe/Boost.svg"}" alt="Boost" style="width: 45px; height: auto;" />
670
933
  </div>
671
- `:i===vt?H`
934
+ `:n===vt?z`
672
935
  <div class="method-icon-right">
673
- <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg"}" alt="ShopeePay" style="width: 45px; height: auto;" />
936
+ <img
937
+ src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg"}"
938
+ alt="ShopeePay"
939
+ style="width: 45px; height: auto;"
940
+ />
674
941
  </div>
675
- `:i===bt?H`
942
+ `:n===bt?z`
676
943
  <div class="method-icon-right">
677
944
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/61LYQ3RuziTGisarZgaAV1/309f3f1e569609dd0b0095857d6382b5/__2022-05-31_11.44.42.png"}" alt="Atome" style="width: 45px; height: auto;" />
678
945
  </div>
679
- `:i===wt?H`
946
+ `:n===wt?z`
680
947
  <div class="method-icon-right">
681
948
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/79Uj5xItEZE7L51j2oh6IV/6af4cfefdd65834305931fd16f652d87/DANA.svg"}" alt="Dana" style="width: 45px; height: auto;" />
682
949
  </div>
683
- `:i===xt?H`
950
+ `:n===xt?z`
684
951
  <div class="method-icon-right">
685
952
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/15FHwC4H3W0JrNvsqy6TWH/5d18aa44231c55d6457389e17ac7ea0c/TnG.svg"}" alt="Touch 'n Go" style="width: 45px; height: auto;" />
686
953
  </div>
687
- `:i===kt?H`
954
+ `:n===Pt?z`
688
955
  <div class="method-icon-right">
689
956
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/5EK8VF1nACmJ0KpPocLuR7/785178078004e82cb69782c570623b8c/Alipay.svg"}" alt="Alipay" style="width: 45px; height: auto;" />
690
957
  </div>
691
- `:i===St?H`
958
+ `:n===Ct?z`
692
959
  <div class="method-icon-right">
693
- <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg"}" alt="AlipayHK" style="width: 45px; height: auto;" />
960
+ <img
961
+ src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg"}"
962
+ alt="AlipayHK"
963
+ style="width: 45px; height: auto;"
964
+ />
694
965
  </div>
695
- `:i===Pt?H`
966
+ `:n===kt?z`
696
967
  <div class="method-icon-right">
697
968
  <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4WAO5JJPUOrZ9jBA0Vf4tf/c3896e1a5508efa0c569bd3eaa577dad/GCash.svg"}" alt="GCash" style="width: 45px; height: auto;" />
698
969
  </div>
970
+ `:n===St?z`
971
+ <div class="method-icon-right">
972
+ <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/2k2M0v6xdd5HvUNxX2sYCi/c9de881648bdd61adb15ec1941f2d47e/konbini_420x280.png"}" alt="Konbini" style="width: 45px; height: auto;" />
973
+ </div>
974
+ `:n===Nt?z`
975
+ <div class="method-icon-right">
976
+ <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3DKc8YOvmllqXs9MIZvDFU/195c73003eacb07b60dd2740c59ab4e3/Pay-easy.svg"}" alt="Pay-Easy" style="width: 45px; height: auto;" />
977
+ </div>
978
+ `:n===Et?z`
979
+ <div class="method-icon-right">
980
+ <img src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1DshnBdElQDmhfINo/abfc59a3c7cb7f3a89b2d32504971c39/GrabPay.svg"}" alt="GrabPay" style="width: 45px; height: auto;" />
981
+ </div>
982
+ `:n===It?z`
983
+ <div class="method-icon-right">
984
+ <img
985
+ src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/35hEmofKsxnjVV4zidB0Ir/00447c59f79d5c1e095f1354f6b909ce/FPX.svg"}"
986
+ alt="FPX Online Banking"
987
+ style="width: 45px; height: auto;"
988
+ />
989
+ </div>
699
990
  `:null}
700
991
  </div>
701
- ${e?H`<div class="method-content">
702
- ${t.id===ht?this.renderCardForm():t.id===pt?this.renderPayNowContent():t.id===mt?this.renderPromptPayContent():t.id===gt?this.renderDuitNowContent():t.id===ft?this.renderGoPayContent():t.id===yt?this.renderBoostContent():t.id===vt?this.renderShopeePayContent():t.id===bt?this.renderAtomContent():t.id===wt?this.renderDanaContent():t.id===xt?this.renderTngContent():t.id===kt?this.renderAlipayCNContent():t.id===St?this.renderAlipayHKContent():t.id===Pt?this.renderGCashContent():null}
992
+ ${e?z`<div class="method-content">
993
+ ${t.id===pt?this.renderCardForm():t.id===mt?this.renderPayNowContent():t.id===ft?this.renderPromptPayContent():t.id===$t?this.renderDuitNowContent():t.id===gt?this.renderGoPayContent():t.id===yt?this.renderBoostContent():t.id===vt?this.renderShopeePayContent():t.id===bt?this.renderAtomContent():t.id===wt?this.renderDanaContent():t.id===xt?this.renderTngContent():t.id===Pt?this.renderAlipayCNContent():t.id===Ct?this.renderAlipayHKContent():t.id===kt?this.renderGCashContent():t.id===St?this.renderKonbiniContent():t.id===Nt?this.renderPayEasyContent():t.id===Et?this.renderGrabPaySGContent():t.id===It?this.renderFPXContent():null}
703
994
  </div>`:""}
704
995
  </div>
705
- `;var i})}
996
+ `;var n})}
706
997
  </div>
707
998
  `:""}
708
999
  ${t?this.renderStatusBlock():""}
709
1000
  </div>
710
1001
 
711
1002
  ${this.render3DSModal()}
712
- `}};async function _r(t){var e;try{const r=await t.json();return r.message||(null==(e=r.error)?void 0:e.message)||r.error||t.statusText}catch{return t.statusText}}Er.styles=((t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,r,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new o(r,t,n)})`
1003
+ `}};async function Ba(t){var e;try{const r=await t.json();return r.message||(null==(e=r.error)?void 0:e.message)||r.error||t.statusText}catch{return t.statusText}}La.styles=((t,...e)=>{const r=1===t.length?t[0]:e.reduce((e,r,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[n+1],t[0]);return new o(r,t,i)})`
713
1004
  /* ═══════════════════════════════════════════════════════════════
714
1005
  CSS CUSTOM PROPERTIES (Theming)
715
1006
  ═══════════════════════════════════════════════════════════════ */
@@ -2031,5 +2322,331 @@ var OnePayments=function(t){"use strict";
2031
2322
  transform: translateX(-50%) translateY(0);
2032
2323
  }
2033
2324
  }
2034
- `,$r([ct({type:Object})],Er.prototype,"config",2),$r([ct({type:Object})],Er.prototype,"adapters",2),$r([ct({type:Number})],Er.prototype,"amount",2),$r([ct({type:String})],Er.prototype,"currency",2),$r([ct({type:String})],Er.prototype,"orderId",2),$r([ct({type:String})],Er.prototype,"firstName",2),$r([ct({type:String})],Er.prototype,"lastName",2),$r([ct({type:String})],Er.prototype,"email",2),$r([ct({type:String})],Er.prototype,"phoneNumber",2),$r([ct({type:Array})],Er.prototype,"excludePaymentMethods",2),$r([ct({type:String})],Er.prototype,"width",2),$r([ct({type:String})],Er.prototype,"maxWidth",2),$r([ct({type:Object})],Er.prototype,"appearance",2),$r([ut()],Er.prototype,"currentState",2),$r([ut()],Er.prototype,"selectedMethod",2),$r([ut()],Er.prototype,"cardFormData",2),$r([ut()],Er.prototype,"formErrors",2),$r([ut()],Er.prototype,"paymentData",2),$r([ut()],Er.prototype,"feesExpanded",2),$r([ut()],Er.prototype,"isInitializing",2),$r([ut()],Er.prototype,"cardBrand",2),$r([ut()],Er.prototype,"paymentLocked",2),$r([ut()],Er.prototype,"show3DSModal",2),$r([ut()],Er.prototype,"showQRModal",2),$r([ut()],Er.prototype,"nextActionUrl",2),$r([ut()],Er.prototype,"qrCode",2),$r([ut()],Er.prototype,"qrCodeDataUrl",2),$r([ut()],Er.prototype,"qrAutoResumeTimer",2),$r([ut()],Er.prototype,"qrPollingInProgress",2),Er=$r([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],Er);class Mr{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await _r(r);throw new Error(t)}return await r.json()}async post(t,e,r){const i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!i.ok){const t=await _r(i);throw new Error(t)}return await i.json()}async put(t,e,r){const i=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!i.ok){const t=await _r(i);throw new Error(t)}return await i.json()}async patch(t,e,r){const i=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!i.ok){const t=await _r(i);throw new Error(t)}return await i.json()}async delete(t,e){const r=await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await _r(r);throw new Error(t)}return await r.json()}}class Ir{constructor(t="one-payments:"){this.prefix=t}async get(t){return localStorage.getItem(this.prefix+t)}async set(t,e){localStorage.setItem(this.prefix+t,e)}async remove(t){localStorage.removeItem(this.prefix+t)}async clear(){Object.keys(localStorage).forEach(t=>{t.startsWith(this.prefix)&&localStorage.removeItem(t)})}}class Nr{async sha256(t){const e="string"==typeof t?(new TextEncoder).encode(t):t,r=await crypto.subtle.digest("SHA-256",e);return this.bufferToHex(r)}async hmacSHA256(t,e){const r=new TextEncoder,i=r.encode(t),n=r.encode(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await crypto.subtle.sign("HMAC",s,n);return this.bufferToHex(o)}uuid(){return crypto.randomUUID()}randomBytes(t){return crypto.getRandomValues(new Uint8Array(t))}bufferToHex(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}}class Tr{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function Dr(){return{http:new Mr,storage:new Ir,crypto:new Nr,timer:new Tr}}const Rr="one-payment",Lr="1.6.0";!function(){if("undefined"==typeof customElements)return console.error("[OnePayments] customElements API is not available in this environment. This bundle is designed for browser environments only."),!1;if(customElements.get(Rr))return console.info(`[OnePayments] <${Rr}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Rr,Er),console.info(`[OnePayments] Registered <${Rr}> custom element (v${Lr})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Rr}>:`,t),!1}}();const Ur={createWebAdapters:Dr,TAG_NAME:Rr,VERSION:Lr,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Rr),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Rr)};return"undefined"!=typeof window&&(window.OnePayments?console.warn("[OnePayments] window.OnePayments already exists. The bundle may have been loaded multiple times. Using existing reference."):window.OnePayments=Ur),t.OnePayments=Ur,t.TAG_NAME=Rr,t.VERSION=Lr,t.createWebAdapters=Dr,t.default=Ur,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
2325
+
2326
+ /* ═══════════════════════════════════════════════════════════════
2327
+ FPX BANK SELECTION STYLES
2328
+ ═══════════════════════════════════════════════════════════════ */
2329
+
2330
+ .fpx-container {
2331
+ display: flex;
2332
+ flex-direction: column;
2333
+ gap: 1.5rem;
2334
+ }
2335
+
2336
+ .fpx-instructions {
2337
+ text-align: left;
2338
+ }
2339
+
2340
+ .fpx-description {
2341
+ color: var(--op-color-text-secondary);
2342
+ font-size: var(--op-font-size-sm);
2343
+ margin: 0.5rem 0 0 0;
2344
+ line-height: 1.5;
2345
+ }
2346
+
2347
+ .bank-selection-wrapper {
2348
+ display: flex;
2349
+ flex-direction: column;
2350
+ gap: 0.75rem;
2351
+ }
2352
+
2353
+ .bank-search-container {
2354
+ position: relative;
2355
+ width: 100%;
2356
+ }
2357
+
2358
+ .bank-search-input {
2359
+ padding-right: 2.75rem;
2360
+ }
2361
+
2362
+ .bank-search-icon {
2363
+ position: absolute;
2364
+ right: 0.75rem;
2365
+ top: 50%;
2366
+ transform: translateY(-50%);
2367
+ color: var(--op-color-text-secondary);
2368
+ pointer-events: none;
2369
+ display: flex;
2370
+ align-items: center;
2371
+ justify-content: center;
2372
+ }
2373
+
2374
+ .bank-loading {
2375
+ display: flex;
2376
+ flex-direction: column;
2377
+ align-items: center;
2378
+ justify-content: center;
2379
+ padding: 2rem;
2380
+ gap: 1rem;
2381
+ color: var(--op-color-text-secondary);
2382
+ font-size: var(--op-font-size-sm);
2383
+ }
2384
+
2385
+ .bank-loading-spinner {
2386
+ width: 32px;
2387
+ height: 32px;
2388
+ border: 3px solid var(--op-color-border);
2389
+ border-top-color: var(--op-color-primary);
2390
+ border-radius: 50%;
2391
+ animation: spin 1s linear infinite;
2392
+ }
2393
+
2394
+ .bank-grid {
2395
+ display: grid;
2396
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
2397
+ gap: 0.75rem;
2398
+ max-height: 320px;
2399
+ overflow-y: auto;
2400
+ padding: 0.25rem;
2401
+ margin: -0.25rem;
2402
+ }
2403
+
2404
+ .bank-grid::-webkit-scrollbar {
2405
+ width: 6px;
2406
+ }
2407
+
2408
+ .bank-grid::-webkit-scrollbar-track {
2409
+ background: var(--op-color-surface);
2410
+ border-radius: 3px;
2411
+ }
2412
+
2413
+ .bank-grid::-webkit-scrollbar-thumb {
2414
+ background: var(--op-color-border);
2415
+ border-radius: 3px;
2416
+ }
2417
+
2418
+ .bank-grid::-webkit-scrollbar-thumb:hover {
2419
+ background: var(--op-color-text-secondary);
2420
+ }
2421
+
2422
+ .bank-card {
2423
+ position: relative;
2424
+ display: flex;
2425
+ flex-direction: column;
2426
+ align-items: center;
2427
+ padding: 1rem 0.75rem;
2428
+ background: var(--op-color-background);
2429
+ border: 2px solid var(--op-color-border);
2430
+ border-radius: var(--op-border-radius);
2431
+ cursor: pointer;
2432
+ transition: all 0.2s ease;
2433
+ gap: 0.625rem;
2434
+ min-height: 100px;
2435
+ }
2436
+
2437
+ .bank-card:hover {
2438
+ border-color: var(--op-color-text-secondary);
2439
+ background: var(--op-color-surface);
2440
+ transform: translateY(-2px);
2441
+ box-shadow: var(--op-box-shadow);
2442
+ }
2443
+
2444
+ .bank-card.selected {
2445
+ border-color: var(--op-color-primary);
2446
+ background: var(--op-color-surface);
2447
+ box-shadow: 0 0 0 3px rgba(42, 35, 39, 0.1);
2448
+ }
2449
+
2450
+ :host([data-theme='dark']) .bank-card.selected {
2451
+ box-shadow: 0 0 0 3px rgba(255, 190, 50, 0.15);
2452
+ }
2453
+
2454
+ .bank-logo-wrapper {
2455
+ width: 48px;
2456
+ height: 48px;
2457
+ display: flex;
2458
+ align-items: center;
2459
+ justify-content: center;
2460
+ flex-shrink: 0;
2461
+ }
2462
+
2463
+ .bank-logo {
2464
+ max-width: 100%;
2465
+ max-height: 100%;
2466
+ object-fit: contain;
2467
+ border-radius: 4px;
2468
+ }
2469
+
2470
+ .bank-logo-fallback {
2471
+ width: 48px;
2472
+ height: 48px;
2473
+ display: flex;
2474
+ align-items: center;
2475
+ justify-content: center;
2476
+ background: linear-gradient(135deg, var(--op-color-primary) 0%, var(--op-color-primary-hover) 100%);
2477
+ color: var(--op-color-primary-text);
2478
+ font-size: 1.25rem;
2479
+ font-weight: 700;
2480
+ border-radius: var(--op-border-radius);
2481
+ }
2482
+
2483
+ .bank-name {
2484
+ font-size: 0.75rem;
2485
+ font-weight: 500;
2486
+ color: var(--op-color-text);
2487
+ text-align: center;
2488
+ line-height: 1.3;
2489
+ overflow: hidden;
2490
+ text-overflow: ellipsis;
2491
+ display: -webkit-box;
2492
+ -webkit-line-clamp: 2;
2493
+ -webkit-box-orient: vertical;
2494
+ word-break: break-word;
2495
+ }
2496
+
2497
+ .bank-check {
2498
+ position: absolute;
2499
+ top: 0.5rem;
2500
+ right: 0.5rem;
2501
+ width: 20px;
2502
+ height: 20px;
2503
+ background: var(--op-color-primary);
2504
+ color: var(--op-color-primary-text);
2505
+ border-radius: 50%;
2506
+ display: flex;
2507
+ align-items: center;
2508
+ justify-content: center;
2509
+ animation: scaleIn 0.2s ease;
2510
+ }
2511
+
2512
+ .bank-no-results {
2513
+ text-align: center;
2514
+ padding: 2rem;
2515
+ color: var(--op-color-text-secondary);
2516
+ font-size: var(--op-font-size-sm);
2517
+ }
2518
+
2519
+ .bank-no-results p {
2520
+ margin: 0;
2521
+ }
2522
+
2523
+ /* Mobile responsiveness for bank grid */
2524
+ @media (max-width: 480px) {
2525
+ .bank-grid {
2526
+ grid-template-columns: repeat(2, 1fr);
2527
+ max-height: 280px;
2528
+ }
2529
+
2530
+ .bank-card {
2531
+ padding: 0.75rem 0.5rem;
2532
+ min-height: 90px;
2533
+ }
2534
+
2535
+ .bank-logo-wrapper {
2536
+ width: 40px;
2537
+ height: 40px;
2538
+ }
2539
+
2540
+ .bank-logo-fallback {
2541
+ width: 40px;
2542
+ height: 40px;
2543
+ font-size: 1rem;
2544
+ }
2545
+
2546
+ .bank-name {
2547
+ font-size: 0.6875rem;
2548
+ }
2549
+ }
2550
+
2551
+ /* ═══════════════════════════════════════════════════════════════
2552
+ PHONE NUMBER INPUT STYLES
2553
+ ═══════════════════════════════════════════════════════════════ */
2554
+
2555
+ .phone-input-section {
2556
+ margin-bottom: 1rem;
2557
+ }
2558
+
2559
+ .phone-input-label {
2560
+ display: block;
2561
+ font-size: var(--op-font-size-sm);
2562
+ font-weight: 500;
2563
+ color: var(--op-color-text);
2564
+ margin-bottom: 0.5rem;
2565
+ }
2566
+
2567
+ .phone-input-wrapper {
2568
+ display: flex;
2569
+ gap: 0.5rem;
2570
+ }
2571
+
2572
+ .country-code-select {
2573
+ flex-shrink: 0;
2574
+ width: 100px;
2575
+ padding: 0.75rem;
2576
+ font-size: var(--op-font-size-base);
2577
+ border: 1px solid var(--op-color-border);
2578
+ border-radius: var(--op-border-radius);
2579
+ background: var(--op-color-background);
2580
+ color: var(--op-color-text);
2581
+ cursor: pointer;
2582
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
2583
+ }
2584
+
2585
+ .country-code-select:focus {
2586
+ outline: none;
2587
+ border-color: var(--op-color-border-focus);
2588
+ box-shadow: 0 0 0 3px rgba(42, 35, 39, 0.1);
2589
+ }
2590
+
2591
+ .country-code-select:disabled {
2592
+ background: var(--op-color-surface);
2593
+ cursor: not-allowed;
2594
+ opacity: 0.7;
2595
+ }
2596
+
2597
+ .phone-input-field {
2598
+ flex: 1;
2599
+ padding: 0.75rem;
2600
+ font-size: var(--op-font-size-base);
2601
+ border: 1px solid var(--op-color-border);
2602
+ border-radius: var(--op-border-radius);
2603
+ background: var(--op-color-background);
2604
+ color: var(--op-color-text);
2605
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
2606
+ }
2607
+
2608
+ .phone-input-field:focus {
2609
+ outline: none;
2610
+ border-color: var(--op-color-border-focus);
2611
+ box-shadow: 0 0 0 3px rgba(42, 35, 39, 0.1);
2612
+ }
2613
+
2614
+ .phone-input-field::placeholder {
2615
+ color: var(--op-color-text-secondary);
2616
+ }
2617
+
2618
+ .phone-input-field.error {
2619
+ border-color: var(--op-color-danger);
2620
+ }
2621
+
2622
+ .phone-input-field.error:focus {
2623
+ box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
2624
+ }
2625
+
2626
+ .phone-input-error {
2627
+ color: var(--op-color-danger);
2628
+ font-size: 0.75rem;
2629
+ margin-top: 0.375rem;
2630
+ }
2631
+
2632
+ .phone-japan-note {
2633
+ font-size: 0.75rem;
2634
+ color: var(--op-color-text-secondary);
2635
+ margin-top: 0.375rem;
2636
+ display: flex;
2637
+ align-items: center;
2638
+ gap: 0.25rem;
2639
+ }
2640
+
2641
+ /* Mobile responsiveness for phone input */
2642
+ @media (max-width: 480px) {
2643
+ .phone-input-wrapper {
2644
+ flex-direction: column;
2645
+ }
2646
+
2647
+ .country-code-select {
2648
+ width: 100%;
2649
+ }
2650
+ }
2651
+ `,Ra([ut({type:Object})],La.prototype,"config",2),Ra([ut({type:Object})],La.prototype,"adapters",2),Ra([ut({type:Number})],La.prototype,"amount",2),Ra([ut({type:String})],La.prototype,"currency",2),Ra([ut({type:String})],La.prototype,"orderId",2),Ra([ut({type:String})],La.prototype,"firstName",2),Ra([ut({type:String})],La.prototype,"lastName",2),Ra([ut({type:String})],La.prototype,"email",2),Ra([ut({type:String})],La.prototype,"phoneNumber",2),Ra([ut({type:Array})],La.prototype,"excludePaymentMethods",2),Ra([ut({type:String})],La.prototype,"width",2),Ra([ut({type:String})],La.prototype,"maxWidth",2),Ra([ut({type:Object})],La.prototype,"appearance",2),Ra([ht()],La.prototype,"currentState",2),Ra([ht()],La.prototype,"selectedMethod",2),Ra([ht()],La.prototype,"cardFormData",2),Ra([ht()],La.prototype,"formErrors",2),Ra([ht()],La.prototype,"paymentData",2),Ra([ht()],La.prototype,"feesExpanded",2),Ra([ht()],La.prototype,"isInitializing",2),Ra([ht()],La.prototype,"cardBrand",2),Ra([ht()],La.prototype,"paymentLocked",2),Ra([ht()],La.prototype,"show3DSModal",2),Ra([ht()],La.prototype,"showQRModal",2),Ra([ht()],La.prototype,"nextActionUrl",2),Ra([ht()],La.prototype,"qrCode",2),Ra([ht()],La.prototype,"qrCodeDataUrl",2),Ra([ht()],La.prototype,"qrAutoResumeTimer",2),Ra([ht()],La.prototype,"qrPollingInProgress",2),Ra([ht()],La.prototype,"availableBanks",2),Ra([ht()],La.prototype,"selectedBank",2),Ra([ht()],La.prototype,"banksLoading",2),Ra([ht()],La.prototype,"bankSearchQuery",2),Ra([ht()],La.prototype,"phoneInputValue",2),Ra([ht()],La.prototype,"phoneInputError",2),Ra([ht()],La.prototype,"selectedCountry",2),La=Ra([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],La);class Ua{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}async post(t,e,r){const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async put(t,e,r){const n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async patch(t,e,r){const n=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async delete(t,e){const r=await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}}class ja{constructor(t="one-payments:"){this.prefix=t}async get(t){return localStorage.getItem(this.prefix+t)}async set(t,e){localStorage.setItem(this.prefix+t,e)}async remove(t){localStorage.removeItem(this.prefix+t)}async clear(){Object.keys(localStorage).forEach(t=>{t.startsWith(this.prefix)&&localStorage.removeItem(t)})}}class Ha{async sha256(t){const e="string"==typeof t?(new TextEncoder).encode(t):t,r=await crypto.subtle.digest("SHA-256",e);return this.bufferToHex(r)}async hmacSHA256(t,e){const r=new TextEncoder,n=r.encode(t),i=r.encode(e),a=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await crypto.subtle.sign("HMAC",a,i);return this.bufferToHex(o)}uuid(){return crypto.randomUUID()}randomBytes(t){return crypto.getRandomValues(new Uint8Array(t))}bufferToHex(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}}class za{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function qa(){return{http:new Ua,storage:new ja,crypto:new Ha,timer:new za}}const Va="one-payment",Ga="1.7.2";!function(){if("undefined"==typeof customElements)return console.error("[OnePayments] customElements API is not available in this environment. This bundle is designed for browser environments only."),!1;if(customElements.get(Va))return console.info(`[OnePayments] <${Va}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Va,La),console.info(`[OnePayments] Registered <${Va}> custom element (v${Ga})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Va}>:`,t),!1}}();const Ka={createWebAdapters:qa,TAG_NAME:Va,VERSION:Ga,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Va),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Va)};return"undefined"!=typeof window&&(window.OnePayments?console.warn("[OnePayments] window.OnePayments already exists. The bundle may have been loaded multiple times. Using existing reference."):window.OnePayments=Ka),t.OnePayments=Ka,t.TAG_NAME=Va,t.VERSION=Ga,t.createWebAdapters=qa,t.default=Ka,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
2035
2652
  //# sourceMappingURL=one-payment.browser.iife.js.map