@one-payments/web-components 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3815,7 +3815,11 @@ let S = class extends st {
3815
3815
  })
3816
3816
  );
3817
3817
  }), this.sdk.on("initialized", (t) => {
3818
- this.paymentData = t.payload.paymentData, this.isInitializing = !1;
3818
+ var r;
3819
+ if (this.paymentData = t.payload.paymentData, this.isInitializing = !1, (r = t.payload.paymentData) != null && r.sessionId && !document.getElementById("airwallex-fraud-api")) {
3820
+ const i = document.createElement("script");
3821
+ i.src = "https://static.airwallex.com/webapp/fraud/device-fingerprint/index.js", i.async = !0, i.setAttribute("data-order-session-id", t.payload.paymentData.sessionId), i.setAttribute("id", "airwallex-fraud-api"), document.body.appendChild(i);
3822
+ }
3819
3823
  }), this.sdk.on("payment_requires_action", (t) => {
3820
3824
  this.nextActionUrl = t.payload.actionUrl, this.show3DSModal = !0, this.paymentLocked = !0, this.leaveEventsCounter = 0;
3821
3825
  }), this.sdk.on("poll_started", () => {
@@ -1,6 +1,6 @@
1
1
  var OnePayments=function(t){"use strict";
2
2
  /*!
3
- * @one-payments/web-components v1.5.5
3
+ * @one-payments/web-components v1.5.6
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(),o=new WeakMap;let s=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=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.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 s("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 o=null==i?void 0:i.call(this);null==n||n.call(this,e),this.requestUpdate(t,o,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 o=(void 0!==(null==(r=i.converter)?void 0:r.toAttribute)?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,i;const n=this.constructor,o=n._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(r=t.converter)?void 0:r.fromAttribute)?t.converter:b;this._$Em=o;const a=s.fromAttribute(e,t.type);this[o]=a??(null==(i=this._$Ej)?void 0:i.get(o))??a,this._$Em=null}}requestUpdate(t,e,r){var i;if(void 0!==t){const n=this.constructor,o=this[t];if(r??(r=n.getPropertyOptions(t)),!((r.hasChanged??w)(o,e)||r.useDefault&&r.reflect&&o===(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},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(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}>`,I=document,M=()=>I.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,z=/"/g,q=/^(?:script|style|textarea|title)$/i,O=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),H=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),V=new WeakMap,Y=I.createTreeWalker(I,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,o=0;const s=t.length-1,a=this.parts,[l,d]=((t,e)=>{const r=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",s=R;for(let a=0;a<r;a++){const e=t[a];let r,l,d=-1,c=0;for(;c<e.length&&(s.lastIndex=c,l=s.exec(e),null!==l);)c=s.lastIndex,s===R?"!--"===l[1]?s=L:void 0!==l[1]?s=U:void 0!==l[2]?(q.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=B):void 0!==l[3]&&(s=B):s===B?">"===l[0]?(s=n??R,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,r=l[1],s=void 0===l[3]?B:'"'===l[3]?z:F):s===z||s===F?s=B:s===L||s===U?s=R:(s=B,n=void 0);const u=s===B&&t[a+1].startsWith("/>")?" ":"";o+=s===R?e+_:d>=0?(i.push(r),e.slice(0,d)+A+e.slice(d)+$+u):e+$+(-2===d?a:u)}return[K(t,o+(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<s;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(A)){const e=d[o++],r=i.getAttribute(t).split($),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:s[2],strings:r,ctor:"."===s[1]?tt:"?"===s[1]?et:"@"===s[1]?rt:X}),i.removeAttribute(t)}else t.startsWith($)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(q.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],M()),Y.nextNode(),a.push({type:2,index:++n});i.append(t[e],M())}}}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=I.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,i){var n,o;if(e===H)return e;let s=void 0!==i?null==(n=r._$Co)?void 0:n[i]:r._$Cl;const a=N(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==a&&(null==(o=null==s?void 0:s._$AO)||o.call(s,!1),void 0===a?s=void 0:(s=new a(t),s._$AT(t,r,i)),void 0!==i?(r._$Co??(r._$Co=[]))[i]=s:r._$Cl=s),void 0!==s&&(e=J(t,s._$AS(t,e.values),s,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)??I).importNode(e,!0);Y.currentNode=i;let n=Y.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===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[++s]}o!==(null==a?void 0:a.index)&&(n=Y.nextNode(),o++)}return Y.currentNode=I,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!==H&&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(I.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(M()),this.O(M()),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 o=!1;if(void 0===n)t=J(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==H,o&&(this._$AH=t);else{const i=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=J(this,i[r+s],e,s),a===H&&(a=this._$AH[s]),o||(o=!N(a)||a!==this._$AH[s]),a===j?t=j:t!==j&&(t+=(a??"")+n[s+1]),this._$AH[s]=a}o&&!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)===H)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 ot=globalThis;class st 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(M(),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 H}}st._$litElement$=!0,st.finalized=!0,null==(e=ot.litElementHydrateSupport)||e.call(ot,{LitElement:st});const at=ot.litElementPolyfillSupport;null==at||at({LitElement:st}),(ot.litElementVersions??(ot.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 o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.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="idle",St="initializing",Pt="ready",Ct="processing",At="requires_action",$t="succeeded",Et="failed";class _t{constructor(t,e,r,i,n={},o){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=o,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 It{constructor(t,e){this.state={status:kt},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:St}),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}),o=new URL(n.result.redirectUrl).searchParams.get("token");if(!o)throw new Error("No token found in redirectUrl");this.paymentToken=o,this.paymentIntentId=n.result.paymentIntentId;const s=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:s.result.customerAmount||t.amount,currency:s.result.currency||t.currency,status:Pt,...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++})}),this.setState({status:Pt,paymentIntent:l,availableMethods:d}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:s.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:Et,error:t}),this.emit({type:"payment_failed",payload:{error:t}}),e}}async submitPayment(t,e){var r,i,n,o,s;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:Ct,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"}},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:Ct}}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==(o=d.error)?void 0:o.message)||l.message,e=d.code||(null==(s=d.error)?void 0:s.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:Et,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 _t(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;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("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:At,...t.metadata&&{metadata:t.metadata}};return this.setState({status:At,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:$t,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:Et,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 Mt="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Nt=function(t,e,r,i,n,o,s,a,l,d){var c=this;c.numeralDecimalMark=t||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=i||Nt.groupStyle.thousand,c.numeralPositiveOnly=!!n,c.stripLeadingZeroes=!1!==o,c.prefix=s||""===s?s:"",c.signBeforePrefix=!!a,c.tailPrefix=!!l,c.delimiter=d||""===d?d:",",c.delimiterRE=d?new RegExp("\\"+d,"g"):""};Nt.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Nt.prototype={getRawValue:function(t){return t.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(t){var e,r,i,n,o=this,s="";switch(t=t.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),o.stripLeadingZeroes&&(t=t.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===t.slice(0,1)?"-":"",i=void 0!==o.prefix?o.signBeforePrefix?r+o.prefix:o.prefix+r:r,n=t,t.indexOf(o.numeralDecimalMark)>=0&&(n=(e=t.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+e[1].slice(0,o.numeralDecimalScale)),"-"===r&&(n=n.slice(1)),o.numeralIntegerScale>0&&(n=n.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case Nt.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case Nt.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case Nt.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?r+n.toString()+(o.numeralDecimalScale>0?s.toString():"")+o.prefix:i+n.toString()+(o.numeralDecimalScale>0?s.toString():"")}};var Tt=Nt,Dt=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()};Dt.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 o=t.slice(0,i),s=o.slice(0,1),a=t.slice(i);switch(e.datePattern[n]){case"d":"00"===o?o="01":parseInt(s,10)>3?o="0"+s:parseInt(o,10)>31&&(o="31");break;case"m":"00"===o?o="01":parseInt(s,10)>1?o="0"+s:parseInt(o,10)>12&&(o="12")}r+=o,t=a}}),this.getFixedDateString(r)},getFixedDateString:function(t){var e,r,i,n=this,o=n.datePattern,s=[],a=0,l=0,d=0,c=0,u=0,h=0,p=!1;return 4===t.length&&"y"!==o[0].toLowerCase()&&"y"!==o[1].toLowerCase()&&(u=2-(c="d"===o[0]?0:2),e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),s=this.getFixedDate(e,r,0)),8===t.length&&(o.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,s=this.getFixedDate(e,r,i)),4!==t.length||"y"!==o[0]&&"y"!==o[1]||(h=2-(u="m"===o[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,s=[0,r,i]),6!==t.length||"Y"!==o[0]&&"Y"!==o[1]||(h=2-.5*(u="m"===o[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,s=[0,r,i]),s=n.getRangeFixedDate(s),n.date=s,0===s.length?t:o.reduce(function(t,e){switch(e){case"d":return t+(0===s[0]?"":n.addLeadingZero(s[0]));case"m":return t+(0===s[1]?"":n.addLeadingZero(s[1]));case"y":return t+(p?n.addLeadingZeroForYear(s[2],!1):"");case"Y":return t+(p?n.addLeadingZeroForYear(s[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 Rt=Dt,Lt=function(t,e){var r=this;r.time=[],r.blocks=[],r.timePattern=t,r.timeFormat=e,r.initBlocks()};Lt.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,o){if(t.length>0){var s=t.slice(0,n),a=s.slice(0,1),l=t.slice(n);switch(e.timePattern[o]){case"h":parseInt(a,10)>i.maxHourFirstDigit?s="0"+a:parseInt(s,10)>i.maxHours&&(s=i.maxHours+"");break;case"m":case"s":parseInt(a,10)>i.maxMinutesFirstDigit?s="0"+a:parseInt(s,10)>i.maxMinutes&&(s=i.maxMinutes+"")}r+=s,t=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(t){var e,r,i,n=this,o=n.timePattern,s=[],a=0,l=0,d=0,c=0,u=0,h=0;return 6===t.length&&(o.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),s=this.getFixedTime(i,r,e)),4===t.length&&n.timePattern.indexOf("s")<0&&(o.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),s=this.getFixedTime(i,r,e)),n.time=s,0===s.length?t:o.reduce(function(t,e){switch(e){case"s":return t+n.addLeadingZero(s[2]);case"m":return t+n.addLeadingZero(s[1]);case"h":return t+n.addLeadingZero(s[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 Ut=Lt,Bt=function(t,e){var r=this;r.delimiter=e||""===e?e:" ",r.delimiterRE=e?new RegExp("\\"+e,"g"):"",r.formatter=t};Bt.prototype={setFormatter:function(t){this.formatter=t},format:function(t){var e=this;e.formatter.clear();for(var r,i="",n=!1,o=0,s=(t=(t=(t=t.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(e.delimiterRE,"")).length;o<s;o++)r=e.formatter.inputDigit(t.charAt(o)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,e.delimiter)}};var Ft=Bt,zt={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=zt.blocks,i=zt.re;for(var n in e=!!e,i)if(i[n].test(t)){var o=r[n];return{type:n,blocks:e?this.getStrictBlocks(o):o}}return{type:"unknown",blocks:e?this.getStrictBlocks(r.general):r.general}}},qt=zt,Ot={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 o,s,a;return o=this.stripDelimiters(e.slice(0,t),i,n),s=this.stripDelimiters(r.slice(0,t),i,n),0!==(a=o.length-s.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,o,s,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,o,s,a,l)}if(i.slice(0,r)!==e&&!a)return s&&!i&&t?t:"";if(i.slice(-r)!==e&&a)return s&&!i&&t?t:"";var c=this.stripDelimiters(i,n,o);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,o){var s="",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[o?d-1:d]||l:i,o?(d>0&&(s+=l),s+=c):(s+=c,c.length===e&&d<r-1&&(s+=l)),t=u}}),s)},fixPrefixCursor:function(t,e,r,i){if(t){var n=t.value,o=r||i[0]||" ";if(t.setSelectionRange&&e&&!(e.length+o.length<=n.length)){var s=2*n.length;setTimeout(function(){t.setSelectionRange(s,s)},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)}},Ht={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 Mt&&Mt?Mt:window,t.document=e.document||t.root.document,t.maxLength=0,t.backspace=!1,t.result="",t.onValueChanged=e.onValueChanged||function(){},t}},jt=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=jt.DefaultProperties.assign({},e),r.init()};jt.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=jt.Util.getMaxLength(e.blocks),t.isAndroid=jt.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 jt.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 jt.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=jt.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new jt.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=jt.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new jt.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=jt.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),jt.Util.fixPrefixCursor(t.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(t){jt.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(t),this.onInput(""))},onCopy:function(t){jt.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(t)},copyClipboardData:function(t){var e=this.properties,r=jt.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(o){}},onInput:function(t){var e=this,r=e.properties,i=jt.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=jt.Util;i.headStr(r.result,4)!==i.headStr(t,4)&&(e=jt.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=jt.Util,r=t.properties;if(t.element){var i=t.element.selectionEnd,n=t.element.value,o=r.result;i=e.getNextCursorPosition(i,n,o,r.delimiter,r.delimiters),t.isAndroid?window.setTimeout(function(){t.element.value=o,e.setSelection(t.element,i,r.document,!1),t.callOnValueChanged()},1):(t.element.value=o,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=jt.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]"}},jt.NumeralFormatter=Tt,jt.DateFormatter=Rt,jt.TimeFormatter=Ut,jt.PhoneFormatter=Ft,jt.CreditCardDetector=qt,jt.Util=Ot,jt.DefaultProperties=Ht,("object"==typeof Mt&&Mt?Mt:window).Cleave=jt;var Vt=jt,Yt={},Qt={},Kt={};let Gt;const Jt=[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];Kt.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},Kt.getSymbolTotalCodewords=function(t){return Jt[t]},Kt.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},Kt.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');Gt=t},Kt.isKanjiModeEnabled=function(){return void 0!==Gt},Kt.toSJIS=function(t){return Gt(t)};var Zt,Wt={};function Xt(){this.buffer=[],this.length=0}(Zt=Wt).L={bit:1},Zt.M={bit:0},Zt.Q={bit:3},Zt.H={bit:2},Zt.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},Zt.from=function(t,e){if(Zt.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 Zt.L;case"m":case"medium":return Zt.M;case"q":case"quartile":return Zt.Q;case"h":case"high":return Zt.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(r){return e}},Xt.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 te=Xt;function ee(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)}ee.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},ee.prototype.get=function(t,e){return this.data[t*this.size+e]},ee.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ee.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var re=ee,ie={};!function(t){const e=Kt.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)),o=[i-7];for(let e=1;e<r-1;e++)o[e]=o[e-1]-n;return o.push(6),o.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}}(ie);var ne={};const oe=Kt.getSymbolSize;ne.getPositions=function(t){const e=oe(t);return[[0,0],[e-7,0],[0,e-7]]};var se={};!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 o(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,o=0,s=null,a=null;for(let l=0;l<r;l++){n=o=0,s=a=null;for(let d=0;d<r;d++){let r=t.get(l,d);r===s?n++:(n>=5&&(i+=e+(n-5)),s=r,n=1),r=t.get(d,l),r===a?o++:(o>=5&&(i+=e+(o-5)),a=r,o=1)}n>=5&&(i+=e+(n-5)),o>=5&&(i+=e+(o-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,o=0;for(let i=0;i<e;i++){n=o=0;for(let s=0;s<e;s++)n=n<<1&2047|t.get(i,s),s>=10&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(s,i),s>=10&&(1488===o||93===o)&&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,o(t,n,i))},t.getBestMask=function(e,r){const i=Object.keys(t.Patterns).length;let n=0,o=1/0;for(let s=0;s<i;s++){r(s),t.applyMask(s,e);const i=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),i<o&&(o=i,n=s)}return n}}(se);var ae={};const le=Wt,de=[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],ce=[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];ae.getBlocksCount=function(t,e){switch(e){case le.L:return de[4*(t-1)+0];case le.M:return de[4*(t-1)+1];case le.Q:return de[4*(t-1)+2];case le.H:return de[4*(t-1)+3];default:return}},ae.getTotalCodewordsCount=function(t,e){switch(e){case le.L:return ce[4*(t-1)+0];case le.M:return ce[4*(t-1)+1];case le.Q:return ce[4*(t-1)+2];case le.H:return ce[4*(t-1)+3];default:return}};var ue={},he={};const pe=new Uint8Array(512),me=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)pe[e]=t,me[t]=e,t<<=1,256&t&&(t^=285);for(let e=255;e<512;e++)pe[e]=pe[e-255]}(),he.log=function(t){if(t<1)throw new Error("log("+t+")");return me[t]},he.exp=function(t){return pe[t]},he.mul=function(t,e){return 0===t||0===e?0:pe[me[t]+me[e]]},function(t){const e=he;t.mul=function(t,r){const i=new Uint8Array(t.length+r.length-1);for(let n=0;n<t.length;n++)for(let o=0;o<r.length;o++)i[n+o]^=e.mul(t[n],r[o]);return i},t.mod=function(t,r){let i=new Uint8Array(t);for(;i.length-r.length>=0;){const t=i[0];for(let o=0;o<r.length;o++)i[o]^=e.mul(r[o],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}}(ue);const ge=ue;function fe(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}fe.prototype.initialize=function(t){this.degree=t,this.genPoly=ge.generateECPolynomial(this.degree)},fe.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=ge.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 ye=fe,ve={},be={},we={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},xe={};const ke="[0-9]+";let Se="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Se=Se.replace(/u/g,"\\u");const Pe="(?:(?![A-Z0-9 $%*+\\-./:]|"+Se+")(?:.|[\r\n]))+";xe.KANJI=new RegExp(Se,"g"),xe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),xe.BYTE=new RegExp(Pe,"g"),xe.NUMERIC=new RegExp(ke,"g"),xe.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Ce=new RegExp("^"+Se+"$"),Ae=new RegExp("^"+ke+"$"),$e=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");xe.testKanji=function(t){return Ce.test(t)},xe.testNumeric=function(t){return Ae.test(t)},xe.testAlphanumeric=function(t){return $e.test(t)},function(t){const e=we,r=xe;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}}}(be),function(t){const e=Kt,r=ae,i=Wt,n=be,o=we,s=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 o.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,i,s){if(!o.isValid(t))throw new Error("Invalid QR Code version");void 0===s&&(s=n.BYTE);const l=8*(e.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,i));if(s===n.MIXED)return l;const d=l-a(s,t);switch(s){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 o;const s=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,s);if(0===e.length)return 1;o=e[0]}else o=e;return function(e,r,i){for(let n=1;n<=40;n++)if(r<=t.getCapacity(n,i,e))return n}(o.mode,o.getLength(),s)},t.getEncodedBits=function(t){if(!o.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;e.getBCHDigit(r)-s>=0;)r^=7973<<e.getBCHDigit(r)-s;return t<<12|r}}(ve);var Ee={};const _e=Kt,Ie=_e.getBCHDigit(1335);Ee.getEncodedBits=function(t,e){const r=t.bit<<3|e;let i=r<<10;for(;_e.getBCHDigit(i)-Ie>=0;)i^=1335<<_e.getBCHDigit(i)-Ie;return 21522^(r<<10|i)};var Me={};const Ne=be;function Te(t){this.mode=Ne.NUMERIC,this.data=t.toString()}Te.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},Te.prototype.getLength=function(){return this.data.length},Te.prototype.getBitsLength=function(){return Te.getBitsLength(this.data.length)},Te.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 De=Te;const Re=be,Le=["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 Ue(t){this.mode=Re.ALPHANUMERIC,this.data=t}Ue.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},Ue.prototype.getLength=function(){return this.data.length},Ue.prototype.getBitsLength=function(){return Ue.getBitsLength(this.data.length)},Ue.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*Le.indexOf(this.data[e]);r+=Le.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(Le.indexOf(this.data[e]),6)};var Be=Ue;const Fe=be;function ze(t){this.mode=Fe.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}ze.getBitsLength=function(t){return 8*t},ze.prototype.getLength=function(){return this.data.length},ze.prototype.getBitsLength=function(){return ze.getBitsLength(this.data.length)},ze.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var qe=ze;const Oe=be,He=Kt;function je(t){this.mode=Oe.KANJI,this.data=t}je.getBitsLength=function(t){return 13*t},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;for(e=0;e<this.data.length;e++){let r=He.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 Ve,Ye=je,Qe={exports:{}};Ve={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var o,s,a,l,d,c,u,h=Ve.PriorityQueue.make();for(h.push(e,0);!h.empty();)for(a in s=(o=h.pop()).value,l=o.cost,d=t[s]||{})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]=s));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=Ve.single_source_shortest_paths(t,e,r);return Ve.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=Ve.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}}},Qe.exports=Ve;var Ke=Qe.exports;!function(t){const e=be,r=De,i=Be,n=qe,o=Ye,s=xe,a=Kt,l=Ke;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(s.NUMERIC,e.NUMERIC,t),i=c(s.ALPHANUMERIC,e.ALPHANUMERIC,t);let n,o;a.isKanjiModeEnabled()?(n=c(s.BYTE,e.BYTE,t),o=c(s.KANJI,e.KANJI,t)):(n=c(s.BYTE_KANJI,e.BYTE,t),o=[]);return r.concat(i,n,o).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,s){switch(s){case e.NUMERIC:return r.getBitsLength(t);case e.ALPHANUMERIC:return i.getBitsLength(t);case e.KANJI:return o.getBitsLength(t);case e.BYTE:return n.getBitsLength(t)}}function p(t,s){let l;const d=e.getBestModeForData(t);if(l=e.from(s,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 o(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())),o=function(t,r){const i={},n={start:{}};let o=["start"];for(let s=0;s<t.length;s++){const a=t[s],l=[];for(let t=0;t<a.length;t++){const d=a[t],c=""+s+t;l.push(c),i[c]={node:d,lastCount:0},n[c]={};for(let t=0;t<o.length;t++){const s=o[t];i[s]&&i[s].node.mode===d.mode?(n[s][c]=h(i[s].lastCount+d.length,d.mode)-h(i[s].lastCount,d.mode),i[s].lastCount+=d.length):(i[s]&&(i[s].lastCount=d.length),n[s][c]=h(d.length,d.mode)+4+e.getCharCountIndicator(d.mode,r))}}o=l}for(let e=0;e<o.length;e++)n[o[e]].end=0;return{map:n,table:i}}(n,i),s=l.find_path(o.map,"start","end"),c=[];for(let t=1;t<s.length-1;t++)c.push(o.table[s[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()))}}(Me);const Ge=Kt,Je=Wt,Ze=te,We=re,Xe=ie,tr=ne,er=se,rr=ae,ir=ye,nr=ve,or=Ee,sr=be,ar=Me;function lr(t,e,r){const i=t.size,n=or.getEncodedBits(e,r);let o,s;for(o=0;o<15;o++)s=1==(n>>o&1),o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(i-15+o,8,s,!0),o<8?t.set(8,i-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(i-8,8,1,!0)}function dr(t,e,r){const i=new Ze;r.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),sr.getCharCountIndicator(e.mode,t)),e.write(i)});const n=8*(Ge.getSymbolTotalCodewords(t)-rr.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=n&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const o=(n-i.getLengthInBits())/8;for(let s=0;s<o;s++)i.put(s%2?17:236,8);return function(t,e,r){const i=Ge.getSymbolTotalCodewords(e),n=rr.getTotalCodewordsCount(e,r),o=i-n,s=rr.getBlocksCount(e,r),a=i%s,l=s-a,d=Math.floor(i/s),c=Math.floor(o/s),u=c+1,h=d-c,p=new ir(h);let m=0;const g=new Array(s),f=new Array(s);let y=0;const v=new Uint8Array(t.buffer);for(let S=0;S<s;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<s;x++)w<g[x].length&&(b[k++]=g[x][w]);for(w=0;w<h;w++)for(x=0;x<s;x++)b[k++]=f[x][w];return b}(i,t,e)}function cr(t,e,r,i){let n;if(Array.isArray(t))n=ar.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let i=e;if(!i){const e=ar.rawSplit(t);i=nr.getBestVersionForData(e,r)}n=ar.fromString(t,i||40)}}const o=nr.getBestVersionForData(n,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else e=o;const s=dr(e,r,n),a=Ge.getSymbolSize(e),l=new We(a);return function(t,e){const r=t.size,i=tr.getPositions(e);for(let n=0;n<i.length;n++){const e=i[n][0],o=i[n][1];for(let i=-1;i<=7;i++)if(!(e+i<=-1||r<=e+i))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+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,o+n,!0,!0):t.set(e+i,o+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=Xe.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),lr(l,r,0),e>=7&&function(t,e){const r=t.size,i=nr.getEncodedBits(e);let n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+r-8-3,s=1==(i>>a&1),t.set(n,o,s,!0),t.set(o,n,s,!0)}(l,e),function(t,e){const r=t.size;let i=-1,n=r-1,o=7,s=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;s<e.length&&(i=1==(e[s]>>>o&1)),t.set(n,a-r,i),o--,-1===o&&(s++,o=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}(l,s),isNaN(i)&&(i=er.getBestMask(l,lr.bind(null,l,r))),er.applyMask(i,l),lr(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}Qt.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let r,i,n=Je.M;return void 0!==e&&(n=Je.from(e.errorCorrectionLevel,Je.M),r=nr.from(e.version),i=er.from(e.maskPattern),e.toSJISFunc&&Ge.setToSJISFunction(e.toSJISFunc)),cr(t,r,n,i)};var ur={},hr={};!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,o=r.modules.data,s=t.getScale(n,i),a=Math.floor((n+2*i.margin)*s),l=i.margin*s,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[o[Math.floor((t-l)/s)*n+Math.floor((r-l)/s)]?1:0]}e[c++]=u.r,e[c++]=u.g,e[c++]=u.b,e[c]=u.a}}}(hr),function(t){const e=hr;t.render=function(t,r,i){let n=i,o=r;void 0!==n||r&&r.getContext||(n=r,r=void 0),r||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=e.getOptions(n);const s=e.getImageWidth(t.modules.size,n),a=o.getContext("2d"),l=a.createImageData(s,s);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,o,s),a.putImageData(l,0,0),o},t.renderToDataURL=function(e,r,i){let n=i;void 0!==n||r&&r.getContext||(n=r,r=void 0),n||(n={});const o=t.render(e,r,n),s=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(s,a.quality)}}(ur);var pr={};const mr=hr;function gr(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function fr(t,e,r){let i=t+e;return void 0!==r&&(i+=" "+r),i}pr.render=function(t,e,r){const i=mr.getOptions(e),n=t.modules.size,o=t.modules.data,s=n+2*i.margin,a=i.color.light.a?"<path "+gr(i.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+gr(i.color.dark,"stroke")+' d="'+function(t,e,r){let i="",n=0,o=!1,s=0;for(let a=0;a<t.length;a++){const l=Math.floor(a%e),d=Math.floor(a/e);l||o||(o=!0),t[a]?(s++,a>0&&l>0&&t[a-1]||(i+=o?fr("M",l+r,.5+d+r):fr("m",n,0),n=0,o=!1),l+1<e&&t[a+1]||(i+=fr("h",s),s=0)):n++}return i}(o,n,i.margin)+'"/>',d='viewBox="0 0 '+s+" "+s+'"',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 yr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},vr=Qt,br=ur,wr=pr;function xr(t,e,r,i,n){const o=[].slice.call(arguments,1),s=o.length,a="function"==typeof o[s-1];if(!a&&!yr())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=e,e=i=void 0):2!==s||e.getContext||(i=r,r=e,e=void 0),new Promise(function(n,o){try{const o=vr.create(r,i);n(t(o,e,i))}catch(s){o(s)}})}if(s<2)throw new Error("Too few arguments provided");2===s?(n=r,r=e,e=i=void 0):3===s&&(e.getContext&&void 0===n?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0));try{const o=vr.create(r,i);n(null,t(o,e,i))}catch(l){n(l)}}Yt.create=vr.create,Yt.toCanvas=xr.bind(null,br.render),Yt.toDataURL=xr.bind(null,br.renderToDataURL),Yt.toString=xr.bind(null,function(t,e,r){return wr.render(t,r)});var kr=Object.defineProperty,Sr=Object.getOwnPropertyDescriptor,Pr=(t,e,r,i)=>{for(var n,o=i>1?void 0:i?Sr(e,r):e,s=t.length-1;s>=0;s--)(n=t[s])&&(o=(i?n(e,r,o):n(o))||o);return i&&o&&kr(e,r,o),o};let Cr=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.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 Vt(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:t=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[t]||"unknown"}})),i&&!this.expiryCleave&&(this.expiryCleave=new Vt(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"}}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 It(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=>{this.paymentData=t.payload.paymentData,this.isInitializing=!1}),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 Yt.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.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 o=parseInt(t,10);i&&(o*=2,o>9&&(o-=9)),r+=o,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 o=parseInt(i,10);if(o<1||o>12)return{valid:!1,error:"Invalid month (01-12)"};const s=new Date,a=s.getFullYear(),l=s.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&&o<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}))}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,o=null!=e.initialAmount?"number"==typeof e.initialAmount?e.initialAmount:Number(e.initialAmount)||0:this.amount,s=null!=e.customerAmount?"number"==typeof e.customerAmount?e.customerAmount:Number(e.customerAmount)||0:o,a=i-n;return{currency:e.currency||this.currency,charge:o,fees:i,feeBreakdown:{transactionFee:a,merchantFee:a,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:s}}renderTransactionDetailsSkeleton(){return O`
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(),o=new WeakMap;let s=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=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.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 s("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 o=null==i?void 0:i.call(this);null==n||n.call(this,e),this.requestUpdate(t,o,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 o=(void 0!==(null==(r=i.converter)?void 0:r.toAttribute)?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,i;const n=this.constructor,o=n._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(r=t.converter)?void 0:r.fromAttribute)?t.converter:b;this._$Em=o;const a=s.fromAttribute(e,t.type);this[o]=a??(null==(i=this._$Ej)?void 0:i.get(o))??a,this._$Em=null}}requestUpdate(t,e,r){var i;if(void 0!==t){const n=this.constructor,o=this[t];if(r??(r=n.getPropertyOptions(t)),!((r.hasChanged??w)(o,e)||r.useDefault&&r.reflect&&o===(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},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(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}>`,I=document,M=()=>I.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,z=/"/g,q=/^(?:script|style|textarea|title)$/i,O=(Q=1,(t,...e)=>({_$litType$:Q,strings:t,values:e})),H=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),V=new WeakMap,Y=I.createTreeWalker(I,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,o=0;const s=t.length-1,a=this.parts,[l,d]=((t,e)=>{const r=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",s=R;for(let a=0;a<r;a++){const e=t[a];let r,l,d=-1,c=0;for(;c<e.length&&(s.lastIndex=c,l=s.exec(e),null!==l);)c=s.lastIndex,s===R?"!--"===l[1]?s=L:void 0!==l[1]?s=U:void 0!==l[2]?(q.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=B):void 0!==l[3]&&(s=B):s===B?">"===l[0]?(s=n??R,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,r=l[1],s=void 0===l[3]?B:'"'===l[3]?z:F):s===z||s===F?s=B:s===L||s===U?s=R:(s=B,n=void 0);const u=s===B&&t[a+1].startsWith("/>")?" ":"";o+=s===R?e+_:d>=0?(i.push(r),e.slice(0,d)+A+e.slice(d)+$+u):e+$+(-2===d?a:u)}return[K(t,o+(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<s;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(A)){const e=d[o++],r=i.getAttribute(t).split($),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:s[2],strings:r,ctor:"."===s[1]?tt:"?"===s[1]?et:"@"===s[1]?rt:X}),i.removeAttribute(t)}else t.startsWith($)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(q.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],M()),Y.nextNode(),a.push({type:2,index:++n});i.append(t[e],M())}}}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=I.createElement("template");return r.innerHTML=t,r}}function J(t,e,r=t,i){var n,o;if(e===H)return e;let s=void 0!==i?null==(n=r._$Co)?void 0:n[i]:r._$Cl;const a=N(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==a&&(null==(o=null==s?void 0:s._$AO)||o.call(s,!1),void 0===a?s=void 0:(s=new a(t),s._$AT(t,r,i)),void 0!==i?(r._$Co??(r._$Co=[]))[i]=s:r._$Cl=s),void 0!==s&&(e=J(t,s._$AS(t,e.values),s,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)??I).importNode(e,!0);Y.currentNode=i;let n=Y.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===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[++s]}o!==(null==a?void 0:a.index)&&(n=Y.nextNode(),o++)}return Y.currentNode=I,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!==H&&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(I.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(M()),this.O(M()),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 o=!1;if(void 0===n)t=J(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==H,o&&(this._$AH=t);else{const i=t;let s,a;for(t=n[0],s=0;s<n.length-1;s++)a=J(this,i[r+s],e,s),a===H&&(a=this._$AH[s]),o||(o=!N(a)||a!==this._$AH[s]),a===j?t=j:t!==j&&(t+=(a??"")+n[s+1]),this._$AH[s]=a}o&&!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)===H)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 ot=globalThis;class st 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(M(),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 H}}st._$litElement$=!0,st.finalized=!0,null==(e=ot.litElementHydrateSupport)||e.call(ot,{LitElement:st});const at=ot.litElementPolyfillSupport;null==at||at({LitElement:st}),(ot.litElementVersions??(ot.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 o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.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="idle",St="initializing",Pt="ready",Ct="processing",At="requires_action",$t="succeeded",Et="failed";class _t{constructor(t,e,r,i,n={},o){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=o,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 It{constructor(t,e){this.state={status:kt},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:St}),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}),o=new URL(n.result.redirectUrl).searchParams.get("token");if(!o)throw new Error("No token found in redirectUrl");this.paymentToken=o,this.paymentIntentId=n.result.paymentIntentId;const s=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:s.result.customerAmount||t.amount,currency:s.result.currency||t.currency,status:Pt,...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++})}),this.setState({status:Pt,paymentIntent:l,availableMethods:d}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:s.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:Et,error:t}),this.emit({type:"payment_failed",payload:{error:t}}),e}}async submitPayment(t,e){var r,i,n,o,s;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:Ct,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"}},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:Ct}}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==(o=d.error)?void 0:o.message)||l.message,e=d.code||(null==(s=d.error)?void 0:s.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:Et,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 _t(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;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("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:At,...t.metadata&&{metadata:t.metadata}};return this.setState({status:At,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:$t,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:Et,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 Mt="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Nt=function(t,e,r,i,n,o,s,a,l,d){var c=this;c.numeralDecimalMark=t||".",c.numeralIntegerScale=e>0?e:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=i||Nt.groupStyle.thousand,c.numeralPositiveOnly=!!n,c.stripLeadingZeroes=!1!==o,c.prefix=s||""===s?s:"",c.signBeforePrefix=!!a,c.tailPrefix=!!l,c.delimiter=d||""===d?d:",",c.delimiterRE=d?new RegExp("\\"+d,"g"):""};Nt.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Nt.prototype={getRawValue:function(t){return t.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(t){var e,r,i,n,o=this,s="";switch(t=t.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),o.stripLeadingZeroes&&(t=t.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===t.slice(0,1)?"-":"",i=void 0!==o.prefix?o.signBeforePrefix?r+o.prefix:o.prefix+r:r,n=t,t.indexOf(o.numeralDecimalMark)>=0&&(n=(e=t.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+e[1].slice(0,o.numeralDecimalScale)),"-"===r&&(n=n.slice(1)),o.numeralIntegerScale>0&&(n=n.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case Nt.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case Nt.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case Nt.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?r+n.toString()+(o.numeralDecimalScale>0?s.toString():"")+o.prefix:i+n.toString()+(o.numeralDecimalScale>0?s.toString():"")}};var Tt=Nt,Dt=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()};Dt.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 o=t.slice(0,i),s=o.slice(0,1),a=t.slice(i);switch(e.datePattern[n]){case"d":"00"===o?o="01":parseInt(s,10)>3?o="0"+s:parseInt(o,10)>31&&(o="31");break;case"m":"00"===o?o="01":parseInt(s,10)>1?o="0"+s:parseInt(o,10)>12&&(o="12")}r+=o,t=a}}),this.getFixedDateString(r)},getFixedDateString:function(t){var e,r,i,n=this,o=n.datePattern,s=[],a=0,l=0,d=0,c=0,u=0,h=0,p=!1;return 4===t.length&&"y"!==o[0].toLowerCase()&&"y"!==o[1].toLowerCase()&&(u=2-(c="d"===o[0]?0:2),e=parseInt(t.slice(c,c+2),10),r=parseInt(t.slice(u,u+2),10),s=this.getFixedDate(e,r,0)),8===t.length&&(o.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,s=this.getFixedDate(e,r,i)),4!==t.length||"y"!==o[0]&&"y"!==o[1]||(h=2-(u="m"===o[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,s=[0,r,i]),6!==t.length||"Y"!==o[0]&&"Y"!==o[1]||(h=2-.5*(u="m"===o[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,s=[0,r,i]),s=n.getRangeFixedDate(s),n.date=s,0===s.length?t:o.reduce(function(t,e){switch(e){case"d":return t+(0===s[0]?"":n.addLeadingZero(s[0]));case"m":return t+(0===s[1]?"":n.addLeadingZero(s[1]));case"y":return t+(p?n.addLeadingZeroForYear(s[2],!1):"");case"Y":return t+(p?n.addLeadingZeroForYear(s[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 Rt=Dt,Lt=function(t,e){var r=this;r.time=[],r.blocks=[],r.timePattern=t,r.timeFormat=e,r.initBlocks()};Lt.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,o){if(t.length>0){var s=t.slice(0,n),a=s.slice(0,1),l=t.slice(n);switch(e.timePattern[o]){case"h":parseInt(a,10)>i.maxHourFirstDigit?s="0"+a:parseInt(s,10)>i.maxHours&&(s=i.maxHours+"");break;case"m":case"s":parseInt(a,10)>i.maxMinutesFirstDigit?s="0"+a:parseInt(s,10)>i.maxMinutes&&(s=i.maxMinutes+"")}r+=s,t=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(t){var e,r,i,n=this,o=n.timePattern,s=[],a=0,l=0,d=0,c=0,u=0,h=0;return 6===t.length&&(o.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),s=this.getFixedTime(i,r,e)),4===t.length&&n.timePattern.indexOf("s")<0&&(o.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),s=this.getFixedTime(i,r,e)),n.time=s,0===s.length?t:o.reduce(function(t,e){switch(e){case"s":return t+n.addLeadingZero(s[2]);case"m":return t+n.addLeadingZero(s[1]);case"h":return t+n.addLeadingZero(s[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 Ut=Lt,Bt=function(t,e){var r=this;r.delimiter=e||""===e?e:" ",r.delimiterRE=e?new RegExp("\\"+e,"g"):"",r.formatter=t};Bt.prototype={setFormatter:function(t){this.formatter=t},format:function(t){var e=this;e.formatter.clear();for(var r,i="",n=!1,o=0,s=(t=(t=(t=t.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(e.delimiterRE,"")).length;o<s;o++)r=e.formatter.inputDigit(t.charAt(o)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,e.delimiter)}};var Ft=Bt,zt={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=zt.blocks,i=zt.re;for(var n in e=!!e,i)if(i[n].test(t)){var o=r[n];return{type:n,blocks:e?this.getStrictBlocks(o):o}}return{type:"unknown",blocks:e?this.getStrictBlocks(r.general):r.general}}},qt=zt,Ot={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 o,s,a;return o=this.stripDelimiters(e.slice(0,t),i,n),s=this.stripDelimiters(r.slice(0,t),i,n),0!==(a=o.length-s.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,o,s,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,o,s,a,l)}if(i.slice(0,r)!==e&&!a)return s&&!i&&t?t:"";if(i.slice(-r)!==e&&a)return s&&!i&&t?t:"";var c=this.stripDelimiters(i,n,o);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,o){var s="",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[o?d-1:d]||l:i,o?(d>0&&(s+=l),s+=c):(s+=c,c.length===e&&d<r-1&&(s+=l)),t=u}}),s)},fixPrefixCursor:function(t,e,r,i){if(t){var n=t.value,o=r||i[0]||" ";if(t.setSelectionRange&&e&&!(e.length+o.length<=n.length)){var s=2*n.length;setTimeout(function(){t.setSelectionRange(s,s)},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)}},Ht={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 Mt&&Mt?Mt:window,t.document=e.document||t.root.document,t.maxLength=0,t.backspace=!1,t.result="",t.onValueChanged=e.onValueChanged||function(){},t}},jt=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=jt.DefaultProperties.assign({},e),r.init()};jt.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=jt.Util.getMaxLength(e.blocks),t.isAndroid=jt.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 jt.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 jt.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=jt.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var t=this.properties;t.date&&(t.dateFormatter=new jt.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=jt.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var t=this.properties;if(t.phone)try{t.phoneFormatter=new jt.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=jt.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),jt.Util.fixPrefixCursor(t.element,e.prefix,e.delimiter,e.delimiters)},onCut:function(t){jt.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(t),this.onInput(""))},onCopy:function(t){jt.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(t)},copyClipboardData:function(t){var e=this.properties,r=jt.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(o){}},onInput:function(t){var e=this,r=e.properties,i=jt.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=jt.Util;i.headStr(r.result,4)!==i.headStr(t,4)&&(e=jt.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=jt.Util,r=t.properties;if(t.element){var i=t.element.selectionEnd,n=t.element.value,o=r.result;i=e.getNextCursorPosition(i,n,o,r.delimiter,r.delimiters),t.isAndroid?window.setTimeout(function(){t.element.value=o,e.setSelection(t.element,i,r.document,!1),t.callOnValueChanged()},1):(t.element.value=o,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=jt.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]"}},jt.NumeralFormatter=Tt,jt.DateFormatter=Rt,jt.TimeFormatter=Ut,jt.PhoneFormatter=Ft,jt.CreditCardDetector=qt,jt.Util=Ot,jt.DefaultProperties=Ht,("object"==typeof Mt&&Mt?Mt:window).Cleave=jt;var Vt=jt,Yt={},Qt={},Kt={};let Gt;const Jt=[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];Kt.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},Kt.getSymbolTotalCodewords=function(t){return Jt[t]},Kt.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},Kt.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');Gt=t},Kt.isKanjiModeEnabled=function(){return void 0!==Gt},Kt.toSJIS=function(t){return Gt(t)};var Zt,Wt={};function Xt(){this.buffer=[],this.length=0}(Zt=Wt).L={bit:1},Zt.M={bit:0},Zt.Q={bit:3},Zt.H={bit:2},Zt.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},Zt.from=function(t,e){if(Zt.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 Zt.L;case"m":case"medium":return Zt.M;case"q":case"quartile":return Zt.Q;case"h":case"high":return Zt.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(r){return e}},Xt.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 te=Xt;function ee(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)}ee.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},ee.prototype.get=function(t,e){return this.data[t*this.size+e]},ee.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},ee.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var re=ee,ie={};!function(t){const e=Kt.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)),o=[i-7];for(let e=1;e<r-1;e++)o[e]=o[e-1]-n;return o.push(6),o.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}}(ie);var ne={};const oe=Kt.getSymbolSize;ne.getPositions=function(t){const e=oe(t);return[[0,0],[e-7,0],[0,e-7]]};var se={};!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 o(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,o=0,s=null,a=null;for(let l=0;l<r;l++){n=o=0,s=a=null;for(let d=0;d<r;d++){let r=t.get(l,d);r===s?n++:(n>=5&&(i+=e+(n-5)),s=r,n=1),r=t.get(d,l),r===a?o++:(o>=5&&(i+=e+(o-5)),a=r,o=1)}n>=5&&(i+=e+(n-5)),o>=5&&(i+=e+(o-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,o=0;for(let i=0;i<e;i++){n=o=0;for(let s=0;s<e;s++)n=n<<1&2047|t.get(i,s),s>=10&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(s,i),s>=10&&(1488===o||93===o)&&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,o(t,n,i))},t.getBestMask=function(e,r){const i=Object.keys(t.Patterns).length;let n=0,o=1/0;for(let s=0;s<i;s++){r(s),t.applyMask(s,e);const i=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),i<o&&(o=i,n=s)}return n}}(se);var ae={};const le=Wt,de=[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],ce=[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];ae.getBlocksCount=function(t,e){switch(e){case le.L:return de[4*(t-1)+0];case le.M:return de[4*(t-1)+1];case le.Q:return de[4*(t-1)+2];case le.H:return de[4*(t-1)+3];default:return}},ae.getTotalCodewordsCount=function(t,e){switch(e){case le.L:return ce[4*(t-1)+0];case le.M:return ce[4*(t-1)+1];case le.Q:return ce[4*(t-1)+2];case le.H:return ce[4*(t-1)+3];default:return}};var ue={},he={};const pe=new Uint8Array(512),me=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)pe[e]=t,me[t]=e,t<<=1,256&t&&(t^=285);for(let e=255;e<512;e++)pe[e]=pe[e-255]}(),he.log=function(t){if(t<1)throw new Error("log("+t+")");return me[t]},he.exp=function(t){return pe[t]},he.mul=function(t,e){return 0===t||0===e?0:pe[me[t]+me[e]]},function(t){const e=he;t.mul=function(t,r){const i=new Uint8Array(t.length+r.length-1);for(let n=0;n<t.length;n++)for(let o=0;o<r.length;o++)i[n+o]^=e.mul(t[n],r[o]);return i},t.mod=function(t,r){let i=new Uint8Array(t);for(;i.length-r.length>=0;){const t=i[0];for(let o=0;o<r.length;o++)i[o]^=e.mul(r[o],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}}(ue);const ge=ue;function fe(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}fe.prototype.initialize=function(t){this.degree=t,this.genPoly=ge.generateECPolynomial(this.degree)},fe.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=ge.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 ye=fe,ve={},be={},we={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},xe={};const ke="[0-9]+";let Se="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Se=Se.replace(/u/g,"\\u");const Pe="(?:(?![A-Z0-9 $%*+\\-./:]|"+Se+")(?:.|[\r\n]))+";xe.KANJI=new RegExp(Se,"g"),xe.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),xe.BYTE=new RegExp(Pe,"g"),xe.NUMERIC=new RegExp(ke,"g"),xe.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Ce=new RegExp("^"+Se+"$"),Ae=new RegExp("^"+ke+"$"),$e=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");xe.testKanji=function(t){return Ce.test(t)},xe.testNumeric=function(t){return Ae.test(t)},xe.testAlphanumeric=function(t){return $e.test(t)},function(t){const e=we,r=xe;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}}}(be),function(t){const e=Kt,r=ae,i=Wt,n=be,o=we,s=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 o.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,i,s){if(!o.isValid(t))throw new Error("Invalid QR Code version");void 0===s&&(s=n.BYTE);const l=8*(e.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,i));if(s===n.MIXED)return l;const d=l-a(s,t);switch(s){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 o;const s=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,s);if(0===e.length)return 1;o=e[0]}else o=e;return function(e,r,i){for(let n=1;n<=40;n++)if(r<=t.getCapacity(n,i,e))return n}(o.mode,o.getLength(),s)},t.getEncodedBits=function(t){if(!o.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;e.getBCHDigit(r)-s>=0;)r^=7973<<e.getBCHDigit(r)-s;return t<<12|r}}(ve);var Ee={};const _e=Kt,Ie=_e.getBCHDigit(1335);Ee.getEncodedBits=function(t,e){const r=t.bit<<3|e;let i=r<<10;for(;_e.getBCHDigit(i)-Ie>=0;)i^=1335<<_e.getBCHDigit(i)-Ie;return 21522^(r<<10|i)};var Me={};const Ne=be;function Te(t){this.mode=Ne.NUMERIC,this.data=t.toString()}Te.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},Te.prototype.getLength=function(){return this.data.length},Te.prototype.getBitsLength=function(){return Te.getBitsLength(this.data.length)},Te.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 De=Te;const Re=be,Le=["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 Ue(t){this.mode=Re.ALPHANUMERIC,this.data=t}Ue.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},Ue.prototype.getLength=function(){return this.data.length},Ue.prototype.getBitsLength=function(){return Ue.getBitsLength(this.data.length)},Ue.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*Le.indexOf(this.data[e]);r+=Le.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(Le.indexOf(this.data[e]),6)};var Be=Ue;const Fe=be;function ze(t){this.mode=Fe.BYTE,this.data="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t)}ze.getBitsLength=function(t){return 8*t},ze.prototype.getLength=function(){return this.data.length},ze.prototype.getBitsLength=function(){return ze.getBitsLength(this.data.length)},ze.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var qe=ze;const Oe=be,He=Kt;function je(t){this.mode=Oe.KANJI,this.data=t}je.getBitsLength=function(t){return 13*t},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;for(e=0;e<this.data.length;e++){let r=He.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 Ve,Ye=je,Qe={exports:{}};Ve={single_source_shortest_paths:function(t,e,r){var i={},n={};n[e]=0;var o,s,a,l,d,c,u,h=Ve.PriorityQueue.make();for(h.push(e,0);!h.empty();)for(a in s=(o=h.pop()).value,l=o.cost,d=t[s]||{})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]=s));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=Ve.single_source_shortest_paths(t,e,r);return Ve.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=Ve.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}}},Qe.exports=Ve;var Ke=Qe.exports;!function(t){const e=be,r=De,i=Be,n=qe,o=Ye,s=xe,a=Kt,l=Ke;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(s.NUMERIC,e.NUMERIC,t),i=c(s.ALPHANUMERIC,e.ALPHANUMERIC,t);let n,o;a.isKanjiModeEnabled()?(n=c(s.BYTE,e.BYTE,t),o=c(s.KANJI,e.KANJI,t)):(n=c(s.BYTE_KANJI,e.BYTE,t),o=[]);return r.concat(i,n,o).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,s){switch(s){case e.NUMERIC:return r.getBitsLength(t);case e.ALPHANUMERIC:return i.getBitsLength(t);case e.KANJI:return o.getBitsLength(t);case e.BYTE:return n.getBitsLength(t)}}function p(t,s){let l;const d=e.getBestModeForData(t);if(l=e.from(s,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 o(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())),o=function(t,r){const i={},n={start:{}};let o=["start"];for(let s=0;s<t.length;s++){const a=t[s],l=[];for(let t=0;t<a.length;t++){const d=a[t],c=""+s+t;l.push(c),i[c]={node:d,lastCount:0},n[c]={};for(let t=0;t<o.length;t++){const s=o[t];i[s]&&i[s].node.mode===d.mode?(n[s][c]=h(i[s].lastCount+d.length,d.mode)-h(i[s].lastCount,d.mode),i[s].lastCount+=d.length):(i[s]&&(i[s].lastCount=d.length),n[s][c]=h(d.length,d.mode)+4+e.getCharCountIndicator(d.mode,r))}}o=l}for(let e=0;e<o.length;e++)n[o[e]].end=0;return{map:n,table:i}}(n,i),s=l.find_path(o.map,"start","end"),c=[];for(let t=1;t<s.length-1;t++)c.push(o.table[s[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()))}}(Me);const Ge=Kt,Je=Wt,Ze=te,We=re,Xe=ie,tr=ne,er=se,rr=ae,ir=ye,nr=ve,or=Ee,sr=be,ar=Me;function lr(t,e,r){const i=t.size,n=or.getEncodedBits(e,r);let o,s;for(o=0;o<15;o++)s=1==(n>>o&1),o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(i-15+o,8,s,!0),o<8?t.set(8,i-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(i-8,8,1,!0)}function dr(t,e,r){const i=new Ze;r.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),sr.getCharCountIndicator(e.mode,t)),e.write(i)});const n=8*(Ge.getSymbolTotalCodewords(t)-rr.getTotalCodewordsCount(t,e));for(i.getLengthInBits()+4<=n&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const o=(n-i.getLengthInBits())/8;for(let s=0;s<o;s++)i.put(s%2?17:236,8);return function(t,e,r){const i=Ge.getSymbolTotalCodewords(e),n=rr.getTotalCodewordsCount(e,r),o=i-n,s=rr.getBlocksCount(e,r),a=i%s,l=s-a,d=Math.floor(i/s),c=Math.floor(o/s),u=c+1,h=d-c,p=new ir(h);let m=0;const g=new Array(s),f=new Array(s);let y=0;const v=new Uint8Array(t.buffer);for(let S=0;S<s;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<s;x++)w<g[x].length&&(b[k++]=g[x][w]);for(w=0;w<h;w++)for(x=0;x<s;x++)b[k++]=f[x][w];return b}(i,t,e)}function cr(t,e,r,i){let n;if(Array.isArray(t))n=ar.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let i=e;if(!i){const e=ar.rawSplit(t);i=nr.getBestVersionForData(e,r)}n=ar.fromString(t,i||40)}}const o=nr.getBestVersionForData(n,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else e=o;const s=dr(e,r,n),a=Ge.getSymbolSize(e),l=new We(a);return function(t,e){const r=t.size,i=tr.getPositions(e);for(let n=0;n<i.length;n++){const e=i[n][0],o=i[n][1];for(let i=-1;i<=7;i++)if(!(e+i<=-1||r<=e+i))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+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,o+n,!0,!0):t.set(e+i,o+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=Xe.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),lr(l,r,0),e>=7&&function(t,e){const r=t.size,i=nr.getEncodedBits(e);let n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+r-8-3,s=1==(i>>a&1),t.set(n,o,s,!0),t.set(o,n,s,!0)}(l,e),function(t,e){const r=t.size;let i=-1,n=r-1,o=7,s=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;s<e.length&&(i=1==(e[s]>>>o&1)),t.set(n,a-r,i),o--,-1===o&&(s++,o=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}(l,s),isNaN(i)&&(i=er.getBestMask(l,lr.bind(null,l,r))),er.applyMask(i,l),lr(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}Qt.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let r,i,n=Je.M;return void 0!==e&&(n=Je.from(e.errorCorrectionLevel,Je.M),r=nr.from(e.version),i=er.from(e.maskPattern),e.toSJISFunc&&Ge.setToSJISFunction(e.toSJISFunc)),cr(t,r,n,i)};var ur={},hr={};!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,o=r.modules.data,s=t.getScale(n,i),a=Math.floor((n+2*i.margin)*s),l=i.margin*s,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[o[Math.floor((t-l)/s)*n+Math.floor((r-l)/s)]?1:0]}e[c++]=u.r,e[c++]=u.g,e[c++]=u.b,e[c]=u.a}}}(hr),function(t){const e=hr;t.render=function(t,r,i){let n=i,o=r;void 0!==n||r&&r.getContext||(n=r,r=void 0),r||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),n=e.getOptions(n);const s=e.getImageWidth(t.modules.size,n),a=o.getContext("2d"),l=a.createImageData(s,s);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,o,s),a.putImageData(l,0,0),o},t.renderToDataURL=function(e,r,i){let n=i;void 0!==n||r&&r.getContext||(n=r,r=void 0),n||(n={});const o=t.render(e,r,n),s=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(s,a.quality)}}(ur);var pr={};const mr=hr;function gr(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function fr(t,e,r){let i=t+e;return void 0!==r&&(i+=" "+r),i}pr.render=function(t,e,r){const i=mr.getOptions(e),n=t.modules.size,o=t.modules.data,s=n+2*i.margin,a=i.color.light.a?"<path "+gr(i.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+gr(i.color.dark,"stroke")+' d="'+function(t,e,r){let i="",n=0,o=!1,s=0;for(let a=0;a<t.length;a++){const l=Math.floor(a%e),d=Math.floor(a/e);l||o||(o=!0),t[a]?(s++,a>0&&l>0&&t[a-1]||(i+=o?fr("M",l+r,.5+d+r):fr("m",n,0),n=0,o=!1),l+1<e&&t[a+1]||(i+=fr("h",s),s=0)):n++}return i}(o,n,i.margin)+'"/>',d='viewBox="0 0 '+s+" "+s+'"',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 yr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},vr=Qt,br=ur,wr=pr;function xr(t,e,r,i,n){const o=[].slice.call(arguments,1),s=o.length,a="function"==typeof o[s-1];if(!a&&!yr())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=e,e=i=void 0):2!==s||e.getContext||(i=r,r=e,e=void 0),new Promise(function(n,o){try{const o=vr.create(r,i);n(t(o,e,i))}catch(s){o(s)}})}if(s<2)throw new Error("Too few arguments provided");2===s?(n=r,r=e,e=i=void 0):3===s&&(e.getContext&&void 0===n?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0));try{const o=vr.create(r,i);n(null,t(o,e,i))}catch(l){n(l)}}Yt.create=vr.create,Yt.toCanvas=xr.bind(null,br.render),Yt.toDataURL=xr.bind(null,br.renderToDataURL),Yt.toString=xr.bind(null,function(t,e,r){return wr.render(t,r)});var kr=Object.defineProperty,Sr=Object.getOwnPropertyDescriptor,Pr=(t,e,r,i)=>{for(var n,o=i>1?void 0:i?Sr(e,r):e,s=t.length-1;s>=0;s--)(n=t[s])&&(o=(i?n(e,r,o):n(o))||o);return i&&o&&kr(e,r,o),o};let Cr=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.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 Vt(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:t=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[t]||"unknown"}})),i&&!this.expiryCleave&&(this.expiryCleave=new Vt(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"}}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 It(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 Yt.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.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 o=parseInt(t,10);i&&(o*=2,o>9&&(o-=9)),r+=o,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 o=parseInt(i,10);if(o<1||o>12)return{valid:!1,error:"Invalid month (01-12)"};const s=new Date,a=s.getFullYear(),l=s.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&&o<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}))}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,o=null!=e.initialAmount?"number"==typeof e.initialAmount?e.initialAmount:Number(e.initialAmount)||0:this.amount,s=null!=e.customerAmount?"number"==typeof e.customerAmount?e.customerAmount:Number(e.customerAmount)||0:o,a=i-n;return{currency:e.currency||this.currency,charge:o,fees:i,feeBreakdown:{transactionFee:a,merchantFee:a,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:s}}renderTransactionDetailsSkeleton(){return O`
12
12
  <div class="skeleton-transaction">
13
13
  <div class="skeleton skeleton-title"></div>
14
14
  <div class="skeleton-row">
@@ -1920,5 +1920,5 @@ var OnePayments=function(t){"use strict";
1920
1920
  transform: translateX(-50%) translateY(0);
1921
1921
  }
1922
1922
  }
1923
- `,Pr([ct({type:Object})],Cr.prototype,"config",2),Pr([ct({type:Object})],Cr.prototype,"adapters",2),Pr([ct({type:Number})],Cr.prototype,"amount",2),Pr([ct({type:String})],Cr.prototype,"currency",2),Pr([ct({type:String})],Cr.prototype,"orderId",2),Pr([ct({type:String})],Cr.prototype,"firstName",2),Pr([ct({type:String})],Cr.prototype,"lastName",2),Pr([ct({type:String})],Cr.prototype,"email",2),Pr([ct({type:String})],Cr.prototype,"phoneNumber",2),Pr([ct({type:Array})],Cr.prototype,"excludePaymentMethods",2),Pr([ct({type:String})],Cr.prototype,"width",2),Pr([ct({type:String})],Cr.prototype,"maxWidth",2),Pr([ct({type:Object})],Cr.prototype,"appearance",2),Pr([ut()],Cr.prototype,"currentState",2),Pr([ut()],Cr.prototype,"selectedMethod",2),Pr([ut()],Cr.prototype,"cardFormData",2),Pr([ut()],Cr.prototype,"formErrors",2),Pr([ut()],Cr.prototype,"paymentData",2),Pr([ut()],Cr.prototype,"feesExpanded",2),Pr([ut()],Cr.prototype,"isInitializing",2),Pr([ut()],Cr.prototype,"cardBrand",2),Pr([ut()],Cr.prototype,"paymentLocked",2),Pr([ut()],Cr.prototype,"show3DSModal",2),Pr([ut()],Cr.prototype,"showQRModal",2),Pr([ut()],Cr.prototype,"nextActionUrl",2),Pr([ut()],Cr.prototype,"qrCode",2),Pr([ut()],Cr.prototype,"qrCodeDataUrl",2),Pr([ut()],Cr.prototype,"qrAutoResumeTimer",2),Pr([ut()],Cr.prototype,"qrPollingInProgress",2),Cr=Pr([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],Cr);class $r{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ar(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 Ar(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 Ar(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 Ar(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 Ar(r);throw new Error(t)}return await r.json()}}class Er{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 _r{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),o=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,n);return this.bufferToHex(s)}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 Ir{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function Mr(){return{http:new $r,storage:new Er,crypto:new _r,timer:new Ir}}const Nr="one-payment",Tr="1.5.5";!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(Nr))return console.info(`[OnePayments] <${Nr}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Nr,Cr),console.info(`[OnePayments] Registered <${Nr}> custom element (v${Tr})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Nr}>:`,t),!1}}();const Dr={createWebAdapters:Mr,TAG_NAME:Nr,VERSION:Tr,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Nr),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Nr)};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=Dr),t.OnePayments=Dr,t.TAG_NAME=Nr,t.VERSION=Tr,t.createWebAdapters=Mr,t.default=Dr,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
1923
+ `,Pr([ct({type:Object})],Cr.prototype,"config",2),Pr([ct({type:Object})],Cr.prototype,"adapters",2),Pr([ct({type:Number})],Cr.prototype,"amount",2),Pr([ct({type:String})],Cr.prototype,"currency",2),Pr([ct({type:String})],Cr.prototype,"orderId",2),Pr([ct({type:String})],Cr.prototype,"firstName",2),Pr([ct({type:String})],Cr.prototype,"lastName",2),Pr([ct({type:String})],Cr.prototype,"email",2),Pr([ct({type:String})],Cr.prototype,"phoneNumber",2),Pr([ct({type:Array})],Cr.prototype,"excludePaymentMethods",2),Pr([ct({type:String})],Cr.prototype,"width",2),Pr([ct({type:String})],Cr.prototype,"maxWidth",2),Pr([ct({type:Object})],Cr.prototype,"appearance",2),Pr([ut()],Cr.prototype,"currentState",2),Pr([ut()],Cr.prototype,"selectedMethod",2),Pr([ut()],Cr.prototype,"cardFormData",2),Pr([ut()],Cr.prototype,"formErrors",2),Pr([ut()],Cr.prototype,"paymentData",2),Pr([ut()],Cr.prototype,"feesExpanded",2),Pr([ut()],Cr.prototype,"isInitializing",2),Pr([ut()],Cr.prototype,"cardBrand",2),Pr([ut()],Cr.prototype,"paymentLocked",2),Pr([ut()],Cr.prototype,"show3DSModal",2),Pr([ut()],Cr.prototype,"showQRModal",2),Pr([ut()],Cr.prototype,"nextActionUrl",2),Pr([ut()],Cr.prototype,"qrCode",2),Pr([ut()],Cr.prototype,"qrCodeDataUrl",2),Pr([ut()],Cr.prototype,"qrAutoResumeTimer",2),Pr([ut()],Cr.prototype,"qrPollingInProgress",2),Cr=Pr([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],Cr);class $r{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ar(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 Ar(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 Ar(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 Ar(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 Ar(r);throw new Error(t)}return await r.json()}}class Er{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 _r{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),o=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,n);return this.bufferToHex(s)}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 Ir{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function Mr(){return{http:new $r,storage:new Er,crypto:new _r,timer:new Ir}}const Nr="one-payment",Tr="1.5.6";!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(Nr))return console.info(`[OnePayments] <${Nr}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Nr,Cr),console.info(`[OnePayments] Registered <${Nr}> custom element (v${Tr})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Nr}>:`,t),!1}}();const Dr={createWebAdapters:Mr,TAG_NAME:Nr,VERSION:Tr,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Nr),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Nr)};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=Dr),t.OnePayments=Dr,t.TAG_NAME=Nr,t.VERSION=Tr,t.createWebAdapters=Mr,t.default=Dr,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
1924
1924
  //# sourceMappingURL=one-payment.browser.iife.js.map