@alipay/ams-checkout 2.0.21 → 2.0.22

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/ams-checkout.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * ams-checkout.js v2.0.21
3
- * Build Time: 2026-07-20T06:16:42.923Z
2
+ * ams-checkout.js v2.0.22
3
+ * Build Time: 2026-07-25T09:47:17.084Z
4
4
  * (c) Antom Team
5
5
  */
6
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={4989:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث استثناء غير معروف، يرجى التحقق من حالة الدفع والتواصل مع التاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى."}},8143:function(e){e.exports={"page.wrong.error.message":"Error del sistema"}},1286:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Unbekannte Fehlermeldung. Bitte überprüfen Sie den Zahlungsstatus und wenden Sie sich an den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut."}},9715:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος"}},3282:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please check your payment status and contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again."}},6233:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Por favor, revise la situación del pago y contacte con el comerciante.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo."}},1269:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s'est produite. Veuillez vérifier l'état de votre paiement et contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer."}},6543:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"अज्ञात त्रुटि। कृपया अपनी भुगतान स्थिति जाँचें और व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।"}},7801:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui, silakan periksa status pembayaran dan hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi."}},817:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(3282),r["pt-BR"]=r["pt-br"]=n(9747),r["es-ES"]=r["es-es"]=n(6233),r["ko-KR"]=r["ko-kr"]=n(6367),r["zh-CN"]=r["zh-cn"]=n(6377),r["zh-HK"]=r["zh-hk"]=n(910),r["ms-MY"]=r["ms-my"]=n(6444),r["in-ID"]=r["in-id"]=n(7801),r["th-TH"]=r["th-th"]=n(4744),r["vi-VN"]=r["vi-vn"]=n(9443),r["tl-PH"]=r["tl-ph"]=n(1153),r["it-IT"]=r["it-it"]=n(6858),r["de-DE"]=r["de-de"]=n(1286),r["fr-FR"]=r["fr-fr"]=n(1269),r["nl-NL"]=r["nl-nl"]=n(7465),r["ja-JP"]=r["ja-jp"]=n(7312),r.ro=r.ro=n(4803),r["pl-PL"]=r["pl-pl"]=n(7846),r["ar-SA"]=r["ar-sa"]=n(4989),r["tr-TR"]=r["tr-tr"]=n(9499),r["hi-IN"]=r["hi-in"]=n(6543),r["pt-PT"]=r["pt-pt"]=n(7021),r.ca=r.ca=n(8143),r.el=r.el=n(9715),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},6858:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Errore sconosciuto. Si prega di verificare lo stato del pagamento e di contattare il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova."}},7312:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"未知のエラーが発生しました。お支払い状況をご確認のうえ、加盟店へお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。"}},6367:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 결제 상황을 확인하고 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요."}},6444:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat tidak diketahui. Sila semak butiran pembayaran anda dan hubungi peniaga.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi."}},7465:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Onbekende uitzondering. Controleer de betalingsstatus en neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw."}},7846:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Sprawdź status płatności i skontaktuj się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie."}},9747:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Erro desconhecido. Verifique o status do pagamento e entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente."}},7021:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu uma exceção desconhecida. Verifique a situação do pagamento e entre em contacto com o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente."}},4803:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"Eroare necunoscută. Vă rugăm să verificați statutul plății și să luați legătura cu comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou."}},4744:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ กรุณาตรวจสอบสถานะการชำระเงินและติดต่อผู้ขาย。","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。"}},1153:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Hindi kilalang error. Pakisuri ang mga detalye ng iyong pagbabayad at makipag-ugnayan sa merchant.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli."}},9499:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu, lütfen ödeme durumunu kontrol edin ve satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin."}},9443:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Lỗi không xác định. Vui lòng kiểm tra lại thông tin thanh toán và liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại."}},6377:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"未知异常,请检查付款情况并联系商户。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。"}},910:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"未知異常,請檢查付款情況並聯絡商家。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。"}},8306:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=void 0,t.createSingletonInstance=l,t.createInstance=c,t.createLoader=function(e){var t=this,n=e.sdkURL,s=e.globalName,u=e.timeout,d=void 0===u?2e4:u,p=e.onLoadComplete,h=e.onError,f=e.onLoadStart,m=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,u,v=this;return o(this,(function(_){var b,E;return null==f||f(),t=Date.now(),i.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),b=function(){return(0,a.loadScriptClass)(n,s)},E=d,u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new a.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(E)))}),E)})),b.apply(void 0,e)])},[2,u().then((function(n){return r(v,[n],void 0,(function(n){var r,u,d,h=n.variable,f=n.cache;return o(this,(function(n){switch(n.label){case 0:if(r=Date.now(),f||i.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new a.LoaderError("NO_REMOTE_CLASS","No variables ".concat(s," were found. Cannot be initialized the Class ").concat(s));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?l:c)(h,e,void 0)];case 2:return u=n.sent(),i.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:u.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==m||m(u,window.location.href),[2,u];case 3:throw d=n.sent(),new a.LoaderError("INIT_ERROR","Initialize Class ".concat(s," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=a.LoaderError.unificationError(e);return i.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var i=n(2611),a=n(7880);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});var s=null;function l(e,t,n){return s||(s=c(e,t,n))}function c(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&i.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new a.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&i.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}},2611:function(e,t,n){"use strict";var r,o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var s=n(7880),l=function(){function e(e){Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,s.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull").then((function(t){var n=null==t?void 0:t.variable;if(n)return new n(o({compactExtraInfo:!0,appId:"180020050100012557"},e.initOptions))})).catch((function(){}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(e.set({keyFormat:"origin",userPathAuto:!1}),this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=l;var c=(null===(r="PROD")?void 0:r.toUpperCase())||"PROD",u=["DEV","SIT","PRE","PROD","LOCAL"].includes(c)?c:"PROD";t.tracker=new l({appId:"180020050100012557",env:u,server:"sg",performance:!1,error:!1})},7880:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},7861:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=l(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;s<l;s+=a)i.push(c(e,s,s+a>l?l:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6207:function(e,t,n){"use strict";var r=n(7861),o=n(9090),i=n(8736);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n);e=s(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function _(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return j(Y(t,e.length-n),e,n,r)}function E(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return E(e,t,n,r)}function A(e,t,n,r){return j(F(t),e,n,r)}function k(e,t,n,r){return j(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=void 0!==n.g.TYPED_ARRAY_SUPPORT?n.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return c(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return u(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){i=c[d],a=u[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=H(e[i]);return o}function N(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=l.isBuffer(e)?e:Y(new l(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}},8736:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9090:function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=f,a/=256,c-=8);e[n+h-f]|=128*m}},8098:function(e,t,n){var r=n(4944).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(E,t),u?g(e):a}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function E(){var e=m();if(b(e))return S(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?f(n,i-(e-c)):n}(e))}function S(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function A(){var e=m(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(E,t),g(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},A.flush=function(){return void 0===s?a:S(m())},A}},9414:function(e,t,n){var r=n(4944).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,f="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=h||f||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,b=m["__core-js_shared__"],E=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=y.toString,A=_.hasOwnProperty,k=_.toString,T=RegExp("^"+S.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=m.Symbol,P=g.splice,I=K(m,"Map"),C=K(Object,"create"),R=w?w.prototype:void 0,N=R?R.toString:void 0;function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||z(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:H(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[Y(t[o++])];return o&&o==i?e:void 0}function U(e){if(!G(e)||(t=e,E&&E in t))return!1;var t,n=function(e){var t=G(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}D.prototype.clear=function(){this.__data__=C?C(null):{}},D.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},D.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===o?void 0:n}return A.call(t,e)?t[e]:void 0},D.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:A.call(t,e)},D.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?o:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():P.call(t,n,1),!0)},O.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},O.prototype.has=function(e){return M(this.__data__,e)>-1},O.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new D,map:new(I||O),string:new D}},L.prototype.delete=function(e){return B(this,e).delete(e)},L.prototype.get=function(e){return B(this,e).get(e)},L.prototype.has=function(e){return B(this,e).has(e)},L.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=F((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(z(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function Y(e){if("string"==typeof e||z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(F.Cache||L),n}F.Cache=L;var j=Array.isArray;function G(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function z(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},8994:function(e,t,n){e=n.nmd(e);var r=n(4944).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=p||h||Function("return this")(),m="object"==r(t)&&t&&!t.nodeType&&t,v=m&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===m,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function E(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S,A,k,T=Array.prototype,w=Function.prototype,P=Object.prototype,I=f["__core-js_shared__"],C=w.toString,R=P.hasOwnProperty,N=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",D=P.toString,O=C.call(Object),L=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=g?f.Buffer:void 0,x=f.Symbol,U=f.Uint8Array,B=M?M.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,k=Object,function(e){return A(k(e))}),H=Object.create,Y=P.propertyIsEnumerable,F=T.splice,j=x?x.toStringTag:void 0,G=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=M?M.isBuffer:void 0,V=Math.max,W=Date.now,q=ve(f,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ie(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Ae(e),r=!n&&Se(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Re(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!Ee(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];R.call(e,t)&&Ee(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return R.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:R.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():F.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return me(this,e).get(e)},$.prototype.has=function(e){return me(this,e).has(e)},$.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=D.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return D.call(e)}(e)}function ce(e){return Ce(e)&&le(e)==a}function ue(e){return!(!Ie(e)||function(e){return!!N&&N in e}(e))&&(we(e)?L:c).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ie(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&R.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ie(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Ae(c),f=!h&&Te(c),m=!h&&!f&&Re(c);d=c,h||f||m?Ae(s)?d=s:Ce(b=s)&&ke(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=B?B(n):new e.constructor(n);return e.copy(r),r}(c,!0)):m?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!Ce(e)||le(e)!=l)return!1;var t=K(e);if(null===t)return!0;var n=R.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==O}(c)||Se(c)?(d=s,Se(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Ne(e))}(s):Ie(s)&&!we(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(K(e))}(c))):p=!1}var v,g,y,_;var b;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Ne)}function he(e,t){return be(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),E(e,this,s)}}(e,t,Le),e+"")}var fe=G?function(e,t){return G(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Le;function me(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function Ee(e,t){return e===t||e!=e&&t!=t}var Se=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&R.call(e,"callee")&&!Y.call(e,"callee")},Ae=Array.isArray;function ke(e){return null!=e&&Pe(e.length)&&!we(e)}var Te=z||function(){return!1};function we(e){if(!Ie(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ie(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==r(e)}var Re=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&Pe(e.length)&&!!d[le(e)]};function Ne(e){return ke(e)?te(e,!0):de(e)}var De,Oe=(De=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=De.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ie(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&Ee(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&De(e,s,n,i)}return e})));function Le(e){return e}e.exports=Oe},3089:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8319:function(e,t,n){var r=n(7652);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7652:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},3317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},4180:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},4786:function(e,t,n){var r=n(3317);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7374:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4331:function(e,t,n){var r=n(7652);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},8193:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},1404:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},8946:function(e,t,n){var r=n(7652);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},5486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},1486:function(e,t,n){var r=n(9687),o=n(2424);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(5281);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},9746:function(e,t,n){var r=n(5508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},3400:function(e,t,n){var r=n(2242),o=n(2424),i=n(1983);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4143:function(e,t,n){var r=n(5281);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},5225:function(e,t,n){var r=n(3155);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2242:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5821:function(e,t,n){var r=n(9687);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2185:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},2424:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},4682:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7249:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},20:function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},114:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},5118:function(e,t,n){var r=n(4143);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},4005:function(e,t,n){var r=n(5166);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},5166:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},1983:function(e,t,n){var r=n(4944).default,o=n(7374);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7662:function(e,t,n){var r=n(4944).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var m="suspendedStart",v="executing",g="completed",y={};function _(){}function b(){}function E(){}var S={};p(S,c,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(O([])));k&&k!==i&&a.call(k,c)&&(S=k);var T=E.prototype=_.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(o,i,s,l){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function I(e,n,r){var o=m;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=E,s(T,"constructor",{value:E,configurable:!0}),s(E,"constructor",{value:b,configurable:!0}),b.displayName=p(E,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},w(P.prototype),p(P.prototype,u,(function(){return this})),n.AsyncIterator=P,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new P(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=O,D.prototype={constructor:D,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(N),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9687:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7925:function(e,t,n){var r=n(4180),o=n(7249),i=n(5508),a=n(20);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3155:function(e,t,n){var r=n(2242);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},4044:function(e,t,n){var r=n(4786),o=n(4682),i=n(5508),a=n(114);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(4944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5281:function(e,t,n){var r=n(4944).default,o=n(224);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},4944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5508:function(e,t,n){var r=n(3317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3697:function(e,t,n){var r=n(8319);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){var r=n(2242),o=n(9687),i=n(2185),a=n(1486);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return Pv},AMSAutoDebitPay:function(){return bv},AMSCashierPayment:function(){return Ev},AMSCheckout:function(){return _v},AMSCheckoutPage:function(){return gv},AMSEasyPay:function(){return wv},AMSElement:function(){return Tv},AMSVaulting:function(){return Sv},AddressElement:function(){return kv},AntomElement:function(){return Av},AntomSDK:function(){return $v},ComponentSignEnum:function(){return j},ComponentSignEnumV2:function(){return F},ConnectErrorCode:function(){return de},DisplayTypeEnum:function(){return Y},ElementType:function(){return N},EnvironmentEnum:function(){return X},EventLoggingEventId:function(){return he},InterActionTypeEnum:function(){return ue},MessageName:function(){return ne},PaymentAmountEnum:function(){return W},PaymentElementLayout:function(){return M},PaymentMethodCategoryTypeEnum:function(){return z},PaypalMethodEnum:function(){return le},PlatformEnum:function(){return te},ProductSceneEnum:function(){return G},ProductSceneVersion:function(){return ce},RedirectType:function(){return se},RiskSdkInfoEnum:function(){return pe},TargetEnum:function(){return re},ThemeType:function(){return L},checkoutDisplayEnum:function(){return J},default:function(){return og},errorEnum:function(){return oe},eventCodeEnum:function(){return ae},loadAntom:function(){return rg},localeEnum:function(){return q},modeEnum:function(){return Q},networkModeEnum:function(){return Z},osTypeEnum:function(){return $},payPalConfigurationIntentEnum:function(){return V},redirectTypeEnum:function(){return ie},terminalTypeEnum:function(){return ee}});var e={};n.r(e),n.d(e,{hasBrowserEnv:function(){return so},hasStandardBrowserEnv:function(){return co},hasStandardBrowserWebWorkerEnv:function(){return uo},navigator:function(){return lo},origin:function(){return po}});var t,o=n(7662),i=n.n(o),a=n(1404),s=n.n(a),l=n(4143),c=n.n(l),u=n(9746),d=n.n(u),p=n(5118),h=n.n(p),f=n(702),m=n.n(f),v=n(5486),g=n.n(v),y=n(5821),_=n.n(y),b=n(3400),E=n.n(b),S={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},A={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},k={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},T="2.0.21",w="1.47.2",P=n(907),I=n.n(P),C=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),R=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),N=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),D=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),O=c()(c()(c()(c()(c()(c()({},N.auth,R.AUTH_ELEMENT),N.address,R.ADDRESS_ELEMENT),N.payment,R.PAYMENT_ELEMENT),R.AUTH_ELEMENT,N.auth),R.ADDRESS_ELEMENT,N.address),R.PAYMENT_ELEMENT,N.payment),L=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),M=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),x=(c()(c()({},L.Default,"LIGHT"),L.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),U=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),B=function(e){_()(n,e);var t=E()(n);function n(e){var r;g()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return m()(n)}(I()(Error)),K=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),H=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),Y=function(e){return e.popup="popup",e.inline="inline",e}({}),F=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),j=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),G=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),z=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),V=function(e){return e.intent="intent",e.capture="capture",e}({}),W=function(e){return e.USD="USD",e}({}),q=function(e){return e["en-US"]="en-US",e}({}),J=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),Q=function(e){return e.dropin="dropin",e.component="component",e}({}),Z=function(e){return e.proxy="proxy",e.session="session",e}({}),X=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),$=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),ee=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),te=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),ne=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),re=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),oe=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),ie=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),ae=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),se=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),le=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),ce=function(e){return e.V1="1.0",e.V2="2.0",e}({}),ue=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),de=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),pe=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),he=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),fe={DOMAIN_NOT_IN_WHITE_LIST:{code:ae.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:ae.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:ae.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:ae.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:ae.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:ae.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:ae.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},me="COMPONENT",ve={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},ge={name:"validateFields"},ye="ams-component-container",_e="ams-component-section",be="ams-checkout-component",Ee="asm-component-close-block",Se="ams-component-mask-close-block",Ae="ams-component-retention",ke="ams-component-mockup",Te="ams-component-loading",we="ams-component-popup-loading",Pe="_ams_sdk_component_listener",Ie="ams-inline-component-style",Ce="inline-loading",Re="ams-popup",Ne="light dark",De=15e3,Oe=300,Le="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",Me={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},xe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Ue=new Uint8Array(16);function Be(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Ue)}for(var Ke=[],He=0;He<256;++He)Ke.push((He+256).toString(16).slice(1));function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]}var Fe=function(e,t,n){if(xe.randomUUID&&!t&&!e)return xe.randomUUID();var r=(e=e||{}).random||(e.rng||Be)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ye(r)},je=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ge=function(){function e(t,n){g()(this,e),c()(this,"action",void 0),c()(this,"data",void 0),c()(this,"jsonData",null),this.action=t,this.data=n}return m()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),ze=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Ve=m()((function e(){g()(this,e)})),We=function(){function e(){g()(this,e)}return m()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(je.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(je.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(je.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new ze((function(r){e.traceLog(je.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(je.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=d()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(je.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=d()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var p=c.value;null==p||p.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var h,f=!1,m=d()(e.interceptors);try{for(m.s();!(h=m.n()).done;){var v=h.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),f=f||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){m.e(e)}finally{m.f()}f?e.publish(t,n):e.traceError(je.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(je.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(je.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=d()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();c()(We,"TAG","BusManager"),c()(We,"_logSplit"," , "),c()(We,"interceptors",[]),c()(We,"subscribersMap",new Map),c()(We,"isDebug",!0),c()(We,"logger",void 0);var qe=n(4944),Je=n.n(qe),Qe=n(7374),Ze=n.n(Qe),Xe=n(4044),$e=n.n(Xe),et=n(7925),tt=n.n(et),nt=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Ne,t},rt=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),ot=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),it=function(e){return e.SDK="SDK",e.API="API",e}({}),at=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},st=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return m()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),lt=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},ct=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},ut=window.navigator,dt=ut.userAgent,pt=/iPhone|iPad|iPod/i.test(dt)||"MacIntel"===ut.platform&&ut.maxTouchPoints>1,ht=/Android/i.test(dt),ft=(/\bMacintosh\b/.test(dt),/Windows NT/.test(dt),function(){var e=/OpenHarmony/i.test(ut.userAgent),t=/Phone/i.test(ut.userAgent),n=/Tablet/i.test(ut.userAgent);return e&&(t||n)}),mt=pt,vt=ht,gt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(dt)&&!ft()),yt=(ft(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),_t=function(){var e=ut.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},bt=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},Et=function(){var e=document.documentElement.clientWidth,t=_t()?130:100*e/390;return Math.min(t,130)},St=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(Et(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},At=function(){window.removeEventListener("resize",St),window.removeEventListener("pageShow",St),window.removeEventListener("DOMContentLoaded",St),window.addEventListener("resize",St),window.addEventListener("pageShow",St),window.addEventListener("DOMContentLoaded",St)},kt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},Tt=function(e){return"function"==typeof e};function wt(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function Pt(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var It=function(e){return!(!e||"object"!==Je()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},Ct=function(){var e=(bt()||{}).environment;return!!e&&"dev"===e};function Rt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Nt(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Rt(e,n)>=0&&Rt(r,e)>=0}function Dt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=tt()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var Ot=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=xt(t,n,r,o,i,l),u=bt(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,f=void 0===h?"":h,m=u.groupId,v=void 0===m?"":m,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var b in a)_[b]=""+a[b];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),f&&(_.requestHost=f),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var E=lt(_);return Ct()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,E)),{path:c,locationSearch:E}},Lt=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?jt(n,o):Gt(n,o),a=Ot(h()(h()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Yt(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},Mt=function(e){var t=Ot(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=bt()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Kt(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===j.AUTO_DEBIT_APM?"".concat(k[e]).concat(rt.TRUSTLY):n===G.EASY_PAY?null!=i?i:Gt(n,e):"".concat(S[e],"/").concat(c,"/").concat(l,"/index.html")},Ut=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Bt=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Kt=function(e,t,n){var r,o=(r={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(r,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(r,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},Ht="web_url_",Yt=function(e,t){var n=Ht+e;localStorage.setItem(n,t)},Ft=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=zt(a,i),l=function(){var e=n.sort((function(e,t){return Rt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Rt(T,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Rt(T,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===ot.SDK_PORTAL?(null==l?void 0:l.url)||s:a===ot.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},jt=function(e,t){var n=Ht+e,r=localStorage.getItem(n);return null!=r?r:Gt(e,t)},Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===G.EASY_PAY?zt(ot.SDK_PORTAL,t):""},zt=function(e,t){return"".concat(k[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},Vt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Bt(r),i=Ft({configs:o,mid:n,env:t,pageName:ot.DOUBLE_FA});return i},Wt="antom_checkout_previous_ProductInfo_",qt=function(){function e(){g()(this,e)}return m()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=Wt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=Wt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},Qt=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function Zt(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Jt(e,"");if(t)return t;var n=Fe();e&&n&&Qt(e,n)}}catch(e){return""}};function $t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function en(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var tn=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Rt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Nt(t.sdkVersion,e.v)&&Zt(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=en(e,null!==(a=t.greyscale)&&void 0!==a?a:$t());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},nn=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Jt(t,"")}catch(e){return""}},rn=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return Qt(n,t)}catch(e){return!1}};function on(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(wt(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var an=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=sn(e,t,n);return r||((r=Jt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Rt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Nt(e.sdkVersion,n.v)&&Zt(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=en(n,null!==(a=e.greyscaleId)&&void 0!==a?a:$t());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},ln={production:{url:"https://cdn.marmot-cloud.com/page/antom-js/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},cn=new Set(Object.values(ln).map((function(e){return e.url}))),un=function(){function e(){g()(this,e),c()(this,"state","idle"),c()(this,"loadingPromise",null),c()(this,"apdidModule",null),c()(this,"retryCount",0),c()(this,"config",null)}var t,n;return m()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=ln[t.environment]){e.next=11;break}return a=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),e.abrupt("return",Promise.reject(a));case 11:if(s=n.url,cn.has(s)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(s)),this.state="failed",null===(l=t.callbacks)||void 0===l||null===(c=l.onLoadFailed)||void 0===c||c.call(l,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(s,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0;case 1:if(!(s<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),a=e.t0,s<1&&(this.retryCount++,this.state="idle");case 13:s++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),a;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now();return"noModule"in document.createElement("script")?new Promise((function(o,i){var a=window,s=a.APDID;if(s)return n._onLoadSuccess(s,r,t),void o();var l=Array.from(document.querySelectorAll('script[type="module"]')).find((function(t){return t.src===e})),c=l||document.createElement("script"),u=!1,d=function(){clearTimeout(m),c.removeEventListener("load",h),c.removeEventListener("error",f)},p=function(e){u||(u=!0,d(),c.parentNode&&c.parentNode.removeChild(c),i(e))},h=function(){if(!u){var e=a.APDID;e?(u=!0,d(),n._onLoadSuccess(e,r,t),o()):p(new Error("[ApdidLoader] Module loaded but window.".concat("APDID"," not found")))}},f=function(){p(new Error("[ApdidLoader] Failed to load module script: ".concat(e)))},m=setTimeout((function(){var n,r;u||(null===(n=t.callbacks)||void 0===n||null===(r=n.onLoadTimeout)||void 0===r||r.call(n),p(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4);c.addEventListener("load",h),c.addEventListener("error",f),l||(c.type="module",c.src=e,c.async=!0,c.crossOrigin="anonymous",(document.head||document.getElementsByTagName("head")[0]).appendChild(c))})):Promise.reject(new Error("[ApdidLoader] Module scripts are not supported"))}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();c()(un,"instance",null);var dn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},pn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),hn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},fn=c()(c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.AUTO_DEBIT_PAY,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),mn=function(e){return hn[e]||hn[pn.SG]},vn=function(e){return fn[e]||""},gn=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},yn=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||hn[pn.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=gn(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(fn).includes(this.scene)||!Object.values(hn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),_n=function(){function e(){g()(this,e),c()(this,"registry",new Map)}var t;return m()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),bn=new _n,En=function(){function e(){g()(this,e)}var t;return m()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=nt(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=s()(i()().mark((function t(n){var r,o,a,s,l,c,u,d,p,h=this,f=arguments;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:"SG",o=f.length>2?f[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(a=e.getSecurityConfigStorage(n),s=a.scene||vn(n),console.log("getSecurityScene",s),l=a.h5gateway||mn(r),console.log("preloadSecuritySDK",s),!bn.isReady(s)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!bn.isLoading(s)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=bn.get(s))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=gn(o),un.getInstance().scheduleLoad({environment:u}),d=new yn({scene:s,h5gateway:l,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){bn.setReady(s,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){bn.setFailed(s,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),bn.setLoading(s,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return bn.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===G.EASY_PAY?"2.0":"1.0",i=qt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:T,webAppVersion:""};s.webAppVersion=an(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Lt(l):Mt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();c()(En,"isWebAppPreloaded",!1),c()(En,"isSecuritySDKPreloaded",!1);var Sn=function(e){return e.optional_init="plugin_optional_init",e}({}),An=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),kn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),Tn=function(e){return e.onEventCallback="onEventCallback",e}({}),wn=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Pn=function(e){return e.reportAnalytics="reportAnalytics",e}({}),In=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(In||{}),Cn=function(){function e(t){var n=this;g()(this,e),c()(this,"merchantIdentifier",void 0),c()(this,"merchantName",void 0),c()(this,"session",void 0),c()(this,"paymentState",void 0),c()(this,"getMerchantSession",void 0),c()(this,"completePaymentAuthorized",void 0),c()(this,"completeApplePay",void 0),c()(this,"logError",void 0),c()(this,"isRecurring",!1),c()(this,"logger",void 0),c()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(ae.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(ae.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=In.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=In.success,o=!0})).catch((function(e){i(e),n.paymentState=In.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===In.pending?n.logError(ae.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(ae.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(ae.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return m()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=In.notStarted}},{key:"hasActiveCard",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),Rn=Cn;function Nn(e,t){return function(){return e.apply(t,arguments)}}var Dn,On,Ln=n(3089),Mn=Object.prototype.toString,xn=Object.getPrototypeOf,Un=Symbol.iterator,Bn=Symbol.toStringTag,Kn=(Dn=Object.prototype.hasOwnProperty,function(e,t){return Dn.call(e,t)}),Hn=function(e,t){for(var n=e,r=[];null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),Kn(n,t))return!0;n=xn(n)}return!1},Yn=(On=Object.create(null),function(e){var t=Mn.call(e);return On[t]||(On[t]=t.slice(8,-1).toLowerCase())}),Fn=function(e){return e=e.toLowerCase(),function(t){return Yn(t)===e}},jn=function(e){return function(t){return qe(t)===e}},Gn=Array.isArray,zn=jn("undefined");function Vn(e){return null!==e&&!zn(e)&&null!==e.constructor&&!zn(e.constructor)&&Jn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Wn=Fn("ArrayBuffer");var qn=jn("string"),Jn=jn("function"),Qn=jn("number"),Zn=function(e){return null!==e&&"object"===qe(e)},Xn=function(e){if(!Zn(e))return!1;var t=xn(e);return!(null!==t&&t!==Object.prototype&&null!==xn(t)||Hn(e,Bn)||Hn(e,Un))},$n=Fn("Date"),er=Fn("File"),tr=Fn("Blob"),nr=Fn("FileList");var rr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},or=void 0!==rr.FormData?rr.FormData:void 0,ir=Fn("URLSearchParams"),ar=["ReadableStream","Request","Response","Headers"].map(Fn),sr=et(ar,4),lr=sr[0],cr=sr[1],ur=sr[2],dr=sr[3];function pr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==qe(e)&&(e=[e]),Gn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(Vn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function hr(e,t){if(Vn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var fr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,mr=function(e){return!zn(e)&&e!==fr};var vr,gr=(vr="undefined"!=typeof Uint8Array&&xn(Uint8Array),function(e){return vr&&e instanceof vr}),yr=Fn("HTMLFormElement"),_r=Object.prototype.propertyIsEnumerable,br=Fn("RegExp"),Er=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};pr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var Sr,Ar,kr,Tr,wr=Fn("AsyncFunction"),Pr=(Sr="function"==typeof setImmediate,Ar=Jn(fr.postMessage),Sr?setImmediate:Ar?(kr="axios@".concat(Math.random()),Tr=[],fr.addEventListener("message",(function(e){var t=e.source,n=e.data;t===fr&&n===kr&&Tr.length&&Tr.shift()()}),!1),function(e){Tr.push(e),fr.postMessage(kr,"*")}):function(e){return setTimeout(e)}),Ir="undefined"!=typeof queueMicrotask?queueMicrotask.bind(fr):void 0!==Ln&&Ln.nextTick||Pr,Cr=function(e){return null!=e&&Jn(e[Un])},Rr={isArray:Gn,isArrayBuffer:Wn,isBuffer:Vn,isFormData:function(e){if(!e)return!1;if(or&&e instanceof or)return!0;var t=xn(e);if(!t||t===Object.prototype)return!1;if(!Jn(e.append))return!1;var n=Yn(e);return"formdata"===n||"object"===n&&Jn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Wn(e.buffer)},isString:qn,isNumber:Qn,isBoolean:function(e){return!0===e||!1===e},isObject:Zn,isPlainObject:Xn,isEmptyObject:function(e){if(!Zn(e)||Vn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lr,isRequest:cr,isResponse:ur,isHeaders:dr,isUndefined:zn,isDate:$n,isFile:er,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:tr,isRegExp:br,isFunction:Jn,isStream:function(e){return Zn(e)&&Jn(e.pipe)},isURLSearchParams:ir,isTypedArray:gr,isFileList:nr,forEach:pr,merge:function e(){for(var t=mr(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&hr(o,i)||i,s=Kn(o,a)?o[a]:void 0;Xn(s)&&Xn(t)?o[a]=e(s,t):Xn(t)?o[a]=e({},t):Gn(t)?o[a]=t.slice():r&&zn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!Vn(l)&&(pr(l,i),"object"===qe(l)&&!Gn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];_r.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return pr(t,(function(t,r){n&&Jn(t)?Object.defineProperty(e,r,{__proto__:null,value:Nn(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&xn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Yn,kindOfTest:Fn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(Gn(e))return e;var t=e.length;if(!Qn(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Un]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:yr,hasOwnProperty:Kn,hasOwnProp:Kn,hasOwnInPrototypeChain:Hn,getSafeProp:function(e,t){return null!=e&&Hn(e,t)?e[t]:void 0},reduceDescriptors:Er,freezeMethods:function(e){Er(e,(function(t,n){if(Jn(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Jn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return Gn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:hr,global:fr,isContextDefined:mr,isSpecCompliantForm:function(e){return!!(e&&Jn(e.append)&&"FormData"===e[Bn]&&e[Un])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if(Zn(n)){if(t.has(n))return;if(Vn(n))return n;if(!("toJSON"in n)){t.add(n);var r=Gn(n)?[]:{};return pr(n,(function(t,n){var o=e(t);!zn(o)&&(r[n]=o)})),t.delete(n),r}}return n}(e)},isAsyncFn:wr,isThenable:function(e){return e&&(Zn(e)||Jn(e))&&Jn(e.then)&&Jn(e.catch)},setImmediate:Pr,asap:Ir,isIterable:Cr,isSafeIterable:function(e){return null!=e&&Hn(e,Un)&&Cr(e)}},Nr=Rr.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"]);var Dr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Or=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Lr(e,t){return Rr.isArray(e)?e.map((function(e){return Lr(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Mr(e){var t=Object.create(null);return Rr.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return Lr(e,Or)}(e)})),t}var xr=Symbol("internals");function Ur(e){return e&&String(e).trim().toLowerCase()}function Br(e){return!1===e||null==e?e:Rr.isArray(e)?e.map(Br):function(e){return Lr(e,Dr)}(String(e))}function Kr(e,t,n,r,o){return Rr.isFunction(r)?r.call(this,t,n):(o&&(t=n),Rr.isString(t)?Rr.isString(r)?-1!==t.indexOf(r):Rr.isRegExp(r)?r.test(t):void 0:void 0)}var Hr=function(e,t){function n(e){v(this,n),e&&this.set(e)}return f(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Ur(t);if(o){var i=Rr.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Br(e))}}var i=function(e,t){return Rr.forEach(e,(function(e,n){return o(e,n,t)}))};if(Rr.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Rr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Nr[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)})),o}(e),t);else if(Rr.isObject(e)&&Rr.isSafeIterable(e)){var a,s,l,c=Object.create(null),d=u(e);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(!Rr.isArray(p))throw new TypeError("Object iterator must return a key-value pair");s=p[0],Rr.hasOwnProp(c,s)?(a=c[s],c[s]=Rr.isArray(a)?[].concat(Xe(a),[p[1]]):[a,p[1]]):c[s]=p[1]}}catch(e){d.e(e)}finally{d.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Ur(e)){var n=Rr.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Rr.isFunction(t))return t.call(this,r,n);if(Rr.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Ur(e)){var n=Rr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Ur(e)){var o=Rr.findKey(n,e);!o||t&&!Kr(0,n[o],o,t)||(delete n[o],r=!0)}}return Rr.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Kr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Rr.forEach(this,(function(r,o){var i=Rr.findKey(n,o);if(i)return t[i]=Br(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Br(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Rr.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&Rr.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=et(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[xr]=this[xr]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Ur(e);t[r]||(!function(e,t){var n=Rr.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Rr.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);Hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Rr.reduceDescriptors(Hr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),Rr.freezeMethods(Hr);var Yr=Hr;function Fr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==qe(t))return t;if(Rr.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof Yr&&(t=t.toJSON()),r.push(t),Rr.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);Rr.isUndefined(r)||(o[n]=r)}));else{if(!Rr.isPlainObject(t)&&function(e){if(Rr.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Rr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=et(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?"[REDACTED ****]":e(c);Rr.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}var jr=function(e){y(n,e);var t=b(n);function n(e,r,o,i,a){var s;return v(this,n),s=t.call(this,e),Object.defineProperty(Qe(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return f(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&Rr.hasOwnProp(e,"redact")?e.redact:void 0,n=Rr.isArray(t)&&t.length>0?Fr(e,t):Rr.toJSONObject(e);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:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=new n(e.message,t||e.code,r,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}}]),n}(P(Error));jr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",jr.ERR_BAD_OPTION="ERR_BAD_OPTION",jr.ECONNABORTED="ECONNABORTED",jr.ETIMEDOUT="ETIMEDOUT",jr.ECONNREFUSED="ECONNREFUSED",jr.ERR_NETWORK="ERR_NETWORK",jr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",jr.ERR_DEPRECATED="ERR_DEPRECATED",jr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",jr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",jr.ERR_CANCELED="ERR_CANCELED",jr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",jr.ERR_INVALID_URL="ERR_INVALID_URL",jr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Gr=jr,zr=n(6207).lW;function Vr(e){return Rr.isPlainObject(e)||Rr.isArray(e)}function Wr(e){return Rr.endsWith(e,"[]")?e.slice(0,-2):e}function qr(e,t,n){return e?e.concat(t).map((function(e,t){return e=Wr(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Jr=Rr.toFlatObject(Rr,{},null,(function(e){return/^is[A-Z]/.test(e)}));var Qr=function(e,t,n){if(!Rr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Rr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Rr.isUndefined(t[e])}))).metaTokens,o=n.visitor||h,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&Rr.isSpecCompliantForm(t),u=[];if(!Rr.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Rr.isDate(e))return e.toISOString();if(Rr.isBoolean(e))return e.toString();if(!c&&Rr.isBlob(e))throw new Gr("Blob is not supported. Use a Buffer instead.");if(Rr.isArrayBuffer(e)||Rr.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if(void 0!==zr)return zr.from(e);throw new Gr("Blob is not supported. Use a Buffer instead.",Gr.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new Gr("Object is too deeply nested ("+e+" levels). Max depth: "+l,Gr.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,n,o){var s=e;if(Rr.isReactNative(t)&&Rr.isReactNativeBlob(e))return t.append(qr(o,n,i),d(e)),!1;if(e&&!o&&"object"===qe(e))if(Rr.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!Rr.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r}))}(e,1);else if(Rr.isArray(e)&&function(e){return Rr.isArray(e)&&!e.some(Vr)}(e)||(Rr.isFileList(e)||Rr.endsWith(n,"[]"))&&(s=Rr.toArray(e)))return n=Wr(n),s.forEach((function(e,r){!Rr.isUndefined(e)&&null!==e&&t.append(!0===a?qr([n],r,i):null===a?n:n+"[]",d(e))})),!1;return!!Vr(e)||(t.append(qr(o,n,i),d(e)),!1)}var f=Object.assign(Jr,{defaultVisitor:h,convertValue:d,isVisitable:Vr});if(!Rr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Rr.isUndefined(n)){if(p(i),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),Rr.forEach(n,(function(n,a){!0===(!(Rr.isUndefined(n)||null===n)&&o.call(t,n,Rr.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],i+1)})),u.pop()}}(e),t};function Zr(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Xr(e,t){this._pairs=[],e&&Qr(e,this,t)}var $r=Xr.prototype;$r.append=function(e,t){this._pairs.push([e,t])},$r.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,Zr)}:Zr;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var eo=Xr;function to(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function no(e,t,n){if(!t)return e;e=e||"";var r,o=Rr.isFunction(n)?{serialize:n}:n,i=Rr.getSafeProp(o,"encode")||to,a=Rr.getSafeProp(o,"serialize");if(r=a?a(t,o):Rr.isURLSearchParams(t)?t.toString():new eo(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var ro=function(){function e(){v(this,e),this.handlers=[]}return f(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Rr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),oo=ro,io={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ao={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:eo,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},so="undefined"!=typeof window&&"undefined"!=typeof document,lo="object"===("undefined"==typeof navigator?"undefined":qe(navigator))&&navigator||void 0,co=so&&(!lo||["ReactNative","NativeScript","NS"].indexOf(lo.product)<0),uo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,po=so&&window.location.href||"http://localhost",ho=p(p({},e),ao);function fo(e){if(e>100)throw new Gr("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Gr.ERR_FORM_DATA_DEPTH_EXCEEDED)}var mo=function(e){function t(e,n,r,o){fo(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Rr.isArray(r)?r.length:i,s?(Rr.hasOwnProp(r,i)?r[i]=Rr.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(Rr.hasOwnProp(r,i)&&Rr.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Rr.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Rr.isFormData(e)&&Rr.isFunction(e.entries)){var n={};return Rr.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/\w+|\[(\w*)]/g;null!==(t=r.exec(e));)fo(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},vo=function(e,t){return null!=e&&Rr.hasOwnProp(e,t)?e[t]:void 0};var go={transitional:io,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Rr.isObject(e);if(i&&Rr.isHTMLForm(e)&&(e=new FormData(e)),Rr.isFormData(e))return o?JSON.stringify(mo(e)):e;if(Rr.isArrayBuffer(e)||Rr.isBuffer(e)||Rr.isStream(e)||Rr.isFile(e)||Rr.isBlob(e)||Rr.isReadableStream(e))return e;if(Rr.isArrayBufferView(e))return e.buffer;if(Rr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=vo(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Qr(e,new ho.classes.URLSearchParams,p({visitor:function(e,t,n,r){return ho.isNode&&Rr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=Rr.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=vo(this,"env"),l=s&&s.FormData;return Qr(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Rr.isString(e))try{return(t||JSON.parse)(e),Rr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=vo(this,"transitional")||go.transitional,n=t&&t.forcedJSONParsing,r=vo(this,"responseType"),o="json"===r;if(Rr.isResponse(e)||Rr.isReadableStream(e))return e;if(e&&Rr.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,vo(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw Gr.from(e,Gr.ERR_BAD_RESPONSE,this,null,vo(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ho.classes.FormData,Blob:ho.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rr.forEach(["delete","get","head","post","put","patch","query"],(function(e){go.headers[e]={}}));var yo=go;function _o(e,t){var n=this||yo,r=t||n,o=Yr.from(r.headers),i=r.data;return Rr.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function bo(e){return!(!e||!e.__CANCEL__)}var Eo=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this,null==e?"canceled":e,Gr.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return f(n)}(Gr);function So(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Gr("Request failed with status code "+n.status,n.status>=400&&n.status<500?Gr.ERR_BAD_REQUEST:Gr.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var Ao=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var ko=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,Xe(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)}]},To=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=Ao(50,250);return ko((function(n){if(n&&"number"==typeof n.loaded){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);var d=l({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(d)}}),n)},wo=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Po=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rr.asap((function(){return e.apply(void 0,n)}))}},Io=ho.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,ho.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(ho.origin),ho.navigator&&/(msie|trident)/i.test(ho.navigator.userAgent)):function(){return!0},Co=ho.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Rr.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Rr.isString(r)&&s.push("path=".concat(r)),Rr.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),Rr.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Ro=/^https?:(?!\/\/)/i,No=/[\t\n\r]/g;function Do(e,t){if("string"==typeof e&&Ro.test(function(e){return function(e){for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(No,"")}(e)))throw new Gr('Invalid URL: missing "//" after protocol',Gr.ERR_INVALID_URL,t)}function Oo(e,t,n,r){Do(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Do(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}var Lo=function(e){return e instanceof Yr?p({},e):e};function Mo(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Rr.isPlainObject(e)&&Rr.isPlainObject(t)?Rr.merge.call({caseless:r},e,t):Rr.isPlainObject(t)?Rr.merge({},t):Rr.isArray(t)?t.slice():t}function o(e,t,n,o){return Rr.isUndefined(t)?Rr.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Rr.isUndefined(t))return r(void 0,t)}function a(e,t){return Rr.isUndefined(t)?Rr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Rr.hasOwnProp(t,i)?r(n,o):Rr.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l={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,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Lo(e),Lo(t),0,!0)}};return Rr.forEach(Object.keys(p(p({},e),t)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Rr.hasOwnProp(l,r)?l[r]:o,a=i(Rr.hasOwnProp(e,r)?e[r]:void 0,Rr.hasOwnProp(t,r)?t[r]:void 0,r);Rr.isUndefined(a)&&i!==s||(n[r]=a)}})),Rr.hasOwnProp(t,"validateStatus")&&Rr.isUndefined(t.validateStatus)&&!1===function(n){var r=Rr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Rr.isUndefined(r)){if(!Rr.isPlainObject(r))return;if(Rr.hasOwnProp(r,n))return r[n]}var o=Rr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Rr.isPlainObject(o)&&Rr.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Rr.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var xo=["content-type","content-length"];var Uo=function(e){var t=Mo({},e),n=function(e){return Rr.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=Yr.from(s),t.url=no(Oo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=Rr.getSafeProp(l,"username")||"",h=Rr.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw Gr.from(t,Gr.ERR_BAD_OPTION_VALUE,e)}}if(Rr.isFormData(r)&&(ho.hasStandardBrowserEnv||ho.hasStandardBrowserWebWorkerEnv||Rr.isReactNative(r)?s.setContentType(void 0):Rr.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=et(t,2),r=n[0],o=n[1];xo.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),ho.hasStandardBrowserEnv&&(Rr.isFunction(o)&&(o=o(t)),!0===o||null==o&&Io(t.url))){var f=i&&a&&Co.read(a);f&&s.set(i,f)}return t},Bo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l=Uo(e),c=l.data,u=Yr.from(l.headers).normalize(),d=l.responseType,p=l.onUploadProgress,h=l.onDownloadProgress;function f(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(r),l.signal&&l.signal.removeEventListener("abort",r)}var m=new XMLHttpRequest;function v(){if(m){var r=Yr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());So((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}}if(m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Gr("Request aborted",Gr.ECONNABORTED,e,m)),f(),m=null)},m.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Gr(r,Gr.ERR_NETWORK,e,m);o.event=t||null,n(o),f(),m=null},m.ontimeout=function(){var t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",r=l.transitional||io;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new Gr(t,r.clarifyTimeoutError?Gr.ETIMEDOUT:Gr.ECONNABORTED,e,m)),f(),m=null},void 0===c&&u.setContentType(null),"setRequestHeader"in m&&Rr.forEach(Mr(u),(function(e,t){m.setRequestHeader(t,e)})),Rr.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),h){var g=To(h,!0),y=et(g,2);i=y[0],s=y[1],m.addEventListener("progress",i)}if(p&&m.upload){var _=To(p),b=et(_,2);o=b[0],a=b[1],m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)}(l.cancelToken||l.signal)&&(r=function(t){m&&(n(!t||t.type?new Eo(null,e,m):t),m.abort(),f(),m=null)},l.cancelToken&&l.cancelToken.subscribe(r),l.signal&&(l.signal.aborted?r():l.signal.addEventListener("abort",r)));var E,S,A=(E=l.url,(S=/^([-+\w]{1,25}):(?:\/\/)?/.exec(E))&&S[1]||"");if(A&&!ho.protocols.includes(A))return n(new Gr("Unsupported protocol "+A+":",Gr.ERR_BAD_REQUEST,e)),void f();m.send(c||null)}))},Ko=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Gr?t:new Eo(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new Gr("timeout of ".concat(t,"ms exceeded"),Gr.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){return e.addEventListener("abort",o,{once:!0})}));var s=n.signal;return s.unsubscribe=function(){return Rr.asap(a)},s}},Ho=n(3697),Yo=n(8946),Fo=n(4331),jo=n(8193),Go=o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:i=0;case 6:if(!(i<r)){e.next=13;break}return a=i+n,e.next=10,t.slice(i,a);case 10:i=a,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),zo=function(){var e=Ho(o().mark((function e(t,n){var r,i,a,s,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,s=jo(Vo(t));case 4:return e.next=6,Yo(s.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(Fo(jo(Go(c,n)),Yo),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),i=!0,a=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==s.return){e.next=23;break}return e.next=23,Yo(s.return());case 23:if(e.prev=23,!i){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),Vo=function(){var e=Ho(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(Fo(jo(t),Yo),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,Yo(n.read());case 7:if(r=e.sent,i=r.done,a=r.value,!i){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,a;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,Yo(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),Wo=function(e,t,n,r){var i,s=zo(e,t),l=0,c=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(o().mark((function t(){var r,i,a,u,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.next();case 3:if(r=t.sent,i=r.done,a=r.value,!i){t.next=10;break}return c(),e.close(),t.abrupt("return");case 10:u=a.byteLength,n&&(d=l+=u,n(d)),e.enqueue(new Uint8Array(a)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),c(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},qo=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},Jo=function(e,t,n){return t+2<n&&qo(e.charCodeAt(t+1))&&qo(e.charCodeAt(t+2))};function Qo(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var t=e.indexOf(",");if(t<0)return 0;var n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){for(var o=r.length,i=r.length,a=0;a<i;a++)if(37===r.charCodeAt(a)&&a+2<i){var s=r.charCodeAt(a+1),l=r.charCodeAt(a+2);qo(s)&&qo(l)&&(o-=2,a+=2)}var c=0,u=i-1,d=function(e){return e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e))};u>=0&&(61===r.charCodeAt(u)?(c++,u--):d(u)&&(c++,u-=3)),1===c&&u>=0&&(61===r.charCodeAt(u)||d(u))&&c++;var p=3*Math.floor(o/4)-(c||0);return p>0?p:0}for(var h=0,f=0,m=r.length;f<m;f++){var v=r.charCodeAt(f);if(37===v&&Jo(r,f,m))h+=1,f+=2;else if(v<128)h+=1;else if(v<2048)h+=2;else if(v>=55296&&v<=56319&&f+1<m){var g=r.charCodeAt(f+1);g>=56320&&g<=57343?(h+=4,f++):h+=3}else h+=3}return h}var Zo="1.18.1",Xo=Rr.isFunction,$o=function(e){if(!Rr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ei=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},ti=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},ni=function(e){var t=void 0!==Rr.global&&null!==Rr.global?Rr.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Rr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=i.fetch,l=i.Request,c=i.Response,u=s?Xo(s):"function"==typeof fetch,d=Xo(l),h=Xo(c);if(!u)return!1;var f,m=u&&Xo(n),v=u&&("function"==typeof r?(f=new r,function(e){return f.encode(e)}):function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new l(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),g=d&&m&&ei((function(){var e=!1,t=new l(ho.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),y=h&&m&&ei((function(){return Rr.isReadableStream(new c("").body)})),_={stream:y&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!_[e]&&(_[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Gr("Response type '".concat(e,"' is not supported"),Gr.ERR_NOT_SUPPORT,n)})}));var b=function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!Rr.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!Rr.isSpecCompliantForm(t)){e.next=9;break}return n=new l(ho.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!Rr.isArrayBufferView(t)&&!Rr.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(Rr.isURLSearchParams(t)&&(t+=""),!Rr.isString(t)){e.next=16;break}return e.next=15,v(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Rr.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?b(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(o().mark((function e(t){var n,i,a,u,h,f,v,S,A,k,T,w,P,I,C,R,N,D,O,L,M,x,U,B,K,H,Y,F,j,G,z,V,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,fe,me,ve,ge,ye,_e,be;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Uo(t),i=n.url,a=n.method,u=n.data,h=n.signal,f=n.cancelToken,v=n.timeout,S=n.onDownloadProgress,A=n.onUploadProgress,k=n.responseType,T=n.headers,w=n.withCredentials,P=void 0===w?"same-origin":w,I=n.fetchOptions,C=n.maxContentLength,R=n.maxBodyLength,N=Rr.isNumber(C)&&C>-1,D=Rr.isNumber(R)&&R>-1,O=function(e){return Rr.hasOwnProp(t,e)?t[e]:void 0},L=s||fetch,k=k?(k+"").toLowerCase():"text",M=Ko([h,f&&f.toAbortSignal()],v),x=null,U=M&&M.unsubscribe&&function(){M.unsubscribe()},K=null,H=function(){return new Gr("Request body larger than maxBodyLength limit",Gr.ERR_BAD_REQUEST,t,x)},e.prev=11,Y=void 0,(F=O("auth"))&&(j=Rr.getSafeProp(F,"username")||"",G=Rr.getSafeProp(F,"password")||"",Y={username:j,password:G}),ti(i)&&(z=new URL(i,ho.origin),Y||!z.username&&!z.password||(V=$o(z.username),W=$o(z.password),Y={username:V,password:W}),(z.username||z.password)&&(z.username="",z.password="",i=z.href)),Y&&(T.delete("authorization"),T.set("Authorization","Basic "+btoa((o=(Y.username||"")+":"+(Y.password||""),encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!N||"string"!=typeof i||!i.startsWith("data:")){e.next=21;break}if(!(Qo(i)>C)){e.next=21;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 21:if(!D||"get"===a||"head"===a){e.next=29;break}return e.next=24,b(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(B=q,!(q>R)){e.next=29;break}throw H();case 29:if(J=D&&(Rr.isReadableStream(u)||Rr.isStream(u)),Q=function(e,t,n){return Wo(e,65536,(function(e){if(D&&e>R)throw K=H();t&&t(e)}),n)},!g||"get"===a||"head"===a||!A&&!J){e.next=43;break}if(null!=B){e.next=38;break}return e.next=35,E(T,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=B;case 39:(0!==(B=e.t0)||J)&&(Z=new l(i,{method:"POST",body:u,duplex:"half"}),Rr.isFormData(u)&&(X=Z.headers.get("content-type"))&&T.setContentType(X),Z.body&&($=A&&wo(B,To(Po(A)))||[],ee=et($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===a||"head"===a){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||g||"get"===a||"head"===a){e.next=49;break}throw new Gr("Stream request bodies are not supported by the current fetch implementation",Gr.ERR_NOT_SUPPORT,t,x);case 49:return Rr.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in l.prototype,Rr.isFormData(u)&&(oe=T.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&T.delete("content-type"),T.set("User-Agent","axios/"+Zo,!1),ie=p(p({},I),{},{signal:M,method:a.toUpperCase(),headers:Mr(T.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),x=d&&new l(i,ie),e.next=57,d?L(x,I):L(i,ie);case 57:if(ae=e.sent,se=Yr.from(ae.headers),!N){e.next=63;break}if(!(null!=(le=Rr.toFiniteNumber(se.getContentLength()))&&le>C)){e.next=63;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 63:return ce=y&&("stream"===k||"response"===k),y&&ae.body&&(S||N||ce&&U)&&(ue={},["status","statusText","headers"].forEach((function(e){ue[e]=ae[e]})),de=Rr.toFiniteNumber(se.getContentLength()),pe=S&&wo(de,To(Po(S),!0))||[],he=et(pe,2),fe=he[0],me=he[1],0,ve=function(e){if(N&&e>C)throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},ae=new c(Wo(ae.body,65536,ve,(function(){me&&me(),U&&U()})),ue)),k=k||"text",e.next=68,_[Rr.findKey(_,k)||"text"](ae,t);case 68:if(ge=e.sent,!N||y||ce){e.next=73;break}if(null!=ge&&("number"==typeof ge.byteLength?ye=ge.byteLength:"number"==typeof ge.size?ye=ge.size:"string"==typeof ge&&(ye="function"==typeof r?(new r).encode(ge).byteLength:ge.length)),!("number"==typeof ye&&ye>C)){e.next=73;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 73:return!ce&&U&&U(),e.next=76,new Promise((function(e,n){So(e,n,{data:ge,headers:Yr.from(ae.headers),status:ae.status,statusText:ae.statusText,config:t,request:x})}));case 76:return e.abrupt("return",e.sent);case 79:if(e.prev=79,e.t1=e.catch(11),U&&U(),!(M&&M.aborted&&M.reason instanceof Gr)){e.next=88;break}throw(_e=M.reason).config=t,x&&(_e.request=x),e.t1!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),_e;case 88:if(!K){e.next=91;break}throw x&&!K.request&&(K.request=x),K;case 91:if(!(e.t1 instanceof Gr)){e.next=94;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 94:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=98;break}throw be=new Gr("Network Error",Gr.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(be,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 98:throw Gr.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 99:case"end":return e.stop()}var o}),e,null,[[11,79]])})));return function(t){return e.apply(this,arguments)}}()},ri=new Map,oi=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=ri;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:ni(r)),s=n;return n},ii=(oi(),{http:null,xhr:Bo,fetch:{get:oi}});Rr.forEach(ii,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var ai=function(e){return"- ".concat(e)},si=function(e){return Rr.isFunction(e)||null===e||!1===e};var li={getAdapter:function(e,t){for(var n,r,o=(e=Rr.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!si(n)&&void 0===(r=ii[(s=String(n)).toLowerCase()]))throw new Gr("Unknown adapter '".concat(s,"'"));if(r&&(Rr.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=et(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(ai).join("\n"):" "+ai(l[0]):"as no adapter specified";throw new Gr("There is no suitable adapter to dispatch the request "+c,Gr.ERR_NOT_SUPPORT)}return r},adapters:ii};function ci(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Eo(null,e)}function ui(e){return ci(e),e.headers=Yr.from(e.headers),e.data=_o.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),li.getAdapter(e.adapter||yo.adapter,e)(e).then((function(t){ci(e),e.response=t;try{t.data=_o.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Yr.from(t.headers),t}),(function(t){if(!bo(t)&&(ci(e),t&&t.response)){e.response=t.response;try{t.response.data=_o.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Yr.from(t.response.headers)}return Promise.reject(t)}))}var di={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){di[e]=function(n){return qe(n)===e||"a"+(t<1?"n ":" ")+e}}));var pi={};di.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Zo+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Gr(r(o," has been removed"+(t?" in "+t:"")),Gr.ERR_DEPRECATED);return t&&!pi[o]&&(pi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},di.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var hi={assertOptions:function(e,t,n){if("object"!==qe(e)||null===e)throw new Gr("options must be an object",Gr.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new Gr("option "+i+" must be "+l,Gr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Gr("Unknown option "+i,Gr.ERR_BAD_OPTION)}},validators:di},fi=hi.validators,mi=function(){function e(t){v(this,e),this.defaults=t||{},this.interceptors={request:new oo,response:new oo}}var t;return f(e,[{key:"request",value:(t=a(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=function(){if(!r.stack)return"";var e=r.stack.indexOf("\n");return-1===e?"":r.stack.slice(e+1)}();try{e.t0.stack?i&&(a=i.indexOf("\n"),s=-1===a?-1:i.indexOf("\n",a+1),l=-1===s?"":i.slice(s+1),String(e.t0.stack).endsWith(l)||(e.t0.stack+="\n"+i)):e.t0.stack=i}catch(e){}}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Mo(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&hi.assertOptions(r,{silentJSONParsing:fi.transitional(fi.boolean),forcedJSONParsing:fi.transitional(fi.boolean),clarifyTimeoutError:fi.transitional(fi.boolean),legacyInterceptorReqResOrdering:fi.transitional(fi.boolean),advertiseZstdAcceptEncoding:fi.transitional(fi.boolean),validateStatusUndefinedResolves:fi.transitional(fi.boolean)},!1),null!=o&&(Rr.isFunction(o)?t.paramsSerializer={serialize:o}:hi.assertOptions(o,{encode:fi.function,serialize:fi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),hi.assertOptions(t,{baseUrl:fi.spelling("baseURL"),withXsrfToken:fi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Rr.merge(i.common,i[t.method]);i&&Rr.forEach(["delete","get","head","post","put","patch","query","common"],(function(e){delete i[e]})),t.headers=Yr.concat(a,i);var s=[],l=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){l=l&&e.synchronous;var n=t.transitional||io;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)}}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,p=0;if(!l){var h=[ui.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,u),d=h.length,c=Promise.resolve(t);p<d;)c=c.then(h[p++],h[p++]);return c}d=s.length;for(var f=t;p<d;){var m=s[p++],v=s[p++];try{f=m(f)}catch(e){v.call(this,e);break}}try{c=ui.call(this,f)}catch(e){return Promise.reject(e)}for(p=0,d=u.length;p<d;)c=c.then(u[p++],u[p++]);return c}},{key:"getUri",value:function(e){return no(Oo((e=Mo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();Rr.forEach(["delete","get","head","options"],(function(e){mi.prototype[e]=function(t,n){return this.request(Mo(n||{},{method:e,url:t,data:n&&Rr.hasOwnProp(n,"data")?n.data:void 0}))}})),Rr.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request(Mo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mi.prototype[e]=t(),"query"!==e&&(mi.prototype[e+"Form"]=t(!0))}));var vi=mi,gi=function(){function e(t){if(v(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new Eo(e,t,o),n(r.reason))}))}return f(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),yi=gi;var _i={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(_i).forEach((function(e){var t=et(e,2),n=t[0],r=t[1];_i[r]=n}));var bi=_i;var Ei=function e(t){var n=new vi(t),r=Nn(vi.prototype.request,n);return Rr.extend(r,vi.prototype,n,{allOwnKeys:!0}),Rr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Mo(t,n))},r}(yo);Ei.Axios=vi,Ei.CanceledError=Eo,Ei.CancelToken=yi,Ei.isCancel=bo,Ei.VERSION=Zo,Ei.toFormData=Qr,Ei.AxiosError=Gr,Ei.Cancel=Ei.CanceledError,Ei.all=function(e){return Promise.all(e)},Ei.spread=function(e){return function(t){return e.apply(null,t)}},Ei.isAxiosError=function(e){return Rr.isObject(e)&&!0===e.isAxiosError},Ei.mergeConfig=Mo,Ei.AxiosHeaders=Yr,Ei.formToJSON=function(e){return mo(Rr.isHTMLForm(e)?new FormData(e):e)},Ei.getAdapter=li.getAdapter,Ei.HttpStatusCode=bi,Ei.default=Ei;var Si=Ei,Ai=bt(),ki=Ai._light_sandbox,Ti=Ai.groupId,wi=Ai.requestHost,Pi={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:wi||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Ii="ALIPW3SG",Ci="ANTOM_PAYMENT_WEB",Ri=Ti||"GROUP_20240627151021",Ni=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},Di=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:wi||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=Ti||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===ki?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},Oi=".".charCodeAt(0),Li=/\\(\\)?/g,Mi=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),xi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ui=/^\w*$/;function Bi(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function Ki(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Je()(e);return"number"===n||"boolean"===n||null===e||Ui.test(e)||!xi.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===Oi&&r.push(""),n.replace(Mi,(function(e,t,n,o){var i=e;return n?i=o.replace(Li,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function Hi(e,t,n){var r=null===e?void 0:function(e,t){for(var n=Ki(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[Bi(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var Yi=function(e,t){var n=Hi(e,"Result-Status")||Hi(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:oe.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:oe.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=Hi(e,"Tips")||Hi(e,"tips",""),o=Hi(e,"Memo")||Hi(e,"memo","");return{success:!1,traceId:t,errorCode:oe.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},Fi=bt()._sandbox;function ji(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Di(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Ni(null==e?void 0:e.hostSign,i)||Pi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Ci,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Ci.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Ri),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ii),"sdk-version",T||""),e.headers);return"true"!==Fi&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Si.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function Gi(e,t,n){return zi.apply(this,arguments)}function zi(){return zi=s()(i()().mark((function e(t,n,r){var o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{a.browserInfo.browserJavaEnabled=(null===(s=navigator)||void 0===s?void 0:s.javaEnabled())||!1}catch(e){}return"WAP"===a.terminalType&&(a.osType=mt?"IOS":"ANDROID"),l=[h()(h()({},t),{},{envInfo:a,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=ji(n),e.next=9,u({data:l});case 9:if(d=e.sent,p=d.data,f=d.headers,m=p||{},v=Hi(f,"Mgw-TraceId")||Hi(f,"mgw-traceid",""),m.traceId=v||"",null==(g=Yi(f,v))||!g.errorCode){e.next=21;break}throw y=(null==m?void 0:m.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:v}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:v}).send(),e.abrupt("return",m);case 25:return e.prev=25,e.t0=e.catch(5),E=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),S=null!==e.t0&&void 0!==e.t0&&null!==(b=e.t0.message)&&void 0!==b&&b.includes("timeout")?oe.TIMEOUT:"",A=(null==E?void 0:E.errorCode)||S,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:A,msg:JSON.stringify((null==E?void 0:E.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:A,errorMessage:null==E?void 0:E.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),zi.apply(this,arguments)}function Vi(e,t,n){return Wi.apply(this,arguments)}function Wi(){return Wi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Gi(t,h()(h()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),Wi.apply(this,arguments)}function qi(){return qi=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(A[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),qi.apply(this,arguments)}function Ji(e,t,n){return Qi.apply(this,arguments)}function Qi(){return Qi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Gi(t,h()(h()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function Zi(e,t,n,r){return Xi.apply(this,arguments)}function Xi(){return Xi=s()(i()().mark((function e(t,n,r,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",a),e.abrupt("return",Gi(n,h()(h()({},r),{},{hostSign:a,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),Xi.apply(this,arguments)}var $i=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ea=function(){function e(t,n){g()(this,e),c()(this,"_applePayService",void 0),c()(this,"_parseData",void 0),c()(this,"_sessionData",void 0),c()(this,"_isFinish",!1),c()(this,"_options",void 0),c()(this,"logger",void 0),c()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:X.prod},t,{product:G.CARD_APPLE_PAY}),this._applePayService=new Rn(n)}return m()(e,[{key:"canMakePayments",value:function(e){return Rn.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:ae.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var a=function(){var e=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ge(wn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=Zi,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,a();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=Ji,e.t1=r,e.t2=o._options.environment,e.next=7,a();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(l,c,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:ae.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),u);try{this._applePayService.startPay(this._parseData)}catch(e){u(ae.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),ta=ea,na=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"applePay",void 0),c()(Ze()(r),"logger",void 0),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(An).concat(Object.values(Sn))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=Rn.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new ta(h()(h()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&We.publish(new Ge(Tn.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Sn.optional_init:this.onOptionalInit(e,t);break;case An.canMakePayments:this.onCanMakePayments(e,t);break;case An.createComponent:this.onCreateComponent(e,t);break;case An.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Ve),ra=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function oa(e,t){for(var n,r=e||window.navigator.userAgent||"",o=ra,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(ia(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(ia(t,r,n.iosScheme),n.iosScheme):void 0;ia(t,r,"")}function ia(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var aa=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var sa=function(e){var t,n,r,o,i;switch(e){case G.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case G.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},la=m()((function e(){g()(this,e)}));c()(la,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var ca={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},ua={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},da=function(){function e(){g()(this,e)}return m()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{ha.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in la.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:ca.spmId},{eventAlias:ca.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:ua.spmId},{eventAlias:ua.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();c()(da,"abnormalEventNameSet",new Set),c()(da,"nonComplianceEventKeys",{});var pa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;g()(this,e),c()(this,"timeoutId",void 0),c()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return m()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),ha=new pa,fa={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},ma=h()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},fa),va=function(){function e(t,n){g()(this,e),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return m()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=h()({},e),l=null==e?void 0:e.title;return ma[l]&&(s.title=ma[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:h()(h()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ma[s]&&(a.title=ma[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ma[s]&&(a.title=ma[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();c()(va,"instance",void 0);var ga={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:"2.0.21"}},ya=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=tn(e,{sdkVersion:T,productScene:t,mid:n});if(r)null===(o=va.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&rn(T+t,i),i):i=nn(T+t)}catch(e){return""}},_a=function(e,t){var n,r=(n={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(n,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(n,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},ba=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=bt()||{},d=u.host,p=ya(a,o,s,l),h=p||n;p&&(null===(e=va.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));Ct()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var f=_a(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===j.ELEMENT_ADDRESS)return"".concat(k[t],"/element-address/pages/address/index.html");if($e()(Object.values(F)).includes(r)){var m=!1;try{m=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return m?"".concat(k[t],"/elements/pages/express_checkout/index.html"):"".concat(k[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(S[t],"/").concat(r,"/").concat(f,"/index.html")},Ea=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,f=e.hostSign,m=void 0===f?"":f,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=ba(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),b=tn(l,{sdkVersion:T,productScene:o,mid:g})?"true":"false",E=bt(),S=E._sandbox,A=E._light_sandbox,k=E.requestHost,w=void 0===k?"":k,P=E.groupId,I=void 0===P?"":P,C=E.LOCAL_MOCK,R=E._displayType,N=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:b,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:T,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(sa(o)),isPreload:h||"",hostSign:m||""});C&&(N.LOCAL_MOCK=C),w&&(N.requestHost=w),I&&(N.groupId=I),"light_sandbox"!==a&&"true"!==A||(N.sandbox="true"),"sandbox"!==a&&"true"!==S||(N.shadow="true"),R&&(N.displayType=R);var D=lt(N);return Ct()&&(console.log("appUpgrade#getIframeUrl#appMatched",b),console.log("appUpgrade#getIframeUrl#url",_,D)),{path:_,locationSearch:D}},Sa=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},Aa=2e4,ka="MERCHANT_CONFIRM_ABORT",Ta="MERCHANT_CONFIRM_TIMEOUT",wa=Symbol("BEFORE_CONFIRM_TIMEOUT");function Pa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=s()(i()().mark((function e(t){var n,r,o,a,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:Aa,o=new Promise((function(e,t){r=setTimeout((function(){return t(wa)}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return a=e.sent,e.abrupt("return",{result:a,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),e.t0!==wa){e.next=13;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 13:throw e.t0;case 14:return e.prev=14,clearTimeout(r),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,9,14,17]])}))),Ia.apply(this,arguments)}var Ca=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}(Ca||{}),Ra=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(Ra||{});function Na(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Vt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(it.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"&notRedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var Da=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},Oa=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?X.prod:i,s=t.shipping,l=t.merchantAmount,u=void 0===l?null:l,d=t.merchantCurrency,p=void 0===d?null:d;g()(this,e),c()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),c()(this,"session",null),c()(this,"paymentSessionData",void 0),c()(this,"parseData",void 0),c()(this,"paymentStatus",void 0),c()(this,"cancelReason",null),c()(this,"logger",void 0),c()(this,"env",void 0),c()(this,"shipping",void 0),c()(this,"merchantAmount",void 0),c()(this,"merchantCurrency",void 0),c()(this,"onBeforeConfirm",null),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=u,this.merchantCurrency=p}var t,n,r,o;return m()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=Ra.PENDING,e.cancelReason="USER_CANCEL",e.session.onvalidatemerchant=function(){var t=s()(i()().mark((function t(r){var o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=Zi,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(a=t.sent)&&a.success&&a.merchantSessionObject?(s=JSON.parse(a.merchantSessionObject),e.session.completeMerchantValidation(s)):(null===(l=e.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=s()(i()().mark((function r(o){var a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D;return i()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:Ca.APPLE_PAY_TOKEN_ERROR})},s=null==o?void 0:o.payment,l=s.token,c=s.billingContact,u=s.shippingContact,!l){r.next=46;break}if(p={instPaymentToken:JSON.stringify(l)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,f=h.requiredBillingContactFields,m=h.requiredShippingContactFields,!It(f)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!It(m)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=12,_=Date.now(),r.next=16,Pa((function(){return e.onBeforeConfirm()}));case 16:if(b=r.sent,E=b.result,S=b.timedOut,A=E,(k=S||Date.now()-_>=Aa)&&(null===(T=e.logger)||void 0===T||T.logError({title:"sdk_before_confirm_timeout"}),A=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:A}),A){r.next=29;break}return e.cancelReason=k?"MERCHANT_TIMEOUT":"MERCHANT_ABORT",null===(w=e.session)||void 0===w||null===(P=w.completePayment)||void 0===P||P.call(w,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:k?Ta:ka}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(12),null===(I=e.logger)||void 0===I||I.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(C=e.session)||void 0===C||null===(R=C.completePayment)||void 0===R||R.call(C,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:ka}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:N=r.sent,e.setPayStatus(N),t(N),r.next=48;break;case 46:null===(D=e.logger)||void 0===D||D.logError({title:"a3753.b103030.c386485.d507486"}),a();case 48:case"end":return r.stop()}}),r,null,[[12,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===Ra.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});var o="MERCHANT_TIMEOUT"===e.cancelReason?Ta:ka;n({errorCode:"MERCHANT_ABORT"===e.cancelReason||"MERCHANT_TIMEOUT"===e.cancelReason?o:Ca.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=Ji,e.t1=h()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=Ra.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==Ra.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=Ra.NORMAL,e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},a=o.recurringInfo,s=a?14:2,this.isCanMakePayments(s)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(s,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(l=this.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=Ra.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(It(n)||It(o)||It(null==r?void 0:r.supportedNetworks)||It(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return vt?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ge(wn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),La="#".concat(be,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(be,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Ce,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Ce,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Ce,"-desktop{}\n"),Ma=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=La,document.head.appendChild(e)},xa=function(e,t,n){var r=document.createElement("div");r.id=Te,n.componentSign===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Ce,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Ce,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop?r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===te.mobile&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);St(0,o)},Ua=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),Ba=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Ua,document.head.appendChild(n),At();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,St(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),Ka(e,t),r}},Ka=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(Ee,"-btn-").concat(e,"' src=\"").concat(Le,'"/>'),i=document.createElement("div");i.classList.add("".concat(Ee,"-").concat(e),"".concat(Ee,"-hidden")),i.id=Ee,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Ha=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Se,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),o.id=Se,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Ya="\n .".concat(Re,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Re,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Re,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Re,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"-drawer-enter {\n animation: slideIn ").concat(Oe,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Re,"-drawer-exit {\n animation: slideOut ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Fa=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(we),n.id=we,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(Et(),"px"),e.appendChild(n)},ja=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()},Ga="desktop",za=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{Ga=t;var i=document.createElement("div");i.classList.add("".concat(Re,"overlay"),"".concat(Re,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(Re,"modal"),"".concat(Re,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(Re,"modal-mobile"),"".concat(Re,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);Fa(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var Va,Wa,qa,Ja=function(){function e(t){g()(this,e),c()(this,"app",void 0),c()(this,"AMSSDK",void 0),c()(this,"platform",void 0),c()(this,"_performanceData",[]),c()(this,"_loadAppPromiseResolve",null),c()(this,"_isInitComponent",void 0),c()(this,"_globalData",void 0),c()(this,"popupApp",void 0),c()(this,"appDomain",void 0),c()(this,"createIframeNode",void 0),c()(this,"createPreloadIframeNode",void 0),c()(this,"_selector",void 0),c()(this,"_appVersion",void 0),c()(this,"_isRetention",void 0),c()(this,"_allowSubmitPayCallAhead",void 0),c()(this,"_actionQueryPromise",null),c()(this,"_actionSubmitPromise",null),c()(this,"_renderParams",null),c()(this,"_componentSign",j.NONE),c()(this,"_appLocationSearch",void 0),c()(this,"_renderDisplayType",Y.popup),c()(this,"_multipleCallbackEvents",void 0),c()(this,"_isAppWebview",void 0),c()(this,"_isNativeAppWebview",void 0),c()(this,"_merchantAppointParam",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(_e),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=gt?te.mobile:te.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,a;return m()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===te.desktop?"PC":"WAP",sdkVersion:T,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;j.CASHIER_PAYMENT_APM!==this._componentSign&&(j.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(s()(i()().mark((function o(){var a,s,l,c,u;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a||null===(a=a.paymentSessionConfig)||void 0===a?void 0:a.productScene,l=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||s});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,l);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,f=this;if(this._isInitComponent)return this.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(fe.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var m=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(m):"",g="".concat(ye).concat(v),y=(null==this?void 0:this._renderDisplayType)===Y.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},b=_.productSceneVersion,E=void 0===b?"":b,S=_.productScene,A=void 0===S?"":S,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,w=T.autoDebitWithToken,P=void 0!==w&&w,I=T.requireFastSdk,C=void 0!==I&&I,R=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,N=void 0===R?{}:R;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),j.EASY_PAY_WALLET!==this._componentSign||A!==G.EASY_PAY||"1.0"!==E||P||!C){if(j.AUTO_DEBIT_WALLET===this._componentSign){var D,O,L,M=(null===(D=this._renderParams)||void 0===D||null===(D=D.paymentSessionMetaData)||void 0===D?void 0:D.action)||{},x=_t()?null==M||null===(O=M.web)||void 0===O?void 0:O.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType,U=(null==M?void 0:M.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(N)}if(j.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===C&&"1.0"===E?void this.handleAuthUrlInfo(N):Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_START_OF_LOADING}),this._renderDisplayType===Y.inline){var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ie)||Ma(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,ye,g);B&&this.renderInlineLoading(t,B),(K=document.createElement("style")).innerHTML=Ya,document.head.appendChild(K)}var K;if(this._renderDisplayType===Y.popup){var H,F;Ba(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Ae,o.classList.add("".concat(Ae,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Ae,'-title" class="').concat(Ae,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Ae,'-sub-title"\n class="').concat(Ae,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Ae,"-btn-block-").concat(e,'">\n <div id="').concat(Ae,'-remain" class="').concat(Ae,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Ae,'-leave" class="').concat(Ae,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Ae,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var z=Na(null===(H=this._renderParams)||void 0===H?void 0:H.paymentSessionMetaData,!0===(null===(F=this._renderParams)||void 0===F?void 0:F.notRedirectAfterComplete)),V=function(){};null!=z&&z.allowClickOutsideClose&&(V=this.closeBtnFunc.bind(this));var W=this.closeBtnFunc.bind(this);Ha({platform:this.platform,onClickOutside:V,closeBtnFunc:W}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return f.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),f._isInitComponent=!1,f.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(N)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===j.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&xa(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(ke);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(Et(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:De)})).catch((function(e){return t.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(ve.eventCallback.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=s()(i()().mark((function t(n,r){var o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D,O,L,M,x;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},f={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a?void 0:a.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(s=e._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},m=(null===(l=e._renderParams)||void 0===l?void 0:l.paymentSessionMetaData)||{},v=m.extendInfo,g=void 0===v?"":v,y=m.action,_=!1,b=!1,E=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},S=E.skipSdkQuery,A=E.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,b=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!aa()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(j.ELEMENT_PAYMENT===e._componentSign&&(f.paymentSessionConfig={productScene:null==(i=f.paymentSessionConfig)?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion}),j.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(j.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(j.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!A){t.next=23;break}if(!Dt(A,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!S){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=Na(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(j.CASHIER_PAYMENT_CARD!==e._componentSign&&j.VAULTING_CARD!==e._componentSign){t.next=35;break}return f.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(j.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(P=f.paymentSessionConfig||{},I=P.productSceneVersion,C=void 0===I?"":I,R=P.productScene,N=void 0===R?"":R,null===(w=e._renderParams)||void 0===w||null===(w=w.paymentSessionMetaData)||void 0===w||null===(w=w.action)||void 0===w||!w.skipSdkQuery||!b){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(N!==G.EASY_PAY||"2.0"!==C){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(j.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(M=(null===(D=e._renderParams)||void 0===D||null===(D=D.paymentSessionMetaData)||void 0===D?void 0:D.action)||{},"SMS"!==(x=_t()?null==M||null===(O=M.web)||void 0===O?void 0:O.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),Vi(f,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),j.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:fe.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(ve.error.name,i),e.dispatchToSDK(ve.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(j.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(ve.eventCallback.name,fe.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[j.CASHIER_PAYMENT_CARD,j.VAULTING_CARD,j.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(ve.error.name,{code:fe.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var i}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var a={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},l=Na(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=s()(i()().mark((function e(t){var n,r,s,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==G.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=l?!l.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||j.EASY_PAY_WALLET!==o._componentSign,j.EASY_PAY_WALLET===o._componentSign&&(h=a.paymentSessionConfig||{},f=h.productSceneVersion,m=void 0===f?"":f,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,E=(b=void 0===_?{}:_).enableSignAgreement,S=void 0!==E&&E,A=b.autoDebitWithToken,k=void 0!==A&&A,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},w=T.paymentMethodInfoView,P=(void 0===w?{}:w).paymentMethodType,I=void 0===P?"":P,g!==G.EASY_PAY||"2.0"!==m||k||(C=o._isAppWebview||!1,R=o._isNativeAppWebview||!1,a.signAgreement=S,"ALIPAY_CN"!==I||C&&R||(N=oa(void 0,o.AMSSDK.logger))&&"https"!==N&&(a.h5FromApp=encodeURIComponent(N)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),D=(null==l||null===(n=l.buildSubmitPayExtParams)||void 0===n?void 0:n.call(l,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},a.extParams=D,e.t0=Ji,e.t1=a,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===at(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(ye);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(ye,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(ke);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=Sa(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=Ea({renderDisplayType:Y.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(ba(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=Ea({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),f=h.path,m=h.locationSearch;this._appLocationSearch=m,-1!==f.indexOf("?")?this.app.src="".concat(f,"&").concat(m):this.app.src="".concat(f,"?").concat(m),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(ve.error.name,Object.assign({},fe.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(ve.error.name,fe.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ct(e.data)){var n=JSON.parse(e.data);if(n.name!==ne.APP_TO_SDK&&n.name!==ne.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(fe.NOT_JSON_FORMAT),this.dispatchToSDK(ve.error.name,fe.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(ye).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,za({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,a=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),De),s=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,ja(),clearTimeout(a),clearTimeout(s)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return a.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===ve.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===R.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===R.CONTAINER_ELEMENT&&this.dispatchToSDK(ve.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(ve).map((function(e){return ve[e].name})).includes(e.context.event))if(e.context.event!==ve.getDeviceId.name)if(e.context.event!==ve.getUserAgentFromSdk.name){if(e.context.event===ve.popWindow.name)return o=document.querySelector(".".concat(Re,"overlay")),i="desktop"===Ga?document.querySelector(".".concat(Re,"modal")):document.querySelector(".".concat(Re,"modal-mobile")),o.classList.remove("".concat(Re,"fadeIn")),o.classList.add("".concat(Re,"fadeOut")),"desktop"===Ga?(i.classList.remove("".concat(Re,"fadeIn")),i.classList.add("".concat(Re,"fadeOut"))):(i.classList.remove("".concat(Re,"-drawer-enter")),i.classList.add("".concat(Re,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),Oe);var o,i,a,s;if(e.context.event!==ve.getGlobalData.name)if(e.context.event!==ve.setGlobalData.name)if(e.context.event!==ve.popupWindow.name){if(e.context.event===ve.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===ve.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(ve.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===ve.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===ve.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===ve.close.name)return this.closeBtnFunc();if(e.context.event===ve.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==ve.submitForm.name)if(e.context.event!==ve.hideCloseButton.name)if(e.context.event!==ve.showCloseButton.name)if(e.context.event!==ve.setMaskCloseButton.name){if(e.context.event===ve.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==ve.declareCheckoutInfo.name)if(e.context.event!==ve.declareEventCallbackInfo.name)if(e.context.event!==ve.appHeartBeat.name)if(e.context.event!==ve.beforeSubmit.name){var c,u,d;if(e.context.event===ve.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==ve.getGooglePayToken.name)if(e.context.event===ve.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===ve.closePaymentPolling.name&&this.dispatchToApp({context:{event:ve.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==ve.getApplePayToken.name)if(e.context.event!==ve.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(ve.validateFieldsResult.forwardName,e.context);else new Oa({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else Da(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:h()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(ve.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(ve.beforeSubmit.name,e.context.data);var f=Fe();this.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:f,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var m;this.createDialog(null===(m=e.context)||void 0===m?void 0:m.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===ve.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Se));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(ye,"-").concat(c):ye,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===Y.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(ye,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(ye,"-").concat(this.platform,"-animation"));var p="".concat(ye,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var f=(v=ye,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),m=document.createElement("style");m.id=p,m.type="text/css",m.innerHTML=f,document.getElementsByTagName("head")[0].appendChild(m),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===Y.inline)null===(y=document.getElementById(Te))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===re.BLANK)return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(se.NormalUrl,"");if(!(c.target!==re.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(se.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var f=new Date,m="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:m}).then((function(){var e=((new Date).getTime()-f.getTime())/1e3;d(se.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-f.getTime())/1e3;p(se.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(se.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(se.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(se.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(se.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(se.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(se.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(Ae,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(Ae,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,f,m,v,g,y=document.getElementById("".concat(Ae,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.corner,"px"),"stroke"===(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,b,E,S,A,k,T,w=document.getElementById("".concat(Ae,"-leave"));w&&(w.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,w.style.fontSize="".concat(null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontSize,"px"),w.style.color=null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontColor,w.style.borderRadius="".concat(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.corner,"px"),"stroke"===(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.type)?w.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):w.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(ve.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(Ee);e?null==t||t.classList.remove("".concat(Ee,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Ee,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Se);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Se,"-hidden")):null==t||t.classList.add("".concat(Se,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:ne.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:me,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(fe.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(me,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===G.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return b=e.sent,e.next=9,this._actionSubmitPromise;case 9:E=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:b,submitResult:E,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(a=this._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(s=this._renderParams)||void 0===s?void 0:s.configParams,prefillValue:null===(l=this._renderParams)||void 0===l?void 0:l.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(f=this._renderParams)||void 0===f?void 0:f.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(m=this._renderParams)||void 0===m||null===(m=m.paymentSessionMetaData)||void 0===m?void 0:m.clientId,instanceId:null===(v=this.AMSSDK)||void 0===v?void 0:v._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Se))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(ke);null==o||o.classList.add("".concat(ke,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(ye).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(ve.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(ve.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===te.mobile?"touchend":"click",i=document.getElementById("".concat(Ae,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(Ae))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Ae,"-hidden")),e.classList.add("".concat(Ae,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(Ae),t=document.getElementById(ye),e&&(e.classList.remove("".concat(Ae,"-show")),e.classList.add("".concat(Ae,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Ae,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Oe))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),Qa=[{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:z.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:An.canMakePayments,optional_init:Sn.optional_init,createComponent:An.createComponent,destroyComponent:An.destroyComponent}},{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:z.APM,paymentMethodTypes:[le.PAYPAL_CHECKOUT,le.PAYPAL_PAYLATER,le.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:kn.mountComponent,destroyComponent:kn.destroyComponent}}],Za=function(e){return"boolean"!=typeof e||e},Xa=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"logger",void 0),c()(Ze()(r),"onEventCallback",(function(e){We.publish(new Ge(Tn.onEventCallback,JSON.stringify(e)))})),c()(Ze()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),c()(Ze()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),c()(Ze()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&le.PAYPAL_VAULT===i&&r.onEventCallback({code:ae.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),c()(Ze()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;Za(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),c()(Ze()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,f=u.enableMessages,m=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),f?y.append("components","messages,buttons"):y.append("components","buttons"),V.intent===m&&le.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),le.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),c()(Ze()(r),"onShippingChange",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"createOrder",function(){var e=s()(i()().mark((function e(t,n,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vi({paymentSessionData:o,paymentSessionConfig:s},{env:a,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(l=c.extendInfo)&&void 0!==l&&l.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),c()(Ze()(r),"onApprove",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"onCancel",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"destroyComponent",function(){var e=s()(i()().mark((function e(t,n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(kn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:h()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;Za(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case kn.mountComponent:this.renderPaypalButton(e,t);break;case kn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Ve),$a=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===at(t)&&(i=document.querySelector(t)),null===i){var a={code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:ne.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:ve.error.name,data:a}})}n===Y.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},es=function(e){var t=document.body||null;t&&t.appendChild(e)},ts=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Tn)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===Tn.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(Ve),ns=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(wn)}},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===wn.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Ve),rs=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"logger",void 0),t.logger=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Pn)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Pn.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Ve),os=window.navigator.userAgent||"",is=function(){var e=os.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},as=/android/i.test(os),ss=/iphone|ipad|ipod/i.test(os),ls=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(os)&&as&&os.indexOf("Version")<0,cs=/qqbrowser/i.test(os),us=/firefox/i.test(os);/baidubrowser/i.test(os);function ds(e){window.location.href=e}function ps(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function hs(){Va||((Va=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),Va.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(Va))}function fs(e){Va.src=e}function ms(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function vs(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var gs,ys,_s,bs=5e3;function Es(e,t){gs=+new Date,ys=setTimeout((function(){!(!!Wa&&document[Wa])&&e&&e()}),t||5e3)}function Ss(e){void 0!==qa?document.addEventListener(qa,(function(){return As(e)})):window.addEventListener("pagehide",(function(){return As(e)}))}function As(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||bs;o-(gs||+new Date)<i&&n(t)}}(e),ys&&clearTimeout(ys))}function ks(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function Ts(e){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ts(e)}function ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(n),!0).forEach((function(t){Is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Is(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rs(r.key),r)}}function Rs(e){var t=function(e,t){if("object"!==Ts(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ts(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(Wa="hidden",qa="visibilitychange"):void 0!==e.mozHidden?(Wa="mozHidden",qa="mozvisibilitychange"):void 0!==e.msHidden?(Wa="msHidden",qa="msvisibilitychange"):void 0!==e.webkitHidden&&(Wa="webkitHidden",qa="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(_s||(_s={}));var Ns=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=ms(r,i),n.options.scheme=ms(t,i),ss&&is()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=ms(r,i),n.evokeLink()):t?(n.options.scheme=ms(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=Ps(Ps({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:_s.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&ks(n))throw new Error("请填写正确格式的scheme");if(o&&!ks(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&ks(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=_s.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=_s.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;ss?is()>9||cs?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!ks(l)&&(this.evokeAppBy.type=_s.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(vs(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Ds=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"originOptions",void 0),c()(this,"logger",void 0),c()(this,"_eventCenter",void 0),c()(this,"_instanceId",void 0),c()(this,"_storageId",void 0),c()(this,"_appendParams",void 0),c()(this,"_componentApp",void 0),c()(this,"securitySdkMap",void 0),c()(this,"plugins",void 0),this._instanceId=Fe(),this.originOptions=t,this.options={},this._eventCenter=new st,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=kt(n);r||(kt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new va(ga,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),va.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return m()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=yt(kt(n),{});if([X.prod,X.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return qi.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){kt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||G.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Rt(T,i)>=0&&Rt(a,T)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&We.isSubscribed(n)&&We.publish(new Ge(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=d()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?G.EASY_PAY:n,o=e.scene,i=void 0===o?G.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||vn(a),l=bn.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:pn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||vn(e.product),n=bn.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=En.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||vn(t.product),e.next=4,bn.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||vn(e.product),a=o.h5gateway||mn(e.region),s=bn.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=gn(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);un.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new yn({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){bn.setReady(i,d),t&&t(),e(d)}),(function(e){bn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));bn.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){bn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=bt()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(fe.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===ee.WAP&&(this.options.env.osType=mt?$.IOS:vt?$.ANDROID:$.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(fe.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=Q.component),this.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=Z.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==at(e.onError))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.error.name,e.onError,ve.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==at(e.onPaymentMethodSelected))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.paymentMethodSelected.name,e.onPaymentMethodSelected,ve.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==at(e.onSizeChanged))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.sizeChanged.name,e.onSizeChanged,ve.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==at(e.onLog))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.log.name,e.onLog,ve.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==at(e.onEventCallback))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.eventCallback.name,e.onEventCallback,ve.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==at(e.onClose))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.close.name,e.onClose,ve.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.beforeSubmit.name,function(){var n=s()(i()().mark((function n(r){var o,a;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=Fe(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:a=n.sent,t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:a}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),ve.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==at(e.onChange))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.onChange.name,e.onChange,ve.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===at(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===ee.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new Ns(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===G.ELEMENT_ADDRESS&&(n=this._getPlugin(G.ELEMENT_ADDRESS)),n}}]),e}();function Os(e,t){return Ls.apply(this,arguments)}function Ls(){return Ls=s()(i()().mark((function e(t,n){var r,o,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,a=void 0===o?[]:o,l=r.paymentRequestId,Array.isArray(a)){e.next=3;break}return e.abrupt("return");case 3:if(0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(a),requestId:l}),a.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,a=null;t===r.AIRWALLEX?a=Pt({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":l},timeOut:3},n):a=Pt({src:i,timeOut:3},n);o.push(a)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),Ls.apply(this,arguments)}var Ms=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):j.NONE},xs=function(e){try{return[JSON.parse(wt(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},Us=function(e){var t=xs(e),n=tt()(t,2),r=n[0],o=n[1];return function(e){var t;_t()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===G.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},Bs=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:Y.popup},e),r=Us(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=tt()(r,2),i=o[0],a=o[1],s=Ms(i);if($e()(Object.values(F)).includes(s)&&n.renderDisplayType===Y.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===G.ELEMENT_ADDRESS&&(s=j.ELEMENT_ADDRESS),s===j.NONE)return Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;kt(dn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},Ks=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;g()(this,r),t=n.call(this,e),c()(Ze()(t),"channelType",void 0),c()(Ze()(t),"productSceneVersion",void 0),c()(Ze()(t),"timer",void 0),c()(Ze()(t),"_validateResolveMap",new Map);var o=new Ja({appVersion:e.appVersion});return o.setRender($a),o.setPreloadRender(es),t._registerPlugin(me,o),t._componentApp=t._getPlugin(me),t.registerBusAbility(),t}return m()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=Q.component,this.options.networkMode=this.options.networkMode||Z.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===G.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===Z.proxy?(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(fe.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,Os(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===j.VAULTING_CARD?j.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;We.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==X.prod,this.logger),We.clear(),We.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(n)}))}}),We.subscribe(new ts((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(ve.eventCallback.name,e)}))),We.subscribe(new ns((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),We.subscribe(new rs(this.logger)),We.subscribe(new na(this.logger)),We.subscribe(new Xa(this.logger)),Qa.forEach((function(e){var n;null!=e&&e.busSubscriber&&We.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&We.publish(new Ge(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&We.isSubscribed(i)?We.publishForResult(new Ge(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.popup}).then((function(e){return Bs(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(ve.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&We.isSubscribed(n))return We.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(En.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.inline,selector:t}).then((function(e){return Bs(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(ve.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&We.isSubscribed(n))return We.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==G.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=Fe();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&We.isSubscribed(a)?We.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=Fe();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:ge.name,data:{},eventCallbackId:n});var r=function(){var t=s()(i()().mark((function t(n){var r,o,a;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),a={isValid:!1},i=null==n?void 0:n.data,"object"===Je()(i)&&null!==i&&"boolean"==typeof i.isValid&&(a=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:a.isValid?"true":"false"}),o&&(o(a),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(ve.validateFieldsResult.forwardName,r,ve.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}(Ds),Hs=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=Fe();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&We.isSubscribed(a)?We.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(Ks);function Ys(e,t){return function(e){return"https://checkout.antom.com/".concat(e?"elements2":"elements","/pages")}(t)+(e.startsWith("/")?e:"/".concat(e))}var Fs="PROD";function js(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=d()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var Gs={i18nPrefix:"OPENSDK"},zs=function(e){y(n,e);var t=b(n);function n(e,r,o,i){var a,s,c,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];v(this,n);var d,p=i,h=void 0;return e&&"object"===qe(e)?(d=e.message,h=e.params):d=e,c=t.call(this,!Gs.i18n||u&&"SERVER_API"===o?d:Gs.i18n.get({id:"".concat(Gs.i18nPrefix,".").concat(r),dm:(null===(a=(s=Gs).getDefaultMessage)||void 0===a?void 0:a.call(s))||d},h)),l(Qe(c),"code",void 0),l(Qe(c),"name","OpenSDKError"),l(Qe(c),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),l(Qe(c),"source","SDK_INTERNAL"),l(Qe(c),"traceId",void 0),l(Qe(c),"reason",void 0),c.reason=d,c.code=r,c.source=o,c.traceId=p,c}return f(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new Vs(e instanceof Error?e.message:(null===(t=(r=Gs).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){Gs=p(p({},Gs),e)}}]),n}(P(Error)),Vs=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKBridgeError"),e}return f(n)}(zs),Ws=function(e){return Xe(new Set(e))},qs=function(e,t){return e.filter((function(e){return!t.includes(e)}))},Js=function(e,t){return e.filter((function(e){return t.includes(e)}))},Qs=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},Zs=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function Xs(e,t){if(0===t.length)return e;for(var n,r=Xe(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var $s=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(il("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},el=/^\+?\d+$/,tl=function(e){if(!el.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(il("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},nl=function(e){return new RegExp(e.map((function(e){return ol(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},rl=function(e){return new RegExp("^[".concat(e.map((function(e){return ol(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},ol=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},il=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},al=3.5,sl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(v(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(qe(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(qe(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(qe(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=Ws(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=qs(l,s);var c,u,d,p=Js(s,l);(this.seps=Xs(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>al)&&((c=Math.ceil(this.alphabet.length/al))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,Xe(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=Xs(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=nl(this.guards),this.sepsRegExp=nl(this.seps),this.allowedCharsRegExp=rl([].concat(Xe(this.alphabet),Xe(this.guards),Xe(this.seps)))}return f(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat(Xe(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(Qs)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:tl(String(e))}))),i.every(Zs)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(qe(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(qe(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=Xe(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=Xs(n,c));if((l=o).push.apply(l,Xe(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=Xs(n,n),(d=o).unshift.apply(d,Xe(n.slice(u))),(p=o).push.apply(p,Xe(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var f=h/2;o=o.slice(f,f+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=u(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=Xs(a,[o].concat(Xe(this.salt),Xe(a)).slice(0,a.length));s.push($s(Array.from(c),d)),a=d}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),ll=new sl("intl-open-sdk",6);function cl(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var ul=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+ll.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))};function dl(e){if("onpagehide"in self){var t=function(t){t.persisted||e("pagehide")};return self.addEventListener("pagehide",t),function(){return self.removeEventListener("pagehide",t)}}if("undefined"!=typeof document&&void 0!==document.visibilityState){var n=!1,r=function(){"hidden"!==document.visibilityState||n||(n=!0,e("visibilitychange"))};return document.addEventListener("visibilitychange",r),function(){return document.removeEventListener("visibilitychange",r)}}var o=self,i=function(){e("beforeunload")};return o.addEventListener("beforeunload",i),function(){return o.removeEventListener("beforeunload",i)}}var pl=function(){function e(t,n){var r=this;v(this,e),l(this,"targetPort",void 0),l(this,"handlers",new Map),l(this,"debugCallback",void 0),l(this,"name",void 0),l(this,"initialized",!1),l(this,"recipientIsReady",!1),l(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(p(p({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t,this.once("ready",(function(){r.recipientIsReady=!0}))}return f(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onData",value:function(e){return this.initialized||(this.send("ready"),this.initialized=!0),this.on("data",e)}},{key:"sendData",value:function(e){var t=this;this.recipientIsReady?this.send("data",e):this.once("ready",(function(){t.recipientIsReady=!0,t.send("data",e)}))}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var i=a(o().mark((function i(a){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(a.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),i,null,[[1,7]])})));return function(e){return i.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o){try{t(o)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.handlers.get(e);n&&n.delete(t)}},{key:"send",value:function(e,t){var n={id:ul("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(p(p({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),hl=function(){function e(t){v(this,e),l(this,"targetPorts",[]),l(this,"name",void 0),this.name=t}var t;return f(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,Xe(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=cl((function(){return Promise.all(i.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(i.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=et(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(l({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return p(p({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),fl=function(){function e(t,n){v(this,e),l(this,"targetPort",void 0),l(this,"name",void 0),this.targetPort=n,this.name=t}return f(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:i=r.type.split(":"),a=et(i,2),a[0],"START_COLLECT_VALUE"===a[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),ml="OPENSDK@HANDSHAKE",vl="OPENSDK@READY_HANDSHAKE",gl="OPENSDK@UPDATE_CONFIG",yl="OPENSDK@UPDATE_CONFIG_REPLY",_l="OPENSDK@SUBMIT",bl="OPENSDK@SUBMIT_REPLY",El="OPENSDK@REDIRECT",Sl="OPENSDK@OPEN_MODAL",Al="OPENSDK@OPEN_MODAL_ERROR",kl="OPENSDK@CLOSE_MODAL",Tl="OPENSDK@ERROR",wl="OPENSDK@HANDSHAKE_ACK",Pl="OPENSDK@TRANSFER_RECEIVE_PORT",Il="OPENSDK@MESSAGE",Cl="OPENSDK@TRANSFER_SEND_PORT",Rl="OPENSDK@TRANSFER_APP_PORT",Nl="OPENSDK@TRANSFER_MODAL_PORT",Dl="OPENSDK@TRANSFER_MODAL_APPEARANCE",Ol="OPENSDK@TRANSFER_MODAL_INITIALDATA",Ll="OPENSDK@HEIGHT_UPDATE",Ml="OPENSDK@DESTROY_ELEMENT",xl=n(8098),Ul=[Pl,Cl,Nl,Dl,Ol,Al,Rl,kl,Sl,El,Il,Ml],Bl="@@global",Kl="@@native",Hl=function(){function e(t,n,r){var o,i,a=this;(v(this,e),l(this,"targetWindow",void 0),l(this,"currentWindow",void 0),l(this,"targetOrigin","*"),l(this,"scope",void 0),l(this,"handlers",new Map),l(this,"mode",void 0),l(this,"resizeObserver",void 0),l(this,"debugCallback",void 0),l(this,"receivePort",void 0),l(this,"openModalOff",void 0),l(this,"openModalPromise",void 0),l(this,"handleMessage",(function(e){var t=e.data;if(t&&t.type){var n=t.type.split(":"),r=et(n,2),o=r[0],i=r[1];if(a.scope!==Kl){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==Kl&&(s||t.type.endsWith(Tl)||t.type.endsWith(Il))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){n.length>=3?n(t.payload,e.ports,{origin:e.origin,source:e.source}):n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return f(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Pl,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Pl,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort(Cl,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:ul("bridge"),type:"SYSTEM_".concat(Tl),payload:{message:"Target window not set"}},"OUT"));var o={id:ul("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Tl,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(bl,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send(Il,{type:e,message:t})}},{key:"sendRedirect",value:function(e){if("WEBAPP"===this.mode){if(!e.url)throw new Vs("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e.url)}catch(e){throw new Vs("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(El,e)}}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new Vs("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new Vs("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(El,{url:e,mode:t})}}},{key:"sendDestroyElement",value:function(e){e||(e=this.scope),"WEBAPP"===this.mode&&this.send(Ml,{elementKey:e})}},{key:"openModal",value:function(e,t){var n,r=this;if(this.openModalPromise)return this.openModalPromise;var o=ul("modal_");this.send(Sl,p(p({},e),{},{scope:this.scope,initialData:t,modalId:o})),null===(n=this.openModalOff)||void 0===n||n.call(this);var i=new Promise((function(e,t){var n=function(){},o=function(){},i=function(){n(),o(),r.openModalOff=void 0,r.openModalPromise=void 0};n=r.once(Al,(function(e){i(),t(new zs(e.message,e.code,e.source))}));o=r.on(Rl,(function(n,r){if(null==r||!r[0])return i(),void t(new Vs("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL"));i(),e(new pl(n,r[0]))})),r.openModalOff=i}));return this.openModalPromise=i,i}},{key:"closeModal",value:function(){var e;null===(e=this.openModalOff)||void 0===e||e.call(this),this.send(kl)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o,i,a){try{t(o,i,a)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new Vs("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(ml,function(){var r=a(o().mark((function r(i){var a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==i?void 0:i.elementMode)?i.isMainElement?n.getReceivePort().then((function(e){t(i,e)})):n.getSendPort().then((function(e){t(i,e)})).catch((function(){t(i)})):t(i),a=0,s=xl((function(e){(Math.abs(e-a)>10||Math.abs((e-a)/a)>.01)&&(a=e,n.send(Ll,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&s(n.height)})),n.resizeObserver.observe(document.body),n.send(wl,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(vl),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Tl),this.scope===Kl)return e;var t=Ul.includes(e)?Bl:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Tl),this.scope===Kl)return e;var t=Ul.includes(e)?Bl:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:ul(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Pl,(function(n,r){e.receivePort||(e.receivePort=new hl(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on(Cl,(function(e,r){if(r){var o=new fl(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,Bl)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",Kl,t)}},{key:"getBridge",value:function(t,n){if(n===Kl||n===Bl)throw new Error("Scope cannot be ".concat(Kl," or ").concat(Bl));return new e(t,n)}}]),e}(),Yl=n(4005),Fl=n.n(Yl),jl=n(8306),Gl=["trackId","userPathAuto","keyFormat"],zl=function(){function e(t){v(this,e),l(this,"options",void 0),l(this,"intlTrackerOptions",void 0),l(this,"tracker",void 0),l(this,"trackerInitPromise",void 0),l(this,"trackId",void 0),this.initialOptions(t)}var t;return f(e,[{key:"initialOptions",value:function(e){var t,n,r,o,i=e||{},a=(i.trackId,i.userPathAuto),s=i.keyFormat,l=Yl(i,Gl);(this.options=p(p(p({env:"PROD",compactExtraInfo:!0},this.options),l),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),this.intlTrackerOptions=p(p({},this.options),{},{userPathAuto:a,keyFormat:s}),e&&"trackId"in e)&&(this.trackId=e.trackId||"",this.options=p(p(p({},this.options),l),{},{mdata:p(p(p({},null===(o=this.options)||void 0===o?void 0:o.mdata),l.mdata),{},{trackId:this.trackId})}));return this.options}},{key:"loadTacker",value:function(e){var t=this,n=(0,jl.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull");return n?n.then((function(n){var r=n.variable;if(r)return new r(t.initialOptions(e))})):Promise.resolve(void 0)}},{key:"initTracker",value:(t=a(o().mark((function e(t){var n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:if(t||!this.trackerInitPromise){e.next=4;break}return e.abrupt("return",this.trackerInitPromise);case 4:if(n=this.loadTacker(t).then((function(e){var n,o,i,a,s,l;return e&&(e.set({keyFormat:null!==(n=null!==(o=null==t?void 0:t.keyFormat)&&void 0!==o?o:null===(i=r.intlTrackerOptions)||void 0===i?void 0:i.keyFormat)&&void 0!==n?n:"origin",userPathAuto:null!==(a=null!==(s=null==t?void 0:t.userPathAuto)&&void 0!==s?s:null===(l=r.intlTrackerOptions)||void 0===l?void 0:l.userPathAuto)&&void 0!==a&&a}),r.tracker=e),e})),t){e.next=8;break}return this.trackerInitPromise=n.finally((function(){r.trackerInitPromise=void 0})),e.abrupt("return",this.trackerInitPromise);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({mdata:{trackId:e}})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),e}(),Vl=new zl;var Wl;!function(e){e["ar-SA"]="ar-SA",e.kn="kn",e.as="as",e.bho="bho",e["pl-PL"]="pl-PL",e["ko-KR"]="ko-KR",e["da-DK"]="da-DK",e["de-DE"]="de-DE",e["ru-RU"]="ru-RU",e["fr-FR"]="fr-FR",e.gu="gu",e["nl-BE"]="nl-BE",e["nl-NL"]="nl-NL",e["cs-CZ"]="cs-CZ",e.ro="ro",e["lo-LA"]="lo-LA",e["my-MM"]="my-MM",e["bn-BD"]="bn-BD",e["bn-IN"]="bn-IN",e.mr="mr",e["ms-MY"]="ms-MY",e.ml="ml",e.mni="mni",e["ne-NP"]="ne-NP",e.or="or",e["pt-BR"]="pt-BR",e["pt-PT"]="pt-PT",e.pa="pa",e["sv-SE"]="sv-SE",e["ja-JP"]="ja-JP",e.sr="sr",e["si-LK"]="si-LK",e["sk-SK"]="sk-SK",e["tr-TR"]="tr-TR",e["tl-PH"]="tl-PH",e.te="te",e.ta="ta",e["th-TH"]="th-TH",e["ur-PK"]="ur-PK",e["ur-IN"]="ur-IN",e["uk-UA"]="uk-UA",e["iw-IL"]="iw-IL",e["es-ES"]="es-ES",e["es-MX"]="es-MX",e.hu="hu",e["it-IT"]="it-IT",e["in-ID"]="in-ID",e["hi-IN"]="hi-IN",e["vi-VN"]="vi-VN",e["en-PK"]="en-PK",e["en-PL"]="en-PL",e["en-FR"]="en-FR",e["en-PH"]="en-PH",e["en-CZ"]="en-CZ",e["en-CA"]="en-CA",e["en-MM"]="en-MM",e["en-US"]="en-US",e["en-BD"]="en-BD",e["en-MY"]="en-MY",e["en-NP"]="en-NP",e["en-LK"]="en-LK",e["en-TH"]="en-TH",e["en-ES"]="en-ES",e["en-SG"]="en-SG",e["en-HU"]="en-HU",e["en-ID"]="en-ID",e["en-GB"]="en-GB",e["en-VN"]="en-VN",e["en-HK"]="en-HK",e["en-KR"]="en-KR",e["zh-TW"]="zh-TW",e["zh-HK"]="zh-HK",e["zh-SG"]="zh-SG",e["zh-CN"]="zh-CN",e["ar-IQ"]="ar-IQ",e["ckb-IQ"]="ckb-IQ",e.ku="ku",e["kk-KZ"]="kk-KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(Wl||(Wl={}));var ql={};ql[Wl["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",ql[Wl.kn]="埃纳德语",ql[Wl.as]="阿萨姆语",ql[Wl.bho]="博杰普尔语",ql[Wl["pl-PL"]]="波兰语 (波兰)",ql[Wl["ko-KR"]]="朝鲜语 (韩国)",ql[Wl["da-DK"]]="丹麦语 (丹麦)",ql[Wl["de-DE"]]="德语 (德国)",ql[Wl["ru-RU"]]="俄语 (俄罗斯)",ql[Wl["fr-FR"]]="法语 (法国)",ql[Wl.gu]="古加拉提语",ql[Wl["nl-BE"]]="荷兰语 (比利时)",ql[Wl["nl-NL"]]="荷兰语 (荷兰)",ql[Wl["cs-CZ"]]="捷克语 (捷克共和国)",ql[Wl.ro]="罗马尼亚语",ql[Wl["lo-LA"]]="老挝语 (老挝)",ql[Wl["my-MM"]]="缅甸语 (缅甸)",ql[Wl["bn-BD"]]="孟加拉语 (孟加拉)",ql[Wl["bn-IN"]]="孟加拉语 (印度)",ql[Wl.mr]="马拉地语",ql[Wl["ms-MY"]]="马来语 (马来西亚)",ql[Wl.ml]="马来亚拉姆语",ql[Wl.mni]="曼尼普里语",ql[Wl["ne-NP"]]="尼泊尔语 (尼泊尔)",ql[Wl.or]="欧里亚语",ql[Wl["pt-BR"]]="葡萄牙语 (巴西)",ql[Wl["pt-PT"]]="葡萄牙语 (葡萄牙)",ql[Wl.pa]="旁遮普语",ql[Wl["sv-SE"]]="瑞典语 (瑞典)",ql[Wl["ja-JP"]]="日语 (日本)",ql[Wl.sr]="塞尔维亚语",ql[Wl["si-LK"]]="僧伽罗语 (斯里兰卡)",ql[Wl["sk-SK"]]="斯洛伐克语 (斯洛伐克)",ql[Wl["tr-TR"]]="土耳其语 (土耳其)",ql[Wl["tl-PH"]]="塔加路族语 (菲律宾)",ql[Wl.te]="泰卢固语",ql[Wl.ta]="泰米尔语",ql[Wl["th-TH"]]="泰语 (泰国)",ql[Wl["ur-PK"]]="乌尔都语 (巴基斯坦)",ql[Wl["ur-IN"]]="乌尔都语 (印度)",ql[Wl["uk-UA"]]="乌克兰语 (乌克兰)",ql[Wl["iw-IL"]]="希伯来语 (以色列)",ql[Wl["es-ES"]]="西班牙语 (西班牙)",ql[Wl["es-MX"]]="西班牙语 (墨西哥)",ql[Wl.hu]="匈牙利语",ql[Wl["it-IT"]]="意大利语 (意大利)",ql[Wl["in-ID"]]="印度尼西亚语 (印度尼西亚)",ql[Wl["hi-IN"]]="印地语 (印度)",ql[Wl["vi-VN"]]="越南语 (越南)",ql[Wl["en-PK"]]="英语 (巴基斯坦)",ql[Wl["en-PL"]]="英语 (波兰)",ql[Wl["en-FR"]]="英语 (法国)",ql[Wl["en-PH"]]="英语 (菲律宾)",ql[Wl["en-CZ"]]="英语 (捷克共和国)",ql[Wl["en-CA"]]="英语 (加拿大)",ql[Wl["en-MM"]]="英语 (缅甸)",ql[Wl["en-US"]]="英语 (美国)",ql[Wl["en-BD"]]="英语 (孟加拉)",ql[Wl["en-MY"]]="英语 (马来西亚)",ql[Wl["en-NP"]]="英语 (尼泊尔)",ql[Wl["en-LK"]]="英语 (斯里兰卡)",ql[Wl["en-TH"]]="英语 (泰国)",ql[Wl["en-ES"]]="英语 (西班牙)",ql[Wl["en-SG"]]="英语 (新加坡)",ql[Wl["en-HU"]]="英语 (匈牙利)",ql[Wl["en-ID"]]="英语 (印度尼西亚)",ql[Wl["en-GB"]]="英语 (英国)",ql[Wl["en-VN"]]="英语 (越南)",ql[Wl["en-HK"]]="英语 (中国香港)",ql[Wl["en-KR"]]="英语 (韩国)",ql[Wl["zh-TW"]]="繁体中文 (中国台湾)",ql[Wl["zh-HK"]]="繁体中文 (中国香港)",ql[Wl["zh-SG"]]="简体中文 (新加坡)",ql[Wl["zh-CN"]]="简体中文 (中国)",ql[Wl["ar-IQ"]]="阿拉伯语 (伊拉克)",ql[Wl["ckb-IQ"]]="中库尔德语 (伊拉克)",ql[Wl.ku]="库尔德语",ql[Wl["kk-KZ"]]="哈萨克语",ql[Wl.af]="南非语",ql[Wl.am]="阿姆哈拉语",ql[Wl.az]="阿塞拜疆语",ql[Wl.be]="白俄罗斯语",ql[Wl.bg]="保加利亚语",ql[Wl.bs]="波斯尼亚语",ql[Wl.ca]="加泰罗尼亚语",ql[Wl.cy]="威尔士语",ql[Wl.el]="现代希腊语",ql[Wl.eo]="世界语",ql[Wl.et]="爱沙尼亚语",ql[Wl.eu]="巴斯克语",ql[Wl.fa]="波斯语",ql[Wl.fi]="芬兰语",ql[Wl.gd]="爱尔兰语",ql[Wl.gl]="加利西亚语",ql[Wl.ha]="豪萨语",ql[Wl.haw]="夏威夷语",ql[Wl.hr]="克罗地亚语",ql[Wl.ig]="伊博语",ql[Wl.is]="冰岛语",ql[Wl.ka]="格鲁吉亚语",ql[Wl.km]="高棉语",ql[Wl.ky]="吉尔吉斯语",ql[Wl.lb]="卢森堡语",ql[Wl.ln]="林格拉语",ql[Wl.lt]="立陶宛语",ql[Wl.lv]="拉脱维亚语",ql[Wl.mg]="马尔加什语",ql[Wl.mk]="马其顿语",ql[Wl.mn]="蒙古文",ql[Wl.mt]="马耳他语",ql[Wl.om]="奥罗莫语",ql[Wl.ps]="普什图语",ql[Wl.qu]="克丘亚语",ql[Wl.rw]="卢旺达语",ql[Wl.sl]="斯洛文尼亚语",ql[Wl.so]="索马里语",ql[Wl.sq]="阿尔巴尼亚语",ql[Wl.sw]="斯瓦希里语",ql[Wl.tg]="塔吉克语",ql[Wl.ti]="蒂格尼亚语",ql[Wl.ug]="维吾尔语",ql[Wl.uz]="乌兹别克语",ql[Wl.yo]="约鲁巴语",ql[Wl.zu]="祖鲁语";var Jl,Ql={};Ql[Wl["ar-SA"]]="Arabic (Saudi Arabia)",Ql[Wl.kn]="Kannada",Ql[Wl.as]="Assamese",Ql[Wl.bho]="Bhojpuri",Ql[Wl["pl-PL"]]="Polish (Poland)",Ql[Wl["ko-KR"]]="Korean (Korean)",Ql[Wl["da-DK"]]="Danish (Denmark)",Ql[Wl["de-DE"]]="German (Germany)",Ql[Wl["ru-RU"]]="Russian (Russia)",Ql[Wl["fr-FR"]]="French (France)",Ql[Wl.gu]="Gujarati",Ql[Wl["nl-BE"]]="Dutch (Belgium)",Ql[Wl["nl-NL"]]="Dutch (Netherlands)",Ql[Wl["cs-CZ"]]="Czech (Czech Republic)",Ql[Wl.ro]="Romanian",Ql[Wl["lo-LA"]]="Lao (Laos)",Ql[Wl["my-MM"]]="Burmese (Myanmar)",Ql[Wl["bn-BD"]]="Bengali (Bangladesh)",Ql[Wl["bn-IN"]]="Bengali (India)",Ql[Wl.mr]="Marathi",Ql[Wl["ms-MY"]]="Malay (Malaysia)",Ql[Wl.ml]="Malayalam",Ql[Wl.mni]="Manipuri",Ql[Wl["ne-NP"]]="Nepalese (Nepal)",Ql[Wl.or]="Odia (Oriya)",Ql[Wl["pt-BR"]]="Portuguese (Brazil)",Ql[Wl["pt-PT"]]="Portuguese (Portugal)",Ql[Wl.pa]="Punjabi",Ql[Wl["sv-SE"]]="Swedish (Sweden)",Ql[Wl["ja-JP"]]="Japanese (Japanese)",Ql[Wl.sr]="Serbian",Ql[Wl["si-LK"]]="Sinhala (Sri Lanka)",Ql[Wl["sk-SK"]]="Slovak (Slovakia)",Ql[Wl["tr-TR"]]="Turkish (Turkish)",Ql[Wl["tl-PH"]]="Tagalog (Philippines)",Ql[Wl.te]="Telugu",Ql[Wl.ta]="Tamil",Ql[Wl["th-TH"]]="Thai (Thailand)",Ql[Wl["ur-PK"]]="Ulduwen (Pakistan)",Ql[Wl["ur-IN"]]="Urduwen (India)",Ql[Wl["uk-UA"]]="Ukrainian (Ukraine)",Ql[Wl["iw-IL"]]="Hebrew (Israel)",Ql[Wl["es-ES"]]="Spanish (Spain)",Ql[Wl["es-MX"]]="Spanish (Mexico)",Ql[Wl.hu]="Hungarian",Ql[Wl["it-IT"]]="Italian (Italian)",Ql[Wl["in-ID"]]="Indonesian (Indonesia)",Ql[Wl["hi-IN"]]="Hindi (India)",Ql[Wl["vi-VN"]]="Vietnamese (Vietnam)",Ql[Wl["en-PK"]]="English (Pakistan)",Ql[Wl["en-PL"]]="English (Poland)",Ql[Wl["en-FR"]]="English (France)",Ql[Wl["en-PH"]]="English (Philippines)",Ql[Wl["en-CZ"]]="English (Czech Republic)",Ql[Wl["en-CA"]]="English (Canada)",Ql[Wl["en-MM"]]="English (Myanmar)",Ql[Wl["en-US"]]="English (US)",Ql[Wl["en-BD"]]="English (Bangladesh)",Ql[Wl["en-MY"]]="English (Malaysia)",Ql[Wl["en-NP"]]="English (Nepal)",Ql[Wl["en-LK"]]="English (Sri Lanka)",Ql[Wl["en-TH"]]="English (Thailand)",Ql[Wl["en-ES"]]="English (Spain)",Ql[Wl["en-SG"]]="English (Singapore)",Ql[Wl["en-HU"]]="English (Hungary)",Ql[Wl["en-ID"]]="English (Indonesia)",Ql[Wl["en-GB"]]="English (UK)",Ql[Wl["en-VN"]]="English (Vietnam)",Ql[Wl["en-HK"]]="English (Hong Kong)",Ql[Wl["en-KR"]]="English (Korean)",Ql[Wl["zh-TW"]]="Chinese Traditional (Taiwan)",Ql[Wl["zh-HK"]]="Chinese Traditional (Hong Kong)",Ql[Wl["zh-SG"]]="Chinese Simplified (Singapore)",Ql[Wl["zh-CN"]]="Chinese Simplified (China)",Ql[Wl["ar-IQ"]]="Arabic (Iraq)",Ql[Wl["ckb-IQ"]]="Central Kurdish (Iraq)",Ql[Wl.ku]="Kurdish",Ql[Wl["kk-KZ"]]="Kazakh",Ql[Wl.af]="Afrikaans",Ql[Wl.am]="Amharic",Ql[Wl.az]="Azerbaijani",Ql[Wl.be]="Belarusian",Ql[Wl.bg]="Bulgarian",Ql[Wl.bs]="Bosnian",Ql[Wl.ca]="Catalan",Ql[Wl.cy]="Welsh",Ql[Wl.el]="Greek",Ql[Wl.eo]="Esperanto",Ql[Wl.et]="Estonian",Ql[Wl.eu]="Basque",Ql[Wl.fa]="Persian",Ql[Wl.fi]="Finnish",Ql[Wl.gd]="Scots Gaelic",Ql[Wl.gl]="Galician",Ql[Wl.ha]="Hausa",Ql[Wl.haw]="Hawaiian",Ql[Wl.hr]="Croatian",Ql[Wl.ig]="Igbo",Ql[Wl.is]="Icelandic",Ql[Wl.ka]="Georgian",Ql[Wl.km]="Khmer",Ql[Wl.ky]="Kyrgyz",Ql[Wl.lb]="Luxembourgish",Ql[Wl.ln]="Lingala",Ql[Wl.lt]="Lithuanian",Ql[Wl.lv]="Latvian",Ql[Wl.mg]="Malagasy",Ql[Wl.mk]="Macedonian",Ql[Wl.mn]="Mongolian",Ql[Wl.mt]="Maltese",Ql[Wl.om]="Oromo",Ql[Wl.ps]="Pashto",Ql[Wl.qu]="Quechua",Ql[Wl.rw]="Kinyarwanda",Ql[Wl.sl]="Slovenian",Ql[Wl.so]="Somali",Ql[Wl.sq]="Albanian",Ql[Wl.sw]="Swahili",Ql[Wl.tg]="Tajik",Ql[Wl.ti]="Tigrinya",Ql[Wl.ug]="Uyghur",Ql[Wl.uz]="Uzbek",Ql[Wl.yo]="Yoruba",Ql[Wl.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(Jl||(Jl={}));var Zl,Xl,$l,ec={"zh-hans":Wl["zh-CN"],"zh-hant":Wl["zh-TW"],ar:Wl["ar-SA"],bn:Wl["bn-BD"],cs:Wl["cs-CZ"],da:Wl["da-DK"],de:Wl["de-DE"],en:Wl["en-US"],es:Wl["es-ES"],fr:Wl["fr-FR"],hi:Wl["hi-IN"],in:Wl["in-ID"],it:Wl["it-IT"],iw:Wl["iw-IL"],ja:Wl["ja-JP"],ko:Wl["ko-KR"],lo:Wl["lo-LA"],ms:Wl["ms-MY"],my:Wl["my-MM"],ne:Wl["ne-NP"],nl:Wl["nl-NL"],pl:Wl["pl-PL"],pt:Wl["pt-PT"],ru:Wl["ru-RU"],si:Wl["si-LK"],sk:Wl["sk-SK"],sv:Wl["sv-SE"],th:Wl["th-TH"],tl:Wl["tl-PH"],tr:Wl["tr-TR"],uk:Wl["uk-UA"],ur:Wl["ur-PK"],vi:Wl["vi-VN"],zh:Wl["zh-CN"],kk:Wl["kk-KZ"]},tc={"zh-hant":Wl["zh-TW"],"zh-hans":Wl["zh-CN"]},nc=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},rc=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}(Zl||(Zl={})),nc(Zl),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(Xl||(Xl={})),nc(Xl),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}($l||($l={})),nc($l);var oc,ic,sc,lc,cc,uc,dc,pc,hc,fc,mc,vc,gc,yc,_c,bc;Wl["ar-IQ"],Zl.ar_EG,$l.ar,Xl.ar,Wl["ar-SA"],Zl.ar_EG,$l["ar-sa"],Xl["ar-sa"],Wl["bn-BD"],Zl.bn_BD,$l["bn-bd"],Xl["bn-bd"],Wl["bn-IN"],Zl.bn_BD,$l.bn,Xl.bn,Wl["cs-CZ"],Zl.cs_CZ,$l.cs,Xl.cs,Wl["da-DK"],Zl.da_DK,$l.da,Xl.da,Wl["de-DE"],Zl.de_DE,$l.de,Xl.de,Wl["en-BD"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-CA"],Zl.en_US,$l["en-ca"],Xl["en-ca"],Wl["en-CZ"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-ES"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-FR"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-GB"],Zl.en_GB,$l["en-gb"],Xl["en-gb"],Wl["en-HU"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-ID"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-LK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-MM"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-MY"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-NP"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PH"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PL"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-SG"],Zl.en_US,$l["en-sg"],Xl.en,Wl["en-TH"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-US"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-VN"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-HK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-KR"],Zl.en_US,$l["en-gb"],Xl.en,Wl["es-ES"],Zl.es_ES,$l.es,Xl.es,Wl["es-MX"],Zl.es_ES,$l.es,Xl.es,Wl["fr-FR"],Zl.fr_FR,$l.fr,Xl.fr,Wl["hi-IN"],Zl.hi_IN,$l.hi,Xl.hi,Wl.hu,Zl.hu_HU,$l.hu,Xl.hu,Wl["in-ID"],Zl.id_ID,$l.id,Xl.id,Wl["it-IT"],Zl.it_IT,$l.it,Xl.it,Wl["ja-JP"],Zl.ja_JP,$l.ja,Xl.ja,Wl.kn,Zl.kn_IN,$l.kn,Xl.kn,Wl["ko-KR"],Zl.ko_KR,$l.ko,Xl.ko,Wl.ml,Zl.ml_IN,$l.ml,Xl.ml,Wl["ms-MY"],Zl.ms_MY,$l["ms-my"],Xl["ms-my"],Wl["ne-NP"],Zl.ne_NP,$l.ne,Xl.ne,Wl["nl-BE"],Zl.nl_BE,$l["nl-be"],Xl["nl-be"],Wl["nl-NL"],Zl.nl_NL,$l.nl,Xl.nl,Wl["pl-PL"],Zl.pl_PL,$l.pl,Xl.pl,Wl["pt-BR"],Zl.pt_BR,$l["pt-br"],Xl["pt-br"],Wl["pt-PT"],Zl.pt_PT,$l.pt,Xl.pt,Wl.ro,Zl.ro_RO,$l.ro,Xl.ro,Wl["ru-RU"],Zl.ru_RU,$l.ru,Xl.ru,Wl["si-LK"],Zl.si_LK,$l.si,Xl.si,Wl["sk-SK"],Zl.sk_SK,$l.sk,Xl.sk,Wl.sr,Zl.sr_RS,$l.sr,Xl.sr,Wl["sv-SE"],Zl.sv_SE,$l.sv,Xl.sv,Wl.ta,Zl.ta_IN,$l.ta,Xl.ta,Wl["th-TH"],Zl.th_TH,$l.th,Xl.th,Wl["tr-TR"],Zl.tr_TR,$l.tr,Xl.tr,Wl["uk-UA"],Zl.uk_UA,$l.uk,Xl.uk,Wl["ur-PK"],Zl.ur_PK,$l.ur,Xl.ur,Wl["vi-VN"],Zl.vi_VN,$l.vi,Xl.vi,Wl["zh-CN"],Zl.zh_CN,$l["zh-cn"],Xl["zh-cn"],Wl["zh-HK"],Zl.zh_HK,$l["zh-hk"],Xl["zh-hk"],Wl["zh-SG"],Zl.zh_HK,$l["zh-hk"],Xl["zh-hk"],Wl["zh-TW"],Zl.zh_TW,$l["zh-tw"],Xl["zh-tw"],Wl["kk-KZ"],Zl.kk_KZ,$l.kk,Xl.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(bc||(bc={}));var Ec,Sc,Ac=nc(bc),kc={};kc[bc.kn]="AiNaDeYu",kc[bc.ar_SA]="ALaBoYu (ShaTeALaBo)",kc[bc.ar_IQ]="ALaBoYu (YiLaKe)",kc[bc.as]="ASaMuYu",kc[bc.bho]="BoJiePuErYu",kc[bc.pl_PL]="BoLanYu (BoLan)",kc[bc.ko_KR]="ChaoXianYu (HanGuo)",kc[bc.da_DK]="DanMaiYu (DanMai)",kc[bc.de_DE]="DeYu (DeGuo)",kc[bc.ru_RU]="EYu (ELuoSi)",kc[bc.fr_FR]="FaYu (FaGuo)",kc[bc.gu]="GuJiaLaTiYu",kc[bc.nl_BE]="HeLanYu (BiLiShi)",kc[bc.nl_NL]="HeLanYu (HeLan)",kc[bc.cs_CZ]="JieKeYu (JieKeGongHeGuo)",kc[bc.ku]="KuErDeYu",kc[bc.lo_LA]="LaoWoYu (LaoWo)",kc[bc.ro]="LuoMaNiYaYu",kc[bc.mr]="MaLaDiYu",kc[bc.ms_MY]="MaLaiYu (MaLaiXiYa)",kc[bc.ml]="MaLaiYaLaMuYu",kc[bc.mni]="ManNiPuLiYu",kc[bc.bn_BD]="MengJiaLaYu (MengJiaLa)",kc[bc.bn_IN]="MengJiaLaYu (YinDu)",kc[bc.my_MM]="MianDianYu (MianDian)",kc[bc.ne_NP]="NiBoErYu (NiBoEr)",kc[bc.or]="OuLiYaYu",kc[bc.pa]="PangZhePuYu",kc[bc.pt_BR]="PuTaoYaYu (BaXi)",kc[bc.pt_PT]="PuTaoYaYu (PuTaoYa)",kc[bc.ja_JP]="RiYu (RiBen)",kc[bc.sv_SE]="RuiDianYu (RuiDian)",kc[bc.sr]="SaiErWeiYaYu",kc[bc.si_LK]="SengJiaLuoYu (SiLiLanKa)",kc[bc.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",kc[bc.te]="TaiLuGuYu",kc[bc.ta]="TaiMiErYu",kc[bc.th_TH]="TaiYu (TaiGuo)",kc[bc.tl_PH]="TaJiaLuZuYu (FeiLvBin)",kc[bc.tr_TR]="TuErQiYu (TuErQi)",kc[bc.ur_PK]="WuErDuYu (BaJiSiTan)",kc[bc.ur_IN]="WuErDuYu (YinDu)",kc[bc.uk_UA]="WuKeLanYu (WuKeLan)",kc[bc.es_ES]="XiBanYaYu (XiBanYa)",kc[bc.es_MX]="XiBanYaYu (MoXiGe)",kc[bc.iw_IL]="XiBoLaiYu (YiSeLie)",kc[bc.hu]="XiongYaLiYu",kc[bc.it_IT]="YiDaLiYu (YiDaLi)",kc[bc.hi_IN]="YinDiYu (YinDu)",kc[bc.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",kc[bc.en_PK]="YingYu (BaJiSiTan)",kc[bc.en_PL]="YingYu (BoLan)",kc[bc.en_FR]="YingYu (FaGuo)",kc[bc.en_PH]="YingYu (FeiLvBin)",kc[bc.en_CA]="YingYu (JiaNaDa)",kc[bc.en_CZ]="YingYu (JieKeGongHeGuo)",kc[bc.en_MY]="YingYu (MaLaiXiYa)",kc[bc.en_US]="YingYu (MeiGuo)",kc[bc.en_BD]="YingYu (MengJiaLa)",kc[bc.en_MM]="YingYu (MianDian)",kc[bc.en_NP]="YingYu (NiBoEr)",kc[bc.en_LK]="YingYu (SiLiLanKa)",kc[bc.en_TH]="YingYu (TaiGuo)",kc[bc.en_ES]="YingYu (XiBanYa)",kc[bc.en_SG]="YingYu (XinJiaPo)",kc[bc.en_HU]="YingYu (XiongYaLi)",kc[bc.en_ID]="YingYu (YinDuNiXiYa)",kc[bc.en_GB]="YingYu (YingGuo)",kc[bc.en_VN]="YingYu (YueNan)",kc[bc.en_HK]="YingYu (XiangGang)",kc[bc.en_KR]="YingYu (HanGuo)",kc[bc.vi_VN]="YueNanYu (YueNan)",kc[bc.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",kc[bc.zh_TW]="ZhongWen (TaiWanDiQu)",kc[bc.zh_HK]="ZhongWen (XiangGang)",kc[bc.zh_SG]="ZhongWen (XinJiaPo)",kc[bc.zh_CN]="ZhongWen (ZhongGuo)",kc[bc.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",kc[bc.af]="NanFeiYu",kc[bc.am]="AMuHaLaYu",kc[bc.az]="ASaiBaiJiangYu",kc[bc.be]="BaiErLuoSiYu",kc[bc.bg]="BaoJiaLiYaYu",kc[bc.bs]="BoSiNiYaYu",kc[bc.ca]="JiaTaiLuoNiYaYu",kc[bc.cy]="WeiErShiYu",kc[bc.el]="XianDaiXiLaYu",kc[bc.eo]="ShiJieYu",kc[bc.et]="AiShaNiYaYu",kc[bc.eu]="BaSiKeYu",kc[bc.fa]="BoSiYu",kc[bc.fi]="FenLanYu",kc[bc.gd]="AiErLanYu",kc[bc.gl]="JiaLiXiYaYu",kc[bc.ha]="HaoSaYu",kc[bc.haw]="XiaWeiYiYu",kc[bc.hr]="KeLuoDiYaYu",kc[bc.ig]="YiBoYu",kc[bc.is]="BingDaoYu",kc[bc.ka]="GeLuJiYaYu",kc[bc.km]="GaoMianYu",kc[bc.ky]="JiErJiSiYu",kc[bc.lb]="LuSenBaoYu",kc[bc.ln]="LinGeLaYu",kc[bc.lt]="LiTaoWanYu",kc[bc.lv]="LaTuoWeiYaYu",kc[bc.mg]="MaErJiaShiYu",kc[bc.mk]="MaQiDunYu",kc[bc.mn]="MengGuWen",kc[bc.mt]="MaErTaYu",kc[bc.om]="AoLuoMoYu",kc[bc.ps]="PuShiTuYu",kc[bc.qu]="KeQiuYaYu",kc[bc.rw]="LuWangDaYu",kc[bc.sl]="SiLuoWeiNiYaYu",kc[bc.so]="SuoMaLiYu",kc[bc.sq]="AErBaNiYaYu",kc[bc.sw]="SiWaXiLiYu",kc[bc.tg]="TaJiKeYu",kc[bc.ti]="DiGeNiYaYu",kc[bc.ug]="WeiWuErYu",kc[bc.uz]="WuZiBieKeYu",kc[bc.yo]="YueLuBaYu",kc[bc.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Ec||(Ec={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Sc||(Sc={})),nc(Sc);var Tc=Object.assign(Object.assign({},Sc),{TranslationMemory:"TranslationMemory"}),wc=(nc(Tc),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-tw";if(e===bc.in_ID)return"id";if(e===bc.iw_IL)return"he";var t=e.split("_")[0];return rc(wc.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-TW";if(e===bc.in_ID)return"id";if(e===bc.mni)return"mni-Mtei";var t=e.split("_")[0];return rc(wc.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===bc.zh_CN)return"zh-CN";if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-TW";var t=e.split("_")[0];return rc(wc.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===bc.in_ID)return"ID";var n=t.split("_")[0];return rc(wc.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===bc.zh_CN||e===bc.zh_SG)return"ZH";if(e===bc.zh_HK||e===bc.zh_TW)return null;if(e===bc.en_GB||e===bc.en_US||e===bc.pt_BR||e===bc.pt_PT)return t.replace("_","-");if(e===bc.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":rc(wc.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===bc.pt_PT)return"pt-pt";if(e===bc.pt_BR)return"pt";if([bc.zh_CN,bc.zh_SG].includes(e))return"zh-Hans";if([bc.zh_HK,bc.zh_TW].includes(e))return"zh-Hant";if(e===bc.iw_IL)return"he";if(e===bc.in_ID)return"id";if(e===bc.ckb_IQ)return"ku";var t=e.split("_")[0];return rc(wc.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===bc.pt_PT)return"pt-PT";if(e===bc.pt_BR)return"pt";if(e===bc.es_MX)return"es-MX";if(e===bc.in_ID)return"id";if(e===bc.zh_CN||e===bc.zh_SG)return"zh";if(e===bc.zh_HK||e===bc.zh_TW)return"zh-TW";var t=e.split("_")[0];return rc(wc.amazonSupportedLanguages,t)?t:null}}),Pc={};Pc[Sc.AiSelected]=Ac,Pc[Sc.Aliyun]=Ac.filter((function(e){return Boolean(wc.mapAliyunLanguage(e))})),Pc[Sc["ChatGPT3.5"]]=Ac,Pc[Sc.Google]=Ac.filter((function(e){return Boolean(wc.mapGoogleLanguage(e))})),Pc[Sc.Papago]=Ac.filter((function(e){return Boolean(wc.mapPapagoLanguage(e))})),Pc[Sc.DeepL]=Ac.filter((function(e){return Boolean(wc.mapDeepLLanguage(e))})),Pc[Sc.Microsoft]=Ac.filter((function(e){return Boolean(wc.mapMicrosoftLanguage(e))})),Pc[Sc.Amazon]=Ac.filter((function(e){return Boolean(wc.mapAmazonLanguage(e))}));var Ic={};Ic[Sc.AiSelected]=Ac,Ic[Sc.Aliyun]=Ac.filter((function(e){return Boolean(wc.mapAliyunLanguage(e))})),Ic[Sc["ChatGPT3.5"]]=Ac,Ic[Sc.Google]=Ac.filter((function(e){return Boolean(wc.mapGoogleLanguage(e))})),Ic[Sc.Papago]=Ac.filter((function(e){return Boolean(wc.mapPapagoLanguage(e))})),Ic[Sc.DeepL]=Ac.filter((function(e){return Boolean(wc.mapDeepLSourceLanguage(e))})),Ic[Sc.Microsoft]=Ac.filter((function(e){return Boolean(wc.mapMicrosoftLanguage(e))})),Ic[Sc.Amazon]=Ac.filter((function(e){return Boolean(wc.mapAmazonLanguage(e))})),Cc=Ac.map((function(e){return[e,nc(Sc).filter((function(t){return rc(Pc[t],e)}))]})),Rc={},Object.keys(Cc||{}).forEach((function(e){var t=Cc[e],n=t[0],r=t[1];Rc[n]=r}));var Cc,Rc,Nc={};Nc[bc.ar_SA]="العربية)السعودية)",Nc[bc.kn]="ಕನ್ನಡ",Nc[bc.as]="অসমীয়া",Nc[bc.bho]="भोजपुरी",Nc[bc.pl_PL]="Polski (Polska)",Nc[bc.ko_KR]="한국어 (대한민국)",Nc[bc.da_DK]="Dansk (Danmark)",Nc[bc.de_DE]="Deutsch (Deutschland)",Nc[bc.ru_RU]="Русский (Россия)",Nc[bc.fr_FR]="Français (France)",Nc[bc.gu]="ગુજરાતી",Nc[bc.nl_BE]="Nederlands (Belgium)",Nc[bc.nl_NL]="Nederlands (Nederland)",Nc[bc.cs_CZ]="Čeština (Česká republika)",Nc[bc.ro]="Română",Nc[bc.lo_LA]="ລາວ (ລາວ)",Nc[bc.my_MM]="မြန်မာဘာသာ (မြန်မာ)",Nc[bc.bn_BD]="বাংলা (বাংলাদেশ)",Nc[bc.bn_IN]="বাংলা (ভারত)",Nc[bc.mr]="मराठी",Nc[bc.ms_MY]="Bahasa Melayu (Malaysia)",Nc[bc.ml]="മലയാളം",Nc[bc.mni]="ꯃꯩꯇꯩꯂꯣꯟ",Nc[bc.ne_NP]="नेपाली (नेपाल)\t",Nc[bc.or]="ଓଡ଼ିଆ",Nc[bc.pt_BR]="Português (Brasil)",Nc[bc.pt_PT]="Português (Portugal)",Nc[bc.pa]="پنجابی",Nc[bc.sv_SE]="Svenska (Sverige)",Nc[bc.ja_JP]="日本語",Nc[bc.sr]="Српски",Nc[bc.si_LK]="සිංහල (ශ්රී ලංකාව)",Nc[bc.sk_SK]="Slovenčina (Slovensko)",Nc[bc.tr_TR]="Türkçe (Türkiye)",Nc[bc.tl_PH]="Wikang Tagalog (Philippines)",Nc[bc.te]="తెలుగు",Nc[bc.ta]="தமிழ்",Nc[bc.th_TH]="ไทย (ประเทศไทย)",Nc[bc.ur_PK]="اردو)پاکستان)",Nc[bc.ur_IN]="اردو)بھارت)",Nc[bc.uk_UA]="Українська (Україна)",Nc[bc.iw_IL]="עִבְרִית (ישראל)",Nc[bc.es_ES]="Español (España)",Nc[bc.es_MX]="Español (México)",Nc[bc.hu]="Magyar",Nc[bc.it_IT]="Italiano (Italia)",Nc[bc.in_ID]="Bahasa Indonesia (Indonesia)",Nc[bc.hi_IN]="हिन्दी (भारत)",Nc[bc.vi_VN]="Tiếng Việt (Việt Nam)",Nc[bc.en_PK]="English (Pakistan)",Nc[bc.en_PL]="English (Poland)",Nc[bc.en_FR]="English (France)",Nc[bc.en_PH]="English (Philippines)",Nc[bc.en_CZ]="English (Czech Republic)",Nc[bc.en_CA]="English (Canada)",Nc[bc.en_MM]="English (Myanmar)",Nc[bc.en_US]="English (United States)",Nc[bc.en_BD]="English (Bangladesh)",Nc[bc.en_MY]="English (Malaysia)",Nc[bc.en_NP]="English (Nepal)",Nc[bc.en_LK]="English (Sri Lanka)",Nc[bc.en_TH]="English (Thailand)",Nc[bc.en_ES]="English (Spain)",Nc[bc.en_SG]="English (Singapore)",Nc[bc.en_HU]="English (Hungary)",Nc[bc.en_ID]="English (Indonesia)",Nc[bc.en_GB]="English (Great Britain)",Nc[bc.en_VN]="English (Vietnam)",Nc[bc.en_HK]="English (Hong Kong)",Nc[bc.en_KR]="English (Korea)",Nc[bc.zh_TW]="繁体中文 (中國台灣)",Nc[bc.zh_HK]="繁体中文 (中國香港)",Nc[bc.zh_SG]="简体中文 (新加坡)",Nc[bc.zh_CN]="简体中文",Nc[bc.ar_IQ]="العربية (العراق)",Nc[bc.ckb_IQ]="کوردیی ناوەندی (عێراق)",Nc[bc.ku]="کورمانجی",Nc[bc.kk_KZ]="قازاقشا ",Nc[bc.af]="Afrikaans",Nc[bc.am]="አማርኛ",Nc[bc.az]="Azərbaycan",Nc[bc.be]="беларуская мова",Nc[bc.bg]="Български",Nc[bc.bs]="босански",Nc[bc.ca]="Català",Nc[bc.cy]="Cymraeg",Nc[bc.el]="Ελληνικά",Nc[bc.eo]="Esperanto",Nc[bc.et]="eesti keel",Nc[bc.eu]="Euskara",Nc[bc.fa]="فارسی",Nc[bc.fi]="Suomi",Nc[bc.gd]="Gaeilge",Nc[bc.gl]="Galego",Nc[bc.ha]="هَوُسَ",Nc[bc.haw]="ʻŌlelo Hawaiʻi",Nc[bc.hr]="Hrvatski",Nc[bc.ig]="Asụsụ Igbo",Nc[bc.is]="Íslenska",Nc[bc.ka]="ქართული",Nc[bc.km]="ភាសាខ្មែរ",Nc[bc.ky]="кыргыз тили",Nc[bc.lb]="Lëtzebuergesch",Nc[bc.ln]="Lingála",Nc[bc.lt]="lietuvių kalba",Nc[bc.lv]="Latviešu valoda",Nc[bc.mg]="malagasy",Nc[bc.mk]="македонски",Nc[bc.mn]="монгол хэл",Nc[bc.mt]="Malti",Nc[bc.om]="Oromoo",Nc[bc.ps]="پښتو",Nc[bc.qu]="Quechua",Nc[bc.rw]="Ikinyarwanda",Nc[bc.sl]="slovenščina",Nc[bc.so]="Af-Soomaali",Nc[bc.sq]="Gjuha shqipe",Nc[bc.sw]="Kiswahili",Nc[bc.tg]="тоҷикӣ",Nc[bc.ti]="ትግርኛ",Nc[bc.ug]="ئۇيغۇر تىلى",Nc[bc.uz]="Ўзбек тили",Nc[bc.yo]="Èdè Yorùbá",Nc[bc.zu]="isiZulu",Sc.AiSelected,(oc={})[bc.en_US]="AI Selected",oc[bc.zh_CN]="AI 精选",(ic={})[bc.en_US]="AI selection of translations",ic[bc.zh_CN]="多渠道翻译的 AI 精选",Ic.AiSelected,Pc.AiSelected,(sc={})[bc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",sc[bc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(lc={})[bc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",lc[bc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Sc["ChatGPT3.5"],(cc={})[bc.en_US]="GPT-3.5",cc[bc.zh_CN]="GPT-3.5",(uc={})[bc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",uc[bc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(dc={})[bc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",dc[bc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",Ic["ChatGPT3.5"],Pc["ChatGPT3.5"],Sc.Aliyun,(pc={})[bc.en_US]="Alibaba",pc[bc.zh_CN]="阿里云",Ic.Aliyun,Pc.Aliyun,Sc.Google,(hc={})[bc.en_US]="Google",hc[bc.zh_CN]="Google",Ic.Google,Pc.Google,Sc.DeepL,(fc={})[bc.en_US]="DeepL",fc[bc.zh_CN]="DeepL",Ic.DeepL,Pc.DeepL,Sc.Microsoft,(mc={})[bc.en_US]="Azure AI",mc[bc.zh_CN]="Azure AI",Ic.Microsoft,Pc.Microsoft,Sc.Amazon,(vc={})[bc.en_US]="Amazon",vc[bc.zh_CN]="Amazon",Ic.Amazon,Pc.Amazon,Sc.Papago,(gc={})[bc.en_US]="Papago",gc[bc.zh_CN]="Papago",(yc={})[bc.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",yc[bc.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(_c={})[bc.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",_c[bc.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",Ic.Papago,Pc.Papago;var Dc=Object.keys(Wl).map((function(e){return Wl[e]})),Oc=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,Lc=function(e,t){return(Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Mc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xc,Uc,Bc,Kc=function(){return(Kc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Hc(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Yc(e){return e.type===Uc.literal}function Fc(e){return e.type===Uc.argument}function jc(e){return e.type===Uc.number}function Gc(e){return e.type===Uc.date}function zc(e){return e.type===Uc.time}function Vc(e){return e.type===Uc.select}function Wc(e){return e.type===Uc.plural}function qc(e){return e.type===Uc.pound}function Jc(e){return e.type===Uc.tag}function Qc(e){return!(!e||"object"!=Je()(e)||e.type!==Bc.number)}function Zc(e){return!(!e||"object"!=Je()(e)||e.type!==Bc.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(xc||(xc={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Uc||(Uc={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(Bc||(Bc={}));var Xc=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,$c=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function eu(e){var t={};return e.replace($c,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var tu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,nu=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ru=/^(@+)?(\+|#+)?[rs]?$/g,ou=/(\*)(0+)|(#+)(0+)|(0+)/g,iu=/^(0+)$/;function au(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ru,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function su(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function lu(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!iu.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function cu(e){return su(e)||{}}function uu(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=Kc(Kc(Kc({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return Kc(Kc({},e),cu(t))}),{}));continue;case"engineering":t=Kc(Kc(Kc({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return Kc(Kc({},e),cu(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(ou,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(iu.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(nu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(nu,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=Kc(Kc({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=Kc(Kc({},t),au(i)))}else if(ru.test(o.stem))t=Kc(Kc({},t),au(o.stem));else{var a=su(o.stem);a&&(t=Kc(Kc({},t),a));var s=lu(o.stem);s&&(t=Kc(Kc({},t),s))}}return t}var du,pu={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function hu(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(pu[n||""]||pu[r||""]||pu["".concat(r,"-001")]||pu["001"])[0]}var fu=new RegExp("^".concat(Xc.source,"*")),mu=new RegExp("".concat(Xc.source,"*$"));function vu(e,t){return{start:e,end:t}}var gu=!!String.prototype.startsWith&&"_a".startsWith("a",1),yu=!!String.fromCodePoint,_u=!!Object.fromEntries,bu=!!String.prototype.codePointAt,Eu=!!String.prototype.trimStart,Su=!!String.prototype.trimEnd,Au=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ku=!0;try{ku="a"===(null===(du=Du("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===du?void 0:du[0])}catch(Wl){ku=!1}var Tu,wu=gu?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Pu=yu?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},Iu=_u?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},Cu=bu?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Ru=Eu?function(e){return e.trimStart()}:function(e){return e.replace(fu,"")},Nu=Su?function(e){return e.trimEnd()}:function(e){return e.replace(mu,"")};function Du(e,t){return new RegExp(e,t)}if(ku){var Ou=Du("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Tu=function(e,t){var n;return Ou.lastIndex=t,null!==(n=Ou.exec(e)[1])&&void 0!==n?n:""}}else Tu=function(e,t){for(var n=[];;){var r=Cu(e,t);if(void 0===r||xu(r)||Uu(r))break;n.push(r),t+=r>=65536?2:1}return Pu.apply(void 0,n)};var Lu=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(xc.UNMATCHED_CLOSING_TAG,vu(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Mu(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:Uc.pound,location:vu(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Uc.literal,value:"<".concat(r,"/>"),location:vu(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Mu(this.char()))return this.error(xc.INVALID_TAG,vu(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(xc.UNMATCHED_CLOSING_TAG,vu(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Uc.tag,value:r,children:i,location:vu(n,this.clonePosition())},err:null}:this.error(xc.INVALID_TAG,vu(a,this.clonePosition())))}return this.error(xc.UNCLOSED_TAG,vu(n,this.clonePosition()))}return this.error(xc.INVALID_TAG,vu(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=vu(n,this.clonePosition());return{val:{type:Uc.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Mu(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Pu.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Pu(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(xc.EMPTY_ARGUMENT,vu(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(xc.MALFORMED_ARGUMENT,vu(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Uc.argument,value:r,location:vu(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(xc.MALFORMED_ARGUMENT,vu(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Tu(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:vu(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(xc.EXPECT_ARGUMENT_TYPE,vu(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=Nu(g.val)).length)return this.error(xc.EXPECT_ARGUMENT_STYLE,vu(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:vu(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=vu(r,this.clonePosition());if(l&&wu(null==l?void 0:l.style,"::",0)){var d=Ru(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:Uc.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(xc.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=hu(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:Bc.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?eu(p):{}};return{val:{type:"date"===a?Uc.date:Uc.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?Uc.number:"date"===a?Uc.date:Uc.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(xc.EXPECT_SELECT_ARGUMENT_OPTIONS,vu(f,Kc({},f)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(xc.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,vu(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(xc.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,xc.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),m=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,m);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var b=vu(r,this.clonePosition());return"select"===a?{val:{type:Uc.select,value:n,options:Iu(_.val),location:b},err:null}:{val:{type:Uc.plural,value:n,options:Iu(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(xc.INVALID_ARGUMENT_TYPE,vu(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(xc.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,vu(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(tu).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(xc.INVALID_NUMBER_SKELETON,t)}return{val:{type:Bc.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?uu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(xc.EXPECT_PLURAL_ARGUMENT_SELECTOR,xc.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=vu(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?xc.DUPLICATE_SELECT_ARGUMENT_SELECTOR:xc.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?xc.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:xc.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,vu(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([l,{value:h.val,location:vu(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?xc.EXPECT_SELECT_ARGUMENT_SELECTOR:xc.EXPECT_PLURAL_ARGUMENT_SELECTOR,vu(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(xc.MISSING_OTHER_CLAUSE,vu(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=vu(r,this.clonePosition());return o?Au(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Cu(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(wu(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&xu(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Mu(e){return e>=97&&e<=122||e>=65&&e<=90}function xu(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Uu(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Bu(e,t){void 0===t&&(t={}),t=Kc({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Lu(e,t).parse();if(n.err){var r=SyntaxError(xc[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,Vc(t)||Wc(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else jc(t)&&Qc(t.style)||(Gc(t)||zc(t))&&Zc(t.style)?delete t.style.location:Jc(t)&&e(t.children)}))}(n.val),n.val}function Ku(e,t){var n=t&&t.cache?t.cache:Wu,r=t&&t.serializer?t.serializer:Gu;return(t&&t.strategy?t.strategy:ju)(e,{cache:n,serializer:r})}function Hu(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function Yu(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function Fu(e,t,n,r,o){return n.bind(t,e,r,o)}function ju(e,t){return Fu(e,this,1===e.length?Hu:Yu,t.cache.create(),t.serializer)}var Gu=function(){return JSON.stringify(arguments)};function zu(){this.cache=Object.create(null)}zu.prototype.get=function(e){return this.cache[e]},zu.prototype.set=function(e,t){this.cache[e]=t};var Vu,Wu={create:function(){return new zu}},qu={variadic:function(e,t){return Fu(e,this,Yu,t.cache.create(),t.serializer)},monadic:function(e,t){return Fu(e,this,Hu,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Vu||(Vu={}));var Ju,Qu=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return Mc(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Zu=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Vu.INVALID_VALUE,o)||this}return Mc(t,e),t}(Qu),Xu=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Vu.INVALID_VALUE,r)||this}return Mc(t,e),t}(Qu),$u=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Vu.MISSING_VALUE,n)||this}return Mc(t,e),t}(Qu);function ed(e){return"function"==typeof e}function td(e,t,n,r,o,i,a){if(1===e.length&&Yc(e[0]))return[{type:Ju.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(Yc(u))s.push({type:Ju.literal,value:u.value});else if(qc(u))"number"==typeof i&&s.push({type:Ju.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new $u(d,a);var p=o[d];if(Fc(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?Ju.literal:Ju.object,value:p});else if(Gc(u)){var h="string"==typeof u.style?r.date[u.style]:Zc(u.style)?u.style.parsedOptions:void 0;s.push({type:Ju.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(zc(u))h="string"==typeof u.style?r.time[u.style]:Zc(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:Ju.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(jc(u))(h="string"==typeof u.style?r.number[u.style]:Qc(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:Ju.literal,value:n.getNumberFormat(t,h).format(p)});else{if(Jc(u)){var f=u.children,m=u.value,v=o[m];if(!ed(v))throw new Xu(m,"function",a);var g=v(td(f,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?Ju.literal:Ju.object,value:e}})))}if(Vc(u)){if(!(y=u.options[p]||u.options.other))throw new Zu(u.value,p,Object.keys(u.options),a);s.push.apply(s,td(y.value,t,n,r,o))}else if(Wc(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Qu('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Vu.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new Zu(u.value,p,Object.keys(u.options),a);s.push.apply(s,td(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Ju.literal&&t.type===Ju.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function nd(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Ju||(Ju={}));var rd=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Ju.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return td(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,Kc(Kc({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?Kc(Kc(Kc({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=Kc(Kc({},o[t]),i[t]||{}),e}),{})):o),n}),Kc({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.number),strategy:qu.variadic}),getDateTimeFormat:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.dateTime),strategy:qu.variadic}),getPluralRules:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.pluralRules),strategy:qu.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Bu,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function od(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var id=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=od({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",od({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,od({},this.attributes,t))},withConverter:function(t){return e(od({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),ad=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},sd=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},ld=function(){return"object"==("undefined"==typeof ac?"undefined":Je()(ac))&&"function"==typeof ac.call},cd=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!ld()},ud=function(){return"object"==("undefined"==typeof window?"undefined":Je()(window))},dd=function(){return function(){var e;return!!ud()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||ud()&&"undefined"!=typeof AlipayJSBridge},pd=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},hd=function(){return!(void 0===n.g||ud()||cd()||pd()||ld())},fd="bailingualLocaleChange",md="bailingualDataChange",vd="bailingualError";function gd(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Je()(document)))try{return id.get(e)||id.get("_CHIPS-"+e)}catch(e){return ad("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var yd,_d=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),dd()||cd()||ld()){var t=tc[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),ec[e.toLowerCase()]&&(e=ec[e.toLowerCase()]),Ld(Dc,e)?e:""};function bd(e){return void 0===e&&(e=!0),_d(function(e){return void 0===e&&(e=!0),cd()||ld()?my.env&&my.env.language||my.getSystemInfoSync().language:pd()?wx.getSystemInfoSync().language:hd()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=gd("x-hng")||gd("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Je()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(ud()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(ud()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function Ed(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&id.set(e,t,n)}catch(e){ad("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Sd(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&id.remove(e,t)}catch(e){ad("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Ad(){"object"==("undefined"==typeof document?"undefined":Je()(document))&&"object"==("undefined"==typeof location?"undefined":Je()(location))&&(Sd("x-hng",{path:"/",domain:location.hostname}),Sd("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Sd("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Sd("x-hng",{path:"/"}),Sd("x-hng",{path:"/",SameSite:"None",Secure:!0}),Sd("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(yd||(yd={}));var kd,Td,wd,Pd,Id,Cd,Rd,Nd,Dd=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},Od=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},Ld=function(e,t){return e.indexOf(t)>-1};function Md(e){var t,n;try{return Td?(null===(t=Td.getItem)||void 0===t?void 0:t.call(Td,e))||"":cd()||ld()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":pd()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function xd(e,t){var n;try{if(t=(t||"").toString(),Td)return void(null===(n=Td.setItem)||void 0===n||n.call(Td,e,t));if(cd()||ld())return void my.setStorage({key:e,data:t});if(pd())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function Ud(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return kd?kd(e):ld()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):cd()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):pd()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(Rd||(Rd={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(Nd||(Nd={}));var Bd={ANTINTL:(wd={},wd[Rd.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",wd[Rd.PROD]="https://bailingual.marmot-cloud.com/manifest/",wd),ALIPAY:(Pd={},Pd[Rd.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Pd[Rd.PROD]="https://bailingual-assets.alipay.com/manifest/",Pd)},Kd={};Kd[Nd.INTERNET]=((Id={})[Rd.DAILY]=function(e,t,n){var r;return""+(n?null===(r=Bd[n])||void 0===r?void 0:r[Rd.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Id[Rd.PROD]=function(e,t,n){var r;return""+(n?null===(r=Bd[n])||void 0===r?void 0:r[Rd.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Id),Kd[Nd.INTRANET]=((Cd={})[Rd.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Cd[Rd.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Cd);var Hd;function Yd(){return"true"===Md("__BAILINGUAL_IN_CONTEXT__")}function Fd(){if(!(cd()||pd()||ld())){var e=Md("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){ad("[bailingual-sdk-glue] JSON.parse data fail: "+e)}Hd=Yd()&&t}}function jd(){return void 0===Hd&&Fd(),Hd}function Gd(){xd("__BAILINGUAL_IN_CONTEXT__","true"),Fd(),new Promise((function(e,t){if(cd()||pd()||ld())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return Ud("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function zd(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function Vd(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function Wd(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(ld())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(cd())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(pd())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(ud()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(cd()||pd()||ld()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(Yd()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void Gd();if("undefined"==typeof document)return;if(dd()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!jd()){if(7==++n)return Gd(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){xd("__BAILINGUAL_IN_CONTEXT__","false"),Fd()}))}catch(e){ad("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var qd=function(e){return e<10?"0"+e:""+e};function Jd(){var e=new Date;return e.getFullYear()+"-"+qd(e.getMonth()+1)+"-"+qd(e.getDate())+" "+qd(e.getHours())+":"+qd(e.getMinutes())+":"+qd(e.getSeconds())+":"+e.getMilliseconds()}function Qd(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function Zd(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",Jd(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Qd({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",Jd(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Qd({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts)})];break;case"US":i=["D-VM",Jd(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",Qd({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var Xd=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};Xd.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),ud()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},Xd.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=Zd(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});Wd(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},Xd.prototype.getRegion=function(){return this.region},Xd.prototype.setRegion=function(e){this.region=e,this.startTimer()},Xd.prototype.report=function(e){this.region&&this.queue.push(e)};var $d=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},ep={usageReportRegion:{configurable:!0}};$d.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},$d.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},$d.customizeStorage=function(e){return function(e){Td=e}(e)},$d.getDataFromStorage=function(e){return Md(e)},$d.setDataToStorage=function(e,t){return xd(e,t)},$d.customizeFetch=function(e){kd=e},ep.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},ep.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new Xd({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},$d.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||bd(this.canReadLocaleFromCookie))},$d.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},$d.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||bd(this.canReadLocaleFromCookie))},$d.prototype.getServerSideFallbackData=function(){if(hd()){var e=n.g.BAILINGUAL_FALLBACK;return e||(ad("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},$d.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new Xd({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Je()(e[n])){var r=_d(n);if(!r)return void sd("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=Od({},e[n]),t.i18nText[r]=Od({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&ad("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||sd("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},$d.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Md("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return sd("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Md("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return sd("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){Ld(Dc,e)&&(t.i18nText[e]||ad("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},Od(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=_d(e),Ld(Dc,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=_d(e),Ld(Dc,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{xd("BAILINGUAL_PATCH_I18N-"+e,""),xd("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){sd("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},$d.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Je()(document))||"object"!=("undefined"==typeof location?"undefined":Je()(location))||dd()||cd()||ld()||pd()||(Ad(),Ed("x-hng","lang="+e,{path:"/",expires:180}),Ed("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(fd,e))},$d.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r=t.id;this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var o=this.intlPDKVMessages[e][r];if(!o){var i=n[r];i.match(Oc)||(i=zd(this.appName,r,i)),o=this.createIntlMessageFormat(i,e),this.intlPDKVMessages[e][r]=o}return o},$d.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r=t.id,o=(null==n?void 0:n[r])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[r]){this.intlMessages[e]=this.intlMessages[e]||{};var i=this.intlMessages[e][r];return i||(i=this.createIntlMessageFormat(o,e),this.intlMessages[e][r]=i),i}return this.createIntlMessageFormat(o,e)},$d.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=jd()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return ad(s),ad("[bailingual-sdk-glue] error detail:",t),this.emit(vd,new Dd({code:yd.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){Ld(l,t)||o.emit(vd,new Dd({code:yd.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return ad(u),ad("[bailingual-sdk-glue] error detail:",n),this.emit(vd,new Dd({code:yd.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},$d.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=_d(r))||sd("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||sd("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},$d.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},$d.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=_d(e),Ld(this.availableLocales,e))return e},$d.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):sd("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},$d.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},$d.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&jd()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},$d.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(Oc)||(o=zd(t.appName,r,o)),n[r]=o})),n},$d.prototype.getDataWithLocale=function(e,t){e||ad("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[_d(e||this.defaultLocale)];return n&&t&&jd()?this.buildPDKVLocaleText(n):n},$d.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);sd("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},$d.prototype.getCurrentLocale=function(){return this.currentLocale||""},$d.prototype.getDefaultLocale=function(){return this.defaultLocale},$d.prototype.formatLocaleCode=function(e){return _d(e)},$d.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return sd('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(vd,new Dd({code:yd.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return sd("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(sd("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return Ud(function(e,t,n,r,o){var i,a;return null===(a=null===(i=Kd[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?Rd.DAILY:Rd.PROD,t.isIntranet?Nd.INTRANET:Nd.INTERNET,e.appName,e.tag,o)).then((function(e){return e?Ud(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Je()(e[t])){var r=_d(t);r&&(n[r]=n[r]||{},Od(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&ad("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!Ld(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=Od({},o,r)})),o.forEach((function(t){if(!Ld(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],Ld(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(xd("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),xd("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(sd("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},$d.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return Ld(Dc,e)}));return this.defaultLocale&&!Ld(t,this.defaultLocale)?(sd("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(md,e),this.currentLocale&&!Ld(t,this.currentLocale)&&(ad("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},$d.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},$d.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},$d.prototype.onDataChange=function(e){this.on(md,e)},$d.prototype.offDataChange=function(e){this.off(md,e)},$d.prototype.onLocaleChange=function(e){this.on(fd,e)},$d.prototype.offLocaleChange=function(e){this.off(fd,e)},$d.prototype.onError=function(e){this.on(vd,e)},$d.prototype.offError=function(e){this.off(vd,e)},$d.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},$d.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},$d.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},$d.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},$d.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},$d.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},$d.prototype.changeBizEnv=function(e){this.bizEnv=e},$d.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},$d.prototype.removeBailingualCookie=function(){Ad()},Object.defineProperties($d.prototype,ep),$d.customizedGetSystemLocale=void 0;var tp=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){Ld([Uc.argument,Uc.number,Uc.date,Uc.time,Uc.select,Uc.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t){return new rd(e,t,{},{ignoreTag:!0})},t}($d),np=(new tp,"antom-language-storage-key"),rp="antom_language_change_event",op="en_US",ip=new tp;function ap(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=lp(e);n&&(ip.getAllLocales().map(lp).includes(n)||(n=op),ip.changeLocale(n),cp(n),t?window.location.reload():window.dispatchEvent(new Event(rp)))}function sp(e){if(e)return lp(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(np)||window.localStorage.getItem(np);if(t)return lp(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=ip.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):lp(e)===lp(navigator.language)}))||op;if(r)return r=lp(r)}return op}function lp(e){var t=e;t||(t=op);var n=t.split(/[-,_]/),r=et(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function cp(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(np,e),window.sessionStorage.setItem(np,e),!0}catch(e){return!1}}"true"==={NODE_ENV:"production",PUBLIC_PATH:"/"}.ANTOM_CORE_UNIT_TEST&&ip.initData(window.bailingual_ckp||{});var up={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},dp=p(p({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),up);zs.initConfig({i18n:ip,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var pp=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomError"),l(Qe(e),"response",void 0),e}return f(n,null,[{key:"isError",value:function(e){return zs.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return zs.unificationError(e,t)}}]),n}(zs),hp=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomCoreError"),e}return f(n)}(pp),fp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0})}}:{success:function(){},error:function(){}}},mp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},vp=(window||{}).navigator,gp=vp.userAgent,yp=function(){var e=/OpenHarmony/i.test(vp.userAgent),t=/Phone/i.test(vp.userAgent),n=/Tablet/i.test(vp.userAgent);return e&&(t||n)},_p=/iPhone|iPad|iPod/i.test(gp)||"MacIntel"===vp.platform&&vp.maxTouchPoints>1,bp=/Android/i.test(gp),Ep=(/\bMacintosh\b/.test(gp),/Windows NT/.test(gp),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(gp)||yp()}),Sp=_p,Ap=bp,kp=!!Ep(),Tp=!Ep();yp();var wp=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},Pp=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return wp(n)}},Ip=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},Cp=function(e){return e.split("&&")[1]||"SG"},Rp=n(9414),Np=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},Dp={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Op="ANTOM_PAYMENT_WEB",Lp=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function Mp(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var xp=function(){function e(t){v(this,e),l(this,"baseUrl",void 0),l(this,"headers",void 0),l(this,"method",void 0),l(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return f(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:p(p({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===qe(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){Mp().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",p({instanceId:Lp},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:wp(t.data),headers:Up(t.headers)};n(o)}))}))}}]),e}();function Up(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var Bp=function(e){var t=Rp(e,"Result-Status")||Rp(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:up.API_NOT_LOGIN,errorMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:up.API_GATEWAY_TIMEOUT,errorMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=Rp(e,"Tips")||Rp(e,"tips","");return{success:!1,errorCode:up.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},Kp={};function Hp(e,t,n){return Yp.apply(this,arguments)}function Yp(){return(Yp=a(o().mark((function e(t,n,r){var i,a,s,l,c,u,d,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p(p(p({},Kp),r),{},{envInfo:p(p({},Kp.envInfo),null==r?void 0:r.envInfo),headers:p(p({},Kp.headers),null==r?void 0:r.headers)}),s=fp(a.tracker,a.scope),l=mp(a.tracker,a.scope),a.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:a.hostSign="SG";case 10:return"WAP"===(c=p(p({terminalType:kp?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:Np(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==a?void 0:a.envInfo),{},{locale:sp((null==a?void 0:a.locale)||(null==a||null===(i=a.envInfo)||void 0===i?void 0:i.locale))})).terminalType&&(c.osType=Sp?"IOS":"ANDROID"),u=[p(p({},n),{},{envInfo:c,extParams:p(p({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,h=Fp(t,a),e.next=18,h({data:u});case 18:if(f=e.sent,m=f.data,v=f.headers,g=m||{},y=Rp(v,"Mgw-TraceId")||Rp(v,"mgw-traceid",""),g.traceId=y,!(_=Bp(v))){e.next=29;break}throw b=_.errorMessage,E=_.errorCode,new hp(b,E,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(g.success){e.next=36;break}throw k=g.errorMessage||g.resultMessage||ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),T=g.errorCode||(null===(S=g.errorContext)||void 0===S||null===(S=S.errorStack)||void 0===S||null===(S=S[0])||void 0===S?void 0:S.errorName)||"API_SYSTEM_ERROR","true"!==(null===(A=g.extendInfo)||void 0===A?void 0:A.mulityLanguageMapping)&&(k=ip.get({id:"server.".concat(T),defaultMessage:ip.get({id:"event.callback.code.${errorCode}",defaultMessage:ip.get({id:"ckp.paymentError.${errorCode}",defaultMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(w=new pp(k,T,"SERVER_API","".concat(y," (").concat(t,")"))).response=g,w;case 36:return s.success(t,performance.now()-d,y),e.abrupt("return",g);case 40:if(e.prev=40,e.t0=e.catch(14),!hp.isError(e.t0)){e.next=45;break}return s.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 45:return I=e.t0,l(I),e.abrupt("return",Promise.reject(new hp(I.message,null!==(P=I.message)&&void 0!==P&&P.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 48:case"end":return e.stop()}}),e,null,[[14,40]])})))).apply(this,arguments)}function Fp(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||Dp[i],c=p(l(l(l(l(l(l(l(l({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||Op,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(Op.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"2.0.21"),null==t?void 0:t.headers);"dev"!==i&&delete c["sofa-group-name"],"sandbox"===i&&(c["load-test"]=!0,c.sofaPenAttrs="instMock=O&loadMode=2");var u,d=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,h=Object.entries(c).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==qe(e[1])})).reduce((function(e,t){var n=et(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),f={baseURL:s,timeout:d,headers:c},m=null;"app"===Kp.appType?m=new xp({baseURL:s,method:"POST",timeout:d,headers:h}):m=Si.create(p(p({},f),{},{withCredentials:null===(u=null==t?void 0:t.withCredentials)||void 0===u||u,method:(null==t?void 0:t.method)||"POST"}));return m.request}Hp.setGlobalOptions=function(e){Object.assign(Kp,e)};"".concat(window.location.origin,"/elements/src/pages");var jp=Pp,Gp=function(){try{return"undefined"!=typeof window&&"true"===window.localStorage.getItem("antom-web-checkout-v2_modern_web")}catch(e){return!1}},zp=function(e){var t;if(!e)return{modernWeb:!1};var n=jp(e),r=!(null==n||null===(t=n.flowSwitchTags)||void 0===t||!t.split(",").includes("elementV3"));return{modernWeb:r||Gp()}};var Vp=function(e){return zp(e).modernWeb},Wp=n(5225),qp=n.n(Wp),Jp=n(2242),Qp=n.n(Jp),Zp=n(8994);function Xp(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Zp.apply(void 0,[{},e].concat(n))}var $p=new zl({appId:"180020050100012557",performance:!1,error:!1,env:"PROD",compactExtraInfo:!0}),eh="7981",th=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){$p.log(p({code:"".concat(eh).concat(e)},t))}},nh=th(),rh=th("event"),oh=th("mount"),ih=th("handshake"),ah=th("merchant"),sh=th("element"),lh=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);"0.0.20260717033647-dev.2".replace(/-dev\.[0-9]+/,"");return(0,jl.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js","sdkDebugger").then((function(e){return e.variable}))},ch=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};nh({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=et(a,3),l=s[0],c=s[1],u=s[2];rh({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},uh=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=et(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(zs.isError(e)?e.toJSON():e);ch("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},dh=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKInternalError"),e}return f(n)}(zs),ph=function(e){y(n,e);var t=b(n);function n(e){return v(this,n),t.call(this,"HOST",e)}return f(n,[{key:"_transferReceivePort",value:function(e){Wp(Jp(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){Wp(Jp(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){Wp(Jp(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){Wp(Jp(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=Wp(Jp(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return Hl.getGlobalBridge("HOST")}}]),n}(Hl),hh=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),l(Qe(i),"name","MountError"),i}return f(n)}(dh),fh=function(e){return new dh("Element destroyed, previous status: ".concat(e),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE")},mh=function(){function e(t,n){v(this,e),l(this,"name",void 0),l(this,"_elementMode",void 0),l(this,"_isMainElement",void 0),l(this,"config",void 0),l(this,"bridge",void 0),l(this,"hooks",{}),l(this,"iframe",null),l(this,"status",void 0),l(this,"cachedSend",[]),l(this,"submitPromise",void 0),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new ph(t),this.bridge.setOrigin(n.targetOrigin),n.trackId&&$p.setTrackId(n.trackId),this.config.debug&&this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(gl)||e.type.endsWith(Ll)||(e.type.endsWith(Il)?ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))})),this.status="initialized"}var t,n,r,i,s;return f(e,[{key:"submit",value:function(e){throw new dh("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(s=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"_setup",value:(i=a(o().mark((function e(){var t,n,r,i,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=function(){return"destroyed"===s.status})()){e.next=3;break}return e.abrupt("return");case 3:return n=function(){},r=new Promise((function(e,t){n=s._addHook("ondestroy",(function(e){return t(fh(e))}))})),i=Promise.resolve().then(a(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.setup();case 4:return n=e.sent,e.abrupt("return",t()?void 0:n);case 6:case"end":return e.stop()}}),e)})))),e.prev=6,e.next=9,Promise.race([i,r]);case 9:return e.abrupt("return",e.sent);case 10:return e.prev=10,t()||n(),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[6,,10,13]])}))),function(){return i.apply(this,arguments)})},{key:"is",value:function(e){return this.name.startsWith(e.elementType)}},{key:"mount",value:(r=a(o().mark((function e(t){var n,r,i,a,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new hh({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),uh(n),n;case 4:return r=Date.now(),i=cl((function(){return Promise.all([s._setup(),s._mount(t)])}),15e3,new hh("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),a=dl((function(){oh({msg:s.name,d1:"用户退出页面",m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0})})),e.abrupt("return",i().then((function(e){var t=et(e,1)[0];ah({msg:s.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),oh({msg:s.name,d1:"挂载成功",m1:1,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),s.bridge.send(ml,Xp(s.config.appConfig,t||{}))})).catch((function(e){"destroyed"!==s.status&&s.unmount();var t=dh.unificationError(e);throw oh({msg:s.name,d1:"挂载失败",d2:t.code,d3:t.reason,m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),uh(t),t})).finally((function(){a()})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(o().mark((function e(r,i){var a,s,l,c,u,d,p,h,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",i(new hh({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",i(new hh("container missing","MOUNT_MISSING_CONTAINER")));case 5:a=n.config.appUrl,s=new URL(n.config.appUrl),l=[["origin",window.location.origin],["locale",n.config.locale]].concat(Xe(n.config.trackId?[["track_id",n.config.trackId]]:[]));try{l.forEach((function(e){var t=et(e,2),n=t[0],r=t[1];return s.searchParams.set(n,r)})),a=s.toString()}catch(e){c=a.includes("?")?"&":"?",u=l.map((function(e){var t=et(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),a="".concat(a).concat(c).concat(u)}(d=t.querySelector("#sdk-loading"))&&(d.style.display=""),n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=a,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.iframe.style.colorScheme=null!==(p=n.config.colorScheme)&&void 0!==p?p:"light dark",n.iframe.allow="payment",n.bridge.on(Ll,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),h=Date.now(),f=n._addHook("ondestroy",(function(e){i(fh(e))})),n.bridge.once(vl,(function(){var e;if(d&&(d.style.display="none"),"mounted"!==n.status&&"ready"!==n.status){if(null===(e=n.iframe)||void 0===e||!e.contentWindow)return r();ch("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",n.bridge.setTarget(n.iframe.contentWindow);var t=Date.now();n.bridge.once(wl,(function(e){n.status="ready",n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),ih({msg:n.name,d1:(null==e?void 0:e.version)||"未知版本",m1:Math.round(Date.now()-t),m2:1,m3:Math.round(Date.now()-h)})})),f(),r()}else f()})),n.iframe.onerror=function(e){i(new hh("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(2),i(new hh("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 24:case"end":return e.stop()}}),e,null,[[2,21]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:(t=a(o().mark((function e(t){var n,r,i,a=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"destroyed"!==this.status){e.next=3;break}throw new dh("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");case 3:if("ready"===this.status){e.next=5;break}throw new dh({message:"Element is { status }, it is not ready, cannot update config",params:{status:this.status}},"UPDATE_CONFIG_NOT_READY","SDK_USAGE");case 5:return this.config.appConfig=Xp(this.config.appConfig,t),ch("INFO","SDK_USAGE","Updating configuration via API",t),n=function(){},r=cl((function(){return new Promise((function(e){n=a.bridge.once(yl,(function(t){e(t)})),a.bridge.send(gl,{merged:a.config.appConfig,updated:t})}))}),3e3,new dh("Update config timeout","UPDATE_CONFIG_TIMEOUT","SYSTEM")),e.abrupt("return",r().catch((function(e){return n(),{error:dh.unificationError(e).toJSON()}})));case 12:return e.prev=12,e.t0=e.catch(0),i=dh.unificationError(e.t0),e.abrupt("return",Promise.resolve({error:i.toJSON()}));case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){"mounted"===this.status||"ready"===this.status?(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe))):ch("WARN","SDK_USAGE","element status is ".concat(this.status,", can not unmount, please check the usage. only mounted or ready status can unmount"))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):uh(new dh("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:function(e){var t=this;return"HOST"!==this.bridge.mode?Promise.reject(new Error("submit method only available in HOST mode")):(this.submitPromise||(this.submitPromise=new Promise((function(n){t.send(_l,e),t.bridge.once(bl,(function(e){n(e)}))})).finally((function(){t.submitPromise=void 0}))),this.submitPromise)}},{key:"destroy",value:function(){var e,t=this;if("destroyed"!==this.status){if(null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e(t.status)})),this.hooks={},this.bridge.destroy(),"mounted"===this.status||"ready"===this.status)this.unmount();else{var n,r=null===(n=this.iframe)||void 0===n?void 0:n.parentNode;r&&r.removeChild(this.iframe)}this.status="destroyed"}else ch("WARN","SDK_USAGE","element status is ".concat(this.status,", can not destroy, please check the usage. only mounted or ready status can destroy"))}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();l(mh,"elementType",void 0);var vh=function(e){y(n,e);var t=b(n);function n(e,r,o,i){return v(this,n),t.call(this,e,p(p({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return f(n,[{key:"_submit",value:function(e){return Wp(Jp(n.prototype),"_submit",this).call(this,e)}}]),n}(mh),gh=function(){function e(t){var n,r=this;v(this,e),l(this,"config",void 0),l(this,"isInit",!1),l(this,"version",void 0),l(this,"elementMode","SINGLE"),l(this,"_elements",new Map),l(this,"globalBridgeForWebApp",void 0),l(this,"globalBridgeForModal",void 0),l(this,"openModalHandle",void 0),l(this,"elementClasses",{}),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,eh=n);var i=this.globalBridgeForWebApp=ph.getGlobalBridge();i.on(Sl,function(){var e=a(o().mark((function e(t){var n,a,s,l,c,u,d,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=r._elements.get(t.scope))&&null!==(n=a.iframe)&&void 0!==n&&n.contentWindow){e.next=4;break}return ch("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available"),e.abrupt("return");case 4:(s=r.globalBridgeForModal=ph.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&ch("INFO","SDK_INTERNAL",e.type,e.payload)})),i.setTarget(a.iframe.contentWindow),e.prev=7,l=new URL(t.url),t.closeConfirm&&l.searchParams.append("confirm","true"),t.url=l.toString(),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(7),c=new dh("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),i.send(Al,c),e.abrupt("return");case 18:return u=new MessageChannel,d=t.modalId||ul("modal_"),e.next=22,r.openModal(p(p({},t),{},{onClose:function(){if(t.closeConfirm)return new pl(d,u.port2).close(!0)}}));case 22:h=r.openModalHandle=e.sent,i.send(Rl,d,[u.port1]),h.onLoadedSuccess((function(){s.setTarget(h.getContentWindow()),t.appearance&&s.send(Dl,t.appearance),t.initialData&&s.send(Ol,t.initialData),s.send(Nl,d,[u.port2])})),i.once(kl,(function(){h.destroy(),s.destroy()}));case 26:case"end":return e.stop()}}),e,null,[[7,13]])})));return function(t){return e.apply(this,arguments)}}()),i.on(El,function(){var e=a(o().mark((function e(t,n,i){var a,s,l,c,u,d,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null==i?void 0:i.source,l=Array.from(r._elements.values()).some((function(e){var t;return(null===(t=e.iframe)||void 0===t?void 0:t.contentWindow)===s})),c=(null===(a=r.openModalHandle)||void 0===a?void 0:a.getContentWindow())===s,!s||l||c){e.next=5;break}return e.abrupt("return");case 5:return u=t.url,d=t.mode,p=void 0===d?"redirect":d,h=t.destroy,(void 0===h||h)&&r.destroy(),e.prev=7,e.next=10,r.redirect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),"replace"===p?window.location.replace(u):"redirect"===p&&(window.location.href=u);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()),i.on(Ml,function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=r._elements.get(t.elementKey))?null==n||n.destroy():ch("WARN","SDK_INTERNAL","Element not found when destroy");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Il)?ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):e.type.endsWith(Al)?ch("ERROR","APP_RUNTIME","Open modal error",e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new dh("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new dh('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return f(e,[{key:"openModal",value:(n=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ch("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"redirect",value:function(e){throw ch("WARN","SDK_INTERNAL","Custom redirect was not implemented, and the default browser redirection method was used",e),new Error("REDIRECT_NOT_IMPLEMENTED")}},{key:"init",value:(t=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,lh().then((function(e){null==e||e.mount()})).catch((function(){var e=new dh("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");uh(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy()}},{key:"_generateElementKey",value:function(e,t){try{var n=this.generateElementKey(e,t);if(!n.startsWith(e))throw new dh("Generate element key error, must start with elementType","GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");return n}catch(n){var r=new dh({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw uh(r),r}}},{key:"_createElement",value:function(e,t){var n,r,o=this,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],sh({msg:e,m1:n?1:0}),!n){var a=new dh({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw uh(a),a}try{r=new n(i,p(p({},this.config),{},{elementMode:this.elementMode,appConfig:p({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=dh.isError(a)?a:new dh({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw uh(s),s}return r._addHook("ondestroy",(function(){o._removeElement(e,t),o._getElementSize()||ch("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,r,t),r}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new dh({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw uh(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),yh=function(e){y(r,e);var t,n=b(r);function r(e){var t;return v(this,r),t=n.call(this,e),l(Qe(t),"waitSendPort",[]),l(Qe(t),"mainElement",void 0),t.elementMode="GROUP",t}return f(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=Wp(Jp(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new dh("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw uh(i),i}this.mainElement=o;var a=new hl(e);o.on(wl,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort(Xe(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new fl(e,s.port1);o.on(wl,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=a(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new dh("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),uh(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(gh),_h=function(e){y(n,e);var t=b(n);function n(){return v(this,n),t.apply(this,arguments)}return f(n)}(gh),bh=(h()(h()(h()({},dp),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",UPDATE_CONFIG_TIMEOUT:"UPDATE_CONFIG_TIMEOUT",UPDATE_CONFIG_NOT_READY:"UPDATE_CONFIG_NOT_READY",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR",CHECKOUT_NOT_READY:"CHECKOUT_NOT_READY",PAYMENT_IN_PROGRESS:"PAYMENT_IN_PROGRESS",AMOUNT_VALUE_EMPTY:"AMOUNT_VALUE_EMPTY",AMOUNT_VALUE_INVALID:"AMOUNT_VALUE_INVALID"}),function(e){_()(n,e);var t=E()(n);function n(){var e;g()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),c()(Ze()(e),"name","AntomSDKError"),e}return m()(n)}(pp)),Eh={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#141935"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#070b29"},cherryBlossomPink:{theme:"light",backgroundColor:"#FFFCFD"}};function Sh(e,t){var n;if(!e)throw new bh("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");ch("INFO","SDK_USAGE","Setup called with sessionData:",{sessionData:e});var r=jp(e);if(!r)throw new bh("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");var o=null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene;if(t&&o!==t)throw new bh("Invalid productScene in sessionData, expected ".concat(t,", but get ").concat(o,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");return r}var Ah="ams-popup",kh=300,Th="ams-component-popup-loading",wh="\n .".concat(Ah,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ah,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ah,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ah,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(kh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ah,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(kh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ah,"-drawer-enter {\n animation: slideIn ").concat(kh,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ah,"-drawer-exit {\n animation: slideOut ").concat(kh,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),Ph=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(Th),n.id=Th,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Tp?t:100*n/e;return Math.min(r,t)}(),"px"),n};var Ih=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,a=void 0===o||o,l=e.hideCloseWhenLoaded,c=void 0===l||l,u=e.onClose,d=e.textDirection,p=void 0===d?"ltr":d,h=e.showLoading,f=void 0===h||h,m=document.createElement("div");m.classList.add("".concat(Ah,"overlay"),"".concat(Ah,"fadeIn"));var v=document.createElement("div");"desktop"===t?(v.classList.add("".concat(Ah,"modal"),"".concat(Ah,"fadeIn")),v.style.width="656px",v.style.height="620px",v.style.borderRadius="12px"):(v.classList.add("".concat(Ah,"modal-mobile"),"".concat(Ah,"-drawer-enter")),v.style.width="100%",v.style.height="80vh",v.style.borderRadius="12px 12px 0 0"),v.setAttribute("dir",p);var g=function(e,t,n){return function(){t&&(t.classList.remove("".concat(Ah,"fadeIn")),t.classList.add("".concat(Ah,"fadeOut")),"desktop"===e?(n.classList.remove("".concat(Ah,"fadeIn")),n.classList.add("".concat(Ah,"fadeOut"))):(n.classList.remove("".concat(Ah,"-drawer-enter")),n.classList.add("".concat(Ah,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),kh))}}(t,m,v),y=document.createElement("iframe");y.src=n,y.style.border="none",y.style.width="100%",y.style.height="100%";var _,b=r||{},E=b.theme,S=void 0===E?"light":E,A=b.backgroundColor,k=void 0===A?"#ffffff":A,T=Ph(S);if(y.addEventListener("load",(function e(){v.removeChild(T),y.removeEventListener("load",e)})),a){var w=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(_=!1,s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=2;break}return e.abrupt("return");case 2:return null===(t=T.parentNode)||void 0===t||t.removeChild(T),v.removeChild(y),n=Ph(S,ip.get({defaultMessage:"closing",id:"antom.common.closing"})),v.appendChild(n),_=!0,e.prev=7,e.next=10,null==u?void 0:u();case 10:return e.prev=10,_=!1,e.finish(10);case 13:g();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:p});c&&y.addEventListener("load",(function e(){v.removeChild(w),y.removeEventListener("load",e)})),v.appendChild(w)}if(f){v.style.backgroundColor=k,y.style.backgroundColor=k;y.addEventListener("load",(function e(){var t;null===(t=T.parentNode)||void 0===t||t.removeChild(T),y.removeEventListener("load",e)})),v.appendChild(T)}v.appendChild(y);var P,I=document.getElementsByTagName("body")[0];return(P=document.createElement("style")).innerHTML=wh,document.head.appendChild(P),I.appendChild(m),I.appendChild(v),{iframe:y,destroy:g}};function Ch(e){return Rh.apply(this,arguments)}function Rh(){return(Rh=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{error:void 0,data:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{error:bh.unificationError(e.t0).toJSON(),data:void 0});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function Nh(e,t){return Dh.apply(this,arguments)}function Dh(){return(Dh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oh(e,t){return Lh.apply(this,arguments)}function Lh(){return(Lh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpcashier.cashier.createApplePayPaymentSession",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mh(e,t){return xh.apply(this,arguments)}function xh(){return(xh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpfront.one.account.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Uh(e,t){return Bh.apply(this,arguments)}function Bh(){return(Bh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Kh="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",Hh=null;function Yh(){return Hh||(Hh=new Promise((function(e){if(Ap)return e(!1);if(window.ApplePaySession)return e(!0);var t=function(t){clearTimeout(n),t||(Hh=null),e(t)},n=setTimeout((function(){console.warn("[ApplePay] Apple Pay SDK load timed out, will retry on next call"),t(!1)}),1e4),r=document.querySelector('script[src="'.concat(Kh,'"]'));if(r)return window.ApplePaySession?void t(!0):(r.addEventListener("load",(function(){return t(!0)})),void r.addEventListener("error",(function(){return t(!1)})));var o=document.createElement("script");o.src=Kh,o.onload=function(){return t(!0)},o.onerror=function(){return t(!1)},document.head.appendChild(o)})),Hh)}function Fh(e){var t;if(!e)return null;var n,r=(null==e?void 0:e.paymentMethods)||[],o=d()(r);try{for(o.s();!(n=o.n()).done;){var i,a=n.value;if("APPLEPAY"===(null==a?void 0:a.paymentMethodType)||"APPLE_PAY"===(null==a?void 0:a.paymentMethodType))return(null==a||null===(i=a.paymentMethodDetail)||void 0===i||null===(i=i.applePayProps)||void 0===i?void 0:i.paymentRequest)||null}}catch(e){o.e(e)}finally{o.f()}return(null==e||null===(t=e.applePayProps)||void 0===t?void 0:t.paymentRequest)||null}var jh=function(){function e(t){g()(this,e),c()(this,"opts",void 0),c()(this,"session",null),c()(this,"settled",!1),c()(this,"phase","idle"),c()(this,"cancelReason",null),c()(this,"modalCloseHandler",null),c()(this,"_activePay",null),this.opts=t}var t,n;return m()(e,[{key:"startPay",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._activePay){e.next=2;break}return e.abrupt("return",this._activePay);case 2:return this._activePay=this._startPayInternal().finally((function(){t._activePay=null})),e.abrupt("return",this._activePay);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_startPayInternal",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,l,c,u=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.settled=!1,this.phase="idle",this.cancelReason=null,(a=this.opts.paymentRequest).version&&Array.isArray(a.supportedNetworks)&&0!==a.supportedNetworks.length&&Array.isArray(a.merchantCapabilities)&&0!==a.merchantCapabilities.length&&a.countryCode&&a.currencyCode&&null!==(t=a.total)&&void 0!==t&&t.label&&null!==(n=a.total)&&void 0!==n&&n.amount){e.next=8;break}throw console.warn("[ApplePay] Required Apple Pay fields are missing"),{errorCode:"APPLE_PAY_MISSING_DATA"};case 8:return e.next=10,Yh();case 10:if(l=e.sent,c=window.ApplePaySession,l&&c){e.next=16;break}throw console.warn("[ApplePay] Apple Pay SDK not available on host"),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 16:if(null!==(r=c.canMakePayments)&&void 0!==r&&r.call(c)&&null!==(o=c.supportsVersion)&&void 0!==o&&o.call(c,a.version)){e.next=20;break}throw console.warn("[ApplePay] canMakePayments=false (version=".concat(a.version,")")),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 20:e.prev=20,this.session=new c(a.version,this.buildSessionParams()),e.next=29;break;case 24:throw e.prev=24,e.t0=e.catch(20),console.warn("[ApplePay] ApplePaySession constructor failed:",e.t0),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 29:return e.abrupt("return",new Promise((function(e,t){var n=function(n){u.settled||(u.settled=!0,u.clearModalCloseListener(),n?t(n):e())};u.session.onvalidatemerchant=function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.phase="validating",e.prev=1,e.next=4,u.opts.callbacks.validateMerchant(null==t?void 0:t.validationURL);case 4:if(r=e.sent){e.next=7;break}throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 7:u.phase="validated",u.session.completeMerchantValidation(r),e.next=21;break;case 11:if(e.prev=11,e.t0=e.catch(1),u.phase="idle",!u.settled){e.next=17;break}return u.safeAbort(),e.abrupt("return");case 17:o=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] validateMerchant failed:",e.t0),n({errorCode:o}),u.safeAbort();case 21:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),u.session.onpaymentauthorized=function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.phase="authorizing",r=(null==t?void 0:t.payment)||{},o=r.token,a=r.billingContact,s=r.shippingContact,o){e.next=7;break}return u.safeComplete(c.STATUS_FAILURE),n({errorCode:"APPLE_PAY_TOKEN_ERROR"}),e.abrupt("return");case 7:return e.prev=7,e.next=10,u.opts.callbacks.onAuthorized({token:o,billingContact:a,shippingContact:s});case 10:(l=e.sent).success?(u.safeComplete(c.STATUS_SUCCESS),n()):("MERCHANT_CONFIRM_ABORT"===l.errorCode&&(u.cancelReason="MERCHANT_ABORT"),u.safeComplete(c.STATUS_FAILURE),d=l.errorCode||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",l.errorMessage&&console.warn("[ApplePay] onAuthorized returned failure:",l.errorMessage),n({errorCode:d})),e.next=20;break;case 14:e.prev=14,e.t0=e.catch(7),u.safeComplete(c.STATUS_FAILURE),p=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] onAuthorized threw:",e.t0),n({errorCode:p});case 20:case"end":return e.stop()}}),e,null,[[7,14]])})));return function(t){return e.apply(this,arguments)}}(),u.session.oncancel=function(){return"MERCHANT_ABORT"===u.cancelReason?(u.phase="idle",void n({errorCode:"MERCHANT_CONFIRM_ABORT"})):"validating"===u.phase?(u.phase="idle",void n({errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"})):(u.phase,u.phase="idle",void n({errorCode:"APPLE_PAY_CANCEL"}))};try{u.session.begin()}catch(e){return console.warn("[ApplePay] ApplePaySession.begin() failed:",e),void n({errorCode:"APPLE_PAY_NOT_SUPPORTED"})}u.opts.enableModalCloseListener&&u.attachModalCloseListener((function(){u.safeAbort(),n({errorCode:"APPLE_PAY_CANCEL"})}))})));case 30:case"end":return e.stop()}}),e,this,[[20,24]])}))),function(){return t.apply(this,arguments)})},{key:"buildSessionParams",value:function(){var e=this.opts.paymentRequest,t={countryCode:e.countryCode,currencyCode:e.currencyCode,merchantCapabilities:e.merchantCapabilities,supportedNetworks:e.supportedNetworks,requiredBillingContactFields:e.requiredBillingContactFields,requiredShippingContactFields:e.requiredShippingContactFields,total:e.total};return e.lineItems&&e.lineItems.length>0&&(t.lineItems=e.lineItems),e.recurringPaymentRequest&&(t.recurringPaymentRequest=e.recurringPaymentRequest),t}},{key:"safeAbort",value:function(){try{var e,t;null===(e=this.session)||void 0===e||null===(t=e.abort)||void 0===t||t.call(e)}catch(e){}}},{key:"safeComplete",value:function(e){try{var t,n;null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,e)}catch(e){}}},{key:"attachModalCloseListener",value:function(e){var t,n=document.querySelector("apple-pay-modal"),r=(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(".modal-close-button"))||null;if(r){var o=function(){e()};r.addEventListener("click",o,{once:!0}),this.modalCloseHandler={el:r,fn:o}}}},{key:"clearModalCloseListener",value:function(){this.modalCloseHandler&&(this.modalCloseHandler.el.removeEventListener("click",this.modalCloseHandler.fn),this.modalCloseHandler=null)}}]),e}(),Gh=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),zh=[{eventName:Gh.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:Gh.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],Vh=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),Wh=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Vh,document.head.appendChild(n),At();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,St(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),qh(e,t),o}},qh=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(Ee,"-btn-").concat(e,"' src=\"").concat(Le,'"/>'),i=document.createElement("div");i.classList.add("".concat(Ee,"-").concat(e),"".concat(Ee,"-hidden")),i.id=Ee,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Jh=function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(e.classList.remove("".concat(Ae,"-show")),e.classList.add("".concat(Ae,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Ae,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Oe))},Qh=function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Ae,"-hidden")),e.classList.add("".concat(Ae,"-show")))},Zh=function(){var e;null===(e=document.getElementById(Ae))||void 0===e||e.remove()},Xh=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Se,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),o.id=Se,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},$h=function(){var e=document.getElementById(ke);null==e||e.classList.add("".concat(ke,"-hidden"))},ef=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(ke);null==e||e.remove()},tf="\n .".concat(Re,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Re,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Re,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Re,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"-drawer-enter {\n animation: slideIn ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Re,"-drawer-exit {\n animation: slideOut ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),nf=function(){var e=document.createElement("style");e.innerHTML=tf,document.head.appendChild(e)};var rf="desktop",of=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{rf=t;var c=document.createElement("div");c.classList.add("".concat(Re,"overlay"),"".concat(Re,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(Re,"modal"),"".concat(Re,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(Re,"modal-mobile"),"".concat(Re,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Ne,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var f=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(f),d.addEventListener("load",(function(){u.removeChild(f)}))}u.appendChild(d);var m=document.getElementsByTagName("body")[0];m.appendChild(c),m.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},af=function(){var e=document.querySelector(".".concat(Re,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===rf?document.querySelector(".".concat(Re,"modal")):document.querySelector(".".concat(Re,"modal-mobile"));e.classList.remove("".concat(Re,"fadeIn")),e.classList.add("".concat(Re,"fadeOut")),"desktop"===rf?(t.classList.remove("".concat(Re,"fadeIn")),t.classList.add("".concat(Re,"fadeOut"))):(t.classList.remove("".concat(Re,"-drawer-enter")),t.classList.add("".concat(Re,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),Oe)}},sf=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e.NEW_ELEMENT_PAYMENT="/elements2/pages/element_payment/index.html",e}({}),lf=m()((function e(){g()(this,e),c()(this,"type",void 0),c()(this,"platform",void 0),c()(this,"isRetention",void 0),c()(this,"selector",void 0),c()(this,"appearance",void 0),c()(this,"appendAliasContainerId",void 0),c()(this,"merchantAppointParam",void 0),c()(this,"iframeStyle",void 0),c()(this,"notRedirectAfterComplete",void 0),this.platform=_t()?te.desktop:te.mobile,this.isRetention=!0,this.type=Y.popup,this.selector=""})),cf=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function uf(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==cf.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=xs(a),l=tt()(s,1)[0],c=xs(i),u=tt()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function df(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,u=e.locale,d=e.pageUrl,p=e.link,h=e.renderDisplayType,f=Ms(r),m=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",v=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",g=(null==r?void 0:r.extendInfo)||"",y=null==r?void 0:r.clientId,_=(o||"").split("&&")[1]||"",b=c()(c()(c()(c()(c()(c()({},U.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),U.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),U.SANDBOX,"https://checkout.antom.com"),U.PROD,"https://checkout.antom.com"),E=(null==a?void 0:a.toLocaleUpperCase())||U.DEV;p||(p="".concat(b[E]).concat(d));var S=Ea({renderDisplayType:null!=h?h:Y.inline,componentSign:f,analytics:l,productScene:v,productSceneVersion:m,environment:a,appVersion:s,extendInfo:g,locale:u,instanceId:i,hostSign:_,mid:y,elementLink:p}),A=S.path,k=S.locationSearch;return console.log("[debug] generateIframeSrc",A,k),"".concat(A,"?").concat(k)}function pf(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var hf=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},ff=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},mf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},vf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}},gf=function(){function e(t){g()(this,e),c()(this,"elementContainer",void 0),c()(this,"instanceId",void 0),c()(this,"options",void 0),c()(this,"obtainDataRes",void 0),c()(this,"elementUrl",void 0),c()(this,"eventCenter",void 0),c()(this,"eventListener",{}),this._setOptions(t)}return m()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(fe.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=Q.component),n.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=Z.proxy),t=bt()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(fe.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===ee.WAP&&(n.options.env.osType=mt?$.IOS:vt?$.ANDROID:$.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product,this.options.preview=null==e?void 0:e.preview}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),yf=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===G.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:h()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return df({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:sf.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}(gf),_f=yf,bf=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return df({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:sf.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}(gf),Ef=bf,Sf="#".concat(be,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(be,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Ce,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Ce,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Ce,"-desktop{}\n"),Af=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=Sf,document.head.appendChild(e)},kf=function(e,t,n){var r=document.createElement("div");r.id=Te,(null==n?void 0:n.componentSign)===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Ce,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Ce,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===te.mobile&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);St(0,o)},Tf=function(){function e(){g()(this,e),c()(this,"popupUrlQuery",void 0),c()(this,"popupApp",void 0)}var t;return m()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),a=!1,e.next=11,of({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,s=setTimeout((function(){if(!a)throw{title:"sdk_error_create_pop_up"}}),De),l=setTimeout((function(){if(!a)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){a=!0,clearTimeout(s),clearTimeout(l)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){af()}}]),e}(),wf=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"initMessageEvent",void 0),c()(this,"clearTimerIdMapping",{}),c()(this,"popupManager",void 0),c()(this,"eventCenter",void 0),c()(this,"logService",void 0),c()(this,"displayInfo",void 0),c()(this,"webApp",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"clientHeight",void 0),c()(this,"boundFocusResizeChange",void 0),c()(this,"customizedLoadingListener",void 0)}return m()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=$f.getInstance(t).getService("EventCenter"),this.logService=$f.getInstance(t).getService("Log"),this.popupManager=new Tf,Boolean(Object.keys(e).length)&&n.productScene===G.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Ne,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));It(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===Y.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;if(document.getElementById(Ie)||Af(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(ye,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):Wh(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===Y.inline?e.selector:ye,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(ye);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(ye,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===Y.inline)kf(e,t.platform);else{var n=document.getElementById(ke);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(Et(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(ye);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(ye,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(ve.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(ve.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(ve.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(ve.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(ve.sizeChanged.name,(function(t){e.handleSizeChanged(h()({},t))})),this.eventCenter.listen(ve.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(ve.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(ve.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(ve.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(ve.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(ve.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Se));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===Y.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(ye,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(ye,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===Y.inline)null===(l=document.getElementById(Te))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(Ee);e?null==t||t.classList.remove("".concat(Ee,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Ee,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Se);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Se,"-hidden")):null==t||t.classList.add("".concat(Se,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(Ee),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Se);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(Ee,"-light")),null==r||r.classList.add("".concat(Se,"-light"))):(null==n||n.setAttribute("src",Le),null==t||t.classList.remove("".concat(Ee,"-light")),null==r||r.classList.remove("".concat(Se,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(nf(),this.popupManager.popup(h()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:ve.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),Pf=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=If,this.debug=![X.prod,X.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Jt("AMSSDK_STORAGE_ID");r||Qt("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:_t()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?da.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=h()({},t),c=null==t?void 0:t.title;return ma[c]&&(l.title=ma[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:h()(h()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),If={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},Cf=function(e){return new URL(e.src).origin},Rf=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"iframes",void 0),c()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return m()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(ve.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(ve.beforeSubmit.name,(function(e){if(r.isExist(ve.beforeSubmit.name))r.emit(ve.beforeSubmit.name,e);else{var t=Fe();r.dispatchToApp({event:ve.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(ve.sendBroadcast.name,(function(e){r.dispatchToApp({event:ve.receiveBroadcast.name,data:e})})),r.listen(ve.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:ve.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(ve.submitForm.name),e.unlisten(ve.beforeSubmit.name),e.unlisten(ve.sendBroadcast.name),e.unlisten(ve.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:Cf(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===Cf(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&(null===(t=e.data)||void 0===t||!t.source||!["react-devtools-content-script","react-devtools-backend-manager","react-devtools-bridge"].includes(e.data.source)))if(ct(e.data)){var n=JSON.parse(e.data);if(n.context.event&&n.context.event,!this.checkEventCompliant(n))return;this._handleAppMessage(n)}else console.error(fe.NOT_JSON_FORMAT)}},{key:"checkEventCompliant",value:function(e){if(e.name!==ne.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=Fe()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:ne.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(h()(h()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),Nf=function(){function e(){g()(this,e),c()(this,"sandboxFlag",void 0),c()(this,"instanceId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){var r=bt()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[h()(h()({},t),{},{envInfo:r,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],a=Date.now(),s="",e.prev=4,l=this.createRequestInstance(n),e.next=8,l({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},s=Hi(d,"Mgw-TraceId")||Hi(d,"mgw-traceid",""),p.traceId=s||"",null==(f=Yi(d,s))||!f.errorCode){e.next=20;break}throw m=(null==p?void 0:p.errorMessage)||(null==f?void 0:f.errorMessage),v=null==f?void 0:f.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:v,errorMessage:m,traceId:s}),new Error(JSON.stringify({errorMessage:m,errorCode:v,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!0,code:"SUCCESS",errorMessage:"",traceId:s}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,traceId:s,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?oe.TIMEOUT:"",b=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:b,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:b,traceId:s,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=mt?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){$f.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Di(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Ni(null==e?void 0:e.hostSign,i)||Pi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Ci,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Ci.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Ri),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ii),"sdk-version",T||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Si.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),Df=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),Of={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},Lf=c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),Mf=function(e){return Lf[e]||""},xf=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},Uf=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||Of[Df.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=xf(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(Lf).includes(this.scene)||!Object.values(Of).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Bf=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"productScene",G.EASY_PAY),c()(this,"environment",void 0)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.logger=$f.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(a=s()(i()().mark((function e(){var t,n,r=this,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(s()(i()().mark((function o(){var a,s,l,c;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=Date.now(),s=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:s});case 4:if(l=o.sent,c="",!l){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,l.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,l.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,a);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"preInitSecurity",value:(o=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l=this,c=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!bn.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!bn.isLoading(o)){e.next=19;break}if(!(a=bn.get(o))||"loading"!==a.status){e.next=19;break}return e.prev=9,e.next=12,a.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),s=xf(this.environment),un.getInstance().scheduleLoad({environment:s,callbacks:{onLoad:function(e){l.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){l.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:l.productScene}).send()},onLoadTimeout:function(){l.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:l.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){l.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:l.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),l._newSecuritySDKByScene({product:l.productScene,region:t?Df.SG:void 0},(function(){l.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:l.productScene}:void 0).send(),e()}),(function(e){l.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:l.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||Mf(e)}},{key:"_getSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",bn.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||Mf(e.product),a=o.h5gateway||(r=e.region,Of[r]||Of[Df.SG]),s=bn.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new Uf({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){bn.setReady(i,l),t&&t(),e(l)}),(function(e){bn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));bn.setLoading(i,c)}catch(e){bn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),Kf=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Hf=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Yf=m()((function e(){g()(this,e)})),Ff=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g()(this,e),c()(this,"isDebug",!0),c()(this,"instanceId",void 0),c()(this,"logger",void 0),this.instanceId=t,this.logger=$f.getInstance(this.instanceId).getService("Log")}return m()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(Kf.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(Kf.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(Kf.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new Hf((function(e){r.traceLog(Kf.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(Kf.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=d()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(Kf.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,p=d()(e.interceptors);try{for(p.s();!(u=p.n()).done;){var h=u.value;null==h||h.onPublishException(t,n)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var f,m=!1,v=d()(e.interceptors);try{for(v.s();!(f=v.n()).done;){var g=f.value;m=m||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}m?this.publish(t,n):this.traceError(Kf.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(Kf.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(Kf.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(Kf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=d()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(Kf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();c()(Ff,"interceptors",[]),c()(Ff,"subscribersMap",new Map),c()(Ff,"TAG","BusManager"),c()(Ff,"_logSplit"," , ");var jf=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),Gf=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),zf=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Vf=function(e){return e.reportAnalytics="reportAnalytics",e}({});jf=function(e){return e.onDestory="httpRequest",e}(jf||{});var Wf=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),c()(Ze()(t),"logger",void 0),t.instanceId=e,t.logger=$f.getInstance(t.instanceId).getService("Log"),t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Vf)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Vf.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Yf),qf=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t;return g()(this,a),t=o.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return m()(a,[{key:"actionNames",value:function(){return Object.values(zf)}},{key:"preInitSecurity",value:(r=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=$f.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=$f.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=$f.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case zf.preInitSecurity:this.preInitSecurity(e,t);case zf.initSecurity:this.initSecurity(e,t);case zf.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),a}(Yf),Jf=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"instanceId",void 0),r.instanceId=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Gf)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=$f.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){$f.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),$f.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Gf.getGlobalData:this.getGlobalData(e,t);break;case Gf.setGlobalData:this.setGlobalData(e,t);break;case Gf.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Yf),Qf=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(jf)}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=$f.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=$f.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case jf.request:this.request(e,t);break;case jf.getEnvInfo:this.getEnvInfo(e,t);break;case jf.getUserAgent:this.getUserAgent(e,t)}}}]),r}(Yf),Zf=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"instanceId",void 0),c()(this,"busManager",void 0)}return m()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=$f.getInstance(this.instanceId).getService("Log"),this.busManager=new Ff(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==X.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new qf(this.instanceId)),this.busManager.subscribe(new Wf(this.instanceId)),this.busManager.subscribe(new Jf(this.instanceId)),this.busManager.subscribe(new Qf(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),Xf=function(){function e(){g()(this,e),c()(this,"globalData",new Map)}return m()(e,[{key:"init",value:function(e,t){var n=this,r=$f.getInstance(t).getService("EventCenter");r.listen(ve.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(ve.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),$f=function(){function e(t){g()(this,e),c()(this,"instanceId",void 0),c()(this,"services",{Log:new Pf,ApiBusManager:new Zf,Requester:new Nf,Container:new wf,Security:new Bf,EventCenter:new Rf,GlobalData:new Xf}),c()(this,"extendServices",{}),this.instanceId=t}return m()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();c()($f,"ProvidersMapping",{});var em={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},tm={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},nm={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},rm={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]};function om(e){"GOOGLEPAY"===e.paymentMethodType&&(e.paymentMethodDetail=h()(h()({},e.paymentMethodDetail),{},{googlePayProps:{environment:"TEST",existingPaymentMethodRequired:!0,paymentRequest:{allowedPaymentMethods:[{parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","JCB"]},tokenizationSpecification:{parameters:{protocolVersion:"ECv2",publicKey:"BDM6GVTLZmxSmTQzm04QKI2av54kFpkqjhbkejtdDUx+VMvUtJ6vc+ZlDp8TygNTf+QeihxpD869sCVWaa0KMJc="},type:"DIRECT"},type:"CARD"}],apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION"],merchantInfo:{merchantId:"123",merchantName:"merchantName"},shippingAddressRequired:!0,transactionInfo:{countryCode:"US",currencyCode:"EUR",totalPrice:"10",totalPriceStatus:"FINAL"}}}}))}var im,am=new va(ga,!0),sm=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},lm=function(e){_()(o,e);var t,n,r=E()(o);function o(){var e;g()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),c()(Ze()(e),"ApplePayService",void 0),c()(Ze()(e),"_onBeforeConfirm",null),c()(Ze()(e),"_merchantAmount",null),c()(Ze()(e),"_merchantCurrency",null),e}return m()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a,s,l=this.elementContainer.getPaymentContext();if(this.getLogger().logInfo({title:"sdk_event_renderComponent"}),"mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)){var c,u,d,p,h=(null==e||null===(c=e.originActionQueryResult)||void 0===c?void 0:c.paymentMethods)||[],f=(null==e||null===(u=e.originActionQueryResult)||void 0===u?void 0:u.savedPaymentMethods)||[];if(!(1!==h.length||0!==f.length||null!==(d=h[0])&&void 0!==d&&null!==(d=d.paymentElements)&&void 0!==d&&d.length||["APPLEPAY","GOOGLEPAY"].includes(null===(p=h[0])||void 0===p?void 0:p.paymentMethodType)))return}var m,v=null==l||null===(n=l.displayInfo)||void 0===n?void 0:n.appearance;if("string"==typeof(null==v?void 0:v.theme)&&v.theme.startsWith("APR_")){var g,y,_=null==e||null===(g=e.originActionQueryResult)||void 0===g||null===(g=g.pageStyle)||void 0===g?void 0:g.elementSettings;m="string"==typeof _?null===(y=vf(_))||void 0===y?void 0:y.appearance:null==_?void 0:_.appearance}else m=v;this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==l?void 0:l.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(o=this.elementContainer)||void 0===o?void 0:o.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(i=this.elementContainer)||void 0===i?void 0:i.getPaymentContext().paymentSessionId,merchantId:null===(a=this.elementContainer)||void 0===a||null===(a=a.getPaymentContext())||void 0===a||null===(a=a.paymentSessionObj)||void 0===a?void 0:a.clientId,paymentMethodType:null===(s=this.elementContainer)||void 0===s||null===(s=s.getPaymentContext())||void 0===s||null===(s=s.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType},appearance:m,sessionResult:null==l?void 0:l.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return $f.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(ve.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(ve.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:ve.closePaymentPolling.name,data:t})})),this.eventCenter.listen(ve.getGooglePayToken.name,(function(t,n){Da(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:h()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(ve.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new Oa({paymentSessionData:i,parseData:o,logger:am,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(ve.beforeConfirm.name,s()(i()().mark((function t(){var n,r,o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return am.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return am.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,Pa((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,a=o.result,s=o.timedOut,l=a,(c=s||Date.now()-r>=Aa)&&(am.logError({title:"sdk_before_confirm_timeout"}),l=!1),am.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:l}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:h()({success:!0,result:!!l},c?{isTimeout:!0}:{})}),t.next=24;break;case 20:t.prev=20,t.t0=t.catch(6),am.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!1,result:!1}});case 24:case"end":return t.stop()}}),t,null,[[6,20]])}))))}},{key:"initApplePaySdk",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new Oa({paymentSessionData:o,parseData:r,logger:am,env:this.options.env.environment}),e.prev=3,am.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:am.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),am.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t,n=e.link,r=e.instanceId;this.instanceId=r;var o=this.elementContainer.getPaymentContext()||{},i=o.paymentSession,a=o.paymentSessionObj,s=o.sdkMetaData,l=this.options,c=l.env.environment,u=l.analytics,d=l.locale,p=(a||{}).extendInfo,h="mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)?Y.popup:Y.inline,f=df({paymentSession:i,paymentSessionObj:a,environment:c,analytics:u,locale:d,link:n,appVersion:null==s?void 0:s.webAppVersion,pageUrl:sm(p)?sf.EXPRESS_CHECKOUT:sf.ELEMENT_PAYMENT,instanceId:r,renderDisplayType:h});return this.setElementUrl(f),f}},{key:"obtainData",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=$f.getInstance(this.instanceId).getService("Requester"),o=this.elementContainer.getPaymentContext(),a=o.paymentSession,s=o.paymentSessionObj,l=o.displayInfo,c=l.debugProps,u=this.options,d=u.env.environment,p=u.locale,h=(s||{}).paymentSessionConfig,f=a.split("&&")[1]||"",m=null==s||null===(t=s.connectFactor)||void 0===t?void 0:t.enableConnect,v=(null==c?void 0:c.isDebug)&&(null==c?void 0:c.local_mock),g=null===(n=this.options)||void 0===n?void 0:n.preview,y=!0===g||"web"===g||"mobile"===g,_=v||y,b=bt(this.getElementUrl()),E=b.appType,S=hf()?"WEB":E?"APP":ff()?"WEB":"WAP",A=function(){return new Promise((function(e,t){var n;if(_)setTimeout((function(){if(y){var t=C.buildPreviewMockData(em);e(t)}else e(em)}),100);else{C.getLogger().logInfo({title:"sdk_action_query_start"},{config:mf(h)});var o={paymentSessionConfig:h,paymentSessionData:a,extParams:{isUserPreferredLocale:!0}},i=null==l?void 0:l.appearance;"string"==typeof(null==i?void 0:i.theme)&&i.theme.startsWith("APR_")&&(o.appearanceId=i.theme),null!=l&&null!==(n=l.merchantAppointParam)&&void 0!==n&&n.storedCard&&(o.merchantAppointParam=l.merchantAppointParam),Object.prototype.hasOwnProperty.call(l,"notRedirectAfterComplete")&&(o.notRedirectAfterComplete=l.notRedirectAfterComplete),r.request(o,{env:d,envInfo:{locale:p,terminalType:S},hostSign:f,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?C.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:mf(h),rpcTraceId:null==t?void 0:t.traceId}):C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:mf(h),errorMessage:mf((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:mf(h),errorMessage:mf(e)})}))}}))},k=function(){return new Promise((function(e,t){_?setTimeout((function(){e(tm)}),100):r.request({paymentSessionConfig:h,paymentSessionData:a,accountInfo:{email:""}},{env:d,envInfo:{locale:p,terminalType:S},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=18,Promise.all(m?[A(),k()]:[A()]);case 18:return T=e.sent,w=tt()(T,2),P=w[0],I=w[1],this.obtainDataRes={originActionQueryResult:P,originOneAccountQueryResult:I},e.abrupt("return",{originActionQueryResult:P,originOneAccountQueryResult:I});case 24:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"buildPreviewMockData",value:function(e){var t=this.elementContainer.getPaymentContext().displayInfo,n=null==t?void 0:t.previewPaymentMethods,r=JSON.parse(JSON.stringify(e)),o=function(e){if(!e)return[];var t=e.expressCheckout,n=e.supportedMethods,r=e.topping,o=((null==t?void 0:t.methods)||[]).map((function(e){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,expressCheckout:!0};return om(t),t})),i=[];(n||[]).forEach((function(e){if("CARD"!==e.paymentMethodName){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,icon:e.logoUrl,recommend:!1};t.paymentMethodType===r&&(t.recommend=!0),om(t),function(e){"ONLINEBANKING_YAPILY"===e.paymentMethodType&&(e.paymentElements=[])}(t),i.push(t)}}));var a=function(){var e=-1,t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n,r){"CARD"===n.paymentMethodName&&(t.push({cardBrand:n.paymentMethodType,logoUrl:n.logoUrl||""}),-1===e&&(e=r))})),t.length?{firstCardIndex:e,cardPaymentMethod:{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,logoList:t,paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"}}:null}(n);return a&&i.splice(a.firstCardIndex,0,a.cardPaymentMethod),[].concat($e()(o),i)}(n);return r.paymentMethods=o,r}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}(gf),cm=lm;function um(){try{var e=Jt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=Fe(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return Qt("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function dm(e){return dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dm(e)}function pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pm(Object(n),!0).forEach((function(t){fm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fm(e,t,n){return(t=vm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vm(r.key),r)}}function vm(e){var t=function(e,t){if("object"!==dm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==dm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===dm(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(im||(im={}));var gm=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=hm(hm({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:im.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&ks(o)?(this.options.link=ms(o,i),this.handleLink()):n&&!ks(n)?(this.options.scheme=ms(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=im.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;ss?is()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=im.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(vs(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=im.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(ss?this.handleIOSScheme():ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;is()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(vs(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&mm(t.prototype,n),r&&mm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),ym=gm,_m=function(e,t){var n=$f.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},h()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new ym({successCb:function(){bm(e,se.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){Em(e,se.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===re.BLANK)return e.url?(bm(e,se.NormalUrl,e.url,n),void window.open(e.url)):Em(e,se.NormalUrl,"",n);if(!(e.browserLinkTarget!==re.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?(bm(e,se.NormalUrl,e.url,n),void window.location.replace(e.url)):Em(e,se.NormalUrl,"",n);if(_t())return e.url?(bm(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):Em(e,se.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?(bm(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):Em(e,se.NormalUrl,"",n);var o=new ym({successCb:function(t){var r="Scheme"==t.type?se.SchemeUrl:se.ApplinkUrl;bm(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(Em(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return Em(e,se.NormalUrl,"",n);bm(e,se.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(Em(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return Em(e,se.NormalUrl,"",n);bm(e,se.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){Em(e,se.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){Em(e,se.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},bm=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},Em=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},Sm=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function Am(e,t){for(var n,r=e||window.navigator.userAgent||"",o=Sm,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(km(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(km(t,r,n.iosScheme),n.iosScheme):void 0;km(t,r,"")}function km(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var Tm=function(){function e(){g()(this,e),c()(this,"bizFlowStartBehavior",void 0),c()(this,"initOptions",void 0),c()(this,"paymentContext",void 0),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"productProcessors",{}),c()(this,"enablePopWindowEventCallback",!1),c()(this,"eventLogging",void 0),c()(this,"status",cf.UNINIT),c()(this,"logger",void 0),this.status=cf.INITING}var t;return m()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=on(e),n=t.id,r=t.data;this.paymentContext=h()(h()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=Fe(),this.sdkMetaData={webAppVersion:"",greyscaleId:um(),productScene:t,sdkVersion:T},this.sdkMetaData.webAppVersion=an(this.sdkMetaData),$f.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=$f.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=$f.getInstance(this.instanceId).getService("EventCenter");r.listen(ve.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};_m(a,n.instanceId),i&&n.cleanRender()}})),r.listen(ve.initSecuritySDK.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=$f.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,s.initSecurity();case 4:l=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),l=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{success:l}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getDeviceId.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=$f.getInstance(n.instanceId).getService("Security"),e.next=3,s.getDeviceId(t);case 3:l=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{deviceId:l}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getSdkVersion.name,function(){var e=s()(i()().mark((function e(n,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.destroy.name,(function(e){n.setStatus(cf.READY),n.destroy()})),r.listen(ve.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(ve.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(ve.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(ve.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(ve.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(cf.IN_BIZ_FLOW),a=t.paymentSession,s=t.displayInfo,l=on(a),c=l.id,u=l.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:a,paymentSessionId:c,paymentSessionObj:u,displayInfo:h()(h()({},new lf),s),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Ut(this.paymentContext.paymentSessionObj.extendInfo),f=an(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=f,$f.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),i=this.sdkMetaData,Qt("Antom_".concat(i.sdkVersion+i.productScene,"_LastAppVersion"),""),m=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,v=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(m,"|").concat(v)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(m,"|").concat(v)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(m)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(m)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=$f.getInstance(this.instanceId).getService("EventCenter"),b={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(ve.eventCallback.name,{code:ae.SDK_REDIRECT,result:{redirectUrls:b}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((E=new URL(y.url)).searchParams.set("source","embedded"),y.url=E.toString()),_m(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var i}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return $f.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=$f.getInstance(this.instanceId).getService("EventCenter"),n=$f.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==Y.inline&&(e.paymentContext.displayInfo.isRetention?Qh():e.handleClose(t,"behavior"))};t.listen(ve.close.name,(function(){a(!0)})),t.listen(ve.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(ve.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(Ae,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(Ae,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,f,m,v=document.getElementById("".concat(Ae,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg):v.style.backgroundColor=null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg);var g,y,_,b,E,S,A,k=document.getElementById("".concat(Ae,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.corner,"px"),"stroke"===(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.type)?k.style.border="1px solid ".concat(null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg):k.style.backgroundColor=null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===Y.inline?(n.showLoading(s,this.paymentContext.displayInfo),void nf()):r==Y.popup?(function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Ae,o.classList.add("".concat(Ae,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Ae,'-title" class="').concat(Ae,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Ae,'-sub-title"\n class="').concat(Ae,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Ae,"-btn-block-").concat(e,'">\n <div id="').concat(Ae,'-remain" class="').concat(Ae,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Ae,'-leave" class="').concat(Ae,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Ae,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){Jh(),e.handleRemain()}),(function(){Jh(),e.handleClose(!1,"retention")})),Xh({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:he.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=$f.getInstance(this.instanceId).getService("EventCenter");if(n.emit(ve.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?he.OnlyClose:he.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(ve.eventCallback.name,{code:ae.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=$f.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),ef(),Zh()};null===(e=document.getElementById(Se))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),o.startHideAnim(),$h(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),wm=function(){function e(){g()(this,e)}return m()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),Pm=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),Im=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;g()(this,e),c()(this,"containerStatus",void 0),c()(this,"instanceId",void 0),c()(this,"containerService",void 0),c()(this,"eventService",void 0),c()(this,"containerElement",void 0),c()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(Pm.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=$f.getInstance(this.instanceId).getService("Container"),$f.getInstance(this.instanceId).init({},{productScene:G.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var u=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:Y.inline,platform:hf()||ff()?te.desktop:te.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Ne}},s.generateIframeSrc({link:u,instanceId:this.instanceId})),this.eventService=$f.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return m()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(ve.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(ve.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),Cm=function(){function e(t){var n=t.instanceId;g()(this,e),c()(this,"containerServices",void 0),c()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return m()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new Im({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),Rm=function(){function e(t){var n=t.logger;g()(this,e),c()(this,"activeEvents",new Map),c()(this,"heartbeatIntervalId",null),c()(this,"HEARTBEAT_INTERVAL",5e3),c()(this,"uniqueId",0),c()(this,"logger",void 0),this.logger=n}return m()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==at(t)&&this.sendLog("data_error",{msg:mf(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=tt()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:mf(e)})}},{key:"sendLog",value:function(e,t){var n=c()(c()(c()(c()(c()(c()(c()(c()(c()(c()({},"".concat(K.MOUNT,"_start"),"sdk_event_mount"),"".concat(K.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(K.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(K.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(K.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(K.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(K.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(K.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},h()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),Nm=["type"],Dm=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"elementContainer",void 0),c()(this,"serviceMap",void 0),c()(this,"loading",void 0),c()(this,"elementProcessors",void 0),c()(this,"initTimeout",void 0),c()(this,"elementContainerService",void 0),c()(this,"onStatusChangeCallback",void 0),c()(this,"submitPayPromise",void 0),c()(this,"elementEventCenter",void 0),c()(this,"currentPaymentMethodType",""),c()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:C.VALIDATE,data:{params:{},target:t,source:R.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),c()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:C.SUBMIT_PAY,data:{params:h()(h()({},n),{},{doMain:window.location.hostname}),target:t,source:R.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new Tm,this.elementContainer.registerProcessor(G.ELEMENT_PAYMENT,"",new wm),this.elementContainer.init(this.options,G.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new Cm({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(cf.READY),this.elementEventCenter=new Rm({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return m()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new Ef(this.options),address:new _f(this.options),payment:new cm(this.options)};this.elementProcessors=h()(h()({},this.elementProcessors),{},c()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:mf(r||""),eventMessage:mf(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(cf.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:x.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:fe.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){var r,o;this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var i=this.elementContainerService.getContainerService(e).getInstanceId(),a=this.elementContainer.getPaymentContext();$f.getInstance(i).update(a),this.serviceMap.Log=$f.getInstance(i).getService("Log"),null===(r=this.serviceMap.Log)||void 0===r||r.logInfo({title:"sdk_event_appearance"},{variables:!(null==n||null===(o=n.appearance)||void 0===o||!o.variables),theme:null==n?void 0:n.theme}),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:h()(h()({},fe.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:x.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=on(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(K.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===cf.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:fe.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===cf.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:fe.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:fe.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:mf(e)}),r(h()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:h()(h()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(cf.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=s()(i()().mark((function e(){var t,n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(K.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[N.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[N.payment].eventCenter,R.PAYMENT_ELEMENT);case 7:return a=e.sent,n=null!==(o=a.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(K.SUBMITPAYMENT),this.elementContainer.getStatus()===cf.IN_BIZ_FLOW){e.next=6;break}return r={error:h()(h()({},fe.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:D.FAIL},o={eventCode:D.FAIL,errorName:fe.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:mf(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),a="APPLEPAY"===this.currentPaymentMethodType,l=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||a){e.next=40;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.prev=11,c=Date.now(),e.next=15,Pa((function(){return t.onBeforeConfirm()}));case 15:if(u=e.sent,d=u.result,!(u.timedOut||Date.now()-c>=Aa)){e.next=24;break}return this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:Ta}),e.abrupt("return",{status:D.FAIL,error:{code:Ta,message:"Merchant confirmation timed out.",needChangeSessionForRetry:!1}});case 24:if(d){e.next=29;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:ka}),e.abrupt("return",{status:D.FAIL,error:{code:ka,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 29:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.next=38;break;case 32:return e.prev=32,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:l,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:ka}),e.abrupt("return",{status:D.FAIL,error:{code:ka,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 38:e.next=41;break;case 40:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:l,path:a?"applePay_eventBridge":"nonApplePay_sync"});case 41:return p=null,e.prev=42,e.next=45,new Promise(function(){var e=s()(i()().mark((function e(n){var r,o,l,c,u,d,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[N.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(p=e)},r=b,e.prev=2,b.submitPayPromise=o,l={},c=function(){var e=s()(i()().mark((function e(t,n){var r,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,b.onValidateAndSubmitPay(b.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,a=r.data,l.shipping=null==a?void 0:a.data,null!=a&&a.success){e.next=11;break}return o(p=a),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,c(N.auth,R.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,c(N.address,R.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!b.elementProcessors[N.payment]){e.next=28;break}return u=a&&!(null==t||!t.onBeforeConfirm),b.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:mf({hasBeforeConfirmForApplePay:u,isApplePay:a,amount:"".concat(null==t?void 0:t.amount,", ").concat(null==t?void 0:t.currency)})}),b.elementProcessors[N.payment].setOnBeforeConfirm(u?t.onBeforeConfirm:null),d=!(null==t||!t.amount),f=!(null==t||!t.currency),!d&&!f||d&&f||b.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:mf({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),b.elementProcessors[N.payment].setMerchantAmountOverride(d&&f?t.amount:null,d&&f?t.currency:null),e.next=24,b.onValidateAndSubmitPay(b.elementProcessors[N.payment].eventCenter,R.PAYMENT_ELEMENT,(_=void 0,h()(h()(h()({},l),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&f?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:u})));case 24:m=e.sent,v=m.data,o(p=v);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:h()(h()({},fe.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:D.FAIL},b.serviceMap.Log.logError({title:fa.sdk_element_missKeyData},{msg:JSON.stringify(y)}),p=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 45:return e.abrupt("return",e.sent);case 46:return e.prev=46,_={eventCode:null===(f=p)||void 0===f?void 0:f.status,errorName:null===(m=p)||void 0===m||null===(m=m.error)||void 0===m?void 0:m.code,errormessage:null===(v=p)||void 0===v||null===(v=v.error)||void 0===v?void 0:v.message,needChangeSessionForRetry:null===(g=p)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.needChangeSessionForRetry,rpcTraceId:null===(y=p)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.traceId,msg:mf(p)},this.elementEventCenter.endEvent(n,_),this.changeLoading(!1),e.finish(46);case 51:case"end":return e.stop()}}),e,this,[[11,32],[42,,46,51]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(C.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(ve.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(Pm.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===re.BLANK)return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(se.NormalUrl,"");if(!(a.target!==re.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(se.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;pf({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(se.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(se.SchemeUrl,a.schemeUrl,e)}))}else pf({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(se.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(se.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(ve.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(cf.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(ve.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(Pm.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=h()(h()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(ve.messageForward.name,(function(e){var n=O[e.source],r=O[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(ve.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(H.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=Fl()(t,Nm),e.prev=1,a=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:fe.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([a.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:s=e.sent,(l=tt()(s,2))[0],c=l[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==a||a.switchContainerStatus(Pm.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:h()(h()({},fe.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,f=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&f&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||fe.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=h()({},fe.ERR_DATA_STRUCT_UNRECOGNIZED)),Me[o])a={code:Me[o].code,message:(null===(t=Me[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:fa.sdk_element_missKeyData},{rpcTraceId:r});return{error:h()(h()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,f;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return $e()(e.values()).every((function(e){return e.getContainerStatus()===Pm.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[N.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===G.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=h()(h()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(r){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(uf({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(N.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[N.payment].obtainData();case 6:a=e.sent,s=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:s?nm:a.originActionQueryResult,originOneAccountQueryResult:s?rm:a.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(ve.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),ef(),Zh();try{af()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(K.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(cf.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=on(this.options.sessionData).data,r="true"===(null===(t=vf(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout)?Gh.EXPRESS_CHECKOUT:Gh.ELEMENT_PAYMENT,o=zh.find((function(e){return e.eventName===r}));return void 0!==o&&o.supportedEvents.includes(e)}}]),e}(),Om=Dm;function Lm(e){return{status:e.status||"FAIL",error:e.error?{code:e.error.code,message:e.error.message,needChangeSessionForRetry:e.error.needChangeSessionForRetry}:void 0,userCanceled3D:e.userCanceled3D,session:e.paymentSession?{nextAction:{applinkUrl:e.paymentSession.returnAppUrl,normalUrl:e.paymentSession.returnUrl,schemeUrl:e.paymentSession.returnAppScheme}}:void 0}}function Mm(e,t){var n,r,o,i={showCardCVV:!(null==t||null===(n=t.storedCard)||void 0===n||!n.needCVV),showPaymentMethodListWhenSingleOption:"list"===(null==t?void 0:t.singleOption)};if(!e)return t?{displaySetting:i}:void 0;var a,s={};if(e.theme&&(s.theme=e.theme),e.variables&&"object"===Je()(e.variables)){var l=h()({},e.variables);Object.keys(l).length>0&&(s.variables=l)}(s.displaySetting=h()(h()({showCardBrandIcon:!(null===(r=e.card)||void 0===r||!r.showBrandIcon)},i),{},{showRadioWhenAccordionLayout:!(null===(o=e.accordion)||void 0===o||!o.showRadio)}),e.layout)&&(s.layout=(null===(a=e.layout.type)||void 0===a?void 0:a.toLowerCase())||"accordion");return s}var xm=["onStatusChange"],Um=["onBeforeConfirm"],Bm="7982",Km=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r="".concat(Bm).concat("error"===e?"":e);Vl.log(h()({code:r,msg:t},n))}catch(e){}},Hm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Km("mount",e,t)},Ym=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Km("handshake",e,t)},Fm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Km("element",e,t)},jm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Km("error",e,t)},Gm=function(e){var t=null==e?void 0:e.response;if(!1===(null==t?void 0:t.success))return t;throw e},zm=16e3,Vm=new va(ga,!0),Wm="Element already destroyed",qm=function(){return{code:fe.UI_STATE_ERROR.code,message:Wm}},Jm=function(e){_()(n,e);var t=E()(n);function n(e,r){return g()(this,n),t.call(this,e,r)}return m()(n,[{key:"setTarget",value:function(e){qp()(Qp()(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=qp()(Qp()(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(e){return qp()(Qp()(n),"getGlobalBridge",this).call(this,e)}}]),n}(Hl),Qm="OPENSDK@VALIDATE",Zm="OPENSDK@VALIDATE_REPLY",Xm="OPENSDK@GET_APPLE_PAY_TOKEN",$m="OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",ev="OPENSDK@GET_GOOGLE_PAY_TOKEN",tv="OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY",nv="OPENSDK@HANDLE_PAYMENT",rv="OPENSDK@BEFORE_CONFIRM",ov="OPENSDK@BEFORE_CONFIRM_REPLY",iv="paymentMethodChanged",av=function(){function e(t){var n=t.onStatusChange,r=Fl()(t,xm);if(g()(this,e),c()(this,"options",void 0),c()(this,"onStatusChange",void 0),c()(this,"scopeId","payment_".concat(Fe().replace(/-/g,"").slice(0,6))),c()(this,"bridge",void 0),c()(this,"iframe",null),c()(this,"status","initialized"),c()(this,"cachedSend",[]),c()(this,"modalBridge",null),c()(this,"modalDestroy",null),c()(this,"modalIframe",null),c()(this,"_closeConfirmResolve",null),c()(this,"notRedirectAfterComplete",!1),c()(this,"_sdkInitTime",Date.now()),c()(this,"_mountStartTime",0),c()(this,"destroyCallbacks",[]),c()(this,"_merchantAmount",null),c()(this,"_merchantCurrency",null),c()(this,"currentPaymentMethodType",""),c()(this,"isSubmitting",!1),this.options=r,this.onStatusChange=n,r.sessionData){var o=Ip(r.sessionData);Vl.setTrackId(o)}this.bridge=new Jm("HOST",this.scopeId),this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(gl)||e.type.endsWith(Ll)||(e.type.endsWith(Il)?ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))}))}var t,n,r,o,a,l;return m()(e,[{key:"mount",value:(l=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Hm("mount_start",{d1:n,d2:this.options.sessionData?"has_session":"no_session"}),a=document.querySelector(n)){e.next=6;break}return jm("selector_not_found",{d1:n}),null===(s=this.options)||void 0===s||null===(l=s.onEventCallback)||void 0===l||l.call(s,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Element with selector ".concat(n," not found.")}),e.abrupt("return",{error:{code:"PARAM_INVALID",message:"selector not found"}});case 6:return null===(r=this.options.loading)||void 0===r||null===(o=r.onStartLoading)||void 0===o||o.call(r),this.setStatus("mounting"),e.prev=8,d=this.buildIframeUrl(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.height="0",this.iframe.style.transition="height 0.3s ease",this.iframe.allow="payment",this.bridge.setOrigin("https://checkout.antom.com"),this.bindBridgeEvents(),p=this.waitForReadyHandshake(),this.iframe.src=d,a.appendChild(this.iframe),Hm("iframe_loaded",{d1:d}),e.next=24,Promise.all([this.setup(t),p]);case 24:if(h=e.sent,f=tt()(h,1),m=f[0],"destroyed"!==this.status){e.next=29;break}throw qm();case 29:return(v=this.validateRenderData(m.renderData,m.renderDataError))&&(m.renderDataError=v,jm("render_data_invalid",{d1:v.code,d2:v.reason})),this.setStatus("mounted"),this.sendHandshake(m),e.next=35,this.waitForHandshakeAck();case 35:if(this.setStatus("ready"),this.flushCachedMessages(),null===(c=this.options.loading)||void 0===c||null===(u=c.onEndLoading)||void 0===u||u.call(c),!v){e.next=40;break}return e.abrupt("return",{error:v});case 40:return Hm("mount_success",{m1:this._mountStartTime?Date.now()-this._mountStartTime:0}),e.abrupt("return",{});case 44:if(e.prev=44,e.t0=e.catch(8),null===(g=this.options.loading)||void 0===g||null===(y=g.onEndLoading)||void 0===y||y.call(g),i=e.t0,S=void 0,(S=i).code!==fe.UI_STATE_ERROR.code||S.message!==Wm){e.next=49;break}return e.abrupt("return",{error:e.t0});case 49:return jm("mount_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||""}),this.cleanup(),E={code:e.t0.code||"UNKNOWN",message:e.t0.message||""},null===(_=this.options)||void 0===_||null===(b=_.onEventCallback)||void 0===b||b.call(_,E),e.abrupt("return",{error:E});case 54:case"end":return e.stop()}var i,S}),e,this,[[8,44]])}))),function(e,t){return l.apply(this,arguments)})},{key:"setup",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._mountStartTime=Date.now(),Hm("setup_start"),this.notRedirectAfterComplete=t.notRedirectAfterComplete||!1,a=this.options.sessionData,s=Sh(a,"ELEMENT_PAYMENT"),Hp.setGlobalOptions({hostSign:Cp(a),env:this.options.environment,sdkVersion:"2.0.21",tracker:Vl}),l=!(null==s||null===(n=s.connectFactor)||void 0===n||!n.enableConnect),c=null==s?void 0:s.paymentSessionConfig,u=function(){var e;return Ch(Uh({extParams:{isUserPreferredLocale:!0},merchantAppointParam:null!==(e=t.merchantAppointParam)&&void 0!==e&&e.storedCard?t.merchantAppointParam:void 0,notRedirectAfterComplete:I.notRedirectAfterComplete,paymentSessionConfig:null==s?void 0:s.paymentSessionConfig,paymentSessionData:a},{envInfo:{locale:I.options.locale}}).catch(Gm))},d=function(){return Ch(Mh({paymentSessionConfig:c,paymentSessionData:a,accountInfo:{email:""}}))},p=l?[u(),d()]:[u(),void 0],f=function(){},m=new Promise((function(e,t){f=I.onDestroy((function(){return t(qm())}))})),v=Promise.all(p),e.next=16,Promise.race([v,m]).finally(f);case 16:return g=e.sent,y=tt()(g,2),_=y[0],b=y[1],_.error&&Ym("sdk_query_failed",{d1:(null===(E=_.error)||void 0===E?void 0:E.code)||"",d2:(null===(S=_.error)||void 0===S?void 0:S.message)||""}),l&&null!=b&&b.error&&Ym("one_account_query_failed",{d1:(null===(A=b.error)||void 0===A?void 0:A.code)||"",d2:(null===(k=b.error)||void 0===k?void 0:k.message)||""}),T=js(_.data),w=T||this.options.locale,P=_.error||(null==b?void 0:b.error),e.abrupt("return",{sdkTiming:{sdkInitTime:this._sdkInitTime,mountStartTime:this._mountStartTime},sessionData:a,renderData:_.data,renderDataError:P,connectAccount:null==b?void 0:b.data,sessionMetaData:s,merchantDomain:window.location.hostname,appearance:Mm((null==t?void 0:t.appearance)||this.options.appearance,t.merchantAppointParam),logMetaData:{paymentMethodCategoryType:null==c?void 0:c.paymentMethodCategoryType,productSceneVersion:null==c?void 0:c.productSceneVersion,trackId:Ip(a),merchantId:null==s?void 0:s.clientId,paymentMethodType:null==s||null===(r=s.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType},heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),locale:w,sdkVersion:"2.0.21",merchantId:(null==_||null===(o=_.data)||void 0===o?void 0:o.merchantId)||"",env:"sandbox"===this.options.environment?"sandbox":"prod",_requestConfig:h()({env:"sandbox"===this.options.environment?"sandbox":"prod"},void 0)});case 26:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getLegacySdkQueryError",value:function(e){var t=e.errorCode,n=e.errorMessage,r=e.traceId,o=e.reason;if(!t)return{source:"SDK_INTERNAL",code:fe.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""};var i=Me[t];return{source:"SDK_INTERNAL",code:(null==i?void 0:i.code)||t,message:(null==i?void 0:i.message)||n||fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""}}},{key:"validateRenderData",value:function(e,t){var n;if(t||!e)return{source:"SDK_INTERNAL",code:fe.INITIALIZE_TIMEOUT.API.code,message:fe.INITIALIZE_TIMEOUT.API.message,reason:t?"query request failed: errorCode=".concat(t.code):"renderData is empty",traceId:null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:""};var r=e.success,o=e.paymentMethods,i=e.savedPaymentMethods,a=e.orderAmountView,s=e.paymentAmountView,l=Boolean(o&&Array.isArray(o)&&o.length>0||i&&Array.isArray(i)&&i.length>0),c=!!a&&!!s;if(!r){var u=e,d=u.traceId,p=u.errorCode,h=u.errorMessage;return this.getLegacySdkQueryError({errorCode:p,errorMessage:h,traceId:d,reason:p?"sdkAction.query failed: errorCode=".concat(p):"sdkAction.query failed without errorCode"})}return l&&c?void 0:{source:"SDK_INTERNAL",code:fe.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:"Data structure validation failed: success=".concat(r,", hasValidPaymentMethods=").concat(l,", hasAmountViews=").concat(c),traceId:""}}},{key:"bindBridgeEvents",value:function(){var e=this;this.bridge.on(Ll,(function(t){e.iframe&&(e.iframe.style.height="".concat(t,"px"))})),this.bridge.on(El,(function(t,n,r){var o,i;if(!r||r.source===(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||r.source===(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)){var a=t.url,s=t.mode,l=t.appLinkUrl,c=t.schemaUrl,u=t.destroy;Fm("redirect",{d1:s||"redirect",d2:l?"app_link":c?"schema":"url",d3:a||"",d4:l||"",d5:c||"",d6:u?"1":"0"}),u&&e.destroy();try{if(l||c)new Ns({resultJudgmentTime:2e3,fallback:function(){Fm("redirect_fallback",{d1:"callapp_failed",d2:a||""}),d()}}).open({scheme:c,link:l});else d()}catch(e){jm("redirect_error",{d1:"callapp_exception",d2:(null==e?void 0:e.message)||"",d3:a||""}),d()}}function d(){"replace"===s?window.location.replace(a):window.location.href=a}})),this.bridge.on(Sl,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||(e.handleOpenModal(t),e.bridge.once(kl,(function(){e.handleCloseModal()})))})),this.bridge.on(Ml,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||e.destroy()})),this.bridge.on(nv,(function(){e.handleHandlePayment()})),this.bridge.on(iv,(function(t){e.currentPaymentMethodType=(null==t?void 0:t.type)||""}))}},{key:"handleGetApplePayToken",value:(o=s()(i()().mark((function e(t,n){var r,o,a,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.options.sessionData,a=null==t||null===(r=t.paymentMethod)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.applePayProps,l=null==a?void 0:a.paymentRequest,Fm("applepay_token_request",{d1:l?"has_payment_request":"no_payment_request"}),l){e.next=8;break}return jm("applepay_token_missing_data",{d1:"MISSING_DATA"}),this.bridge.send($m,{success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}}),e.abrupt("return");case 8:return c=l.merchantCapabilities,u=l.merchantInfo,d=l.paymentAmount,p=l.supportedNetworks,h=l.version,f=l.requiredBillingContactFields,m=l.requiredShippingContactFields,v=(null==d?void 0:d.formattedValue)||(null==d?void 0:d.value),g=null==d?void 0:d.currency,this._merchantAmount&&(v=this._merchantAmount),this._merchantCurrency&&(g=this._merchantCurrency),_=new jh({paymentRequest:{countryCode:null==u?void 0:u.countryCode,currencyCode:g,merchantCapabilities:c,supportedNetworks:p,requiredBillingContactFields:f,requiredShippingContactFields:m,total:{type:"final",label:(null==u?void 0:u.merchantName)||"Payment",amount:v},version:h},enableModalCloseListener:!0,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Fm("applepay_validate_start",{d1:"merchant_validate"}),e.next=3,Zi(o,{validateUrl:t,paymentSessionData:o,merchantDomain:window.location.hostname},{env:S.options.environment,envInfo:{deviceId:""}},Vm);case 3:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=7;break}return Fm("applepay_validate_success",{d1:"got_session"}),e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 7:throw jm("applepay_merchant_validate_failed",{d1:"VALIDATION_FAILED",d2:(null==n?void 0:n.errorMessage)||"Merchant validation failed"}),{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,o=t.billingContact,a=t.shippingContact,!n){e.next=18;break}return e.prev=2,s=Date.now(),e.next=6,Pa((function(){return n()}));case 6:if(l=e.sent,c=l.result,u=l.timedOut,d=!u&&!!c&&Date.now()-s<Aa,(u||Date.now()-s>=Aa)&&jm("sdk_before_confirm_timeout",{d1:"applePay_chrome_modern"}),d){e.next=13;break}return e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 13:e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(2),e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 18:return y={token:r,billingContact:o,shippingContact:a},Fm("applepay_authorized",{d1:r?"has_token":"no_token"}),e.abrupt("return",{success:!0,result:y});case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=14,e.next=17,_.startPay();case 17:Fm("applepay_token_success",{d1:null!==(b=y)&&void 0!==b&&b.token?"has_token":"no_token"}),this.bridge.send($m,{success:!0,result:y}),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(14),"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"!==(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)&&("APPLE_PAY_CANCEL"===(E=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED")?Fm("applepay_cancel",{d1:"user_cancel"}):jm("applepay_token_failed",{d1:E,d2:(null===e.t0||void 0===e.t0?void 0:e.t0.errorMessage)||""})),this.bridge.send($m,{success:!1,result:{errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"}});case 25:case"end":return e.stop()}}),e,this,[[14,21]])}))),function(e,t){return o.apply(this,arguments)})},{key:"handleGetGooglePayToken",value:function(e){var t,n,r=this,o=null==e?void 0:e.data,i=null==o||null===(t=o.paymentMethodDetail)||void 0===t?void 0:t.googlePayProps,a=(null==o?void 0:o.environment)||(null==i?void 0:i.environment)||"TEST",s=(null==o?void 0:o.paymentRequest)||(null==i?void 0:i.paymentRequest)||{};if(Fm("googlepay_token_request",{d1:a,d2:s?"has_payment_request":"no_payment_request"}),!s||!Object.keys(s).length)return jm("googlepay_token_missing_data",{d1:"MISSING_DATA"}),void this.bridge.send(tv,{success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}});var l=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(s).then((function(t){if(t.result)return e.loadPaymentData(s);throw{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})).then((function(e){e&&(Fm("googlepay_token_success",{d1:"has_token"}),r.bridge.send(tv,{success:!0,result:e}))})).catch((function(e){var t=(null==e?void 0:e.statusCode)||"GOOGLE_PAY_PAYMENT_FAILED";"CANCELED"===t?Fm("googlepay_cancel",{d1:"user_cancel"}):jm("googlepay_token_failed",{d1:t,d2:(null==e?void 0:e.statusMessage)||""}),r.bridge.send(tv,{success:!1,err:h()({statusCode:t},e)})}))};if(null!==(n=window.google)&&void 0!==n&&null!==(n=n.payments)&&void 0!==n&&null!==(n=n.api)&&void 0!==n&&n.PaymentsClient)l();else{var c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild(c),c.onload=function(){l()},c.onerror=function(){jm("googlepay_script_load_failed",{d1:"script_error"}),r.bridge.send(tv,{success:!1,err:{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})}}}},{key:"handleHandlePayment",value:function(){var e=this.options.sessionData,t=jp(e);Fm("handle_payment",{d1:"skipRender_applepay_publish"}),t||jm("handle_payment_meta_failed",{d1:"meta_parse_failed"}),We.publish(new Ge(An.createComponent,JSON.stringify({appendParams:{iframeNodesParams:{sessionData:e,paymentSessionMetaData:t}},options:{environment:this.options.environment,locale:this.options.locale}})))}},{key:"handleBeforeConfirmInternal",value:function(e){var t=this;if(!e)return Vm.logInfo({title:"sdk_before_confirm_skip"},{path:"modernController_bridge"}),void this.bridge.send(ov,{success:!0,result:!0});Vm.logInfo({title:"sdk_before_confirm_start"},{path:"modernController_bridge"});var n=Date.now();Pa((function(){return e()})).then((function(e){var r=e.result,o=e.timedOut,i=!o&&!!r&&Date.now()-n<Aa;(o||Date.now()-n>=Aa)&&Vm.logError({title:"sdk_before_confirm_timeout"}),Vm.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:i}),t.bridge.send(ov,{success:!0,result:!!i})})).catch((function(e){Vm.logError({title:"sdk_before_confirm_error"},{errorMessage:String((null==e?void 0:e.message)||e).slice(0,200),path:"modernController_bridge"}),t.bridge.send(ov,{success:!1,result:!1})}))}},{key:"waitForReadyHandshake",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),jm("ready_handshake_timeout",{d1:String(zm)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),zm);r=e.onDestroy((function(){clearTimeout(o),n(qm())})),e.bridge.once(vl,(function(){var i;if(clearTimeout(o),r(),null===(i=e.iframe)||void 0===i||!i.contentWindow)return jm("iframe_contentwindow_unavailable",{d1:"after_ready_handshake"}),void n({code:"SDK_LAUNCH_PAYMENT_APP_ERROR",message:"Iframe contentWindow not available"});e.bridge.setTarget(e.iframe.contentWindow),Ym("ready_handshake_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"sendHandshake",value:function(e){this.bridge.send(ml,e),Ym("handshake_sent",{d1:(null==e?void 0:e.sdkVersion)||""})}},{key:"waitForHandshakeAck",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),jm("handshake_ack_timeout",{d1:String(zm)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),zm);r=e.onDestroy((function(){clearTimeout(o),n(qm())})),e.bridge.once(wl,(function(){clearTimeout(o),r(),Ym("handshake_ack_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return jm("submit_not_ready",{d1:this.status}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"not ready"}});case 3:if(!this.isSubmitting){e.next=6;break}return jm("submit_in_progress",{}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"submit already in progress"}});case 6:if(this.isSubmitting=!0,e.prev=7,o="APPLEPAY"===this.currentPaymentMethodType,s=(a=t||{}).onBeforeConfirm,l=Fl()(a,Um),!s||o){e.next=31;break}return Vm.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.prev=12,c=Date.now(),e.next=16,Pa((function(){return s()}));case 16:if(u=e.sent,d=u.result,!((p=u.timedOut)||!d||Date.now()-c>=Aa)){e.next=22;break}return p?Vm.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}):Vm.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 22:Vm.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.next=29;break;case 25:return e.prev=25,e.t0=e.catch(12),Vm.logError({title:"sdk_before_confirm_error"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 29:e.next=32;break;case 31:s||Vm.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:o?"applePay_eventBridge":"nonApplePay_sync"});case 32:return f=o&&!!s,m=!(null==l||!l.amount),v=!(null==l||!l.currency),!m&&!v||m&&v||Vm.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{amount:null==l?void 0:l.amount,currency:null==l?void 0:l.currency,reason:"amount and currency must be provided together, both ignored"}),this._merchantAmount=m&&v?l.amount:null,this._merchantCurrency=m&&v?l.currency:null,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n),Fm("submit_start",{d1:this.notRedirectAfterComplete?"if_required":"always"}),g=[],e.prev=41,_=new Promise((function(e){g.push(A.bridge.once(Xm,(function(e){A.handleGetApplePayToken(e,s).then((function(){}))}))),g.push(A.bridge.once(ev,(function(e){A.handleGetGooglePayToken(e)}))),g.push(A.bridge.once(rv,(function(){A.handleBeforeConfirmInternal(s||null)}))),g.push(A.bridge.once(bl,e))})),this.send(_l,h()(h()({},l),{},{redirect:this.notRedirectAfterComplete?"if_required":"always",hasBeforeConfirm:f},m&&v?{amount:l.amount,currency:l.currency}:{})),e.next=46,_;case 46:return b=e.sent,Fm("submit_reply",{d1:(null==b?void 0:b.status)||"",d2:(null==b||null===(y=b.error)||void 0===y?void 0:y.code)||""}),e.abrupt("return",Lm(b));case 51:throw e.prev=51,e.t1=e.catch(41),jm("submit_error",{d1:(null===e.t1||void 0===e.t1?void 0:e.t1.code)||"UNKNOWN",d2:(null===e.t1||void 0===e.t1?void 0:e.t1.message)||""}),e.t1;case 55:return e.prev=55,g.forEach((function(e){try{e()}catch(e){}})),null===(E=this.options.loading)||void 0===E||null===(S=E.onEndLoading)||void 0===S||S.call(E),e.finish(55);case 59:return e.prev=59,this.isSubmitting=!1,e.finish(59);case 62:case"end":return e.stop()}}),e,this,[[7,,59,62],[12,25],[41,51,55,59]])}))),function(e){return r.apply(this,arguments)})},{key:"validateFields",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return jm("validate_not_ready",{d1:this.status}),e.abrupt("return",{isValid:!1});case 3:return this.send(Qm),e.abrupt("return",new Promise((function(e){var n=setTimeout((function(){jm("validate_fields_timeout",{d1:"15000"}),e({isValid:!1})}),15e3);t.bridge.once(Zm,(function(t){clearTimeout(n);var r=!(null==t||!t.isValid);Fm("validate_result",{d1:r?"valid":"invalid"}),e(t||{isValid:!1})}))})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"destroy",value:function(){var e;Fm("destroy",{d1:this.status}),"initialized"!==this.status&&"destroyed"!==this.status&&(this.handleCloseModal(),this.bridge.destroy(),null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("destroyed"),this.runDestroyCallbacks(),this.cachedSend=[])}},{key:"cleanup",value:function(){var e;null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("initialized"),this.cachedSend=[]}},{key:"setStatus",value:function(e){var t;if("destroyed"!==this.status&&e!==this.status){var n=this.status;this.status=e,null===(t=this.onStatusChange)||void 0===t||t.call(this,e,n)}}},{key:"onDestroy",value:function(e){var t=this;return"destroyed"===this.status?(e(),function(){}):(this.destroyCallbacks.push(e),function(){t.destroyCallbacks=t.destroyCallbacks.filter((function(t){return t!==e}))})}},{key:"runDestroyCallbacks",value:function(){var e=this.destroyCallbacks;this.destroyCallbacks=[],e.forEach((function(e){return e()}))}},{key:"send",value:function(e,t){"destroyed"!==this.status&&("ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}))}},{key:"flushCachedMessages",value:function(){var e=this;this.cachedSend.length>0&&(this.cachedSend.forEach((function(t){var n=t.type,r=t.payload;e.bridge.send(n,r)})),this.cachedSend=[])}},{key:"handleOpenModal",value:function(e){var t,n,r,o=this;this.handleCloseModal();var i=gt?"mobile":"desktop";Fm("open_modal",{d1:i,d2:(null==e?void 0:e.modalId)||""});try{var a=new URL(e.url);e.closeConfirm&&a.searchParams.append("confirm","true"),e.url=a.toString()}catch(t){var s=new zs("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME");return jm("open_modal_invalid_url",{d1:"INVALID_MODAL_URL",d2:(null==e?void 0:e.url)||""}),void this.bridge.send(Al,s)}var l=this.modalBridge=Jm.getGlobalBridge("HOST"),c=new MessageChannel;this.bridge.send(Rl,e.modalId,[c.port1]);var u=(null==e||null===(t=e.appearance)||void 0===t?void 0:t.theme)||"default",d=null!==(n=Eh[u])&&void 0!==n?n:Eh.default,p={theme:d.theme,backgroundColor:(null==e||null===(r=e.appearance)||void 0===r||null===(r=r.variables)||void 0===r?void 0:r["background-primary"])||d.backgroundColor},f=Ih(h()(h()({},e),{},{mode:i,loadingConfig:p,onClose:e.closeConfirm?function(){return new Promise((function(e){o._closeConfirmResolve=e}))}:void 0})),m=f.iframe,v=f.destroy,g=function t(){if(m.removeEventListener("load",t),Fm("modal_loaded",{d1:e.url}),m.contentWindow){l.setTarget(m.contentWindow);try{var n=new URL(m.src).origin;n&&"null"!==n&&l.setOrigin(n)}catch(e){}e.appearance&&l.send(Dl,e.appearance),e.initialData&&l.send(Ol,e.initialData),l.send(Nl,e.modalId,[c.port2])}};this.modalIframe=m,this.modalDestroy=function(){v(),m.removeEventListener("load",g),o.modalIframe=null},m.addEventListener("load",g)}},{key:"handleCloseModal",value:function(){this._closeConfirmResolve&&(Fm("modal_close_confirm",{d1:"confirm_resolved"}),this._closeConfirmResolve(),this._closeConfirmResolve=null),Fm("modal_closed",{d1:this.modalBridge?"with_bridge":"no_bridge"}),this.modalBridge&&(this.modalBridge.destroy(),this.modalBridge=null),this.modalDestroy&&(this.modalDestroy(),this.modalDestroy=null)}},{key:"buildIframeUrl",value:function(){var e=Ys("/element_payment/index.html",!0),t=this.options.sessionData?Ip(this.options.sessionData):"";return"".concat(e,"?").concat(t?"track_id=".concat(encodeURIComponent(t),"&"):"","_scope_id=").concat(encodeURIComponent(this.scopeId))}}]),e}(),sv=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new B(n.errors);this.options=function(e){var t=e.environment;return h()(h()({},e),{},{environment:(t||U.PROD).toLocaleLowerCase()})}(t),Vp(t.sessionData)?this.controller=new av(h()(h()({},this.options),{},{sessionData:this.options.sessionData})):this.controller=new Om(this.options)}var t;return m()(e,[{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(h()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),lv={message:"sdk no need to make query request",success:!0},cv=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"eventCenter",void 0),c()(this,"securityService",void 0),c()(this,"instanceId",void 0),c()(this,"componentSign",void 0),c()(this,"hostSign",void 0),c()(this,"_performanceData",[]),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=$f.getInstance(this.instanceId).getService("Log"),this.eventCenter=$f.getInstance(this.instanceId).getService("EventCenter"),this.securityService=$f.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=Ms(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,a=r.authUrlInfo,s=void 0===a?{}:a,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=9;break}if(u=_t()?null==o||null===(l=o.web)||void 0===l?void 0:l.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(s));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===j.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=$f.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,a=this.initConfig,s=a.environment,l=a.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(f=_t()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(lv));case 9:if(f&&"REDIRECT"===f){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!aa()){e.next=13;break}return e.abrupt("return",Promise.resolve(lv));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),m={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=m,e.t2=s,e.t3=l,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:ve.error.name,data:fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),De);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=tt()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Lt({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===te.desktop&&(null===(t=document.getElementById(_e))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(ye))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===j.AUTO_DEBIT_APM}}]),e}();function uv(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Vt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(it.SDK)+"&"+"&notRedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var dv=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"securityService",void 0),c()(this,"eventCenter",void 0),c()(this,"instanceId",void 0),c()(this,"hostSign",void 0),c()(this,"allowQueryCall",void 0),c()(this,"allowSubmitPayCallAhead",void 0),c()(this,"channelBehavior",void 0),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),c()(this,"SDK_REQUEST_TIMEOUT",15e3),c()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=$f.getInstance(this.instanceId).getService("Log"),this.securityService=$f.getInstance(this.instanceId).getService("Security"),this.eventCenter=$f.getInstance(this.instanceId).getService("EventCenter"),En.preloadWebApp(G.EASY_PAY,z.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_t()&&"BANKTRANSFER_QUICKPAY"!==(null===(a=t.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",s=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,l=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=uv(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},qt.savePreviousProductInfo(G.EASY_PAY,{paymentMethodCategoryType:l,hostSign:this.hostSign,productSceneVersion:s}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Lt({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:Y.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=tt()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),f={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:Vt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(f.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:f}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(a=this.paymentContext)||void 0===a?void 0:a.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(s=this.paymentContext)&&void 0!==s&&null!==(s=s.paymentSessionObj.action)&&void 0!==s&&s.autoDebitWithToken),p=!0;try{f=JSON.parse(c),p=It(f.needQueryRender)||!0===f.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return m=Fe(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m}),v=$f.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=v,e.t1=h()(h()({},l),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(l.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:m,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,f=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},m=f.action,g=(v=void 0===m?{}:m).enableSignAgreement,y=void 0!==g&&g,_=v.autoDebitWithToken,b=void 0!==_&&_,"2.0"!==p||b||(c.signAgreement=y,S=null===(E=this.paymentContext.paymentSessionObj)||void 0===E||null===(E=E.paymentMethodInfoView)||void 0===E?void 0:E.paymentMethodType,A=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==S||A&&k||(T=Am(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return w=Fe(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w}),P=(null===(o=this.channelBehavior)||void 0===o||null===(a=o.buildSubmitPayExtParams)||void 0===a?void 0:a.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(s=this.paymentContext.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(l=this.paymentContext)||void 0===l||null===(l=l.startBizFlowOptions)||void 0===l||null===(l=l.submitPayRequestExtra)||void 0===l?void 0:l.notRedirectAfterComplete)}))||{},b||(P.complianceSDK=!0),c.extParams=P,I=$f.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=I,e.t1=h()(h()({},c),{},{integrationType:"SDK",sdkVersion:null!==(C=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==C?C:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return R=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w,rpcTraceId:R.traceId}),e.abrupt("return",R);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:w,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=$f.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(a=null===(s=this.paymentContext.paymentSessionObj.action)||void 0===s?void 0:s.userSignAgreement)&&void 0!==a&&a,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===l?h=!1:"2.0"===l&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?pe.NEED:pe.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var pv="https://dev.page.alipay.net",hv="https://test.page.alipay.net",fv="https://pre.ac.alipay.com",mv="https://checkout.antom.com",vv="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",gv=function(){function e(t){var n=this;g()(this,e),c()(this,"logger",void 0),c()(this,"_instanceId",void 0),c()(this,"iframe",void 0),c()(this,"originOptions",void 0),c()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),c()(this,"eventListener",void 0),c()(this,"generateIframeSrc",(function(e,t){var r=n.originOptions.environment||"prod",o=e||"",i=n.originOptions.locale||"en_US",a=function(e){switch(e){case"dev":return"".concat(pv).concat(vv);case"sit":return"".concat(hv).concat(vv);case"pre":return"".concat(fv).concat(vv);case"prod":case"sandbox":case"light_sandbox":return"".concat(mv).concat("/checkout-page/pages/payment/index.html");default:return e}}(r);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,r,o,i,a);var s=a.split("?")[0],l=bt(a);return l.sessionData=o,l.lang=i,l.mode="embed","sandbox"===r&&(l.shadow="true"),t&&(l.demoMode="true"),Object.keys(l).forEach((function(e){s+="".concat(s.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(l[e]))})),s})),c()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,f=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:f}).send();var m=h()(h()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(m)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=h()(h()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),c()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),c()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),c()(this,"dispatchToApp",(function(e){var t,r={name:ne.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||X.prod,this._instanceId=Fe(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new va(ga,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),va.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return m()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData,e.isDemoMode),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),yv=new va(ga,!0),_v=function(e){_()(n,e);var t=E()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return g()(this,n),(o=t.call(this,h()({appVersion:w},e))).preloadComponent(r,i),o}return m()(n)}(Ks),bv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.AUTO_DEBIT_PAY});return t.call(this,r,[j.AUTO_DEBIT_PAY_WALLET])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.AUTO_DEBIT_PAY,z.WALLET,e.environment),En.preloadSecuritySDK(G.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}(_v),Ev=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r,o=Object.assign({},e,{product:G.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM,j.CASHIER_PAYMENT_BANK].includes(s)?[s]:[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM]}catch(e){yv.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return m()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=j.CASHIER_PAYMENT_CARD===a?[z.CARD]:j.CASHIER_PAYMENT_APM===a?[z.APM]:j.CASHIER_PAYMENT_BANK===a?[z.BANK]:[z.CARD,z.APM];var s,l=d()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;En.preloadWebApp(G.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}En.preloadSecuritySDK(G.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}(_v),Sv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[j.CASHIER_PAYMENT_CARD])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.CASHIER_PAYMENT,z.CARD,e.environment),En.preloadSecuritySDK(G.VAULTING,e.securityRegion,e.environment)}}]),n}(_v),Av=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[j.ELEMENT_PAYMENT])}return m()(n)}(_v),kv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return m()(n)}(Hs),Tv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return m()(n)}(sv),wv=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Tm,this.core.registerProcessor(G.EASY_PAY,"",new dv),this.core.init(t,G.EASY_PAY)}return m()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.EASY_PAY,z.WALLET,e.environment,!0)}}]),e}(),Pv=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Tm,this.core.registerProcessor(G.AUTO_DEBIT,"",new cv),this.core.init(t,G.AUTO_DEBIT)}var t;return m()(e,[{key:"createComponent",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.AUTO_DEBIT,z.WALLET,e.environment),En.preloadSecuritySDK(G.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),Iv=new va(ga,!0);function Cv(e){return Rv.apply(this,arguments)}function Rv(){return Rv=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.requestId,r=t.renderData,o=t.appConfig,a=t.sendReply,l=Fh(r)){e.next=5;break}return a({requestId:n,success:!1,errorCode:"APPLE_PAY_MISSING_DATA"}),e.abrupt("return");case 5:return c=l.merchantCapabilities,u=l.merchantInfo,d=l.paymentAmount,p=l.supportedNetworks,f=l.version,m=l.requiredBillingContactFields,v=l.requiredShippingContactFields,g=(null==o?void 0:o.sessionData)||"",y=null==o?void 0:o.amount,_=null!=y&&y.value?y:d,b=null==_?void 0:_.value,E=null==d?void 0:d.currency,S=Nv(g,u,_),w=new jh({paymentRequest:h()({countryCode:null==u?void 0:u.countryCode,currencyCode:E,merchantCapabilities:c,supportedNetworks:p,requiredBillingContactFields:m,requiredShippingContactFields:v,total:S?{type:"final",label:S.regularBilling.label,amount:b}:{type:"final",label:null==u?void 0:u.merchantName,amount:b},version:f},S?{lineItems:[S.regularBilling],recurringPaymentRequest:S}:{}),enableModalCloseListener:!1,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Oh({validateUrl:t,paymentSessionData:g,merchantDomain:window.location.hostname});case 2:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=5;break}return e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 5:throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.token,r=t.billingContact,o=t.shippingContact,k=r,T=o,A={token:n,billingContact:r,shippingContact:o},e.abrupt("return",{success:!0,result:A});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=13,e.next=16,w.startPay();case 16:a({requestId:n,success:!0,result:A,billingDetails:k,shippingAddress:T}),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(13),P=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED",a({requestId:n,success:!1,errorCode:P});case 23:case"end":return e.stop()}}),e,null,[[13,19]])}))),Rv.apply(this,arguments)}function Nv(e,t,n){if(!e)return null;try{var r,o,i,a,s,l,c,u,d=jp(e),p=null==d?void 0:d.paymentSessionFactor,f=null==p?void 0:p.recurringInfo;if(!f)return null;var m=null==p||null===(r=p.order)||void 0===r?void 0:r.orderDescription;if(!m||!f.managementURL)return null;var v=h()(h()(h()({type:"final",label:null!==(o=null!==(i=f.title)&&void 0!==i?i:null==t?void 0:t.merchantName)&&void 0!==o?o:"",amount:null!==(a=null==n?void 0:n.value)&&void 0!==a?a:"0",paymentTiming:"recurring"},f.startDate?{recurringPaymentStartDate:new Date(1e3*f.startDate)}:{}),f.endDate?{recurringPaymentEndDate:new Date(1e3*f.endDate)}:{}),{},{recurringPaymentIntervalUnit:null!==(s=f.intervalUnit)&&void 0!==s?s:"month",recurringPaymentIntervalCount:null!==(l=f.intervalCount)&&void 0!==l?l:1});return{paymentDescription:m,billingAgreement:null!==(c=f.agreementDescription)&&void 0!==c?c:void 0,regularBilling:v,managementURL:f.managementURL,tokenNotificationURL:null!==(u=f.tokenNotificationURL)&&void 0!==u?u:void 0}}catch(e){return null}}var Dv=["paypal","applePay","googlePay","alipay"];function Ov(e,t,n){var r=new bh(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function Lv(e){var t=null==e?void 0:e.paymentMethods;if(!Array.isArray(t)||0===t.length)return Ov("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var n,r=d()(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Dv.includes(o))return Ov("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(o),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){r.e(e)}finally{r.f()}return!t.includes("paypal")||null!=e&&e.paypal?null:Ov("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}function Mv(e){return xv.apply(this,arguments)}function xv(){return xv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.env,o=null==n?void 0:n.sessionData,a=(null==n?void 0:n.locale)||"en_US",(s=Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("applePay")&&Yh(),!(l=Lv(n))){e.next=8;break}return e.abrupt("return",{setupResult:{sessionData:o,locale:a,setupError:l}});case 8:if(!s.includes("paypal")){e.next=14;break}return e.next=11,Uv(n);case 11:e.t0=e.sent,e.next=15;break;case 14:e.t0=void 0;case 15:if(c=e.t0,!((s.includes("applePay")||s.includes("googlePay")||s.includes("alipay"))&&o)){e.next=19;break}return e.abrupt("return",Kv({appConfig:n,sessionData:o,env:r,paypalSetupResult:c}));case 19:if(o){e.next=21;break}return e.abrupt("return",{setupResult:h()({sessionData:void 0},c)});case 21:if(!(u=Fv(o))){e.next=24;break}return e.abrupt("return",{setupResult:h()(h()({sessionData:o},c),{},{setupError:u})});case 24:return e.abrupt("return",{setupResult:h()({sessionData:o},c)});case 25:case"end":return e.stop()}}),e)}))),xv.apply(this,arguments)}function Uv(e){return Bv.apply(this,arguments)}function Bv(){return(Bv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null==t?void 0:t.paypal,a=(null==o?void 0:o.channelMerchantAccountId)||"",s=(null==t?void 0:t.businessDivision)||"",l=(null==t||null===(n=t.amount)||void 0===n?void 0:n.currency)||"",c=(null==t||null===(r=t.amount)||void 0===r?void 0:r.value)||"",e.prev=5,e.next=8,Nh({clientId:a,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:s,amount:{currency:l,value:c}},{timeout:1e5,hostSign:s});case 8:if(!0!==(null==(d=e.sent)?void 0:d.success)||!d.channelClientId){e.next=11;break}return e.abrupt("return",{paypal:h()(h()({},o),{},{channelMerchantAccountId:d.channelClientId})});case 11:if(!0!==(null==d?void 0:d.success)){e.next=13;break}return e.abrupt("return",{setupError:new bh("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON()});case 13:return p=new bh((null==d?void 0:d.errorMessage)||"channelClientId query failed",(null==d?void 0:d.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),"true"===(null==d||null===(u=d.extendInfo)||void 0===u?void 0:u.mulityLanguageMapping)&&(p.mulityLanguageMapping=!0),e.abrupt("return",{setupError:p});case 18:return e.prev=18,e.t0=e.catch(5),i=void 0,i="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),m={code:i?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:i?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},v=new bh(m.message,m.code,"SDK_USAGE").toJSON(),"true"===(null===e.t0||void 0===e.t0||null===(f=e.t0.response)||void 0===f||null===(f=f.extendInfo)||void 0===f?void 0:f.mulityLanguageMapping)&&(v.mulityLanguageMapping=!0),e.abrupt("return",{setupError:v});case 25:case"end":return e.stop()}var i}),e,null,[[5,18]])})))).apply(this,arguments)}function Kv(e){return Hv.apply(this,arguments)}function Hv(){return(Hv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.sessionData,o=t.env,a=t.paypalSetupResult,!(s=Fv(r))){e.next=4;break}return e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:s})});case 4:return l=jp(r),e.prev=5,e.next=8,Uh({paymentSessionData:r,paymentSessionConfig:null==l?void 0:l.paymentSessionConfig});case 8:if(null==(c=e.sent)||!c.success){e.next=12;break}return u=Yv(),e.abrupt("return",{renderData:c,setupResult:h()(h()(h()({sessionData:r,renderData:c,isNativeAppWebview:null==n?void 0:n.isNativeAppWebview},u?{merchantDomain:u,doMain:u}:{}),a),{},{_requestConfig:h()({env:o},void 0),sdkVersion:"2.0.21"})});case 12:return e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:bh.unificationError(new Error((null==c?void 0:c.errorMessage)||"sdkActionQuery failed")).toJSON()})});case 15:return e.prev=15,e.t0=e.catch(5),e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:bh.unificationError(e.t0).toJSON()})});case 18:case"end":return e.stop()}}),e,null,[[5,15]])})))).apply(this,arguments)}function Yv(){var e;if("undefined"!=typeof window)return(null===(e=window.location)||void 0===e?void 0:e.hostname)||void 0}function Fv(e){var t,n=jp(e);if(!n)return bh.unificationError(new Error("Failed to parse sessionData, please check the sessionData")).toJSON();var r=null===(t=n.paymentSessionConfig)||void 0===t?void 0:t.productScene;return"ELEMENT_PAYMENT"!==r?bh.unificationError(new Error("Invalid productScene in sessionData, expected ELEMENT_PAYMENT, but get ".concat(r,", please check the sessionData is correct?"))).toJSON():void 0}var jv=["paypal"],Gv=["createOrder","onShippingAddressChange","onShippingOptionsChange"],zv=function(e){_()(o,e);var t,n,r=E()(o);function o(e,t){var n;g()(this,o);var i=t.appConfig||{},a=i.paypal,s=Fl()(i,jv),l=a||{},u=l.createOrder,d=l.onShippingAddressChange,p=l.onShippingOptionsChange,f=Fl()(l,Gv),m=h()({},s);delete m.amount;var v=h()(h()({},m),Object.keys(f).length>0&&{paypal:f}),y=t.locale||"en_US",_=Ys("/express_element/index.html",!0);"sandbox"===t.env&&(_+=_.includes("?")?"&shadow=true":"?shadow=true");var b,E,S=i.sessionData?Ip(i.sessionData):void 0;S&&Vl.setTrackId(S),n=r.call(this,e,_,h()(h()({},t),{},{appConfig:v,locale:y,trackId:S}),Xp({appearance:{displaySetting:{showCardBrandIcon:!0}}},v)),c()(Ze()(n),"_callbacks",{}),c()(Ze()(n),"_renderData",null),c()(Ze()(n),"_initialAmount",void 0),c()(Ze()(n),"_localHandlers",new Map),c()(Ze()(n),"_paymentInProgress",!1),c()(Ze()(n),"_paypalOverlay",(b=null,{show:function(){if(!b){var e=document.createElement("div");e.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){e.style.opacity="1"}));var t=document.createElement("button");t.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",t.innerHTML="&#x2715;",t.addEventListener("click",E);var n=document.createElement("div");n.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var r=document.createElement("div");r.setAttribute("role","img"),r.setAttribute("aria-label","PayPal"),r.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var o=document.createElement("p");o.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",o.textContent="Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods.",n.appendChild(r),n.appendChild(o),e.appendChild(t),e.appendChild(n),document.body.appendChild(e),b=e}},hide:E=function(){b&&(b.remove(),b=null)}}));var A=i.sessionData?Cp(i.sessionData):"";return Hp.setGlobalOptions(h()({hostSign:A,sdkVersion:"2.0.21",env:t.env},void 0)),n._callbacks={paypalCreateOrder:u,paypalOnShippingAddressChange:d,paypalOnShippingOptionsChange:p},n._initialAmount=i.amount,n}return m()(o,[{key:"on",value:function(e,t){var n=this;if("onRedirect"===e&&(this._localHandlers.has(e)||this._localHandlers.set(e,new Set),this._localHandlers.get(e).add(t)),"confirm"===e){return qp()(Qp()(o.prototype),"on",this).call(this,e,(function(e){e.paymentFailed=function(){n._paymentInProgress=!1,n.send("OPENSDK@COMPLETE_PAYMENT_REJECT",{})},t(e)}))}return qp()(Qp()(o.prototype),"on",this).call(this,e,t)}},{key:"_emit",value:function(e,t){var n;null===(n=this._localHandlers.get(e))||void 0===n||n.forEach((function(e){return e(t)}))}},{key:"updateConfig",value:(n=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.amount,e.prev=1,"ready"===this.status){e.next=4;break}throw new bh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 4:if(void 0===n){e.next=12;break}if(!this._paymentInProgress){e.next=7;break}throw new bh("Payment amount update is not allowed during payment processing","PAYMENT_IN_PROGRESS","SDK_USAGE");case 7:if(null!=n&&n.value){e.next=9;break}throw new bh("Payment amount cannot be empty","AMOUNT_VALUE_EMPTY","SDK_USAGE");case 9:if(/^\d+(\.\d+)?$/.test(n.value)&&!(Number(n.value)<=0)){e.next=12;break}throw new bh("Invalid payment amount format (only positive integers and decimals allowed)","AMOUNT_VALUE_INVALID","SDK_USAGE");case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",{error:bh.unificationError(e.t0).toJSON()});case 17:return e.abrupt("return",qp()(Qp()(o.prototype),"updateConfig",this).call(this,t));case 18:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e){return n.apply(this,arguments)})},{key:"completePayment",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";if("destroyed"===this.status)return Promise.resolve({success:!1,error:{code:"ELEMENT_INSTANCE_DESTROYED",message:"Element already destroyed"}});var n="cp_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return this.send("OPENSDK@COMPLETE_PAYMENT",{requestId:n,redirect:t}),new Promise((function(t){var r=e.bridge.on("OPENSDK@COMPLETE_PAYMENT_RESULT",(function(i){(null==i?void 0:i.requestId)===n&&(e._paymentInProgress=!1,r(),clearTimeout(o),t({success:i.success,result:i.result,error:i.error}))})),o=setTimeout((function(){e._paymentInProgress=!1,r(),t({success:!1,error:{code:"COMPLETE_PAYMENT_TIMEOUT",message:"completePayment timed out"}})}),3e5)}))}},{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.registerInternalListeners(),t=h()(h()({},this.config.appConfig),{},{amount:this._initialAmount}),e.next=4,Mv({appConfig:t,env:this.config.env});case 4:return n=e.sent,r=n.setupResult,(o=n.renderData)&&(this._renderData=o),e.abrupt("return",h()(h()({},r),{},{amount:this._initialAmount}));case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;!function(e){var t=e.getIframe,n=e.on,r=t();r&&(r.style.opacity="0",r.style.transition="height 0.35s, opacity 0.4s 0.1s",r.style.height="0px",r.style.width="100%",r.style.display="block");var o=!1;n("contentHeightChanged",(function(e){var n=t();n&&(null==e?void 0:e.height)>0&&(n.style.height="".concat(e.height,"px"),o||(o=!0,requestAnimationFrame((function(){n.style.opacity="1"}))))}))}({getIframe:function(){return e.iframe},on:this.on.bind(this)}),function(e){var t=e.on,n=e.send,r=e.callbacks,o=e.paypalOverlay,a=e.setPaymentInProgress,l=e.getRenderData,c=e.getAppConfig;t("click",(function(e){a(!0),"paypal"!==(null==e?void 0:e.expressPaymentType)?n("OPENSDK@CLICK_RESOLVE",{}):o.show()})),t("ready",(function(){})),t("confirm",(function(){o.hide()})),t("error",(function(){a(!1),o.hide()})),t("cancel",(function(){a(!1),o.hide()})),t("OPENSDK@GET_APPLE_PAY_TOKEN",function(){var e=s()(i()().mark((function e(t){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.requestId,e.prev=1,e.next=4,Cv({requestId:r,renderData:l(),appConfig:c(),sendReply:function(e){n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",e)}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{requestId:r,success:!1,errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"});case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_CREATE_ORDER",function(){var e=s()(i()().mark((function e(t){var s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t.requestId,e.prev=1,r.paypalCreateOrder){e.next=4;break}throw new Error("paypal.createOrder is not provided");case 4:return e.next=6,r.paypalCreateOrder();case 6:l=e.sent,n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,sessionData:l}),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(1),a(!1),n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"createOrder failed"}),o.hide();case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE",function(){var e=s()(i()().mark((function e(t){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,a=t.shippingData,e.prev=1,e.next=4,null===(s=r.paypalOnShippingAddressChange)||void 0===s?void 0:s.call(r,a,{});case 4:n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingAddressChange failed"});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE",function(){var e=s()(i()().mark((function e(t){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,a=t.shippingData,e.prev=1,e.next=4,null===(s=r.paypalOnShippingOptionsChange)||void 0===s?void 0:s.call(r,a,{});case 4:n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingOptionsChange failed"});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}())}({on:this.on.bind(this),send:this.send.bind(this),callbacks:this._callbacks,paypalOverlay:this._paypalOverlay,setPaymentInProgress:function(t){e._paymentInProgress=t},getRenderData:function(){return e._renderData},getAppConfig:function(){return e.config.appConfig}})}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),o}(vh);c()(zv,"elementType","express");var Vv=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a,s=t.appConfig.sessionData,l=s?Ip(s):void 0;(l&&Vl.setTrackId(l),i=n.call(this,e,Ys("/vaulting/index.html",Vp(s)),h()(h()({},t),{},{trackId:l}),Xp({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default"}},t.appConfig)),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&Hp.setGlobalOptions({hostSign:Cp(null===(a=t.appConfig)||void 0===a?void 0:a.sessionData)});return i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData,a=Sh(o,"ELEMENT_VAULT"),e.next=4,Ch(Uh({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:a.paymentSessionConfig,paymentSessionData:o}));case 4:return s=e.sent,l=js(s.data),ap(c=l||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale),e.abrupt("return",{sessionData:o,renderData:s.data,renderDataError:s.error,sdkVersion:"2.0.21",paymentSessionConfig:a.paymentSessionConfig,locale:c,merchantId:(null===(r=s.data)||void 0===r?void 0:r.merchantId)||"default merchantId",_requestConfig:h()({env:this.config.env},void 0)});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(vh);c()(Vv,"elementType","vaulting");var Wv=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"canUseElements",value:function(){return[Vv,zv]}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}}]),n}(yh),qv=function(e){_()(o,e);var t,n,r=E()(o);function o(e,t){var n,i,a;g()(this,o);var s,l=Xp({appearance:{layout:"accordion",theme:"default",displaySetting:{showCardBrandIcon:!0}}},t.appConfig),c=null!==(n=t.appConfig)&&void 0!==n&&n.sessionData?Ip(t.appConfig.sessionData):void 0;(c&&Vl.setTrackId(c),a=r.call(this,e,Ys("/element_payment/index.html",!0),h()(h()({},t),{},{trackId:c}),l),null!==(i=t.appConfig)&&void 0!==i&&i.sessionData)&&Hp.setGlobalOptions({hostSign:Cp(null===(s=t.appConfig)||void 0===s?void 0:s.sessionData)});return a}return m()(o,[{key:"setup",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.config.appConfig.sessionData,s=Sh(a,"ELEMENT_PAYMENT"),l=null==s?void 0:s.paymentSessionConfig,c=function(){return Ch(Uh({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:l,paymentSessionData:a}))},u=function(){return Ch(Mh({paymentSessionConfig:l,paymentSessionData:a,accountInfo:{email:""}}))},d=!(null==s||null===(t=s.connectFactor)||void 0===t||!t.enableConnect),p=d?[c(),u()]:[c(),void 0],e.next=9,Promise.all(p);case 9:return f=e.sent,m=tt()(f,2),v=m[0],g=m[1],y=js(null==v?void 0:v.data),_=y||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale,b=(null===(r=v.data)||void 0===r?void 0:r.merchantId)||(null==s?void 0:s.clientId)||"default merchantId",e.abrupt("return",{renderData:v.data,renderDataError:v.error||(null==g?void 0:g.error),connectAccount:null==g?void 0:g.data,logMetaData:{paymentMethodCategoryType:null==l?void 0:l.paymentMethodCategoryType,productSceneVersion:null==l?void 0:l.productSceneVersion,trackId:Ip(a),merchantId:b,paymentMethodType:null==s||null===(o=s.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType},sessionData:a,sessionMetaData:s,sdkVersion:"2.0.21",locale:_,merchantId:b,heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),merchantDomain:window.location.hostname,env:this.config.env,_requestConfig:h()({env:this.config.env},void 0)});case 17:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"submit",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._submit(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),o}(vh);c()(qv,"elementType","payment");var Jv=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a=null===(o=t.appConfig)||void 0===o?void 0:o.sessionData,s=a?Ip(a):void 0;return s&&Vl.setTrackId(s),(i=n.call(this,e,Ys("/element_payment_modern/index.html",Vp(a)),h()(h()({},t),{},{trackId:s}),Xp({appearance:{theme:"default"}},t.appConfig))).on("destroy",(function(){i.destroy()})),i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"2.0.21",_requestConfig:h()({env:this.config.env},void 0)}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(vh);c()(Jv,"elementType","CVV");var Qv=n(817),Zv=n.n(Qv),Xv={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"2.0.21",trackerCode:"7982"},$v=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t,n,r;return g()(this,a),t=o.call(this,Xp(Xv,e)),Vl.initTracker({env:Fs}),Hp.setGlobalOptions(h()(h()({env:t.config.env},void 0),{},{sdkVersion:t.config.version,tracker:Vl,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=Zv(),r=null==e?void 0:e.locale,ip.initData(n),r&&ap(r),t}return m()(a,[{key:"canUseElements",value:function(){return[Vv,Jv,zv,qv]}},{key:"updateConfig",value:function(e){e.env&&Hp.setGlobalOptions({env:e.env}),e.locale&&(Hp.setGlobalOptions({envInfo:{locale:e.locale}}),ap(e.locale)),qp()(Qp()(a.prototype),"updateConfig",this).call(this,e)}},{key:"redirect",value:function(e){var t=e.url,n=e.mode,r=e.appLinkUrl,o=e.schemaUrl;function i(){"replace"===n?window.location.replace(t):window.location.href=t}e.destroy&&this.destroy();try{if(r||o)new Ns({resultJudgmentTime:2e3,fallback:function(){i()}}).open({scheme:o,link:r});else i()}catch(e){i()}}},{key:"openModal",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",s=null!==(r=Eh[a])&&void 0!==r?r:Eh.default,l=Ih(h()(h()({},t),{},{loadingConfig:h()(h()({},t.loadingConfig),{},{theme:s.theme,backgroundColor:(null==t||null===(o=t.appearance)||void 0===o||null===(o=o.variables)||void 0===o?void 0:o["background-primary"])||s.backgroundColor})})),c=l.iframe,u=l.destroy,d=function e(){ch("ERROR","SDK_INTERNAL","modal load error"+t.url),c.removeEventListener("error",e),u()},c.addEventListener("error",d),e.abrupt("return",{destroy:u,onLoadedSuccess:function(e){c.addEventListener("load",(function(){e()}))},getContentWindow:function(){return c.contentWindow}});case 6:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"elements",value:function(){return new Wv(this.config)}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}},{key:"extractMainElement",value:function(e){if(e instanceof yh){var t=e._mainElement;if(!t)throw new bh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof vh)return e;throw new bh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=bh.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmPayment",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h,f,m;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=45;break}e.prev=1,n=this.extractMainElement(t.elements),e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(1),r=bh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:if(!n.is(zv)){e.next=25;break}return e.prev=10,e.next=13,n.completePayment(t.redirect||"always");case 13:if(!(a=e.sent).success){e.next=16;break}return e.abrupt("return",{status:"SUCCESS",userCanceled3D:!1});case 16:return s=["PAYMENT_CANCELLED","APPLE_PAY_CANCEL"].includes((null===(o=a.error)||void 0===o?void 0:o.code)||""),e.abrupt("return",{status:s?"CANCELLED":"FAIL",userCanceled3D:!1,error:a.error?{code:a.error.code,message:a.error.message}:void 0});case 21:return e.prev=21,e.t1=e.catch(10),l=bh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:l.code,message:l.message}});case 25:if(!n.is(qv)){e.next=36;break}return e.prev=26,e.next=29,n.submit({redirect:null!==(c=t.redirect)&&void 0!==c?c:"always",params:t.params,shippingInfo:t.shippingInfo,handleActions:t.handleActions});case 29:return e.abrupt("return",e.sent);case 32:return e.prev=32,e.t2=e.catch(26),u=bh.unificationError(e.t2),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:u.code,message:u.message}});case 36:return e.prev=36,d=n,e.abrupt("return",d.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 41:return e.prev=41,e.t3=e.catch(36),p=bh.unificationError(e.t3),e.abrupt("return",{code:p.code,message:p.message,userCanceled3D:!1,status:"FAIL",error:{code:p.code,message:p.message}});case 45:return(h=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance,sessionData:t.sessionData})).mount(document.body),e.prev=47,e.next=50,new Promise((function(e,t){var n=setTimeout((function(){t(new bh("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);h.on(wl,(function(){clearTimeout(n),e()}))}));case 50:e.next=58;break;case 52:return e.prev=52,e.t4=e.catch(47),h.unmount(),f=bh.unificationError(e.t4),m=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:f.code,message:f.message,status:m.includes(f.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:f.code,message:f.message}});case 58:return e.abrupt("return",h.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 59:case"end":return e.stop()}}),e,this,[[1,5],[10,21],[26,32],[36,41],[47,52]])}))),function(e){return t.apply(this,arguments)})}]),a}(_h);c()($v,"version","2.0.21");var eg,tg,ng=["env","environment"],rg=function(){var e=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).env,o=n.environment,a=Fl()(n,ng),s=r||o||"prod",e.abrupt("return",(0,jl.createSingletonInstance)($v,h()(h()({},a),{},{env:s}),"AntomSDK"));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(tg=["CDN","NPM"]).includes(eg="CDN")&&"undefined"!=typeof window&&(tg.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=eg,Iv.setMedta({integrationType:eg})));var og=_v}(),r}()}));
6
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={4989:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث استثناء غير معروف، يرجى التحقق من حالة الدفع والتواصل مع التاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى."}},8143:function(e){e.exports={"page.wrong.error.message":"Error del sistema"}},1286:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Unbekannte Fehlermeldung. Bitte überprüfen Sie den Zahlungsstatus und wenden Sie sich an den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut."}},9715:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος"}},3282:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please check your payment status and contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again."}},6233:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Por favor, revise la situación del pago y contacte con el comerciante.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo."}},1269:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s'est produite. Veuillez vérifier l'état de votre paiement et contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer."}},6543:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"अज्ञात त्रुटि। कृपया अपनी भुगतान स्थिति जाँचें और व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।"}},7801:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui, silakan periksa status pembayaran dan hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi."}},817:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(3282),r["pt-BR"]=r["pt-br"]=n(9747),r["es-ES"]=r["es-es"]=n(6233),r["ko-KR"]=r["ko-kr"]=n(6367),r["zh-CN"]=r["zh-cn"]=n(6377),r["zh-HK"]=r["zh-hk"]=n(910),r["ms-MY"]=r["ms-my"]=n(6444),r["in-ID"]=r["in-id"]=n(7801),r["th-TH"]=r["th-th"]=n(4744),r["vi-VN"]=r["vi-vn"]=n(9443),r["tl-PH"]=r["tl-ph"]=n(1153),r["it-IT"]=r["it-it"]=n(6858),r["de-DE"]=r["de-de"]=n(1286),r["fr-FR"]=r["fr-fr"]=n(1269),r["nl-NL"]=r["nl-nl"]=n(7465),r["ja-JP"]=r["ja-jp"]=n(7312),r.ro=r.ro=n(4803),r["pl-PL"]=r["pl-pl"]=n(7846),r["ar-SA"]=r["ar-sa"]=n(4989),r["tr-TR"]=r["tr-tr"]=n(9499),r["hi-IN"]=r["hi-in"]=n(6543),r["pt-PT"]=r["pt-pt"]=n(7021),r.ca=r.ca=n(8143),r.el=r.el=n(9715),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},6858:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Errore sconosciuto. Si prega di verificare lo stato del pagamento e di contattare il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova."}},7312:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"未知のエラーが発生しました。お支払い状況をご確認のうえ、加盟店へお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。"}},6367:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 결제 상황을 확인하고 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요."}},6444:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat tidak diketahui. Sila semak butiran pembayaran anda dan hubungi peniaga.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi."}},7465:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Onbekende uitzondering. Controleer de betalingsstatus en neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw."}},7846:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Sprawdź status płatności i skontaktuj się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie."}},9747:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Erro desconhecido. Verifique o status do pagamento e entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente."}},7021:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu uma exceção desconhecida. Verifique a situação do pagamento e entre em contacto com o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente."}},4803:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"Eroare necunoscută. Vă rugăm să verificați statutul plății și să luați legătura cu comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou."}},4744:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ กรุณาตรวจสอบสถานะการชำระเงินและติดต่อผู้ขาย。","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。"}},1153:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Hindi kilalang error. Pakisuri ang mga detalye ng iyong pagbabayad at makipag-ugnayan sa merchant.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli."}},9499:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu, lütfen ödeme durumunu kontrol edin ve satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin."}},9443:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Lỗi không xác định. Vui lòng kiểm tra lại thông tin thanh toán và liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại."}},6377:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"未知异常,请检查付款情况并联系商户。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。"}},910:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"未知異常,請檢查付款情況並聯絡商家。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。"}},8306:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=void 0,t.createSingletonInstance=l,t.createInstance=c,t.createLoader=function(e){var t=this,n=e.sdkURL,s=e.globalName,u=e.timeout,d=void 0===u?2e4:u,p=e.onLoadComplete,h=e.onError,f=e.onLoadStart,m=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,u,v=this;return o(this,(function(_){var b,E;return null==f||f(),t=Date.now(),i.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),b=function(){return(0,a.loadScriptClass)(n,s)},E=d,u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new a.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(E)))}),E)})),b.apply(void 0,e)])},[2,u().then((function(n){return r(v,[n],void 0,(function(n){var r,u,d,h=n.variable,f=n.cache;return o(this,(function(n){switch(n.label){case 0:if(r=Date.now(),f||i.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new a.LoaderError("NO_REMOTE_CLASS","No variables ".concat(s," were found. Cannot be initialized the Class ").concat(s));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?l:c)(h,e,void 0)];case 2:return u=n.sent(),i.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:u.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==m||m(u,window.location.href),[2,u];case 3:throw d=n.sent(),new a.LoaderError("INIT_ERROR","Initialize Class ".concat(s," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=a.LoaderError.unificationError(e);return i.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var i=n(2611),a=n(7880);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});var s=null;function l(e,t,n){return s=s?s.then((function(r){return r.isDestroyed?c(e,t,n):r})):c(e,t,n)}function c(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&i.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new a.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&i.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}},2611:function(e,t,n){"use strict";var r,o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var s=n(7880),l=function(){function e(e){Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,s.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull").then((function(t){var n=null==t?void 0:t.variable;if(n)return new n(o({compactExtraInfo:!0,appId:"180020050100012557"},e.initOptions))})).catch((function(){}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(e.set({keyFormat:"origin",userPathAuto:!1}),this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=l;var c=(null===(r="PROD")?void 0:r.toUpperCase())||"PROD",u=["DEV","SIT","PRE","PROD","LOCAL"].includes(c)?c:"PROD";t.tracker=new l({appId:"180020050100012557",env:u,server:"sg",performance:!1,error:!1})},7880:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},7861:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=l(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;s<l;s+=a)i.push(c(e,s,s+a>l?l:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6207:function(e,t,n){"use strict";var r=n(7861),o=n(9090),i=n(8736);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n);e=s(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function _(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return j(Y(t,e.length-n),e,n,r)}function E(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return E(e,t,n,r)}function A(e,t,n,r){return j(F(t),e,n,r)}function k(e,t,n,r){return j(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=void 0!==n.g.TYPED_ARRAY_SUPPORT?n.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return c(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return u(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){i=c[d],a=u[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=H(e[i]);return o}function N(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=l.isBuffer(e)?e:Y(new l(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}},8736:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9090:function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=f,a/=256,c-=8);e[n+h-f]|=128*m}},8098:function(e,t,n){var r=n(4944).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(E,t),u?g(e):a}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function E(){var e=m();if(b(e))return S(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?f(n,i-(e-c)):n}(e))}function S(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function A(){var e=m(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(E,t),g(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},A.flush=function(){return void 0===s?a:S(m())},A}},9414:function(e,t,n){var r=n(4944).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,f="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=h||f||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,b=m["__core-js_shared__"],E=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=y.toString,A=_.hasOwnProperty,k=_.toString,T=RegExp("^"+S.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=m.Symbol,P=g.splice,I=K(m,"Map"),C=K(Object,"create"),R=w?w.prototype:void 0,N=R?R.toString:void 0;function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||z(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:H(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[Y(t[o++])];return o&&o==i?e:void 0}function U(e){if(!G(e)||(t=e,E&&E in t))return!1;var t,n=function(e){var t=G(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}D.prototype.clear=function(){this.__data__=C?C(null):{}},D.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},D.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===o?void 0:n}return A.call(t,e)?t[e]:void 0},D.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:A.call(t,e)},D.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?o:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():P.call(t,n,1),!0)},O.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},O.prototype.has=function(e){return M(this.__data__,e)>-1},O.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new D,map:new(I||O),string:new D}},L.prototype.delete=function(e){return B(this,e).delete(e)},L.prototype.get=function(e){return B(this,e).get(e)},L.prototype.has=function(e){return B(this,e).has(e)},L.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=F((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(z(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function Y(e){if("string"==typeof e||z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(F.Cache||L),n}F.Cache=L;var j=Array.isArray;function G(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function z(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},8994:function(e,t,n){e=n.nmd(e);var r=n(4944).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=p||h||Function("return this")(),m="object"==r(t)&&t&&!t.nodeType&&t,v=m&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===m,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function E(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S,A,k,T=Array.prototype,w=Function.prototype,P=Object.prototype,I=f["__core-js_shared__"],C=w.toString,R=P.hasOwnProperty,N=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",D=P.toString,O=C.call(Object),L=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=g?f.Buffer:void 0,x=f.Symbol,U=f.Uint8Array,B=M?M.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,k=Object,function(e){return A(k(e))}),H=Object.create,Y=P.propertyIsEnumerable,F=T.splice,j=x?x.toStringTag:void 0,G=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=M?M.isBuffer:void 0,V=Math.max,W=Date.now,q=ve(f,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ie(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Ae(e),r=!n&&Se(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Re(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!Ee(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];R.call(e,t)&&Ee(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return R.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:R.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():F.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return me(this,e).get(e)},$.prototype.has=function(e){return me(this,e).has(e)},$.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=D.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return D.call(e)}(e)}function ce(e){return Ce(e)&&le(e)==a}function ue(e){return!(!Ie(e)||function(e){return!!N&&N in e}(e))&&(we(e)?L:c).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ie(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&R.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ie(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Ae(c),f=!h&&Te(c),m=!h&&!f&&Re(c);d=c,h||f||m?Ae(s)?d=s:Ce(b=s)&&ke(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=B?B(n):new e.constructor(n);return e.copy(r),r}(c,!0)):m?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!Ce(e)||le(e)!=l)return!1;var t=K(e);if(null===t)return!0;var n=R.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==O}(c)||Se(c)?(d=s,Se(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Ne(e))}(s):Ie(s)&&!we(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(K(e))}(c))):p=!1}var v,g,y,_;var b;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Ne)}function he(e,t){return be(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),E(e,this,s)}}(e,t,Le),e+"")}var fe=G?function(e,t){return G(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Le;function me(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function Ee(e,t){return e===t||e!=e&&t!=t}var Se=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&R.call(e,"callee")&&!Y.call(e,"callee")},Ae=Array.isArray;function ke(e){return null!=e&&Pe(e.length)&&!we(e)}var Te=z||function(){return!1};function we(e){if(!Ie(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ie(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==r(e)}var Re=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&Pe(e.length)&&!!d[le(e)]};function Ne(e){return ke(e)?te(e,!0):de(e)}var De,Oe=(De=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=De.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ie(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&Ee(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&De(e,s,n,i)}return e})));function Le(e){return e}e.exports=Oe},3089:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8319:function(e,t,n){var r=n(7652);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7652:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},3317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},4180:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},4786:function(e,t,n){var r=n(3317);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7374:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4331:function(e,t,n){var r=n(7652);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},8193:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},1404:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},8946:function(e,t,n){var r=n(7652);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},5486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},1486:function(e,t,n){var r=n(9687),o=n(2424);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(5281);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},9746:function(e,t,n){var r=n(5508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},3400:function(e,t,n){var r=n(2242),o=n(2424),i=n(1983);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4143:function(e,t,n){var r=n(5281);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},5225:function(e,t,n){var r=n(3155);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2242:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5821:function(e,t,n){var r=n(9687);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2185:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},2424:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},4682:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7249:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},20:function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},114:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},5118:function(e,t,n){var r=n(4143);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},4005:function(e,t,n){var r=n(5166);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},5166:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},1983:function(e,t,n){var r=n(4944).default,o=n(7374);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7662:function(e,t,n){var r=n(4944).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new D(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var m="suspendedStart",v="executing",g="completed",y={};function _(){}function b(){}function E(){}var S={};p(S,c,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(O([])));k&&k!==i&&a.call(k,c)&&(S=k);var T=E.prototype=_.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(o,i,s,l){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function I(e,n,r){var o=m;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=E,s(T,"constructor",{value:E,configurable:!0}),s(E,"constructor",{value:b,configurable:!0}),b.displayName=p(E,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},w(P.prototype),p(P.prototype,u,(function(){return this})),n.AsyncIterator=P,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new P(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=O,D.prototype={constructor:D,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(N),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9687:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7925:function(e,t,n){var r=n(4180),o=n(7249),i=n(5508),a=n(20);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3155:function(e,t,n){var r=n(2242);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},4044:function(e,t,n){var r=n(4786),o=n(4682),i=n(5508),a=n(114);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(4944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5281:function(e,t,n){var r=n(4944).default,o=n(224);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},4944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5508:function(e,t,n){var r=n(3317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3697:function(e,t,n){var r=n(8319);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){var r=n(2242),o=n(9687),i=n(2185),a=n(1486);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return Mv},AMSAutoDebitPay:function(){return Iv},AMSCashierPayment:function(){return Cv},AMSCheckout:function(){return Pv},AMSCheckoutPage:function(){return Tv},AMSEasyPay:function(){return Lv},AMSElement:function(){return Ov},AMSVaulting:function(){return Rv},AddressElement:function(){return Dv},AntomElement:function(){return Nv},AntomSDK:function(){return og},ComponentSignEnum:function(){return j},ComponentSignEnumV2:function(){return F},ConnectErrorCode:function(){return de},DisplayTypeEnum:function(){return Y},ElementType:function(){return N},EnvironmentEnum:function(){return X},EventLoggingEventId:function(){return he},InterActionTypeEnum:function(){return ue},MessageName:function(){return ne},PaymentAmountEnum:function(){return W},PaymentElementLayout:function(){return M},PaymentMethodCategoryTypeEnum:function(){return z},PaypalMethodEnum:function(){return le},PlatformEnum:function(){return te},ProductSceneEnum:function(){return G},ProductSceneVersion:function(){return ce},RedirectType:function(){return se},RiskSdkInfoEnum:function(){return pe},TargetEnum:function(){return re},ThemeType:function(){return L},checkoutDisplayEnum:function(){return J},default:function(){return cg},errorEnum:function(){return oe},eventCodeEnum:function(){return ae},loadAntom:function(){return lg},localeEnum:function(){return q},modeEnum:function(){return Q},networkModeEnum:function(){return Z},osTypeEnum:function(){return $},payPalConfigurationIntentEnum:function(){return V},redirectTypeEnum:function(){return ie},terminalTypeEnum:function(){return ee}});var e={};n.r(e),n.d(e,{hasBrowserEnv:function(){return so},hasStandardBrowserEnv:function(){return co},hasStandardBrowserWebWorkerEnv:function(){return uo},navigator:function(){return lo},origin:function(){return po}});var t,o=n(7662),i=n.n(o),a=n(1404),s=n.n(a),l=n(4143),c=n.n(l),u=n(9746),d=n.n(u),p=n(5118),h=n.n(p),f=n(702),m=n.n(f),v=n(5486),g=n.n(v),y=n(5821),_=n.n(y),b=n(3400),E=n.n(b),S={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},A={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},k={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},T="2.0.22",w="1.47.2",P=n(907),I=n.n(P),C=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),R=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),N=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),D=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),O=c()(c()(c()(c()(c()(c()({},N.auth,R.AUTH_ELEMENT),N.address,R.ADDRESS_ELEMENT),N.payment,R.PAYMENT_ELEMENT),R.AUTH_ELEMENT,N.auth),R.ADDRESS_ELEMENT,N.address),R.PAYMENT_ELEMENT,N.payment),L=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),M=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),x=(c()(c()({},L.Default,"LIGHT"),L.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),U=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),B=function(e){_()(n,e);var t=E()(n);function n(e){var r;g()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return m()(n)}(I()(Error)),K=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),H=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),Y=function(e){return e.popup="popup",e.inline="inline",e}({}),F=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),j=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),G=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),z=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),V=function(e){return e.intent="intent",e.capture="capture",e}({}),W=function(e){return e.USD="USD",e}({}),q=function(e){return e["en-US"]="en-US",e}({}),J=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),Q=function(e){return e.dropin="dropin",e.component="component",e}({}),Z=function(e){return e.proxy="proxy",e.session="session",e}({}),X=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),$=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),ee=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),te=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),ne=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),re=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),oe=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),ie=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),ae=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),se=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),le=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),ce=function(e){return e.V1="1.0",e.V2="2.0",e}({}),ue=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),de=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),pe=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),he=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),fe={DOMAIN_NOT_IN_WHITE_LIST:{code:ae.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:ae.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:ae.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:ae.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:ae.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:ae.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:ae.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},me="COMPONENT",ve={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},ge={name:"validateFields"},ye="ams-component-container",_e="ams-component-section",be="ams-checkout-component",Ee="asm-component-close-block",Se="ams-component-mask-close-block",Ae="ams-component-retention",ke="ams-component-mockup",Te="ams-component-loading",we="ams-component-popup-loading",Pe="_ams_sdk_component_listener",Ie="ams-inline-component-style",Ce="inline-loading",Re="ams-popup",Ne="light dark",De=15e3,Oe=300,Le="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",Me={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},xe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Ue=new Uint8Array(16);function Be(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Ue)}for(var Ke=[],He=0;He<256;++He)Ke.push((He+256).toString(16).slice(1));function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ke[e[t+0]]+Ke[e[t+1]]+Ke[e[t+2]]+Ke[e[t+3]]+"-"+Ke[e[t+4]]+Ke[e[t+5]]+"-"+Ke[e[t+6]]+Ke[e[t+7]]+"-"+Ke[e[t+8]]+Ke[e[t+9]]+"-"+Ke[e[t+10]]+Ke[e[t+11]]+Ke[e[t+12]]+Ke[e[t+13]]+Ke[e[t+14]]+Ke[e[t+15]]}var Fe=function(e,t,n){if(xe.randomUUID&&!t&&!e)return xe.randomUUID();var r=(e=e||{}).random||(e.rng||Be)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ye(r)},je=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ge=function(){function e(t,n){g()(this,e),c()(this,"action",void 0),c()(this,"data",void 0),c()(this,"jsonData",null),this.action=t,this.data=n}return m()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),ze=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Ve=m()((function e(){g()(this,e)})),We=function(){function e(){g()(this,e)}return m()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(je.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(je.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(je.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new ze((function(r){e.traceLog(je.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(je.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=d()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(je.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=d()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var p=c.value;null==p||p.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var h,f=!1,m=d()(e.interceptors);try{for(m.s();!(h=m.n()).done;){var v=h.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),f=f||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){m.e(e)}finally{m.f()}f?e.publish(t,n):e.traceError(je.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(je.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(je.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=d()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();c()(We,"TAG","BusManager"),c()(We,"_logSplit"," , "),c()(We,"interceptors",[]),c()(We,"subscribersMap",new Map),c()(We,"isDebug",!0),c()(We,"logger",void 0);var qe=n(4944),Je=n.n(qe),Qe=n(7374),Ze=n.n(Qe),Xe=n(4044),$e=n.n(Xe),et=n(7925),tt=n.n(et),nt=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Ne,t},rt=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),ot=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),it=function(e){return e.SDK="SDK",e.API="API",e}({}),at=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},st=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return m()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),lt=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},ct=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},ut=window.navigator,dt=ut.userAgent,pt=/iPhone|iPad|iPod/i.test(dt)||"MacIntel"===ut.platform&&ut.maxTouchPoints>1,ht=/Android/i.test(dt),ft=(/\bMacintosh\b/.test(dt),/Windows NT/.test(dt),function(){var e=/OpenHarmony/i.test(ut.userAgent),t=/Phone/i.test(ut.userAgent),n=/Tablet/i.test(ut.userAgent);return e&&(t||n)}),mt=pt,vt=ht,gt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(dt)&&!ft()),yt=(ft(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),_t=function(){var e=ut.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},bt=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},Et=function(){var e=document.documentElement.clientWidth,t=_t()?130:100*e/390;return Math.min(t,130)},St=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(Et(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},At=function(){window.removeEventListener("resize",St),window.removeEventListener("pageShow",St),window.removeEventListener("DOMContentLoaded",St),window.addEventListener("resize",St),window.addEventListener("pageShow",St),window.addEventListener("DOMContentLoaded",St)},kt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},Tt=function(e){return"function"==typeof e};function wt(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function Pt(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var It=function(e){return!(!e||"object"!==Je()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},Ct=function(){var e=(bt()||{}).environment;return!!e&&"dev"===e};function Rt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Nt(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Rt(e,n)>=0&&Rt(r,e)>=0}function Dt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=tt()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var Ot=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=xt(t,n,r,o,i,l),u=bt(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,f=void 0===h?"":h,m=u.groupId,v=void 0===m?"":m,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var b in a)_[b]=""+a[b];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),f&&(_.requestHost=f),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var E=lt(_);return Ct()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,E)),{path:c,locationSearch:E}},Lt=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?jt(n,o):Gt(n,o),a=Ot(h()(h()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Yt(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},Mt=function(e){var t=Ot(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=bt()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Kt(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===j.AUTO_DEBIT_APM?"".concat(k[e]).concat(rt.TRUSTLY):n===G.EASY_PAY?null!=i?i:Gt(n,e):"".concat(S[e],"/").concat(c,"/").concat(l,"/index.html")},Ut=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Bt=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Kt=function(e,t,n){var r,o=(r={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(r,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(r,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},Ht="web_url_",Yt=function(e,t){var n=Ht+e;localStorage.setItem(n,t)},Ft=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=zt(a,i),l=function(){var e=n.sort((function(e,t){return Rt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Rt(T,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Rt(T,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===ot.SDK_PORTAL?(null==l?void 0:l.url)||s:a===ot.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},jt=function(e,t){var n=Ht+e,r=localStorage.getItem(n);return null!=r?r:Gt(e,t)},Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===G.EASY_PAY?zt(ot.SDK_PORTAL,t):""},zt=function(e,t){return"".concat(k[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},Vt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Bt(r),i=Ft({configs:o,mid:n,env:t,pageName:ot.DOUBLE_FA});return i},Wt="antom_checkout_previous_ProductInfo_",qt=function(){function e(){g()(this,e)}return m()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=Wt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=Wt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},Qt=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function Zt(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Jt(e,"");if(t)return t;var n=Fe();e&&n&&Qt(e,n)}}catch(e){return""}};function $t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function en(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var tn=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Rt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Nt(t.sdkVersion,e.v)&&Zt(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=en(e,null!==(a=t.greyscale)&&void 0!==a?a:$t());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},nn=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Jt(t,"")}catch(e){return""}},rn=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return Qt(n,t)}catch(e){return!1}};function on(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(wt(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var an=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=sn(e,t,n);return r||((r=Jt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Rt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Nt(e.sdkVersion,n.v)&&Zt(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=en(n,null!==(a=e.greyscaleId)&&void 0!==a?a:$t());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},ln={production:{url:"https://cdn.marmot-cloud.com/page/antom-js/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},cn=new Set(Object.values(ln).map((function(e){return e.url}))),un=function(){function e(){g()(this,e),c()(this,"state","idle"),c()(this,"loadingPromise",null),c()(this,"apdidModule",null),c()(this,"retryCount",0),c()(this,"config",null)}var t,n;return m()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=ln[t.environment]){e.next=11;break}return a=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),e.abrupt("return",Promise.reject(a));case 11:if(s=n.url,cn.has(s)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(s)),this.state="failed",null===(l=t.callbacks)||void 0===l||null===(c=l.onLoadFailed)||void 0===c||c.call(l,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(s,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0;case 1:if(!(s<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),a=e.t0,s<1&&(this.retryCount++,this.state="idle");case 13:s++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),a;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now();return"noModule"in document.createElement("script")?new Promise((function(o,i){var a=window,s=a.APDID;if(s)return n._onLoadSuccess(s,r,t),void o();var l=Array.from(document.querySelectorAll('script[type="module"]')).find((function(t){return t.src===e})),c=l||document.createElement("script"),u=!1,d=function(){clearTimeout(m),c.removeEventListener("load",h),c.removeEventListener("error",f)},p=function(e){u||(u=!0,d(),c.parentNode&&c.parentNode.removeChild(c),i(e))},h=function(){if(!u){var e=a.APDID;e?(u=!0,d(),n._onLoadSuccess(e,r,t),o()):p(new Error("[ApdidLoader] Module loaded but window.".concat("APDID"," not found")))}},f=function(){p(new Error("[ApdidLoader] Failed to load module script: ".concat(e)))},m=setTimeout((function(){var n,r;u||(null===(n=t.callbacks)||void 0===n||null===(r=n.onLoadTimeout)||void 0===r||r.call(n),p(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4);c.addEventListener("load",h),c.addEventListener("error",f),l||(c.type="module",c.src=e,c.async=!0,c.crossOrigin="anonymous",(document.head||document.getElementsByTagName("head")[0]).appendChild(c))})):Promise.reject(new Error("[ApdidLoader] Module scripts are not supported"))}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();c()(un,"instance",null);var dn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},pn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),hn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},fn=c()(c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.AUTO_DEBIT_PAY,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),mn=function(e){return hn[e]||hn[pn.SG]},vn=function(e){return fn[e]||""},gn=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},yn=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||hn[pn.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=gn(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(fn).includes(this.scene)||!Object.values(hn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),_n=function(){function e(){g()(this,e),c()(this,"registry",new Map)}var t;return m()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),bn=new _n,En=function(){function e(){g()(this,e)}var t;return m()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=nt(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=s()(i()().mark((function t(n){var r,o,a,s,l,c,u,d,p,h=this,f=arguments;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:"SG",o=f.length>2?f[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(a=e.getSecurityConfigStorage(n),s=a.scene||vn(n),console.log("getSecurityScene",s),l=a.h5gateway||mn(r),console.log("preloadSecuritySDK",s),!bn.isReady(s)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!bn.isLoading(s)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=bn.get(s))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=gn(o),un.getInstance().scheduleLoad({environment:u}),d=new yn({scene:s,h5gateway:l,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){bn.setReady(s,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){bn.setFailed(s,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),bn.setLoading(s,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return bn.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===G.EASY_PAY?"2.0":"1.0",i=qt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:T,webAppVersion:""};s.webAppVersion=an(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Lt(l):Mt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();c()(En,"isWebAppPreloaded",!1),c()(En,"isSecuritySDKPreloaded",!1);var Sn=function(e){return e.optional_init="plugin_optional_init",e}({}),An=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),kn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),Tn=function(e){return e.onEventCallback="onEventCallback",e}({}),wn=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Pn=function(e){return e.reportAnalytics="reportAnalytics",e}({}),In=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(In||{}),Cn=function(){function e(t){var n=this;g()(this,e),c()(this,"merchantIdentifier",void 0),c()(this,"merchantName",void 0),c()(this,"session",void 0),c()(this,"paymentState",void 0),c()(this,"getMerchantSession",void 0),c()(this,"completePaymentAuthorized",void 0),c()(this,"completeApplePay",void 0),c()(this,"logError",void 0),c()(this,"isRecurring",!1),c()(this,"logger",void 0),c()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(ae.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(ae.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=In.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=In.success,o=!0})).catch((function(e){i(e),n.paymentState=In.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===In.pending?n.logError(ae.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(ae.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(ae.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return m()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=In.notStarted}},{key:"hasActiveCard",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),Rn=Cn;function Nn(e,t){return function(){return e.apply(t,arguments)}}var Dn,On,Ln=n(3089),Mn=Object.prototype.toString,xn=Object.getPrototypeOf,Un=Symbol.iterator,Bn=Symbol.toStringTag,Kn=(Dn=Object.prototype.hasOwnProperty,function(e,t){return Dn.call(e,t)}),Hn=function(e,t){for(var n=e,r=[];null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),Kn(n,t))return!0;n=xn(n)}return!1},Yn=(On=Object.create(null),function(e){var t=Mn.call(e);return On[t]||(On[t]=t.slice(8,-1).toLowerCase())}),Fn=function(e){return e=e.toLowerCase(),function(t){return Yn(t)===e}},jn=function(e){return function(t){return qe(t)===e}},Gn=Array.isArray,zn=jn("undefined");function Vn(e){return null!==e&&!zn(e)&&null!==e.constructor&&!zn(e.constructor)&&Jn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Wn=Fn("ArrayBuffer");var qn=jn("string"),Jn=jn("function"),Qn=jn("number"),Zn=function(e){return null!==e&&"object"===qe(e)},Xn=function(e){if(!Zn(e))return!1;var t=xn(e);return!(null!==t&&t!==Object.prototype&&null!==xn(t)||Hn(e,Bn)||Hn(e,Un))},$n=Fn("Date"),er=Fn("File"),tr=Fn("Blob"),nr=Fn("FileList");var rr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},or=void 0!==rr.FormData?rr.FormData:void 0,ir=Fn("URLSearchParams"),ar=["ReadableStream","Request","Response","Headers"].map(Fn),sr=et(ar,4),lr=sr[0],cr=sr[1],ur=sr[2],dr=sr[3];function pr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==qe(e)&&(e=[e]),Gn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(Vn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function hr(e,t){if(Vn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var fr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,mr=function(e){return!zn(e)&&e!==fr};var vr,gr=(vr="undefined"!=typeof Uint8Array&&xn(Uint8Array),function(e){return vr&&e instanceof vr}),yr=Fn("HTMLFormElement"),_r=Object.prototype.propertyIsEnumerable,br=Fn("RegExp"),Er=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};pr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var Sr,Ar,kr,Tr,wr=Fn("AsyncFunction"),Pr=(Sr="function"==typeof setImmediate,Ar=Jn(fr.postMessage),Sr?setImmediate:Ar?(kr="axios@".concat(Math.random()),Tr=[],fr.addEventListener("message",(function(e){var t=e.source,n=e.data;t===fr&&n===kr&&Tr.length&&Tr.shift()()}),!1),function(e){Tr.push(e),fr.postMessage(kr,"*")}):function(e){return setTimeout(e)}),Ir="undefined"!=typeof queueMicrotask?queueMicrotask.bind(fr):void 0!==Ln&&Ln.nextTick||Pr,Cr=function(e){return null!=e&&Jn(e[Un])},Rr={isArray:Gn,isArrayBuffer:Wn,isBuffer:Vn,isFormData:function(e){if(!e)return!1;if(or&&e instanceof or)return!0;var t=xn(e);if(!t||t===Object.prototype)return!1;if(!Jn(e.append))return!1;var n=Yn(e);return"formdata"===n||"object"===n&&Jn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Wn(e.buffer)},isString:qn,isNumber:Qn,isBoolean:function(e){return!0===e||!1===e},isObject:Zn,isPlainObject:Xn,isEmptyObject:function(e){if(!Zn(e)||Vn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lr,isRequest:cr,isResponse:ur,isHeaders:dr,isUndefined:zn,isDate:$n,isFile:er,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:tr,isRegExp:br,isFunction:Jn,isStream:function(e){return Zn(e)&&Jn(e.pipe)},isURLSearchParams:ir,isTypedArray:gr,isFileList:nr,forEach:pr,merge:function e(){for(var t=mr(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&hr(o,i)||i,s=Kn(o,a)?o[a]:void 0;Xn(s)&&Xn(t)?o[a]=e(s,t):Xn(t)?o[a]=e({},t):Gn(t)?o[a]=t.slice():r&&zn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!Vn(l)&&(pr(l,i),"object"===qe(l)&&!Gn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];_r.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return pr(t,(function(t,r){n&&Jn(t)?Object.defineProperty(e,r,{__proto__:null,value:Nn(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&xn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Yn,kindOfTest:Fn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(Gn(e))return e;var t=e.length;if(!Qn(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Un]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:yr,hasOwnProperty:Kn,hasOwnProp:Kn,hasOwnInPrototypeChain:Hn,getSafeProp:function(e,t){return null!=e&&Hn(e,t)?e[t]:void 0},reduceDescriptors:Er,freezeMethods:function(e){Er(e,(function(t,n){if(Jn(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Jn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return Gn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:hr,global:fr,isContextDefined:mr,isSpecCompliantForm:function(e){return!!(e&&Jn(e.append)&&"FormData"===e[Bn]&&e[Un])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if(Zn(n)){if(t.has(n))return;if(Vn(n))return n;if(!("toJSON"in n)){t.add(n);var r=Gn(n)?[]:{};return pr(n,(function(t,n){var o=e(t);!zn(o)&&(r[n]=o)})),t.delete(n),r}}return n}(e)},isAsyncFn:wr,isThenable:function(e){return e&&(Zn(e)||Jn(e))&&Jn(e.then)&&Jn(e.catch)},setImmediate:Pr,asap:Ir,isIterable:Cr,isSafeIterable:function(e){return null!=e&&Hn(e,Un)&&Cr(e)}},Nr=Rr.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"]);var Dr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Or=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Lr(e,t){return Rr.isArray(e)?e.map((function(e){return Lr(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Mr(e){var t=Object.create(null);return Rr.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return Lr(e,Or)}(e)})),t}var xr=Symbol("internals");function Ur(e){return e&&String(e).trim().toLowerCase()}function Br(e){return!1===e||null==e?e:Rr.isArray(e)?e.map(Br):function(e){return Lr(e,Dr)}(String(e))}function Kr(e,t,n,r,o){return Rr.isFunction(r)?r.call(this,t,n):(o&&(t=n),Rr.isString(t)?Rr.isString(r)?-1!==t.indexOf(r):Rr.isRegExp(r)?r.test(t):void 0:void 0)}var Hr=function(e,t){function n(e){v(this,n),e&&this.set(e)}return f(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Ur(t);if(o){var i=Rr.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Br(e))}}var i=function(e,t){return Rr.forEach(e,(function(e,n){return o(e,n,t)}))};if(Rr.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Rr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Nr[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)})),o}(e),t);else if(Rr.isObject(e)&&Rr.isSafeIterable(e)){var a,s,l,c=Object.create(null),d=u(e);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(!Rr.isArray(p))throw new TypeError("Object iterator must return a key-value pair");s=p[0],Rr.hasOwnProp(c,s)?(a=c[s],c[s]=Rr.isArray(a)?[].concat(Xe(a),[p[1]]):[a,p[1]]):c[s]=p[1]}}catch(e){d.e(e)}finally{d.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Ur(e)){var n=Rr.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Rr.isFunction(t))return t.call(this,r,n);if(Rr.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Ur(e)){var n=Rr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Ur(e)){var o=Rr.findKey(n,e);!o||t&&!Kr(0,n[o],o,t)||(delete n[o],r=!0)}}return Rr.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Kr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Rr.forEach(this,(function(r,o){var i=Rr.findKey(n,o);if(i)return t[i]=Br(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Br(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Rr.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&Rr.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=et(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[xr]=this[xr]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Ur(e);t[r]||(!function(e,t){var n=Rr.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Rr.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);Hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Rr.reduceDescriptors(Hr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),Rr.freezeMethods(Hr);var Yr=Hr;function Fr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==qe(t))return t;if(Rr.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof Yr&&(t=t.toJSON()),r.push(t),Rr.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);Rr.isUndefined(r)||(o[n]=r)}));else{if(!Rr.isPlainObject(t)&&function(e){if(Rr.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Rr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=et(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?"[REDACTED ****]":e(c);Rr.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}var jr=function(e){y(n,e);var t=b(n);function n(e,r,o,i,a){var s;return v(this,n),s=t.call(this,e),Object.defineProperty(Qe(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return f(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&Rr.hasOwnProp(e,"redact")?e.redact:void 0,n=Rr.isArray(t)&&t.length>0?Fr(e,t):Rr.toJSONObject(e);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:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=new n(e.message,t||e.code,r,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}}]),n}(P(Error));jr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",jr.ERR_BAD_OPTION="ERR_BAD_OPTION",jr.ECONNABORTED="ECONNABORTED",jr.ETIMEDOUT="ETIMEDOUT",jr.ECONNREFUSED="ECONNREFUSED",jr.ERR_NETWORK="ERR_NETWORK",jr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",jr.ERR_DEPRECATED="ERR_DEPRECATED",jr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",jr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",jr.ERR_CANCELED="ERR_CANCELED",jr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",jr.ERR_INVALID_URL="ERR_INVALID_URL",jr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Gr=jr,zr=n(6207).lW;function Vr(e){return Rr.isPlainObject(e)||Rr.isArray(e)}function Wr(e){return Rr.endsWith(e,"[]")?e.slice(0,-2):e}function qr(e,t,n){return e?e.concat(t).map((function(e,t){return e=Wr(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Jr=Rr.toFlatObject(Rr,{},null,(function(e){return/^is[A-Z]/.test(e)}));var Qr=function(e,t,n){if(!Rr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Rr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Rr.isUndefined(t[e])}))).metaTokens,o=n.visitor||h,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&Rr.isSpecCompliantForm(t),u=[];if(!Rr.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Rr.isDate(e))return e.toISOString();if(Rr.isBoolean(e))return e.toString();if(!c&&Rr.isBlob(e))throw new Gr("Blob is not supported. Use a Buffer instead.");if(Rr.isArrayBuffer(e)||Rr.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if(void 0!==zr)return zr.from(e);throw new Gr("Blob is not supported. Use a Buffer instead.",Gr.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new Gr("Object is too deeply nested ("+e+" levels). Max depth: "+l,Gr.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,n,o){var s=e;if(Rr.isReactNative(t)&&Rr.isReactNativeBlob(e))return t.append(qr(o,n,i),d(e)),!1;if(e&&!o&&"object"===qe(e))if(Rr.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!Rr.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r}))}(e,1);else if(Rr.isArray(e)&&function(e){return Rr.isArray(e)&&!e.some(Vr)}(e)||(Rr.isFileList(e)||Rr.endsWith(n,"[]"))&&(s=Rr.toArray(e)))return n=Wr(n),s.forEach((function(e,r){!Rr.isUndefined(e)&&null!==e&&t.append(!0===a?qr([n],r,i):null===a?n:n+"[]",d(e))})),!1;return!!Vr(e)||(t.append(qr(o,n,i),d(e)),!1)}var f=Object.assign(Jr,{defaultVisitor:h,convertValue:d,isVisitable:Vr});if(!Rr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Rr.isUndefined(n)){if(p(i),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),Rr.forEach(n,(function(n,a){!0===(!(Rr.isUndefined(n)||null===n)&&o.call(t,n,Rr.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],i+1)})),u.pop()}}(e),t};function Zr(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Xr(e,t){this._pairs=[],e&&Qr(e,this,t)}var $r=Xr.prototype;$r.append=function(e,t){this._pairs.push([e,t])},$r.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,Zr)}:Zr;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var eo=Xr;function to(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function no(e,t,n){if(!t)return e;e=e||"";var r,o=Rr.isFunction(n)?{serialize:n}:n,i=Rr.getSafeProp(o,"encode")||to,a=Rr.getSafeProp(o,"serialize");if(r=a?a(t,o):Rr.isURLSearchParams(t)?t.toString():new eo(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var ro=function(){function e(){v(this,e),this.handlers=[]}return f(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Rr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),oo=ro,io={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ao={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:eo,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},so="undefined"!=typeof window&&"undefined"!=typeof document,lo="object"===("undefined"==typeof navigator?"undefined":qe(navigator))&&navigator||void 0,co=so&&(!lo||["ReactNative","NativeScript","NS"].indexOf(lo.product)<0),uo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,po=so&&window.location.href||"http://localhost",ho=p(p({},e),ao);function fo(e){if(e>100)throw new Gr("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Gr.ERR_FORM_DATA_DEPTH_EXCEEDED)}var mo=function(e){function t(e,n,r,o){fo(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Rr.isArray(r)?r.length:i,s?(Rr.hasOwnProp(r,i)?r[i]=Rr.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(Rr.hasOwnProp(r,i)&&Rr.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Rr.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Rr.isFormData(e)&&Rr.isFunction(e.entries)){var n={};return Rr.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/\w+|\[(\w*)]/g;null!==(t=r.exec(e));)fo(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},vo=function(e,t){return null!=e&&Rr.hasOwnProp(e,t)?e[t]:void 0};var go={transitional:io,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Rr.isObject(e);if(i&&Rr.isHTMLForm(e)&&(e=new FormData(e)),Rr.isFormData(e))return o?JSON.stringify(mo(e)):e;if(Rr.isArrayBuffer(e)||Rr.isBuffer(e)||Rr.isStream(e)||Rr.isFile(e)||Rr.isBlob(e)||Rr.isReadableStream(e))return e;if(Rr.isArrayBufferView(e))return e.buffer;if(Rr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=vo(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Qr(e,new ho.classes.URLSearchParams,p({visitor:function(e,t,n,r){return ho.isNode&&Rr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=Rr.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=vo(this,"env"),l=s&&s.FormData;return Qr(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Rr.isString(e))try{return(t||JSON.parse)(e),Rr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=vo(this,"transitional")||go.transitional,n=t&&t.forcedJSONParsing,r=vo(this,"responseType"),o="json"===r;if(Rr.isResponse(e)||Rr.isReadableStream(e))return e;if(e&&Rr.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,vo(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw Gr.from(e,Gr.ERR_BAD_RESPONSE,this,null,vo(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ho.classes.FormData,Blob:ho.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rr.forEach(["delete","get","head","post","put","patch","query"],(function(e){go.headers[e]={}}));var yo=go;function _o(e,t){var n=this||yo,r=t||n,o=Yr.from(r.headers),i=r.data;return Rr.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function bo(e){return!(!e||!e.__CANCEL__)}var Eo=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this,null==e?"canceled":e,Gr.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return f(n)}(Gr);function So(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Gr("Request failed with status code "+n.status,n.status>=400&&n.status<500?Gr.ERR_BAD_REQUEST:Gr.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var Ao=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var ko=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,Xe(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)}]},To=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=Ao(50,250);return ko((function(n){if(n&&"number"==typeof n.loaded){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);var d=l({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(d)}}),n)},wo=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Po=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rr.asap((function(){return e.apply(void 0,n)}))}},Io=ho.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,ho.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(ho.origin),ho.navigator&&/(msie|trident)/i.test(ho.navigator.userAgent)):function(){return!0},Co=ho.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Rr.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Rr.isString(r)&&s.push("path=".concat(r)),Rr.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),Rr.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Ro=/^https?:(?!\/\/)/i,No=/[\t\n\r]/g;function Do(e,t){if("string"==typeof e&&Ro.test(function(e){return function(e){for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(No,"")}(e)))throw new Gr('Invalid URL: missing "//" after protocol',Gr.ERR_INVALID_URL,t)}function Oo(e,t,n,r){Do(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Do(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}var Lo=function(e){return e instanceof Yr?p({},e):e};function Mo(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Rr.isPlainObject(e)&&Rr.isPlainObject(t)?Rr.merge.call({caseless:r},e,t):Rr.isPlainObject(t)?Rr.merge({},t):Rr.isArray(t)?t.slice():t}function o(e,t,n,o){return Rr.isUndefined(t)?Rr.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Rr.isUndefined(t))return r(void 0,t)}function a(e,t){return Rr.isUndefined(t)?Rr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Rr.hasOwnProp(t,i)?r(n,o):Rr.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l={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,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Lo(e),Lo(t),0,!0)}};return Rr.forEach(Object.keys(p(p({},e),t)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Rr.hasOwnProp(l,r)?l[r]:o,a=i(Rr.hasOwnProp(e,r)?e[r]:void 0,Rr.hasOwnProp(t,r)?t[r]:void 0,r);Rr.isUndefined(a)&&i!==s||(n[r]=a)}})),Rr.hasOwnProp(t,"validateStatus")&&Rr.isUndefined(t.validateStatus)&&!1===function(n){var r=Rr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Rr.isUndefined(r)){if(!Rr.isPlainObject(r))return;if(Rr.hasOwnProp(r,n))return r[n]}var o=Rr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Rr.isPlainObject(o)&&Rr.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Rr.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var xo=["content-type","content-length"];var Uo=function(e){var t=Mo({},e),n=function(e){return Rr.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=Yr.from(s),t.url=no(Oo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=Rr.getSafeProp(l,"username")||"",h=Rr.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw Gr.from(t,Gr.ERR_BAD_OPTION_VALUE,e)}}if(Rr.isFormData(r)&&(ho.hasStandardBrowserEnv||ho.hasStandardBrowserWebWorkerEnv||Rr.isReactNative(r)?s.setContentType(void 0):Rr.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=et(t,2),r=n[0],o=n[1];xo.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),ho.hasStandardBrowserEnv&&(Rr.isFunction(o)&&(o=o(t)),!0===o||null==o&&Io(t.url))){var f=i&&a&&Co.read(a);f&&s.set(i,f)}return t},Bo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l=Uo(e),c=l.data,u=Yr.from(l.headers).normalize(),d=l.responseType,p=l.onUploadProgress,h=l.onDownloadProgress;function f(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(r),l.signal&&l.signal.removeEventListener("abort",r)}var m=new XMLHttpRequest;function v(){if(m){var r=Yr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());So((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}}if(m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Gr("Request aborted",Gr.ECONNABORTED,e,m)),f(),m=null)},m.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Gr(r,Gr.ERR_NETWORK,e,m);o.event=t||null,n(o),f(),m=null},m.ontimeout=function(){var t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",r=l.transitional||io;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new Gr(t,r.clarifyTimeoutError?Gr.ETIMEDOUT:Gr.ECONNABORTED,e,m)),f(),m=null},void 0===c&&u.setContentType(null),"setRequestHeader"in m&&Rr.forEach(Mr(u),(function(e,t){m.setRequestHeader(t,e)})),Rr.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),h){var g=To(h,!0),y=et(g,2);i=y[0],s=y[1],m.addEventListener("progress",i)}if(p&&m.upload){var _=To(p),b=et(_,2);o=b[0],a=b[1],m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)}(l.cancelToken||l.signal)&&(r=function(t){m&&(n(!t||t.type?new Eo(null,e,m):t),m.abort(),f(),m=null)},l.cancelToken&&l.cancelToken.subscribe(r),l.signal&&(l.signal.aborted?r():l.signal.addEventListener("abort",r)));var E,S,A=(E=l.url,(S=/^([-+\w]{1,25}):(?:\/\/)?/.exec(E))&&S[1]||"");if(A&&!ho.protocols.includes(A))return n(new Gr("Unsupported protocol "+A+":",Gr.ERR_BAD_REQUEST,e)),void f();m.send(c||null)}))},Ko=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Gr?t:new Eo(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new Gr("timeout of ".concat(t,"ms exceeded"),Gr.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){return e.addEventListener("abort",o,{once:!0})}));var s=n.signal;return s.unsubscribe=function(){return Rr.asap(a)},s}},Ho=n(3697),Yo=n(8946),Fo=n(4331),jo=n(8193),Go=o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:i=0;case 6:if(!(i<r)){e.next=13;break}return a=i+n,e.next=10,t.slice(i,a);case 10:i=a,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),zo=function(){var e=Ho(o().mark((function e(t,n){var r,i,a,s,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,s=jo(Vo(t));case 4:return e.next=6,Yo(s.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(Fo(jo(Go(c,n)),Yo),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),i=!0,a=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==s.return){e.next=23;break}return e.next=23,Yo(s.return());case 23:if(e.prev=23,!i){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),Vo=function(){var e=Ho(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(Fo(jo(t),Yo),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,Yo(n.read());case 7:if(r=e.sent,i=r.done,a=r.value,!i){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,a;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,Yo(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),Wo=function(e,t,n,r){var i,s=zo(e,t),l=0,c=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(o().mark((function t(){var r,i,a,u,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.next();case 3:if(r=t.sent,i=r.done,a=r.value,!i){t.next=10;break}return c(),e.close(),t.abrupt("return");case 10:u=a.byteLength,n&&(d=l+=u,n(d)),e.enqueue(new Uint8Array(a)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),c(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},qo=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},Jo=function(e,t,n){return t+2<n&&qo(e.charCodeAt(t+1))&&qo(e.charCodeAt(t+2))};function Qo(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var t=e.indexOf(",");if(t<0)return 0;var n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){for(var o=r.length,i=r.length,a=0;a<i;a++)if(37===r.charCodeAt(a)&&a+2<i){var s=r.charCodeAt(a+1),l=r.charCodeAt(a+2);qo(s)&&qo(l)&&(o-=2,a+=2)}var c=0,u=i-1,d=function(e){return e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e))};u>=0&&(61===r.charCodeAt(u)?(c++,u--):d(u)&&(c++,u-=3)),1===c&&u>=0&&(61===r.charCodeAt(u)||d(u))&&c++;var p=3*Math.floor(o/4)-(c||0);return p>0?p:0}for(var h=0,f=0,m=r.length;f<m;f++){var v=r.charCodeAt(f);if(37===v&&Jo(r,f,m))h+=1,f+=2;else if(v<128)h+=1;else if(v<2048)h+=2;else if(v>=55296&&v<=56319&&f+1<m){var g=r.charCodeAt(f+1);g>=56320&&g<=57343?(h+=4,f++):h+=3}else h+=3}return h}var Zo="1.18.1",Xo=Rr.isFunction,$o=function(e){if(!Rr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ei=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},ti=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},ni=function(e){var t=void 0!==Rr.global&&null!==Rr.global?Rr.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Rr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=i.fetch,l=i.Request,c=i.Response,u=s?Xo(s):"function"==typeof fetch,d=Xo(l),h=Xo(c);if(!u)return!1;var f,m=u&&Xo(n),v=u&&("function"==typeof r?(f=new r,function(e){return f.encode(e)}):function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new l(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),g=d&&m&&ei((function(){var e=!1,t=new l(ho.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),y=h&&m&&ei((function(){return Rr.isReadableStream(new c("").body)})),_={stream:y&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!_[e]&&(_[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Gr("Response type '".concat(e,"' is not supported"),Gr.ERR_NOT_SUPPORT,n)})}));var b=function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!Rr.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!Rr.isSpecCompliantForm(t)){e.next=9;break}return n=new l(ho.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!Rr.isArrayBufferView(t)&&!Rr.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(Rr.isURLSearchParams(t)&&(t+=""),!Rr.isString(t)){e.next=16;break}return e.next=15,v(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Rr.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?b(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(o().mark((function e(t){var n,i,a,u,h,f,v,S,A,k,T,w,P,I,C,R,N,D,O,L,M,x,U,B,K,H,Y,F,j,G,z,V,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,fe,me,ve,ge,ye,_e,be;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Uo(t),i=n.url,a=n.method,u=n.data,h=n.signal,f=n.cancelToken,v=n.timeout,S=n.onDownloadProgress,A=n.onUploadProgress,k=n.responseType,T=n.headers,w=n.withCredentials,P=void 0===w?"same-origin":w,I=n.fetchOptions,C=n.maxContentLength,R=n.maxBodyLength,N=Rr.isNumber(C)&&C>-1,D=Rr.isNumber(R)&&R>-1,O=function(e){return Rr.hasOwnProp(t,e)?t[e]:void 0},L=s||fetch,k=k?(k+"").toLowerCase():"text",M=Ko([h,f&&f.toAbortSignal()],v),x=null,U=M&&M.unsubscribe&&function(){M.unsubscribe()},K=null,H=function(){return new Gr("Request body larger than maxBodyLength limit",Gr.ERR_BAD_REQUEST,t,x)},e.prev=11,Y=void 0,(F=O("auth"))&&(j=Rr.getSafeProp(F,"username")||"",G=Rr.getSafeProp(F,"password")||"",Y={username:j,password:G}),ti(i)&&(z=new URL(i,ho.origin),Y||!z.username&&!z.password||(V=$o(z.username),W=$o(z.password),Y={username:V,password:W}),(z.username||z.password)&&(z.username="",z.password="",i=z.href)),Y&&(T.delete("authorization"),T.set("Authorization","Basic "+btoa((o=(Y.username||"")+":"+(Y.password||""),encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!N||"string"!=typeof i||!i.startsWith("data:")){e.next=21;break}if(!(Qo(i)>C)){e.next=21;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 21:if(!D||"get"===a||"head"===a){e.next=29;break}return e.next=24,b(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(B=q,!(q>R)){e.next=29;break}throw H();case 29:if(J=D&&(Rr.isReadableStream(u)||Rr.isStream(u)),Q=function(e,t,n){return Wo(e,65536,(function(e){if(D&&e>R)throw K=H();t&&t(e)}),n)},!g||"get"===a||"head"===a||!A&&!J){e.next=43;break}if(null!=B){e.next=38;break}return e.next=35,E(T,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=B;case 39:(0!==(B=e.t0)||J)&&(Z=new l(i,{method:"POST",body:u,duplex:"half"}),Rr.isFormData(u)&&(X=Z.headers.get("content-type"))&&T.setContentType(X),Z.body&&($=A&&wo(B,To(Po(A)))||[],ee=et($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===a||"head"===a){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||g||"get"===a||"head"===a){e.next=49;break}throw new Gr("Stream request bodies are not supported by the current fetch implementation",Gr.ERR_NOT_SUPPORT,t,x);case 49:return Rr.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in l.prototype,Rr.isFormData(u)&&(oe=T.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&T.delete("content-type"),T.set("User-Agent","axios/"+Zo,!1),ie=p(p({},I),{},{signal:M,method:a.toUpperCase(),headers:Mr(T.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),x=d&&new l(i,ie),e.next=57,d?L(x,I):L(i,ie);case 57:if(ae=e.sent,se=Yr.from(ae.headers),!N){e.next=63;break}if(!(null!=(le=Rr.toFiniteNumber(se.getContentLength()))&&le>C)){e.next=63;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 63:return ce=y&&("stream"===k||"response"===k),y&&ae.body&&(S||N||ce&&U)&&(ue={},["status","statusText","headers"].forEach((function(e){ue[e]=ae[e]})),de=Rr.toFiniteNumber(se.getContentLength()),pe=S&&wo(de,To(Po(S),!0))||[],he=et(pe,2),fe=he[0],me=he[1],0,ve=function(e){if(N&&e>C)throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},ae=new c(Wo(ae.body,65536,ve,(function(){me&&me(),U&&U()})),ue)),k=k||"text",e.next=68,_[Rr.findKey(_,k)||"text"](ae,t);case 68:if(ge=e.sent,!N||y||ce){e.next=73;break}if(null!=ge&&("number"==typeof ge.byteLength?ye=ge.byteLength:"number"==typeof ge.size?ye=ge.size:"string"==typeof ge&&(ye="function"==typeof r?(new r).encode(ge).byteLength:ge.length)),!("number"==typeof ye&&ye>C)){e.next=73;break}throw new Gr("maxContentLength size of "+C+" exceeded",Gr.ERR_BAD_RESPONSE,t,x);case 73:return!ce&&U&&U(),e.next=76,new Promise((function(e,n){So(e,n,{data:ge,headers:Yr.from(ae.headers),status:ae.status,statusText:ae.statusText,config:t,request:x})}));case 76:return e.abrupt("return",e.sent);case 79:if(e.prev=79,e.t1=e.catch(11),U&&U(),!(M&&M.aborted&&M.reason instanceof Gr)){e.next=88;break}throw(_e=M.reason).config=t,x&&(_e.request=x),e.t1!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),_e;case 88:if(!K){e.next=91;break}throw x&&!K.request&&(K.request=x),K;case 91:if(!(e.t1 instanceof Gr)){e.next=94;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 94:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=98;break}throw be=new Gr("Network Error",Gr.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(be,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 98:throw Gr.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 99:case"end":return e.stop()}var o}),e,null,[[11,79]])})));return function(t){return e.apply(this,arguments)}}()},ri=new Map,oi=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=ri;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:ni(r)),s=n;return n},ii=(oi(),{http:null,xhr:Bo,fetch:{get:oi}});Rr.forEach(ii,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var ai=function(e){return"- ".concat(e)},si=function(e){return Rr.isFunction(e)||null===e||!1===e};var li={getAdapter:function(e,t){for(var n,r,o=(e=Rr.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!si(n)&&void 0===(r=ii[(s=String(n)).toLowerCase()]))throw new Gr("Unknown adapter '".concat(s,"'"));if(r&&(Rr.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=et(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(ai).join("\n"):" "+ai(l[0]):"as no adapter specified";throw new Gr("There is no suitable adapter to dispatch the request "+c,Gr.ERR_NOT_SUPPORT)}return r},adapters:ii};function ci(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Eo(null,e)}function ui(e){return ci(e),e.headers=Yr.from(e.headers),e.data=_o.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),li.getAdapter(e.adapter||yo.adapter,e)(e).then((function(t){ci(e),e.response=t;try{t.data=_o.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Yr.from(t.headers),t}),(function(t){if(!bo(t)&&(ci(e),t&&t.response)){e.response=t.response;try{t.response.data=_o.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Yr.from(t.response.headers)}return Promise.reject(t)}))}var di={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){di[e]=function(n){return qe(n)===e||"a"+(t<1?"n ":" ")+e}}));var pi={};di.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Zo+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Gr(r(o," has been removed"+(t?" in "+t:"")),Gr.ERR_DEPRECATED);return t&&!pi[o]&&(pi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},di.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var hi={assertOptions:function(e,t,n){if("object"!==qe(e)||null===e)throw new Gr("options must be an object",Gr.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new Gr("option "+i+" must be "+l,Gr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Gr("Unknown option "+i,Gr.ERR_BAD_OPTION)}},validators:di},fi=hi.validators,mi=function(){function e(t){v(this,e),this.defaults=t||{},this.interceptors={request:new oo,response:new oo}}var t;return f(e,[{key:"request",value:(t=a(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=function(){if(!r.stack)return"";var e=r.stack.indexOf("\n");return-1===e?"":r.stack.slice(e+1)}();try{e.t0.stack?i&&(a=i.indexOf("\n"),s=-1===a?-1:i.indexOf("\n",a+1),l=-1===s?"":i.slice(s+1),String(e.t0.stack).endsWith(l)||(e.t0.stack+="\n"+i)):e.t0.stack=i}catch(e){}}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Mo(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&hi.assertOptions(r,{silentJSONParsing:fi.transitional(fi.boolean),forcedJSONParsing:fi.transitional(fi.boolean),clarifyTimeoutError:fi.transitional(fi.boolean),legacyInterceptorReqResOrdering:fi.transitional(fi.boolean),advertiseZstdAcceptEncoding:fi.transitional(fi.boolean),validateStatusUndefinedResolves:fi.transitional(fi.boolean)},!1),null!=o&&(Rr.isFunction(o)?t.paramsSerializer={serialize:o}:hi.assertOptions(o,{encode:fi.function,serialize:fi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),hi.assertOptions(t,{baseUrl:fi.spelling("baseURL"),withXsrfToken:fi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Rr.merge(i.common,i[t.method]);i&&Rr.forEach(["delete","get","head","post","put","patch","query","common"],(function(e){delete i[e]})),t.headers=Yr.concat(a,i);var s=[],l=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){l=l&&e.synchronous;var n=t.transitional||io;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)}}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,p=0;if(!l){var h=[ui.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,u),d=h.length,c=Promise.resolve(t);p<d;)c=c.then(h[p++],h[p++]);return c}d=s.length;for(var f=t;p<d;){var m=s[p++],v=s[p++];try{f=m(f)}catch(e){v.call(this,e);break}}try{c=ui.call(this,f)}catch(e){return Promise.reject(e)}for(p=0,d=u.length;p<d;)c=c.then(u[p++],u[p++]);return c}},{key:"getUri",value:function(e){return no(Oo((e=Mo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();Rr.forEach(["delete","get","head","options"],(function(e){mi.prototype[e]=function(t,n){return this.request(Mo(n||{},{method:e,url:t,data:n&&Rr.hasOwnProp(n,"data")?n.data:void 0}))}})),Rr.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request(Mo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}mi.prototype[e]=t(),"query"!==e&&(mi.prototype[e+"Form"]=t(!0))}));var vi=mi,gi=function(){function e(t){if(v(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new Eo(e,t,o),n(r.reason))}))}return f(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),yi=gi;var _i={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(_i).forEach((function(e){var t=et(e,2),n=t[0],r=t[1];_i[r]=n}));var bi=_i;var Ei=function e(t){var n=new vi(t),r=Nn(vi.prototype.request,n);return Rr.extend(r,vi.prototype,n,{allOwnKeys:!0}),Rr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Mo(t,n))},r}(yo);Ei.Axios=vi,Ei.CanceledError=Eo,Ei.CancelToken=yi,Ei.isCancel=bo,Ei.VERSION=Zo,Ei.toFormData=Qr,Ei.AxiosError=Gr,Ei.Cancel=Ei.CanceledError,Ei.all=function(e){return Promise.all(e)},Ei.spread=function(e){return function(t){return e.apply(null,t)}},Ei.isAxiosError=function(e){return Rr.isObject(e)&&!0===e.isAxiosError},Ei.mergeConfig=Mo,Ei.AxiosHeaders=Yr,Ei.formToJSON=function(e){return mo(Rr.isHTMLForm(e)?new FormData(e):e)},Ei.getAdapter=li.getAdapter,Ei.HttpStatusCode=bi,Ei.default=Ei;var Si=Ei,Ai=bt(),ki=Ai._light_sandbox,Ti=Ai.groupId,wi=Ai.requestHost,Pi={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:wi||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Ii="ALIPW3SG",Ci="ANTOM_PAYMENT_WEB",Ri=Ti||"GROUP_20240627151021",Ni=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},Di=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:wi||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=Ti||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===ki?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},Oi=".".charCodeAt(0),Li=/\\(\\)?/g,Mi=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),xi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ui=/^\w*$/;function Bi(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function Ki(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Je()(e);return"number"===n||"boolean"===n||null===e||Ui.test(e)||!xi.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===Oi&&r.push(""),n.replace(Mi,(function(e,t,n,o){var i=e;return n?i=o.replace(Li,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function Hi(e,t,n){var r=null===e?void 0:function(e,t){for(var n=Ki(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[Bi(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var Yi=function(e,t){var n=Hi(e,"Result-Status")||Hi(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:oe.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:oe.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=Hi(e,"Tips")||Hi(e,"tips",""),o=Hi(e,"Memo")||Hi(e,"memo","");return{success:!1,traceId:t,errorCode:oe.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},Fi=bt()._sandbox;function ji(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Di(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Ni(null==e?void 0:e.hostSign,i)||Pi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Ci,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Ci.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Ri),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ii),"sdk-version",T||""),e.headers);return"true"!==Fi&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Si.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function Gi(e,t,n){return zi.apply(this,arguments)}function zi(){return zi=s()(i()().mark((function e(t,n,r){var o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{a.browserInfo.browserJavaEnabled=(null===(s=navigator)||void 0===s?void 0:s.javaEnabled())||!1}catch(e){}return"WAP"===a.terminalType&&(a.osType=mt?"IOS":"ANDROID"),l=[h()(h()({},t),{},{envInfo:a,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=ji(n),e.next=9,u({data:l});case 9:if(d=e.sent,p=d.data,f=d.headers,m=p||{},v=Hi(f,"Mgw-TraceId")||Hi(f,"mgw-traceid",""),m.traceId=v||"",null==(g=Yi(f,v))||!g.errorCode){e.next=21;break}throw y=(null==m?void 0:m.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:v}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:v}).send(),e.abrupt("return",m);case 25:return e.prev=25,e.t0=e.catch(5),E=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),S=null!==e.t0&&void 0!==e.t0&&null!==(b=e.t0.message)&&void 0!==b&&b.includes("timeout")?oe.TIMEOUT:"",A=(null==E?void 0:E.errorCode)||S,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:A,msg:JSON.stringify((null==E?void 0:E.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:A,errorMessage:null==E?void 0:E.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),zi.apply(this,arguments)}function Vi(e,t,n){return Wi.apply(this,arguments)}function Wi(){return Wi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Gi(t,h()(h()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),Wi.apply(this,arguments)}function qi(){return qi=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(A[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),qi.apply(this,arguments)}function Ji(e,t,n){return Qi.apply(this,arguments)}function Qi(){return Qi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Gi(t,h()(h()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function Zi(e,t,n,r){return Xi.apply(this,arguments)}function Xi(){return Xi=s()(i()().mark((function e(t,n,r,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",a),e.abrupt("return",Gi(n,h()(h()({},r),{},{hostSign:a,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),Xi.apply(this,arguments)}var $i=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ea=function(){function e(t,n){g()(this,e),c()(this,"_applePayService",void 0),c()(this,"_parseData",void 0),c()(this,"_sessionData",void 0),c()(this,"_isFinish",!1),c()(this,"_options",void 0),c()(this,"logger",void 0),c()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:X.prod},t,{product:G.CARD_APPLE_PAY}),this._applePayService=new Rn(n)}return m()(e,[{key:"canMakePayments",value:function(e){return Rn.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:ae.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var a=function(){var e=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ge(wn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=Zi,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,a();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=Ji,e.t1=r,e.t2=o._options.environment,e.next=7,a();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(l,c,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:ae.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),u);try{this._applePayService.startPay(this._parseData)}catch(e){u(ae.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),ta=ea,na=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"applePay",void 0),c()(Ze()(r),"logger",void 0),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(An).concat(Object.values(Sn))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=Rn.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new ta(h()(h()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&We.publish(new Ge(Tn.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:$i.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Sn.optional_init:this.onOptionalInit(e,t);break;case An.canMakePayments:this.onCanMakePayments(e,t);break;case An.createComponent:this.onCreateComponent(e,t);break;case An.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Ve),ra=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function oa(e,t){for(var n,r=e||window.navigator.userAgent||"",o=ra,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(ia(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(ia(t,r,n.iosScheme),n.iosScheme):void 0;ia(t,r,"")}function ia(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var aa=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var sa=function(e){var t,n,r,o,i;switch(e){case G.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case G.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},la=m()((function e(){g()(this,e)}));c()(la,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var ca={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},ua={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},da=function(){function e(){g()(this,e)}return m()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{ha.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in la.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:ca.spmId},{eventAlias:ca.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:ua.spmId},{eventAlias:ua.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();c()(da,"abnormalEventNameSet",new Set),c()(da,"nonComplianceEventKeys",{});var pa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;g()(this,e),c()(this,"timeoutId",void 0),c()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return m()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),ha=new pa,fa={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},ma=h()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},fa),va=function(){function e(t,n){g()(this,e),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return m()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=h()({},e),l=null==e?void 0:e.title;return ma[l]&&(s.title=ma[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:h()(h()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ma[s]&&(a.title=ma[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=da.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ma[s]&&(a.title=ma[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();c()(va,"instance",void 0);var ga={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:"2.0.22"}},ya=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=tn(e,{sdkVersion:T,productScene:t,mid:n});if(r)null===(o=va.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&rn(T+t,i),i):i=nn(T+t)}catch(e){return""}},_a=function(e,t){var n,r=(n={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(n,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(n,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},ba=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=bt()||{},d=u.host,p=ya(a,o,s,l),h=p||n;p&&(null===(e=va.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));Ct()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var f=_a(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===j.ELEMENT_ADDRESS)return"".concat(k[t],"/element-address/pages/address/index.html");if($e()(Object.values(F)).includes(r)){var m=!1;try{m=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return m?"".concat(k[t],"/elements/pages/express_checkout/index.html"):"".concat(k[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(S[t],"/").concat(r,"/").concat(f,"/index.html")},Ea=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,f=e.hostSign,m=void 0===f?"":f,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=ba(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),b=tn(l,{sdkVersion:T,productScene:o,mid:g})?"true":"false",E=bt(),S=E._sandbox,A=E._light_sandbox,k=E.requestHost,w=void 0===k?"":k,P=E.groupId,I=void 0===P?"":P,C=E.LOCAL_MOCK,R=E._displayType,N=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:b,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:T,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(sa(o)),isPreload:h||"",hostSign:m||""});C&&(N.LOCAL_MOCK=C),w&&(N.requestHost=w),I&&(N.groupId=I),"light_sandbox"!==a&&"true"!==A||(N.sandbox="true"),"sandbox"!==a&&"true"!==S||(N.shadow="true"),R&&(N.displayType=R);var D=lt(N);return Ct()&&(console.log("appUpgrade#getIframeUrl#appMatched",b),console.log("appUpgrade#getIframeUrl#url",_,D)),{path:_,locationSearch:D}},Sa=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},Aa=2e4,ka="MERCHANT_CONFIRM_ABORT",Ta="MERCHANT_CONFIRM_TIMEOUT",wa=Symbol("BEFORE_CONFIRM_TIMEOUT");function Pa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=s()(i()().mark((function e(t){var n,r,o,a,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:Aa,o=new Promise((function(e,t){r=setTimeout((function(){return t(wa)}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return a=e.sent,e.abrupt("return",{result:a,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),e.t0!==wa){e.next=13;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 13:throw e.t0;case 14:return e.prev=14,clearTimeout(r),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,9,14,17]])}))),Ia.apply(this,arguments)}var Ca=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}(Ca||{}),Ra=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(Ra||{});function Na(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Vt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(it.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"&notRedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var Da=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},Oa=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?X.prod:i,s=t.shipping,l=t.merchantAmount,u=void 0===l?null:l,d=t.merchantCurrency,p=void 0===d?null:d;g()(this,e),c()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),c()(this,"session",null),c()(this,"paymentSessionData",void 0),c()(this,"parseData",void 0),c()(this,"paymentStatus",void 0),c()(this,"cancelReason",null),c()(this,"logger",void 0),c()(this,"env",void 0),c()(this,"shipping",void 0),c()(this,"merchantAmount",void 0),c()(this,"merchantCurrency",void 0),c()(this,"onBeforeConfirm",null),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=u,this.merchantCurrency=p}var t,n,r,o;return m()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=Ra.PENDING,e.cancelReason="USER_CANCEL",e.session.onvalidatemerchant=function(){var t=s()(i()().mark((function t(r){var o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=Zi,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(a=t.sent)&&a.success&&a.merchantSessionObject?(s=JSON.parse(a.merchantSessionObject),e.session.completeMerchantValidation(s)):(null===(l=e.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=s()(i()().mark((function r(o){var a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D;return i()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:Ca.APPLE_PAY_TOKEN_ERROR})},s=null==o?void 0:o.payment,l=s.token,c=s.billingContact,u=s.shippingContact,!l){r.next=46;break}if(p={instPaymentToken:JSON.stringify(l)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,f=h.requiredBillingContactFields,m=h.requiredShippingContactFields,!It(f)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!It(m)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=12,_=Date.now(),r.next=16,Pa((function(){return e.onBeforeConfirm()}));case 16:if(b=r.sent,E=b.result,S=b.timedOut,A=E,(k=S||Date.now()-_>=Aa)&&(null===(T=e.logger)||void 0===T||T.logError({title:"sdk_before_confirm_timeout"}),A=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:A}),A){r.next=29;break}return e.cancelReason=k?"MERCHANT_TIMEOUT":"MERCHANT_ABORT",null===(w=e.session)||void 0===w||null===(P=w.completePayment)||void 0===P||P.call(w,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:k?Ta:ka}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(12),null===(I=e.logger)||void 0===I||I.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(C=e.session)||void 0===C||null===(R=C.completePayment)||void 0===R||R.call(C,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:ka}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:N=r.sent,e.setPayStatus(N),t(N),r.next=48;break;case 46:null===(D=e.logger)||void 0===D||D.logError({title:"a3753.b103030.c386485.d507486"}),a();case 48:case"end":return r.stop()}}),r,null,[[12,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===Ra.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});var o="MERCHANT_TIMEOUT"===e.cancelReason?Ta:ka;n({errorCode:"MERCHANT_ABORT"===e.cancelReason||"MERCHANT_TIMEOUT"===e.cancelReason?o:Ca.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=Ji,e.t1=h()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=Ra.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==Ra.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=Ra.NORMAL,e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},a=o.recurringInfo,s=a?14:2,this.isCanMakePayments(s)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(s,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(l=this.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=Ra.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(It(n)||It(o)||It(null==r?void 0:r.supportedNetworks)||It(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return vt?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ge(wn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),La="#".concat(be,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(be,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Ce,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Ce,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Ce,"-desktop{}\n"),Ma=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=La,document.head.appendChild(e)},xa=function(e,t,n){var r=document.createElement("div");r.id=Te,n.componentSign===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Ce,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Ce,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop?r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===te.mobile&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);St(0,o)},Ua=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),Ba=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Ua,document.head.appendChild(n),At();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,St(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),Ka(e,t),r}},Ka=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(Ee,"-btn-").concat(e,"' src=\"").concat(Le,'"/>'),i=document.createElement("div");i.classList.add("".concat(Ee,"-").concat(e),"".concat(Ee,"-hidden")),i.id=Ee,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Ha=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Se,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),o.id=Se,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Ya="\n .".concat(Re,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Re,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Re,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Re,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"-drawer-enter {\n animation: slideIn ").concat(Oe,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Re,"-drawer-exit {\n animation: slideOut ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Fa=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(we),n.id=we,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(Et(),"px"),e.appendChild(n)},ja=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()},Ga="desktop",za=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{Ga=t;var i=document.createElement("div");i.classList.add("".concat(Re,"overlay"),"".concat(Re,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(Re,"modal"),"".concat(Re,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(Re,"modal-mobile"),"".concat(Re,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);Fa(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var Va,Wa,qa,Ja=function(){function e(t){g()(this,e),c()(this,"app",void 0),c()(this,"AMSSDK",void 0),c()(this,"platform",void 0),c()(this,"_performanceData",[]),c()(this,"_loadAppPromiseResolve",null),c()(this,"_isInitComponent",void 0),c()(this,"_globalData",void 0),c()(this,"popupApp",void 0),c()(this,"appDomain",void 0),c()(this,"createIframeNode",void 0),c()(this,"createPreloadIframeNode",void 0),c()(this,"_selector",void 0),c()(this,"_appVersion",void 0),c()(this,"_isRetention",void 0),c()(this,"_allowSubmitPayCallAhead",void 0),c()(this,"_actionQueryPromise",null),c()(this,"_actionSubmitPromise",null),c()(this,"_renderParams",null),c()(this,"_componentSign",j.NONE),c()(this,"_appLocationSearch",void 0),c()(this,"_renderDisplayType",Y.popup),c()(this,"_multipleCallbackEvents",void 0),c()(this,"_isAppWebview",void 0),c()(this,"_isNativeAppWebview",void 0),c()(this,"_merchantAppointParam",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(_e),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=gt?te.mobile:te.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,a;return m()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===te.desktop?"PC":"WAP",sdkVersion:T,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;j.CASHIER_PAYMENT_APM!==this._componentSign&&(j.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(s()(i()().mark((function o(){var a,s,l,c,u;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a||null===(a=a.paymentSessionConfig)||void 0===a?void 0:a.productScene,l=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||s});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,l);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,f=this;if(this._isInitComponent)return this.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(fe.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var m=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(m):"",g="".concat(ye).concat(v),y=(null==this?void 0:this._renderDisplayType)===Y.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},b=_.productSceneVersion,E=void 0===b?"":b,S=_.productScene,A=void 0===S?"":S,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,w=T.autoDebitWithToken,P=void 0!==w&&w,I=T.requireFastSdk,C=void 0!==I&&I,R=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,N=void 0===R?{}:R;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),j.EASY_PAY_WALLET!==this._componentSign||A!==G.EASY_PAY||"1.0"!==E||P||!C){if(j.AUTO_DEBIT_WALLET===this._componentSign){var D,O,L,M=(null===(D=this._renderParams)||void 0===D||null===(D=D.paymentSessionMetaData)||void 0===D?void 0:D.action)||{},x=_t()?null==M||null===(O=M.web)||void 0===O?void 0:O.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType,U=(null==M?void 0:M.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(N)}if(j.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===C&&"1.0"===E?void this.handleAuthUrlInfo(N):Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_START_OF_LOADING}),this._renderDisplayType===Y.inline){var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ie)||Ma(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,ye,g);B&&this.renderInlineLoading(t,B),(K=document.createElement("style")).innerHTML=Ya,document.head.appendChild(K)}var K;if(this._renderDisplayType===Y.popup){var H,F;Ba(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Ae,o.classList.add("".concat(Ae,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Ae,'-title" class="').concat(Ae,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Ae,'-sub-title"\n class="').concat(Ae,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Ae,"-btn-block-").concat(e,'">\n <div id="').concat(Ae,'-remain" class="').concat(Ae,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Ae,'-leave" class="').concat(Ae,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Ae,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var z=Na(null===(H=this._renderParams)||void 0===H?void 0:H.paymentSessionMetaData,!0===(null===(F=this._renderParams)||void 0===F?void 0:F.notRedirectAfterComplete)),V=function(){};null!=z&&z.allowClickOutsideClose&&(V=this.closeBtnFunc.bind(this));var W=this.closeBtnFunc.bind(this);Ha({platform:this.platform,onClickOutside:V,closeBtnFunc:W}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return f.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),f._isInitComponent=!1,f.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(N)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===j.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&xa(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(ke);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(Et(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:De)})).catch((function(e){return t.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(ve.eventCallback.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=s()(i()().mark((function t(n,r){var o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D,O,L,M,x;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},f={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a?void 0:a.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(s=e._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},m=(null===(l=e._renderParams)||void 0===l?void 0:l.paymentSessionMetaData)||{},v=m.extendInfo,g=void 0===v?"":v,y=m.action,_=!1,b=!1,E=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},S=E.skipSdkQuery,A=E.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,b=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!aa()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(j.ELEMENT_PAYMENT===e._componentSign&&(f.paymentSessionConfig={productScene:null==(i=f.paymentSessionConfig)?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion}),j.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(j.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(j.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!A){t.next=23;break}if(!Dt(A,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!S){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=Na(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(j.CASHIER_PAYMENT_CARD!==e._componentSign&&j.VAULTING_CARD!==e._componentSign){t.next=35;break}return f.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(j.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(P=f.paymentSessionConfig||{},I=P.productSceneVersion,C=void 0===I?"":I,R=P.productScene,N=void 0===R?"":R,null===(w=e._renderParams)||void 0===w||null===(w=w.paymentSessionMetaData)||void 0===w||null===(w=w.action)||void 0===w||!w.skipSdkQuery||!b){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(N!==G.EASY_PAY||"2.0"!==C){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(j.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(M=(null===(D=e._renderParams)||void 0===D||null===(D=D.paymentSessionMetaData)||void 0===D?void 0:D.action)||{},"SMS"!==(x=_t()?null==M||null===(O=M.web)||void 0===O?void 0:O.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),Vi(f,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),j.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:fe.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(ve.error.name,i),e.dispatchToSDK(ve.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(j.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(ve.eventCallback.name,fe.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[j.CASHIER_PAYMENT_CARD,j.VAULTING_CARD,j.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(ve.error.name,{code:fe.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var i}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var a={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},l=Na(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=s()(i()().mark((function e(t){var n,r,s,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,D;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==G.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=l?!l.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||j.EASY_PAY_WALLET!==o._componentSign,j.EASY_PAY_WALLET===o._componentSign&&(h=a.paymentSessionConfig||{},f=h.productSceneVersion,m=void 0===f?"":f,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,E=(b=void 0===_?{}:_).enableSignAgreement,S=void 0!==E&&E,A=b.autoDebitWithToken,k=void 0!==A&&A,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},w=T.paymentMethodInfoView,P=(void 0===w?{}:w).paymentMethodType,I=void 0===P?"":P,g!==G.EASY_PAY||"2.0"!==m||k||(C=o._isAppWebview||!1,R=o._isNativeAppWebview||!1,a.signAgreement=S,"ALIPAY_CN"!==I||C&&R||(N=oa(void 0,o.AMSSDK.logger))&&"https"!==N&&(a.h5FromApp=encodeURIComponent(N)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),D=(null==l||null===(n=l.buildSubmitPayExtParams)||void 0===n?void 0:n.call(l,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},a.extParams=D,e.t0=Ji,e.t1=a,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===at(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(ye);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(ye,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(ke);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=Sa(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=Ea({renderDisplayType:Y.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(ba(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=Ea({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),f=h.path,m=h.locationSearch;this._appLocationSearch=m,-1!==f.indexOf("?")?this.app.src="".concat(f,"&").concat(m):this.app.src="".concat(f,"?").concat(m),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(ve.error.name,Object.assign({},fe.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(ve.error.name,fe.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ct(e.data)){var n=JSON.parse(e.data);if(n.name!==ne.APP_TO_SDK&&n.name!==ne.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(fe.NOT_JSON_FORMAT),this.dispatchToSDK(ve.error.name,fe.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(ye).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,za({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,a=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),De),s=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,ja(),clearTimeout(a),clearTimeout(s)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return a.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Pe,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===ve.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===R.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===R.CONTAINER_ELEMENT&&this.dispatchToSDK(ve.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(ve).map((function(e){return ve[e].name})).includes(e.context.event))if(e.context.event!==ve.getDeviceId.name)if(e.context.event!==ve.getUserAgentFromSdk.name){if(e.context.event===ve.popWindow.name)return o=document.querySelector(".".concat(Re,"overlay")),i="desktop"===Ga?document.querySelector(".".concat(Re,"modal")):document.querySelector(".".concat(Re,"modal-mobile")),o.classList.remove("".concat(Re,"fadeIn")),o.classList.add("".concat(Re,"fadeOut")),"desktop"===Ga?(i.classList.remove("".concat(Re,"fadeIn")),i.classList.add("".concat(Re,"fadeOut"))):(i.classList.remove("".concat(Re,"-drawer-enter")),i.classList.add("".concat(Re,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),Oe);var o,i,a,s;if(e.context.event!==ve.getGlobalData.name)if(e.context.event!==ve.setGlobalData.name)if(e.context.event!==ve.popupWindow.name){if(e.context.event===ve.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===ve.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(ve.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===ve.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===ve.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===ve.close.name)return this.closeBtnFunc();if(e.context.event===ve.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==ve.submitForm.name)if(e.context.event!==ve.hideCloseButton.name)if(e.context.event!==ve.showCloseButton.name)if(e.context.event!==ve.setMaskCloseButton.name){if(e.context.event===ve.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==ve.declareCheckoutInfo.name)if(e.context.event!==ve.declareEventCallbackInfo.name)if(e.context.event!==ve.appHeartBeat.name)if(e.context.event!==ve.beforeSubmit.name){var c,u,d;if(e.context.event===ve.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==ve.getGooglePayToken.name)if(e.context.event===ve.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===ve.closePaymentPolling.name&&this.dispatchToApp({context:{event:ve.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==ve.getApplePayToken.name)if(e.context.event!==ve.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(ve.validateFieldsResult.forwardName,e.context);else new Oa({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else Da(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:h()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(ve.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(ve.beforeSubmit.name,e.context.data);var f=Fe();this.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:f,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var m;this.createDialog(null===(m=e.context)||void 0===m?void 0:m.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===ve.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Se));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(ye,"-").concat(c):ye,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===Y.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(ye,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(ye,"-").concat(this.platform,"-animation"));var p="".concat(ye,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var f=(v=ye,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),m=document.createElement("style");m.id=p,m.type="text/css",m.innerHTML=f,document.getElementsByTagName("head")[0].appendChild(m),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===Y.inline)null===(y=document.getElementById(Te))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===re.BLANK)return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(se.NormalUrl,"");if(!(c.target!==re.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(se.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var f=new Date,m="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:m}).then((function(){var e=((new Date).getTime()-f.getTime())/1e3;d(se.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-f.getTime())/1e3;p(se.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(se.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(se.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(se.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(se.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(se.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(se.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(Ae,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(Ae,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,f,m,v,g,y=document.getElementById("".concat(Ae,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.corner,"px"),"stroke"===(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,b,E,S,A,k,T,w=document.getElementById("".concat(Ae,"-leave"));w&&(w.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,w.style.fontSize="".concat(null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontSize,"px"),w.style.color=null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontColor,w.style.borderRadius="".concat(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.corner,"px"),"stroke"===(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.type)?w.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):w.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(ve.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(Ee);e?null==t||t.classList.remove("".concat(Ee,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Ee,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Se);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Se,"-hidden")):null==t||t.classList.add("".concat(Se,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:ne.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:me,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(fe.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(me,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===G.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return b=e.sent,e.next=9,this._actionSubmitPromise;case 9:E=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:b,submitResult:E,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(a=this._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(s=this._renderParams)||void 0===s?void 0:s.configParams,prefillValue:null===(l=this._renderParams)||void 0===l?void 0:l.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(f=this._renderParams)||void 0===f?void 0:f.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(m=this._renderParams)||void 0===m||null===(m=m.paymentSessionMetaData)||void 0===m?void 0:m.clientId,instanceId:null===(v=this.AMSSDK)||void 0===v?void 0:v._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Se))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(ke);null==o||o.classList.add("".concat(ke,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(ye).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(ve.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(ve.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===te.mobile?"touchend":"click",i=document.getElementById("".concat(Ae,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(Ae))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Ae,"-hidden")),e.classList.add("".concat(Ae,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(Ae),t=document.getElementById(ye),e&&(e.classList.remove("".concat(Ae,"-show")),e.classList.add("".concat(Ae,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Ae,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Oe))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),Qa=[{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:z.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:An.canMakePayments,optional_init:Sn.optional_init,createComponent:An.createComponent,destroyComponent:An.destroyComponent}},{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:z.APM,paymentMethodTypes:[le.PAYPAL_CHECKOUT,le.PAYPAL_PAYLATER,le.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:kn.mountComponent,destroyComponent:kn.destroyComponent}}],Za=function(e){return"boolean"!=typeof e||e},Xa=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"logger",void 0),c()(Ze()(r),"onEventCallback",(function(e){We.publish(new Ge(Tn.onEventCallback,JSON.stringify(e)))})),c()(Ze()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),c()(Ze()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),c()(Ze()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&le.PAYPAL_VAULT===i&&r.onEventCallback({code:ae.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),c()(Ze()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;Za(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),c()(Ze()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,f=u.enableMessages,m=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),f?y.append("components","messages,buttons"):y.append("components","buttons"),V.intent===m&&le.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),le.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),c()(Ze()(r),"onShippingChange",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"createOrder",function(){var e=s()(i()().mark((function e(t,n,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vi({paymentSessionData:o,paymentSessionConfig:s},{env:a,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(l=c.extendInfo)&&void 0!==l&&l.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),c()(Ze()(r),"onApprove",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"onCancel",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"destroyComponent",function(){var e=s()(i()().mark((function e(t,n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(kn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:h()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;Za(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case kn.mountComponent:this.renderPaypalButton(e,t);break;case kn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Ve),$a=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===at(t)&&(i=document.querySelector(t)),null===i){var a={code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:ne.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:ve.error.name,data:a}})}n===Y.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},es=function(e){var t=document.body||null;t&&t.appendChild(e)},ts=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Tn)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===Tn.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(Ve),ns=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(wn)}},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===wn.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Ve),rs=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"logger",void 0),t.logger=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Pn)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Pn.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Ve),os=window.navigator.userAgent||"",is=function(){var e=os.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},as=/android/i.test(os),ss=/iphone|ipad|ipod/i.test(os),ls=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(os)&&as&&os.indexOf("Version")<0,cs=/qqbrowser/i.test(os),us=/firefox/i.test(os);/baidubrowser/i.test(os);function ds(e){window.location.href=e}function ps(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function hs(){Va||((Va=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),Va.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(Va))}function fs(e){Va.src=e}function ms(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function vs(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var gs,ys,_s,bs=5e3;function Es(e,t){gs=+new Date,ys=setTimeout((function(){!(!!Wa&&document[Wa])&&e&&e()}),t||5e3)}function Ss(e){void 0!==qa?document.addEventListener(qa,(function(){return As(e)})):window.addEventListener("pagehide",(function(){return As(e)}))}function As(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||bs;o-(gs||+new Date)<i&&n(t)}}(e),ys&&clearTimeout(ys))}function ks(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function Ts(e){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ts(e)}function ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(n),!0).forEach((function(t){Is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Is(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rs(r.key),r)}}function Rs(e){var t=function(e,t){if("object"!==Ts(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ts(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(Wa="hidden",qa="visibilitychange"):void 0!==e.mozHidden?(Wa="mozHidden",qa="mozvisibilitychange"):void 0!==e.msHidden?(Wa="msHidden",qa="msvisibilitychange"):void 0!==e.webkitHidden&&(Wa="webkitHidden",qa="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(_s||(_s={}));var Ns=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=ms(r,i),n.options.scheme=ms(t,i),ss&&is()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=ms(r,i),n.evokeLink()):t?(n.options.scheme=ms(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=Ps(Ps({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:_s.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&ks(n))throw new Error("请填写正确格式的scheme");if(o&&!ks(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&ks(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=_s.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=_s.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;ss?is()>9||cs?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!ks(l)&&(this.evokeAppBy.type=_s.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(vs(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Ds=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"originOptions",void 0),c()(this,"logger",void 0),c()(this,"_eventCenter",void 0),c()(this,"_instanceId",void 0),c()(this,"_storageId",void 0),c()(this,"_appendParams",void 0),c()(this,"_componentApp",void 0),c()(this,"securitySdkMap",void 0),c()(this,"plugins",void 0),this._instanceId=Fe(),this.originOptions=t,this.options={},this._eventCenter=new st,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=kt(n);r||(kt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new va(ga,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),va.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return m()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=yt(kt(n),{});if([X.prod,X.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return qi.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){kt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||G.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Rt(T,i)>=0&&Rt(a,T)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&We.isSubscribed(n)&&We.publish(new Ge(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=d()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?G.EASY_PAY:n,o=e.scene,i=void 0===o?G.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||vn(a),l=bn.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:pn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||vn(e.product),n=bn.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=En.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||vn(t.product),e.next=4,bn.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||vn(e.product),a=o.h5gateway||mn(e.region),s=bn.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=gn(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);un.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new yn({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){bn.setReady(i,d),t&&t(),e(d)}),(function(e){bn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));bn.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){bn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=bt()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(fe.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===ee.WAP&&(this.options.env.osType=mt?$.IOS:vt?$.ANDROID:$.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(fe.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=Q.component),this.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=Z.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==at(e.onError))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.error.name,e.onError,ve.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==at(e.onPaymentMethodSelected))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.paymentMethodSelected.name,e.onPaymentMethodSelected,ve.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==at(e.onSizeChanged))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.sizeChanged.name,e.onSizeChanged,ve.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==at(e.onLog))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.log.name,e.onLog,ve.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==at(e.onEventCallback))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.eventCallback.name,e.onEventCallback,ve.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==at(e.onClose))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.close.name,e.onClose,ve.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.beforeSubmit.name,function(){var n=s()(i()().mark((function n(r){var o,a;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=Fe(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:a=n.sent,t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:a}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),ve.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==at(e.onChange))throw new Error(fe.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.onChange.name,e.onChange,ve.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===at(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===ee.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new Ns(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===G.ELEMENT_ADDRESS&&(n=this._getPlugin(G.ELEMENT_ADDRESS)),n}}]),e}();function Os(e,t){return Ls.apply(this,arguments)}function Ls(){return Ls=s()(i()().mark((function e(t,n){var r,o,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,a=void 0===o?[]:o,l=r.paymentRequestId,Array.isArray(a)){e.next=3;break}return e.abrupt("return");case 3:if(0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(a),requestId:l}),a.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,a=null;t===r.AIRWALLEX?a=Pt({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":l},timeOut:3},n):a=Pt({src:i,timeOut:3},n);o.push(a)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),Ls.apply(this,arguments)}var Ms=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):j.NONE},xs=function(e){try{return[JSON.parse(wt(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},Us=function(e){var t=xs(e),n=tt()(t,2),r=n[0],o=n[1];return function(e){var t;_t()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===G.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},Bs=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:Y.popup},e),r=Us(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=tt()(r,2),i=o[0],a=o[1],s=Ms(i);if($e()(Object.values(F)).includes(s)&&n.renderDisplayType===Y.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===G.ELEMENT_ADDRESS&&(s=j.ELEMENT_ADDRESS),s===j.NONE)return Promise.reject({code:fe.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;kt(dn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},Ks=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;g()(this,r),t=n.call(this,e),c()(Ze()(t),"channelType",void 0),c()(Ze()(t),"productSceneVersion",void 0),c()(Ze()(t),"timer",void 0),c()(Ze()(t),"_validateResolveMap",new Map);var o=new Ja({appVersion:e.appVersion});return o.setRender($a),o.setPreloadRender(es),t._registerPlugin(me,o),t._componentApp=t._getPlugin(me),t.registerBusAbility(),t}return m()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=Q.component,this.options.networkMode=this.options.networkMode||Z.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===G.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===Z.proxy?(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(fe.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,Os(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===j.VAULTING_CARD?j.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;We.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==X.prod,this.logger),We.clear(),We.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(n)}))}}),We.subscribe(new ts((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(ve.eventCallback.name,e)}))),We.subscribe(new ns((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),We.subscribe(new rs(this.logger)),We.subscribe(new na(this.logger)),We.subscribe(new Xa(this.logger)),Qa.forEach((function(e){var n;null!=e&&e.busSubscriber&&We.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&We.publish(new Ge(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&We.isSubscribed(i)?We.publishForResult(new Ge(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.popup}).then((function(e){return Bs(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(ve.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&We.isSubscribed(n))return We.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(En.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.inline,selector:t}).then((function(e){return Bs(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(ve.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&We.isSubscribed(n))return We.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==G.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=Fe();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&We.isSubscribed(a)?We.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=Fe();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:ge.name,data:{},eventCallbackId:n});var r=function(){var t=s()(i()().mark((function t(n){var r,o,a;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),a={isValid:!1},i=null==n?void 0:n.data,"object"===Je()(i)&&null!==i&&"boolean"==typeof i.isValid&&(a=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:a.isValid?"true":"false"}),o&&(o(a),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(ve.validateFieldsResult.forwardName,r,ve.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}(Ds),Hs=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=Fe();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&We.isSubscribed(a)?We.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(Ks);function Ys(e,t){return function(e){return"https://checkout.antom.com/".concat(e?"elements2":"elements","/pages")}(t)+(e.startsWith("/")?e:"/".concat(e))}var Fs="PROD";function js(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=d()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var Gs={i18nPrefix:"OPENSDK"},zs=function(e){y(n,e);var t=b(n);function n(e,r,o,i){var a,s,c,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];v(this,n);var d,p=i,h=void 0;return e&&"object"===qe(e)?(d=e.message,h=e.params):d=e,c=t.call(this,!Gs.i18n||u&&"SERVER_API"===o?d:Gs.i18n.get({id:"".concat(Gs.i18nPrefix,".").concat(r),dm:(null===(a=(s=Gs).getDefaultMessage)||void 0===a?void 0:a.call(s))||d},h)),l(Qe(c),"code",void 0),l(Qe(c),"name","OpenSDKError"),l(Qe(c),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),l(Qe(c),"source","SDK_INTERNAL"),l(Qe(c),"traceId",void 0),l(Qe(c),"reason",void 0),c.reason=d,c.code=r,c.source=o,c.traceId=p,c}return f(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new Vs(e instanceof Error?e.message:(null===(t=(r=Gs).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){Gs=p(p({},Gs),e)}}]),n}(P(Error)),Vs=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKBridgeError"),e}return f(n)}(zs),Ws=function(e){return Xe(new Set(e))},qs=function(e,t){return e.filter((function(e){return!t.includes(e)}))},Js=function(e,t){return e.filter((function(e){return t.includes(e)}))},Qs=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},Zs=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function Xs(e,t){if(0===t.length)return e;for(var n,r=Xe(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var $s=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(il("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},el=/^\+?\d+$/,tl=function(e){if(!el.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(il("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},nl=function(e){return new RegExp(e.map((function(e){return ol(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},rl=function(e){return new RegExp("^[".concat(e.map((function(e){return ol(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},ol=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},il=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},al=3.5,sl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(v(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(qe(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(qe(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(qe(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=Ws(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=qs(l,s);var c,u,d,p=Js(s,l);(this.seps=Xs(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>al)&&((c=Math.ceil(this.alphabet.length/al))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,Xe(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=Xs(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=nl(this.guards),this.sepsRegExp=nl(this.seps),this.allowedCharsRegExp=rl([].concat(Xe(this.alphabet),Xe(this.guards),Xe(this.seps)))}return f(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat(Xe(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(Qs)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:tl(String(e))}))),i.every(Zs)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(qe(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(qe(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=Xe(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=Xs(n,c));if((l=o).push.apply(l,Xe(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=Xs(n,n),(d=o).unshift.apply(d,Xe(n.slice(u))),(p=o).push.apply(p,Xe(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var f=h/2;o=o.slice(f,f+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=u(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=Xs(a,[o].concat(Xe(this.salt),Xe(a)).slice(0,a.length));s.push($s(Array.from(c),d)),a=d}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),ll=new sl("intl-open-sdk",6);function cl(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var ul=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+ll.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))};function dl(e){if("onpagehide"in self){var t=function(t){t.persisted||e("pagehide")};return self.addEventListener("pagehide",t),function(){return self.removeEventListener("pagehide",t)}}if("undefined"!=typeof document&&void 0!==document.visibilityState){var n=!1,r=function(){"hidden"!==document.visibilityState||n||(n=!0,e("visibilitychange"))};return document.addEventListener("visibilitychange",r),function(){return document.removeEventListener("visibilitychange",r)}}var o=self,i=function(){e("beforeunload")};return o.addEventListener("beforeunload",i),function(){return o.removeEventListener("beforeunload",i)}}var pl=function(){function e(t,n){var r=this;v(this,e),l(this,"targetPort",void 0),l(this,"handlers",new Map),l(this,"debugCallback",void 0),l(this,"name",void 0),l(this,"initialized",!1),l(this,"recipientIsReady",!1),l(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(p(p({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t,this.once("ready",(function(){r.recipientIsReady=!0}))}return f(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onData",value:function(e){return this.initialized||(this.send("ready"),this.initialized=!0),this.on("data",e)}},{key:"sendData",value:function(e){var t=this;this.recipientIsReady?this.send("data",e):this.once("ready",(function(){t.recipientIsReady=!0,t.send("data",e)}))}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var i=a(o().mark((function i(a){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(a.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),i,null,[[1,7]])})));return function(e){return i.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o){try{t(o)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.handlers.get(e);n&&n.delete(t)}},{key:"send",value:function(e,t){var n={id:ul("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(p(p({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),hl=function(){function e(t){v(this,e),l(this,"targetPorts",[]),l(this,"name",void 0),this.name=t}var t;return f(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,Xe(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=cl((function(){return Promise.all(i.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(i.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=et(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(l({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return p(p({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),fl=function(){function e(t,n){v(this,e),l(this,"targetPort",void 0),l(this,"name",void 0),this.targetPort=n,this.name=t}return f(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:i=r.type.split(":"),a=et(i,2),a[0],"START_COLLECT_VALUE"===a[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),ml="OPENSDK@HANDSHAKE",vl="OPENSDK@READY_HANDSHAKE",gl="OPENSDK@UPDATE_CONFIG",yl="OPENSDK@UPDATE_CONFIG_REPLY",_l="OPENSDK@SUBMIT",bl="OPENSDK@SUBMIT_REPLY",El="OPENSDK@REDIRECT",Sl="OPENSDK@OPEN_MODAL",Al="OPENSDK@OPEN_MODAL_ERROR",kl="OPENSDK@CLOSE_MODAL",Tl="OPENSDK@ERROR",wl="OPENSDK@HANDSHAKE_ACK",Pl="OPENSDK@TRANSFER_RECEIVE_PORT",Il="OPENSDK@MESSAGE",Cl="OPENSDK@TRANSFER_SEND_PORT",Rl="OPENSDK@TRANSFER_APP_PORT",Nl="OPENSDK@TRANSFER_MODAL_PORT",Dl="OPENSDK@TRANSFER_MODAL_APPEARANCE",Ol="OPENSDK@TRANSFER_MODAL_INITIALDATA",Ll="OPENSDK@HEIGHT_UPDATE",Ml="OPENSDK@DESTROY_ELEMENT",xl=n(8098),Ul=[Pl,Cl,Nl,Dl,Ol,Al,Rl,kl,Sl,El,Il,Ml],Bl="@@global",Kl="@@native",Hl=function(){function e(t,n,r){var o,i,a=this;(v(this,e),l(this,"targetWindow",void 0),l(this,"currentWindow",void 0),l(this,"targetOrigin","*"),l(this,"scope",void 0),l(this,"handlers",new Map),l(this,"mode",void 0),l(this,"resizeObserver",void 0),l(this,"debugCallback",void 0),l(this,"receivePort",void 0),l(this,"openModalOff",void 0),l(this,"openModalPromise",void 0),l(this,"handleMessage",(function(e){var t=e.data;if(t&&t.type){var n=t.type.split(":"),r=et(n,2),o=r[0],i=r[1];if(a.scope!==Kl){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==Kl&&(s||t.type.endsWith(Tl)||t.type.endsWith(Il))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){n.length>=3?n(t.payload,e.ports,{origin:e.origin,source:e.source}):n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return f(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Pl,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Pl,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort(Cl,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:ul("bridge"),type:"SYSTEM_".concat(Tl),payload:{message:"Target window not set"}},"OUT"));var o={id:ul("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Tl,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(bl,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send(Il,{type:e,message:t})}},{key:"sendRedirect",value:function(e){if("WEBAPP"===this.mode){if(!e.url)throw new Vs("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e.url)}catch(e){throw new Vs("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(El,e)}}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new Vs("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new Vs("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(El,{url:e,mode:t})}}},{key:"sendDestroyElement",value:function(e){e||(e=this.scope),"WEBAPP"===this.mode&&this.send(Ml,{elementKey:e})}},{key:"openModal",value:function(e,t){var n,r=this;if(this.openModalPromise)return this.openModalPromise;var o=ul("modal_");this.send(Sl,p(p({},e),{},{scope:this.scope,initialData:t,modalId:o})),null===(n=this.openModalOff)||void 0===n||n.call(this);var i=new Promise((function(e,t){var n=function(){},o=function(){},i=function(){n(),o(),r.openModalOff=void 0,r.openModalPromise=void 0};n=r.once(Al,(function(e){i(),t(new zs(e.message,e.code,e.source))}));o=r.on(Rl,(function(n,r){if(null==r||!r[0])return i(),void t(new Vs("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL"));i(),e(new pl(n,r[0]))})),r.openModalOff=i}));return this.openModalPromise=i,i}},{key:"closeModal",value:function(){var e;null===(e=this.openModalOff)||void 0===e||e.call(this),this.send(kl)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o,i,a){try{t(o,i,a)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new Vs("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(ml,function(){var r=a(o().mark((function r(i){var a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==i?void 0:i.elementMode)?i.isMainElement?n.getReceivePort().then((function(e){t(i,e)})):n.getSendPort().then((function(e){t(i,e)})).catch((function(){t(i)})):t(i),a=0,s=xl((function(e){(Math.abs(e-a)>10||Math.abs((e-a)/a)>.01)&&(a=e,n.send(Ll,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&s(n.height)})),n.resizeObserver.observe(document.body),n.send(wl,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(vl),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Tl),this.scope===Kl)return e;var t=Ul.includes(e)?Bl:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Tl),this.scope===Kl)return e;var t=Ul.includes(e)?Bl:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:ul(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Pl,(function(n,r){e.receivePort||(e.receivePort=new hl(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on(Cl,(function(e,r){if(r){var o=new fl(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,Bl)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",Kl,t)}},{key:"getBridge",value:function(t,n){if(n===Kl||n===Bl)throw new Error("Scope cannot be ".concat(Kl," or ").concat(Bl));return new e(t,n)}}]),e}(),Yl=n(4005),Fl=n.n(Yl),jl=n(8306),Gl=["trackId","userPathAuto","keyFormat"],zl=function(){function e(t){v(this,e),l(this,"options",void 0),l(this,"intlTrackerOptions",void 0),l(this,"tracker",void 0),l(this,"trackerInitPromise",void 0),l(this,"trackId",void 0),this.initialOptions(t)}var t;return f(e,[{key:"initialOptions",value:function(e){var t,n,r,o,i=e||{},a=(i.trackId,i.userPathAuto),s=i.keyFormat,l=Yl(i,Gl);(this.options=p(p(p({env:"PROD",compactExtraInfo:!0},this.options),l),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),this.intlTrackerOptions=p(p({},this.options),{},{userPathAuto:a,keyFormat:s}),e&&"trackId"in e)&&(this.trackId=e.trackId||"",this.options=p(p(p({},this.options),l),{},{mdata:p(p(p({},null===(o=this.options)||void 0===o?void 0:o.mdata),l.mdata),{},{trackId:this.trackId})}));return this.options}},{key:"loadTacker",value:function(e){var t=this,n=(0,jl.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull");return n?n.then((function(n){var r=n.variable;if(r)return new r(t.initialOptions(e))})):Promise.resolve(void 0)}},{key:"initTracker",value:(t=a(o().mark((function e(t){var n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:if(t||!this.trackerInitPromise){e.next=4;break}return e.abrupt("return",this.trackerInitPromise);case 4:if(n=this.loadTacker(t).then((function(e){var n,o,i,a,s,l;return e&&(e.set({keyFormat:null!==(n=null!==(o=null==t?void 0:t.keyFormat)&&void 0!==o?o:null===(i=r.intlTrackerOptions)||void 0===i?void 0:i.keyFormat)&&void 0!==n?n:"origin",userPathAuto:null!==(a=null!==(s=null==t?void 0:t.userPathAuto)&&void 0!==s?s:null===(l=r.intlTrackerOptions)||void 0===l?void 0:l.userPathAuto)&&void 0!==a&&a}),r.tracker=e),e})),t){e.next=8;break}return this.trackerInitPromise=n.finally((function(){r.trackerInitPromise=void 0})),e.abrupt("return",this.trackerInitPromise);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({mdata:{trackId:e}})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),e}(),Vl=new zl;var Wl;!function(e){e["ar-SA"]="ar-SA",e.kn="kn",e.as="as",e.bho="bho",e["pl-PL"]="pl-PL",e["ko-KR"]="ko-KR",e["da-DK"]="da-DK",e["de-DE"]="de-DE",e["ru-RU"]="ru-RU",e["fr-FR"]="fr-FR",e.gu="gu",e["nl-BE"]="nl-BE",e["nl-NL"]="nl-NL",e["cs-CZ"]="cs-CZ",e.ro="ro",e["lo-LA"]="lo-LA",e["my-MM"]="my-MM",e["bn-BD"]="bn-BD",e["bn-IN"]="bn-IN",e.mr="mr",e["ms-MY"]="ms-MY",e.ml="ml",e.mni="mni",e["ne-NP"]="ne-NP",e.or="or",e["pt-BR"]="pt-BR",e["pt-PT"]="pt-PT",e.pa="pa",e["sv-SE"]="sv-SE",e["ja-JP"]="ja-JP",e.sr="sr",e["si-LK"]="si-LK",e["sk-SK"]="sk-SK",e["tr-TR"]="tr-TR",e["tl-PH"]="tl-PH",e.te="te",e.ta="ta",e["th-TH"]="th-TH",e["ur-PK"]="ur-PK",e["ur-IN"]="ur-IN",e["uk-UA"]="uk-UA",e["iw-IL"]="iw-IL",e["es-ES"]="es-ES",e["es-MX"]="es-MX",e.hu="hu",e["it-IT"]="it-IT",e["in-ID"]="in-ID",e["hi-IN"]="hi-IN",e["vi-VN"]="vi-VN",e["en-PK"]="en-PK",e["en-PL"]="en-PL",e["en-FR"]="en-FR",e["en-PH"]="en-PH",e["en-CZ"]="en-CZ",e["en-CA"]="en-CA",e["en-MM"]="en-MM",e["en-US"]="en-US",e["en-BD"]="en-BD",e["en-MY"]="en-MY",e["en-NP"]="en-NP",e["en-LK"]="en-LK",e["en-TH"]="en-TH",e["en-ES"]="en-ES",e["en-SG"]="en-SG",e["en-HU"]="en-HU",e["en-ID"]="en-ID",e["en-GB"]="en-GB",e["en-VN"]="en-VN",e["en-HK"]="en-HK",e["en-KR"]="en-KR",e["zh-TW"]="zh-TW",e["zh-HK"]="zh-HK",e["zh-SG"]="zh-SG",e["zh-CN"]="zh-CN",e["ar-IQ"]="ar-IQ",e["ckb-IQ"]="ckb-IQ",e.ku="ku",e["kk-KZ"]="kk-KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(Wl||(Wl={}));var ql={};ql[Wl["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",ql[Wl.kn]="埃纳德语",ql[Wl.as]="阿萨姆语",ql[Wl.bho]="博杰普尔语",ql[Wl["pl-PL"]]="波兰语 (波兰)",ql[Wl["ko-KR"]]="朝鲜语 (韩国)",ql[Wl["da-DK"]]="丹麦语 (丹麦)",ql[Wl["de-DE"]]="德语 (德国)",ql[Wl["ru-RU"]]="俄语 (俄罗斯)",ql[Wl["fr-FR"]]="法语 (法国)",ql[Wl.gu]="古加拉提语",ql[Wl["nl-BE"]]="荷兰语 (比利时)",ql[Wl["nl-NL"]]="荷兰语 (荷兰)",ql[Wl["cs-CZ"]]="捷克语 (捷克共和国)",ql[Wl.ro]="罗马尼亚语",ql[Wl["lo-LA"]]="老挝语 (老挝)",ql[Wl["my-MM"]]="缅甸语 (缅甸)",ql[Wl["bn-BD"]]="孟加拉语 (孟加拉)",ql[Wl["bn-IN"]]="孟加拉语 (印度)",ql[Wl.mr]="马拉地语",ql[Wl["ms-MY"]]="马来语 (马来西亚)",ql[Wl.ml]="马来亚拉姆语",ql[Wl.mni]="曼尼普里语",ql[Wl["ne-NP"]]="尼泊尔语 (尼泊尔)",ql[Wl.or]="欧里亚语",ql[Wl["pt-BR"]]="葡萄牙语 (巴西)",ql[Wl["pt-PT"]]="葡萄牙语 (葡萄牙)",ql[Wl.pa]="旁遮普语",ql[Wl["sv-SE"]]="瑞典语 (瑞典)",ql[Wl["ja-JP"]]="日语 (日本)",ql[Wl.sr]="塞尔维亚语",ql[Wl["si-LK"]]="僧伽罗语 (斯里兰卡)",ql[Wl["sk-SK"]]="斯洛伐克语 (斯洛伐克)",ql[Wl["tr-TR"]]="土耳其语 (土耳其)",ql[Wl["tl-PH"]]="塔加路族语 (菲律宾)",ql[Wl.te]="泰卢固语",ql[Wl.ta]="泰米尔语",ql[Wl["th-TH"]]="泰语 (泰国)",ql[Wl["ur-PK"]]="乌尔都语 (巴基斯坦)",ql[Wl["ur-IN"]]="乌尔都语 (印度)",ql[Wl["uk-UA"]]="乌克兰语 (乌克兰)",ql[Wl["iw-IL"]]="希伯来语 (以色列)",ql[Wl["es-ES"]]="西班牙语 (西班牙)",ql[Wl["es-MX"]]="西班牙语 (墨西哥)",ql[Wl.hu]="匈牙利语",ql[Wl["it-IT"]]="意大利语 (意大利)",ql[Wl["in-ID"]]="印度尼西亚语 (印度尼西亚)",ql[Wl["hi-IN"]]="印地语 (印度)",ql[Wl["vi-VN"]]="越南语 (越南)",ql[Wl["en-PK"]]="英语 (巴基斯坦)",ql[Wl["en-PL"]]="英语 (波兰)",ql[Wl["en-FR"]]="英语 (法国)",ql[Wl["en-PH"]]="英语 (菲律宾)",ql[Wl["en-CZ"]]="英语 (捷克共和国)",ql[Wl["en-CA"]]="英语 (加拿大)",ql[Wl["en-MM"]]="英语 (缅甸)",ql[Wl["en-US"]]="英语 (美国)",ql[Wl["en-BD"]]="英语 (孟加拉)",ql[Wl["en-MY"]]="英语 (马来西亚)",ql[Wl["en-NP"]]="英语 (尼泊尔)",ql[Wl["en-LK"]]="英语 (斯里兰卡)",ql[Wl["en-TH"]]="英语 (泰国)",ql[Wl["en-ES"]]="英语 (西班牙)",ql[Wl["en-SG"]]="英语 (新加坡)",ql[Wl["en-HU"]]="英语 (匈牙利)",ql[Wl["en-ID"]]="英语 (印度尼西亚)",ql[Wl["en-GB"]]="英语 (英国)",ql[Wl["en-VN"]]="英语 (越南)",ql[Wl["en-HK"]]="英语 (中国香港)",ql[Wl["en-KR"]]="英语 (韩国)",ql[Wl["zh-TW"]]="繁体中文 (中国台湾)",ql[Wl["zh-HK"]]="繁体中文 (中国香港)",ql[Wl["zh-SG"]]="简体中文 (新加坡)",ql[Wl["zh-CN"]]="简体中文 (中国)",ql[Wl["ar-IQ"]]="阿拉伯语 (伊拉克)",ql[Wl["ckb-IQ"]]="中库尔德语 (伊拉克)",ql[Wl.ku]="库尔德语",ql[Wl["kk-KZ"]]="哈萨克语",ql[Wl.af]="南非语",ql[Wl.am]="阿姆哈拉语",ql[Wl.az]="阿塞拜疆语",ql[Wl.be]="白俄罗斯语",ql[Wl.bg]="保加利亚语",ql[Wl.bs]="波斯尼亚语",ql[Wl.ca]="加泰罗尼亚语",ql[Wl.cy]="威尔士语",ql[Wl.el]="现代希腊语",ql[Wl.eo]="世界语",ql[Wl.et]="爱沙尼亚语",ql[Wl.eu]="巴斯克语",ql[Wl.fa]="波斯语",ql[Wl.fi]="芬兰语",ql[Wl.gd]="爱尔兰语",ql[Wl.gl]="加利西亚语",ql[Wl.ha]="豪萨语",ql[Wl.haw]="夏威夷语",ql[Wl.hr]="克罗地亚语",ql[Wl.ig]="伊博语",ql[Wl.is]="冰岛语",ql[Wl.ka]="格鲁吉亚语",ql[Wl.km]="高棉语",ql[Wl.ky]="吉尔吉斯语",ql[Wl.lb]="卢森堡语",ql[Wl.ln]="林格拉语",ql[Wl.lt]="立陶宛语",ql[Wl.lv]="拉脱维亚语",ql[Wl.mg]="马尔加什语",ql[Wl.mk]="马其顿语",ql[Wl.mn]="蒙古文",ql[Wl.mt]="马耳他语",ql[Wl.om]="奥罗莫语",ql[Wl.ps]="普什图语",ql[Wl.qu]="克丘亚语",ql[Wl.rw]="卢旺达语",ql[Wl.sl]="斯洛文尼亚语",ql[Wl.so]="索马里语",ql[Wl.sq]="阿尔巴尼亚语",ql[Wl.sw]="斯瓦希里语",ql[Wl.tg]="塔吉克语",ql[Wl.ti]="蒂格尼亚语",ql[Wl.ug]="维吾尔语",ql[Wl.uz]="乌兹别克语",ql[Wl.yo]="约鲁巴语",ql[Wl.zu]="祖鲁语";var Jl,Ql={};Ql[Wl["ar-SA"]]="Arabic (Saudi Arabia)",Ql[Wl.kn]="Kannada",Ql[Wl.as]="Assamese",Ql[Wl.bho]="Bhojpuri",Ql[Wl["pl-PL"]]="Polish (Poland)",Ql[Wl["ko-KR"]]="Korean (Korean)",Ql[Wl["da-DK"]]="Danish (Denmark)",Ql[Wl["de-DE"]]="German (Germany)",Ql[Wl["ru-RU"]]="Russian (Russia)",Ql[Wl["fr-FR"]]="French (France)",Ql[Wl.gu]="Gujarati",Ql[Wl["nl-BE"]]="Dutch (Belgium)",Ql[Wl["nl-NL"]]="Dutch (Netherlands)",Ql[Wl["cs-CZ"]]="Czech (Czech Republic)",Ql[Wl.ro]="Romanian",Ql[Wl["lo-LA"]]="Lao (Laos)",Ql[Wl["my-MM"]]="Burmese (Myanmar)",Ql[Wl["bn-BD"]]="Bengali (Bangladesh)",Ql[Wl["bn-IN"]]="Bengali (India)",Ql[Wl.mr]="Marathi",Ql[Wl["ms-MY"]]="Malay (Malaysia)",Ql[Wl.ml]="Malayalam",Ql[Wl.mni]="Manipuri",Ql[Wl["ne-NP"]]="Nepalese (Nepal)",Ql[Wl.or]="Odia (Oriya)",Ql[Wl["pt-BR"]]="Portuguese (Brazil)",Ql[Wl["pt-PT"]]="Portuguese (Portugal)",Ql[Wl.pa]="Punjabi",Ql[Wl["sv-SE"]]="Swedish (Sweden)",Ql[Wl["ja-JP"]]="Japanese (Japanese)",Ql[Wl.sr]="Serbian",Ql[Wl["si-LK"]]="Sinhala (Sri Lanka)",Ql[Wl["sk-SK"]]="Slovak (Slovakia)",Ql[Wl["tr-TR"]]="Turkish (Turkish)",Ql[Wl["tl-PH"]]="Tagalog (Philippines)",Ql[Wl.te]="Telugu",Ql[Wl.ta]="Tamil",Ql[Wl["th-TH"]]="Thai (Thailand)",Ql[Wl["ur-PK"]]="Ulduwen (Pakistan)",Ql[Wl["ur-IN"]]="Urduwen (India)",Ql[Wl["uk-UA"]]="Ukrainian (Ukraine)",Ql[Wl["iw-IL"]]="Hebrew (Israel)",Ql[Wl["es-ES"]]="Spanish (Spain)",Ql[Wl["es-MX"]]="Spanish (Mexico)",Ql[Wl.hu]="Hungarian",Ql[Wl["it-IT"]]="Italian (Italian)",Ql[Wl["in-ID"]]="Indonesian (Indonesia)",Ql[Wl["hi-IN"]]="Hindi (India)",Ql[Wl["vi-VN"]]="Vietnamese (Vietnam)",Ql[Wl["en-PK"]]="English (Pakistan)",Ql[Wl["en-PL"]]="English (Poland)",Ql[Wl["en-FR"]]="English (France)",Ql[Wl["en-PH"]]="English (Philippines)",Ql[Wl["en-CZ"]]="English (Czech Republic)",Ql[Wl["en-CA"]]="English (Canada)",Ql[Wl["en-MM"]]="English (Myanmar)",Ql[Wl["en-US"]]="English (US)",Ql[Wl["en-BD"]]="English (Bangladesh)",Ql[Wl["en-MY"]]="English (Malaysia)",Ql[Wl["en-NP"]]="English (Nepal)",Ql[Wl["en-LK"]]="English (Sri Lanka)",Ql[Wl["en-TH"]]="English (Thailand)",Ql[Wl["en-ES"]]="English (Spain)",Ql[Wl["en-SG"]]="English (Singapore)",Ql[Wl["en-HU"]]="English (Hungary)",Ql[Wl["en-ID"]]="English (Indonesia)",Ql[Wl["en-GB"]]="English (UK)",Ql[Wl["en-VN"]]="English (Vietnam)",Ql[Wl["en-HK"]]="English (Hong Kong)",Ql[Wl["en-KR"]]="English (Korean)",Ql[Wl["zh-TW"]]="Chinese Traditional (Taiwan)",Ql[Wl["zh-HK"]]="Chinese Traditional (Hong Kong)",Ql[Wl["zh-SG"]]="Chinese Simplified (Singapore)",Ql[Wl["zh-CN"]]="Chinese Simplified (China)",Ql[Wl["ar-IQ"]]="Arabic (Iraq)",Ql[Wl["ckb-IQ"]]="Central Kurdish (Iraq)",Ql[Wl.ku]="Kurdish",Ql[Wl["kk-KZ"]]="Kazakh",Ql[Wl.af]="Afrikaans",Ql[Wl.am]="Amharic",Ql[Wl.az]="Azerbaijani",Ql[Wl.be]="Belarusian",Ql[Wl.bg]="Bulgarian",Ql[Wl.bs]="Bosnian",Ql[Wl.ca]="Catalan",Ql[Wl.cy]="Welsh",Ql[Wl.el]="Greek",Ql[Wl.eo]="Esperanto",Ql[Wl.et]="Estonian",Ql[Wl.eu]="Basque",Ql[Wl.fa]="Persian",Ql[Wl.fi]="Finnish",Ql[Wl.gd]="Scots Gaelic",Ql[Wl.gl]="Galician",Ql[Wl.ha]="Hausa",Ql[Wl.haw]="Hawaiian",Ql[Wl.hr]="Croatian",Ql[Wl.ig]="Igbo",Ql[Wl.is]="Icelandic",Ql[Wl.ka]="Georgian",Ql[Wl.km]="Khmer",Ql[Wl.ky]="Kyrgyz",Ql[Wl.lb]="Luxembourgish",Ql[Wl.ln]="Lingala",Ql[Wl.lt]="Lithuanian",Ql[Wl.lv]="Latvian",Ql[Wl.mg]="Malagasy",Ql[Wl.mk]="Macedonian",Ql[Wl.mn]="Mongolian",Ql[Wl.mt]="Maltese",Ql[Wl.om]="Oromo",Ql[Wl.ps]="Pashto",Ql[Wl.qu]="Quechua",Ql[Wl.rw]="Kinyarwanda",Ql[Wl.sl]="Slovenian",Ql[Wl.so]="Somali",Ql[Wl.sq]="Albanian",Ql[Wl.sw]="Swahili",Ql[Wl.tg]="Tajik",Ql[Wl.ti]="Tigrinya",Ql[Wl.ug]="Uyghur",Ql[Wl.uz]="Uzbek",Ql[Wl.yo]="Yoruba",Ql[Wl.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(Jl||(Jl={}));var Zl,Xl,$l,ec={"zh-hans":Wl["zh-CN"],"zh-hant":Wl["zh-TW"],ar:Wl["ar-SA"],bn:Wl["bn-BD"],cs:Wl["cs-CZ"],da:Wl["da-DK"],de:Wl["de-DE"],en:Wl["en-US"],es:Wl["es-ES"],fr:Wl["fr-FR"],hi:Wl["hi-IN"],in:Wl["in-ID"],it:Wl["it-IT"],iw:Wl["iw-IL"],ja:Wl["ja-JP"],ko:Wl["ko-KR"],lo:Wl["lo-LA"],ms:Wl["ms-MY"],my:Wl["my-MM"],ne:Wl["ne-NP"],nl:Wl["nl-NL"],pl:Wl["pl-PL"],pt:Wl["pt-PT"],ru:Wl["ru-RU"],si:Wl["si-LK"],sk:Wl["sk-SK"],sv:Wl["sv-SE"],th:Wl["th-TH"],tl:Wl["tl-PH"],tr:Wl["tr-TR"],uk:Wl["uk-UA"],ur:Wl["ur-PK"],vi:Wl["vi-VN"],zh:Wl["zh-CN"],kk:Wl["kk-KZ"]},tc={"zh-hant":Wl["zh-TW"],"zh-hans":Wl["zh-CN"]},nc=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},rc=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}(Zl||(Zl={})),nc(Zl),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(Xl||(Xl={})),nc(Xl),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}($l||($l={})),nc($l);var oc,ic,sc,lc,cc,uc,dc,pc,hc,fc,mc,vc,gc,yc,_c,bc;Wl["ar-IQ"],Zl.ar_EG,$l.ar,Xl.ar,Wl["ar-SA"],Zl.ar_EG,$l["ar-sa"],Xl["ar-sa"],Wl["bn-BD"],Zl.bn_BD,$l["bn-bd"],Xl["bn-bd"],Wl["bn-IN"],Zl.bn_BD,$l.bn,Xl.bn,Wl["cs-CZ"],Zl.cs_CZ,$l.cs,Xl.cs,Wl["da-DK"],Zl.da_DK,$l.da,Xl.da,Wl["de-DE"],Zl.de_DE,$l.de,Xl.de,Wl["en-BD"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-CA"],Zl.en_US,$l["en-ca"],Xl["en-ca"],Wl["en-CZ"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-ES"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-FR"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-GB"],Zl.en_GB,$l["en-gb"],Xl["en-gb"],Wl["en-HU"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-ID"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-LK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-MM"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-MY"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-NP"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PH"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-PL"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-SG"],Zl.en_US,$l["en-sg"],Xl.en,Wl["en-TH"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-US"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-VN"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-HK"],Zl.en_US,$l["en-gb"],Xl.en,Wl["en-KR"],Zl.en_US,$l["en-gb"],Xl.en,Wl["es-ES"],Zl.es_ES,$l.es,Xl.es,Wl["es-MX"],Zl.es_ES,$l.es,Xl.es,Wl["fr-FR"],Zl.fr_FR,$l.fr,Xl.fr,Wl["hi-IN"],Zl.hi_IN,$l.hi,Xl.hi,Wl.hu,Zl.hu_HU,$l.hu,Xl.hu,Wl["in-ID"],Zl.id_ID,$l.id,Xl.id,Wl["it-IT"],Zl.it_IT,$l.it,Xl.it,Wl["ja-JP"],Zl.ja_JP,$l.ja,Xl.ja,Wl.kn,Zl.kn_IN,$l.kn,Xl.kn,Wl["ko-KR"],Zl.ko_KR,$l.ko,Xl.ko,Wl.ml,Zl.ml_IN,$l.ml,Xl.ml,Wl["ms-MY"],Zl.ms_MY,$l["ms-my"],Xl["ms-my"],Wl["ne-NP"],Zl.ne_NP,$l.ne,Xl.ne,Wl["nl-BE"],Zl.nl_BE,$l["nl-be"],Xl["nl-be"],Wl["nl-NL"],Zl.nl_NL,$l.nl,Xl.nl,Wl["pl-PL"],Zl.pl_PL,$l.pl,Xl.pl,Wl["pt-BR"],Zl.pt_BR,$l["pt-br"],Xl["pt-br"],Wl["pt-PT"],Zl.pt_PT,$l.pt,Xl.pt,Wl.ro,Zl.ro_RO,$l.ro,Xl.ro,Wl["ru-RU"],Zl.ru_RU,$l.ru,Xl.ru,Wl["si-LK"],Zl.si_LK,$l.si,Xl.si,Wl["sk-SK"],Zl.sk_SK,$l.sk,Xl.sk,Wl.sr,Zl.sr_RS,$l.sr,Xl.sr,Wl["sv-SE"],Zl.sv_SE,$l.sv,Xl.sv,Wl.ta,Zl.ta_IN,$l.ta,Xl.ta,Wl["th-TH"],Zl.th_TH,$l.th,Xl.th,Wl["tr-TR"],Zl.tr_TR,$l.tr,Xl.tr,Wl["uk-UA"],Zl.uk_UA,$l.uk,Xl.uk,Wl["ur-PK"],Zl.ur_PK,$l.ur,Xl.ur,Wl["vi-VN"],Zl.vi_VN,$l.vi,Xl.vi,Wl["zh-CN"],Zl.zh_CN,$l["zh-cn"],Xl["zh-cn"],Wl["zh-HK"],Zl.zh_HK,$l["zh-hk"],Xl["zh-hk"],Wl["zh-SG"],Zl.zh_HK,$l["zh-hk"],Xl["zh-hk"],Wl["zh-TW"],Zl.zh_TW,$l["zh-tw"],Xl["zh-tw"],Wl["kk-KZ"],Zl.kk_KZ,$l.kk,Xl.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(bc||(bc={}));var Ec,Sc,Ac=nc(bc),kc={};kc[bc.kn]="AiNaDeYu",kc[bc.ar_SA]="ALaBoYu (ShaTeALaBo)",kc[bc.ar_IQ]="ALaBoYu (YiLaKe)",kc[bc.as]="ASaMuYu",kc[bc.bho]="BoJiePuErYu",kc[bc.pl_PL]="BoLanYu (BoLan)",kc[bc.ko_KR]="ChaoXianYu (HanGuo)",kc[bc.da_DK]="DanMaiYu (DanMai)",kc[bc.de_DE]="DeYu (DeGuo)",kc[bc.ru_RU]="EYu (ELuoSi)",kc[bc.fr_FR]="FaYu (FaGuo)",kc[bc.gu]="GuJiaLaTiYu",kc[bc.nl_BE]="HeLanYu (BiLiShi)",kc[bc.nl_NL]="HeLanYu (HeLan)",kc[bc.cs_CZ]="JieKeYu (JieKeGongHeGuo)",kc[bc.ku]="KuErDeYu",kc[bc.lo_LA]="LaoWoYu (LaoWo)",kc[bc.ro]="LuoMaNiYaYu",kc[bc.mr]="MaLaDiYu",kc[bc.ms_MY]="MaLaiYu (MaLaiXiYa)",kc[bc.ml]="MaLaiYaLaMuYu",kc[bc.mni]="ManNiPuLiYu",kc[bc.bn_BD]="MengJiaLaYu (MengJiaLa)",kc[bc.bn_IN]="MengJiaLaYu (YinDu)",kc[bc.my_MM]="MianDianYu (MianDian)",kc[bc.ne_NP]="NiBoErYu (NiBoEr)",kc[bc.or]="OuLiYaYu",kc[bc.pa]="PangZhePuYu",kc[bc.pt_BR]="PuTaoYaYu (BaXi)",kc[bc.pt_PT]="PuTaoYaYu (PuTaoYa)",kc[bc.ja_JP]="RiYu (RiBen)",kc[bc.sv_SE]="RuiDianYu (RuiDian)",kc[bc.sr]="SaiErWeiYaYu",kc[bc.si_LK]="SengJiaLuoYu (SiLiLanKa)",kc[bc.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",kc[bc.te]="TaiLuGuYu",kc[bc.ta]="TaiMiErYu",kc[bc.th_TH]="TaiYu (TaiGuo)",kc[bc.tl_PH]="TaJiaLuZuYu (FeiLvBin)",kc[bc.tr_TR]="TuErQiYu (TuErQi)",kc[bc.ur_PK]="WuErDuYu (BaJiSiTan)",kc[bc.ur_IN]="WuErDuYu (YinDu)",kc[bc.uk_UA]="WuKeLanYu (WuKeLan)",kc[bc.es_ES]="XiBanYaYu (XiBanYa)",kc[bc.es_MX]="XiBanYaYu (MoXiGe)",kc[bc.iw_IL]="XiBoLaiYu (YiSeLie)",kc[bc.hu]="XiongYaLiYu",kc[bc.it_IT]="YiDaLiYu (YiDaLi)",kc[bc.hi_IN]="YinDiYu (YinDu)",kc[bc.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",kc[bc.en_PK]="YingYu (BaJiSiTan)",kc[bc.en_PL]="YingYu (BoLan)",kc[bc.en_FR]="YingYu (FaGuo)",kc[bc.en_PH]="YingYu (FeiLvBin)",kc[bc.en_CA]="YingYu (JiaNaDa)",kc[bc.en_CZ]="YingYu (JieKeGongHeGuo)",kc[bc.en_MY]="YingYu (MaLaiXiYa)",kc[bc.en_US]="YingYu (MeiGuo)",kc[bc.en_BD]="YingYu (MengJiaLa)",kc[bc.en_MM]="YingYu (MianDian)",kc[bc.en_NP]="YingYu (NiBoEr)",kc[bc.en_LK]="YingYu (SiLiLanKa)",kc[bc.en_TH]="YingYu (TaiGuo)",kc[bc.en_ES]="YingYu (XiBanYa)",kc[bc.en_SG]="YingYu (XinJiaPo)",kc[bc.en_HU]="YingYu (XiongYaLi)",kc[bc.en_ID]="YingYu (YinDuNiXiYa)",kc[bc.en_GB]="YingYu (YingGuo)",kc[bc.en_VN]="YingYu (YueNan)",kc[bc.en_HK]="YingYu (XiangGang)",kc[bc.en_KR]="YingYu (HanGuo)",kc[bc.vi_VN]="YueNanYu (YueNan)",kc[bc.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",kc[bc.zh_TW]="ZhongWen (TaiWanDiQu)",kc[bc.zh_HK]="ZhongWen (XiangGang)",kc[bc.zh_SG]="ZhongWen (XinJiaPo)",kc[bc.zh_CN]="ZhongWen (ZhongGuo)",kc[bc.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",kc[bc.af]="NanFeiYu",kc[bc.am]="AMuHaLaYu",kc[bc.az]="ASaiBaiJiangYu",kc[bc.be]="BaiErLuoSiYu",kc[bc.bg]="BaoJiaLiYaYu",kc[bc.bs]="BoSiNiYaYu",kc[bc.ca]="JiaTaiLuoNiYaYu",kc[bc.cy]="WeiErShiYu",kc[bc.el]="XianDaiXiLaYu",kc[bc.eo]="ShiJieYu",kc[bc.et]="AiShaNiYaYu",kc[bc.eu]="BaSiKeYu",kc[bc.fa]="BoSiYu",kc[bc.fi]="FenLanYu",kc[bc.gd]="AiErLanYu",kc[bc.gl]="JiaLiXiYaYu",kc[bc.ha]="HaoSaYu",kc[bc.haw]="XiaWeiYiYu",kc[bc.hr]="KeLuoDiYaYu",kc[bc.ig]="YiBoYu",kc[bc.is]="BingDaoYu",kc[bc.ka]="GeLuJiYaYu",kc[bc.km]="GaoMianYu",kc[bc.ky]="JiErJiSiYu",kc[bc.lb]="LuSenBaoYu",kc[bc.ln]="LinGeLaYu",kc[bc.lt]="LiTaoWanYu",kc[bc.lv]="LaTuoWeiYaYu",kc[bc.mg]="MaErJiaShiYu",kc[bc.mk]="MaQiDunYu",kc[bc.mn]="MengGuWen",kc[bc.mt]="MaErTaYu",kc[bc.om]="AoLuoMoYu",kc[bc.ps]="PuShiTuYu",kc[bc.qu]="KeQiuYaYu",kc[bc.rw]="LuWangDaYu",kc[bc.sl]="SiLuoWeiNiYaYu",kc[bc.so]="SuoMaLiYu",kc[bc.sq]="AErBaNiYaYu",kc[bc.sw]="SiWaXiLiYu",kc[bc.tg]="TaJiKeYu",kc[bc.ti]="DiGeNiYaYu",kc[bc.ug]="WeiWuErYu",kc[bc.uz]="WuZiBieKeYu",kc[bc.yo]="YueLuBaYu",kc[bc.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Ec||(Ec={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Sc||(Sc={})),nc(Sc);var Tc=Object.assign(Object.assign({},Sc),{TranslationMemory:"TranslationMemory"}),wc=(nc(Tc),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-tw";if(e===bc.in_ID)return"id";if(e===bc.iw_IL)return"he";var t=e.split("_")[0];return rc(wc.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-TW";if(e===bc.in_ID)return"id";if(e===bc.mni)return"mni-Mtei";var t=e.split("_")[0];return rc(wc.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===bc.zh_CN)return"zh-CN";if(e===bc.zh_HK||e===bc.zh_TW||e===bc.zh_SG)return"zh-TW";var t=e.split("_")[0];return rc(wc.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===bc.in_ID)return"ID";var n=t.split("_")[0];return rc(wc.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===bc.zh_CN||e===bc.zh_SG)return"ZH";if(e===bc.zh_HK||e===bc.zh_TW)return null;if(e===bc.en_GB||e===bc.en_US||e===bc.pt_BR||e===bc.pt_PT)return t.replace("_","-");if(e===bc.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":rc(wc.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===bc.pt_PT)return"pt-pt";if(e===bc.pt_BR)return"pt";if([bc.zh_CN,bc.zh_SG].includes(e))return"zh-Hans";if([bc.zh_HK,bc.zh_TW].includes(e))return"zh-Hant";if(e===bc.iw_IL)return"he";if(e===bc.in_ID)return"id";if(e===bc.ckb_IQ)return"ku";var t=e.split("_")[0];return rc(wc.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===bc.pt_PT)return"pt-PT";if(e===bc.pt_BR)return"pt";if(e===bc.es_MX)return"es-MX";if(e===bc.in_ID)return"id";if(e===bc.zh_CN||e===bc.zh_SG)return"zh";if(e===bc.zh_HK||e===bc.zh_TW)return"zh-TW";var t=e.split("_")[0];return rc(wc.amazonSupportedLanguages,t)?t:null}}),Pc={};Pc[Sc.AiSelected]=Ac,Pc[Sc.Aliyun]=Ac.filter((function(e){return Boolean(wc.mapAliyunLanguage(e))})),Pc[Sc["ChatGPT3.5"]]=Ac,Pc[Sc.Google]=Ac.filter((function(e){return Boolean(wc.mapGoogleLanguage(e))})),Pc[Sc.Papago]=Ac.filter((function(e){return Boolean(wc.mapPapagoLanguage(e))})),Pc[Sc.DeepL]=Ac.filter((function(e){return Boolean(wc.mapDeepLLanguage(e))})),Pc[Sc.Microsoft]=Ac.filter((function(e){return Boolean(wc.mapMicrosoftLanguage(e))})),Pc[Sc.Amazon]=Ac.filter((function(e){return Boolean(wc.mapAmazonLanguage(e))}));var Ic={};Ic[Sc.AiSelected]=Ac,Ic[Sc.Aliyun]=Ac.filter((function(e){return Boolean(wc.mapAliyunLanguage(e))})),Ic[Sc["ChatGPT3.5"]]=Ac,Ic[Sc.Google]=Ac.filter((function(e){return Boolean(wc.mapGoogleLanguage(e))})),Ic[Sc.Papago]=Ac.filter((function(e){return Boolean(wc.mapPapagoLanguage(e))})),Ic[Sc.DeepL]=Ac.filter((function(e){return Boolean(wc.mapDeepLSourceLanguage(e))})),Ic[Sc.Microsoft]=Ac.filter((function(e){return Boolean(wc.mapMicrosoftLanguage(e))})),Ic[Sc.Amazon]=Ac.filter((function(e){return Boolean(wc.mapAmazonLanguage(e))})),Cc=Ac.map((function(e){return[e,nc(Sc).filter((function(t){return rc(Pc[t],e)}))]})),Rc={},Object.keys(Cc||{}).forEach((function(e){var t=Cc[e],n=t[0],r=t[1];Rc[n]=r}));var Cc,Rc,Nc={};Nc[bc.ar_SA]="العربية)السعودية)",Nc[bc.kn]="ಕನ್ನಡ",Nc[bc.as]="অসমীয়া",Nc[bc.bho]="भोजपुरी",Nc[bc.pl_PL]="Polski (Polska)",Nc[bc.ko_KR]="한국어 (대한민국)",Nc[bc.da_DK]="Dansk (Danmark)",Nc[bc.de_DE]="Deutsch (Deutschland)",Nc[bc.ru_RU]="Русский (Россия)",Nc[bc.fr_FR]="Français (France)",Nc[bc.gu]="ગુજરાતી",Nc[bc.nl_BE]="Nederlands (Belgium)",Nc[bc.nl_NL]="Nederlands (Nederland)",Nc[bc.cs_CZ]="Čeština (Česká republika)",Nc[bc.ro]="Română",Nc[bc.lo_LA]="ລາວ (ລາວ)",Nc[bc.my_MM]="မြန်မာဘာသာ (မြန်မာ)",Nc[bc.bn_BD]="বাংলা (বাংলাদেশ)",Nc[bc.bn_IN]="বাংলা (ভারত)",Nc[bc.mr]="मराठी",Nc[bc.ms_MY]="Bahasa Melayu (Malaysia)",Nc[bc.ml]="മലയാളം",Nc[bc.mni]="ꯃꯩꯇꯩꯂꯣꯟ",Nc[bc.ne_NP]="नेपाली (नेपाल)\t",Nc[bc.or]="ଓଡ଼ିଆ",Nc[bc.pt_BR]="Português (Brasil)",Nc[bc.pt_PT]="Português (Portugal)",Nc[bc.pa]="پنجابی",Nc[bc.sv_SE]="Svenska (Sverige)",Nc[bc.ja_JP]="日本語",Nc[bc.sr]="Српски",Nc[bc.si_LK]="සිංහල (ශ්රී ලංකාව)",Nc[bc.sk_SK]="Slovenčina (Slovensko)",Nc[bc.tr_TR]="Türkçe (Türkiye)",Nc[bc.tl_PH]="Wikang Tagalog (Philippines)",Nc[bc.te]="తెలుగు",Nc[bc.ta]="தமிழ்",Nc[bc.th_TH]="ไทย (ประเทศไทย)",Nc[bc.ur_PK]="اردو)پاکستان)",Nc[bc.ur_IN]="اردو)بھارت)",Nc[bc.uk_UA]="Українська (Україна)",Nc[bc.iw_IL]="עִבְרִית (ישראל)",Nc[bc.es_ES]="Español (España)",Nc[bc.es_MX]="Español (México)",Nc[bc.hu]="Magyar",Nc[bc.it_IT]="Italiano (Italia)",Nc[bc.in_ID]="Bahasa Indonesia (Indonesia)",Nc[bc.hi_IN]="हिन्दी (भारत)",Nc[bc.vi_VN]="Tiếng Việt (Việt Nam)",Nc[bc.en_PK]="English (Pakistan)",Nc[bc.en_PL]="English (Poland)",Nc[bc.en_FR]="English (France)",Nc[bc.en_PH]="English (Philippines)",Nc[bc.en_CZ]="English (Czech Republic)",Nc[bc.en_CA]="English (Canada)",Nc[bc.en_MM]="English (Myanmar)",Nc[bc.en_US]="English (United States)",Nc[bc.en_BD]="English (Bangladesh)",Nc[bc.en_MY]="English (Malaysia)",Nc[bc.en_NP]="English (Nepal)",Nc[bc.en_LK]="English (Sri Lanka)",Nc[bc.en_TH]="English (Thailand)",Nc[bc.en_ES]="English (Spain)",Nc[bc.en_SG]="English (Singapore)",Nc[bc.en_HU]="English (Hungary)",Nc[bc.en_ID]="English (Indonesia)",Nc[bc.en_GB]="English (Great Britain)",Nc[bc.en_VN]="English (Vietnam)",Nc[bc.en_HK]="English (Hong Kong)",Nc[bc.en_KR]="English (Korea)",Nc[bc.zh_TW]="繁体中文 (中國台灣)",Nc[bc.zh_HK]="繁体中文 (中國香港)",Nc[bc.zh_SG]="简体中文 (新加坡)",Nc[bc.zh_CN]="简体中文",Nc[bc.ar_IQ]="العربية (العراق)",Nc[bc.ckb_IQ]="کوردیی ناوەندی (عێراق)",Nc[bc.ku]="کورمانجی",Nc[bc.kk_KZ]="قازاقشا ",Nc[bc.af]="Afrikaans",Nc[bc.am]="አማርኛ",Nc[bc.az]="Azərbaycan",Nc[bc.be]="беларуская мова",Nc[bc.bg]="Български",Nc[bc.bs]="босански",Nc[bc.ca]="Català",Nc[bc.cy]="Cymraeg",Nc[bc.el]="Ελληνικά",Nc[bc.eo]="Esperanto",Nc[bc.et]="eesti keel",Nc[bc.eu]="Euskara",Nc[bc.fa]="فارسی",Nc[bc.fi]="Suomi",Nc[bc.gd]="Gaeilge",Nc[bc.gl]="Galego",Nc[bc.ha]="هَوُسَ",Nc[bc.haw]="ʻŌlelo Hawaiʻi",Nc[bc.hr]="Hrvatski",Nc[bc.ig]="Asụsụ Igbo",Nc[bc.is]="Íslenska",Nc[bc.ka]="ქართული",Nc[bc.km]="ភាសាខ្មែរ",Nc[bc.ky]="кыргыз тили",Nc[bc.lb]="Lëtzebuergesch",Nc[bc.ln]="Lingála",Nc[bc.lt]="lietuvių kalba",Nc[bc.lv]="Latviešu valoda",Nc[bc.mg]="malagasy",Nc[bc.mk]="македонски",Nc[bc.mn]="монгол хэл",Nc[bc.mt]="Malti",Nc[bc.om]="Oromoo",Nc[bc.ps]="پښتو",Nc[bc.qu]="Quechua",Nc[bc.rw]="Ikinyarwanda",Nc[bc.sl]="slovenščina",Nc[bc.so]="Af-Soomaali",Nc[bc.sq]="Gjuha shqipe",Nc[bc.sw]="Kiswahili",Nc[bc.tg]="тоҷикӣ",Nc[bc.ti]="ትግርኛ",Nc[bc.ug]="ئۇيغۇر تىلى",Nc[bc.uz]="Ўзбек тили",Nc[bc.yo]="Èdè Yorùbá",Nc[bc.zu]="isiZulu",Sc.AiSelected,(oc={})[bc.en_US]="AI Selected",oc[bc.zh_CN]="AI 精选",(ic={})[bc.en_US]="AI selection of translations",ic[bc.zh_CN]="多渠道翻译的 AI 精选",Ic.AiSelected,Pc.AiSelected,(sc={})[bc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",sc[bc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(lc={})[bc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",lc[bc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Sc["ChatGPT3.5"],(cc={})[bc.en_US]="GPT-3.5",cc[bc.zh_CN]="GPT-3.5",(uc={})[bc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",uc[bc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(dc={})[bc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",dc[bc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",Ic["ChatGPT3.5"],Pc["ChatGPT3.5"],Sc.Aliyun,(pc={})[bc.en_US]="Alibaba",pc[bc.zh_CN]="阿里云",Ic.Aliyun,Pc.Aliyun,Sc.Google,(hc={})[bc.en_US]="Google",hc[bc.zh_CN]="Google",Ic.Google,Pc.Google,Sc.DeepL,(fc={})[bc.en_US]="DeepL",fc[bc.zh_CN]="DeepL",Ic.DeepL,Pc.DeepL,Sc.Microsoft,(mc={})[bc.en_US]="Azure AI",mc[bc.zh_CN]="Azure AI",Ic.Microsoft,Pc.Microsoft,Sc.Amazon,(vc={})[bc.en_US]="Amazon",vc[bc.zh_CN]="Amazon",Ic.Amazon,Pc.Amazon,Sc.Papago,(gc={})[bc.en_US]="Papago",gc[bc.zh_CN]="Papago",(yc={})[bc.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",yc[bc.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(_c={})[bc.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",_c[bc.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",Ic.Papago,Pc.Papago;var Dc=Object.keys(Wl).map((function(e){return Wl[e]})),Oc=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,Lc=function(e,t){return(Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Mc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xc,Uc,Bc,Kc=function(){return(Kc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Hc(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Yc(e){return e.type===Uc.literal}function Fc(e){return e.type===Uc.argument}function jc(e){return e.type===Uc.number}function Gc(e){return e.type===Uc.date}function zc(e){return e.type===Uc.time}function Vc(e){return e.type===Uc.select}function Wc(e){return e.type===Uc.plural}function qc(e){return e.type===Uc.pound}function Jc(e){return e.type===Uc.tag}function Qc(e){return!(!e||"object"!=Je()(e)||e.type!==Bc.number)}function Zc(e){return!(!e||"object"!=Je()(e)||e.type!==Bc.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(xc||(xc={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Uc||(Uc={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(Bc||(Bc={}));var Xc=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,$c=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function eu(e){var t={};return e.replace($c,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var tu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,nu=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ru=/^(@+)?(\+|#+)?[rs]?$/g,ou=/(\*)(0+)|(#+)(0+)|(0+)/g,iu=/^(0+)$/;function au(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ru,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function su(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function lu(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!iu.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function cu(e){return su(e)||{}}function uu(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=Kc(Kc(Kc({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return Kc(Kc({},e),cu(t))}),{}));continue;case"engineering":t=Kc(Kc(Kc({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return Kc(Kc({},e),cu(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(ou,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(iu.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(nu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(nu,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=Kc(Kc({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=Kc(Kc({},t),au(i)))}else if(ru.test(o.stem))t=Kc(Kc({},t),au(o.stem));else{var a=su(o.stem);a&&(t=Kc(Kc({},t),a));var s=lu(o.stem);s&&(t=Kc(Kc({},t),s))}}return t}var du,pu={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function hu(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(pu[n||""]||pu[r||""]||pu["".concat(r,"-001")]||pu["001"])[0]}var fu=new RegExp("^".concat(Xc.source,"*")),mu=new RegExp("".concat(Xc.source,"*$"));function vu(e,t){return{start:e,end:t}}var gu=!!String.prototype.startsWith&&"_a".startsWith("a",1),yu=!!String.fromCodePoint,_u=!!Object.fromEntries,bu=!!String.prototype.codePointAt,Eu=!!String.prototype.trimStart,Su=!!String.prototype.trimEnd,Au=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ku=!0;try{ku="a"===(null===(du=Du("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===du?void 0:du[0])}catch(Wl){ku=!1}var Tu,wu=gu?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Pu=yu?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},Iu=_u?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},Cu=bu?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Ru=Eu?function(e){return e.trimStart()}:function(e){return e.replace(fu,"")},Nu=Su?function(e){return e.trimEnd()}:function(e){return e.replace(mu,"")};function Du(e,t){return new RegExp(e,t)}if(ku){var Ou=Du("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Tu=function(e,t){var n;return Ou.lastIndex=t,null!==(n=Ou.exec(e)[1])&&void 0!==n?n:""}}else Tu=function(e,t){for(var n=[];;){var r=Cu(e,t);if(void 0===r||xu(r)||Uu(r))break;n.push(r),t+=r>=65536?2:1}return Pu.apply(void 0,n)};var Lu=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(xc.UNMATCHED_CLOSING_TAG,vu(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Mu(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:Uc.pound,location:vu(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Uc.literal,value:"<".concat(r,"/>"),location:vu(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Mu(this.char()))return this.error(xc.INVALID_TAG,vu(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(xc.UNMATCHED_CLOSING_TAG,vu(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Uc.tag,value:r,children:i,location:vu(n,this.clonePosition())},err:null}:this.error(xc.INVALID_TAG,vu(a,this.clonePosition())))}return this.error(xc.UNCLOSED_TAG,vu(n,this.clonePosition()))}return this.error(xc.INVALID_TAG,vu(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=vu(n,this.clonePosition());return{val:{type:Uc.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Mu(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Pu.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Pu(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(xc.EMPTY_ARGUMENT,vu(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(xc.MALFORMED_ARGUMENT,vu(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Uc.argument,value:r,location:vu(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(xc.MALFORMED_ARGUMENT,vu(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Tu(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:vu(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(xc.EXPECT_ARGUMENT_TYPE,vu(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=Nu(g.val)).length)return this.error(xc.EXPECT_ARGUMENT_STYLE,vu(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:vu(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=vu(r,this.clonePosition());if(l&&wu(null==l?void 0:l.style,"::",0)){var d=Ru(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:Uc.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(xc.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=hu(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:Bc.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?eu(p):{}};return{val:{type:"date"===a?Uc.date:Uc.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?Uc.number:"date"===a?Uc.date:Uc.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(xc.EXPECT_SELECT_ARGUMENT_OPTIONS,vu(f,Kc({},f)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(xc.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,vu(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(xc.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,xc.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),m=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,m);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var b=vu(r,this.clonePosition());return"select"===a?{val:{type:Uc.select,value:n,options:Iu(_.val),location:b},err:null}:{val:{type:Uc.plural,value:n,options:Iu(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(xc.INVALID_ARGUMENT_TYPE,vu(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(xc.EXPECT_ARGUMENT_CLOSING_BRACE,vu(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(xc.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,vu(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(tu).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(xc.INVALID_NUMBER_SKELETON,t)}return{val:{type:Bc.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?uu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(xc.EXPECT_PLURAL_ARGUMENT_SELECTOR,xc.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=vu(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?xc.DUPLICATE_SELECT_ARGUMENT_SELECTOR:xc.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?xc.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:xc.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,vu(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([l,{value:h.val,location:vu(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?xc.EXPECT_SELECT_ARGUMENT_SELECTOR:xc.EXPECT_PLURAL_ARGUMENT_SELECTOR,vu(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(xc.MISSING_OTHER_CLAUSE,vu(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=vu(r,this.clonePosition());return o?Au(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Cu(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(wu(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&xu(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Mu(e){return e>=97&&e<=122||e>=65&&e<=90}function xu(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Uu(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Bu(e,t){void 0===t&&(t={}),t=Kc({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Lu(e,t).parse();if(n.err){var r=SyntaxError(xc[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,Vc(t)||Wc(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else jc(t)&&Qc(t.style)||(Gc(t)||zc(t))&&Zc(t.style)?delete t.style.location:Jc(t)&&e(t.children)}))}(n.val),n.val}function Ku(e,t){var n=t&&t.cache?t.cache:Wu,r=t&&t.serializer?t.serializer:Gu;return(t&&t.strategy?t.strategy:ju)(e,{cache:n,serializer:r})}function Hu(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function Yu(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function Fu(e,t,n,r,o){return n.bind(t,e,r,o)}function ju(e,t){return Fu(e,this,1===e.length?Hu:Yu,t.cache.create(),t.serializer)}var Gu=function(){return JSON.stringify(arguments)};function zu(){this.cache=Object.create(null)}zu.prototype.get=function(e){return this.cache[e]},zu.prototype.set=function(e,t){this.cache[e]=t};var Vu,Wu={create:function(){return new zu}},qu={variadic:function(e,t){return Fu(e,this,Yu,t.cache.create(),t.serializer)},monadic:function(e,t){return Fu(e,this,Hu,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Vu||(Vu={}));var Ju,Qu=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return Mc(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Zu=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Vu.INVALID_VALUE,o)||this}return Mc(t,e),t}(Qu),Xu=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Vu.INVALID_VALUE,r)||this}return Mc(t,e),t}(Qu),$u=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Vu.MISSING_VALUE,n)||this}return Mc(t,e),t}(Qu);function ed(e){return"function"==typeof e}function td(e,t,n,r,o,i,a){if(1===e.length&&Yc(e[0]))return[{type:Ju.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(Yc(u))s.push({type:Ju.literal,value:u.value});else if(qc(u))"number"==typeof i&&s.push({type:Ju.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new $u(d,a);var p=o[d];if(Fc(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?Ju.literal:Ju.object,value:p});else if(Gc(u)){var h="string"==typeof u.style?r.date[u.style]:Zc(u.style)?u.style.parsedOptions:void 0;s.push({type:Ju.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(zc(u))h="string"==typeof u.style?r.time[u.style]:Zc(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:Ju.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(jc(u))(h="string"==typeof u.style?r.number[u.style]:Qc(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:Ju.literal,value:n.getNumberFormat(t,h).format(p)});else{if(Jc(u)){var f=u.children,m=u.value,v=o[m];if(!ed(v))throw new Xu(m,"function",a);var g=v(td(f,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?Ju.literal:Ju.object,value:e}})))}if(Vc(u)){if(!(y=u.options[p]||u.options.other))throw new Zu(u.value,p,Object.keys(u.options),a);s.push.apply(s,td(y.value,t,n,r,o))}else if(Wc(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Qu('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Vu.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new Zu(u.value,p,Object.keys(u.options),a);s.push.apply(s,td(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Ju.literal&&t.type===Ju.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function nd(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Ju||(Ju={}));var rd=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Ju.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return td(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,Kc(Kc({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?Kc(Kc(Kc({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=Kc(Kc({},o[t]),i[t]||{}),e}),{})):o),n}),Kc({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.number),strategy:qu.variadic}),getDateTimeFormat:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.dateTime),strategy:qu.variadic}),getPluralRules:Ku((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,Hc([void 0],n,!1)))}),{cache:nd(i.pluralRules),strategy:qu.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Bu,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function od(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var id=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=od({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",od({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,od({},this.attributes,t))},withConverter:function(t){return e(od({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),ad=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},sd=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},ld=function(){return"object"==("undefined"==typeof ac?"undefined":Je()(ac))&&"function"==typeof ac.call},cd=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!ld()},ud=function(){return"object"==("undefined"==typeof window?"undefined":Je()(window))},dd=function(){return function(){var e;return!!ud()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||ud()&&"undefined"!=typeof AlipayJSBridge},pd=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},hd=function(){return!(void 0===n.g||ud()||cd()||pd()||ld())},fd="bailingualLocaleChange",md="bailingualDataChange",vd="bailingualError";function gd(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Je()(document)))try{return id.get(e)||id.get("_CHIPS-"+e)}catch(e){return ad("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var yd,_d=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),dd()||cd()||ld()){var t=tc[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),ec[e.toLowerCase()]&&(e=ec[e.toLowerCase()]),Ld(Dc,e)?e:""};function bd(e){return void 0===e&&(e=!0),_d(function(e){return void 0===e&&(e=!0),cd()||ld()?my.env&&my.env.language||my.getSystemInfoSync().language:pd()?wx.getSystemInfoSync().language:hd()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=gd("x-hng")||gd("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Je()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(ud()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(ud()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function Ed(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&id.set(e,t,n)}catch(e){ad("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Sd(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&id.remove(e,t)}catch(e){ad("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Ad(){"object"==("undefined"==typeof document?"undefined":Je()(document))&&"object"==("undefined"==typeof location?"undefined":Je()(location))&&(Sd("x-hng",{path:"/",domain:location.hostname}),Sd("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Sd("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Sd("x-hng",{path:"/"}),Sd("x-hng",{path:"/",SameSite:"None",Secure:!0}),Sd("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(yd||(yd={}));var kd,Td,wd,Pd,Id,Cd,Rd,Nd,Dd=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},Od=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},Ld=function(e,t){return e.indexOf(t)>-1};function Md(e){var t,n;try{return Td?(null===(t=Td.getItem)||void 0===t?void 0:t.call(Td,e))||"":cd()||ld()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":pd()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function xd(e,t){var n;try{if(t=(t||"").toString(),Td)return void(null===(n=Td.setItem)||void 0===n||n.call(Td,e,t));if(cd()||ld())return void my.setStorage({key:e,data:t});if(pd())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function Ud(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return kd?kd(e):ld()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):cd()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):pd()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(Rd||(Rd={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(Nd||(Nd={}));var Bd={ANTINTL:(wd={},wd[Rd.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",wd[Rd.PROD]="https://bailingual.marmot-cloud.com/manifest/",wd),ALIPAY:(Pd={},Pd[Rd.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Pd[Rd.PROD]="https://bailingual-assets.alipay.com/manifest/",Pd)},Kd={};Kd[Nd.INTERNET]=((Id={})[Rd.DAILY]=function(e,t,n){var r;return""+(n?null===(r=Bd[n])||void 0===r?void 0:r[Rd.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Id[Rd.PROD]=function(e,t,n){var r;return""+(n?null===(r=Bd[n])||void 0===r?void 0:r[Rd.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Id),Kd[Nd.INTRANET]=((Cd={})[Rd.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Cd[Rd.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Cd);var Hd;function Yd(){return"true"===Md("__BAILINGUAL_IN_CONTEXT__")}function Fd(){if(!(cd()||pd()||ld())){var e=Md("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){ad("[bailingual-sdk-glue] JSON.parse data fail: "+e)}Hd=Yd()&&t}}function jd(){return void 0===Hd&&Fd(),Hd}function Gd(){xd("__BAILINGUAL_IN_CONTEXT__","true"),Fd(),new Promise((function(e,t){if(cd()||pd()||ld())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return Ud("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function zd(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function Vd(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function Wd(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(ld())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(cd())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(pd())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(ud()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(cd()||pd()||ld()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(Yd()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void Gd();if("undefined"==typeof document)return;if(dd()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!jd()){if(7==++n)return Gd(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){xd("__BAILINGUAL_IN_CONTEXT__","false"),Fd()}))}catch(e){ad("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var qd=function(e){return e<10?"0"+e:""+e};function Jd(){var e=new Date;return e.getFullYear()+"-"+qd(e.getMonth()+1)+"-"+qd(e.getDate())+" "+qd(e.getHours())+":"+qd(e.getMinutes())+":"+qd(e.getSeconds())+":"+e.getMilliseconds()}function Qd(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function Zd(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",Jd(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Qd({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",Jd(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Qd({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts)})];break;case"US":i=["D-VM",Jd(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",Qd({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:Vd(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var Xd=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};Xd.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),ud()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},Xd.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=Zd(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});Wd(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},Xd.prototype.getRegion=function(){return this.region},Xd.prototype.setRegion=function(e){this.region=e,this.startTimer()},Xd.prototype.report=function(e){this.region&&this.queue.push(e)};var $d=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},ep={usageReportRegion:{configurable:!0}};$d.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},$d.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},$d.customizeStorage=function(e){return function(e){Td=e}(e)},$d.getDataFromStorage=function(e){return Md(e)},$d.setDataToStorage=function(e,t){return xd(e,t)},$d.customizeFetch=function(e){kd=e},ep.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},ep.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new Xd({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},$d.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||bd(this.canReadLocaleFromCookie))},$d.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},$d.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||bd(this.canReadLocaleFromCookie))},$d.prototype.getServerSideFallbackData=function(){if(hd()){var e=n.g.BAILINGUAL_FALLBACK;return e||(ad("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},$d.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new Xd({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Je()(e[n])){var r=_d(n);if(!r)return void sd("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=Od({},e[n]),t.i18nText[r]=Od({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&ad("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||sd("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},$d.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Md("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return sd("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Md("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return sd("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){Ld(Dc,e)&&(t.i18nText[e]||ad("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},Od(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=_d(e),Ld(Dc,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=_d(e),Ld(Dc,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{xd("BAILINGUAL_PATCH_I18N-"+e,""),xd("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){sd("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},$d.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Je()(document))||"object"!=("undefined"==typeof location?"undefined":Je()(location))||dd()||cd()||ld()||pd()||(Ad(),Ed("x-hng","lang="+e,{path:"/",expires:180}),Ed("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(fd,e))},$d.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r=t.id;this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var o=this.intlPDKVMessages[e][r];if(!o){var i=n[r];i.match(Oc)||(i=zd(this.appName,r,i)),o=this.createIntlMessageFormat(i,e),this.intlPDKVMessages[e][r]=o}return o},$d.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r=t.id,o=(null==n?void 0:n[r])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[r]){this.intlMessages[e]=this.intlMessages[e]||{};var i=this.intlMessages[e][r];return i||(i=this.createIntlMessageFormat(o,e),this.intlMessages[e][r]=i),i}return this.createIntlMessageFormat(o,e)},$d.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=jd()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return ad(s),ad("[bailingual-sdk-glue] error detail:",t),this.emit(vd,new Dd({code:yd.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){Ld(l,t)||o.emit(vd,new Dd({code:yd.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return ad(u),ad("[bailingual-sdk-glue] error detail:",n),this.emit(vd,new Dd({code:yd.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},$d.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=_d(r))||sd("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||sd("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},$d.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},$d.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=_d(e),Ld(this.availableLocales,e))return e},$d.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):sd("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},$d.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},$d.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&jd()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},$d.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(Oc)||(o=zd(t.appName,r,o)),n[r]=o})),n},$d.prototype.getDataWithLocale=function(e,t){e||ad("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[_d(e||this.defaultLocale)];return n&&t&&jd()?this.buildPDKVLocaleText(n):n},$d.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);sd("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},$d.prototype.getCurrentLocale=function(){return this.currentLocale||""},$d.prototype.getDefaultLocale=function(){return this.defaultLocale},$d.prototype.formatLocaleCode=function(e){return _d(e)},$d.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return sd('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(vd,new Dd({code:yd.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return sd("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(sd("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return Ud(function(e,t,n,r,o){var i,a;return null===(a=null===(i=Kd[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?Rd.DAILY:Rd.PROD,t.isIntranet?Nd.INTRANET:Nd.INTERNET,e.appName,e.tag,o)).then((function(e){return e?Ud(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Je()(e[t])){var r=_d(t);r&&(n[r]=n[r]||{},Od(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&ad("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!Ld(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=Od({},o,r)})),o.forEach((function(t){if(!Ld(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],Ld(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(xd("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),xd("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(sd("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},$d.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return Ld(Dc,e)}));return this.defaultLocale&&!Ld(t,this.defaultLocale)?(sd("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(md,e),this.currentLocale&&!Ld(t,this.currentLocale)&&(ad("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},$d.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},$d.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},$d.prototype.onDataChange=function(e){this.on(md,e)},$d.prototype.offDataChange=function(e){this.off(md,e)},$d.prototype.onLocaleChange=function(e){this.on(fd,e)},$d.prototype.offLocaleChange=function(e){this.off(fd,e)},$d.prototype.onError=function(e){this.on(vd,e)},$d.prototype.offError=function(e){this.off(vd,e)},$d.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},$d.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},$d.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},$d.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},$d.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},$d.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},$d.prototype.changeBizEnv=function(e){this.bizEnv=e},$d.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},$d.prototype.removeBailingualCookie=function(){Ad()},Object.defineProperties($d.prototype,ep),$d.customizedGetSystemLocale=void 0;var tp=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){Ld([Uc.argument,Uc.number,Uc.date,Uc.time,Uc.select,Uc.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t){return new rd(e,t,{},{ignoreTag:!0})},t}($d),np=(new tp,"antom-language-storage-key"),rp="antom_language_change_event",op="en_US",ip=new tp;function ap(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=lp(e);n&&(ip.getAllLocales().map(lp).includes(n)||(n=op),ip.changeLocale(n),cp(n),t?window.location.reload():window.dispatchEvent(new Event(rp)))}function sp(e){if(e)return lp(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(np)||window.localStorage.getItem(np);if(t)return lp(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=ip.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):lp(e)===lp(navigator.language)}))||op;if(r)return r=lp(r)}return op}function lp(e){var t=e;t||(t=op);var n=t.split(/[-,_]/),r=et(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function cp(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(np,e),window.sessionStorage.setItem(np,e),!0}catch(e){return!1}}"true"==={NODE_ENV:"production",PUBLIC_PATH:"/"}.ANTOM_CORE_UNIT_TEST&&ip.initData(window.bailingual_ckp||{});var up={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},dp=p(p({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),up);zs.initConfig({i18n:ip,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var pp=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomError"),l(Qe(e),"response",void 0),e}return f(n,null,[{key:"isError",value:function(e){return zs.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return zs.unificationError(e,t)}}]),n}(zs),hp=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomCoreError"),e}return f(n)}(pp),fp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0})}}:{success:function(){},error:function(){}}},mp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},vp=(window||{}).navigator,gp=vp.userAgent,yp=function(){var e=/OpenHarmony/i.test(vp.userAgent),t=/Phone/i.test(vp.userAgent),n=/Tablet/i.test(vp.userAgent);return e&&(t||n)},_p=/iPhone|iPad|iPod/i.test(gp)||"MacIntel"===vp.platform&&vp.maxTouchPoints>1,bp=/Android/i.test(gp),Ep=(/\bMacintosh\b/.test(gp),/Windows NT/.test(gp),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(gp)||yp()}),Sp=_p,Ap=bp,kp=!!Ep(),Tp=!Ep();yp();var wp=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},Pp=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return wp(n)}},Ip=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},Cp=function(e){return e.split("&&")[1]||"SG"},Rp=n(9414),Np=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},Dp={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Op="ANTOM_PAYMENT_WEB",Lp=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function Mp(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var xp=function(){function e(t){v(this,e),l(this,"baseUrl",void 0),l(this,"headers",void 0),l(this,"method",void 0),l(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return f(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:p(p({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===qe(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){Mp().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",p({instanceId:Lp},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:wp(t.data),headers:Up(t.headers)};n(o)}))}))}}]),e}();function Up(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var Bp=function(e){var t=Rp(e,"Result-Status")||Rp(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:up.API_NOT_LOGIN,errorMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:up.API_GATEWAY_TIMEOUT,errorMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=Rp(e,"Tips")||Rp(e,"tips","");return{success:!1,errorCode:up.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},Kp={};function Hp(e,t,n){return Yp.apply(this,arguments)}function Yp(){return(Yp=a(o().mark((function e(t,n,r){var i,a,s,l,c,u,d,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p(p(p({},Kp),r),{},{envInfo:p(p({},Kp.envInfo),null==r?void 0:r.envInfo),headers:p(p({},Kp.headers),null==r?void 0:r.headers)}),s=fp(a.tracker,a.scope),l=mp(a.tracker,a.scope),a.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:a.hostSign="SG";case 10:return"WAP"===(c=p(p({terminalType:kp?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:Np(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==a?void 0:a.envInfo),{},{locale:sp((null==a?void 0:a.locale)||(null==a||null===(i=a.envInfo)||void 0===i?void 0:i.locale))})).terminalType&&(c.osType=Sp?"IOS":"ANDROID"),u=[p(p({},n),{},{envInfo:c,extParams:p(p({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,h=Fp(t,a),e.next=18,h({data:u});case 18:if(f=e.sent,m=f.data,v=f.headers,g=m||{},y=Rp(v,"Mgw-TraceId")||Rp(v,"mgw-traceid",""),g.traceId=y,!(_=Bp(v))){e.next=29;break}throw b=_.errorMessage,E=_.errorCode,new hp(b,E,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(g.success){e.next=36;break}throw k=g.errorMessage||g.resultMessage||ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),T=g.errorCode||(null===(S=g.errorContext)||void 0===S||null===(S=S.errorStack)||void 0===S||null===(S=S[0])||void 0===S?void 0:S.errorName)||"API_SYSTEM_ERROR","true"!==(null===(A=g.extendInfo)||void 0===A?void 0:A.mulityLanguageMapping)&&(k=ip.get({id:"server.".concat(T),defaultMessage:ip.get({id:"event.callback.code.${errorCode}",defaultMessage:ip.get({id:"ckp.paymentError.${errorCode}",defaultMessage:ip.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(w=new pp(k,T,"SERVER_API","".concat(y," (").concat(t,")"))).response=g,w;case 36:return s.success(t,performance.now()-d,y),e.abrupt("return",g);case 40:if(e.prev=40,e.t0=e.catch(14),!hp.isError(e.t0)){e.next=45;break}return s.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 45:return I=e.t0,l(I),e.abrupt("return",Promise.reject(new hp(I.message,null!==(P=I.message)&&void 0!==P&&P.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 48:case"end":return e.stop()}}),e,null,[[14,40]])})))).apply(this,arguments)}function Fp(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||Dp[i],c=p(l(l(l(l(l(l(l(l({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||Op,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(Op.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"2.0.22"),null==t?void 0:t.headers);"dev"!==i&&delete c["sofa-group-name"],"sandbox"===i&&(c["load-test"]=!0,c.sofaPenAttrs="instMock=O&loadMode=2");var u,d=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,h=Object.entries(c).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==qe(e[1])})).reduce((function(e,t){var n=et(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),f={baseURL:s,timeout:d,headers:c},m=null;"app"===Kp.appType?m=new xp({baseURL:s,method:"POST",timeout:d,headers:h}):m=Si.create(p(p({},f),{},{withCredentials:null===(u=null==t?void 0:t.withCredentials)||void 0===u||u,method:(null==t?void 0:t.method)||"POST"}));return m.request}Hp.setGlobalOptions=function(e){Object.assign(Kp,e)};"".concat(window.location.origin,"/elements/src/pages");var jp=Pp,Gp=function(){try{return"undefined"!=typeof window&&"true"===window.localStorage.getItem("antom-web-checkout-v2_modern_web")}catch(e){return!1}},zp=function(e){var t;if(!e)return{modernWeb:!1};var n=jp(e),r=!(null==n||null===(t=n.flowSwitchTags)||void 0===t||!t.split(",").includes("elementV3"));return{modernWeb:r||Gp()}};var Vp=function(e){return zp(e).modernWeb},Wp=n(5225),qp=n.n(Wp),Jp=n(2242),Qp=n.n(Jp),Zp=n(8994);function Xp(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Zp.apply(void 0,[{},e].concat(n))}var $p=new zl({appId:"180020050100012557",performance:!1,error:!1,env:"PROD",compactExtraInfo:!0}),eh="7981",th=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){$p.log(p({code:"".concat(eh).concat(e)},t))}},nh=th(),rh=th("event"),oh=th("mount"),ih=th("handshake"),ah=th("merchant"),sh=th("element"),lh=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);"2.0.3".replace(/-dev\.[0-9]+/,"");return(0,jl.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js","sdkDebugger").then((function(e){return e.variable}))},ch=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};nh({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=et(a,3),l=s[0],c=s[1],u=s[2];rh({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},uh=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=et(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(zs.isError(e)?e.toJSON():e);ch("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},dh=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKInternalError"),e}return f(n)}(zs),ph=function(e){y(n,e);var t=b(n);function n(e){return v(this,n),t.call(this,"HOST",e)}return f(n,[{key:"_transferReceivePort",value:function(e){Wp(Jp(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){Wp(Jp(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){Wp(Jp(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){Wp(Jp(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=Wp(Jp(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return Hl.getGlobalBridge("HOST")}}]),n}(Hl),hh=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),l(Qe(i),"name","MountError"),i}return f(n)}(dh),fh=function(e){return new dh("Element destroyed, previous status: ".concat(e),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE")},mh=function(){function e(t,n){v(this,e),l(this,"name",void 0),l(this,"_elementMode",void 0),l(this,"_isMainElement",void 0),l(this,"config",void 0),l(this,"bridge",void 0),l(this,"hooks",{}),l(this,"iframe",null),l(this,"status",void 0),l(this,"cachedSend",[]),l(this,"submitPromise",void 0),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new ph(t),this.bridge.setOrigin(n.targetOrigin),n.trackId&&$p.setTrackId(n.trackId),this.bridge.setDebugCallback((function(e,t){try{if(e.type.endsWith(gl)||e.type.endsWith(Ll))return;var n,r;if(e.type.endsWith(Il))ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message);else e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)}catch(e){}})),this.status="initialized"}var t,n,r,i,s;return f(e,[{key:"submit",value:function(e){throw new dh("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(s=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"_setup",value:(i=a(o().mark((function e(){var t,n,r,i,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=function(){return"destroyed"===s.status})()){e.next=3;break}return e.abrupt("return");case 3:return n=function(){},r=new Promise((function(e,t){n=s._addHook("ondestroy",(function(e){return t(fh(e))}))})),i=Promise.resolve().then(a(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.setup();case 4:return n=e.sent,e.abrupt("return",t()?void 0:n);case 6:case"end":return e.stop()}}),e)})))),e.prev=6,e.next=9,Promise.race([i,r]);case 9:return e.abrupt("return",e.sent);case 10:return e.prev=10,t()||n(),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[6,,10,13]])}))),function(){return i.apply(this,arguments)})},{key:"is",value:function(e){return this.name.startsWith(e.elementType)}},{key:"mount",value:(r=a(o().mark((function e(t){var n,r,i,a,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new hh({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),uh(n),n;case 4:return r=Date.now(),i=cl((function(){return Promise.all([s._setup(),s._mount(t)])}),15e3,new hh("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),a=dl((function(){oh({msg:s.name,d1:"用户退出页面",m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0})})),e.abrupt("return",i().then((function(e){var t=et(e,1)[0];ah({msg:s.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),oh({msg:s.name,d1:"挂载成功",m1:1,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),s.bridge.send(ml,Xp(s.config.appConfig,t||{}))})).catch((function(e){"destroyed"!==s.status&&s.unmount();var t=dh.unificationError(e);throw oh({msg:s.name,d1:"挂载失败",d2:t.code,d3:t.reason,m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),uh(t),t})).finally((function(){a()})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(o().mark((function e(r,i){var a,s,l,c,u,d,p,h,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",i(new hh({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",i(new hh("container missing","MOUNT_MISSING_CONTAINER")));case 5:a=n.config.appUrl,s=new URL(n.config.appUrl),l=[["origin",window.location.origin],["locale",n.config.locale]].concat(Xe(n.config.trackId?[["track_id",n.config.trackId]]:[]));try{l.forEach((function(e){var t=et(e,2),n=t[0],r=t[1];return s.searchParams.set(n,r)})),a=s.toString()}catch(e){c=a.includes("?")?"&":"?",u=l.map((function(e){var t=et(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),a="".concat(a).concat(c).concat(u)}(d=t.querySelector("#sdk-loading"))&&(d.style.display=""),n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=a,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.iframe.style.colorScheme=null!==(p=n.config.colorScheme)&&void 0!==p?p:"light dark",n.iframe.allow="payment",n.bridge.on(Ll,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),h=Date.now(),f=n._addHook("ondestroy",(function(e){i(fh(e))})),n.bridge.once(vl,(function(){var e;if(d&&(d.style.display="none"),"mounted"!==n.status&&"ready"!==n.status){if(null===(e=n.iframe)||void 0===e||!e.contentWindow)return r();ch("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",n.bridge.setTarget(n.iframe.contentWindow);var t=Date.now();n.bridge.once(wl,(function(e){n.status="ready",n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),ih({msg:n.name,d1:(null==e?void 0:e.version)||"未知版本",m1:Math.round(Date.now()-t),m2:1,m3:Math.round(Date.now()-h)})})),f(),r()}else f()})),n.iframe.onerror=function(e){i(new hh("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(2),i(new hh("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 24:case"end":return e.stop()}}),e,null,[[2,21]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:(t=a(o().mark((function e(t){var n,r,i,a=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"destroyed"!==this.status){e.next=3;break}throw new dh("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");case 3:if("ready"===this.status){e.next=5;break}throw new dh({message:"Element is { status }, it is not ready, cannot update config",params:{status:this.status}},"UPDATE_CONFIG_NOT_READY","SDK_USAGE");case 5:return this.config.appConfig=Xp(this.config.appConfig,t),ch("INFO","SDK_USAGE","Updating configuration via API",t),n=function(){},r=cl((function(){return new Promise((function(e){n=a.bridge.once(yl,(function(t){e(t)})),a.bridge.send(gl,{merged:a.config.appConfig,updated:t})}))}),3e3,new dh("Update config timeout","UPDATE_CONFIG_TIMEOUT","SYSTEM")),e.abrupt("return",r().catch((function(e){return n(),{error:dh.unificationError(e).toJSON()}})));case 12:return e.prev=12,e.t0=e.catch(0),i=dh.unificationError(e.t0),e.abrupt("return",Promise.resolve({error:i.toJSON()}));case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){"mounted"===this.status||"ready"===this.status?(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe))):ch("WARN","SDK_USAGE","element status is ".concat(this.status,", can not unmount, please check the usage. only mounted or ready status can unmount"))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):uh(new dh("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:function(e){var t=this;return"HOST"!==this.bridge.mode?Promise.reject(new Error("submit method only available in HOST mode")):(this.submitPromise||(this.submitPromise=new Promise((function(n){t.send(_l,e),t.bridge.once(bl,(function(e){n(e)}))})).finally((function(){t.submitPromise=void 0}))),this.submitPromise)}},{key:"destroy",value:function(){var e,t=this;if("destroyed"!==this.status){if(null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e(t.status)})),this.hooks={},this.bridge.destroy(),"mounted"===this.status||"ready"===this.status)this.unmount();else{var n,r=null===(n=this.iframe)||void 0===n?void 0:n.parentNode;r&&r.removeChild(this.iframe)}this.status="destroyed"}else ch("WARN","SDK_USAGE","element status is ".concat(this.status,", can not destroy, please check the usage. only mounted or ready status can destroy"))}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();l(mh,"elementType",void 0);var vh=function(e){y(n,e);var t=b(n);function n(e,r,o,i){return v(this,n),t.call(this,e,p(p({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return f(n,[{key:"_submit",value:function(e){return Wp(Jp(n.prototype),"_submit",this).call(this,e)}}]),n}(mh),gh=function(){function e(t){var n,r=this;v(this,e),l(this,"config",void 0),l(this,"isInit",!1),l(this,"isDestroyed",!1),l(this,"version",void 0),l(this,"elementMode","SINGLE"),l(this,"_elements",new Map),l(this,"globalBridgeForWebApp",void 0),l(this,"globalBridgeForModal",void 0),l(this,"openModalHandle",void 0),l(this,"elementClasses",{}),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,eh=n);var i=this.globalBridgeForWebApp=ph.getGlobalBridge();i.on(Sl,function(){var e=a(o().mark((function e(t){var n,a,s,l,c,u,d,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=r._elements.get(t.scope))&&null!==(n=a.iframe)&&void 0!==n&&n.contentWindow){e.next=4;break}return ch("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available"),e.abrupt("return");case 4:(s=r.globalBridgeForModal=ph.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&ch("INFO","SDK_INTERNAL",e.type,e.payload)})),i.setTarget(a.iframe.contentWindow),e.prev=7,l=new URL(t.url),t.closeConfirm&&l.searchParams.append("confirm","true"),t.url=l.toString(),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(7),c=new dh("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),i.send(Al,c),e.abrupt("return");case 18:return u=new MessageChannel,d=t.modalId||ul("modal_"),e.next=22,r.openModal(p(p({},t),{},{onClose:function(){if(t.closeConfirm)return new pl(d,u.port2).close(!0)}}));case 22:h=r.openModalHandle=e.sent,i.send(Rl,d,[u.port1]),h.onLoadedSuccess((function(){s.setTarget(h.getContentWindow()),t.appearance&&s.send(Dl,t.appearance),t.initialData&&s.send(Ol,t.initialData),s.send(Nl,d,[u.port2])})),i.once(kl,(function(){h.destroy(),s.destroy()}));case 26:case"end":return e.stop()}}),e,null,[[7,13]])})));return function(t){return e.apply(this,arguments)}}()),i.on(El,function(){var e=a(o().mark((function e(t,n,i){var a,s,l,c,u,d,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null==i?void 0:i.source,l=Array.from(r._elements.values()).some((function(e){var t;return(null===(t=e.iframe)||void 0===t?void 0:t.contentWindow)===s})),c=(null===(a=r.openModalHandle)||void 0===a?void 0:a.getContentWindow())===s,!s||l||c){e.next=5;break}return e.abrupt("return");case 5:return u=t.url,d=t.mode,p=void 0===d?"redirect":d,h=t.destroy,(void 0===h||h)&&r.destroy(),e.prev=7,e.next=10,r.redirect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),"replace"===p?window.location.replace(u):"redirect"===p&&(window.location.href=u);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()),i.on(Ml,function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=r._elements.get(t.elementKey))?null==n||n.destroy():ch("WARN","SDK_INTERNAL","Element not found when destroy");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Il)?ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):e.type.endsWith(Al)?ch("ERROR","APP_RUNTIME","Open modal error",e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new dh("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new dh('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return f(e,[{key:"openModal",value:(n=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ch("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"redirect",value:function(e){throw ch("WARN","SDK_INTERNAL","Custom redirect was not implemented, and the default browser redirection method was used",e),new Error("REDIRECT_NOT_IMPLEMENTED")}},{key:"init",value:(t=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,lh().then((function(e){null==e||e.mount()})).catch((function(){var e=new dh("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");uh(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy(),this.isDestroyed=!0}},{key:"_generateElementKey",value:function(e,t){try{var n=this.generateElementKey(e,t);if(!n.startsWith(e))throw new dh("Generate element key error, must start with elementType","GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");return n}catch(n){var r=new dh({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw uh(r),r}}},{key:"_createElement",value:function(e,t){var n,r,o=this,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],sh({msg:e,m1:n?1:0}),!n){var a=new dh({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw uh(a),a}try{r=new n(i,p(p({},this.config),{},{elementMode:this.elementMode,appConfig:p({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=dh.isError(a)?a:new dh({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw uh(s),s}return r._addHook("ondestroy",(function(){o._removeElement(e,t),o._getElementSize()||ch("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,r,t),r}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new dh({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw uh(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),yh=function(e){y(r,e);var t,n=b(r);function r(e){var t;return v(this,r),t=n.call(this,e),l(Qe(t),"waitSendPort",[]),l(Qe(t),"mainElement",void 0),t.elementMode="GROUP",t}return f(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=Wp(Jp(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new dh("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw uh(i),i}this.mainElement=o;var a=new hl(e);o.on(wl,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort(Xe(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new fl(e,s.port1);o.on(wl,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=a(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new dh("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),uh(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(gh),_h=function(e){y(n,e);var t=b(n);function n(){return v(this,n),t.apply(this,arguments)}return f(n)}(gh),bh=(h()(h()(h()({},dp),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",UPDATE_CONFIG_TIMEOUT:"UPDATE_CONFIG_TIMEOUT",UPDATE_CONFIG_NOT_READY:"UPDATE_CONFIG_NOT_READY",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR",CHECKOUT_NOT_READY:"CHECKOUT_NOT_READY",PAYMENT_IN_PROGRESS:"PAYMENT_IN_PROGRESS",AMOUNT_VALUE_EMPTY:"AMOUNT_VALUE_EMPTY",AMOUNT_VALUE_INVALID:"AMOUNT_VALUE_INVALID"}),function(e){_()(n,e);var t=E()(n);function n(){var e;g()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),c()(Ze()(e),"name","AntomSDKError"),e}return m()(n)}(pp)),Eh={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#141935"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#070b29"},cherryBlossomPink:{theme:"light",backgroundColor:"#FFFCFD"}};function Sh(e,t){var n;if(!e)throw new bh("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");ch("INFO","SDK_USAGE","Setup called with sessionData:",{sessionData:e});var r=jp(e);if(!r)throw new bh("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");var o=null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene;if(t&&o!==t)throw new bh("Invalid productScene in sessionData, expected ".concat(t,", but get ").concat(o,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");return r}var Ah="ams-popup",kh=300,Th="ams-component-popup-loading",wh="\n .".concat(Ah,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ah,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ah,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ah,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(kh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ah,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(kh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ah,"-drawer-enter {\n animation: slideIn ").concat(kh,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ah,"-drawer-exit {\n animation: slideOut ").concat(kh,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),Ph=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(Th),n.id=Th,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Tp?t:100*n/e;return Math.min(r,t)}(),"px"),n};var Ih=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,a=void 0===o||o,l=e.hideCloseWhenLoaded,c=void 0===l||l,u=e.onClose,d=e.textDirection,p=void 0===d?"ltr":d,h=e.showLoading,f=void 0===h||h,m=document.createElement("div");m.classList.add("".concat(Ah,"overlay"),"".concat(Ah,"fadeIn"));var v=document.createElement("div");"desktop"===t?(v.classList.add("".concat(Ah,"modal"),"".concat(Ah,"fadeIn")),v.style.width="656px",v.style.height="620px",v.style.borderRadius="12px"):(v.classList.add("".concat(Ah,"modal-mobile"),"".concat(Ah,"-drawer-enter")),v.style.width="100%",v.style.height="80vh",v.style.borderRadius="12px 12px 0 0"),v.setAttribute("dir",p);var g=function(e,t,n){return function(){t&&(t.classList.remove("".concat(Ah,"fadeIn")),t.classList.add("".concat(Ah,"fadeOut")),"desktop"===e?(n.classList.remove("".concat(Ah,"fadeIn")),n.classList.add("".concat(Ah,"fadeOut"))):(n.classList.remove("".concat(Ah,"-drawer-enter")),n.classList.add("".concat(Ah,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),kh))}}(t,m,v),y=document.createElement("iframe");y.src=n,y.style.border="none",y.style.width="100%",y.style.height="100%";var _,b=r||{},E=b.theme,S=void 0===E?"light":E,A=b.backgroundColor,k=void 0===A?"#ffffff":A,T=Ph(S);if(y.addEventListener("load",(function e(){v.removeChild(T),y.removeEventListener("load",e)})),a){var w=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(_=!1,s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=2;break}return e.abrupt("return");case 2:return null===(t=T.parentNode)||void 0===t||t.removeChild(T),v.removeChild(y),n=Ph(S,ip.get({defaultMessage:"closing",id:"antom.common.closing"})),v.appendChild(n),_=!0,e.prev=7,e.next=10,null==u?void 0:u();case 10:return e.prev=10,_=!1,e.finish(10);case 13:g();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:p});c&&y.addEventListener("load",(function e(){v.removeChild(w),y.removeEventListener("load",e)})),v.appendChild(w)}if(f){v.style.backgroundColor=k,y.style.backgroundColor=k;y.addEventListener("load",(function e(){var t;null===(t=T.parentNode)||void 0===t||t.removeChild(T),y.removeEventListener("load",e)})),v.appendChild(T)}v.appendChild(y);var P,I=document.getElementsByTagName("body")[0];return(P=document.createElement("style")).innerHTML=wh,document.head.appendChild(P),I.appendChild(m),I.appendChild(v),{iframe:y,destroy:g}};var Ch={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},Rh={"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"bottom-right":{top:"0",right:"0",bottom:"0",left:"0"},center:{top:"0",right:"0",bottom:"0",left:"0"}},Nh={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},Dh="antom_toast-container";function Oh(e){return Lh.apply(this,arguments)}function Lh(){return(Lh=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{error:void 0,data:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{error:bh.unificationError(e.t0).toJSON(),data:void 0});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function Mh(e,t){return xh.apply(this,arguments)}function xh(){return(xh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Uh(e,t){return Bh.apply(this,arguments)}function Bh(){return(Bh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpcashier.cashier.createApplePayPaymentSession",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kh(e,t){return Hh.apply(this,arguments)}function Hh(){return(Hh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpfront.one.account.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yh(e,t){return Fh.apply(this,arguments)}function Fh(){return(Fh=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hp("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jh="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",Gh=null;function zh(){return Gh||(Gh=new Promise((function(e){if(Ap)return e(!1);if(window.ApplePaySession)return e(!0);var t=function(t){clearTimeout(n),t||(Gh=null),e(t)},n=setTimeout((function(){console.warn("[ApplePay] Apple Pay SDK load timed out, will retry on next call"),t(!1)}),1e4),r=document.querySelector('script[src="'.concat(jh,'"]'));if(r)return window.ApplePaySession?void t(!0):(r.addEventListener("load",(function(){return t(!0)})),void r.addEventListener("error",(function(){return t(!1)})));var o=document.createElement("script");o.src=jh,o.onload=function(){return t(!0)},o.onerror=function(){return t(!1)},document.head.appendChild(o)})),Gh)}function Vh(e){var t;if(!e)return null;var n,r=(null==e?void 0:e.paymentMethods)||[],o=d()(r);try{for(o.s();!(n=o.n()).done;){var i,a=n.value;if("APPLEPAY"===(null==a?void 0:a.paymentMethodType)||"APPLE_PAY"===(null==a?void 0:a.paymentMethodType))return(null==a||null===(i=a.paymentMethodDetail)||void 0===i||null===(i=i.applePayProps)||void 0===i?void 0:i.paymentRequest)||null}}catch(e){o.e(e)}finally{o.f()}return(null==e||null===(t=e.applePayProps)||void 0===t?void 0:t.paymentRequest)||null}var Wh=function(){function e(t){g()(this,e),c()(this,"opts",void 0),c()(this,"session",null),c()(this,"settled",!1),c()(this,"phase","idle"),c()(this,"cancelReason",null),c()(this,"modalCloseHandler",null),c()(this,"_activePay",null),this.opts=t}var t,n;return m()(e,[{key:"startPay",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._activePay){e.next=2;break}return e.abrupt("return",this._activePay);case 2:return this._activePay=this._startPayInternal().finally((function(){t._activePay=null})),e.abrupt("return",this._activePay);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_startPayInternal",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,l,c,u=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.settled=!1,this.phase="idle",this.cancelReason=null,(a=this.opts.paymentRequest).version&&Array.isArray(a.supportedNetworks)&&0!==a.supportedNetworks.length&&Array.isArray(a.merchantCapabilities)&&0!==a.merchantCapabilities.length&&a.countryCode&&a.currencyCode&&null!==(t=a.total)&&void 0!==t&&t.label&&null!==(n=a.total)&&void 0!==n&&n.amount){e.next=8;break}throw console.warn("[ApplePay] Required Apple Pay fields are missing"),{errorCode:"APPLE_PAY_MISSING_DATA"};case 8:return e.next=10,zh();case 10:if(l=e.sent,c=window.ApplePaySession,l&&c){e.next=16;break}throw console.warn("[ApplePay] Apple Pay SDK not available on host"),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 16:if(null!==(r=c.canMakePayments)&&void 0!==r&&r.call(c)&&null!==(o=c.supportsVersion)&&void 0!==o&&o.call(c,a.version)){e.next=20;break}throw console.warn("[ApplePay] canMakePayments=false (version=".concat(a.version,")")),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 20:e.prev=20,this.session=new c(a.version,this.buildSessionParams()),e.next=29;break;case 24:throw e.prev=24,e.t0=e.catch(20),console.warn("[ApplePay] ApplePaySession constructor failed:",e.t0),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 29:return e.abrupt("return",new Promise((function(e,t){var n=function(n){u.settled||(u.settled=!0,u.clearModalCloseListener(),n?t(n):e())};u.session.onvalidatemerchant=function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.phase="validating",e.prev=1,e.next=4,u.opts.callbacks.validateMerchant(null==t?void 0:t.validationURL);case 4:if(r=e.sent){e.next=7;break}throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 7:u.phase="validated",u.session.completeMerchantValidation(r),e.next=21;break;case 11:if(e.prev=11,e.t0=e.catch(1),u.phase="idle",!u.settled){e.next=17;break}return u.safeAbort(),e.abrupt("return");case 17:o=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] validateMerchant failed:",e.t0),n({errorCode:o}),u.safeAbort();case 21:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),u.session.onpaymentauthorized=function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.phase="authorizing",r=(null==t?void 0:t.payment)||{},o=r.token,a=r.billingContact,s=r.shippingContact,o){e.next=7;break}return u.safeComplete(c.STATUS_FAILURE),n({errorCode:"APPLE_PAY_TOKEN_ERROR"}),e.abrupt("return");case 7:return e.prev=7,e.next=10,u.opts.callbacks.onAuthorized({token:o,billingContact:a,shippingContact:s});case 10:(l=e.sent).success?(u.safeComplete(c.STATUS_SUCCESS),n()):("MERCHANT_CONFIRM_ABORT"===l.errorCode&&(u.cancelReason="MERCHANT_ABORT"),u.safeComplete(c.STATUS_FAILURE),d=l.errorCode||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",l.errorMessage&&console.warn("[ApplePay] onAuthorized returned failure:",l.errorMessage),n({errorCode:d})),e.next=20;break;case 14:e.prev=14,e.t0=e.catch(7),u.safeComplete(c.STATUS_FAILURE),p=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] onAuthorized threw:",e.t0),n({errorCode:p});case 20:case"end":return e.stop()}}),e,null,[[7,14]])})));return function(t){return e.apply(this,arguments)}}(),u.session.oncancel=function(){return"MERCHANT_ABORT"===u.cancelReason?(u.phase="idle",void n({errorCode:"MERCHANT_CONFIRM_ABORT"})):"validating"===u.phase?(u.phase="idle",void n({errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"})):(u.phase,u.phase="idle",void n({errorCode:"APPLE_PAY_CANCEL"}))};try{u.session.begin()}catch(e){return console.warn("[ApplePay] ApplePaySession.begin() failed:",e),void n({errorCode:"APPLE_PAY_NOT_SUPPORTED"})}u.opts.enableModalCloseListener&&u.attachModalCloseListener((function(){u.safeAbort(),n({errorCode:"APPLE_PAY_CANCEL"})}))})));case 30:case"end":return e.stop()}}),e,this,[[20,24]])}))),function(){return t.apply(this,arguments)})},{key:"buildSessionParams",value:function(){var e=this.opts.paymentRequest,t={countryCode:e.countryCode,currencyCode:e.currencyCode,merchantCapabilities:e.merchantCapabilities,supportedNetworks:e.supportedNetworks,requiredBillingContactFields:e.requiredBillingContactFields,requiredShippingContactFields:e.requiredShippingContactFields,total:e.total};return e.lineItems&&e.lineItems.length>0&&(t.lineItems=e.lineItems),e.recurringPaymentRequest&&(t.recurringPaymentRequest=e.recurringPaymentRequest),t}},{key:"safeAbort",value:function(){try{var e,t;null===(e=this.session)||void 0===e||null===(t=e.abort)||void 0===t||t.call(e)}catch(e){}}},{key:"safeComplete",value:function(e){try{var t,n;null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,e)}catch(e){}}},{key:"attachModalCloseListener",value:function(e){var t,n=document.querySelector("apple-pay-modal"),r=(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(".modal-close-button"))||null;if(r){var o=function(){e()};r.addEventListener("click",o,{once:!0}),this.modalCloseHandler={el:r,fn:o}}}},{key:"clearModalCloseListener",value:function(){this.modalCloseHandler&&(this.modalCloseHandler.el.removeEventListener("click",this.modalCloseHandler.fn),this.modalCloseHandler=null)}}]),e}();function qh(e){return Jh.apply(this,arguments)}function Jh(){return Jh=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.requestId,r=t.renderData,o=t.appConfig,a=t.sendReply,l=Vh(r)){e.next=5;break}return a({requestId:n,success:!1,errorCode:"APPLE_PAY_MISSING_DATA"}),e.abrupt("return");case 5:return c=l.merchantCapabilities,u=l.merchantInfo,d=l.paymentAmount,p=l.supportedNetworks,f=l.version,m=l.requiredBillingContactFields,v=l.requiredShippingContactFields,g=(null==o?void 0:o.sessionData)||"",y=null==o?void 0:o.amount,_=null!=y&&y.value?y:d,b=null==_?void 0:_.value,E=null==d?void 0:d.currency,S=Qh(g,u,_),w=new Wh({paymentRequest:h()({countryCode:null==u?void 0:u.countryCode,currencyCode:E,merchantCapabilities:c,supportedNetworks:p,requiredBillingContactFields:m,requiredShippingContactFields:v,total:S?{type:"final",label:S.regularBilling.label,amount:b}:{type:"final",label:null==u?void 0:u.merchantName,amount:b},version:S?14:f},S?{lineItems:[S.regularBilling],recurringPaymentRequest:S}:{}),enableModalCloseListener:!1,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uh({validateUrl:t,paymentSessionData:g,merchantDomain:window.location.hostname});case 2:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=5;break}return e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 5:throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.token,r=t.billingContact,o=t.shippingContact,k=r,T=o,A={token:n,billingContact:r,shippingContact:o},e.abrupt("return",{success:!0,result:A});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=13,e.next=16,w.startPay();case 16:a({requestId:n,success:!0,result:A,billingDetails:k,shippingAddress:T}),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(13),P=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED",a({requestId:n,success:!1,errorCode:P});case 23:case"end":return e.stop()}}),e,null,[[13,19]])}))),Jh.apply(this,arguments)}function Qh(e,t,n){if(!e)return null;try{var r,o,i,a,s,l,c=jp(e),u=null==c?void 0:c.paymentSessionFactor,d=null==u?void 0:u.recurringInfo;if(!d)return null;var p=null==u||null===(r=u.order)||void 0===r?void 0:r.orderDescription;if(!p||!d.managementURL)return null;var f=h()(h()(h()({type:"final",label:null!==(o=d.title)&&void 0!==o?o:null==t?void 0:t.merchantName,amount:null==n?void 0:n.value,paymentTiming:"recurring"},d.startDate?{recurringPaymentStartDate:new Date(1e3*d.startDate)}:{}),d.endDate?{recurringPaymentEndDate:new Date(1e3*d.endDate)}:{}),{},{recurringPaymentIntervalUnit:null!==(i=d.intervalUnit)&&void 0!==i?i:"month",recurringPaymentIntervalCount:null!==(a=d.intervalCount)&&void 0!==a?a:1});return{paymentDescription:p,billingAgreement:null!==(s=d.agreementDescription)&&void 0!==s?s:void 0,regularBilling:f,managementURL:d.managementURL,tokenNotificationURL:null!==(l=d.tokenNotificationURL)&&void 0!==l?l:void 0}}catch(e){return null}}var Zh=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),Xh=[{eventName:Zh.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:Zh.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],$h=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),ef=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=$h,document.head.appendChild(n),At();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,St(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),tf(e,t),o}},tf=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(Ee,"-btn-").concat(e,"' src=\"").concat(Le,'"/>'),i=document.createElement("div");i.classList.add("".concat(Ee,"-").concat(e),"".concat(Ee,"-hidden")),i.id=Ee,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},nf=function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(e.classList.remove("".concat(Ae,"-show")),e.classList.add("".concat(Ae,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Ae,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Oe))},rf=function(){var e=document.getElementById(Ae),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Ae,"-hidden")),e.classList.add("".concat(Ae,"-show")))},of=function(){var e;null===(e=document.getElementById(Ae))||void 0===e||e.remove()},af=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Se,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),o.id=Se,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},sf=function(){var e=document.getElementById(ke);null==e||e.classList.add("".concat(ke,"-hidden"))},lf=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(ke);null==e||e.remove()},cf="\n .".concat(Re,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Re,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Re,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Re,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Oe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Re,"-drawer-enter {\n animation: slideIn ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Re,"-drawer-exit {\n animation: slideOut ").concat(Oe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),uf=function(){var e=document.createElement("style");e.innerHTML=cf,document.head.appendChild(e)};var df="desktop",pf=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{df=t;var c=document.createElement("div");c.classList.add("".concat(Re,"overlay"),"".concat(Re,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(Re,"modal"),"".concat(Re,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(Re,"modal-mobile"),"".concat(Re,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Ne,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var f=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(f),d.addEventListener("load",(function(){u.removeChild(f)}))}u.appendChild(d);var m=document.getElementsByTagName("body")[0];m.appendChild(c),m.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},hf=function(){var e=document.querySelector(".".concat(Re,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===df?document.querySelector(".".concat(Re,"modal")):document.querySelector(".".concat(Re,"modal-mobile"));e.classList.remove("".concat(Re,"fadeIn")),e.classList.add("".concat(Re,"fadeOut")),"desktop"===df?(t.classList.remove("".concat(Re,"fadeIn")),t.classList.add("".concat(Re,"fadeOut"))):(t.classList.remove("".concat(Re,"-drawer-enter")),t.classList.add("".concat(Re,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),Oe)}},ff=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e.NEW_ELEMENT_PAYMENT="/elements2/pages/element_payment/index.html",e}({}),mf=m()((function e(){g()(this,e),c()(this,"type",void 0),c()(this,"platform",void 0),c()(this,"isRetention",void 0),c()(this,"selector",void 0),c()(this,"appearance",void 0),c()(this,"appendAliasContainerId",void 0),c()(this,"merchantAppointParam",void 0),c()(this,"iframeStyle",void 0),c()(this,"notRedirectAfterComplete",void 0),this.platform=_t()?te.desktop:te.mobile,this.isRetention=!0,this.type=Y.popup,this.selector=""})),vf=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function gf(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==vf.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=xs(a),l=tt()(s,1)[0],c=xs(i),u=tt()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function yf(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,u=e.locale,d=e.pageUrl,p=e.link,h=e.renderDisplayType,f=Ms(r),m=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",v=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",g=(null==r?void 0:r.extendInfo)||"",y=null==r?void 0:r.clientId,_=(o||"").split("&&")[1]||"",b=c()(c()(c()(c()(c()(c()({},U.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),U.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),U.SANDBOX,"https://checkout.antom.com"),U.PROD,"https://checkout.antom.com"),E=(null==a?void 0:a.toLocaleUpperCase())||U.DEV;p||(p="".concat(b[E]).concat(d));var S=Ea({renderDisplayType:null!=h?h:Y.inline,componentSign:f,analytics:l,productScene:v,productSceneVersion:m,environment:a,appVersion:s,extendInfo:g,locale:u,instanceId:i,hostSign:_,mid:y,elementLink:p}),A=S.path,k=S.locationSearch;return console.log("[debug] generateIframeSrc",A,k),"".concat(A,"?").concat(k)}function _f(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var bf=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},Ef=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},Sf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},Af=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}},kf=function(){function e(t){g()(this,e),c()(this,"elementContainer",void 0),c()(this,"instanceId",void 0),c()(this,"options",void 0),c()(this,"obtainDataRes",void 0),c()(this,"elementUrl",void 0),c()(this,"eventCenter",void 0),c()(this,"eventListener",{}),this._setOptions(t)}return m()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(fe.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=Q.component),n.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(fe.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=Z.proxy),t=bt()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(fe.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===ee.WAP&&(n.options.env.osType=mt?$.IOS:vt?$.ANDROID:$.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product,this.options.preview=null==e?void 0:e.preview}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),Tf=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===G.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:h()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return yf({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:ff.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}(kf),wf=Tf,Pf=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return yf({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:ff.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}(kf),If=Pf,Cf="#".concat(be,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(be,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Ce,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Ce,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Ce,"-desktop{}\n"),Rf=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=Cf,document.head.appendChild(e)},Nf=function(e,t,n){var r=document.createElement("div");r.id=Te,(null==n?void 0:n.componentSign)===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Ce,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Ce,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===te.mobile&&(r.innerHTML='<svg class="'.concat(Ce," ").concat(Ce,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);St(0,o)},Df=function(){function e(){g()(this,e),c()(this,"popupUrlQuery",void 0),c()(this,"popupApp",void 0)}var t;return m()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),a=!1,e.next=11,pf({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,s=setTimeout((function(){if(!a)throw{title:"sdk_error_create_pop_up"}}),De),l=setTimeout((function(){if(!a)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){a=!0,clearTimeout(s),clearTimeout(l)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){hf()}}]),e}(),Of=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"initMessageEvent",void 0),c()(this,"clearTimerIdMapping",{}),c()(this,"popupManager",void 0),c()(this,"eventCenter",void 0),c()(this,"logService",void 0),c()(this,"displayInfo",void 0),c()(this,"webApp",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"clientHeight",void 0),c()(this,"boundFocusResizeChange",void 0),c()(this,"customizedLoadingListener",void 0)}return m()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=am.getInstance(t).getService("EventCenter"),this.logService=am.getInstance(t).getService("Log"),this.popupManager=new Df,Boolean(Object.keys(e).length)&&n.productScene===G.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Ne,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));It(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===Y.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;if(document.getElementById(Ie)||Rf(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(ye,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):ef(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===Y.inline?e.selector:ye,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(ye);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(ye,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===Y.inline)Nf(e,t.platform);else{var n=document.getElementById(ke);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(Et(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(ye);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(ye,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(ve.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(ve.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(ve.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(ve.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(ve.sizeChanged.name,(function(t){e.handleSizeChanged(h()({},t))})),this.eventCenter.listen(ve.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(ve.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(ve.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(ve.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(ve.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(ve.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Se));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===Y.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(ye,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(ye,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===Y.inline)null===(l=document.getElementById(Te))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(Ee);e?null==t||t.classList.remove("".concat(Ee,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Ee,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Se);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Se,"-hidden")):null==t||t.classList.add("".concat(Se,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(Ee),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Se);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(Ee,"-light")),null==r||r.classList.add("".concat(Se,"-light"))):(null==n||n.setAttribute("src",Le),null==t||t.classList.remove("".concat(Ee,"-light")),null==r||r.classList.remove("".concat(Se,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(uf(),this.popupManager.popup(h()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(ve.error.name,fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:ve.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),Lf=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=Mf,this.debug=![X.prod,X.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Jt("AMSSDK_STORAGE_ID");r||Qt("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:_t()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?da.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=h()({},t),c=null==t?void 0:t.title;return ma[c]&&(l.title=ma[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:h()(h()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),Mf={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},xf=function(e){return new URL(e.src).origin},Uf=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"iframes",void 0),c()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return m()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(ve.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(ve.beforeSubmit.name,(function(e){if(r.isExist(ve.beforeSubmit.name))r.emit(ve.beforeSubmit.name,e);else{var t=Fe();r.dispatchToApp({event:ve.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(ve.sendBroadcast.name,(function(e){r.dispatchToApp({event:ve.receiveBroadcast.name,data:e})})),r.listen(ve.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:ve.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(ve.submitForm.name),e.unlisten(ve.beforeSubmit.name),e.unlisten(ve.sendBroadcast.name),e.unlisten(ve.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:xf(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===xf(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&(null===(t=e.data)||void 0===t||!t.source||!["react-devtools-content-script","react-devtools-backend-manager","react-devtools-bridge"].includes(e.data.source)))if(ct(e.data)){var n=JSON.parse(e.data);if(n.context.event&&n.context.event,!this.checkEventCompliant(n))return;this._handleAppMessage(n)}else console.error(fe.NOT_JSON_FORMAT)}},{key:"checkEventCompliant",value:function(e){if(e.name!==ne.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=Fe()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:ne.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(h()(h()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),Bf=function(){function e(){g()(this,e),c()(this,"sandboxFlag",void 0),c()(this,"instanceId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){var r=bt()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[h()(h()({},t),{},{envInfo:r,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],a=Date.now(),s="",e.prev=4,l=this.createRequestInstance(n),e.next=8,l({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},s=Hi(d,"Mgw-TraceId")||Hi(d,"mgw-traceid",""),p.traceId=s||"",null==(f=Yi(d,s))||!f.errorCode){e.next=20;break}throw m=(null==p?void 0:p.errorMessage)||(null==f?void 0:f.errorMessage),v=null==f?void 0:f.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:v,errorMessage:m,traceId:s}),new Error(JSON.stringify({errorMessage:m,errorCode:v,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!0,code:"SUCCESS",errorMessage:"",traceId:s}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,traceId:s,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?oe.TIMEOUT:"",b=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:b,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:b,traceId:s,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=mt?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){am.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Di(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Ni(null==e?void 0:e.hostSign,i)||Pi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Ci,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Ci.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Ri),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ii),"sdk-version",T||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Si.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),Kf=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),Hf={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},Yf=c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),Ff=function(e){return Yf[e]||""},jf=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},Gf=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||Hf[Kf.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=jf(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(Yf).includes(this.scene)||!Object.values(Hf).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),zf=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"productScene",G.EASY_PAY),c()(this,"environment",void 0)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.logger=am.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(a=s()(i()().mark((function e(){var t,n,r=this,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(s()(i()().mark((function o(){var a,s,l,c;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=Date.now(),s=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:s});case 4:if(l=o.sent,c="",!l){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,l.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,l.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,a);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"preInitSecurity",value:(o=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l=this,c=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!bn.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!bn.isLoading(o)){e.next=19;break}if(!(a=bn.get(o))||"loading"!==a.status){e.next=19;break}return e.prev=9,e.next=12,a.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),s=jf(this.environment),un.getInstance().scheduleLoad({environment:s,callbacks:{onLoad:function(e){l.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){l.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:l.productScene}).send()},onLoadTimeout:function(){l.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:l.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){l.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:l.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),l._newSecuritySDKByScene({product:l.productScene,region:t?Kf.SG:void 0},(function(){l.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:l.productScene}:void 0).send(),e()}),(function(e){l.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:l.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||Ff(e)}},{key:"_getSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",bn.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||Ff(e.product),a=o.h5gateway||(r=e.region,Hf[r]||Hf[Kf.SG]),s=bn.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new Gf({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){bn.setReady(i,l),t&&t(),e(l)}),(function(e){bn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));bn.setLoading(i,c)}catch(e){bn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),Vf=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Wf=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),qf=m()((function e(){g()(this,e)})),Jf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g()(this,e),c()(this,"isDebug",!0),c()(this,"instanceId",void 0),c()(this,"logger",void 0),this.instanceId=t,this.logger=am.getInstance(this.instanceId).getService("Log")}return m()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(Vf.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(Vf.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(Vf.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new Wf((function(e){r.traceLog(Vf.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(Vf.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=d()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(Vf.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,p=d()(e.interceptors);try{for(p.s();!(u=p.n()).done;){var h=u.value;null==h||h.onPublishException(t,n)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var f,m=!1,v=d()(e.interceptors);try{for(v.s();!(f=v.n()).done;){var g=f.value;m=m||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}m?this.publish(t,n):this.traceError(Vf.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(Vf.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(Vf.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(Vf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=d()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(Vf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();c()(Jf,"interceptors",[]),c()(Jf,"subscribersMap",new Map),c()(Jf,"TAG","BusManager"),c()(Jf,"_logSplit"," , ");var Qf=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),Zf=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),Xf=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),$f=function(e){return e.reportAnalytics="reportAnalytics",e}({});Qf=function(e){return e.onDestory="httpRequest",e}(Qf||{});var em=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),c()(Ze()(t),"logger",void 0),t.instanceId=e,t.logger=am.getInstance(t.instanceId).getService("Log"),t}return m()(r,[{key:"actionNames",value:function(){return Object.values($f)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===$f.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(qf),tm=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t;return g()(this,a),t=o.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return m()(a,[{key:"actionNames",value:function(){return Object.values(Xf)}},{key:"preInitSecurity",value:(r=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=am.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=am.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=am.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Xf.preInitSecurity:this.preInitSecurity(e,t);case Xf.initSecurity:this.initSecurity(e,t);case Xf.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),a}(qf),nm=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"instanceId",void 0),r.instanceId=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Zf)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=am.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){am.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),am.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Zf.getGlobalData:this.getGlobalData(e,t);break;case Zf.setGlobalData:this.setGlobalData(e,t);break;case Zf.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(qf),rm=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Qf)}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=am.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=am.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Qf.request:this.request(e,t);break;case Qf.getEnvInfo:this.getEnvInfo(e,t);break;case Qf.getUserAgent:this.getUserAgent(e,t)}}}]),r}(qf),om=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"instanceId",void 0),c()(this,"busManager",void 0)}return m()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=am.getInstance(this.instanceId).getService("Log"),this.busManager=new Jf(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==X.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new tm(this.instanceId)),this.busManager.subscribe(new em(this.instanceId)),this.busManager.subscribe(new nm(this.instanceId)),this.busManager.subscribe(new rm(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),im=function(){function e(){g()(this,e),c()(this,"globalData",new Map)}return m()(e,[{key:"init",value:function(e,t){var n=this,r=am.getInstance(t).getService("EventCenter");r.listen(ve.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(ve.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),am=function(){function e(t){g()(this,e),c()(this,"instanceId",void 0),c()(this,"services",{Log:new Lf,ApiBusManager:new om,Requester:new Bf,Container:new Of,Security:new zf,EventCenter:new Uf,GlobalData:new im}),c()(this,"extendServices",{}),this.instanceId=t}return m()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();c()(am,"ProvidersMapping",{});var sm={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},lm={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},cm={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},um={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]};function dm(e){"GOOGLEPAY"===e.paymentMethodType&&(e.paymentMethodDetail=h()(h()({},e.paymentMethodDetail),{},{googlePayProps:{environment:"TEST",existingPaymentMethodRequired:!0,paymentRequest:{allowedPaymentMethods:[{parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","JCB"]},tokenizationSpecification:{parameters:{protocolVersion:"ECv2",publicKey:"BDM6GVTLZmxSmTQzm04QKI2av54kFpkqjhbkejtdDUx+VMvUtJ6vc+ZlDp8TygNTf+QeihxpD869sCVWaa0KMJc="},type:"DIRECT"},type:"CARD"}],apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION"],merchantInfo:{merchantId:"123",merchantName:"merchantName"},shippingAddressRequired:!0,transactionInfo:{countryCode:"US",currencyCode:"EUR",totalPrice:"10",totalPriceStatus:"FINAL"}}}}))}var pm,hm=new va(ga,!0),fm=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},mm=function(e){_()(o,e);var t,n,r=E()(o);function o(){var e;g()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),c()(Ze()(e),"ApplePayService",void 0),c()(Ze()(e),"_onBeforeConfirm",null),c()(Ze()(e),"_merchantAmount",null),c()(Ze()(e),"_merchantCurrency",null),e}return m()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a,s,l=this.elementContainer.getPaymentContext();if(this.getLogger().logInfo({title:"sdk_event_renderComponent"}),"mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)){var c,u,d,p,h=(null==e||null===(c=e.originActionQueryResult)||void 0===c?void 0:c.paymentMethods)||[],f=(null==e||null===(u=e.originActionQueryResult)||void 0===u?void 0:u.savedPaymentMethods)||[];if(!(1!==h.length||0!==f.length||null!==(d=h[0])&&void 0!==d&&null!==(d=d.paymentElements)&&void 0!==d&&d.length||["APPLEPAY","GOOGLEPAY"].includes(null===(p=h[0])||void 0===p?void 0:p.paymentMethodType)))return}var m,v=null==l||null===(n=l.displayInfo)||void 0===n?void 0:n.appearance;if("string"==typeof(null==v?void 0:v.theme)&&v.theme.startsWith("APR_")){var g,y,_=null==e||null===(g=e.originActionQueryResult)||void 0===g||null===(g=g.pageStyle)||void 0===g?void 0:g.elementSettings;m="string"==typeof _?null===(y=Af(_))||void 0===y?void 0:y.appearance:null==_?void 0:_.appearance}else m=v;this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==l?void 0:l.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(o=this.elementContainer)||void 0===o?void 0:o.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(i=this.elementContainer)||void 0===i?void 0:i.getPaymentContext().paymentSessionId,merchantId:null===(a=this.elementContainer)||void 0===a||null===(a=a.getPaymentContext())||void 0===a||null===(a=a.paymentSessionObj)||void 0===a?void 0:a.clientId,paymentMethodType:null===(s=this.elementContainer)||void 0===s||null===(s=s.getPaymentContext())||void 0===s||null===(s=s.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType},appearance:m,sessionResult:null==l?void 0:l.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return am.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(ve.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(ve.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:ve.closePaymentPolling.name,data:t})})),this.eventCenter.listen(ve.getGooglePayToken.name,(function(t,n){Da(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:h()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(ve.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new Oa({paymentSessionData:i,parseData:o,logger:hm,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(ve.beforeConfirm.name,s()(i()().mark((function t(){var n,r,o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return hm.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return hm.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,Pa((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,a=o.result,s=o.timedOut,l=a,(c=s||Date.now()-r>=Aa)&&(hm.logError({title:"sdk_before_confirm_timeout"}),l=!1),hm.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:l}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:h()({success:!0,result:!!l},c?{isTimeout:!0}:{})}),t.next=24;break;case 20:t.prev=20,t.t0=t.catch(6),hm.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!1,result:!1}});case 24:case"end":return t.stop()}}),t,null,[[6,20]])}))))}},{key:"initApplePaySdk",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new Oa({paymentSessionData:o,parseData:r,logger:hm,env:this.options.env.environment}),e.prev=3,hm.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:hm.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),hm.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t,n=e.link,r=e.instanceId;this.instanceId=r;var o=this.elementContainer.getPaymentContext()||{},i=o.paymentSession,a=o.paymentSessionObj,s=o.sdkMetaData,l=this.options,c=l.env.environment,u=l.analytics,d=l.locale,p=(a||{}).extendInfo,h="mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)?Y.popup:Y.inline,f=yf({paymentSession:i,paymentSessionObj:a,environment:c,analytics:u,locale:d,link:n,appVersion:null==s?void 0:s.webAppVersion,pageUrl:fm(p)?ff.EXPRESS_CHECKOUT:ff.ELEMENT_PAYMENT,instanceId:r,renderDisplayType:h});return this.setElementUrl(f),f}},{key:"obtainData",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=am.getInstance(this.instanceId).getService("Requester"),o=this.elementContainer.getPaymentContext(),a=o.paymentSession,s=o.paymentSessionObj,l=o.displayInfo,c=l.debugProps,u=this.options,d=u.env.environment,p=u.locale,h=(s||{}).paymentSessionConfig,f=a.split("&&")[1]||"",m=null==s||null===(t=s.connectFactor)||void 0===t?void 0:t.enableConnect,v=(null==c?void 0:c.isDebug)&&(null==c?void 0:c.local_mock),g=null===(n=this.options)||void 0===n?void 0:n.preview,y=!0===g||"web"===g||"mobile"===g,_=v||y,b=bt(this.getElementUrl()),E=b.appType,S=bf()?"WEB":E?"APP":Ef()?"WEB":"WAP",A=function(){return new Promise((function(e,t){var n;if(_)setTimeout((function(){if(y){var t=C.buildPreviewMockData(sm);e(t)}else e(sm)}),100);else{C.getLogger().logInfo({title:"sdk_action_query_start"},{config:Sf(h)});var o={paymentSessionConfig:h,paymentSessionData:a,extParams:{isUserPreferredLocale:!0}},i=null==l?void 0:l.appearance;"string"==typeof(null==i?void 0:i.theme)&&i.theme.startsWith("APR_")&&(o.appearanceId=i.theme),null!=l&&null!==(n=l.merchantAppointParam)&&void 0!==n&&n.storedCard&&(o.merchantAppointParam=l.merchantAppointParam),Object.prototype.hasOwnProperty.call(l,"notRedirectAfterComplete")&&(o.notRedirectAfterComplete=l.notRedirectAfterComplete),r.request(o,{env:d,envInfo:{locale:p,terminalType:S},hostSign:f,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?C.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:Sf(h),rpcTraceId:null==t?void 0:t.traceId}):C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Sf(h),errorMessage:Sf((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Sf(h),errorMessage:Sf(e)})}))}}))},k=function(){return new Promise((function(e,t){_?setTimeout((function(){e(lm)}),100):r.request({paymentSessionConfig:h,paymentSessionData:a,accountInfo:{email:""}},{env:d,envInfo:{locale:p,terminalType:S},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=18,Promise.all(m?[A(),k()]:[A()]);case 18:return T=e.sent,w=tt()(T,2),P=w[0],I=w[1],this.obtainDataRes={originActionQueryResult:P,originOneAccountQueryResult:I},e.abrupt("return",{originActionQueryResult:P,originOneAccountQueryResult:I});case 24:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"buildPreviewMockData",value:function(e){var t=this.elementContainer.getPaymentContext().displayInfo,n=null==t?void 0:t.previewPaymentMethods,r=JSON.parse(JSON.stringify(e)),o=function(e){if(!e)return[];var t=e.expressCheckout,n=e.supportedMethods,r=e.topping,o=((null==t?void 0:t.methods)||[]).map((function(e){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,expressCheckout:!0};return dm(t),t})),i=[];(n||[]).forEach((function(e){if("CARD"!==e.paymentMethodName){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,icon:e.logoUrl,recommend:!1};t.paymentMethodType===r&&(t.recommend=!0),dm(t),function(e){"ONLINEBANKING_YAPILY"===e.paymentMethodType&&(e.paymentElements=[])}(t),i.push(t)}}));var a=function(){var e=-1,t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n,r){"CARD"===n.paymentMethodName&&(t.push({cardBrand:n.paymentMethodType,logoUrl:n.logoUrl||""}),-1===e&&(e=r))})),t.length?{firstCardIndex:e,cardPaymentMethod:{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,logoList:t,paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"}}:null}(n);return a&&i.splice(a.firstCardIndex,0,a.cardPaymentMethod),[].concat($e()(o),i)}(n);return r.paymentMethods=o,r}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}(kf),vm=mm;function gm(){try{var e=Jt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=Fe(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return Qt("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function ym(e){return ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ym(e)}function _m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_m(Object(n),!0).forEach((function(t){Em(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Em(e,t,n){return(t=Am(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Am(r.key),r)}}function Am(e){var t=function(e,t){if("object"!==ym(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ym(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ym(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(pm||(pm={}));var km=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=bm(bm({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:pm.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&ks(o)?(this.options.link=ms(o,i),this.handleLink()):n&&!ks(n)?(this.options.scheme=ms(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=pm.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;ss?is()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=pm.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(vs(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=pm.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(ss?this.handleIOSScheme():ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;is()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(vs(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Sm(t.prototype,n),r&&Sm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Tm=km,wm=function(e,t){var n=am.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},h()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new Tm({successCb:function(){Pm(e,se.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){Im(e,se.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===re.BLANK)return e.url?(Pm(e,se.NormalUrl,e.url,n),void window.open(e.url)):Im(e,se.NormalUrl,"",n);if(!(e.browserLinkTarget!==re.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?(Pm(e,se.NormalUrl,e.url,n),void window.location.replace(e.url)):Im(e,se.NormalUrl,"",n);if(_t())return e.url?(Pm(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):Im(e,se.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?(Pm(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):Im(e,se.NormalUrl,"",n);var o=new Tm({successCb:function(t){var r="Scheme"==t.type?se.SchemeUrl:se.ApplinkUrl;Pm(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(Im(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return Im(e,se.NormalUrl,"",n);Pm(e,se.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(Im(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return Im(e,se.NormalUrl,"",n);Pm(e,se.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){Im(e,se.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){Im(e,se.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},Pm=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},Im=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},Cm=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function Rm(e,t){for(var n,r=e||window.navigator.userAgent||"",o=Cm,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(Nm(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(Nm(t,r,n.iosScheme),n.iosScheme):void 0;Nm(t,r,"")}function Nm(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var Dm=function(){function e(){g()(this,e),c()(this,"bizFlowStartBehavior",void 0),c()(this,"initOptions",void 0),c()(this,"paymentContext",void 0),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"productProcessors",{}),c()(this,"enablePopWindowEventCallback",!1),c()(this,"eventLogging",void 0),c()(this,"status",vf.UNINIT),c()(this,"logger",void 0),this.status=vf.INITING}var t;return m()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=on(e),n=t.id,r=t.data;this.paymentContext=h()(h()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=Fe(),this.sdkMetaData={webAppVersion:"",greyscaleId:gm(),productScene:t,sdkVersion:T},this.sdkMetaData.webAppVersion=an(this.sdkMetaData),am.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=am.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=am.getInstance(this.instanceId).getService("EventCenter");r.listen(ve.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};wm(a,n.instanceId),i&&n.cleanRender()}})),r.listen(ve.initSecuritySDK.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=am.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,s.initSecurity();case 4:l=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),l=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{success:l}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getDeviceId.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=am.getInstance(n.instanceId).getService("Security"),e.next=3,s.getDeviceId(t);case 3:l=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{deviceId:l}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getSdkVersion.name,function(){var e=s()(i()().mark((function e(n,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.destroy.name,(function(e){n.setStatus(vf.READY),n.destroy()})),r.listen(ve.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(ve.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(ve.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(ve.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(ve.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(vf.IN_BIZ_FLOW),a=t.paymentSession,s=t.displayInfo,l=on(a),c=l.id,u=l.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:a,paymentSessionId:c,paymentSessionObj:u,displayInfo:h()(h()({},new mf),s),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Ut(this.paymentContext.paymentSessionObj.extendInfo),f=an(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=f,am.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),i=this.sdkMetaData,Qt("Antom_".concat(i.sdkVersion+i.productScene,"_LastAppVersion"),""),m=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,v=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(m,"|").concat(v)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(m,"|").concat(v)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(m)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(m)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=am.getInstance(this.instanceId).getService("EventCenter"),b={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(ve.eventCallback.name,{code:ae.SDK_REDIRECT,result:{redirectUrls:b}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((E=new URL(y.url)).searchParams.set("source","embedded"),y.url=E.toString()),wm(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var i}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return am.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=am.getInstance(this.instanceId).getService("EventCenter"),n=am.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==Y.inline&&(e.paymentContext.displayInfo.isRetention?rf():e.handleClose(t,"behavior"))};t.listen(ve.close.name,(function(){a(!0)})),t.listen(ve.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(ve.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(Ae,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(Ae,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,f,m,v=document.getElementById("".concat(Ae,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg):v.style.backgroundColor=null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg);var g,y,_,b,E,S,A,k=document.getElementById("".concat(Ae,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.corner,"px"),"stroke"===(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.type)?k.style.border="1px solid ".concat(null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg):k.style.backgroundColor=null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===Y.inline?(n.showLoading(s,this.paymentContext.displayInfo),void uf()):r==Y.popup?(function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Ae,o.classList.add("".concat(Ae,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Ae,'-title" class="').concat(Ae,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Ae,'-sub-title"\n class="').concat(Ae,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Ae,"-btn-block-").concat(e,'">\n <div id="').concat(Ae,'-remain" class="').concat(Ae,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Ae,'-leave" class="').concat(Ae,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Ae,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Ae,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){nf(),e.handleRemain()}),(function(){nf(),e.handleClose(!1,"retention")})),af({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:he.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=am.getInstance(this.instanceId).getService("EventCenter");if(n.emit(ve.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?he.OnlyClose:he.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(ve.eventCallback.name,{code:ae.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=am.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),lf(),of()};null===(e=document.getElementById(Se))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),o.startHideAnim(),sf(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),Om=function(){function e(){g()(this,e)}return m()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),Lm=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),Mm=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;g()(this,e),c()(this,"containerStatus",void 0),c()(this,"instanceId",void 0),c()(this,"containerService",void 0),c()(this,"eventService",void 0),c()(this,"containerElement",void 0),c()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(Lm.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=am.getInstance(this.instanceId).getService("Container"),am.getInstance(this.instanceId).init({},{productScene:G.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var u=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:Y.inline,platform:bf()||Ef()?te.desktop:te.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Ne}},s.generateIframeSrc({link:u,instanceId:this.instanceId})),this.eventService=am.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return m()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(ve.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(ve.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),xm=function(){function e(t){var n=t.instanceId;g()(this,e),c()(this,"containerServices",void 0),c()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return m()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new Mm({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),Um=function(){function e(t){var n=t.logger;g()(this,e),c()(this,"activeEvents",new Map),c()(this,"heartbeatIntervalId",null),c()(this,"HEARTBEAT_INTERVAL",5e3),c()(this,"uniqueId",0),c()(this,"logger",void 0),this.logger=n}return m()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==at(t)&&this.sendLog("data_error",{msg:Sf(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=tt()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:Sf(e)})}},{key:"sendLog",value:function(e,t){var n=c()(c()(c()(c()(c()(c()(c()(c()(c()(c()({},"".concat(K.MOUNT,"_start"),"sdk_event_mount"),"".concat(K.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(K.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(K.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(K.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(K.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(K.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(K.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},h()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),Bm=["type"],Km=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"elementContainer",void 0),c()(this,"serviceMap",void 0),c()(this,"loading",void 0),c()(this,"elementProcessors",void 0),c()(this,"initTimeout",void 0),c()(this,"elementContainerService",void 0),c()(this,"onStatusChangeCallback",void 0),c()(this,"submitPayPromise",void 0),c()(this,"elementEventCenter",void 0),c()(this,"currentPaymentMethodType",""),c()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:C.VALIDATE,data:{params:{},target:t,source:R.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),c()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:C.SUBMIT_PAY,data:{params:h()(h()({},n),{},{doMain:window.location.hostname}),target:t,source:R.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new Dm,this.elementContainer.registerProcessor(G.ELEMENT_PAYMENT,"",new Om),this.elementContainer.init(this.options,G.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new xm({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(vf.READY),this.elementEventCenter=new Um({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return m()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new If(this.options),address:new wf(this.options),payment:new vm(this.options)};this.elementProcessors=h()(h()({},this.elementProcessors),{},c()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:Sf(r||""),eventMessage:Sf(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(vf.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:x.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:fe.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){var r,o;this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var i=this.elementContainerService.getContainerService(e).getInstanceId(),a=this.elementContainer.getPaymentContext();am.getInstance(i).update(a),this.serviceMap.Log=am.getInstance(i).getService("Log"),null===(r=this.serviceMap.Log)||void 0===r||r.logInfo({title:"sdk_event_appearance"},{variables:!(null==n||null===(o=n.appearance)||void 0===o||!o.variables),theme:null==n?void 0:n.theme}),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:h()(h()({},fe.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:x.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=on(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(K.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===vf.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:fe.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===vf.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:fe.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:fe.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:Sf(e)}),r(h()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:h()(h()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(vf.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=s()(i()().mark((function e(){var t,n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(K.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[N.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[N.payment].eventCenter,R.PAYMENT_ELEMENT);case 7:return a=e.sent,n=null!==(o=a.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(K.SUBMITPAYMENT),this.elementContainer.getStatus()===vf.IN_BIZ_FLOW){e.next=6;break}return r={error:h()(h()({},fe.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:D.FAIL},o={eventCode:D.FAIL,errorName:fe.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:Sf(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),a="APPLEPAY"===this.currentPaymentMethodType,l=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||a){e.next=40;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.prev=11,c=Date.now(),e.next=15,Pa((function(){return t.onBeforeConfirm()}));case 15:if(u=e.sent,d=u.result,!(u.timedOut||Date.now()-c>=Aa)){e.next=24;break}return this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:Ta}),e.abrupt("return",{status:D.FAIL,error:{code:Ta,message:"Merchant confirmation timed out.",needChangeSessionForRetry:!1}});case 24:if(d){e.next=29;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:ka}),e.abrupt("return",{status:D.FAIL,error:{code:ka,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 29:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.next=38;break;case 32:return e.prev=32,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:l,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:D.FAIL,errorName:ka}),e.abrupt("return",{status:D.FAIL,error:{code:ka,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 38:e.next=41;break;case 40:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:l,path:a?"applePay_eventBridge":"nonApplePay_sync"});case 41:return p=null,e.prev=42,e.next=45,new Promise(function(){var e=s()(i()().mark((function e(n){var r,o,l,c,u,d,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[N.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(p=e)},r=b,e.prev=2,b.submitPayPromise=o,l={},c=function(){var e=s()(i()().mark((function e(t,n){var r,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,b.onValidateAndSubmitPay(b.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,a=r.data,l.shipping=null==a?void 0:a.data,null!=a&&a.success){e.next=11;break}return o(p=a),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,c(N.auth,R.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,c(N.address,R.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!b.elementProcessors[N.payment]){e.next=28;break}return u=a&&!(null==t||!t.onBeforeConfirm),b.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:Sf({hasBeforeConfirmForApplePay:u,isApplePay:a,amount:"".concat(null==t?void 0:t.amount,", ").concat(null==t?void 0:t.currency)})}),b.elementProcessors[N.payment].setOnBeforeConfirm(u?t.onBeforeConfirm:null),d=!(null==t||!t.amount),f=!(null==t||!t.currency),!d&&!f||d&&f||b.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:Sf({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),b.elementProcessors[N.payment].setMerchantAmountOverride(d&&f?t.amount:null,d&&f?t.currency:null),e.next=24,b.onValidateAndSubmitPay(b.elementProcessors[N.payment].eventCenter,R.PAYMENT_ELEMENT,(_=void 0,h()(h()(h()({},l),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&f?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:u})));case 24:m=e.sent,v=m.data,o(p=v);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:h()(h()({},fe.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:D.FAIL},b.serviceMap.Log.logError({title:fa.sdk_element_missKeyData},{msg:JSON.stringify(y)}),p=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 45:return e.abrupt("return",e.sent);case 46:return e.prev=46,_={eventCode:null===(f=p)||void 0===f?void 0:f.status,errorName:null===(m=p)||void 0===m||null===(m=m.error)||void 0===m?void 0:m.code,errormessage:null===(v=p)||void 0===v||null===(v=v.error)||void 0===v?void 0:v.message,needChangeSessionForRetry:null===(g=p)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.needChangeSessionForRetry,rpcTraceId:null===(y=p)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.traceId,msg:Sf(p)},this.elementEventCenter.endEvent(n,_),this.changeLoading(!1),e.finish(46);case 51:case"end":return e.stop()}}),e,this,[[11,32],[42,,46,51]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(C.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(ve.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(Lm.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===re.BLANK)return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(se.NormalUrl,"");if(!(a.target!==re.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(se.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;_f({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(se.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(se.SchemeUrl,a.schemeUrl,e)}))}else _f({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(se.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(se.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(ve.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(vf.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(ve.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(Lm.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=h()(h()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(ve.messageForward.name,(function(e){var n=O[e.source],r=O[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(ve.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(H.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=Fl()(t,Bm),e.prev=1,a=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:fe.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([a.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:s=e.sent,(l=tt()(s,2))[0],c=l[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==a||a.switchContainerStatus(Lm.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:h()(h()({},fe.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,f=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&f&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||fe.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=h()({},fe.ERR_DATA_STRUCT_UNRECOGNIZED)),Me[o])a={code:Me[o].code,message:(null===(t=Me[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:fa.sdk_element_missKeyData},{rpcTraceId:r});return{error:h()(h()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,f;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return $e()(e.values()).every((function(e){return e.getContainerStatus()===Lm.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[N.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===G.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=h()(h()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(r){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(gf({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(N.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[N.payment].obtainData();case 6:a=e.sent,s=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:s?cm:a.originActionQueryResult,originOneAccountQueryResult:s?um:a.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(ve.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),lf(),of();try{hf()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(K.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(vf.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=on(this.options.sessionData).data,r="true"===(null===(t=Af(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout)?Zh.EXPRESS_CHECKOUT:Zh.ELEMENT_PAYMENT,o=Xh.find((function(e){return e.eventName===r}));return void 0!==o&&o.supportedEvents.includes(e)}}]),e}(),Hm=Km;function Ym(e){return{status:e.status||"FAIL",error:e.error?{code:e.error.code,message:e.error.message,needChangeSessionForRetry:e.error.needChangeSessionForRetry}:void 0,userCanceled3D:e.userCanceled3D,session:e.paymentSession?{nextAction:{applinkUrl:e.paymentSession.returnAppUrl,normalUrl:e.paymentSession.returnUrl,schemeUrl:e.paymentSession.returnAppScheme}}:void 0}}function Fm(e,t){var n,r,o,i={showCardCVV:!(null==t||null===(n=t.storedCard)||void 0===n||!n.needCVV),showPaymentMethodListWhenSingleOption:"list"===(null==t?void 0:t.singleOption)};if(!e)return t?{displaySetting:i}:void 0;var a,s={};if(e.theme&&(s.theme=e.theme),e.variables&&"object"===Je()(e.variables)){var l=h()({},e.variables);Object.keys(l).length>0&&(s.variables=l)}(s.displaySetting=h()(h()({showCardBrandIcon:!(null===(r=e.card)||void 0===r||!r.showBrandIcon)},i),{},{showRadioWhenAccordionLayout:!(null===(o=e.accordion)||void 0===o||!o.showRadio)}),e.layout)&&(s.layout=(null===(a=e.layout.type)||void 0===a?void 0:a.toLowerCase())||"accordion");return s}var jm=["onStatusChange"],Gm=["onBeforeConfirm"],zm="7982",Vm=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r="".concat(zm).concat("error"===e?"":e);Vl.log(h()({code:r,msg:t},n))}catch(e){}},Wm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vm("mount",e,t)},qm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vm("handshake",e,t)},Jm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vm("element",e,t)},Qm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Vm("error",e,t)},Zm=function(e){var t=null==e?void 0:e.response;if(!1===(null==t?void 0:t.success))return t;throw e},Xm=16e3,$m=new va(ga,!0),ev="Element already destroyed",tv=function(){return{code:fe.UI_STATE_ERROR.code,message:ev}},nv=function(e){_()(n,e);var t=E()(n);function n(e,r){return g()(this,n),t.call(this,e,r)}return m()(n,[{key:"setTarget",value:function(e){qp()(Qp()(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=qp()(Qp()(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(e){return qp()(Qp()(n),"getGlobalBridge",this).call(this,e)}}]),n}(Hl),rv="OPENSDK@VALIDATE",ov="OPENSDK@VALIDATE_REPLY",iv="OPENSDK@SHOWTOAST",av="OPENSDK@GET_APPLE_PAY_TOKEN",sv="OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",lv="OPENSDK@GET_GOOGLE_PAY_TOKEN",cv="OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY",uv="OPENSDK@HANDLE_PAYMENT",dv="OPENSDK@BEFORE_CONFIRM",pv="OPENSDK@BEFORE_CONFIRM_REPLY",hv="paymentMethodChanged",fv=function(){function e(t){var n=t.onStatusChange,r=Fl()(t,jm);if(g()(this,e),c()(this,"options",void 0),c()(this,"onStatusChange",void 0),c()(this,"scopeId","payment_".concat(Fe().replace(/-/g,"").slice(0,6))),c()(this,"bridge",void 0),c()(this,"iframe",null),c()(this,"status","initialized"),c()(this,"cachedSend",[]),c()(this,"modalBridge",null),c()(this,"modalDestroy",null),c()(this,"modalIframe",null),c()(this,"_closeConfirmResolve",null),c()(this,"notRedirectAfterComplete",!1),c()(this,"_sdkInitTime",Date.now()),c()(this,"_mountStartTime",0),c()(this,"destroyCallbacks",[]),c()(this,"_merchantAmount",null),c()(this,"_merchantCurrency",null),c()(this,"currentPaymentMethodType",""),c()(this,"isSubmitting",!1),this.options=r,this.onStatusChange=n,r.sessionData){var o=Ip(r.sessionData);Vl.setTrackId(o)}this.bridge=new nv("HOST",this.scopeId),this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(gl)||e.type.endsWith(Ll)||(e.type.endsWith(Il)?ch(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Tl)&&"IN"===t?uh(e.payload):ch("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))}))}var t,n,r,o,a,l;return m()(e,[{key:"mount",value:(l=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Wm("mount_start",{d1:n,d2:this.options.sessionData?"has_session":"no_session"}),a=document.querySelector(n)){e.next=6;break}return Qm("selector_not_found",{d1:n}),null===(s=this.options)||void 0===s||null===(l=s.onEventCallback)||void 0===l||l.call(s,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Element with selector ".concat(n," not found.")}),e.abrupt("return",{error:{code:"PARAM_INVALID",message:"selector not found"}});case 6:return null===(r=this.options.loading)||void 0===r||null===(o=r.onStartLoading)||void 0===o||o.call(r),this.setStatus("mounting"),e.prev=8,d=this.buildIframeUrl(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.height="0",this.iframe.style.transition="height 0.3s ease",this.iframe.allow="payment",this.bridge.setOrigin("https://checkout.antom.com"),this.bindBridgeEvents(),p=this.waitForReadyHandshake(),this.iframe.src=d,a.appendChild(this.iframe),Wm("iframe_loaded",{d1:d}),e.next=24,Promise.all([this.setup(t),p]);case 24:if(h=e.sent,f=tt()(h,1),m=f[0],"destroyed"!==this.status){e.next=29;break}throw tv();case 29:return(v=this.validateRenderData(m.renderData,m.renderDataError))&&(m.renderDataError=v,Qm("render_data_invalid",{d1:v.code,d2:v.reason})),this.setStatus("mounted"),this.sendHandshake(m),e.next=35,this.waitForHandshakeAck();case 35:if(this.setStatus("ready"),this.flushCachedMessages(),null===(c=this.options.loading)||void 0===c||null===(u=c.onEndLoading)||void 0===u||u.call(c),!v){e.next=40;break}return e.abrupt("return",{error:v});case 40:return Wm("mount_success",{m1:this._mountStartTime?Date.now()-this._mountStartTime:0}),e.abrupt("return",{});case 44:if(e.prev=44,e.t0=e.catch(8),null===(g=this.options.loading)||void 0===g||null===(y=g.onEndLoading)||void 0===y||y.call(g),i=e.t0,S=void 0,(S=i).code!==fe.UI_STATE_ERROR.code||S.message!==ev){e.next=49;break}return e.abrupt("return",{error:e.t0});case 49:return Qm("mount_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||""}),this.cleanup(),E={code:e.t0.code||"UNKNOWN",message:e.t0.message||""},null===(_=this.options)||void 0===_||null===(b=_.onEventCallback)||void 0===b||b.call(_,E),e.abrupt("return",{error:E});case 54:case"end":return e.stop()}var i,S}),e,this,[[8,44]])}))),function(e,t){return l.apply(this,arguments)})},{key:"setup",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._mountStartTime=Date.now(),Wm("setup_start"),this.notRedirectAfterComplete=t.notRedirectAfterComplete||!1,a=this.options.sessionData,s=Sh(a,"ELEMENT_PAYMENT"),l="sandbox"===this.options.environment?"sandbox":"prod",this.options.environment,Hp.setGlobalOptions(h()(h()({hostSign:Cp(a),env:l},void 0),{},{sdkVersion:"2.0.22",tracker:Vl})),c=!(null==s||null===(n=s.connectFactor)||void 0===n||!n.enableConnect),u=null==s?void 0:s.paymentSessionConfig,d=function(){var e;return Oh(Yh({extParams:{isUserPreferredLocale:!0},merchantAppointParam:null!==(e=t.merchantAppointParam)&&void 0!==e&&e.storedCard?t.merchantAppointParam:void 0,notRedirectAfterComplete:C.notRedirectAfterComplete,paymentSessionConfig:null==s?void 0:s.paymentSessionConfig,paymentSessionData:a},{envInfo:{locale:C.options.locale}}).catch(Zm))},p=function(){return Oh(Kh({paymentSessionConfig:u,paymentSessionData:a,accountInfo:{email:""}}))},f=c?[d(),p()]:[d(),void 0],m=function(){},v=new Promise((function(e,t){m=C.onDestroy((function(){return t(tv())}))})),g=Promise.all(f),e.next=18,Promise.race([g,v]).finally(m);case 18:return y=e.sent,_=tt()(y,2),b=_[0],E=_[1],b.error&&qm("sdk_query_failed",{d1:(null===(S=b.error)||void 0===S?void 0:S.code)||"",d2:(null===(A=b.error)||void 0===A?void 0:A.message)||""}),c&&null!=E&&E.error&&qm("one_account_query_failed",{d1:(null===(k=E.error)||void 0===k?void 0:k.code)||"",d2:(null===(T=E.error)||void 0===T?void 0:T.message)||""}),w=js(b.data),P=w||this.options.locale,I=b.error||(null==E?void 0:E.error),e.abrupt("return",{sdkTiming:{sdkInitTime:this._sdkInitTime,mountStartTime:this._mountStartTime},sessionData:a,renderData:b.data,renderDataError:I,connectAccount:null==E?void 0:E.data,sessionMetaData:s,merchantDomain:window.location.hostname,doMain:window.location.hostname,appearance:Fm((null==t?void 0:t.appearance)||this.options.appearance,t.merchantAppointParam),logMetaData:{paymentMethodCategoryType:null==u?void 0:u.paymentMethodCategoryType,productSceneVersion:null==u?void 0:u.productSceneVersion,trackId:Ip(a),merchantId:null==s?void 0:s.clientId,paymentMethodType:null==s||null===(r=s.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType},heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),locale:P,sdkVersion:"2.0.22",merchantId:(null==b||null===(o=b.data)||void 0===o?void 0:o.merchantId)||"",env:l,_requestConfig:h()({env:l},void 0)});case 28:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getLegacySdkQueryError",value:function(e){var t=e.errorCode,n=e.errorMessage,r=e.traceId,o=e.reason;if(!t)return{source:"SDK_INTERNAL",code:fe.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""};var i=Me[t];return{source:"SDK_INTERNAL",code:(null==i?void 0:i.code)||t,message:(null==i?void 0:i.message)||n||fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""}}},{key:"validateRenderData",value:function(e,t){var n;if(t||!e)return{source:"SDK_INTERNAL",code:fe.INITIALIZE_TIMEOUT.API.code,message:fe.INITIALIZE_TIMEOUT.API.message,reason:t?"query request failed: errorCode=".concat(t.code):"renderData is empty",traceId:null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:""};var r=e.success,o=e.paymentMethods,i=e.savedPaymentMethods,a=e.orderAmountView,s=e.paymentAmountView,l=Boolean(o&&Array.isArray(o)&&o.length>0||i&&Array.isArray(i)&&i.length>0),c=!!a&&!!s;if(!r){var u=e,d=u.traceId,p=u.errorCode,h=u.errorMessage;return this.getLegacySdkQueryError({errorCode:p,errorMessage:h,traceId:d,reason:p?"sdkAction.query failed: errorCode=".concat(p):"sdkAction.query failed without errorCode"})}return l&&c?void 0:{source:"SDK_INTERNAL",code:fe.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:fe.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:"Data structure validation failed: success=".concat(r,", hasValidPaymentMethods=").concat(l,", hasAmountViews=").concat(c),traceId:""}}},{key:"bindBridgeEvents",value:function(){var e=this;this.bridge.on(Ll,(function(t){e.iframe&&(e.iframe.style.height="".concat(t,"px"))})),this.bridge.on(iv,(function(t,n,r){var o,i;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)&&r.source!==(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)||function(e){if(null!=e&&e.message){var t=h()(h()({},Ch),e),n=document.getElementById(Dh);n?n.innerHTML="":((n=document.createElement("div")).id=Dh,Object.assign(n.style,{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"}),document.body.appendChild(n)),n.style.top="",n.style.right="",n.style.bottom="",n.style.left="",n.style.zIndex=String(t.zIndex),Object.assign(n.style,Rh[t.position]);var r=document.createElement("div");if(Object.assign(r.style,{backgroundColor:t.backgroundColor,color:t.color,padding:t.padding,borderRadius:t.borderRadius,fontSize:t.fontSize,opacity:"0",transition:"opacity ".concat(300,"ms ease-in-out"),display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:t.width,boxSizing:"border-box"}),t.icon){var o=document.createElement("img");Object.assign(o.style,{width:"40px",height:"40px"}),o.src=Nh[t.icon],r.appendChild(o)}var i=document.createElement("span");Object.assign(i.style,{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:"400",fontSize:"14px"}),i.textContent=t.message,r.appendChild(i),n.appendChild(r),setTimeout((function(){r.style.opacity="1"}),10),setTimeout((function(){r.style.opacity="0",setTimeout((function(){n.remove()}),300)}),t.duration)}}(t)})),this.bridge.on(El,(function(t,n,r){var o,i;if(!r||r.source===(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||r.source===(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)){var a=t.url,s=t.mode,l=t.appLinkUrl,c=t.schemaUrl,u=t.destroy;Jm("redirect",{d1:s||"redirect",d2:l?"app_link":c?"schema":"url",d3:a||"",d4:l||"",d5:c||"",d6:u?"1":"0"}),u&&e.destroy();try{if(l||c)new Ns({resultJudgmentTime:2e3,fallback:function(){Jm("redirect_fallback",{d1:"callapp_failed",d2:a||""}),d()}}).open({scheme:c,link:l});else d()}catch(e){Qm("redirect_error",{d1:"callapp_exception",d2:(null==e?void 0:e.message)||"",d3:a||""}),d()}}function d(){"replace"===s?window.location.replace(a):window.location.href=a}})),this.bridge.on(Sl,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||(e.handleOpenModal(t),e.bridge.once(kl,(function(){e.handleCloseModal()})))})),this.bridge.on(Ml,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||e.destroy()})),this.bridge.on(uv,(function(){e.handleHandlePayment()})),this.bridge.on(hv,(function(t){e.currentPaymentMethodType=(null==t?void 0:t.type)||""}))}},{key:"handleGetApplePayToken",value:(o=s()(i()().mark((function e(t,n){var r,o,a,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.options.sessionData,a=null==t||null===(r=t.paymentMethod)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.applePayProps,l=null==a?void 0:a.paymentRequest,Jm("applepay_token_request",{d1:l?"has_payment_request":"no_payment_request"}),l){e.next=8;break}return Qm("applepay_token_missing_data",{d1:"MISSING_DATA"}),this.bridge.send(sv,{success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}}),e.abrupt("return");case 8:return c=l.merchantCapabilities,u=l.merchantInfo,d=l.paymentAmount,p=l.supportedNetworks,f=l.version,m=l.requiredBillingContactFields,v=l.requiredShippingContactFields,g=(null==d?void 0:d.formattedValue)||(null==d?void 0:d.value),y=null==d?void 0:d.currency,this._merchantAmount&&(g=this._merchantAmount),this._merchantCurrency&&(y=this._merchantCurrency),b=Qh(o,u,{value:g,currency:y}),E=new Wh({paymentRequest:h()({countryCode:null==u?void 0:u.countryCode,currencyCode:y,merchantCapabilities:c,supportedNetworks:p,requiredBillingContactFields:m,requiredShippingContactFields:v,total:b?{type:"final",label:b.regularBilling.label,amount:g}:{type:"final",label:(null==u?void 0:u.merchantName)||"Payment",amount:g},version:b?14:f},b?{lineItems:[b.regularBilling],recurringPaymentRequest:b}:{}),enableModalCloseListener:!0,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Jm("applepay_validate_start",{d1:"merchant_validate"}),e.next=3,Zi(o,{validateUrl:t,paymentSessionData:o,merchantDomain:window.location.hostname},{env:k.options.environment,envInfo:{deviceId:""}},$m);case 3:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=7;break}return Jm("applepay_validate_success",{d1:"got_session"}),e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 7:throw Qm("applepay_merchant_validate_failed",{d1:"VALIDATION_FAILED",d2:(null==n?void 0:n.errorMessage)||"Merchant validation failed"}),{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,o=t.billingContact,a=t.shippingContact,!n){e.next=18;break}return e.prev=2,s=Date.now(),e.next=6,Pa((function(){return n()}));case 6:if(l=e.sent,c=l.result,u=l.timedOut,d=!u&&!!c&&Date.now()-s<Aa,(u||Date.now()-s>=Aa)&&Qm("sdk_before_confirm_timeout",{d1:"applePay_chrome_modern"}),d){e.next=13;break}return e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 13:e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(2),e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 18:return _={token:r,billingContact:o,shippingContact:a},Jm("applepay_authorized",{d1:r?"has_token":"no_token"}),e.abrupt("return",{success:!0,result:_});case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=15,e.next=18,E.startPay();case 18:Jm("applepay_token_success",{d1:null!==(S=_)&&void 0!==S&&S.token?"has_token":"no_token"}),this.bridge.send(sv,{success:!0,result:_}),e.next=26;break;case 22:e.prev=22,e.t0=e.catch(15),"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"!==(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)&&("APPLE_PAY_CANCEL"===(A=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED")?Jm("applepay_cancel",{d1:"user_cancel"}):Qm("applepay_token_failed",{d1:A,d2:(null===e.t0||void 0===e.t0?void 0:e.t0.errorMessage)||""})),this.bridge.send(sv,{success:!1,result:{errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"}});case 26:case"end":return e.stop()}}),e,this,[[15,22]])}))),function(e,t){return o.apply(this,arguments)})},{key:"handleGetGooglePayToken",value:function(e){var t,n,r=this,o=null==e?void 0:e.data,i=null==o||null===(t=o.paymentMethodDetail)||void 0===t?void 0:t.googlePayProps,a=(null==o?void 0:o.environment)||(null==i?void 0:i.environment)||"TEST",s=(null==o?void 0:o.paymentRequest)||(null==i?void 0:i.paymentRequest)||{};if(Jm("googlepay_token_request",{d1:a,d2:s?"has_payment_request":"no_payment_request"}),!s||!Object.keys(s).length)return Qm("googlepay_token_missing_data",{d1:"MISSING_DATA"}),void this.bridge.send(cv,{success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}});var l=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(s).then((function(t){if(t.result)return e.loadPaymentData(s);throw{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})).then((function(e){e&&(Jm("googlepay_token_success",{d1:"has_token"}),r.bridge.send(cv,{success:!0,result:e}))})).catch((function(e){var t=(null==e?void 0:e.statusCode)||"GOOGLE_PAY_PAYMENT_FAILED";"CANCELED"===t?Jm("googlepay_cancel",{d1:"user_cancel"}):Qm("googlepay_token_failed",{d1:t,d2:(null==e?void 0:e.statusMessage)||""}),r.bridge.send(cv,{success:!1,err:h()({statusCode:t},e)})}))};if(null!==(n=window.google)&&void 0!==n&&null!==(n=n.payments)&&void 0!==n&&null!==(n=n.api)&&void 0!==n&&n.PaymentsClient)l();else{var c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){l()},c.onerror=function(){Qm("googlepay_script_load_failed",{d1:"script_error"}),r.bridge.send(cv,{success:!1,err:{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})}}}},{key:"handleHandlePayment",value:function(){var e=this.options.sessionData,t=jp(e);Jm("handle_payment",{d1:"skipRender_applepay_publish"}),t||Qm("handle_payment_meta_failed",{d1:"meta_parse_failed"}),We.publish(new Ge(An.createComponent,JSON.stringify({appendParams:{iframeNodesParams:{sessionData:e,paymentSessionMetaData:t}},options:{environment:this.options.environment,locale:this.options.locale}})))}},{key:"handleBeforeConfirmInternal",value:function(e){var t=this;if(!e)return $m.logInfo({title:"sdk_before_confirm_skip"},{path:"modernController_bridge"}),void this.bridge.send(pv,{success:!0,result:!0});$m.logInfo({title:"sdk_before_confirm_start"},{path:"modernController_bridge"});var n=Date.now();Pa((function(){return e()})).then((function(e){var r=e.result,o=e.timedOut,i=!o&&!!r&&Date.now()-n<Aa;(o||Date.now()-n>=Aa)&&$m.logError({title:"sdk_before_confirm_timeout"}),$m.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:i}),t.bridge.send(pv,{success:!0,result:!!i})})).catch((function(e){$m.logError({title:"sdk_before_confirm_error"},{errorMessage:String((null==e?void 0:e.message)||e).slice(0,200),path:"modernController_bridge"}),t.bridge.send(pv,{success:!1,result:!1})}))}},{key:"waitForReadyHandshake",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),Qm("ready_handshake_timeout",{d1:String(Xm)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),Xm);r=e.onDestroy((function(){clearTimeout(o),n(tv())})),e.bridge.once(vl,(function(){var i;if(clearTimeout(o),r(),null===(i=e.iframe)||void 0===i||!i.contentWindow)return Qm("iframe_contentwindow_unavailable",{d1:"after_ready_handshake"}),void n({code:"SDK_LAUNCH_PAYMENT_APP_ERROR",message:"Iframe contentWindow not available"});e.bridge.setTarget(e.iframe.contentWindow),qm("ready_handshake_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"sendHandshake",value:function(e){this.bridge.send(ml,e),qm("handshake_sent",{d1:(null==e?void 0:e.sdkVersion)||""})}},{key:"waitForHandshakeAck",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),Qm("handshake_ack_timeout",{d1:String(Xm)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),Xm);r=e.onDestroy((function(){clearTimeout(o),n(tv())})),e.bridge.once(wl,(function(){clearTimeout(o),r(),qm("handshake_ack_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return Qm("submit_not_ready",{d1:this.status}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"not ready"}});case 3:if(!this.isSubmitting){e.next=6;break}return Qm("submit_in_progress",{}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"submit already in progress"}});case 6:if(this.isSubmitting=!0,e.prev=7,o="APPLEPAY"===this.currentPaymentMethodType,s=(a=t||{}).onBeforeConfirm,l=Fl()(a,Gm),!s||o){e.next=31;break}return $m.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.prev=12,c=Date.now(),e.next=16,Pa((function(){return s()}));case 16:if(u=e.sent,d=u.result,!((p=u.timedOut)||!d||Date.now()-c>=Aa)){e.next=22;break}return p?$m.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}):$m.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 22:$m.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.next=29;break;case 25:return e.prev=25,e.t0=e.catch(12),$m.logError({title:"sdk_before_confirm_error"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 29:e.next=32;break;case 31:s||$m.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:o?"applePay_eventBridge":"nonApplePay_sync"});case 32:return f=o&&!!s,m=!(null==l||!l.amount),v=!(null==l||!l.currency),!m&&!v||m&&v||$m.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{amount:null==l?void 0:l.amount,currency:null==l?void 0:l.currency,reason:"amount and currency must be provided together, both ignored"}),this._merchantAmount=m&&v?l.amount:null,this._merchantCurrency=m&&v?l.currency:null,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n),Jm("submit_start",{d1:this.notRedirectAfterComplete?"if_required":"always"}),g=[],e.prev=41,_=new Promise((function(e){g.push(A.bridge.once(av,(function(e){A.handleGetApplePayToken(e,s).then((function(){}))}))),g.push(A.bridge.once(lv,(function(e){A.handleGetGooglePayToken(e)}))),g.push(A.bridge.once(dv,(function(){A.handleBeforeConfirmInternal(s||null)}))),g.push(A.bridge.once(bl,e))})),this.send(_l,h()(h()({},l),{},{redirect:this.notRedirectAfterComplete?"if_required":"always",hasBeforeConfirm:f},m&&v?{amount:l.amount,currency:l.currency}:{})),e.next=46,_;case 46:return b=e.sent,Jm("submit_reply",{d1:(null==b?void 0:b.status)||"",d2:(null==b||null===(y=b.error)||void 0===y?void 0:y.code)||""}),e.abrupt("return",Ym(b));case 51:throw e.prev=51,e.t1=e.catch(41),Qm("submit_error",{d1:(null===e.t1||void 0===e.t1?void 0:e.t1.code)||"UNKNOWN",d2:(null===e.t1||void 0===e.t1?void 0:e.t1.message)||""}),e.t1;case 55:return e.prev=55,g.forEach((function(e){try{e()}catch(e){}})),null===(E=this.options.loading)||void 0===E||null===(S=E.onEndLoading)||void 0===S||S.call(E),e.finish(55);case 59:return e.prev=59,this.isSubmitting=!1,e.finish(59);case 62:case"end":return e.stop()}}),e,this,[[7,,59,62],[12,25],[41,51,55,59]])}))),function(e){return r.apply(this,arguments)})},{key:"validateFields",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return Qm("validate_not_ready",{d1:this.status}),e.abrupt("return",{isValid:!1});case 3:return this.send(rv),e.abrupt("return",new Promise((function(e){var n=setTimeout((function(){Qm("validate_fields_timeout",{d1:"15000"}),e({isValid:!1})}),15e3);t.bridge.once(ov,(function(t){clearTimeout(n);var r=!(null==t||!t.isValid);Jm("validate_result",{d1:r?"valid":"invalid"}),e(t||{isValid:!1})}))})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"destroy",value:function(){var e;Jm("destroy",{d1:this.status}),"initialized"!==this.status&&"destroyed"!==this.status&&(this.handleCloseModal(),this.bridge.destroy(),null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("destroyed"),this.runDestroyCallbacks(),this.cachedSend=[])}},{key:"cleanup",value:function(){var e;null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("initialized"),this.cachedSend=[]}},{key:"setStatus",value:function(e){var t;if("destroyed"!==this.status&&e!==this.status){var n=this.status;this.status=e,null===(t=this.onStatusChange)||void 0===t||t.call(this,e,n)}}},{key:"onDestroy",value:function(e){var t=this;return"destroyed"===this.status?(e(),function(){}):(this.destroyCallbacks.push(e),function(){t.destroyCallbacks=t.destroyCallbacks.filter((function(t){return t!==e}))})}},{key:"runDestroyCallbacks",value:function(){var e=this.destroyCallbacks;this.destroyCallbacks=[],e.forEach((function(e){return e()}))}},{key:"send",value:function(e,t){"destroyed"!==this.status&&("ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}))}},{key:"flushCachedMessages",value:function(){var e=this;this.cachedSend.length>0&&(this.cachedSend.forEach((function(t){var n=t.type,r=t.payload;e.bridge.send(n,r)})),this.cachedSend=[])}},{key:"handleOpenModal",value:function(e){var t,n,r,o=this;this.handleCloseModal();var i=gt?"mobile":"desktop";Jm("open_modal",{d1:i,d2:(null==e?void 0:e.modalId)||""});try{var a=new URL(e.url);e.closeConfirm&&a.searchParams.append("confirm","true"),e.url=a.toString()}catch(t){var s=new zs("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME");return Qm("open_modal_invalid_url",{d1:"INVALID_MODAL_URL",d2:(null==e?void 0:e.url)||""}),void this.bridge.send(Al,s)}var l=this.modalBridge=nv.getGlobalBridge("HOST"),c=new MessageChannel;this.bridge.send(Rl,e.modalId,[c.port1]);var u=(null==e||null===(t=e.appearance)||void 0===t?void 0:t.theme)||"default",d=null!==(n=Eh[u])&&void 0!==n?n:Eh.default,p={theme:d.theme,backgroundColor:(null==e||null===(r=e.appearance)||void 0===r||null===(r=r.variables)||void 0===r?void 0:r["background-primary"])||d.backgroundColor},f=Ih(h()(h()({},e),{},{mode:i,loadingConfig:p,onClose:e.closeConfirm?function(){return new Promise((function(e){o._closeConfirmResolve=e}))}:void 0})),m=f.iframe,v=f.destroy,g=function t(){if(m.removeEventListener("load",t),Jm("modal_loaded",{d1:e.url}),m.contentWindow){l.setTarget(m.contentWindow);try{var n=new URL(m.src).origin;n&&"null"!==n&&l.setOrigin(n)}catch(e){}e.appearance&&l.send(Dl,e.appearance),e.initialData&&l.send(Ol,e.initialData),l.send(Nl,e.modalId,[c.port2])}};this.modalIframe=m,this.modalDestroy=function(){v(),m.removeEventListener("load",g),o.modalIframe=null},m.addEventListener("load",g)}},{key:"handleCloseModal",value:function(){this._closeConfirmResolve&&(Jm("modal_close_confirm",{d1:"confirm_resolved"}),this._closeConfirmResolve(),this._closeConfirmResolve=null),Jm("modal_closed",{d1:this.modalBridge?"with_bridge":"no_bridge"}),this.modalBridge&&(this.modalBridge.destroy(),this.modalBridge=null),this.modalDestroy&&(this.modalDestroy(),this.modalDestroy=null)}},{key:"buildIframeUrl",value:function(){var e=Ys("/element_payment/index.html",!0),t=this.options.sessionData?Ip(this.options.sessionData):"";return"".concat(e,"?").concat(t?"track_id=".concat(encodeURIComponent(t),"&"):"","_scope_id=").concat(encodeURIComponent(this.scopeId))}}]),e}(),mv=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new B(n.errors);this.options=function(e){var t=e.environment;return h()(h()({},e),{},{environment:(t||U.PROD).toLocaleLowerCase()})}(t),Vp(t.sessionData)?this.controller=new fv(h()(h()({},this.options),{},{sessionData:this.options.sessionData})):this.controller=new Hm(this.options)}var t;return m()(e,[{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(h()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),vv={message:"sdk no need to make query request",success:!0},gv=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"eventCenter",void 0),c()(this,"securityService",void 0),c()(this,"instanceId",void 0),c()(this,"componentSign",void 0),c()(this,"hostSign",void 0),c()(this,"_performanceData",[]),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=am.getInstance(this.instanceId).getService("Log"),this.eventCenter=am.getInstance(this.instanceId).getService("EventCenter"),this.securityService=am.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=Ms(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,a=r.authUrlInfo,s=void 0===a?{}:a,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=9;break}if(u=_t()?null==o||null===(l=o.web)||void 0===l?void 0:l.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(s));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===j.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=am.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,a=this.initConfig,s=a.environment,l=a.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(f=_t()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(vv));case 9:if(f&&"REDIRECT"===f){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!aa()){e.next=13;break}return e.abrupt("return",Promise.resolve(vv));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),m={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=m,e.t2=s,e.t3=l,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:ve.error.name,data:fe.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),De);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=tt()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Lt({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===te.desktop&&(null===(t=document.getElementById(_e))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(ye))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===j.AUTO_DEBIT_APM}}]),e}();function yv(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Vt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(it.SDK)+"&"+"&notRedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var _v=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"securityService",void 0),c()(this,"eventCenter",void 0),c()(this,"instanceId",void 0),c()(this,"hostSign",void 0),c()(this,"allowQueryCall",void 0),c()(this,"allowSubmitPayCallAhead",void 0),c()(this,"channelBehavior",void 0),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),c()(this,"SDK_REQUEST_TIMEOUT",15e3),c()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=am.getInstance(this.instanceId).getService("Log"),this.securityService=am.getInstance(this.instanceId).getService("Security"),this.eventCenter=am.getInstance(this.instanceId).getService("EventCenter"),En.preloadWebApp(G.EASY_PAY,z.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_t()&&"BANKTRANSFER_QUICKPAY"!==(null===(a=t.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",s=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,l=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=yv(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},qt.savePreviousProductInfo(G.EASY_PAY,{paymentMethodCategoryType:l,hostSign:this.hostSign,productSceneVersion:s}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Lt({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:Y.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=tt()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),f={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:Vt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(f.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:f}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(a=this.paymentContext)||void 0===a?void 0:a.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(s=this.paymentContext)&&void 0!==s&&null!==(s=s.paymentSessionObj.action)&&void 0!==s&&s.autoDebitWithToken),p=!0;try{f=JSON.parse(c),p=It(f.needQueryRender)||!0===f.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return m=Fe(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m}),v=am.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=v,e.t1=h()(h()({},l),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(l.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:m,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,f=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},m=f.action,g=(v=void 0===m?{}:m).enableSignAgreement,y=void 0!==g&&g,_=v.autoDebitWithToken,b=void 0!==_&&_,"2.0"!==p||b||(c.signAgreement=y,S=null===(E=this.paymentContext.paymentSessionObj)||void 0===E||null===(E=E.paymentMethodInfoView)||void 0===E?void 0:E.paymentMethodType,A=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==S||A&&k||(T=Rm(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return w=Fe(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w}),P=(null===(o=this.channelBehavior)||void 0===o||null===(a=o.buildSubmitPayExtParams)||void 0===a?void 0:a.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(s=this.paymentContext.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(l=this.paymentContext)||void 0===l||null===(l=l.startBizFlowOptions)||void 0===l||null===(l=l.submitPayRequestExtra)||void 0===l?void 0:l.notRedirectAfterComplete)}))||{},b||(P.complianceSDK=!0),c.extParams=P,I=am.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=I,e.t1=h()(h()({},c),{},{integrationType:"SDK",sdkVersion:null!==(C=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==C?C:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return R=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w,rpcTraceId:R.traceId}),e.abrupt("return",R);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:w,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=am.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(a=null===(s=this.paymentContext.paymentSessionObj.action)||void 0===s?void 0:s.userSignAgreement)&&void 0!==a&&a,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===l?h=!1:"2.0"===l&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?pe.NEED:pe.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var bv="https://dev.page.alipay.net",Ev="https://test.page.alipay.net",Sv="https://pre.ac.alipay.com",Av="https://checkout.antom.com",kv="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",Tv=function(){function e(t){var n=this;g()(this,e),c()(this,"logger",void 0),c()(this,"_instanceId",void 0),c()(this,"iframe",void 0),c()(this,"originOptions",void 0),c()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),c()(this,"eventListener",void 0),c()(this,"generateIframeSrc",(function(e,t){var r=n.originOptions.environment||"prod",o=e||"",i=n.originOptions.locale||"en_US",a=function(e){switch(e){case"dev":return"".concat(bv).concat(kv);case"sit":return"".concat(Ev).concat(kv);case"pre":return"".concat(Sv).concat(kv);case"prod":case"sandbox":case"light_sandbox":return"".concat(Av).concat("/checkout-page/pages/payment/index.html");default:return e}}(r);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,r,o,i,a);var s=a.split("?")[0],l=bt(a);return l.sessionData=o,l.lang=i,l.mode="embed","sandbox"===r&&(l.shadow="true"),t&&(l.demoMode="true"),Object.keys(l).forEach((function(e){s+="".concat(s.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(l[e]))})),s})),c()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,f=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:f}).send();var m=h()(h()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(m)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(fe.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=h()(h()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),c()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),c()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),c()(this,"dispatchToApp",(function(e){var t,r={name:ne.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||X.prod,this._instanceId=Fe(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new va(ga,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),va.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return m()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData,e.isDemoMode),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),wv=new va(ga,!0),Pv=function(e){_()(n,e);var t=E()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return g()(this,n),(o=t.call(this,h()({appVersion:w},e))).preloadComponent(r,i),o}return m()(n)}(Ks),Iv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.AUTO_DEBIT_PAY});return t.call(this,r,[j.AUTO_DEBIT_PAY_WALLET])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.AUTO_DEBIT_PAY,z.WALLET,e.environment),En.preloadSecuritySDK(G.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}(Pv),Cv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r,o=Object.assign({},e,{product:G.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM,j.CASHIER_PAYMENT_BANK].includes(s)?[s]:[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM]}catch(e){wv.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return m()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=j.CASHIER_PAYMENT_CARD===a?[z.CARD]:j.CASHIER_PAYMENT_APM===a?[z.APM]:j.CASHIER_PAYMENT_BANK===a?[z.BANK]:[z.CARD,z.APM];var s,l=d()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;En.preloadWebApp(G.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}En.preloadSecuritySDK(G.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}(Pv),Rv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[j.CASHIER_PAYMENT_CARD])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.CASHIER_PAYMENT,z.CARD,e.environment),En.preloadSecuritySDK(G.VAULTING,e.securityRegion,e.environment)}}]),n}(Pv),Nv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[j.ELEMENT_PAYMENT])}return m()(n)}(Pv),Dv=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return m()(n)}(Hs),Ov=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return m()(n)}(mv),Lv=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Dm,this.core.registerProcessor(G.EASY_PAY,"",new _v),this.core.init(t,G.EASY_PAY)}return m()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.EASY_PAY,z.WALLET,e.environment,!0)}}]),e}(),Mv=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Dm,this.core.registerProcessor(G.AUTO_DEBIT,"",new gv),this.core.init(t,G.AUTO_DEBIT)}var t;return m()(e,[{key:"createComponent",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};En.preloadWebApp(G.AUTO_DEBIT,z.WALLET,e.environment),En.preloadSecuritySDK(G.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),xv=new va(ga,!0);var Uv=["paypal","applePay","googlePay","alipay"];function Bv(e,t,n){var r=new bh(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function Kv(e){var t=null==e?void 0:e.paymentMethods;if(!Array.isArray(t)||0===t.length)return Bv("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var n,r=d()(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Uv.includes(o))return Bv("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(o),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){r.e(e)}finally{r.f()}return!t.includes("paypal")||null!=e&&e.paypal?null:Bv("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}function Hv(e){return Yv.apply(this,arguments)}function Yv(){return Yv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.env,o=null==n?void 0:n.sessionData,a=(null==n?void 0:n.locale)||"en_US",(s=Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("applePay")&&zh(),!(l=Kv(n))){e.next=8;break}return e.abrupt("return",{setupResult:{sessionData:o,locale:a,setupError:l}});case 8:if(!s.includes("paypal")){e.next=14;break}return e.next=11,Fv(n);case 11:e.t0=e.sent,e.next=15;break;case 14:e.t0=void 0;case 15:if(c=e.t0,!((s.includes("applePay")||s.includes("googlePay")||s.includes("alipay"))&&o)){e.next=19;break}return e.abrupt("return",Gv({appConfig:n,sessionData:o,env:r,paypalSetupResult:c}));case 19:if(o){e.next=21;break}return e.abrupt("return",{setupResult:h()({sessionData:void 0},c)});case 21:if(!(u=Wv(o))){e.next=24;break}return e.abrupt("return",{setupResult:h()(h()({sessionData:o},c),{},{setupError:u})});case 24:return e.abrupt("return",{setupResult:h()({sessionData:o},c)});case 25:case"end":return e.stop()}}),e)}))),Yv.apply(this,arguments)}function Fv(e){return jv.apply(this,arguments)}function jv(){return(jv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null==t?void 0:t.paypal,a=(null==o?void 0:o.channelMerchantAccountId)||"",s=(null==t?void 0:t.businessDivision)||"",l=(null==t||null===(n=t.amount)||void 0===n?void 0:n.currency)||"",c=(null==t||null===(r=t.amount)||void 0===r?void 0:r.value)||"",e.prev=5,e.next=8,Mh({clientId:a,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:s,amount:{currency:l,value:c}},{timeout:1e5,hostSign:s});case 8:if(!0!==(null==(d=e.sent)?void 0:d.success)||!d.channelClientId){e.next=11;break}return e.abrupt("return",{paypal:h()(h()({},o),{},{channelMerchantAccountId:d.channelClientId})});case 11:if(!0!==(null==d?void 0:d.success)){e.next=13;break}return e.abrupt("return",{setupError:new bh("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON()});case 13:return p=new bh((null==d?void 0:d.errorMessage)||"channelClientId query failed",(null==d?void 0:d.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),"true"===(null==d||null===(u=d.extendInfo)||void 0===u?void 0:u.mulityLanguageMapping)&&(p.mulityLanguageMapping=!0),e.abrupt("return",{setupError:p});case 18:return e.prev=18,e.t0=e.catch(5),i=void 0,i="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),m={code:i?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:i?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},v=new bh(m.message,m.code,"SDK_USAGE").toJSON(),"true"===(null===e.t0||void 0===e.t0||null===(f=e.t0.response)||void 0===f||null===(f=f.extendInfo)||void 0===f?void 0:f.mulityLanguageMapping)&&(v.mulityLanguageMapping=!0),e.abrupt("return",{setupError:v});case 25:case"end":return e.stop()}var i}),e,null,[[5,18]])})))).apply(this,arguments)}function Gv(e){return zv.apply(this,arguments)}function zv(){return(zv=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.sessionData,o=t.env,a=t.paypalSetupResult,!(s=Wv(r))){e.next=4;break}return e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:s})});case 4:return l=jp(r),e.prev=5,e.next=8,Yh({paymentSessionData:r,paymentSessionConfig:null==l?void 0:l.paymentSessionConfig});case 8:if(null==(c=e.sent)||!c.success){e.next=12;break}return u=Vv(),e.abrupt("return",{renderData:c,setupResult:h()(h()(h()({sessionData:r,renderData:c,isNativeAppWebview:null==n?void 0:n.isNativeAppWebview},u?{merchantDomain:u,doMain:u}:{}),a),{},{_requestConfig:h()({env:o},void 0),sdkVersion:"2.0.22"})});case 12:return e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:bh.unificationError(new Error((null==c?void 0:c.errorMessage)||"sdkActionQuery failed")).toJSON()})});case 15:return e.prev=15,e.t0=e.catch(5),e.abrupt("return",{setupResult:h()(h()({sessionData:r},a),{},{setupError:bh.unificationError(e.t0).toJSON()})});case 18:case"end":return e.stop()}}),e,null,[[5,15]])})))).apply(this,arguments)}function Vv(){var e;if("undefined"!=typeof window)return(null===(e=window.location)||void 0===e?void 0:e.hostname)||void 0}function Wv(e){var t,n=jp(e);if(!n)return bh.unificationError(new Error("Failed to parse sessionData, please check the sessionData")).toJSON();var r=null===(t=n.paymentSessionConfig)||void 0===t?void 0:t.productScene;return"ELEMENT_PAYMENT"!==r?bh.unificationError(new Error("Invalid productScene in sessionData, expected ELEMENT_PAYMENT, but get ".concat(r,", please check the sessionData is correct?"))).toJSON():void 0}var qv=["paypal"],Jv=["createOrder","onShippingAddressChange","onShippingOptionsChange"],Qv=function(e){_()(o,e);var t,n,r=E()(o);function o(e,t){var n;g()(this,o);var i=t.appConfig||{},a=i.paypal,s=Fl()(i,qv),l=a||{},u=l.createOrder,d=l.onShippingAddressChange,p=l.onShippingOptionsChange,f=Fl()(l,Jv),m=h()({},s);delete m.amount;var v=h()(h()({},m),Object.keys(f).length>0&&{paypal:f}),y=t.locale||"en_US",_=Ys("/express_element/index.html",!0);"sandbox"===t.env&&(_+=_.includes("?")?"&shadow=true":"?shadow=true");var b,E,S=i.sessionData?Ip(i.sessionData):void 0;S&&Vl.setTrackId(S),n=r.call(this,e,_,h()(h()({},t),{},{appConfig:v,locale:y,trackId:S}),Xp({appearance:{displaySetting:{showCardBrandIcon:!0}}},v)),c()(Ze()(n),"_callbacks",{}),c()(Ze()(n),"_renderData",null),c()(Ze()(n),"_initialAmount",void 0),c()(Ze()(n),"_localHandlers",new Map),c()(Ze()(n),"_paymentInProgress",!1),c()(Ze()(n),"_paypalOverlay",(b=null,{show:function(){if(!b){var e=document.createElement("div");e.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){e.style.opacity="1"}));var t=document.createElement("button");t.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",t.innerHTML="&#x2715;",t.addEventListener("click",E);var n=document.createElement("div");n.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var r=document.createElement("div");r.setAttribute("role","img"),r.setAttribute("aria-label","PayPal"),r.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var o=document.createElement("p");o.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",o.textContent="Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods.",n.appendChild(r),n.appendChild(o),e.appendChild(t),e.appendChild(n),document.body.appendChild(e),b=e}},hide:E=function(){b&&(b.remove(),b=null)}}));var A=i.sessionData?Cp(i.sessionData):"";return Hp.setGlobalOptions(h()({hostSign:A,sdkVersion:"2.0.22",env:t.env},void 0)),n._callbacks={paypalCreateOrder:u,paypalOnShippingAddressChange:d,paypalOnShippingOptionsChange:p},n._initialAmount=i.amount,n}return m()(o,[{key:"on",value:function(e,t){var n=this;if("onRedirect"===e&&(this._localHandlers.has(e)||this._localHandlers.set(e,new Set),this._localHandlers.get(e).add(t)),"confirm"===e){return qp()(Qp()(o.prototype),"on",this).call(this,e,(function(e){e.paymentFailed=function(){n._paymentInProgress=!1,n.send("OPENSDK@COMPLETE_PAYMENT_REJECT",{})},t(e)}))}return qp()(Qp()(o.prototype),"on",this).call(this,e,t)}},{key:"_emit",value:function(e,t){var n;null===(n=this._localHandlers.get(e))||void 0===n||n.forEach((function(e){return e(t)}))}},{key:"updateConfig",value:(n=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.amount,e.prev=1,"ready"===this.status){e.next=4;break}throw new bh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 4:if(void 0===n){e.next=12;break}if(!this._paymentInProgress){e.next=7;break}throw new bh("Payment amount update is not allowed during payment processing","PAYMENT_IN_PROGRESS","SDK_USAGE");case 7:if(null!=n&&n.value){e.next=9;break}throw new bh("Payment amount cannot be empty","AMOUNT_VALUE_EMPTY","SDK_USAGE");case 9:if(/^\d+(\.\d+)?$/.test(n.value)&&!(Number(n.value)<=0)){e.next=12;break}throw new bh("Invalid payment amount format (only positive integers and decimals allowed)","AMOUNT_VALUE_INVALID","SDK_USAGE");case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",{error:bh.unificationError(e.t0).toJSON()});case 17:return e.abrupt("return",qp()(Qp()(o.prototype),"updateConfig",this).call(this,t));case 18:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e){return n.apply(this,arguments)})},{key:"completePayment",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";if("destroyed"===this.status)return Promise.resolve({success:!1,error:{code:"ELEMENT_INSTANCE_DESTROYED",message:"Element already destroyed"}});var n="cp_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return this.send("OPENSDK@COMPLETE_PAYMENT",{requestId:n,redirect:t}),new Promise((function(t){var r=e.bridge.on("OPENSDK@COMPLETE_PAYMENT_RESULT",(function(i){(null==i?void 0:i.requestId)===n&&(e._paymentInProgress=!1,r(),clearTimeout(o),t({success:i.success,result:i.result,error:i.error}))})),o=setTimeout((function(){e._paymentInProgress=!1,r(),t({success:!1,error:{code:"COMPLETE_PAYMENT_TIMEOUT",message:"completePayment timed out"}})}),3e5)}))}},{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.registerInternalListeners(),t=h()(h()({},this.config.appConfig),{},{amount:this._initialAmount}),e.next=4,Hv({appConfig:t,env:this.config.env});case 4:return n=e.sent,r=n.setupResult,(o=n.renderData)&&(this._renderData=o),e.abrupt("return",h()(h()({},r),{},{amount:this._initialAmount}));case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;!function(e){var t=e.getIframe,n=e.on,r=t();r&&(r.style.opacity="0",r.style.transition="height 0.35s, opacity 0.4s 0.1s",r.style.height="0px",r.style.width="100%",r.style.display="block");var o=!1;n("contentHeightChanged",(function(e){var n=t();n&&(null==e?void 0:e.height)>0&&(n.style.height="".concat(e.height,"px"),o||(o=!0,requestAnimationFrame((function(){n.style.opacity="1"}))))}))}({getIframe:function(){return e.iframe},on:this.on.bind(this)}),function(e){var t=e.on,n=e.send,r=e.callbacks,o=e.paypalOverlay,a=e.setPaymentInProgress,l=e.getRenderData,c=e.getAppConfig;t("click",(function(e){a(!0),"paypal"!==(null==e?void 0:e.expressPaymentType)?n("OPENSDK@CLICK_RESOLVE",{}):o.show()})),t("ready",(function(){})),t("confirm",(function(){o.hide()})),t("error",(function(){a(!1),o.hide()})),t("cancel",(function(){a(!1),o.hide()})),t("OPENSDK@GET_APPLE_PAY_TOKEN",function(){var e=s()(i()().mark((function e(t){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.requestId,e.prev=1,e.next=4,qh({requestId:r,renderData:l(),appConfig:c(),sendReply:function(e){n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",e)}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{requestId:r,success:!1,errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"});case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_CREATE_ORDER",function(){var e=s()(i()().mark((function e(t){var s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t.requestId,e.prev=1,r.paypalCreateOrder){e.next=4;break}throw new Error("paypal.createOrder is not provided");case 4:return e.next=6,r.paypalCreateOrder();case 6:l=e.sent,n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,sessionData:l}),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(1),a(!1),n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"createOrder failed"}),o.hide();case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE",function(){var e=s()(i()().mark((function e(t){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,a=t.shippingData,e.prev=1,e.next=4,null===(s=r.paypalOnShippingAddressChange)||void 0===s?void 0:s.call(r,a,{});case 4:n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingAddressChange failed"});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE",function(){var e=s()(i()().mark((function e(t){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,a=t.shippingData,e.prev=1,e.next=4,null===(s=r.paypalOnShippingOptionsChange)||void 0===s?void 0:s.call(r,a,{});case 4:n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingOptionsChange failed"});case 10:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}())}({on:this.on.bind(this),send:this.send.bind(this),callbacks:this._callbacks,paypalOverlay:this._paypalOverlay,setPaymentInProgress:function(t){e._paymentInProgress=t},getRenderData:function(){return e._renderData},getAppConfig:function(){return e.config.appConfig}})}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),o}(vh);c()(Qv,"elementType","express");var Zv=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a,s=t.appConfig.sessionData,l=s?Ip(s):void 0;(l&&Vl.setTrackId(l),i=n.call(this,e,Ys("/vaulting/index.html",Vp(s)),h()(h()({},t),{},{trackId:l}),Xp({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default"}},t.appConfig)),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&Hp.setGlobalOptions({hostSign:Cp(null===(a=t.appConfig)||void 0===a?void 0:a.sessionData)});return i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData,a=Sh(o,"ELEMENT_VAULT"),e.next=4,Oh(Yh({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:a.paymentSessionConfig,paymentSessionData:o}));case 4:return s=e.sent,l=js(s.data),ap(c=l||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale),e.abrupt("return",{sessionData:o,renderData:s.data,renderDataError:s.error,sdkVersion:"2.0.22",paymentSessionConfig:a.paymentSessionConfig,locale:c,merchantId:(null===(r=s.data)||void 0===r?void 0:r.merchantId)||"default merchantId",_requestConfig:h()({env:this.config.env},void 0)});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(vh);c()(Zv,"elementType","vaulting");var Xv=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"canUseElements",value:function(){return[Zv,Qv]}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}}]),n}(yh),$v=function(e){_()(o,e);var t,n,r=E()(o);function o(e,t){var n,i,a;g()(this,o);var s,l=Xp({appearance:{layout:"accordion",theme:"default",displaySetting:{showCardBrandIcon:!0}}},t.appConfig),c=null!==(n=t.appConfig)&&void 0!==n&&n.sessionData?Ip(t.appConfig.sessionData):void 0;(c&&Vl.setTrackId(c),a=r.call(this,e,Ys("/element_payment/index.html",!0),h()(h()({},t),{},{trackId:c}),l),null!==(i=t.appConfig)&&void 0!==i&&i.sessionData)&&Hp.setGlobalOptions({hostSign:Cp(null===(s=t.appConfig)||void 0===s?void 0:s.sessionData)});return a}return m()(o,[{key:"setup",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.config.appConfig.sessionData,s=Sh(a,"ELEMENT_PAYMENT"),l=null==s?void 0:s.paymentSessionConfig,c=function(){return Oh(Yh({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:l,paymentSessionData:a}))},u=function(){return Oh(Kh({paymentSessionConfig:l,paymentSessionData:a,accountInfo:{email:""}}))},d=!(null==s||null===(t=s.connectFactor)||void 0===t||!t.enableConnect),p=d?[c(),u()]:[c(),void 0],e.next=9,Promise.all(p);case 9:return f=e.sent,m=tt()(f,2),v=m[0],g=m[1],y=js(null==v?void 0:v.data),_=y||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale,b=(null===(r=v.data)||void 0===r?void 0:r.merchantId)||(null==s?void 0:s.clientId)||"default merchantId",e.abrupt("return",{renderData:v.data,renderDataError:v.error||(null==g?void 0:g.error),connectAccount:null==g?void 0:g.data,logMetaData:{paymentMethodCategoryType:null==l?void 0:l.paymentMethodCategoryType,productSceneVersion:null==l?void 0:l.productSceneVersion,trackId:Ip(a),merchantId:b,paymentMethodType:null==s||null===(o=s.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType},sessionData:a,sessionMetaData:s,sdkVersion:"2.0.22",locale:_,merchantId:b,heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),merchantDomain:window.location.hostname,doMain:window.location.hostname,env:this.config.env,_requestConfig:h()({env:this.config.env},void 0)});case 17:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"submit",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._submit(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),o}(vh);c()($v,"elementType","payment");var eg=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a=null===(o=t.appConfig)||void 0===o?void 0:o.sessionData,s=a?Ip(a):void 0;return s&&Vl.setTrackId(s),(i=n.call(this,e,Ys("/element_payment_modern/index.html",Vp(a)),h()(h()({},t),{},{trackId:s}),Xp({appearance:{theme:"default"}},t.appConfig))).on("destroy",(function(){i.destroy()})),i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"2.0.22",_requestConfig:h()({env:this.config.env},void 0)}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(vh);c()(eg,"elementType","CVV");var tg=n(817),ng=n.n(tg),rg={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"2.0.22",trackerCode:"7982"},og=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t,n,r;return g()(this,a),t=o.call(this,Xp(rg,e)),Vl.initTracker({env:Fs}),Hp.setGlobalOptions(h()(h()({env:t.config.env},void 0),{},{sdkVersion:t.config.version,tracker:Vl,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=ng(),r=null==e?void 0:e.locale,ip.initData(n),r&&ap(r),t}return m()(a,[{key:"canUseElements",value:function(){return[Zv,eg,Qv,$v]}},{key:"updateConfig",value:function(e){e.env&&Hp.setGlobalOptions({env:e.env}),e.locale&&(Hp.setGlobalOptions({envInfo:{locale:e.locale}}),ap(e.locale)),qp()(Qp()(a.prototype),"updateConfig",this).call(this,e)}},{key:"redirect",value:function(e){var t=e.url,n=e.mode,r=e.appLinkUrl,o=e.schemaUrl;function i(){"replace"===n?window.location.replace(t):window.location.href=t}e.destroy&&this.destroy();try{if(r||o)new Ns({resultJudgmentTime:2e3,fallback:function(){i()}}).open({scheme:o,link:r});else i()}catch(e){i()}}},{key:"openModal",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",s=null!==(r=Eh[a])&&void 0!==r?r:Eh.default,l=Ih(h()(h()({},t),{},{loadingConfig:h()(h()({},t.loadingConfig),{},{theme:s.theme,backgroundColor:(null==t||null===(o=t.appearance)||void 0===o||null===(o=o.variables)||void 0===o?void 0:o["background-primary"])||s.backgroundColor})})),c=l.iframe,u=l.destroy,d=function e(){ch("ERROR","SDK_INTERNAL","modal load error"+t.url),c.removeEventListener("error",e),u()},c.addEventListener("error",d),e.abrupt("return",{destroy:u,onLoadedSuccess:function(e){c.addEventListener("load",(function(){e()}))},getContentWindow:function(){return c.contentWindow}});case 6:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"elements",value:function(){return new Xv(this.config)}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}},{key:"extractMainElement",value:function(e){if(e instanceof yh){var t=e._mainElement;if(!t)throw new bh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof vh)return e;throw new bh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=bh.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmPayment",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h,f,m;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=45;break}e.prev=1,n=this.extractMainElement(t.elements),e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(1),r=bh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:if(!n.is(Qv)){e.next=25;break}return e.prev=10,e.next=13,n.completePayment(t.redirect||"always");case 13:if(!(a=e.sent).success){e.next=16;break}return e.abrupt("return",{status:"SUCCESS",userCanceled3D:!1});case 16:return s=["PAYMENT_CANCELLED","APPLE_PAY_CANCEL"].includes((null===(o=a.error)||void 0===o?void 0:o.code)||""),e.abrupt("return",{status:s?"CANCELLED":"FAIL",userCanceled3D:!1,error:a.error?{code:a.error.code,message:a.error.message}:void 0});case 21:return e.prev=21,e.t1=e.catch(10),l=bh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:l.code,message:l.message}});case 25:if(!n.is($v)){e.next=36;break}return e.prev=26,e.next=29,n.submit({redirect:null!==(c=t.redirect)&&void 0!==c?c:"always",params:t.params,shippingInfo:t.shippingInfo,handleActions:t.handleActions});case 29:return e.abrupt("return",e.sent);case 32:return e.prev=32,e.t2=e.catch(26),u=bh.unificationError(e.t2),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:u.code,message:u.message}});case 36:return e.prev=36,d=n,e.abrupt("return",d.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 41:return e.prev=41,e.t3=e.catch(36),p=bh.unificationError(e.t3),e.abrupt("return",{code:p.code,message:p.message,userCanceled3D:!1,status:"FAIL",error:{code:p.code,message:p.message}});case 45:return(h=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance,sessionData:t.sessionData})).mount(document.body),e.prev=47,e.next=50,new Promise((function(e,t){var n=setTimeout((function(){t(new bh("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);h.on(wl,(function(){clearTimeout(n),e()}))}));case 50:e.next=58;break;case 52:return e.prev=52,e.t4=e.catch(47),h.unmount(),f=bh.unificationError(e.t4),m=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:f.code,message:f.message,status:m.includes(f.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:f.code,message:f.message}});case 58:return e.abrupt("return",h.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 59:case"end":return e.stop()}}),e,this,[[1,5],[10,21],[26,32],[36,41],[47,52]])}))),function(e){return t.apply(this,arguments)})}]),a}(_h);c()(og,"version","2.0.22");var ig,ag,sg=["env","environment"],lg=function(){var e=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).env,o=n.environment,a=Fl()(n,sg),s=r||o||"prod",e.abrupt("return",(0,jl.createSingletonInstance)(og,h()(h()({},a),{},{env:s}),"AntomSDK"));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(ag=["CDN","NPM"]).includes(ig="CDN")&&"undefined"!=typeof window&&(ag.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=ig,xv.setMedta({integrationType:ig})));var cg=Pv}(),r}()}));