@zonos/elements 1.3.290 → 1.3.292

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.
Files changed (174) hide show
  1. package/dist/cjs/{cart-7DceSLKl.js → cart-B6Aty-21.js} +1 -1
  2. package/dist/cjs/{collect-C08DUE1L.js → collect-Oeo5tjN5.js} +2 -2
  3. package/dist/cjs/{getMissingRequiredShippingFields-Duz8xpmf.js → getMissingRequiredShippingFields-D03ICqss.js} +1 -1
  4. package/dist/cjs/{hasInclusivePrice-C-iyXqJ0.js → hasInclusivePrice-CPCoVeU3.js} +1 -1
  5. package/dist/cjs/index.cjs.js +7 -7
  6. package/dist/cjs/{invoice-DSuHUQpi.js → invoice-Cj8W7NW0.js} +2 -2
  7. package/dist/cjs/{localization-BJqYz_PB.js → localization-BzNeXeDe.js} +24 -15
  8. package/dist/cjs/{paypal-CZoctP9S.js → paypal-CuKshRmZ.js} +2 -2
  9. package/dist/cjs/{placeTestOrder-D7baFuaV.js → placeTestOrder-7czjwkjm.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-Ca2HH1Gc.js → renderCheckoutCurrency-BH8t2b2x.js} +2 -2
  11. package/dist/cjs/{shouldShowLanguageSelect-FyTdz7U_.js → shouldShowLanguageSelect-yAbtCmd8.js} +1 -1
  12. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-address-display_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  17. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +8 -8
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  19. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +7 -7
  21. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  24. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +7 -7
  29. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  30. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  31. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
  32. package/dist/collection/components/store/hello/localization.js +4 -1
  33. package/dist/collection/components/utils/hello/countryOverrideStorage.js +20 -14
  34. package/dist/esm/{cart-Cleo1j5P.js → cart-BoQp8Ema.js} +1 -1
  35. package/dist/esm/{collect-CspdWIRo.js → collect-CdrR5OBy.js} +2 -2
  36. package/dist/esm/{getMissingRequiredShippingFields-B1IL1-gn.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +1 -1
  37. package/dist/esm/{hasInclusivePrice-DKRplpLX.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
  38. package/dist/esm/index.js +7 -7
  39. package/dist/esm/{invoice-D49igPQ9.js → invoice-S1KahJ_Z.js} +2 -2
  40. package/dist/esm/{localization-BiL8bPsY.js → localization-BIh-4pc_.js} +24 -15
  41. package/dist/esm/{paypal-D4vWRxHJ.js → paypal-DNfvnuUU.js} +2 -2
  42. package/dist/esm/{placeTestOrder-BNmc5RCo.js → placeTestOrder-CQaMKFOg.js} +2 -2
  43. package/dist/esm/{renderCheckoutCurrency-BNbwijGo.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
  44. package/dist/esm/{shouldShowLanguageSelect-B82gTfHz.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
  45. package/dist/esm/zonos-address-completion-dialog_7.entry.js +3 -3
  46. package/dist/esm/zonos-address-display_2.entry.js +1 -1
  47. package/dist/esm/zonos-address_4.entry.js +2 -2
  48. package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
  49. package/dist/esm/zonos-card_5.entry.js +3 -3
  50. package/dist/esm/zonos-cart-items_12.entry.js +8 -8
  51. package/dist/esm/zonos-checkout.entry.js +3 -3
  52. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  53. package/dist/esm/zonos-collect-finish_6.entry.js +7 -7
  54. package/dist/esm/zonos-collect.entry.js +4 -4
  55. package/dist/esm/zonos-controller.entry.js +2 -2
  56. package/dist/esm/zonos-country-flag.entry.js +2 -2
  57. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  58. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  59. package/dist/esm/zonos-hello.entry.js +1 -1
  60. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  61. package/dist/esm/zonos-invoice-finish_5.entry.js +7 -7
  62. package/dist/esm/zonos-invoice.entry.js +4 -4
  63. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  64. package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
  65. package/dist/esm-es5/{cart-Cleo1j5P.js → cart-BoQp8Ema.js} +8 -8
  66. package/dist/esm-es5/{collect-CspdWIRo.js → collect-CdrR5OBy.js} +1 -1
  67. package/dist/esm-es5/{getMissingRequiredShippingFields-B1IL1-gn.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +3 -3
  68. package/dist/esm-es5/{hasInclusivePrice-DKRplpLX.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
  69. package/dist/esm-es5/index.js +4 -4
  70. package/dist/esm-es5/{invoice-D49igPQ9.js → invoice-S1KahJ_Z.js} +1 -1
  71. package/dist/esm-es5/{localization-BiL8bPsY.js → localization-BIh-4pc_.js} +13 -3
  72. package/dist/esm-es5/{paypal-D4vWRxHJ.js → paypal-DNfvnuUU.js} +1 -1
  73. package/dist/esm-es5/{placeTestOrder-BNmc5RCo.js → placeTestOrder-CQaMKFOg.js} +1 -1
  74. package/dist/esm-es5/{renderCheckoutCurrency-BNbwijGo.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
  75. package/dist/esm-es5/{shouldShowLanguageSelect-B82gTfHz.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
  76. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
  77. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  78. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  79. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  80. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  81. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  82. package/dist/esm-es5/zonos-checkout.entry.js +3 -3
  83. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  84. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  85. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  86. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  87. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  88. package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
  89. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  90. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  91. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
  92. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  93. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  94. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  95. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  96. package/dist/scripts/index.d.ts +2 -0
  97. package/dist/scripts/index.js +1 -1
  98. package/dist/scripts/loadZonos.js +1 -1
  99. package/dist/scripts/zonos.js +1 -1
  100. package/dist/types/components/store/checkout/cart.d.ts +2 -0
  101. package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +1 -1
  102. package/dist/zonos-elements/index.esm.js +1 -1
  103. package/dist/zonos-elements/{p-0ee74bf3.system.entry.js → p-04bded81.system.entry.js} +22 -22
  104. package/dist/zonos-elements/{p-c3b02dbf.entry.js → p-06fe2939.entry.js} +1 -1
  105. package/dist/zonos-elements/{p-13d3a372.system.entry.js → p-0b81f8b9.system.entry.js} +14 -14
  106. package/dist/zonos-elements/{p-d6b72f6d.entry.js → p-0fca452b.entry.js} +1 -1
  107. package/dist/zonos-elements/{p-a571beaa.system.entry.js → p-11defdca.system.entry.js} +16 -16
  108. package/dist/zonos-elements/{p-fb869759.system.entry.js → p-17c7ea4a.system.entry.js} +1 -1
  109. package/dist/zonos-elements/{p-9ef0f69e.system.entry.js → p-23352709.system.entry.js} +3 -3
  110. package/dist/zonos-elements/{p-a5c25829.system.entry.js → p-249c1ee1.system.entry.js} +1 -1
  111. package/dist/zonos-elements/{p-52d9fd3a.entry.js → p-34656e6c.entry.js} +1 -1
  112. package/dist/zonos-elements/{p-c4ad6d4b.entry.js → p-39ee1558.entry.js} +1 -1
  113. package/dist/zonos-elements/p-4679f0ec.entry.js +1 -0
  114. package/dist/zonos-elements/{p-23f6346b.system.entry.js → p-4806b264.system.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-3c800376.system.entry.js → p-5016d71b.system.entry.js} +59 -59
  116. package/dist/zonos-elements/{p-5f347f91.system.entry.js → p-51400242.system.entry.js} +1 -1
  117. package/dist/zonos-elements/{p-35509b10.system.entry.js → p-5236c676.system.entry.js} +20 -20
  118. package/dist/zonos-elements/{p-ddca5ee1.entry.js → p-550d4eea.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-481ecc23.system.entry.js → p-552fbde1.system.entry.js} +20 -20
  120. package/dist/zonos-elements/{p-1b77464d.system.entry.js → p-5b80aff2.system.entry.js} +13 -13
  121. package/dist/zonos-elements/{p-079af8c0.system.entry.js → p-69c3e367.system.entry.js} +9 -9
  122. package/dist/zonos-elements/{p-7d284341.system.entry.js → p-6abec43f.system.entry.js} +3 -3
  123. package/dist/zonos-elements/{p-5df25a1a.entry.js → p-6c41b00c.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-f37b8aaf.system.entry.js → p-6db7c0b1.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-990b49f2.entry.js → p-6e296228.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-BDrM4x5N.js → p-7abqRc9V.js} +2 -2
  127. package/dist/zonos-elements/{p-ba510730.entry.js → p-82595838.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-84c9ce16.entry.js → p-938fc1e4.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-7ee2af6e.system.entry.js → p-9c33f7ed.system.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-DVITR-Eu.system.js → p-Be3Hpms1.system.js} +1 -1
  131. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  132. package/dist/zonos-elements/{p-BT9_ehlh.system.js → p-CEK_Wk6v.system.js} +1 -1
  133. package/dist/zonos-elements/p-CFbfEmjN.js +1 -0
  134. package/dist/zonos-elements/p-D-bZg-Pc.js +1 -0
  135. package/dist/zonos-elements/{p-CASTsiDR.system.js → p-D4MevhAL.system.js} +3 -3
  136. package/dist/zonos-elements/{p-tGJYTlGL.system.js → p-DI2vXnXc.system.js} +3 -3
  137. package/dist/zonos-elements/{p-Cpe_ISNt.system.js → p-DNc279vN.system.js} +27 -27
  138. package/dist/zonos-elements/{p-CEmXVahp.system.js → p-DOD2I44l.system.js} +92 -82
  139. package/dist/zonos-elements/{p-uuZUZPIm.system.js → p-DS-qw_qc.system.js} +10 -10
  140. package/dist/zonos-elements/p-DZ2mevDK.js +1 -0
  141. package/dist/zonos-elements/{p-CewmhMGk.js → p-DzLNk-Pf.js} +1 -1
  142. package/dist/zonos-elements/{p-DwkyNtpD.js → p-FRWZayxL.js} +1 -1
  143. package/dist/zonos-elements/p-Mrz_lnC1.js +1 -0
  144. package/dist/zonos-elements/{p-B_5RofQ9.system.js → p-XDxdMlQl.system.js} +23 -23
  145. package/dist/zonos-elements/{p-DYIisqF7.system.js → p-XqkqjeNV.system.js} +1 -1
  146. package/dist/zonos-elements/{p-4fd78ecf.system.entry.js → p-a40fd99b.system.entry.js} +9 -9
  147. package/dist/zonos-elements/{p-79ddb12a.system.entry.js → p-b2dd7f02.system.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-11bab88b.entry.js → p-b79036fc.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-26295311.entry.js → p-bb3546c0.entry.js} +1 -1
  150. package/dist/zonos-elements/p-c1cbfdba.entry.js +1 -0
  151. package/dist/zonos-elements/{p-7e1050dd.system.entry.js → p-c3646ae6.system.entry.js} +15 -15
  152. package/dist/zonos-elements/{p-028e0500.entry.js → p-c47ce656.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-34c5e145.entry.js → p-c5bab786.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-234c202c.entry.js → p-c961caaf.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-NJVOYjda.js → p-c9QtIdJX.js} +1 -1
  156. package/dist/zonos-elements/{p-Cuk0LLGQ.js → p-clDfq9AL.js} +1 -1
  157. package/dist/zonos-elements/{p-db75322d.entry.js → p-d168023b.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-5b06f069.entry.js → p-db87b0dd.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-dd8ca91e.entry.js → p-defc2d18.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-0dca8a26.system.entry.js → p-e0e9cff5.system.entry.js} +26 -26
  161. package/dist/zonos-elements/p-f8b50aa0.entry.js +1 -0
  162. package/dist/zonos-elements/{p-tkSf-lrO.system.js → p-kaOxUR9u.system.js} +5 -5
  163. package/dist/zonos-elements/p-rVp8hgWw.js +1 -0
  164. package/dist/zonos-elements/{p-B5NDhB1w.system.js → p-y7PFdTUN.system.js} +4 -4
  165. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  166. package/package.json +1 -1
  167. package/dist/zonos-elements/p-35539d3d.entry.js +0 -1
  168. package/dist/zonos-elements/p-BJzAgoqz.js +0 -1
  169. package/dist/zonos-elements/p-BKoLoalh.js +0 -1
  170. package/dist/zonos-elements/p-BaF00SfB.js +0 -1
  171. package/dist/zonos-elements/p-BtWDzGMx.js +0 -1
  172. package/dist/zonos-elements/p-CX_vfdWt.js +0 -1
  173. package/dist/zonos-elements/p-ab54d0a1.entry.js +0 -1
  174. package/dist/zonos-elements/p-ca3175d9.entry.js +0 -1
@@ -1,22 +1,22 @@
1
- var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-BuU_p5DP.system.js","./p-CEmXVahp.system.js","./p-zVLAvre1.system.js","./p-BbgqQIHv.system.js","./p-uuZUZPIm.system.js"],(function(e){"use strict";var n,t,r,i,o,a,u,s,c,f,l,v,d,m;return{setters:[function(e){n=e.c;t=e.z},function(e){r=e.t;i=e.l;o=e.s},function(e){a=e.l;u=e.h;s=e.s},function(e){c=e.l;f=e.b},function(e){l=e.d;v=e.Y;d=e.b;m=e.a0}],execute:function(){var p=this;
1
+ var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-BuU_p5DP.system.js","./p-DOD2I44l.system.js","./p-zVLAvre1.system.js","./p-BbgqQIHv.system.js","./p-DS-qw_qc.system.js"],(function(e){"use strict";var n,t,r,i,o,a,u,s,c,f,l,v,d,m;return{setters:[function(e){n=e.c;t=e.z},function(e){r=e.t;i=e.l;o=e.s},function(e){a=e.l;u=e.h;s=e.s},function(e){c=e.l;f=e.b},function(e){l=e.d;v=e.Y;d=e.b;m=e.a0}],execute:function(){var p=this;
2
2
  // src/constant/common.ts
3
- function h(e,n){if(n==null||n>e.length)n=e.length;for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function y(e){if(Array.isArray(e))return e}function w(e){if(Array.isArray(e))return h(e)}function g(e,n,t,r,i,o,a){try{var u=e[o](a);var s=u.value}catch(e){t(e);return}if(u.done){n(s)}else{Promise.resolve(s).then(r,i)}}function b(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){g(o,r,i,a,u,"next",e)}function u(e){g(o,r,i,a,u,"throw",e)}a(undefined)}))}}function k(e,n){if(!(e instanceof n)){throw new TypeError("Cannot call a class as a function")}}function x(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function E(e,n,t){if(n)x(e.prototype,n);return e}function I(e,n,t){if(n in e){Object.defineProperty(e,n,{value:t,enumerable:true,configurable:true,writable:true})}else{e[n]=t}return e}function S(e,n){if(n!=null&&typeof Symbol!=="undefined"&&n[Symbol.hasInstance]){return!!n[Symbol.hasInstance](e)}else{return e instanceof n}}function N(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function C(e,n){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var r=[];var i=true;var o=false;var a,u;try{for(t=t.call(e);!(i=(a=t.next()).done);i=true){r.push(a.value);if(r.length===n)break}}catch(e){o=true;u=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(o)throw u}}return r}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};var r=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))}r.forEach((function(n){I(e,n,t[n])}))}return e}function R(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}function O(e,n){n=n!=null?n:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(n))}else{R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e,n){return y(e)||C(e,n)||L(e,n)||T()}function _(e){return w(e)||N(e)||L(e)||D()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function L(e,n){if(!e)return;if(typeof e==="string")return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}function U(e,n){var t,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(n){return s([e,n])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e];r=0}finally{t=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var M=function(e){e["production"]="prod";e["demo"]="demo";e["staging"]="staging";return e}(M||{});
3
+ function h(e,n){if(n==null||n>e.length)n=e.length;for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function y(e){if(Array.isArray(e))return e}function w(e){if(Array.isArray(e))return h(e)}function g(e,n,t,r,i,o,a){try{var u=e[o](a);var s=u.value}catch(e){t(e);return}if(u.done){n(s)}else{Promise.resolve(s).then(r,i)}}function b(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){g(o,r,i,a,u,"next",e)}function u(e){g(o,r,i,a,u,"throw",e)}a(undefined)}))}}function k(e,n){if(!(e instanceof n)){throw new TypeError("Cannot call a class as a function")}}function x(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function E(e,n,t){if(n)x(e.prototype,n);return e}function I(e,n,t){if(n in e){Object.defineProperty(e,n,{value:t,enumerable:true,configurable:true,writable:true})}else{e[n]=t}return e}function S(e,n){if(n!=null&&typeof Symbol!=="undefined"&&n[Symbol.hasInstance]){return!!n[Symbol.hasInstance](e)}else{return e instanceof n}}function N(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function C(e,n){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var r=[];var i=true;var o=false;var a,u;try{for(t=t.call(e);!(i=(a=t.next()).done);i=true){r.push(a.value);if(r.length===n)break}}catch(e){o=true;u=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(o)throw u}}return r}function D(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};var r=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))}r.forEach((function(n){I(e,n,t[n])}))}return e}function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}function R(e,n){n=n!=null?n:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(n))}else{O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e,n){return y(e)||C(e,n)||L(e,n)||D()}function _(e){return w(e)||N(e)||L(e)||T()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function L(e,n){if(!e)return;if(typeof e==="string")return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}function U(e,n){var t,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(n){return s([e,n])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e];r=0}finally{t=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var M=function(e){e["production"]="prod";e["demo"]="demo";e["staging"]="staging";return e}(M||{});
4
4
  // src/constant/config.ts
5
- var F="airTracker_unknown";var K={appName:F,appVersion:F,env:"staging"/* staging */,isWebappContainer:false,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:false,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:false,enableRecordPageRetention:false,hideSearchParams:false,useSessionStorageForSessionId:false,assetSpeedMonitoringWhiteListByMFE:{}};var H={appName:F,env:"staging"/* staging */,sessionId:F,deviceId:F};
5
+ var F="airTracker_unknown";var K={appName:F,appVersion:F,env:"staging"/* staging */,isWebappContainer:false,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:false,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:false,enableRecordPageRetention:false,hideSearchParams:false,useSessionStorageForSessionId:false,assetSpeedMonitoringWhiteListByMFE:{}};var q={appName:F,env:"staging"/* staging */,sessionId:F,deviceId:F};
6
6
  // src/util/jsonHelper.ts
7
- var q=function(e){if(!e){return false}if(/^\s*$/.test(e))return false;e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)};var z=function(){var e=new WeakSet;return function(n,t){if(S(t,Error)){return"Error.message: ".concat(t.message," \n Error.stack: ").concat(t.stack)}if((typeof t==="undefined"?"undefined":A(t))==="object"&&t!==null){if(e.has(t)){return"[Circular ".concat(n||"root","]")}e.add(t)}if(typeof t==="function"){return"function"}if((typeof t==="undefined"?"undefined":A(t))==="symbol"){return"symbol"}if(typeof t==="undefined"){return null}return t}};var B=function(e){if(typeof e==="string"){return e}try{if(S(e,Error)){return(JSON.stringify(e,z())||"undefined").replace(/"/gim,"")}return JSON.stringify(e,z())}catch(e){return'{"error":"error happen when airTracker stringify"}'}};
7
+ var H=function(e){if(!e){return false}if(/^\s*$/.test(e))return false;e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)};var z=function(){var e=new WeakSet;return function(n,t){if(S(t,Error)){return"Error.message: ".concat(t.message," \n Error.stack: ").concat(t.stack)}if((typeof t==="undefined"?"undefined":A(t))==="object"&&t!==null){if(e.has(t)){return"[Circular ".concat(n||"root","]")}e.add(t)}if(typeof t==="function"){return"function"}if((typeof t==="undefined"?"undefined":A(t))==="symbol"){return"symbol"}if(typeof t==="undefined"){return null}return t}};var B=function(e){if(typeof e==="string"){return e}try{if(S(e,Error)){return(JSON.stringify(e,z())||"undefined").replace(/"/gim,"")}return JSON.stringify(e,z())}catch(e){return'{"error":"error happen when airTracker stringify"}'}};
8
8
  // src/util/http.ts
9
- var V=function(e){var n=e.method,t=n===void 0?"post":n,r=e.url,i=e.data,o=e.success,a=e.fail;if(!q(i)){return}var u=new XMLHttpRequest;u.addEventListener("readystatechange",(function(){if(u.readyState===4){if(u.status>=400||u.status===0){a===null||a===void 0?void 0:a(u.response)}else{o===null||o===void 0?void 0:o(u.response)}}}));u.open(t,r);u.setRequestHeader("Content-Type","application/json");u.send(i)};
9
+ var W=function(e){var n=e.method,t=n===void 0?"post":n,r=e.url,i=e.data,o=e.success,a=e.fail;if(!H(i)){return}var u=new XMLHttpRequest;u.addEventListener("readystatechange",(function(){if(u.readyState===4){if(u.status>=400||u.status===0){a===null||a===void 0?void 0:a(u.response)}else{o===null||o===void 0?void 0:o(u.response)}}}));u.open(t,r);u.setRequestHeader("Content-Type","application/json");u.send(i)};
10
10
  // src/constant/lifeCycleEventName.ts
11
- var W={onInit:"onInit",onConfigInit:"onConfigInit",onCommonDataInit:"onCommonDataInit",onCommonUpdated:"onCommonUpdated"};
11
+ var V={onInit:"onInit",onConfigInit:"onConfigInit",onCommonDataInit:"onCommonDataInit",onCommonUpdated:"onCommonUpdated"};
12
12
  // src/constant/index.ts
13
13
  var X="AIR_ANALYTICS_DEVICE_ID";var G="AIR_ANALYTICS_SESSION_ID";var $="AWX_RISK_ID";var J=function(e){if(e=="prod"/* production */){return"https://o11y.airwallex.com/airtracker/logs"}if(e=="demo"/* demo */){return"https://o11y-demo.airwallex.com/airtracker/logs"}return"https://o11y-staging.airwallex.com/airtracker/logs"};var Q=function(e){if(e=="prod"/* production */){return"https://o11y.airwallex.com/airtracker/metrics"}if(e=="demo"/* demo */){return"https://o11y-demo.airwallex.com/airtracker/metrics"}return"https://o11y-staging.airwallex.com/airtracker/metrics"};
14
14
  // src/util/index.ts
15
15
  var Y=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=Math.random()*16|0;var t=e==="x"?n:n&3|8;return t.toString(16)}));return e};var Z=function(e){var n,t,r;if(e.config.getMFEName){return e.config.getMFEName()}return((r=location)===null||r===void 0?void 0:(t=r.pathname)===null||t===void 0?void 0:(n=t.split("/"))===null||n===void 0?void 0:n[2])||"unknown"};var ee=function(){try{var e=window.sessionStorage.getItem(G);if(!e){e=Y();window.sessionStorage.setItem(G,e)}return e}catch(e){return Y()}};var ne=function(){try{var e=window.localStorage.getItem(X);if(!e){e=Y();window.localStorage.setItem(X,e)}return e}catch(e){}};var te=function(){try{var e=window.localStorage.getItem($);return e||void 0}catch(e){}};var re=function(){var e;var n="";var t=navigator.userAgent.match(/NetType\/(\w+)/);if(t){var r;r=j(t,2),n=r[1]}else if((e=navigator)===null||e===void 0?void 0:e.connection){var i,o,a,u;n=((o=navigator)===null||o===void 0?void 0:(i=o.connection)===null||i===void 0?void 0:i.effectiveType)||((u=navigator)===null||u===void 0?void 0:(a=u.connection)===null||a===void 0?void 0:a.type)}if(!n){n="unknown"}return ie(n)};var ie=function(e){e=String(e).toLowerCase();if(e.indexOf("4g")>=0)return"net4g"/* net4g */;if(e.indexOf("wifi")>=0)return"wifi"/* wifi */;if(e.indexOf("5g")>=0)return"net5g"/* net5g */;if(e.indexOf("3g")>=0)return"net3g"/* net3g */;if(e.indexOf("2g")>=0)return"net2g"/* net2g */;return"unknown"/* unknown */};var oe=function e(){return typeof window.performance!=="undefined"&&typeof window.performance.clearResourceTimings==="function"&&typeof window.performance.getEntriesByType==="function"&&typeof window.performance.now==="function"};var ae=function(e){if(typeof e==="string"){var n=e.split("?")[0]||"";return n.slice(0,200)}return e};var ue=function(e){if(typeof e==="string"){return e.split("?")[1]||""}return e};var se=function(e){var n=typeof e==="string"&&e.startsWith("//");return n?typeof location!=="undefined"&&location.protocol==="https:":/^https/.test(e)};var ce=function(e,n){if(typeof e==="number"){return e}if(typeof e==="string"){return e}return-1/* number */};var fe=function(e,n){var t;var r=false;if(!n.config.isWebappContainer){r=le(e,n.config.assetSpeedMonitoringWhiteList);return r}var i=Z(n);return r||le(e,(t=n.config.assetSpeedMonitoringWhiteListByMFE)===null||t===void 0?void 0:t[i])};var le=function(e,n){if(!(n===null||n===void 0?void 0:n.length)){return false}for(var t=0;t<n.length;t++){var r=n[t];if(S(r,RegExp)&&r.test(e)){return true}if(typeof r=="string"&&e.includes(r)){return true}}return false};var ve=function(e,n){var t=100;return Math.round((e-n)*t)/t};
16
16
  // src/pipes/send.ts
17
- var de=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?P({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a=Array.isArray(n)?n:[n];if(a.length===0){return}var u={commonData:o,data:a};var s=B(u);var c={method:"post",url:J(e.commonData.env),data:s};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var f=navigator.sendBeacon(c.url,s);if(!f){V(c)}}else{V(c)}}};var me=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?P({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a={commonData:o,data:Array.isArray(n)?n:[n]};var u=B(a);var s={method:"post",url:Q(e.commonData.env),data:u};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var c=navigator.sendBeacon(s.url,u);if(!c){V(s)}}else{V(s)}}};
17
+ var de=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?P({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a=Array.isArray(n)?n:[n];if(a.length===0){return}var u={commonData:o,data:a};var s=B(u);var c={method:"post",url:J(e.commonData.env),data:s};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var f=navigator.sendBeacon(c.url,s);if(!f){W(c)}}else{W(c)}}};var me=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?P({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a={commonData:o,data:Array.isArray(n)?n:[n]};var u=B(a);var s={method:"post",url:Q(e.commonData.env),data:u};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var c=navigator.sendBeacon(s.url,u);if(!c){W(s)}}else{W(s)}}};
18
18
  // src/pipes/throttle.ts
19
- var pe=function(e,n){var t;var r=[];var i=e.config;window.addEventListener("beforeunload",(function(){if(r.length>0){e.immediateSendPipe(r.splice(0,r.length));t&&clearTimeout(t)}}));return function(o,a){r.push(o);e.lifeCycle.on(W.onCommonUpdated,(function(){if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(W.onCommonUpdated);t&&clearTimeout(t)}}));if(r.length>=n){a===null||a===void 0?void 0:a(r.splice(0,r.length));t&&clearTimeout(t);return}t&&clearTimeout(t);t=setTimeout((function(){t=null;if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(W.onCommonUpdated)}}),i.delay)}};
19
+ var pe=function(e,n){var t;var r=[];var i=e.config;window.addEventListener("beforeunload",(function(){if(r.length>0){e.immediateSendPipe(r.splice(0,r.length));t&&clearTimeout(t)}}));return function(o,a){r.push(o);e.lifeCycle.on(V.onCommonUpdated,(function(){if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(V.onCommonUpdated);t&&clearTimeout(t)}}));if(r.length>=n){a===null||a===void 0?void 0:a(r.splice(0,r.length));t&&clearTimeout(t);return}t&&clearTimeout(t);t=setTimeout((function(){t=null;if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(V.onCommonUpdated)}}),i.delay)}};
20
20
  // src/pipes/errorRepeatLimit.ts
21
21
  var he=function(e){var n={};return function(t,r){var i=typeof e.config.errorRepeatTime==="number"?e.config.errorRepeatTime:5;if(i===0){return r===null||r===void 0?void 0:r(t)}r===null||r===void 0?void 0:r(t.filter((function(e){if(e.severity=="autoDetectError"/* AUTO_DETECT_ERROR */){n[e.error]=n[e.error]||0;n[e.error]+=1;if(n[e.error]>i){return false}return true}return true})))}};
22
22
  // src/pipes/index.ts
@@ -30,37 +30,37 @@ this.isInit=false;this.name=n.name;this.option=n}E(e,[{key:"patch",value:functio
30
30
  // src/plugins/onErrorPlugin.ts
31
31
  var ke;var xe=function(e){var n="".concat(B(e.message)||""," @ (").concat(B(e.filename)||"",":").concat(e.lineno||0,":").concat(e.colno||0,")\n").concat(B(e.error||""));ke.normalLogPipeLine({severity:"autoDetectError"/* AUTO_DETECT_ERROR */,eventName:"windowOnError"/* windowOnError */,extraInfo:{error:n}})};var Ee=function(e){var n=e&&B(e.reason);ke.normalLogPipeLine({severity:"autoDetectError"/* AUTO_DETECT_ERROR */,eventName:"promiseError"/* promiseError */,extraInfo:{error:n}})};var Ie=function(e){var n=(e===null||e===void 0?void 0:e.target)||(e===null||e===void 0?void 0:e.srcElement);if(!n){return}var t=(n===null||n===void 0?void 0:n.src)||(n===null||n===void 0?void 0:n.href);var r=n.tagName;var i="unknown"/* unknown */;if(typeof t==="string"&&r){if(window.location.href.indexOf(t)>-1){return}if(/\.js$/.test(t)){i="script"/* script */}else if(/\.css$/.test(t)){i="css"/* css */}else{switch(r.toLowerCase()){case"script":i="script"/* script */;break;case"link":i="css"/* css */;break;case"img":i="image"/* img */;break;case"audio":case"video":i="media"/* media */;break;default:return}}ke.normalLogPipeLine({severity:"autoDetectError"/* AUTO_DETECT_ERROR */,eventName:"staticFileLoadError"/* staticFileLoadError */,extraInfo:{staticFileType:i,error:"".concat(r," load fail: ").concat(t)}})}};var Se=new be({name:"errorDetectionPlugin",setUp:function(e){ke=e;window.addEventListener("error",xe);window.addEventListener("unhandledrejection",Ee);window.document.addEventListener("error",Ie,true)},destroy:function(){window.removeEventListener("unhandledrejection",Ee);window.document.removeEventListener("error",Ie,true);window.removeEventListener("error",xe)}});
32
32
  // src/plugins/assetsSpeedPlugin.ts
33
- var Ne=["img","css","script","link","audio","video","iframe"];var Ce="resource";var Te=function(e){var n=e.name;return{url:ae(n),method:"get",
33
+ var Ne=["img","css","script","link","audio","video","iframe"];var Ce="resource";var De=function(e){var n=e.name;return{url:ae(n),method:"get",
34
34
  // duration = redirect + DNS + CONNECTION + request + response
35
35
  duration:Number(e.duration.toFixed(2)),
36
36
  // time it takes to load
37
- type:"static",isHttps:se(n),urlQuery:ue(n),domainLookup:ce(e.domainLookupEnd-e.domainLookupStart),connectTime:ce(e.connectEnd-e.connectStart)}};var De=function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(Ne.indexOf(i.initiatorType)!==-1&&fe(i.name,n)){n.normalLogPipeLine({severity:"performance"/* PERFORMANCE */,eventName:"assets_speed"/* ASSETS_SPEED */,extraInfo:{log:Te(i)}})}}};var Pe;var Re;var Oe=new be({name:"assetsSpeedPlugin",setUp:function(e){if(!oe())return;var n=0;window.performance.onresourcetimingbufferfull=function(){n=0;window.performance.clearResourceTimings()};if(typeof window.PerformanceObserver==="function"){De(window.performance.getEntriesByType(Ce),e);Re=new window.PerformanceObserver((function(n){De(n.getEntries(),e)}));Re.observe({entryTypes:[Ce]})}else{Pe=setInterval((function(){var t=window.performance.getEntriesByType(Ce);var r=t.slice(n);n=t.length;De(r,e)}),3e3)}},destroy:function(){Re===null||Re===void 0?void 0:Re.disconnect();Pe&&clearInterval(Pe)}});
37
+ type:"static",isHttps:se(n),urlQuery:ue(n),domainLookup:ce(e.domainLookupEnd-e.domainLookupStart),connectTime:ce(e.connectEnd-e.connectStart)}};var Te=function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(Ne.indexOf(i.initiatorType)!==-1&&fe(i.name,n)){n.normalLogPipeLine({severity:"performance"/* PERFORMANCE */,eventName:"assets_speed"/* ASSETS_SPEED */,extraInfo:{log:De(i)}})}}};var Pe;var Oe;var Re=new be({name:"assetsSpeedPlugin",setUp:function(e){if(!oe())return;var n=0;window.performance.onresourcetimingbufferfull=function(){n=0;window.performance.clearResourceTimings()};if(typeof window.PerformanceObserver==="function"){Te(window.performance.getEntriesByType(Ce),e);Oe=new window.PerformanceObserver((function(n){Te(n.getEntries(),e)}));Oe.observe({entryTypes:[Ce]})}else{Pe=setInterval((function(){var t=window.performance.getEntriesByType(Ce);var r=t.slice(n);n=t.length;Te(r,e)}),3e3)}},destroy:function(){Oe===null||Oe===void 0?void 0:Oe.disconnect();Pe&&clearInterval(Pe)}});
38
38
  // src/plugins/onPageChangePlugin.ts
39
39
  var je;var _e=new be({name:"onPageChangePlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o;return U(this,(function(a){t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");i=function(n){var t=n.prevHref;var r,i,o,a,u;e.normalLogPipeLine({severity:"autoDetectEvent"/* AUTO_DETECT_EVENT */,eventName:"onPageChange"/* onPageChange */,extraInfo:{prevHref:t,href:((r=location)===null||r===void 0?void 0:r.href)||"",hostname:(i=location)===null||i===void 0?void 0:i.hostname,pathName:(o=location)===null||o===void 0?void 0:o.pathname,protocol:(a=location)===null||a===void 0?void 0:a.protocol,search:(u=location)===null||u===void 0?void 0:u.search}})};i({prevHref:""});je=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;i({prevHref:e})}}));o={subtree:true,childList:true};je.observe(r||document,o);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){je===null||je===void 0?void 0:je.disconnect()}});
40
40
  // src/plugins/pageRetentionPlugin.ts
41
41
  var Ae;var Le=new be({name:"onPageRetentionPlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o,a,u;return U(this,(function(s){if(typeof document.visibilityState==="undefined"){return[2]}t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");o=function(){i=Date.now()};o();document.addEventListener("visibilitychange",(function(){if(document.visibilityState==="hidden"){a({href:location.href,leftReason:"visibilityChange"/* visibilityChange */})}else if(document.visibilityState==="visible"){o()}}));window.addEventListener("beforeunload",(function(){a({href:location.href,sendImmediate:true,leftReason:"pageClose"/* pageClose */})}));a=function(n){var t=n.href,r=n.sendImmediate,o=n.leftReason;if(!i){return}var a=Date.now()-i;if(a===0){return}i=void 0;var u={severity:"autoDetectEvent"/* AUTO_DETECT_EVENT */,eventName:"onPageRetention"/* onPageRetention */,extraInfo:{href:t,duration:a,leftReason:o}};if(r){e.ImmediatePipeline(u);return}e.normalLogPipeLine(u)};Ae=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;a({href:e,leftReason:"nextPage"/* nextPage */});o()}}));u={subtree:true,childList:true};Ae.observe(r||document,u);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){Ae===null||Ae===void 0?void 0:Ae.disconnect()}});
42
42
  // src/plugins/apiPerformancePlugin/utils.ts
43
- var Ue=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)};var Me=function(e,n){var t=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/];var r=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];if(r.some((function(n){return n.test(e)}))){return false}return le(e,n||t)};var Fe=function(e){var n=e.startTime,t=e.endTime,r=e.entries;if(r.length===0){return void 0}if(r.length===1){return r[0]}var i=r.filter((function(e){return e.startTime>=n&&t&&e.responseEnd<=t})).sort((function(e,n){return e.startTime-n.startTime}));return i===null||i===void 0?void 0:i[0]};var Ke=function(e){return Math.round(e*100)/100};var He=function(e){var n=e.startTime,t=e.duration,r=e.responseStart,i=e.connectEnd,o=e.connectStart,a=e.domainLookupEnd,u=e.domainLookupStart,s=e.requestStart,c=e.secureConnectionStart,f=e.redirectEnd,l=e.redirectStart,v=e.responseStatus,d=e.responseEnd,m=e.encodedBodySize,p=e.decodedBodySize,h=e.transferSize,y=e.deliveryType,w=e.initiatorType;return{startTime:Ke(n),totalDuration:Ke(t),timeToFirstByte:ve(r,n),tcpDuration:ve(i,o),dnsDuration:ve(a,u),tlsDuration:ve(s,c),redirectDuration:ve(f,l),responseDuration:ve(d,r),encodeResponseSize:m,decodeResponseSize:p,transferSize:h,deliveryType:y,statusCode:v,initiatorType:w}};var qe=function(e,n){var t=e.url,r=e.method,i=e.errorType,o=e.errorDetail;var a=Fe(e);var u=new URL(t,window.location.href),s=u.href,c=u.protocol;var f=a?He(a):{};var l={severity:"autoDetectEvent"/* AUTO_DETECT_EVENT */,eventName:"httpClientMetrics"/* httpClientMetrics */,extraInfo:P(O(P({httpUrl:s,method:r,scheme:c},i&&{errorType:i},o&&{errorDetail:o},f),{
43
+ var Ue=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)};var Me=function(e,n){var t=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/];var r=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];if(r.some((function(n){return n.test(e)}))){return false}return le(e,n||t)};var Fe=function(e){var n=e.startTime,t=e.endTime,r=e.entries;if(r.length===0){return void 0}if(r.length===1){return r[0]}var i=r.filter((function(e){return e.startTime>=n&&t&&e.responseEnd<=t})).sort((function(e,n){return e.startTime-n.startTime}));return i===null||i===void 0?void 0:i[0]};var Ke=function(e){return Math.round(e*100)/100};var qe=function(e){var n=e.startTime,t=e.duration,r=e.responseStart,i=e.connectEnd,o=e.connectStart,a=e.domainLookupEnd,u=e.domainLookupStart,s=e.requestStart,c=e.secureConnectionStart,f=e.redirectEnd,l=e.redirectStart,v=e.responseStatus,d=e.responseEnd,m=e.encodedBodySize,p=e.decodedBodySize,h=e.transferSize,y=e.deliveryType,w=e.initiatorType;return{startTime:Ke(n),totalDuration:Ke(t),timeToFirstByte:ve(r,n),tcpDuration:ve(i,o),dnsDuration:ve(a,u),tlsDuration:ve(s,c),redirectDuration:ve(f,l),responseDuration:ve(d,r),encodeResponseSize:m,decodeResponseSize:p,transferSize:h,deliveryType:y,statusCode:v,initiatorType:w}};var He=function(e,n){var t=e.url,r=e.method,i=e.errorType,o=e.errorDetail;var a=Fe(e);var u=new URL(t,window.location.href),s=u.href,c=u.protocol;var f=a?qe(a):{};var l={severity:"autoDetectEvent"/* AUTO_DETECT_EVENT */,eventName:"httpClientMetrics"/* httpClientMetrics */,extraInfo:P(R(P({httpUrl:s,method:r,scheme:c},i&&{errorType:i},o&&{errorDetail:o},f),{
44
44
  // use injected response as fallback
45
45
  statusCode:(f===null||f===void 0?void 0:f.statusCode)||(e===null||e===void 0?void 0:e.responseStatus),startTime:(f===null||f===void 0?void 0:f.startTime)||(e===null||e===void 0?void 0:e.startTime),initiatorType:(f===null||f===void 0?void 0:f.initiatorType)||(e===null||e===void 0?void 0:e.initiatorType)}),n)};return l};var ze=function(e){// Has data or errors at root level
46
46
  return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"errors"in e&&// If errors exist, they should be an array with proper GraphQL error shape
47
47
  Array.isArray(e.errors)&&e.errors.every((function(e){return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"message"in e}))};
48
48
  // src/plugins/apiPerformancePlugin/type.ts
49
- var Be="awx_airtracker_api_performance_queue";var Ve="awx_airtracker_api_performance_plugin_loaded";
49
+ var Be="awx_airtracker_api_performance_queue";var We="awx_airtracker_api_performance_plugin_loaded";
50
50
  // src/plugins/apiPerformancePlugin/index.ts
51
- var We=300;var Xe=1e4;var Ge=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};Ge[Be]=Ge[Be]||[];var $e=function(e,n,t){setTimeout((function(){var r=qe(e,t);n.observerPipeline(r);Ge[Be]=Ge[Be].filter((function(n){return n.id!==e.id}))}),We)};var Je=function(e,n){setTimeout((function(){var t=Ge[Be].find((function(n){return n.id===e}));if(!t){return}var r=qe(t,{exceptionType:"timeout-without-response"});n.observerPipeline(r);Ge[Be]=Ge[Be].filter((function(n){return n.id!==e}))}),Xe)};var Qe=function(e){var n=XMLHttpRequest.prototype.open;var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function t(r,i,o,a,u){try{var s;var c=Ue();this.__requestId=c;var f=S(i,URL)?i.href:new URL(i,window.location.href).href;if(!Me(f,(s=e.config)===null||s===void 0?void 0:s.enableRecordAPIPerformanceWhitelist)){return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}var l={id:c,startTime:performance.now(),method:r,url:f,entries:[],initiatorType:"xmlhttprequest"};Ge[Be].push(l);Je(c,e);return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}catch(t){e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:t}});return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}};XMLHttpRequest.prototype.send=function n(){var r=this;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}try{var u=Ge[Be].find((function(e){return e.id===r.__requestId}));if(!u){return t.apply(this,o)}var s=this;this.addEventListener("loadend",b((function(){var n,t,r,i,o,a,c;return U(this,(function(f){switch(f.label){case 0:n=performance.now();t=n-u.startTime;r=s.status;if(r===0){return[2]}u.endTime=n;u.duration=t;u.responseStatus=r;f.label=1;case 1:f.trys.push([1,6,,7]);if(!(s.responseType===""||s.responseType==="text"))return[3,2];i=s.responseText;return[3,5];case 2:if(!(s.responseType==="json"))return[3,3];i=s.response;return[3,5];case 3:if(!(s.responseType==="blob"))return[3,5];o=s.response;if(!((o===null||o===void 0?void 0:o.type)==="application/json"))return[3,5];return[4,o.text()];case 4:i=f.sent();f.label=5;case 5:a=i&&typeof i==="string"?JSON.parse(i):i;if(a&&ze(a)){u.errorType="graphqlError";u.errorDetail=a.errors}return[3,7];case 6:c=f.sent();e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:u===null||u===void 0?void 0:u.url,error:c}});return[3,7];case 7:$e(u,e);return[2]}}))})));this.addEventListener("error",(function(){$e(u,e,{exceptionType:"network-error"})}));this.addEventListener("abort",(function(){$e(u,e,{exceptionType:"abort-error"})}));this.addEventListener("timeout",(function(){$e(u,e,{exceptionType:"timeout-error"})}));return t.apply(this,o)}catch(n){e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:n}});throw n}}};var Ye=function(e){var n=window.fetch;window.fetch=b((function(){var t,r,i,o,a,u,s,c,f,l,v,d,m,p,h,y;var w=arguments;return U(this,(function(g){switch(g.label){case 0:for(t=w.length,r=new Array(t),i=0;i<t;i++){r[i]=w[i]}u=new URL(S(r[0],Request)?r[0].url:String(r[0]),window.location.href).href;if(!!Me(u,(o=e.config)===null||o===void 0?void 0:o.enableRecordAPIPerformanceWhitelist))return[3,2];return[4,n.apply(this,r)];case 1:return[2,g.sent()];case 2:g.trys.push([2,9,,10]);c=performance.now();f=Ue();a={id:f,startTime:c,method:((s=S(r[0],Request)?r[0]:r[1])===null||s===void 0?void 0:s.method)||"GET",url:u,entries:[],initiatorType:"fetch"};Ge[Be].push(a);Je(f,e);return[4,n.apply(this,r)];case 3:l=g.sent();v=performance.now();a.endTime=v;a.duration=v-c;a.responseStatus=l.status;d=l.clone();g.label=4;case 4:g.trys.push([4,7,,8]);if(!d.ok)return[3,6];return[4,d.json()];case 5:m=g.sent();if(m&&ze(m)){a.errorType="graphqlError";a.errorDetail=m.errors}g.label=6;case 6:return[3,8];case 7:p=g.sent();e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a===null||a===void 0?void 0:a.url,error:p}});return[3,8];case 8:$e(a,e);return[2,l];case 9:h=g.sent();if(a&&a.id&&Ge[Be].find((function(e){return e.id===(a===null||a===void 0?void 0:a.id)}))){y="fetch-error";if(S(h,TypeError)){y="network-error"}else if(S(h,DOMException)&&h.name==="AbortError"){y="abort-error"}$e(a,e,{exceptionType:y})}else{e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:h}})}throw h;case 10:return[2]}}))}))};var Ze=function(e){var n;Qe(e);Ye(e);if((n=window)===null||n===void 0?void 0:n.PerformanceObserver){var t=new window.PerformanceObserver((function(e){var n=e.getEntries();n.forEach((function(e){var n=e;if(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest"){var t=Ge[Be].filter((function(e){return e.url===n.name}));t.forEach((function(e){e.entries.push(n)}))}}))}));t.observe({entryTypes:["resource"],buffered:true})}else{e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})}};var en=new be({name:"apiPerformancePlugin",setUp:function(){var e=b((function(e){var n,t;return U(this,(function(r){if(Ge[Ve]){return[2]}if(((n=e.config)===null||n===void 0?void 0:n.enableRecordAPIPerformance)&&Math.random()<(((t=e.config)===null||t===void 0?void 0:t.enableRecordAPIPerformancePercentage)||0)){Ge[Ve]=true;Ze(e)}return[2]}))}));return function(n){return e.apply(this,arguments)}}()});
51
+ var Ve=300;var Xe=1e4;var Ge=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};Ge[Be]=Ge[Be]||[];var $e=function(e,n,t){setTimeout((function(){var r=He(e,t);n.observerPipeline(r);Ge[Be]=Ge[Be].filter((function(n){return n.id!==e.id}))}),Ve)};var Je=function(e,n){setTimeout((function(){var t=Ge[Be].find((function(n){return n.id===e}));if(!t){return}var r=He(t,{exceptionType:"timeout-without-response"});n.observerPipeline(r);Ge[Be]=Ge[Be].filter((function(n){return n.id!==e}))}),Xe)};var Qe=function(e){var n=XMLHttpRequest.prototype.open;var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function t(r,i,o,a,u){try{var s;var c=Ue();this.__requestId=c;var f=S(i,URL)?i.href:new URL(i,window.location.href).href;if(!Me(f,(s=e.config)===null||s===void 0?void 0:s.enableRecordAPIPerformanceWhitelist)){return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}var l={id:c,startTime:performance.now(),method:r,url:f,entries:[],initiatorType:"xmlhttprequest"};Ge[Be].push(l);Je(c,e);return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}catch(t){e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:t}});return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}};XMLHttpRequest.prototype.send=function n(){var r=this;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}try{var u=Ge[Be].find((function(e){return e.id===r.__requestId}));if(!u){return t.apply(this,o)}var s=this;this.addEventListener("loadend",b((function(){var n,t,r,i,o,a,c;return U(this,(function(f){switch(f.label){case 0:n=performance.now();t=n-u.startTime;r=s.status;if(r===0){return[2]}u.endTime=n;u.duration=t;u.responseStatus=r;f.label=1;case 1:f.trys.push([1,6,,7]);if(!(s.responseType===""||s.responseType==="text"))return[3,2];i=s.responseText;return[3,5];case 2:if(!(s.responseType==="json"))return[3,3];i=s.response;return[3,5];case 3:if(!(s.responseType==="blob"))return[3,5];o=s.response;if(!((o===null||o===void 0?void 0:o.type)==="application/json"))return[3,5];return[4,o.text()];case 4:i=f.sent();f.label=5;case 5:a=i&&typeof i==="string"?JSON.parse(i):i;if(a&&ze(a)){u.errorType="graphqlError";u.errorDetail=a.errors}return[3,7];case 6:c=f.sent();e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:u===null||u===void 0?void 0:u.url,error:c}});return[3,7];case 7:$e(u,e);return[2]}}))})));this.addEventListener("error",(function(){$e(u,e,{exceptionType:"network-error"})}));this.addEventListener("abort",(function(){$e(u,e,{exceptionType:"abort-error"})}));this.addEventListener("timeout",(function(){$e(u,e,{exceptionType:"timeout-error"})}));return t.apply(this,o)}catch(n){e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:n}});throw n}}};var Ye=function(e){var n=window.fetch;window.fetch=b((function(){var t,r,i,o,a,u,s,c,f,l,v,d,m,p,h,y;var w=arguments;return U(this,(function(g){switch(g.label){case 0:for(t=w.length,r=new Array(t),i=0;i<t;i++){r[i]=w[i]}u=new URL(S(r[0],Request)?r[0].url:String(r[0]),window.location.href).href;if(!!Me(u,(o=e.config)===null||o===void 0?void 0:o.enableRecordAPIPerformanceWhitelist))return[3,2];return[4,n.apply(this,r)];case 1:return[2,g.sent()];case 2:g.trys.push([2,9,,10]);c=performance.now();f=Ue();a={id:f,startTime:c,method:((s=S(r[0],Request)?r[0]:r[1])===null||s===void 0?void 0:s.method)||"GET",url:u,entries:[],initiatorType:"fetch"};Ge[Be].push(a);Je(f,e);return[4,n.apply(this,r)];case 3:l=g.sent();v=performance.now();a.endTime=v;a.duration=v-c;a.responseStatus=l.status;d=l.clone();g.label=4;case 4:g.trys.push([4,7,,8]);if(!d.ok)return[3,6];return[4,d.json()];case 5:m=g.sent();if(m&&ze(m)){a.errorType="graphqlError";a.errorDetail=m.errors}g.label=6;case 6:return[3,8];case 7:p=g.sent();e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a===null||a===void 0?void 0:a.url,error:p}});return[3,8];case 8:$e(a,e);return[2,l];case 9:h=g.sent();if(a&&a.id&&Ge[Be].find((function(e){return e.id===(a===null||a===void 0?void 0:a.id)}))){y="fetch-error";if(S(h,TypeError)){y="network-error"}else if(S(h,DOMException)&&h.name==="AbortError"){y="abort-error"}$e(a,e,{exceptionType:y})}else{e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:h}})}throw h;case 10:return[2]}}))}))};var Ze=function(e){var n;Qe(e);Ye(e);if((n=window)===null||n===void 0?void 0:n.PerformanceObserver){var t=new window.PerformanceObserver((function(e){var n=e.getEntries();n.forEach((function(e){var n=e;if(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest"){var t=Ge[Be].filter((function(e){return e.url===n.name}));t.forEach((function(e){e.entries.push(n)}))}}))}));t.observe({entryTypes:["resource"],buffered:true})}else{e.normalLogPipeLine({severity:"warn"/* WARN */,eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})}};var en=new be({name:"apiPerformancePlugin",setUp:function(){var e=b((function(e){var n,t;return U(this,(function(r){if(Ge[We]){return[2]}if(((n=e.config)===null||n===void 0?void 0:n.enableRecordAPIPerformance)&&Math.random()<(((t=e.config)===null||t===void 0?void 0:t.enableRecordAPIPerformancePercentage)||0)){Ge[We]=true;Ze(e)}return[2]}))}));return function(n){return e.apply(this,arguments)}}()});
52
52
  // src/util/version.ts
53
53
  var nn="3.1.0";
54
54
  // src/airTracker.ts
55
- var tn=function(){function e(n){var t=this;var r=n.config,i=n.plugins,o=i===void 0?[]:i;k(this,e);this.config=K;this.lifeCycle=new ge;this.plugins=[];this._commonData=H;this._MFECommonDataMap={};
55
+ var tn=function(){function e(n){var t=this;var r=n.config,i=n.plugins,o=i===void 0?[]:i;k(this,e);this.config=K;this.lifeCycle=new ge;this.plugins=[];this._commonData=q;this._MFECommonDataMap={};
56
56
  // customized speed log
57
- this.timeMap={};this.packedDataConvert=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o,a;var u=P({severity:n,eventName:r,currentHref:t.config.hideSearchParams?(((o=location)===null||o===void 0?void 0:o.href)||"").split("?")[0]||"":((a=location)===null||a===void 0?void 0:a.href)||""},i);if(t.config.isWebappContainer){u.MFEName=Z(t)}return u};this.normalPipelineObj=we([pe(this,8),he(this),de(this)]);this.observerPipelineObj=we([pe(this,8),me(this)]);this.immediateSendPipe=de(this);this.observerPipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.observerPipelineObj(o)};this.normalLogPipeLine=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});if(t.config.disableThrottle){return t.immediateSendPipe(o)}else{return t.normalPipelineObj(o)}};this.ImmediatePipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.immediateSendPipe(o)};this.plugins=_(o);this.setConfig(r);this.initCommonData(r);this.lifeCycle.emit(W.onInit);if(r.enableErrorMonitoring){this.plugins.push(Se)}if((r===null||r===void 0?void 0:r.assetSpeedMonitoringWhiteList)&&r.assetSpeedMonitoringWhiteList.length>0||r.isWebappContainer){this.plugins.push(Oe)}if(r===null||r===void 0?void 0:r.enableDetectPageChange){this.plugins.push(_e)}if(r===null||r===void 0?void 0:r.enableRecordPageRetention){this.plugins.push(Le)}if((r===null||r===void 0?void 0:r.enableRecordAPIPerformance)&&(r===null||r===void 0?void 0:r.enableRecordAPIPerformancePercentage)&&r.enableRecordAPIPerformancePercentage>0&&r.enableRecordAPIPerformancePercentage<=1){this.plugins.push(en)}this.installPlugins()}E(e,[{key:"installPlugins",value:function e(){var n=this;this.plugins.forEach((function(e){e.patch(n)}))}},{key:"commonData",get:function e(){return this._commonData}},{key:"MFECommonDataMap",get:function e(){return this._MFECommonDataMap}},{key:"initCommonData",value:function e(n){this._commonData.sessionId=n.useSessionStorageForSessionId?ee():Y();this._commonData.deviceId=ne()||F;this._commonData.riskDeviceId=te();this._commonData.networkType=re()||"unknown"/* unknown */;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||F;this._commonData.appVersion=n.appVersion;this._commonData.appName=n.appName;this._commonData.sdkVersion=nn;this.lifeCycle.emit(W.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function e(n){this.lifeCycle.emit(W.onCommonUpdated,this._commonData);this._commonData.env=n.env||this._commonData.env;this._commonData.appName=n.appName||this._commonData.appName;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||this._commonData.accountId;this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{
57
+ this.timeMap={};this.packedDataConvert=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o,a;var u=P({severity:n,eventName:r,currentHref:t.config.hideSearchParams?(((o=location)===null||o===void 0?void 0:o.href)||"").split("?")[0]||"":((a=location)===null||a===void 0?void 0:a.href)||""},i);if(t.config.isWebappContainer){u.MFEName=Z(t)}return u};this.normalPipelineObj=we([pe(this,8),he(this),de(this)]);this.observerPipelineObj=we([pe(this,8),me(this)]);this.immediateSendPipe=de(this);this.observerPipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.observerPipelineObj(o)};this.normalLogPipeLine=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});if(t.config.disableThrottle){return t.immediateSendPipe(o)}else{return t.normalPipelineObj(o)}};this.ImmediatePipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.immediateSendPipe(o)};this.plugins=_(o);this.setConfig(r);this.initCommonData(r);this.lifeCycle.emit(V.onInit);if(r.enableErrorMonitoring){this.plugins.push(Se)}if((r===null||r===void 0?void 0:r.assetSpeedMonitoringWhiteList)&&r.assetSpeedMonitoringWhiteList.length>0||r.isWebappContainer){this.plugins.push(Re)}if(r===null||r===void 0?void 0:r.enableDetectPageChange){this.plugins.push(_e)}if(r===null||r===void 0?void 0:r.enableRecordPageRetention){this.plugins.push(Le)}if((r===null||r===void 0?void 0:r.enableRecordAPIPerformance)&&(r===null||r===void 0?void 0:r.enableRecordAPIPerformancePercentage)&&r.enableRecordAPIPerformancePercentage>0&&r.enableRecordAPIPerformancePercentage<=1){this.plugins.push(en)}this.installPlugins()}E(e,[{key:"installPlugins",value:function e(){var n=this;this.plugins.forEach((function(e){e.patch(n)}))}},{key:"commonData",get:function e(){return this._commonData}},{key:"MFECommonDataMap",get:function e(){return this._MFECommonDataMap}},{key:"initCommonData",value:function e(n){this._commonData.sessionId=n.useSessionStorageForSessionId?ee():Y();this._commonData.deviceId=ne()||F;this._commonData.riskDeviceId=te();this._commonData.networkType=re()||"unknown"/* unknown */;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||F;this._commonData.appVersion=n.appVersion;this._commonData.appName=n.appName;this._commonData.sdkVersion=nn;this.lifeCycle.emit(V.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function e(n){this.lifeCycle.emit(V.onCommonUpdated,this._commonData);this._commonData.env=n.env||this._commonData.env;this._commonData.appName=n.appName||this._commonData.appName;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||this._commonData.accountId;this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{
58
58
  // Can add extra common data based on developers' needs
59
- key:"updateCommonData",value:function e(n){this.lifeCycle.emit(W.onCommonUpdated,this._commonData);this._commonData=P({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function e(n){var t=this;this.lifeCycle.emit(W.onCommonUpdated,this._commonData);setTimeout((function(){n.forEach((function(e){delete t._commonData[e]}))}),1e3)}},{
59
+ key:"updateCommonData",value:function e(n){this.lifeCycle.emit(V.onCommonUpdated,this._commonData);this._commonData=P({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function e(n){var t=this;this.lifeCycle.emit(V.onCommonUpdated,this._commonData);setTimeout((function(){n.forEach((function(e){delete t._commonData[e]}))}),1e3)}},{
60
60
  // only worked if isWebappContainer is true
61
- key:"addToMFECommonData",value:function e(n){var t=n.MFEName,r=n.MFECommonData;var i;if(!this.config.isWebappContainer){return}if(!t||!r){return}this._MFECommonDataMap=O(P({},this._MFECommonDataMap||{}),I({},t,P({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[t])||{},r)))}},{
61
+ key:"addToMFECommonData",value:function e(n){var t=n.MFEName,r=n.MFECommonData;var i;if(!this.config.isWebappContainer){return}if(!t||!r){return}this._MFECommonDataMap=R(P({},this._MFECommonDataMap||{}),I({},t,P({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[t])||{},r)))}},{
62
62
  // support set config later
63
- key:"setConfig",value:function e(n){var t=this;if(this.config.isWebappContainer){return}var r=function(e,n){t.config[e]=n};Object.entries(n).forEach((function(e){var n=j(e,2),t=n[0],i=n[1];if((typeof i==="undefined"?"undefined":A(i))!==void 0){r(t,i)}}));this.lifeCycle.emit(W.onConfigInit,this.config);this.updateCommonDataBasedOnConfig(n)}},{
63
+ key:"setConfig",value:function e(n){var t=this;if(this.config.isWebappContainer){return}var r=function(e,n){t.config[e]=n};Object.entries(n).forEach((function(e){var n=j(e,2),t=n[0],i=n[1];if((typeof i==="undefined"?"undefined":A(i))!==void 0){r(t,i)}}));this.lifeCycle.emit(V.onConfigInit,this.config);this.updateCommonDataBasedOnConfig(n)}},{
64
64
  // send verbose level log
65
65
  key:"verbose",value:function e(n,t){this.normalLogPipeLine({severity:"verbose"/* VERBOSE */,eventName:n,extraInfo:t})}},{
66
66
  // send HTTP request log
@@ -73,11 +73,11 @@ key:"warn",value:function e(n,t){this.normalLogPipeLine({severity:"warn"/* WARN
73
73
  key:"error",value:function e(n,t){console.error("error",n);this.normalLogPipeLine({severity:"error"/* ERROR */,eventName:n,extraInfo:t})}},{
74
74
  // send business related log, usually used for data analysis
75
75
  // all the logs with isBusinessData == true, will be sync to bigQuery / looker
76
- key:"businessLog",value:function e(n,t){this.normalLogPipeLine({severity:"info"/* INFO */,eventName:n,extraInfo:O(P({},t),{isBusinessLog:true})})}},{
76
+ key:"businessLog",value:function e(n,t){this.normalLogPipeLine({severity:"info"/* INFO */,eventName:n,extraInfo:R(P({},t),{isBusinessLog:true})})}},{
77
77
  // duration: milliseconds
78
78
  key:"reportDuration",value:function e(n,t,r){if(typeof n!=="string"){console.warn("reportDuration: eventName (first param) must be a string");return}if(typeof t!=="number"){console.warn("reportDuration: duration (second param) must be number");return}if(t<0||t>6e4){console.warn("reportDuration: duration (second param) must between 0 and 60000");return}this.normalLogPipeLine({severity:"speed"/* SPEED */,eventName:n,extraInfo:P({duration:t},r)})}},{key:"getTimerKey",value:function e(n){var t=Z(this);return this.config.isWebappContainer?"".concat(t,"_").concat(n):n}},{key:"timeStart",value:function e(n){if(typeof n!=="string"){console.warn("time: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){console.warn("Timer ".concat(n," already exists"))}this.timeMap[this.getTimerKey(n)]=Date.now()}},{key:"timeEnd",value:function e(n,t){if(typeof n!=="string"){console.warn("timeEnd: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){var r=Date.now()-this.timeMap[this.getTimerKey(n)]+(t||0);this.normalLogPipeLine({severity:"speed"/* SPEED */,eventName:n,extraInfo:{duration:r}});delete this.timeMap[this.getTimerKey(n)]}else{console.warn("Timer key :".concat(n," does not exist"))}}},{
79
79
  // only worked if isWebappContainer is true
80
- key:"addToAssetSpeedWhiteListByMFE",value:function e(n){var t=n.MFEName,r=n.whiteList;var i;if(!this.config.isWebappContainer){return}if(!t||!(r===null||r===void 0?void 0:r.length)){return}if(!this.config.assetSpeedMonitoringWhiteListByMFE){this.config.assetSpeedMonitoringWhiteListByMFE={}}if(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0?void 0:i[t])){this.config.assetSpeedMonitoringWhiteListByMFE=O(P({},this.config.assetSpeedMonitoringWhiteListByMFE),I({},t,r))}else{var o;var a,u;(u=this.config.assetSpeedMonitoringWhiteListByMFE)===null||u===void 0?void 0:(a=u[t])===null||a===void 0?void 0:(o=a).push.apply(o,_(r))}}},{
80
+ key:"addToAssetSpeedWhiteListByMFE",value:function e(n){var t=n.MFEName,r=n.whiteList;var i;if(!this.config.isWebappContainer){return}if(!t||!(r===null||r===void 0?void 0:r.length)){return}if(!this.config.assetSpeedMonitoringWhiteListByMFE){this.config.assetSpeedMonitoringWhiteListByMFE={}}if(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0?void 0:i[t])){this.config.assetSpeedMonitoringWhiteListByMFE=R(P({},this.config.assetSpeedMonitoringWhiteListByMFE),I({},t,r))}else{var o;var a,u;(u=this.config.assetSpeedMonitoringWhiteListByMFE)===null||u===void 0?void 0:(a=u[t])===null||a===void 0?void 0:(o=a).push.apply(o,_(r))}}},{
81
81
  // please call destroy from your app root component when your app unmount
82
82
  key:"destroy",value:function e(){if(this.config.isWebappContainer){return}this.plugins.forEach((function(e){e.uninstall()}))}}]);return e}();
83
83
  // src/index.ts
@@ -96,7 +96,7 @@ var rn=tn;
96
96
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
97
97
  PERFORMANCE OF THIS SOFTWARE.
98
98
  ***************************************************************************** */
99
- /* global Reflect, Promise, SuppressedError, Symbol */var on=function(e,n){on=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return on(e,n)};function an(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");on(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var un=function(){un=Object.assign||function e(n){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))n[o]=t[o]}return n};return un.apply(this,arguments)};function sn(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(n,t){function o(e){try{u(r.next(e))}catch(e){t(e)}}function a(e){try{u(r["throw"](e))}catch(e){t(e)}}function u(e){e.done?n(e.value):i(e.value).then(o,a)}u((r=r.apply(e,[])).next())}))}function cn(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}function fn(e,n,t){for(var r=0,i=n.length,o;r<i;r++){if(o||!(r in n)){if(!o)o=Array.prototype.slice.call(n,0,r);o[r]=n[r]}}return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError==="function"?SuppressedError:function(e,n,t){var r=new Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};var ln="1.35.0";var vn={version:ln};var dn={dev:M.staging,staging:M.staging,demo:M.demo,prod:M.production};var mn=function(e,n){if(e===void 0){e=M.production}if(!window._AirwallexSDKs.airTracker){window._AirwallexSDKs.airTracker=new rn({config:{appName:"components-sdk",appVersion:vn.version,env:dn[e]||M.production}});window._AirwallexSDKs.airTracker.updateCommonData({clientId:n})}return window._AirwallexSDKs.airTracker};var pn=function(e){if(typeof e!=="object"){return e}try{var n=JSON.parse(JSON.stringify(e));Object.keys(n).forEach((function(e){if(typeof e==="string"&&["auth","code"].some((function(n){return e.includes(n)}))){n[e]="***"}}));return n}catch(n){return e}};var hn=function(e,n){var t,r;(r=(t=window._AirwallexSDKs)===null||t===void 0?void 0:t.airTracker)===null||r===void 0?void 0:r.error(e,un(un({},n),{context:"components-sdk"}))};var yn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.warn(e,un(un({},n),{context:"components-sdk"}))};var wn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.info(e,un(un({},n),{context:"components-sdk"}))};var gn=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="LOAD_SCRIPT_ERROR";return t}return n}(Error);var bn,kn;var xn;(function(e){e["dev"]="dev";e["staging"]="staging";e["demo"]="demo";e["prod"]="prod";e["sandbox"]="sandbox"})(xn||(xn={}));var En=(bn={},bn[xn.dev]="https://checkout-staging.airwallex.com",bn[xn.staging]="https://checkout-staging.airwallex.com",bn[xn.demo]="https://checkout-demo.airwallex.com",bn[xn.prod]="https://checkout.airwallex.com",bn[xn.sandbox]="https://checkout.sandbox.airwallex.com",bn);var In=(kn={},kn[xn.dev]="https://static-staging.airwallex.com",kn[xn.staging]="https://static-staging.airwallex.com",kn[xn.demo]="https://static-demo.airwallex.com",kn[xn.prod]="https://static.airwallex.com",kn[xn.sandbox]="https://static.sandbox.airwallex.com",kn);var Sn="sdkController";var Nn="payments";var Cn={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"};var Tn={
99
+ /* global Reflect, Promise, SuppressedError, Symbol */var on=function(e,n){on=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return on(e,n)};function an(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");on(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var un=function(){un=Object.assign||function e(n){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))n[o]=t[o]}return n};return un.apply(this,arguments)};function sn(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(n,t){function o(e){try{u(r.next(e))}catch(e){t(e)}}function a(e){try{u(r["throw"](e))}catch(e){t(e)}}function u(e){e.done?n(e.value):i(e.value).then(o,a)}u((r=r.apply(e,[])).next())}))}function cn(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}function fn(e,n,t){for(var r=0,i=n.length,o;r<i;r++){if(o||!(r in n)){if(!o)o=Array.prototype.slice.call(n,0,r);o[r]=n[r]}}return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError==="function"?SuppressedError:function(e,n,t){var r=new Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};var ln="1.35.0";var vn={version:ln};var dn={dev:M.staging,staging:M.staging,demo:M.demo,prod:M.production};var mn=function(e,n){if(e===void 0){e=M.production}if(!window._AirwallexSDKs.airTracker){window._AirwallexSDKs.airTracker=new rn({config:{appName:"components-sdk",appVersion:vn.version,env:dn[e]||M.production}});window._AirwallexSDKs.airTracker.updateCommonData({clientId:n})}return window._AirwallexSDKs.airTracker};var pn=function(e){if(typeof e!=="object"){return e}try{var n=JSON.parse(JSON.stringify(e));Object.keys(n).forEach((function(e){if(typeof e==="string"&&["auth","code"].some((function(n){return e.includes(n)}))){n[e]="***"}}));return n}catch(n){return e}};var hn=function(e,n){var t,r;(r=(t=window._AirwallexSDKs)===null||t===void 0?void 0:t.airTracker)===null||r===void 0?void 0:r.error(e,un(un({},n),{context:"components-sdk"}))};var yn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.warn(e,un(un({},n),{context:"components-sdk"}))};var wn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.info(e,un(un({},n),{context:"components-sdk"}))};var gn=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="LOAD_SCRIPT_ERROR";return t}return n}(Error);var bn,kn;var xn;(function(e){e["dev"]="dev";e["staging"]="staging";e["demo"]="demo";e["prod"]="prod";e["sandbox"]="sandbox"})(xn||(xn={}));var En=(bn={},bn[xn.dev]="https://checkout-staging.airwallex.com",bn[xn.staging]="https://checkout-staging.airwallex.com",bn[xn.demo]="https://checkout-demo.airwallex.com",bn[xn.prod]="https://checkout.airwallex.com",bn[xn.sandbox]="https://checkout.sandbox.airwallex.com",bn);var In=(kn={},kn[xn.dev]="https://static-staging.airwallex.com",kn[xn.staging]="https://static-staging.airwallex.com",kn[xn.demo]="https://static-demo.airwallex.com",kn[xn.prod]="https://static.airwallex.com",kn[xn.sandbox]="https://static.sandbox.airwallex.com",kn);var Sn="sdkController";var Nn="payments";var Cn={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"};var Dn={
100
100
  // legacy
101
101
  kyc:"kyc",paymentsKyb:"paymentsKyb",
102
102
  // rfi elements
@@ -108,20 +108,20 @@ hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments
108
108
  // sca elements
109
109
  scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",
110
110
  // billing elements
111
- embeddedCheckout:"billing"};var Dn={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]};var Pn={billing:["payments"]};var Rn=["payments","sca","billing"];var On=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INVALID_STATIC_RESOURCE_ERROR";return t}return n}(Error);var jn=Date.now();var _n=function(e){return Object.keys(Dn).includes(e)};var An=function(e){if(e===void 0){e=500}return new Promise((function(n){return window.setTimeout(n,e)}))};var Ln=function(e){return Tn[e]};var Un=function(e,n){var t=e===Nn?En:In;return t[n]||t.prod};
111
+ embeddedCheckout:"billing"};var Tn={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]};var Pn={billing:["payments"]};var On=["payments","sca","billing"];var Rn=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INVALID_STATIC_RESOURCE_ERROR";return t}return n}(Error);var jn=Date.now();var _n=function(e){return Object.keys(Tn).includes(e)};var An=function(e){if(e===void 0){e=500}return new Promise((function(n){return window.setTimeout(n,e)}))};var Ln=function(e){return Dn[e]};var Un=function(e,n){var t=e===Nn?En:In;return t[n]||t.prod};
112
112
  /**
113
113
  * get the elements and sdks that need registry by controller
114
114
  * @param enabledElements the enabledElements passed in init params
115
115
  * @returns array of deduplicated elementName pair with sdkName
116
116
  */var Mn=function(e){
117
117
  // e.g., ['hpp', 'payoutForm', 'kyc', 'kyc']
118
- var n=e.reduce((function(e,n){return e.concat(_n(n)?Dn[n]:n)}),[]);return Array.from(new Set(n)).map((function(e){return{elementName:e,sdkName:Ln(e)}}))};var Fn=function(e){return Array.from(new Set(Mn(e).map((function(e){var n=e.sdkName;return n})).filter((function(e){return Rn.includes(e)}))))};var Kn=function(e){return e==="payments"?"payment":e};
118
+ var n=e.reduce((function(e,n){return e.concat(_n(n)?Tn[n]:n)}),[]);return Array.from(new Set(n)).map((function(e){return{elementName:e,sdkName:Ln(e)}}))};var Fn=function(e){return Array.from(new Set(Mn(e).map((function(e){var n=e.sdkName;return n})).filter((function(e){return On.includes(e)}))))};var Kn=function(e){return e==="payments"?"payment":e};
119
119
  /**
120
120
  * get the CDN url of a specific package
121
121
  * @param name declare the element name
122
122
  * @param env the environment of package
123
123
  * @returns string the CDN url
124
- */var Hn=function(e){var n=e.name,t=e.env,r=t===void 0?xn.prod:t;var i=Un(n,r);var o=Cn[n];if(!o){hn("[components-sdk] Element static resource not found",{sdkName:n});throw new On("Element ".concat(n," static resource URL is invalid."))}return"".concat(i).concat(o,"?ts=").concat(jn)};var qn=function(){return Rn.reduce((function(e,n){var t;return un(un({},e),(t={},t[n]=window._AirwallexSDKs.__controller__.internalSDKs[n],t))}),{})};var zn=function(e){return Pn[e]||[]};var Bn=function(){return Math.floor(performance.now())};var Vn=function(e){var n=document.createElement("script");n.src=e;n.type="module";var t=document.head||document.body;t.appendChild(n);return n};var Wn=3;var Xn=function(e){return sn(void 0,void 0,void 0,(function(){var n,t;return cn(this,(function(r){switch(r.label){case 0:if(typeof window==="undefined"){throw new Error("Please load script in browser environment")}n=0;t=function(){return sn(void 0,void 0,void 0,(function(){var t,r,i;return cn(this,(function(o){t=Bn();if(n>0&&e.includes("?ts=")){r=new URL(e,window.location.href);r.searchParams.set("ts","".concat(Date.now()));e=r.toString()}i=Vn(e);return[2/*return*/,new Promise((function(r,o){i.addEventListener("load",(function(){var i=Bn();wn("[components-sdk] SDK script loaded",{scriptUrl:e,start:t,latency:i-t,end:i,retryCount:n});r(true)}));i.addEventListener("error",(function(r){i.remove();console.error(r);var a=Bn();hn("[components-sdk] Failed to load script",{scriptUrl:e,error:r,start:t,latency:a-t,end:a,retryCount:n});o(new gn("Failed to load Airwallex SDK scripts: ".concat(e)))}))}))]}))}))};r.label=1;case 1:if(!(n<Wn))return[3/*break*/,7];r.label=2;case 2:r.trys.push([2,4,,6]);return[4/*yield*/,t()];case 3:return[2/*return*/,r.sent()];case 4:r.sent();n++;return[4/*yield*/,An()];case 5:r.sent();return[3/*break*/,6];case 6:return[3/*break*/,1];case 7:hn("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:n});throw new gn("Failed to load Airwallex SDK scripts: ".concat(e))}}))}))};var Gn=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INSTANCE_NOT_FOUND_ERROR";return t}return n}(Error);var $n;
124
+ */var qn=function(e){var n=e.name,t=e.env,r=t===void 0?xn.prod:t;var i=Un(n,r);var o=Cn[n];if(!o){hn("[components-sdk] Element static resource not found",{sdkName:n});throw new Rn("Element ".concat(n," static resource URL is invalid."))}return"".concat(i).concat(o,"?ts=").concat(jn)};var Hn=function(){return On.reduce((function(e,n){var t;return un(un({},e),(t={},t[n]=window._AirwallexSDKs.__controller__.internalSDKs[n],t))}),{})};var zn=function(e){return Pn[e]||[]};var Bn=function(){return Math.floor(performance.now())};var Wn=function(e){var n=document.createElement("script");n.src=e;n.type="module";var t=document.head||document.body;t.appendChild(n);return n};var Vn=3;var Xn=function(e){return sn(void 0,void 0,void 0,(function(){var n,t;return cn(this,(function(r){switch(r.label){case 0:if(typeof window==="undefined"){throw new Error("Please load script in browser environment")}n=0;t=function(){return sn(void 0,void 0,void 0,(function(){var t,r,i;return cn(this,(function(o){t=Bn();if(n>0&&e.includes("?ts=")){r=new URL(e,window.location.href);r.searchParams.set("ts","".concat(Date.now()));e=r.toString()}i=Wn(e);return[2/*return*/,new Promise((function(r,o){i.addEventListener("load",(function(){var i=Bn();wn("[components-sdk] SDK script loaded",{scriptUrl:e,start:t,latency:i-t,end:i,retryCount:n});r(true)}));i.addEventListener("error",(function(r){i.remove();console.error(r);var a=Bn();hn("[components-sdk] Failed to load script",{scriptUrl:e,error:r,start:t,latency:a-t,end:a,retryCount:n});o(new gn("Failed to load Airwallex SDK scripts: ".concat(e)))}))}))]}))}))};r.label=1;case 1:if(!(n<Vn))return[3/*break*/,7];r.label=2;case 2:r.trys.push([2,4,,6]);return[4/*yield*/,t()];case 3:return[2/*return*/,r.sent()];case 4:r.sent();n++;return[4/*yield*/,An()];case 5:r.sent();return[3/*break*/,6];case 6:return[3/*break*/,1];case 7:hn("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:n});throw new gn("Failed to load Airwallex SDK scripts: ".concat(e))}}))}))};var Gn=/** @class */function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INSTANCE_NOT_FOUND_ERROR";return t}return n}(Error);var $n;
125
125
  /**
126
126
  * ensure one script one promise
127
127
  */var Jn=new Map;
@@ -130,7 +130,7 @@ var n=e.reduce((function(e,n){return e.concat(_n(n)?Dn[n]:n)}),[]);return Array.
130
130
  * @param scriptName declare the SDK or Functions namespace
131
131
  * @param env the resource url
132
132
  * @returns Promise to load the script
133
- */var Qn=function(e){var n=e.env,t=e.scriptName;var r=Hn({name:t,env:n});
133
+ */var Qn=function(e){var n=e.env,t=e.scriptName;var r=qn({name:t,env:n});
134
134
  // if promise was made
135
135
  var i=Jn.get(t);if(i){return i}var o=Xn(r);Jn.set(t,o);return o};
136
136
  /**
@@ -153,7 +153,7 @@ var a=(r=e.enabledElements)!==null&&r!==void 0?r:[];var u=Fn(a);
153
153
  // load SDK functions scripts
154
154
  var s=u.map((function(e){return Yn({env:i.env,scriptName:e}).then((function(){return o})).then((function(){var n=window._AirwallexSDKs[Kn(e)];if(!n){hn("[components-sdk] SDK instance not found",{functionsNamespace:e,windowSDKInstanceName:Kn(e)});throw new Gn("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerFunctions({functionsNamespace:e,instance:n})}))}));
155
155
  // load SDK elements scripts
156
- var c=Mn(a);var f=c.map((function(e){var n=e.sdkName,t=e.elementName;return Yn({scriptName:n,env:i.env}).then((function(){return o})).then((function(){var e=window._AirwallexSDKs[Kn(n)];if(!e){hn("[components-sdk] SDK instance not found",{sdkName:n,windowSDKInstanceName:Kn(n)});throw new Gn("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:t,instance:e})}))}));Promise.all(fn(fn([o],s,true),f)).then((function(){wn("[components-sdk] SDK initialized",{options:pn(e),start:Bn()});n(qn())}))["catch"]((function(e){if(!e.code){hn("[components-sdk] Unexpected errors when init",{error:e})}t(e)}))}));return[2/*return*/,$n]}))}))};
156
+ var c=Mn(a);var f=c.map((function(e){var n=e.sdkName,t=e.elementName;return Yn({scriptName:n,env:i.env}).then((function(){return o})).then((function(){var e=window._AirwallexSDKs[Kn(n)];if(!e){hn("[components-sdk] SDK instance not found",{sdkName:n,windowSDKInstanceName:Kn(n)});throw new Gn("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:t,instance:e})}))}));Promise.all(fn(fn([o],s,true),f)).then((function(){wn("[components-sdk] SDK initialized",{options:pn(e),start:Bn()});n(Hn())}))["catch"]((function(e){if(!e.code){hn("[components-sdk] Unexpected errors when init",{error:e})}t(e)}))}));return[2/*return*/,$n]}))}))};
157
157
  /**
158
158
  * load SDK element script and call SDK instance.createElement.
159
159
  * @param elementName the element name to create
@@ -165,7 +165,7 @@ var c=Mn(a);var f=c.map((function(e){var n=e.sdkName,t=e.elementName;return Yn({
165
165
  */var nt=[Sn,Nn];
166
166
  /**
167
167
  * Prefetch scripts by preload link, only for production as there's no environment context before SDK init
168
- */var tt=function(){nt.forEach((function(e){var n=Hn({name:e,env:xn.prod});var t=document.createElement("link");t.href=n;t.rel="modulepreload";t.as="script";var r=document.head||document.body;r.appendChild(t)}))};
168
+ */var tt=function(){nt.forEach((function(e){var n=qn({name:e,env:xn.prod});var t=document.createElement("link");t.href=n;t.rel="modulepreload";t.as="script";var r=document.head||document.body;r.appendChild(t)}))};
169
169
  /**
170
170
  * @airwallex/components-sdk may run in node environment, e.g., in Next.js
171
171
  * Prefetch scripts only in browser environment