@a-tech.jo/atech_payment 1.0.21 → 1.0.23
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.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/src/hyperpay/billing.d.ts +13 -0
- package/dist/src/hyperpay/billing.d.ts.map +1 -0
- package/dist/src/hyperpay/billingStepper.d.ts +15 -0
- package/dist/src/hyperpay/billingStepper.d.ts.map +1 -0
- package/dist/src/hyperpay/hyperpayOrder.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +9 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,OAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAW3E,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAIjB,YAAY,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACrB,CAAC;AA4CF,eAAO,MAAM,uBAAuB,GAChC,MAAM,MAAM,EACZ,mBAAmB,wBAAwB,KAC5C,IAEF,CAAC;AAIF,QAAA,MAAM,WAAW,GAAI,OAAO,iBAAiB,KAAG,SAwH/C,CAAC;AAIF,QAAA,MAAM,WAAW,GAAU,gDAKxB,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAOrC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as t from"react";import*as e from"react/jsx-runtime";var r={d:(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>rr,Rb:()=>er,IZ:()=>nr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>_t,hasStandardBrowserEnv:()=>kt,hasStandardBrowserWebWorkerEnv:()=>Dt,navigator:()=>Ct,origin:()=>It});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),p={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},h={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:p,development:p}[d],y=l(l({ENV:d},h),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(h,t,e)}});const m=y,g=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx}),b=function(t){var e=t.checkoutId,r=t.redirectUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("hyperpay",e),r=document.createElement("script");return r.src=t,r.async=!0,document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},v=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},w=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,g.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},E=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},O=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function S(t,e){return function(){return t.apply(e,arguments)}}const{toString:x}=Object.prototype,{getPrototypeOf:R}=Object,j=(A=Object.create(null),t=>{const e=x.call(t);return A[e]||(A[e]=e.slice(8,-1).toLowerCase())});var A;const P=t=>(t=t.toLowerCase(),e=>j(e)===t),T=t=>e=>typeof e===t,{isArray:N}=Array,L=T("undefined"),_=P("ArrayBuffer"),C=T("string"),k=T("function"),D=T("number"),I=t=>null!==t&&"object"==typeof t,U=t=>{if("object"!==j(t))return!1;const e=R(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},F=P("Date"),B=P("File"),M=P("Blob"),q=P("FileList"),z=P("URLSearchParams"),[G,H,K,W]=["ReadableStream","Request","Response","Headers"].map(P);function J(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),N(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function V(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$=t=>!L(t)&&t!==Y,X=(Z="undefined"!=typeof Uint8Array&&R(Uint8Array),t=>Z&&t instanceof Z);var Z;const Q=P("HTMLFormElement"),tt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),et=P("RegExp"),rt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};J(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},nt="abcdefghijklmnopqrstuvwxyz",ot="0123456789",it={DIGIT:ot,ALPHA:nt,ALPHA_DIGIT:nt+nt.toUpperCase()+ot},at=P("AsyncFunction"),st=(ct="function"==typeof setImmediate,ut=k(Y.postMessage),ct?setImmediate:ut?(lt=`axios@${Math.random()}`,ft=[],Y.addEventListener("message",(({source:t,data:e})=>{t===Y&&e===lt&&ft.length&&ft.shift()()}),!1),t=>{ft.push(t),Y.postMessage(lt,"*")}):t=>setTimeout(t));var ct,ut,lt,ft;const dt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Y):"undefined"!=typeof process&&process.nextTick||st,pt={isArray:N,isArrayBuffer:_,isBuffer:function(t){return null!==t&&!L(t)&&null!==t.constructor&&!L(t.constructor)&&k(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||k(t.append)&&("formdata"===(e=j(t))||"object"===e&&k(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&_(t.buffer),e},isString:C,isNumber:D,isBoolean:t=>!0===t||!1===t,isObject:I,isPlainObject:U,isReadableStream:G,isRequest:H,isResponse:K,isHeaders:W,isUndefined:L,isDate:F,isFile:B,isBlob:M,isRegExp:et,isFunction:k,isStream:t=>I(t)&&k(t.pipe),isURLSearchParams:z,isTypedArray:X,isFileList:q,forEach:J,merge:function t(){const{caseless:e}=$(this)&&this||{},r={},n=(n,o)=>{const i=e&&V(r,o)||o;U(r[i])&&U(n)?r[i]=t(r[i],n):U(n)?r[i]=t({},n):N(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&J(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(J(e,((e,n)=>{r&&k(e)?t[n]=S(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&R(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:j,kindOfTest:P,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(N(t))return t;let e=t.length;if(!D(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:Q,hasOwnProperty:tt,hasOwnProp:tt,reduceDescriptors:rt,freezeMethods:t=>{rt(t,((e,r)=>{if(k(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];k(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return N(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:V,global:Y,isContextDefined:$,ALPHABET:it,generateString:(t=16,e=it.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&k(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(I(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=N(t)?[]:{};return J(t,((t,e)=>{const i=r(t,n+1);!L(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:at,isThenable:t=>t&&(I(t)||k(t))&&k(t.then)&&k(t.catch),setImmediate:st,asap:dt};function ht(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}pt.inherits(ht,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:pt.toJSONObject(this.config),code:this.code,status:this.status}}});const yt=ht.prototype,mt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{mt[t]={value:t}})),Object.defineProperties(ht,mt),Object.defineProperty(yt,"isAxiosError",{value:!0}),ht.from=(t,e,r,n,o,i)=>{const a=Object.create(yt);return pt.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),ht.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const gt=ht;function bt(t){return pt.isPlainObject(t)||pt.isArray(t)}function vt(t){return pt.endsWith(t,"[]")?t.slice(0,-2):t}function wt(t,e,r){return t?t.concat(e).map((function(t,e){return t=vt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Et=pt.toFlatObject(pt,{},null,(function(t){return/^is[A-Z]/.test(t)})),Ot=function(t,e,r){if(!pt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=pt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!pt.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&pt.isSpecCompliantForm(e);if(!pt.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(pt.isDate(t))return t.toISOString();if(!s&&pt.isBlob(t))throw new gt("Blob is not supported. Use a Buffer instead.");return pt.isArrayBuffer(t)||pt.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(pt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(pt.isArray(t)&&function(t){return pt.isArray(t)&&!t.some(bt)}(t)||(pt.isFileList(t)||pt.endsWith(r,"[]"))&&(s=pt.toArray(t)))return r=vt(r),s.forEach((function(t,n){!pt.isUndefined(t)&&null!==t&&e.append(!0===a?wt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!bt(t)||(e.append(wt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Et,{defaultVisitor:u,convertValue:c,isVisitable:bt});if(!pt.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!pt.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),pt.forEach(r,(function(r,i){!0===(!(pt.isUndefined(r)||null===r)&&o.call(e,r,pt.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function St(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function xt(t,e){this._pairs=[],t&&Ot(t,this,e)}const Rt=xt.prototype;Rt.append=function(t,e){this._pairs.push([t,e])},Rt.toString=function(t){const e=t?function(e){return t.call(this,e,St)}:St;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const jt=xt;function At(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pt(t,e,r){if(!e)return t;const n=r&&r.encode||At,o=r&&r.serialize;let i;if(i=o?o(e,r):pt.isURLSearchParams(e)?e.toString():new jt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Tt=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:jt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_t="undefined"!=typeof window&&"undefined"!=typeof document,Ct="object"==typeof navigator&&navigator||void 0,kt=_t&&(!Ct||["ReactNative","NativeScript","NS"].indexOf(Ct.product)<0),Dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,It=_t&&window.location.href||"http://localhost",Ut={...o,...Lt},Ft=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&&pt.isArray(n)?n.length:i,s?(pt.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&pt.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&pt.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a)}if(pt.isFormData(t)&&pt.isFunction(t.entries)){const r={};return pt.forEachEntry(t,((t,n)=>{e(function(t){return pt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Bt={transitional:Nt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=pt.isObject(t);if(o&&pt.isHTMLForm(t)&&(t=new FormData(t)),pt.isFormData(t))return n?JSON.stringify(Ft(t)):t;if(pt.isArrayBuffer(t)||pt.isBuffer(t)||pt.isStream(t)||pt.isFile(t)||pt.isBlob(t)||pt.isReadableStream(t))return t;if(pt.isArrayBufferView(t))return t.buffer;if(pt.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Ot(t,new Ut.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return Ut.isNode&&pt.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=pt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ot(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(pt.isString(t))try{return(0,JSON.parse)(t),pt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Bt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(pt.isResponse(t)||pt.isReadableStream(t))return t;if(t&&pt.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw gt.from(t,gt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ut.classes.FormData,Blob:Ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pt.forEach(["delete","get","head","post","put","patch"],(t=>{Bt.headers[t]={}}));const Mt=Bt,qt=pt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zt=Symbol("internals");function Gt(t){return t&&String(t).trim().toLowerCase()}function Ht(t){return!1===t||null==t?t:pt.isArray(t)?t.map(Ht):String(t)}function Kt(t,e,r,n,o){return pt.isFunction(n)?n.call(this,e,r):(o&&(e=r),pt.isString(e)?pt.isString(n)?-1!==e.indexOf(n):pt.isRegExp(n)?n.test(e):void 0:void 0)}class Wt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Gt(e);if(!o)throw new Error("header name must be a non-empty string");const i=pt.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Ht(t))}const i=(t,e)=>pt.forEach(t,((t,r)=>o(t,r,e)));if(pt.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(pt.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&qt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(pt.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=Gt(t)){const r=pt.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(pt.isFunction(e))return e.call(this,t,r);if(pt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Gt(t)){const r=pt.findKey(this,t);return!(!r||void 0===this[r]||e&&!Kt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Gt(t)){const o=pt.findKey(r,t);!o||e&&!Kt(0,r[o],o,e)||(delete r[o],n=!0)}}return pt.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!Kt(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return pt.forEach(this,((n,o)=>{const i=pt.findKey(r,o);if(i)return e[i]=Ht(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=Ht(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return pt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&pt.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[zt]=this[zt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Gt(t);e[n]||(function(t,e){const r=pt.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return pt.isArray(t)?t.forEach(n):n(t),this}}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),pt.reduceDescriptors(Wt.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),pt.freezeMethods(Wt);const Jt=Wt;function Vt(t,e){const r=this||Mt,n=e||r,o=Jt.from(n.headers);let i=n.data;return pt.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Yt(t){return!(!t||!t.__CANCEL__)}function $t(t,e,r){gt.call(this,null==t?"canceled":t,gt.ERR_CANCELED,e,r),this.name="CanceledError"}pt.inherits($t,gt,{__CANCEL__:!0});const Xt=$t;function Zt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new gt("Request failed with status code "+r.status,[gt.ERR_BAD_REQUEST,gt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Qt=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},te=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},ee=t=>(...e)=>pt.asap((()=>t(...e))),re=Ut.hasStandardBrowserEnv?function(){const t=Ut.navigator&&/(msie|trident)/i.test(Ut.navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=pt.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},ne=Ut.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];pt.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),pt.isString(n)&&a.push("path="+n),pt.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function oe(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const ie=t=>t instanceof Jt?{...t}:t;function ae(t,e){e=e||{};const r={};function n(t,e,r){return pt.isPlainObject(t)&&pt.isPlainObject(e)?pt.merge.call({caseless:r},t,e):pt.isPlainObject(e)?pt.merge({},e):pt.isArray(e)?e.slice():e}function o(t,e,r){return pt.isUndefined(e)?pt.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!pt.isUndefined(e))return n(void 0,e)}function a(t,e){return pt.isUndefined(e)?pt.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(ie(t),ie(e),!0)};return pt.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);pt.isUndefined(a)&&i!==s||(r[n]=a)})),r}const se=t=>{const e=ae({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=Jt.from(s),e.url=Pt(oe(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),pt.isFormData(n))if(Ut.hasStandardBrowserEnv||Ut.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];s.setContentType([t||"multipart/form-data",...e].join("; "))}if(Ut.hasStandardBrowserEnv&&(o&&pt.isFunction(o)&&(o=o(e)),o||!1!==o&&re(e.url))){const t=i&&a&&ne.read(a);t&&s.set(i,t)}return e},ce="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=se(t);let o=n.data;const i=Jt.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=Jt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Zt((function(t){e(t),h()}),(function(t){r(t),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new gt("Request aborted",gt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new gt("Network Error",gt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Nt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new gt(e,o.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&pt.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),pt.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=Qt(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=Qt(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Xt(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);g&&-1===Ut.protocols.indexOf(g)?r(new gt("Unsupported protocol "+g+":",gt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},ue=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof gt?e:new Xt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new gt(`timeout ${e} of ms exceeded`,gt.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:s}=n;return s.unsubscribe=()=>pt.asap(a),s}},le=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},fe=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*le(r,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return s(),void t.close();let i=n.byteLength;if(r){let t=a+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw s(t),t}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},de="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,pe=de&&"function"==typeof ReadableStream,he=de&&("function"==typeof TextEncoder?(ye=new TextEncoder,t=>ye.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var ye;const me=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ge=pe&&me((()=>{let t=!1;const e=new Request(Ut.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),be=pe&&me((()=>pt.isReadableStream(new Response("").body))),ve={stream:be&&(t=>t.body)};var we;de&&(we=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!ve[t]&&(ve[t]=pt.isFunction(we[t])?e=>e[t]():(e,r)=>{throw new gt(`Response type '${t}' is not supported`,gt.ERR_NOT_SUPPORT,r)})})));const Ee=de&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=se(t);u=u?(u+"").toLowerCase():"text";let p,h=ue([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&ge&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=pt.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(pt.isBlob(t))return t.size;if(pt.isSpecCompliantForm(t)){const e=new Request(Ut.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return pt.isArrayBufferView(t)||pt.isArrayBuffer(t)?t.byteLength:(pt.isURLSearchParams(t)&&(t+=""),pt.isString(t)?(await he(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(pt.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=te(m,Qt(ee(c)));n=fe(r.body,65536,t,e)}}pt.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=be&&("stream"===u||"response"===u);if(be&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=pt.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&te(e,Qt(ee(s),!0))||[];i=new Response(fe(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let g=await ve[pt.findKey(ve,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Zt(e,r,{data:g,headers:Jt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new gt("Network Error",gt.ERR_NETWORK,t,p),{cause:e.cause||e});throw gt.from(e,e&&e.code,t,p)}}),Oe={http:null,xhr:ce,fetch:Ee};pt.forEach(Oe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Se=t=>`- ${t}`,xe=t=>pt.isFunction(t)||null===t||!1===t,Re=t=>{t=pt.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!xe(r)&&(n=Oe[(e=String(r)).toLowerCase()],void 0===n))throw new gt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(Se).join("\n"):" "+Se(t[0]):"as no adapter specified";throw new gt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function je(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Xt(null,t)}function Ae(t){return je(t),t.headers=Jt.from(t.headers),t.data=Vt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Re(t.adapter||Mt.adapter)(t).then((function(e){return je(t),e.data=Vt.call(t,t.transformResponse,e),e.headers=Jt.from(e.headers),e}),(function(e){return Yt(e)||(je(t),e&&e.response&&(e.response.data=Vt.call(t,t.transformResponse,e.response),e.response.headers=Jt.from(e.response.headers))),Promise.reject(e)}))}const Pe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Pe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Te={};Pe.transitional=function(t,e,r){function n(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new gt(n(o," has been removed"+(e?" in "+e:"")),gt.ERR_DEPRECATED);return e&&!Te[o]&&(Te[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const Ne={assertOptions:function(t,e,r){if("object"!=typeof t)throw new gt("options must be an object",gt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new gt("option "+i+" must be "+r,gt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new gt("Unknown option "+i,gt.ERR_BAD_OPTION)}},validators:Pe},Le=Ne.validators;class _e{constructor(t){this.defaults=t,this.interceptors={request:new Tt,response:new Tt}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ae(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&Ne.assertOptions(r,{silentJSONParsing:Le.transitional(Le.boolean),forcedJSONParsing:Le.transitional(Le.boolean),clarifyTimeoutError:Le.transitional(Le.boolean)},!1),null!=n&&(pt.isFunction(n)?e.paramsSerializer={serialize:n}:Ne.assertOptions(n,{encode:Le.function,serialize:Le.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&pt.merge(o.common,o[e.method]);o&&pt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Jt.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[Ae.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ae.call(this,d)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return Pt(oe((t=ae(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}pt.forEach(["delete","get","head","options"],(function(t){_e.prototype[t]=function(e,r){return this.request(ae(r||{},{method:t,url:e,data:(r||{}).data}))}})),pt.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ae(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}_e.prototype[t]=e(),_e.prototype[t+"Form"]=e(!0)}));const Ce=_e;class ke{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Xt(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ke((function(e){t=e})),cancel:t}}}const De=ke,Ie={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ie).forEach((([t,e])=>{Ie[e]=t}));const Ue=Ie,Fe=function t(e){const r=new Ce(e),n=S(Ce.prototype.request,r);return pt.extend(n,Ce.prototype,r,{allOwnKeys:!0}),pt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ae(e,r))},n}(Mt);function Be(t){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(t)}function Me(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Me(Object(r),!0).forEach((function(e){ze(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ze(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Be(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Be(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ge(){Ge=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:j(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Be(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function j(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Be(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function He(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ke(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){He(i,n,o,a,s,"next",t)}function s(t){He(i,n,o,a,s,"throw",t)}a(void 0)}))}}Fe.Axios=Ce,Fe.CanceledError=Xt,Fe.CancelToken=De,Fe.isCancel=Yt,Fe.VERSION="1.7.7",Fe.toFormData=Ot,Fe.AxiosError=gt,Fe.Cancel=Fe.CanceledError,Fe.all=function(t){return Promise.all(t)},Fe.spread=function(t){return function(e){return t.apply(null,e)}},Fe.isAxiosError=function(t){return pt.isObject(t)&&!0===t.isAxiosError},Fe.mergeConfig=ae,Fe.AxiosHeaders=Jt,Fe.formToJSON=t=>Ft(pt.isHTMLForm(t)?new FormData(t):t),Fe.getAdapter=Re,Fe.HttpStatusCode=Ue,Fe.default=Fe;var We=Fe.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const Je={createOrder:function(){var t=Ke(Ge().mark((function t(e){var r,n,o,i,a;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,We.post("/orders",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=Ke(Ge().mark((function t(e){var r,n,o,i,a;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,We.get("/orders/".concat(encodeURIComponent(o)),{params:qe({entityId:n,appId:r},i?{resourcePath:i}:{})});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function Ve(t){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ve(t)}function Ye(){Ye=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:j(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ve(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function j(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ve(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function $e(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Xe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){$e(i,n,o,a,s,"next",t)}function s(t){$e(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ze(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Qe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qe(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var tr={hyperpay:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(b,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(v,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(w,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(E,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(O,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},er=function(t,e){tr[t]=e},rr=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=Ze((0,i.useState)(!1),2),d=f[0],p=f[1],h=Ze((0,i.useState)(null),2),y=h[0],m=h[1],g=Ze((0,i.useState)(null),2),b=g[0],v=g[1];return(0,i.useEffect)((function(){if(s&&r&&o){var t=!0,e=function(){var e=Xe(Ye().mark((function e(){var n,i;return Ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),m(null),e.next=5,Je.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 5:n=e.sent,t&&(v(n),l&&l({status:"order_created",provider:n.provider,data:n})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t&&(i=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",m(i),l&&l({status:"error",error:i}));case 13:return e.prev=13,t&&p(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return e(),function(){t=!1}}}),[r,o,s,u]),d?i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment..."):y?i.default.createElement("div",{className:"payment-sdk-error"},y):null!=b&&b.provider&&tr[b.provider]?(0,tr[b.provider])({orderData:b,redirectUrl:u,onChange:l}):null},nr=function(){var t=Xe(Ye().mark((function t(e){var r,n,o,i;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,Je.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),or=n.qT,ir=n.Rb,ar=n.IZ;export{or as PymentOrder,ir as registerPaymentProvider,ar as verifyOrder};
|
|
2
|
+
import*as t from"react";import*as e from"react/jsx-runtime";var r={d:(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>Ar,Rb:()=>Pr,IZ:()=>Rr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>ne,hasStandardBrowserEnv:()=>ie,hasStandardBrowserWebWorkerEnv:()=>ae,navigator:()=>oe,origin:()=>se});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useRef:()=>t.useRef,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),p={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},h={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:p,development:p}[d],y=l(l({ENV:d},h),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(h,t,e)}});const m=y,b=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx,jsxs:()=>e.jsxs});function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const E=function(t){var e=t.checkoutId,r=t.redirectUrl,n=t.billing;return(0,i.useEffect)((function(){var t,r,o,i,a;if(e){var s=window,c=s.wpwlOptions;s.wpwlOptions=w(w({},c),{},{billingAddress:{street1:null!==(t=null==n?void 0:n.street1)&&void 0!==t?t:"",city:null!==(r=null==n?void 0:n.city)&&void 0!==r?r:"",state:null!==(o=null==n?void 0:n.state)&&void 0!==o?o:"",country:null!==(i=null==n?void 0:n.country)&&void 0!==i?i:"",postcode:null!==(a=null==n?void 0:n.postcode)&&void 0!==a?a:""},mandatoryBillingFields:{street1:!0,city:!0,state:!0,country:!0,postcode:!0}});var u=m.getGatewayCheckoutUrl("hyperpay",e),l=document.createElement("script");return l.src=u,l.async=!0,document.body.appendChild(l),function(){s.wpwlOptions=c,document.body.contains(l)&&document.body.removeChild(l)}}}),[e]),e?(0,b.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},S=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},j=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,b.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},x=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,b.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},P=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==C(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}var L=function(t){return t&&"object"===C(t)?t:void 0},_=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,o=e;n<o.length;n++){var i=o[n];if("string"==typeof i&&i.trim())return i.trim();if("number"==typeof i)return String(i)}return""},I=function(t){var e,r,n,o,i=L(null==t?void 0:t.user),a=null!==(e=L(null==t?void 0:t.billingAddress))&&void 0!==e?e:L(null==t?void 0:t.billing),s=(L(null==t?void 0:t.customer),null==i?void 0:i.city),c="object"===C(s)?_(null===(r=L(s))||void 0===r?void 0:r.name):_(s);return{street1:_(null==i?void 0:i.streetName,null==a?void 0:a.street1,null==a?void 0:a.street),city:_(c,null==a?void 0:a.city),state:_(null==a?void 0:a.state,c),country:_(null==i?void 0:i.countryIso2,null===(n=L(null===(o=L(s))||void 0===o?void 0:o.country))||void 0===n?void 0:n.nameIso2,null==a?void 0:a.country).toUpperCase(),postcode:_(null==i?void 0:i.postalCode,null==a?void 0:a.postcode,null==a?void 0:a.postalCode,null==a?void 0:a.zip)}},D={street1:"user.streetName",city:"user.city",state:"user.city",country:"user.countryIso2",postcode:"user.postalCode"},U=function(t){var e=I(t),r=Object.keys(e).filter((function(t){return!e[t]})).map((function(t){return D[t]}));return Array.from(new Set(r))};function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var H=function(t){return function(e){return e.trim()?null:"".concat(t," is required")}},W={"user.streetName":{key:"user.streetName",label:"Street address",placeholder:"Street and number",validate:H("Street address")},"user.city":{key:"user.city",label:"City",validate:H("City")},"user.countryIso2":{key:"user.countryIso2",label:"Country code",placeholder:"2-letter code, e.g. JO",validate:function(t){return/^[A-Za-z]{2}$/.test(t.trim())?null:"Enter a 2-letter country code, e.g. JO"}},"user.postalCode":{key:"user.postalCode",label:"Postal / ZIP code",validate:H("Postal / ZIP code")}},K={wrap:{width:"100%",maxWidth:420,fontFamily:"inherit"},steps:{display:"flex",gap:6,marginBottom:16},title:{fontSize:14,fontWeight:600,marginBottom:4},hint:{fontSize:12,color:"#64748b",marginBottom:12},input:{width:"100%",padding:"10px 12px",border:"1px solid #cbd5e1",borderRadius:8,fontSize:14,boxSizing:"border-box"},error:{color:"#dc2626",fontSize:12,marginTop:6},actions:{display:"flex",justifyContent:"space-between",marginTop:16},button:{padding:"9px 18px",borderRadius:8,border:"1px solid #cbd5e1",background:"#fff",cursor:"pointer",fontSize:14},primary:{padding:"9px 18px",borderRadius:8,border:"none",background:"#2563eb",color:"#fff",cursor:"pointer",fontSize:14}};const J=function(t){var e,r=t.fields,n=t.onComplete,o=r.map((function(t){return W[t]})).filter(Boolean),a=z((0,i.useState)(0),2),s=a[0],c=a[1],u=z((0,i.useState)({}),2),l=u[0],f=u[1],d=z((0,i.useState)(null),2),p=d[0],h=d[1],y=o[s];if(!y)return null;var m=s===o.length-1,v=null!==(e=l[y.key])&&void 0!==e?e:"";return(0,b.jsxs)("form",{className:"payment-sdk-billing",style:K.wrap,onSubmit:function(t){t.preventDefault();var e=y.validate(v);if(e)h(e);else if(h(null),m){var r={};o.forEach((function(t){var e,n=(null!==(e=l[t.key])&&void 0!==e?e:"").trim();r[t.key]="user.countryIso2"===t.key?n.toUpperCase():n})),n(r)}else c(s+1)},noValidate:!0,children:[(0,b.jsx)("div",{style:K.steps,role:"list","aria-label":"Billing details progress",children:o.map((function(t,e){return(0,b.jsx)("div",{role:"listitem","aria-current":e===s?"step":void 0,style:{flex:1,height:4,borderRadius:2,background:e<=s?"#2563eb":"#e2e8f0"}},t.key)}))}),(0,b.jsxs)("div",{style:K.title,children:["Billing details (",s+1," of ",o.length,")"]}),(0,b.jsx)("div",{style:K.hint,children:"Your payment provider needs this to process the card."}),(0,b.jsx)("label",{htmlFor:"billing-".concat(y.key),style:{display:"block",fontSize:13,marginBottom:6},children:y.label}),(0,b.jsx)("input",{id:"billing-".concat(y.key),style:K.input,value:v,placeholder:y.placeholder,autoFocus:!0,onChange:function(t){f(M(M({},l),{},q({},y.key,t.target.value))),h(null)}}),p&&(0,b.jsx)("div",{style:K.error,role:"alert",children:p}),(0,b.jsxs)("div",{style:K.actions,children:[(0,b.jsx)("button",{type:"button",style:M(M({},K.button),{},{visibility:0===s?"hidden":"visible"}),onClick:function(){h(null),c(s-1)},children:"Back"}),(0,b.jsx)("button",{type:"submit",style:K.primary,children:m?"Continue to payment":"Next"})]})]})};function V(t,e){return function(){return t.apply(e,arguments)}}const{toString:Y}=Object.prototype,{getPrototypeOf:$}=Object,X=(Z=Object.create(null),t=>{const e=Y.call(t);return Z[e]||(Z[e]=e.slice(8,-1).toLowerCase())});var Z;const Q=t=>(t=t.toLowerCase(),e=>X(e)===t),tt=t=>e=>typeof e===t,{isArray:et}=Array,rt=tt("undefined"),nt=Q("ArrayBuffer"),ot=tt("string"),it=tt("function"),at=tt("number"),st=t=>null!==t&&"object"==typeof t,ct=t=>{if("object"!==X(t))return!1;const e=$(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},ut=Q("Date"),lt=Q("File"),ft=Q("Blob"),dt=Q("FileList"),pt=Q("URLSearchParams"),[ht,yt,mt,bt]=["ReadableStream","Request","Response","Headers"].map(Q);function vt(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),et(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function gt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ot=t=>!rt(t)&&t!==wt,Et=(St="undefined"!=typeof Uint8Array&&$(Uint8Array),t=>St&&t instanceof St);var St;const jt=Q("HTMLFormElement"),xt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Pt=Q("RegExp"),At=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};vt(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},Rt="abcdefghijklmnopqrstuvwxyz",Tt="0123456789",Nt={DIGIT:Tt,ALPHA:Rt,ALPHA_DIGIT:Rt+Rt.toUpperCase()+Tt},kt=Q("AsyncFunction"),Ct=(Lt="function"==typeof setImmediate,_t=it(wt.postMessage),Lt?setImmediate:_t?(It=`axios@${Math.random()}`,Dt=[],wt.addEventListener("message",(({source:t,data:e})=>{t===wt&&e===It&&Dt.length&&Dt.shift()()}),!1),t=>{Dt.push(t),wt.postMessage(It,"*")}):t=>setTimeout(t));var Lt,_t,It,Dt;const Ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(wt):"undefined"!=typeof process&&process.nextTick||Ct,Ft={isArray:et,isArrayBuffer:nt,isBuffer:function(t){return null!==t&&!rt(t)&&null!==t.constructor&&!rt(t.constructor)&&it(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||it(t.append)&&("formdata"===(e=X(t))||"object"===e&&it(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&nt(t.buffer),e},isString:ot,isNumber:at,isBoolean:t=>!0===t||!1===t,isObject:st,isPlainObject:ct,isReadableStream:ht,isRequest:yt,isResponse:mt,isHeaders:bt,isUndefined:rt,isDate:ut,isFile:lt,isBlob:ft,isRegExp:Pt,isFunction:it,isStream:t=>st(t)&&it(t.pipe),isURLSearchParams:pt,isTypedArray:Et,isFileList:dt,forEach:vt,merge:function t(){const{caseless:e}=Ot(this)&&this||{},r={},n=(n,o)=>{const i=e&>(r,o)||o;ct(r[i])&&ct(n)?r[i]=t(r[i],n):ct(n)?r[i]=t({},n):et(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&vt(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(vt(e,((e,n)=>{r&&it(e)?t[n]=V(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&$(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:X,kindOfTest:Q,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(et(t))return t;let e=t.length;if(!at(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:jt,hasOwnProperty:xt,hasOwnProp:xt,reduceDescriptors:At,freezeMethods:t=>{At(t,((e,r)=>{if(it(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];it(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return et(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:gt,global:wt,isContextDefined:Ot,ALPHABET:Nt,generateString:(t=16,e=Nt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&it(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(st(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=et(t)?[]:{};return vt(t,((t,e)=>{const i=r(t,n+1);!rt(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:kt,isThenable:t=>t&&(st(t)||it(t))&&it(t.then)&&it(t.catch),setImmediate:Ct,asap:Ut};function Bt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Ft.inherits(Bt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ft.toJSONObject(this.config),code:this.code,status:this.status}}});const Mt=Bt.prototype,qt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{qt[t]={value:t}})),Object.defineProperties(Bt,qt),Object.defineProperty(Mt,"isAxiosError",{value:!0}),Bt.from=(t,e,r,n,o,i)=>{const a=Object.create(Mt);return Ft.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Bt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const zt=Bt;function Gt(t){return Ft.isPlainObject(t)||Ft.isArray(t)}function Ht(t){return Ft.endsWith(t,"[]")?t.slice(0,-2):t}function Wt(t,e,r){return t?t.concat(e).map((function(t,e){return t=Ht(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Kt=Ft.toFlatObject(Ft,{},null,(function(t){return/^is[A-Z]/.test(t)})),Jt=function(t,e,r){if(!Ft.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=Ft.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Ft.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Ft.isSpecCompliantForm(e);if(!Ft.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Ft.isDate(t))return t.toISOString();if(!s&&Ft.isBlob(t))throw new zt("Blob is not supported. Use a Buffer instead.");return Ft.isArrayBuffer(t)||Ft.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(Ft.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(Ft.isArray(t)&&function(t){return Ft.isArray(t)&&!t.some(Gt)}(t)||(Ft.isFileList(t)||Ft.endsWith(r,"[]"))&&(s=Ft.toArray(t)))return r=Ht(r),s.forEach((function(t,n){!Ft.isUndefined(t)&&null!==t&&e.append(!0===a?Wt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!Gt(t)||(e.append(Wt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Kt,{defaultVisitor:u,convertValue:c,isVisitable:Gt});if(!Ft.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Ft.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Ft.forEach(r,(function(r,i){!0===(!(Ft.isUndefined(r)||null===r)&&o.call(e,r,Ft.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function Vt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Yt(t,e){this._pairs=[],t&&Jt(t,this,e)}const $t=Yt.prototype;$t.append=function(t,e){this._pairs.push([t,e])},$t.toString=function(t){const e=t?function(e){return t.call(this,e,Vt)}:Vt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Xt=Yt;function Zt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qt(t,e,r){if(!e)return t;const n=r&&r.encode||Zt,o=r&&r.serialize;let i;if(i=o?o(e,r):Ft.isURLSearchParams(e)?e.toString():new Xt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const te=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ft.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ne="undefined"!=typeof window&&"undefined"!=typeof document,oe="object"==typeof navigator&&navigator||void 0,ie=ne&&(!oe||["ReactNative","NativeScript","NS"].indexOf(oe.product)<0),ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,se=ne&&window.location.href||"http://localhost",ce={...o,...re},ue=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&&Ft.isArray(n)?n.length:i,s?(Ft.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&Ft.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&Ft.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a)}if(Ft.isFormData(t)&&Ft.isFunction(t.entries)){const r={};return Ft.forEachEntry(t,((t,n)=>{e(function(t){return Ft.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},le={transitional:ee,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=Ft.isObject(t);if(o&&Ft.isHTMLForm(t)&&(t=new FormData(t)),Ft.isFormData(t))return n?JSON.stringify(ue(t)):t;if(Ft.isArrayBuffer(t)||Ft.isBuffer(t)||Ft.isStream(t)||Ft.isFile(t)||Ft.isBlob(t)||Ft.isReadableStream(t))return t;if(Ft.isArrayBufferView(t))return t.buffer;if(Ft.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Jt(t,new ce.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return ce.isNode&&Ft.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Ft.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Jt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(Ft.isString(t))try{return(0,JSON.parse)(t),Ft.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||le.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Ft.isResponse(t)||Ft.isReadableStream(t))return t;if(t&&Ft.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw zt.from(t,zt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ft.forEach(["delete","get","head","post","put","patch"],(t=>{le.headers[t]={}}));const fe=le,de=Ft.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(t){return t&&String(t).trim().toLowerCase()}function ye(t){return!1===t||null==t?t:Ft.isArray(t)?t.map(ye):String(t)}function me(t,e,r,n,o){return Ft.isFunction(n)?n.call(this,e,r):(o&&(e=r),Ft.isString(e)?Ft.isString(n)?-1!==e.indexOf(n):Ft.isRegExp(n)?n.test(e):void 0:void 0)}class be{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=he(e);if(!o)throw new Error("header name must be a non-empty string");const i=Ft.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=ye(t))}const i=(t,e)=>Ft.forEach(t,((t,r)=>o(t,r,e)));if(Ft.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(Ft.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&de[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(Ft.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=he(t)){const r=Ft.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(Ft.isFunction(e))return e.call(this,t,r);if(Ft.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=he(t)){const r=Ft.findKey(this,t);return!(!r||void 0===this[r]||e&&!me(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=he(t)){const o=Ft.findKey(r,t);!o||e&&!me(0,r[o],o,e)||(delete r[o],n=!0)}}return Ft.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!me(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return Ft.forEach(this,((n,o)=>{const i=Ft.findKey(r,o);if(i)return e[i]=ye(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=ye(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Ft.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&Ft.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[pe]=this[pe]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=he(t);e[n]||(function(t,e){const r=Ft.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return Ft.isArray(t)?t.forEach(n):n(t),this}}be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ft.reduceDescriptors(be.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),Ft.freezeMethods(be);const ve=be;function ge(t,e){const r=this||fe,n=e||r,o=ve.from(n.headers);let i=n.data;return Ft.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function we(t){return!(!t||!t.__CANCEL__)}function Oe(t,e,r){zt.call(this,null==t?"canceled":t,zt.ERR_CANCELED,e,r),this.name="CanceledError"}Ft.inherits(Oe,zt,{__CANCEL__:!0});const Ee=Oe;function Se(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new zt("Request failed with status code "+r.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const je=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},xe=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Pe=t=>(...e)=>Ft.asap((()=>t(...e))),Ae=ce.hasStandardBrowserEnv?function(){const t=ce.navigator&&/(msie|trident)/i.test(ce.navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=Ft.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},Re=ce.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];Ft.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Ft.isString(n)&&a.push("path="+n),Ft.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Te(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Ne=t=>t instanceof ve?{...t}:t;function ke(t,e){e=e||{};const r={};function n(t,e,r){return Ft.isPlainObject(t)&&Ft.isPlainObject(e)?Ft.merge.call({caseless:r},t,e):Ft.isPlainObject(e)?Ft.merge({},e):Ft.isArray(e)?e.slice():e}function o(t,e,r){return Ft.isUndefined(e)?Ft.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!Ft.isUndefined(e))return n(void 0,e)}function a(t,e){return Ft.isUndefined(e)?Ft.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(Ne(t),Ne(e),!0)};return Ft.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);Ft.isUndefined(a)&&i!==s||(r[n]=a)})),r}const Ce=t=>{const e=ke({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=ve.from(s),e.url=Qt(Te(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Ft.isFormData(n))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];s.setContentType([t||"multipart/form-data",...e].join("; "))}if(ce.hasStandardBrowserEnv&&(o&&Ft.isFunction(o)&&(o=o(e)),o||!1!==o&&Ae(e.url))){const t=i&&a&&Re.read(a);t&&s.set(i,t)}return e},Le="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=Ce(t);let o=n.data;const i=ve.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=ve.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Se((function(t){e(t),h()}),(function(t){r(t),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new zt("Request aborted",zt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new zt("Network Error",zt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ee;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new zt(e,o.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Ft.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),Ft.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=je(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=je(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Ee(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);b&&-1===ce.protocols.indexOf(b)?r(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},_e=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof zt?e:new Ee(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new zt(`timeout ${e} of ms exceeded`,zt.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:s}=n;return s.unsubscribe=()=>Ft.asap(a),s}},Ie=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},De=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*Ie(r,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return s(),void t.close();let i=n.byteLength;if(r){let t=a+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw s(t),t}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},Ue="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Fe=Ue&&"function"==typeof ReadableStream,Be=Ue&&("function"==typeof TextEncoder?(Me=new TextEncoder,t=>Me.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Me;const qe=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ze=Fe&&qe((()=>{let t=!1;const e=new Request(ce.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Ge=Fe&&qe((()=>Ft.isReadableStream(new Response("").body))),He={stream:Ge&&(t=>t.body)};var We;Ue&&(We=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!He[t]&&(He[t]=Ft.isFunction(We[t])?e=>e[t]():(e,r)=>{throw new zt(`Response type '${t}' is not supported`,zt.ERR_NOT_SUPPORT,r)})})));const Ke=Ue&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Ce(t);u=u?(u+"").toLowerCase():"text";let p,h=_e([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&ze&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=Ft.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(Ft.isBlob(t))return t.size;if(Ft.isSpecCompliantForm(t)){const e=new Request(ce.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Ft.isArrayBufferView(t)||Ft.isArrayBuffer(t)?t.byteLength:(Ft.isURLSearchParams(t)&&(t+=""),Ft.isString(t)?(await Be(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(Ft.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=xe(m,je(Pe(c)));n=De(r.body,65536,t,e)}}Ft.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=Ge&&("stream"===u||"response"===u);if(Ge&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=Ft.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&xe(e,je(Pe(s),!0))||[];i=new Response(De(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let b=await He[Ft.findKey(He,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Se(e,r,{data:b,headers:ve.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new zt("Network Error",zt.ERR_NETWORK,t,p),{cause:e.cause||e});throw zt.from(e,e&&e.code,t,p)}}),Je={http:null,xhr:Le,fetch:Ke};Ft.forEach(Je,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ve=t=>`- ${t}`,Ye=t=>Ft.isFunction(t)||null===t||!1===t,$e=t=>{t=Ft.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!Ye(r)&&(n=Je[(e=String(r)).toLowerCase()],void 0===n))throw new zt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(Ve).join("\n"):" "+Ve(t[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Xe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ee(null,t)}function Ze(t){return Xe(t),t.headers=ve.from(t.headers),t.data=ge.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),$e(t.adapter||fe.adapter)(t).then((function(e){return Xe(t),e.data=ge.call(t,t.transformResponse,e),e.headers=ve.from(e.headers),e}),(function(e){return we(e)||(Xe(t),e&&e.response&&(e.response.data=ge.call(t,t.transformResponse,e.response),e.response.headers=ve.from(e.response.headers))),Promise.reject(e)}))}const Qe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Qe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const tr={};Qe.transitional=function(t,e,r){function n(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new zt(n(o," has been removed"+(e?" in "+e:"")),zt.ERR_DEPRECATED);return e&&!tr[o]&&(tr[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const er={assertOptions:function(t,e,r){if("object"!=typeof t)throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new zt("option "+i+" must be "+r,zt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}},validators:Qe},rr=er.validators;class nr{constructor(t){this.defaults=t,this.interceptors={request:new te,response:new te}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ke(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&er.assertOptions(r,{silentJSONParsing:rr.transitional(rr.boolean),forcedJSONParsing:rr.transitional(rr.boolean),clarifyTimeoutError:rr.transitional(rr.boolean)},!1),null!=n&&(Ft.isFunction(n)?e.paramsSerializer={serialize:n}:er.assertOptions(n,{encode:rr.function,serialize:rr.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Ft.merge(o.common,o[e.method]);o&&Ft.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=ve.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[Ze.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ze.call(this,d)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return Qt(Te((t=ke(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Ft.forEach(["delete","get","head","options"],(function(t){nr.prototype[t]=function(e,r){return this.request(ke(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ke(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}nr.prototype[t]=e(),nr.prototype[t+"Form"]=e(!0)}));const or=nr;class ir{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Ee(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ir((function(e){t=e})),cancel:t}}}const ar=ir,sr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sr).forEach((([t,e])=>{sr[e]=t}));const cr=sr,ur=function t(e){const r=new or(e),n=V(or.prototype.request,r);return Ft.extend(n,or.prototype,r,{allOwnKeys:!0}),Ft.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ke(e,r))},n}(fe);function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fr(Object(r),!0).forEach((function(e){pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=lr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hr(){hr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function v(){}function g(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(k([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==lr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(lr(e)+" is not iterable")}return v.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function yr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function mr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){yr(i,n,o,a,s,"next",t)}function s(t){yr(i,n,o,a,s,"throw",t)}a(void 0)}))}}ur.Axios=or,ur.CanceledError=Ee,ur.CancelToken=ar,ur.isCancel=we,ur.VERSION="1.7.7",ur.toFormData=Jt,ur.AxiosError=zt,ur.Cancel=ur.CanceledError,ur.all=function(t){return Promise.all(t)},ur.spread=function(t){return function(e){return t.apply(null,e)}},ur.isAxiosError=function(t){return Ft.isObject(t)&&!0===t.isAxiosError},ur.mergeConfig=ke,ur.AxiosHeaders=ve,ur.formToJSON=t=>ue(Ft.isHTMLForm(t)?new FormData(t):t),ur.getAdapter=$e,ur.HttpStatusCode=cr,ur.default=ur;var br=ur.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const vr={createOrder:function(){var t=mr(hr().mark((function t(e){var r,n,o,i,a;return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,br.post("/orders",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=mr(hr().mark((function t(e){var r,n,o,i,a;return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,br.get("/orders/".concat(encodeURIComponent(o)),{params:dr({entityId:n,appId:r},i?{resourcePath:i}:{})});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function gr(){gr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function v(){}function g(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(k([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==wr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(wr(e)+" is not iterable")}return v.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function wr(t){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(t)}function Or(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Er(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Or(i,n,o,a,s,"next",t)}function s(t){Or(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Sr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return jr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var xr={hyperpay:function(t){var e=t.orderData,r=t.order,n=t.redirectUrl,o=t.onChange;return(0,b.jsx)(E,{checkoutId:e.checkoutId,billing:I(r),redirectUrl:n,onChange:o})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(S,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(j,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(x,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(P,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},Pr=function(t,e){xr[t]=e},Ar=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=Sr((0,i.useState)(!1),2),d=f[0],p=f[1],h=Sr((0,i.useState)(null),2),y=h[0],m=h[1],v=Sr((0,i.useState)(null),2),g=v[0],w=v[1],O=Sr((0,i.useState)({}),2),E=O[0],S=O[1],j=(0,i.useRef)(l);j.current=l;var x=(0,i.useRef)(null),P=(0,i.useRef)(!0),A=s&&r&&o?JSON.stringify([r,o,u,s]):null;if((0,i.useEffect)((function(){return P.current=!0,function(){P.current=!1}}),[]),(0,i.useEffect)((function(){if(s&&r&&o&&A&&x.current!==A){x.current=A;var t=function(){return P.current&&x.current===A},e=function(){var e=Er(gr().mark((function e(){var n,i,a,c,l,f,d,h,y;return gr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),m(null),w(null),S({}),e.next=7,vr.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 7:n=e.sent,t()&&"hyperpay"===n.provider&&(i=U(s)).length&&(null===(a=j.current)||void 0===a||a.call(j,{status:"billing_required",fields:i})),t()&&(w(n),null===(c=j.current)||void 0===c||c.call(j,{status:"order_created",provider:n.provider,data:n})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t()&&(d=null===e.t0||void 0===e.t0||null===(l=e.t0.response)||void 0===l?void 0:l.data,h=(null==d?void 0:d.message)||(null==d?void 0:d.error)||(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",y=null==d?void 0:d.code,m({message:h,code:y}),null===(f=j.current)||void 0===f||f.call(j,d&&"object"===wr(d)?d:{success:!1,error:h,code:y}));case 16:return e.prev=16,t()&&p(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])})));return function(){return e.apply(this,arguments)}}();e()}}),[A]),d)return i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment...");if(y)return i.default.createElement("div",{className:"payment-sdk-error",role:"alert","data-code":y.code},y.message);if(null!=g&&g.provider&&xr[g.provider]){var T=xr[g.provider],k=function(t,e){var r;if(!t)return null;var n=Object.entries(e).filter((function(t){return N(t,1)[0].startsWith("user.")}));if(!n.length)return t;var o=R({},null!==(r=L(t.user))&&void 0!==r?r:{});return n.forEach((function(t){var e=N(t,2),r=e[0],n=e[1];o[r.slice(5)]=n})),R(R({},t),{},{user:o})}(s,E);if("hyperpay"===g.provider){var C=U(k);if(C.length)return(0,b.jsx)(J,{fields:C,onComplete:function(t){S(t),null==l||l({status:"billing_completed",fields:Object.keys(t)})}})}return T({orderData:g,order:k,redirectUrl:u,onChange:l})}return null},Rr=function(){var t=Er(gr().mark((function t(e){var r,n,o,i;return gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,vr.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Tr=n.qT,Nr=n.Rb,kr=n.IZ;export{Tr as PymentOrder,Nr as registerPaymentProvider,kr as verifyOrder};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HyperpayBilling, OrderObject } from "@/types";
|
|
2
|
+
/**
|
|
3
|
+
* Billing details HyperPay needs, read from the order that was sent to create-order.
|
|
4
|
+
* The backend reads `order.user` (streetName, city, countryIso2, postalCode, ...);
|
|
5
|
+
* `billingAddress` / `customer` are accepted too. Missing values stay "" so the
|
|
6
|
+
* widget asks the shopper for them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getHyperpayBilling: (order?: OrderObject | null) => HyperpayBilling;
|
|
9
|
+
/** Copy values keyed by order field (e.g. "user.postalCode") into order.user. */
|
|
10
|
+
export declare const withBillingValues: (order: OrderObject | null | undefined, values: Record<string, string>) => OrderObject | null;
|
|
11
|
+
/** Order fields HyperPay needs that the order did not provide. Empty when complete. */
|
|
12
|
+
export declare const getMissingBillingFields: (order?: OrderObject | null) => string[];
|
|
13
|
+
//# sourceMappingURL=billing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe5D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,eAc/D,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,GAC1B,OAAO,WAAW,GAAG,IAAI,GAAG,SAAS,EACrC,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/B,WAAW,GAAG,IAShB,CAAC;AAWF,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,MAAM,EAM1E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface BillingFieldSpec {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
validate: (value: string) => string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const BILLING_FIELD_SPECS: Record<string, BillingFieldSpec>;
|
|
9
|
+
interface BillingStepperProps {
|
|
10
|
+
fields: string[];
|
|
11
|
+
onComplete: (values: Record<string, string>) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const BillingStepper: React.FC<BillingStepperProps>;
|
|
14
|
+
export default BillingStepper;
|
|
15
|
+
//# sourceMappingURL=billingStepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billingStepper.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/billingStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC9C;AAID,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAuBhE,CAAC;AAEF,UAAU,mBAAmB;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACxD;AAcD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkFjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hyperpayOrder.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/hyperpayOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"hyperpayOrder.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/hyperpayOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -17,8 +17,16 @@ export interface BackendOrderResponse {
|
|
|
17
17
|
approvalUrl?: string;
|
|
18
18
|
rawResponse?: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
|
+
export interface HyperpayBilling {
|
|
21
|
+
street1: string;
|
|
22
|
+
city: string;
|
|
23
|
+
state: string;
|
|
24
|
+
country: string;
|
|
25
|
+
postcode: string;
|
|
26
|
+
}
|
|
20
27
|
export interface HyperpayOrderProps {
|
|
21
28
|
checkoutId?: string;
|
|
29
|
+
billing?: HyperpayBilling;
|
|
22
30
|
redirectUrl?: string;
|
|
23
31
|
onChange?: (data?: any) => void;
|
|
24
32
|
}
|
|
@@ -45,6 +53,7 @@ export interface NetworkOrderProps {
|
|
|
45
53
|
}
|
|
46
54
|
export interface GatewayStrategyProps {
|
|
47
55
|
orderData: BackendOrderResponse;
|
|
56
|
+
order?: OrderObject | null;
|
|
48
57
|
redirectUrl?: string;
|
|
49
58
|
onChange?: (data?: any) => void;
|
|
50
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAID,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAID,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,oBAAoB,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAID,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAID,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}
|