stripe-pwa-elements 3.0.0-0 → 3.0.0

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 (1568) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  3. package/dist/cjs/index-BmB5d_Yj.js +194 -0
  4. package/dist/cjs/index-BmB5d_Yj.js.map +1 -0
  5. package/dist/cjs/index-CQkz7IJv.js +1904 -0
  6. package/dist/cjs/index-CQkz7IJv.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +1 -2
  8. package/dist/cjs/index.cjs.js.map +1 -1
  9. package/dist/cjs/ion-icon.cjs.entry.js +339 -252
  10. package/dist/cjs/ion-icon.entry.cjs.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +7 -17
  12. package/dist/cjs/loader.cjs.js.map +1 -1
  13. package/dist/cjs/stripe-card-element-modal.cjs.entry.js +111 -0
  14. package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +1 -0
  15. package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +1 -0
  16. package/dist/cjs/stripe-card-element_2.cjs.entry.js +3677 -0
  17. package/dist/cjs/stripe-elements.cjs.js +16 -18
  18. package/dist/cjs/stripe-elements.cjs.js.map +1 -1
  19. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +170 -162
  20. package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +1 -0
  21. package/dist/collection/collection-manifest.json +6 -6
  22. package/dist/collection/components/{stripe-payment-sheet/stripe-payment-sheet.css → stripe-card-element/stripe-card-element.css} +6 -4
  23. package/dist/collection/components/stripe-card-element/stripe-card-element.js +878 -0
  24. package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +1 -0
  25. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +547 -0
  26. package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +1 -0
  27. package/dist/collection/components/stripe-modal/stripe-modal.js +177 -0
  28. package/dist/collection/components/stripe-modal/stripe-modal.js.map +1 -0
  29. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +539 -500
  30. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +1 -1
  31. package/dist/collection/index.js +1 -1
  32. package/dist/collection/interfaces.js.map +1 -1
  33. package/dist/collection/services/card-element-manager.js +147 -0
  34. package/dist/collection/services/card-element-manager.js.map +1 -0
  35. package/dist/collection/services/factory.js +28 -0
  36. package/dist/collection/services/factory.js.map +1 -0
  37. package/dist/collection/services/interfaces.js +2 -0
  38. package/dist/collection/services/interfaces.js.map +1 -0
  39. package/dist/collection/services/stripe-service.js +118 -0
  40. package/dist/collection/services/stripe-service.js.map +1 -0
  41. package/dist/collection/utils/error.js +12 -0
  42. package/dist/collection/utils/error.js.map +1 -0
  43. package/dist/collection/utils/i18n.js +40 -40
  44. package/dist/collection/utils/i18n.js.map +1 -1
  45. package/dist/collection/utils/platform.js +51 -51
  46. package/dist/collection/utils/platform.js.map +1 -1
  47. package/dist/collection/utils/utils.js +22 -22
  48. package/dist/collection/utils/utils.js.map +1 -1
  49. package/dist/components/icon.js +375 -276
  50. package/dist/components/icon.js.map +1 -1
  51. package/dist/components/index.d.ts +6 -0
  52. package/dist/components/index.js +2 -1
  53. package/dist/components/ion-icon.js +1 -0
  54. package/dist/components/stripe-card-element-modal.d.ts +11 -0
  55. package/dist/components/stripe-card-element-modal.js +174 -0
  56. package/dist/components/stripe-card-element-modal.js.map +1 -0
  57. package/dist/components/{stripe-payment.d.ts → stripe-card-element.d.ts} +4 -4
  58. package/dist/components/stripe-card-element.js +9 -0
  59. package/dist/components/stripe-card-element.js.map +1 -0
  60. package/dist/components/stripe-card-element2.js +3586 -0
  61. package/dist/components/stripe-card-element2.js.map +1 -0
  62. package/dist/components/{stripe-sheet.d.ts → stripe-modal.d.ts} +4 -4
  63. package/dist/components/stripe-modal.js +9 -0
  64. package/dist/components/stripe-modal.js.map +1 -0
  65. package/dist/components/stripe-modal2.js +87 -0
  66. package/dist/components/stripe-modal2.js.map +1 -0
  67. package/dist/components/stripe-payment-request-button.d.ts +2 -2
  68. package/dist/components/stripe-payment-request-button.js +1 -0
  69. package/dist/components/stripe-payment-request-button2.js +299 -225
  70. package/dist/components/stripe-payment-request-button2.js.map +1 -1
  71. package/dist/components/utils.js +54 -70
  72. package/dist/components/utils.js.map +1 -1
  73. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  74. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  75. package/dist/esm/index-C5QyifTT.js +192 -0
  76. package/dist/esm/index-C5QyifTT.js.map +1 -0
  77. package/dist/esm/index-DB2hiILr.js +1892 -0
  78. package/dist/esm/index-DB2hiILr.js.map +1 -0
  79. package/dist/esm/index.js +1 -2
  80. package/dist/esm/index.js.map +1 -1
  81. package/dist/esm/ion-icon.entry.js +339 -250
  82. package/dist/esm/ion-icon.entry.js.map +1 -1
  83. package/dist/esm/loader.js +9 -17
  84. package/dist/esm/loader.js.map +1 -1
  85. package/dist/esm/stripe-card-element-modal.entry.js +109 -0
  86. package/dist/esm/stripe-card-element-modal.entry.js.map +1 -0
  87. package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +1 -0
  88. package/dist/esm/stripe-card-element_2.entry.js +3674 -0
  89. package/dist/esm/stripe-elements.js +16 -17
  90. package/dist/esm/stripe-elements.js.map +1 -1
  91. package/dist/esm/stripe-payment-request-button.entry.js +170 -160
  92. package/dist/esm/stripe-payment-request-button.entry.js.map +1 -1
  93. package/dist/stripe-elements/index.esm.js.map +1 -1
  94. package/dist/stripe-elements/ion-icon.entry.esm.js.map +1 -0
  95. package/dist/stripe-elements/loader.esm.js.map +1 -0
  96. package/dist/stripe-elements/p-263cf51d.entry.js +2 -0
  97. package/dist/stripe-elements/p-263cf51d.entry.js.map +1 -0
  98. package/dist/stripe-elements/p-5beb3870.entry.js +2 -0
  99. package/dist/stripe-elements/p-5beb3870.entry.js.map +1 -0
  100. package/dist/stripe-elements/p-C5QyifTT.js +2 -0
  101. package/dist/stripe-elements/p-C5QyifTT.js.map +1 -0
  102. package/dist/stripe-elements/p-DB2hiILr.js +3 -0
  103. package/dist/stripe-elements/p-DB2hiILr.js.map +1 -0
  104. package/dist/stripe-elements/p-DQuL1Twl.js +2 -0
  105. package/dist/stripe-elements/p-DQuL1Twl.js.map +1 -0
  106. package/dist/stripe-elements/p-b598431f.entry.js +2 -0
  107. package/dist/stripe-elements/p-b598431f.entry.js.map +1 -0
  108. package/dist/stripe-elements/p-bb923a08.entry.js +2 -0
  109. package/dist/stripe-elements/p-bb923a08.entry.js.map +1 -0
  110. package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +1 -0
  111. package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +1 -0
  112. package/dist/stripe-elements/stripe-elements.esm.js +1 -1
  113. package/dist/stripe-elements/stripe-elements.esm.js.map +1 -1
  114. package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +1 -0
  115. package/dist/stripe-elements/svg/accessibility-outline.svg +1 -1
  116. package/dist/stripe-elements/svg/accessibility-sharp.svg +1 -1
  117. package/dist/stripe-elements/svg/accessibility.svg +1 -1
  118. package/dist/stripe-elements/svg/add-circle-outline.svg +1 -1
  119. package/dist/stripe-elements/svg/add-circle-sharp.svg +1 -1
  120. package/dist/stripe-elements/svg/add-circle.svg +1 -1
  121. package/dist/stripe-elements/svg/add-outline.svg +1 -1
  122. package/dist/stripe-elements/svg/add-sharp.svg +1 -1
  123. package/dist/stripe-elements/svg/add.svg +1 -1
  124. package/dist/stripe-elements/svg/airplane-outline.svg +1 -1
  125. package/dist/stripe-elements/svg/airplane-sharp.svg +1 -1
  126. package/dist/stripe-elements/svg/airplane.svg +1 -1
  127. package/dist/stripe-elements/svg/alarm-outline.svg +1 -1
  128. package/dist/stripe-elements/svg/alarm-sharp.svg +1 -1
  129. package/dist/stripe-elements/svg/alarm.svg +1 -1
  130. package/dist/stripe-elements/svg/albums-outline.svg +1 -1
  131. package/dist/stripe-elements/svg/albums-sharp.svg +1 -1
  132. package/dist/stripe-elements/svg/albums.svg +1 -1
  133. package/dist/stripe-elements/svg/alert-circle-outline.svg +1 -1
  134. package/dist/stripe-elements/svg/alert-circle-sharp.svg +1 -1
  135. package/dist/stripe-elements/svg/alert-circle.svg +1 -1
  136. package/dist/stripe-elements/svg/alert-outline.svg +1 -1
  137. package/dist/stripe-elements/svg/alert-sharp.svg +1 -1
  138. package/dist/stripe-elements/svg/alert.svg +1 -1
  139. package/dist/stripe-elements/svg/american-football-outline.svg +1 -1
  140. package/dist/stripe-elements/svg/american-football-sharp.svg +1 -1
  141. package/dist/stripe-elements/svg/american-football.svg +1 -1
  142. package/dist/stripe-elements/svg/analytics-outline.svg +1 -1
  143. package/dist/stripe-elements/svg/analytics-sharp.svg +1 -1
  144. package/dist/stripe-elements/svg/analytics.svg +1 -1
  145. package/dist/stripe-elements/svg/aperture-outline.svg +1 -1
  146. package/dist/stripe-elements/svg/aperture-sharp.svg +1 -1
  147. package/dist/stripe-elements/svg/aperture.svg +1 -1
  148. package/dist/stripe-elements/svg/apps-outline.svg +1 -1
  149. package/dist/stripe-elements/svg/apps-sharp.svg +1 -1
  150. package/dist/stripe-elements/svg/apps.svg +1 -1
  151. package/dist/stripe-elements/svg/archive-outline.svg +1 -1
  152. package/dist/stripe-elements/svg/archive-sharp.svg +1 -1
  153. package/dist/stripe-elements/svg/archive.svg +1 -1
  154. package/dist/stripe-elements/svg/arrow-back-circle-outline.svg +1 -1
  155. package/dist/stripe-elements/svg/arrow-back-circle-sharp.svg +1 -1
  156. package/dist/stripe-elements/svg/arrow-back-circle.svg +1 -1
  157. package/dist/stripe-elements/svg/arrow-back-outline.svg +1 -1
  158. package/dist/stripe-elements/svg/arrow-back-sharp.svg +1 -1
  159. package/dist/stripe-elements/svg/arrow-back.svg +1 -1
  160. package/dist/stripe-elements/svg/arrow-down-circle-outline.svg +1 -1
  161. package/dist/stripe-elements/svg/arrow-down-circle-sharp.svg +1 -1
  162. package/dist/stripe-elements/svg/arrow-down-circle.svg +1 -1
  163. package/dist/stripe-elements/svg/arrow-down-left-box-outline.svg +1 -0
  164. package/dist/stripe-elements/svg/arrow-down-left-box-sharp.svg +1 -0
  165. package/dist/stripe-elements/svg/arrow-down-left-box.svg +1 -0
  166. package/dist/stripe-elements/svg/arrow-down-outline.svg +1 -1
  167. package/dist/stripe-elements/svg/arrow-down-right-box-outline.svg +1 -0
  168. package/dist/stripe-elements/svg/arrow-down-right-box-sharp.svg +1 -0
  169. package/dist/stripe-elements/svg/arrow-down-right-box.svg +1 -0
  170. package/dist/stripe-elements/svg/arrow-down-sharp.svg +1 -1
  171. package/dist/stripe-elements/svg/arrow-down.svg +1 -1
  172. package/dist/stripe-elements/svg/arrow-forward-circle-outline.svg +1 -1
  173. package/dist/stripe-elements/svg/arrow-forward-circle-sharp.svg +1 -1
  174. package/dist/stripe-elements/svg/arrow-forward-circle.svg +1 -1
  175. package/dist/stripe-elements/svg/arrow-forward-outline.svg +1 -1
  176. package/dist/stripe-elements/svg/arrow-forward-sharp.svg +1 -1
  177. package/dist/stripe-elements/svg/arrow-forward.svg +1 -1
  178. package/dist/stripe-elements/svg/arrow-redo-circle-outline.svg +1 -1
  179. package/dist/stripe-elements/svg/arrow-redo-circle-sharp.svg +1 -1
  180. package/dist/stripe-elements/svg/arrow-redo-circle.svg +1 -1
  181. package/dist/stripe-elements/svg/arrow-redo-outline.svg +1 -1
  182. package/dist/stripe-elements/svg/arrow-redo-sharp.svg +1 -1
  183. package/dist/stripe-elements/svg/arrow-redo.svg +1 -1
  184. package/dist/stripe-elements/svg/arrow-undo-circle-outline.svg +1 -1
  185. package/dist/stripe-elements/svg/arrow-undo-circle-sharp.svg +1 -1
  186. package/dist/stripe-elements/svg/arrow-undo-circle.svg +1 -1
  187. package/dist/stripe-elements/svg/arrow-undo-outline.svg +1 -1
  188. package/dist/stripe-elements/svg/arrow-undo-sharp.svg +1 -1
  189. package/dist/stripe-elements/svg/arrow-undo.svg +1 -1
  190. package/dist/stripe-elements/svg/arrow-up-circle-outline.svg +1 -1
  191. package/dist/stripe-elements/svg/arrow-up-circle-sharp.svg +1 -1
  192. package/dist/stripe-elements/svg/arrow-up-circle.svg +1 -1
  193. package/dist/stripe-elements/svg/arrow-up-left-box-outline.svg +1 -0
  194. package/dist/stripe-elements/svg/arrow-up-left-box-sharp.svg +1 -0
  195. package/dist/stripe-elements/svg/arrow-up-left-box.svg +1 -0
  196. package/dist/stripe-elements/svg/arrow-up-outline.svg +1 -1
  197. package/dist/stripe-elements/svg/arrow-up-right-box-outline.svg +1 -0
  198. package/dist/stripe-elements/svg/arrow-up-right-box-sharp.svg +1 -0
  199. package/dist/stripe-elements/svg/arrow-up-right-box.svg +1 -0
  200. package/dist/stripe-elements/svg/arrow-up-sharp.svg +1 -1
  201. package/dist/stripe-elements/svg/arrow-up.svg +1 -1
  202. package/dist/stripe-elements/svg/at-circle-outline.svg +1 -1
  203. package/dist/stripe-elements/svg/at-circle-sharp.svg +1 -1
  204. package/dist/stripe-elements/svg/at-circle.svg +1 -1
  205. package/dist/stripe-elements/svg/at-outline.svg +1 -1
  206. package/dist/stripe-elements/svg/at-sharp.svg +1 -1
  207. package/dist/stripe-elements/svg/at.svg +1 -1
  208. package/dist/stripe-elements/svg/attach-outline.svg +1 -1
  209. package/dist/stripe-elements/svg/attach-sharp.svg +1 -1
  210. package/dist/stripe-elements/svg/attach.svg +1 -1
  211. package/dist/stripe-elements/svg/backspace-outline.svg +1 -1
  212. package/dist/stripe-elements/svg/backspace-sharp.svg +1 -1
  213. package/dist/stripe-elements/svg/backspace.svg +1 -1
  214. package/dist/stripe-elements/svg/bag-add-outline.svg +1 -1
  215. package/dist/stripe-elements/svg/bag-add-sharp.svg +1 -1
  216. package/dist/stripe-elements/svg/bag-add.svg +1 -1
  217. package/dist/stripe-elements/svg/bag-check-outline.svg +1 -1
  218. package/dist/stripe-elements/svg/bag-check-sharp.svg +1 -1
  219. package/dist/stripe-elements/svg/bag-check.svg +1 -1
  220. package/dist/stripe-elements/svg/bag-handle-outline.svg +1 -1
  221. package/dist/stripe-elements/svg/bag-handle-sharp.svg +1 -1
  222. package/dist/stripe-elements/svg/bag-handle.svg +1 -1
  223. package/dist/stripe-elements/svg/bag-outline.svg +1 -1
  224. package/dist/stripe-elements/svg/bag-remove-outline.svg +1 -1
  225. package/dist/stripe-elements/svg/bag-remove-sharp.svg +1 -1
  226. package/dist/stripe-elements/svg/bag-remove.svg +1 -1
  227. package/dist/stripe-elements/svg/bag-sharp.svg +1 -1
  228. package/dist/stripe-elements/svg/bag.svg +1 -1
  229. package/dist/stripe-elements/svg/balloon-outline.svg +1 -1
  230. package/dist/stripe-elements/svg/balloon-sharp.svg +1 -1
  231. package/dist/stripe-elements/svg/balloon.svg +1 -1
  232. package/dist/stripe-elements/svg/ban-outline.svg +1 -1
  233. package/dist/stripe-elements/svg/ban-sharp.svg +1 -1
  234. package/dist/stripe-elements/svg/ban.svg +1 -1
  235. package/dist/stripe-elements/svg/bandage-outline.svg +1 -1
  236. package/dist/stripe-elements/svg/bandage-sharp.svg +1 -1
  237. package/dist/stripe-elements/svg/bandage.svg +1 -1
  238. package/dist/stripe-elements/svg/bar-chart-outline.svg +1 -1
  239. package/dist/stripe-elements/svg/bar-chart-sharp.svg +1 -1
  240. package/dist/stripe-elements/svg/bar-chart.svg +1 -1
  241. package/dist/stripe-elements/svg/barbell-outline.svg +1 -1
  242. package/dist/stripe-elements/svg/barbell-sharp.svg +1 -1
  243. package/dist/stripe-elements/svg/barbell.svg +1 -1
  244. package/dist/stripe-elements/svg/barcode-outline.svg +1 -1
  245. package/dist/stripe-elements/svg/barcode-sharp.svg +1 -1
  246. package/dist/stripe-elements/svg/barcode.svg +1 -1
  247. package/dist/stripe-elements/svg/baseball-outline.svg +1 -1
  248. package/dist/stripe-elements/svg/baseball-sharp.svg +1 -1
  249. package/dist/stripe-elements/svg/baseball.svg +1 -1
  250. package/dist/stripe-elements/svg/basket-outline.svg +1 -1
  251. package/dist/stripe-elements/svg/basket-sharp.svg +1 -1
  252. package/dist/stripe-elements/svg/basket.svg +1 -1
  253. package/dist/stripe-elements/svg/basketball-outline.svg +1 -1
  254. package/dist/stripe-elements/svg/basketball-sharp.svg +1 -1
  255. package/dist/stripe-elements/svg/basketball.svg +1 -1
  256. package/dist/stripe-elements/svg/battery-charging-outline.svg +1 -1
  257. package/dist/stripe-elements/svg/battery-charging-sharp.svg +1 -1
  258. package/dist/stripe-elements/svg/battery-charging.svg +1 -1
  259. package/dist/stripe-elements/svg/battery-dead-outline.svg +1 -1
  260. package/dist/stripe-elements/svg/battery-dead-sharp.svg +1 -1
  261. package/dist/stripe-elements/svg/battery-dead.svg +1 -1
  262. package/dist/stripe-elements/svg/battery-full-outline.svg +1 -1
  263. package/dist/stripe-elements/svg/battery-full-sharp.svg +1 -1
  264. package/dist/stripe-elements/svg/battery-full.svg +1 -1
  265. package/dist/stripe-elements/svg/battery-half-outline.svg +1 -1
  266. package/dist/stripe-elements/svg/battery-half-sharp.svg +1 -1
  267. package/dist/stripe-elements/svg/battery-half.svg +1 -1
  268. package/dist/stripe-elements/svg/beaker-outline.svg +1 -1
  269. package/dist/stripe-elements/svg/beaker-sharp.svg +1 -1
  270. package/dist/stripe-elements/svg/beaker.svg +1 -1
  271. package/dist/stripe-elements/svg/bed-outline.svg +1 -1
  272. package/dist/stripe-elements/svg/bed-sharp.svg +1 -1
  273. package/dist/stripe-elements/svg/bed.svg +1 -1
  274. package/dist/stripe-elements/svg/beer-outline.svg +1 -1
  275. package/dist/stripe-elements/svg/beer-sharp.svg +1 -1
  276. package/dist/stripe-elements/svg/beer.svg +1 -1
  277. package/dist/stripe-elements/svg/bicycle-outline.svg +1 -1
  278. package/dist/stripe-elements/svg/bicycle-sharp.svg +1 -1
  279. package/dist/stripe-elements/svg/bicycle.svg +1 -1
  280. package/dist/stripe-elements/svg/binoculars-outline.svg +1 -0
  281. package/dist/stripe-elements/svg/binoculars-sharp.svg +1 -0
  282. package/dist/stripe-elements/svg/binoculars.svg +1 -0
  283. package/dist/stripe-elements/svg/bluetooth-outline.svg +1 -1
  284. package/dist/stripe-elements/svg/bluetooth-sharp.svg +1 -1
  285. package/dist/stripe-elements/svg/bluetooth.svg +1 -1
  286. package/dist/stripe-elements/svg/boat-outline.svg +1 -1
  287. package/dist/stripe-elements/svg/boat-sharp.svg +1 -1
  288. package/dist/stripe-elements/svg/boat.svg +1 -1
  289. package/dist/stripe-elements/svg/body-outline.svg +1 -1
  290. package/dist/stripe-elements/svg/body-sharp.svg +1 -1
  291. package/dist/stripe-elements/svg/body.svg +1 -1
  292. package/dist/stripe-elements/svg/bonfire-outline.svg +1 -1
  293. package/dist/stripe-elements/svg/bonfire-sharp.svg +1 -1
  294. package/dist/stripe-elements/svg/bonfire.svg +1 -1
  295. package/dist/stripe-elements/svg/book-outline.svg +1 -1
  296. package/dist/stripe-elements/svg/book-sharp.svg +1 -1
  297. package/dist/stripe-elements/svg/book.svg +1 -1
  298. package/dist/stripe-elements/svg/bookmark-outline.svg +1 -1
  299. package/dist/stripe-elements/svg/bookmark-sharp.svg +1 -1
  300. package/dist/stripe-elements/svg/bookmark.svg +1 -1
  301. package/dist/stripe-elements/svg/bookmarks-outline.svg +1 -1
  302. package/dist/stripe-elements/svg/bookmarks-sharp.svg +1 -1
  303. package/dist/stripe-elements/svg/bookmarks.svg +1 -1
  304. package/dist/stripe-elements/svg/bowling-ball-outline.svg +1 -1
  305. package/dist/stripe-elements/svg/bowling-ball-sharp.svg +1 -1
  306. package/dist/stripe-elements/svg/bowling-ball.svg +1 -1
  307. package/dist/stripe-elements/svg/briefcase-outline.svg +1 -1
  308. package/dist/stripe-elements/svg/briefcase-sharp.svg +1 -1
  309. package/dist/stripe-elements/svg/briefcase.svg +1 -1
  310. package/dist/stripe-elements/svg/browsers-outline.svg +1 -1
  311. package/dist/stripe-elements/svg/browsers-sharp.svg +1 -1
  312. package/dist/stripe-elements/svg/browsers.svg +1 -1
  313. package/dist/stripe-elements/svg/brush-outline.svg +1 -1
  314. package/dist/stripe-elements/svg/brush-sharp.svg +1 -1
  315. package/dist/stripe-elements/svg/brush.svg +1 -1
  316. package/dist/stripe-elements/svg/bug-outline.svg +1 -1
  317. package/dist/stripe-elements/svg/bug-sharp.svg +1 -1
  318. package/dist/stripe-elements/svg/bug.svg +1 -1
  319. package/dist/stripe-elements/svg/build-outline.svg +1 -1
  320. package/dist/stripe-elements/svg/build-sharp.svg +1 -1
  321. package/dist/stripe-elements/svg/build.svg +1 -1
  322. package/dist/stripe-elements/svg/bulb-outline.svg +1 -1
  323. package/dist/stripe-elements/svg/bulb-sharp.svg +1 -1
  324. package/dist/stripe-elements/svg/bulb.svg +1 -1
  325. package/dist/stripe-elements/svg/bus-outline.svg +1 -1
  326. package/dist/stripe-elements/svg/bus-sharp.svg +1 -1
  327. package/dist/stripe-elements/svg/bus.svg +1 -1
  328. package/dist/stripe-elements/svg/business-outline.svg +1 -1
  329. package/dist/stripe-elements/svg/business-sharp.svg +1 -1
  330. package/dist/stripe-elements/svg/business.svg +1 -1
  331. package/dist/stripe-elements/svg/cafe-outline.svg +1 -1
  332. package/dist/stripe-elements/svg/cafe-sharp.svg +1 -1
  333. package/dist/stripe-elements/svg/cafe.svg +1 -1
  334. package/dist/stripe-elements/svg/calculator-outline.svg +1 -1
  335. package/dist/stripe-elements/svg/calculator-sharp.svg +1 -1
  336. package/dist/stripe-elements/svg/calculator.svg +1 -1
  337. package/dist/stripe-elements/svg/calendar-clear-outline.svg +1 -1
  338. package/dist/stripe-elements/svg/calendar-clear-sharp.svg +1 -1
  339. package/dist/stripe-elements/svg/calendar-clear.svg +1 -1
  340. package/dist/stripe-elements/svg/calendar-number-outline.svg +1 -1
  341. package/dist/stripe-elements/svg/calendar-number-sharp.svg +1 -1
  342. package/dist/stripe-elements/svg/calendar-number.svg +1 -1
  343. package/dist/stripe-elements/svg/calendar-outline.svg +1 -1
  344. package/dist/stripe-elements/svg/calendar-sharp.svg +1 -1
  345. package/dist/stripe-elements/svg/calendar.svg +1 -1
  346. package/dist/stripe-elements/svg/call-outline.svg +1 -1
  347. package/dist/stripe-elements/svg/call-sharp.svg +1 -1
  348. package/dist/stripe-elements/svg/call.svg +1 -1
  349. package/dist/stripe-elements/svg/camera-outline.svg +1 -1
  350. package/dist/stripe-elements/svg/camera-reverse-outline.svg +1 -1
  351. package/dist/stripe-elements/svg/camera-reverse-sharp.svg +1 -1
  352. package/dist/stripe-elements/svg/camera-reverse.svg +1 -1
  353. package/dist/stripe-elements/svg/camera-sharp.svg +1 -1
  354. package/dist/stripe-elements/svg/camera.svg +1 -1
  355. package/dist/stripe-elements/svg/car-outline.svg +1 -1
  356. package/dist/stripe-elements/svg/car-sharp.svg +1 -1
  357. package/dist/stripe-elements/svg/car-sport-outline.svg +1 -1
  358. package/dist/stripe-elements/svg/car-sport-sharp.svg +1 -1
  359. package/dist/stripe-elements/svg/car-sport.svg +1 -1
  360. package/dist/stripe-elements/svg/car.svg +1 -1
  361. package/dist/stripe-elements/svg/card-outline.svg +1 -1
  362. package/dist/stripe-elements/svg/card-sharp.svg +1 -1
  363. package/dist/stripe-elements/svg/card.svg +1 -1
  364. package/dist/stripe-elements/svg/caret-back-circle-outline.svg +1 -1
  365. package/dist/stripe-elements/svg/caret-back-circle-sharp.svg +1 -1
  366. package/dist/stripe-elements/svg/caret-back-circle.svg +1 -1
  367. package/dist/stripe-elements/svg/caret-back-outline.svg +1 -1
  368. package/dist/stripe-elements/svg/caret-back-sharp.svg +1 -1
  369. package/dist/stripe-elements/svg/caret-back.svg +1 -1
  370. package/dist/stripe-elements/svg/caret-down-circle-outline.svg +1 -1
  371. package/dist/stripe-elements/svg/caret-down-circle-sharp.svg +1 -1
  372. package/dist/stripe-elements/svg/caret-down-circle.svg +1 -1
  373. package/dist/stripe-elements/svg/caret-down-outline.svg +1 -1
  374. package/dist/stripe-elements/svg/caret-down-sharp.svg +1 -1
  375. package/dist/stripe-elements/svg/caret-down.svg +1 -1
  376. package/dist/stripe-elements/svg/caret-forward-circle-outline.svg +1 -1
  377. package/dist/stripe-elements/svg/caret-forward-circle-sharp.svg +1 -1
  378. package/dist/stripe-elements/svg/caret-forward-circle.svg +1 -1
  379. package/dist/stripe-elements/svg/caret-forward-outline.svg +1 -1
  380. package/dist/stripe-elements/svg/caret-forward-sharp.svg +1 -1
  381. package/dist/stripe-elements/svg/caret-forward.svg +1 -1
  382. package/dist/stripe-elements/svg/caret-up-circle-outline.svg +1 -1
  383. package/dist/stripe-elements/svg/caret-up-circle-sharp.svg +1 -1
  384. package/dist/stripe-elements/svg/caret-up-circle.svg +1 -1
  385. package/dist/stripe-elements/svg/caret-up-outline.svg +1 -1
  386. package/dist/stripe-elements/svg/caret-up-sharp.svg +1 -1
  387. package/dist/stripe-elements/svg/caret-up.svg +1 -1
  388. package/dist/stripe-elements/svg/cart-outline.svg +1 -1
  389. package/dist/stripe-elements/svg/cart-sharp.svg +1 -1
  390. package/dist/stripe-elements/svg/cart.svg +1 -1
  391. package/dist/stripe-elements/svg/cash-outline.svg +1 -1
  392. package/dist/stripe-elements/svg/cash-sharp.svg +1 -1
  393. package/dist/stripe-elements/svg/cash.svg +1 -1
  394. package/dist/stripe-elements/svg/cellular-outline.svg +1 -1
  395. package/dist/stripe-elements/svg/cellular-sharp.svg +1 -1
  396. package/dist/stripe-elements/svg/cellular.svg +1 -1
  397. package/dist/stripe-elements/svg/chatbox-ellipses-outline.svg +1 -1
  398. package/dist/stripe-elements/svg/chatbox-ellipses-sharp.svg +1 -1
  399. package/dist/stripe-elements/svg/chatbox-ellipses.svg +1 -1
  400. package/dist/stripe-elements/svg/chatbox-outline.svg +1 -1
  401. package/dist/stripe-elements/svg/chatbox-sharp.svg +1 -1
  402. package/dist/stripe-elements/svg/chatbox.svg +1 -1
  403. package/dist/stripe-elements/svg/chatbubble-ellipses-outline.svg +1 -1
  404. package/dist/stripe-elements/svg/chatbubble-ellipses-sharp.svg +1 -1
  405. package/dist/stripe-elements/svg/chatbubble-ellipses.svg +1 -1
  406. package/dist/stripe-elements/svg/chatbubble-outline.svg +1 -1
  407. package/dist/stripe-elements/svg/chatbubble-sharp.svg +1 -1
  408. package/dist/stripe-elements/svg/chatbubble.svg +1 -1
  409. package/dist/stripe-elements/svg/chatbubbles-outline.svg +1 -1
  410. package/dist/stripe-elements/svg/chatbubbles-sharp.svg +1 -1
  411. package/dist/stripe-elements/svg/chatbubbles.svg +1 -1
  412. package/dist/stripe-elements/svg/checkbox-outline.svg +1 -1
  413. package/dist/stripe-elements/svg/checkbox-sharp.svg +1 -1
  414. package/dist/stripe-elements/svg/checkbox.svg +1 -1
  415. package/dist/stripe-elements/svg/checkmark-circle-outline.svg +1 -1
  416. package/dist/stripe-elements/svg/checkmark-circle-sharp.svg +1 -1
  417. package/dist/stripe-elements/svg/checkmark-circle.svg +1 -1
  418. package/dist/stripe-elements/svg/checkmark-done-circle-outline.svg +1 -1
  419. package/dist/stripe-elements/svg/checkmark-done-circle-sharp.svg +1 -1
  420. package/dist/stripe-elements/svg/checkmark-done-circle.svg +1 -1
  421. package/dist/stripe-elements/svg/checkmark-done-outline.svg +1 -1
  422. package/dist/stripe-elements/svg/checkmark-done-sharp.svg +1 -1
  423. package/dist/stripe-elements/svg/checkmark-done.svg +1 -1
  424. package/dist/stripe-elements/svg/checkmark-outline.svg +1 -1
  425. package/dist/stripe-elements/svg/checkmark-sharp.svg +1 -1
  426. package/dist/stripe-elements/svg/checkmark.svg +1 -1
  427. package/dist/stripe-elements/svg/chevron-back-circle-outline.svg +1 -1
  428. package/dist/stripe-elements/svg/chevron-back-circle-sharp.svg +1 -1
  429. package/dist/stripe-elements/svg/chevron-back-circle.svg +1 -1
  430. package/dist/stripe-elements/svg/chevron-back-outline.svg +1 -1
  431. package/dist/stripe-elements/svg/chevron-back-sharp.svg +1 -1
  432. package/dist/stripe-elements/svg/chevron-back.svg +1 -1
  433. package/dist/stripe-elements/svg/chevron-collapse-outline.svg +1 -1
  434. package/dist/stripe-elements/svg/chevron-collapse-sharp.svg +1 -1
  435. package/dist/stripe-elements/svg/chevron-collapse.svg +1 -1
  436. package/dist/stripe-elements/svg/chevron-down-circle-outline.svg +1 -1
  437. package/dist/stripe-elements/svg/chevron-down-circle-sharp.svg +1 -1
  438. package/dist/stripe-elements/svg/chevron-down-circle.svg +1 -1
  439. package/dist/stripe-elements/svg/chevron-down-outline.svg +1 -1
  440. package/dist/stripe-elements/svg/chevron-down-sharp.svg +1 -1
  441. package/dist/stripe-elements/svg/chevron-down.svg +1 -1
  442. package/dist/stripe-elements/svg/chevron-expand-outline.svg +1 -1
  443. package/dist/stripe-elements/svg/chevron-expand-sharp.svg +1 -1
  444. package/dist/stripe-elements/svg/chevron-expand.svg +1 -1
  445. package/dist/stripe-elements/svg/chevron-forward-circle-outline.svg +1 -1
  446. package/dist/stripe-elements/svg/chevron-forward-circle-sharp.svg +1 -1
  447. package/dist/stripe-elements/svg/chevron-forward-circle.svg +1 -1
  448. package/dist/stripe-elements/svg/chevron-forward-outline.svg +1 -1
  449. package/dist/stripe-elements/svg/chevron-forward-sharp.svg +1 -1
  450. package/dist/stripe-elements/svg/chevron-forward.svg +1 -1
  451. package/dist/stripe-elements/svg/chevron-up-circle-outline.svg +1 -1
  452. package/dist/stripe-elements/svg/chevron-up-circle-sharp.svg +1 -1
  453. package/dist/stripe-elements/svg/chevron-up-circle.svg +1 -1
  454. package/dist/stripe-elements/svg/chevron-up-outline.svg +1 -1
  455. package/dist/stripe-elements/svg/chevron-up-sharp.svg +1 -1
  456. package/dist/stripe-elements/svg/chevron-up.svg +1 -1
  457. package/dist/stripe-elements/svg/clipboard-outline.svg +1 -1
  458. package/dist/stripe-elements/svg/clipboard-sharp.svg +1 -1
  459. package/dist/stripe-elements/svg/clipboard.svg +1 -1
  460. package/dist/stripe-elements/svg/close-circle-outline.svg +1 -1
  461. package/dist/stripe-elements/svg/close-circle-sharp.svg +1 -1
  462. package/dist/stripe-elements/svg/close-circle.svg +1 -1
  463. package/dist/stripe-elements/svg/close-outline.svg +1 -1
  464. package/dist/stripe-elements/svg/close-sharp.svg +1 -1
  465. package/dist/stripe-elements/svg/close.svg +1 -1
  466. package/dist/stripe-elements/svg/cloud-circle-outline.svg +1 -1
  467. package/dist/stripe-elements/svg/cloud-circle-sharp.svg +1 -1
  468. package/dist/stripe-elements/svg/cloud-circle.svg +1 -1
  469. package/dist/stripe-elements/svg/cloud-done-outline.svg +1 -1
  470. package/dist/stripe-elements/svg/cloud-done-sharp.svg +1 -1
  471. package/dist/stripe-elements/svg/cloud-done.svg +1 -1
  472. package/dist/stripe-elements/svg/cloud-download-outline.svg +1 -1
  473. package/dist/stripe-elements/svg/cloud-download-sharp.svg +1 -1
  474. package/dist/stripe-elements/svg/cloud-download.svg +1 -1
  475. package/dist/stripe-elements/svg/cloud-offline-outline.svg +1 -1
  476. package/dist/stripe-elements/svg/cloud-offline-sharp.svg +1 -1
  477. package/dist/stripe-elements/svg/cloud-offline.svg +1 -1
  478. package/dist/stripe-elements/svg/cloud-outline.svg +1 -1
  479. package/dist/stripe-elements/svg/cloud-sharp.svg +1 -1
  480. package/dist/stripe-elements/svg/cloud-upload-outline.svg +1 -1
  481. package/dist/stripe-elements/svg/cloud-upload-sharp.svg +1 -1
  482. package/dist/stripe-elements/svg/cloud-upload.svg +1 -1
  483. package/dist/stripe-elements/svg/cloud.svg +1 -1
  484. package/dist/stripe-elements/svg/cloudy-night-outline.svg +1 -1
  485. package/dist/stripe-elements/svg/cloudy-night-sharp.svg +1 -1
  486. package/dist/stripe-elements/svg/cloudy-night.svg +1 -1
  487. package/dist/stripe-elements/svg/cloudy-outline.svg +1 -1
  488. package/dist/stripe-elements/svg/cloudy-sharp.svg +1 -1
  489. package/dist/stripe-elements/svg/cloudy.svg +1 -1
  490. package/dist/stripe-elements/svg/code-download-outline.svg +1 -1
  491. package/dist/stripe-elements/svg/code-download-sharp.svg +1 -1
  492. package/dist/stripe-elements/svg/code-download.svg +1 -1
  493. package/dist/stripe-elements/svg/code-outline.svg +1 -1
  494. package/dist/stripe-elements/svg/code-sharp.svg +1 -1
  495. package/dist/stripe-elements/svg/code-slash-outline.svg +1 -1
  496. package/dist/stripe-elements/svg/code-slash-sharp.svg +1 -1
  497. package/dist/stripe-elements/svg/code-slash.svg +1 -1
  498. package/dist/stripe-elements/svg/code-working-outline.svg +1 -1
  499. package/dist/stripe-elements/svg/code-working-sharp.svg +1 -1
  500. package/dist/stripe-elements/svg/code-working.svg +1 -1
  501. package/dist/stripe-elements/svg/code.svg +1 -1
  502. package/dist/stripe-elements/svg/cog-outline.svg +1 -1
  503. package/dist/stripe-elements/svg/cog-sharp.svg +1 -1
  504. package/dist/stripe-elements/svg/cog.svg +1 -1
  505. package/dist/stripe-elements/svg/color-fill-outline.svg +1 -1
  506. package/dist/stripe-elements/svg/color-fill-sharp.svg +1 -1
  507. package/dist/stripe-elements/svg/color-fill.svg +1 -1
  508. package/dist/stripe-elements/svg/color-filter-outline.svg +1 -1
  509. package/dist/stripe-elements/svg/color-filter-sharp.svg +1 -1
  510. package/dist/stripe-elements/svg/color-filter.svg +1 -1
  511. package/dist/stripe-elements/svg/color-palette-outline.svg +1 -1
  512. package/dist/stripe-elements/svg/color-palette-sharp.svg +1 -1
  513. package/dist/stripe-elements/svg/color-palette.svg +1 -1
  514. package/dist/stripe-elements/svg/color-wand-outline.svg +1 -1
  515. package/dist/stripe-elements/svg/color-wand-sharp.svg +1 -1
  516. package/dist/stripe-elements/svg/color-wand.svg +1 -1
  517. package/dist/stripe-elements/svg/compass-outline.svg +1 -1
  518. package/dist/stripe-elements/svg/compass-sharp.svg +1 -1
  519. package/dist/stripe-elements/svg/compass.svg +1 -1
  520. package/dist/stripe-elements/svg/construct-outline.svg +1 -1
  521. package/dist/stripe-elements/svg/construct-sharp.svg +1 -1
  522. package/dist/stripe-elements/svg/construct.svg +1 -1
  523. package/dist/stripe-elements/svg/contract-outline.svg +1 -1
  524. package/dist/stripe-elements/svg/contract-sharp.svg +1 -1
  525. package/dist/stripe-elements/svg/contract.svg +1 -1
  526. package/dist/stripe-elements/svg/contrast-outline.svg +1 -1
  527. package/dist/stripe-elements/svg/contrast-sharp.svg +1 -1
  528. package/dist/stripe-elements/svg/contrast.svg +1 -1
  529. package/dist/stripe-elements/svg/copy-outline.svg +1 -1
  530. package/dist/stripe-elements/svg/copy-sharp.svg +1 -1
  531. package/dist/stripe-elements/svg/copy.svg +1 -1
  532. package/dist/stripe-elements/svg/create-outline.svg +1 -1
  533. package/dist/stripe-elements/svg/create-sharp.svg +1 -1
  534. package/dist/stripe-elements/svg/create.svg +1 -1
  535. package/dist/stripe-elements/svg/crop-outline.svg +1 -1
  536. package/dist/stripe-elements/svg/crop-sharp.svg +1 -1
  537. package/dist/stripe-elements/svg/crop.svg +1 -1
  538. package/dist/stripe-elements/svg/cube-outline.svg +1 -1
  539. package/dist/stripe-elements/svg/cube-sharp.svg +1 -1
  540. package/dist/stripe-elements/svg/cube.svg +1 -1
  541. package/dist/stripe-elements/svg/cut-outline.svg +1 -1
  542. package/dist/stripe-elements/svg/cut-sharp.svg +1 -1
  543. package/dist/stripe-elements/svg/cut.svg +1 -1
  544. package/dist/stripe-elements/svg/desktop-outline.svg +1 -1
  545. package/dist/stripe-elements/svg/desktop-sharp.svg +1 -1
  546. package/dist/stripe-elements/svg/desktop.svg +1 -1
  547. package/dist/stripe-elements/svg/diamond-outline.svg +1 -1
  548. package/dist/stripe-elements/svg/diamond-sharp.svg +1 -1
  549. package/dist/stripe-elements/svg/diamond.svg +1 -1
  550. package/dist/stripe-elements/svg/dice-outline.svg +1 -1
  551. package/dist/stripe-elements/svg/dice-sharp.svg +1 -1
  552. package/dist/stripe-elements/svg/dice.svg +1 -1
  553. package/dist/stripe-elements/svg/disc-outline.svg +1 -1
  554. package/dist/stripe-elements/svg/disc-sharp.svg +1 -1
  555. package/dist/stripe-elements/svg/disc.svg +1 -1
  556. package/dist/stripe-elements/svg/document-attach-outline.svg +1 -1
  557. package/dist/stripe-elements/svg/document-attach-sharp.svg +1 -1
  558. package/dist/stripe-elements/svg/document-attach.svg +1 -1
  559. package/dist/stripe-elements/svg/document-lock-outline.svg +1 -1
  560. package/dist/stripe-elements/svg/document-lock-sharp.svg +1 -1
  561. package/dist/stripe-elements/svg/document-lock.svg +1 -1
  562. package/dist/stripe-elements/svg/document-outline.svg +1 -1
  563. package/dist/stripe-elements/svg/document-sharp.svg +1 -1
  564. package/dist/stripe-elements/svg/document-text-outline.svg +1 -1
  565. package/dist/stripe-elements/svg/document-text-sharp.svg +1 -1
  566. package/dist/stripe-elements/svg/document-text.svg +1 -1
  567. package/dist/stripe-elements/svg/document.svg +1 -1
  568. package/dist/stripe-elements/svg/documents-outline.svg +1 -1
  569. package/dist/stripe-elements/svg/documents-sharp.svg +1 -1
  570. package/dist/stripe-elements/svg/documents.svg +1 -1
  571. package/dist/stripe-elements/svg/download-outline.svg +1 -1
  572. package/dist/stripe-elements/svg/download-sharp.svg +1 -1
  573. package/dist/stripe-elements/svg/download.svg +1 -1
  574. package/dist/stripe-elements/svg/duplicate-outline.svg +1 -1
  575. package/dist/stripe-elements/svg/duplicate-sharp.svg +1 -1
  576. package/dist/stripe-elements/svg/duplicate.svg +1 -1
  577. package/dist/stripe-elements/svg/ear-outline.svg +1 -1
  578. package/dist/stripe-elements/svg/ear-sharp.svg +1 -1
  579. package/dist/stripe-elements/svg/ear.svg +1 -1
  580. package/dist/stripe-elements/svg/earth-outline.svg +1 -1
  581. package/dist/stripe-elements/svg/earth-sharp.svg +1 -1
  582. package/dist/stripe-elements/svg/earth.svg +1 -1
  583. package/dist/stripe-elements/svg/easel-outline.svg +1 -1
  584. package/dist/stripe-elements/svg/easel-sharp.svg +1 -1
  585. package/dist/stripe-elements/svg/easel.svg +1 -1
  586. package/dist/stripe-elements/svg/egg-outline.svg +1 -1
  587. package/dist/stripe-elements/svg/egg-sharp.svg +1 -1
  588. package/dist/stripe-elements/svg/egg.svg +1 -1
  589. package/dist/stripe-elements/svg/ellipse-outline.svg +1 -1
  590. package/dist/stripe-elements/svg/ellipse-sharp.svg +1 -1
  591. package/dist/stripe-elements/svg/ellipse.svg +1 -1
  592. package/dist/stripe-elements/svg/ellipsis-horizontal-circle-outline.svg +1 -1
  593. package/dist/stripe-elements/svg/ellipsis-horizontal-circle-sharp.svg +1 -1
  594. package/dist/stripe-elements/svg/ellipsis-horizontal-circle.svg +1 -1
  595. package/dist/stripe-elements/svg/ellipsis-horizontal-outline.svg +1 -1
  596. package/dist/stripe-elements/svg/ellipsis-horizontal-sharp.svg +1 -1
  597. package/dist/stripe-elements/svg/ellipsis-horizontal.svg +1 -1
  598. package/dist/stripe-elements/svg/ellipsis-vertical-circle-outline.svg +1 -1
  599. package/dist/stripe-elements/svg/ellipsis-vertical-circle-sharp.svg +1 -1
  600. package/dist/stripe-elements/svg/ellipsis-vertical-circle.svg +1 -1
  601. package/dist/stripe-elements/svg/ellipsis-vertical-outline.svg +1 -1
  602. package/dist/stripe-elements/svg/ellipsis-vertical-sharp.svg +1 -1
  603. package/dist/stripe-elements/svg/ellipsis-vertical.svg +1 -1
  604. package/dist/stripe-elements/svg/enter-outline.svg +1 -1
  605. package/dist/stripe-elements/svg/enter-sharp.svg +1 -1
  606. package/dist/stripe-elements/svg/enter.svg +1 -1
  607. package/dist/stripe-elements/svg/exit-outline.svg +1 -1
  608. package/dist/stripe-elements/svg/exit-sharp.svg +1 -1
  609. package/dist/stripe-elements/svg/exit.svg +1 -1
  610. package/dist/stripe-elements/svg/expand-outline.svg +1 -1
  611. package/dist/stripe-elements/svg/expand-sharp.svg +1 -1
  612. package/dist/stripe-elements/svg/expand.svg +1 -1
  613. package/dist/stripe-elements/svg/extension-puzzle-outline.svg +1 -1
  614. package/dist/stripe-elements/svg/extension-puzzle-sharp.svg +1 -1
  615. package/dist/stripe-elements/svg/extension-puzzle.svg +1 -1
  616. package/dist/stripe-elements/svg/eye-off-outline.svg +1 -1
  617. package/dist/stripe-elements/svg/eye-off-sharp.svg +1 -1
  618. package/dist/stripe-elements/svg/eye-off.svg +1 -1
  619. package/dist/stripe-elements/svg/eye-outline.svg +1 -1
  620. package/dist/stripe-elements/svg/eye-sharp.svg +1 -1
  621. package/dist/stripe-elements/svg/eye.svg +1 -1
  622. package/dist/stripe-elements/svg/eyedrop-outline.svg +1 -1
  623. package/dist/stripe-elements/svg/eyedrop-sharp.svg +1 -1
  624. package/dist/stripe-elements/svg/eyedrop.svg +1 -1
  625. package/dist/stripe-elements/svg/fast-food-outline.svg +1 -1
  626. package/dist/stripe-elements/svg/fast-food-sharp.svg +1 -1
  627. package/dist/stripe-elements/svg/fast-food.svg +1 -1
  628. package/dist/stripe-elements/svg/female-outline.svg +1 -1
  629. package/dist/stripe-elements/svg/female-sharp.svg +1 -1
  630. package/dist/stripe-elements/svg/female.svg +1 -1
  631. package/dist/stripe-elements/svg/file-tray-full-outline.svg +1 -1
  632. package/dist/stripe-elements/svg/file-tray-full-sharp.svg +1 -1
  633. package/dist/stripe-elements/svg/file-tray-full.svg +1 -1
  634. package/dist/stripe-elements/svg/file-tray-outline.svg +1 -1
  635. package/dist/stripe-elements/svg/file-tray-sharp.svg +1 -1
  636. package/dist/stripe-elements/svg/file-tray-stacked-outline.svg +1 -1
  637. package/dist/stripe-elements/svg/file-tray-stacked-sharp.svg +1 -1
  638. package/dist/stripe-elements/svg/file-tray-stacked.svg +1 -1
  639. package/dist/stripe-elements/svg/file-tray.svg +1 -1
  640. package/dist/stripe-elements/svg/film-outline.svg +1 -1
  641. package/dist/stripe-elements/svg/film-sharp.svg +1 -1
  642. package/dist/stripe-elements/svg/film.svg +1 -1
  643. package/dist/stripe-elements/svg/filter-circle-outline.svg +1 -1
  644. package/dist/stripe-elements/svg/filter-circle-sharp.svg +1 -1
  645. package/dist/stripe-elements/svg/filter-circle.svg +1 -1
  646. package/dist/stripe-elements/svg/filter-outline.svg +1 -1
  647. package/dist/stripe-elements/svg/filter-sharp.svg +1 -1
  648. package/dist/stripe-elements/svg/filter.svg +1 -1
  649. package/dist/stripe-elements/svg/finger-print-outline.svg +1 -1
  650. package/dist/stripe-elements/svg/finger-print-sharp.svg +1 -1
  651. package/dist/stripe-elements/svg/finger-print.svg +1 -1
  652. package/dist/stripe-elements/svg/fish-outline.svg +1 -1
  653. package/dist/stripe-elements/svg/fish-sharp.svg +1 -1
  654. package/dist/stripe-elements/svg/fish.svg +1 -1
  655. package/dist/stripe-elements/svg/fitness-outline.svg +1 -1
  656. package/dist/stripe-elements/svg/fitness-sharp.svg +1 -1
  657. package/dist/stripe-elements/svg/fitness.svg +1 -1
  658. package/dist/stripe-elements/svg/flag-outline.svg +1 -1
  659. package/dist/stripe-elements/svg/flag-sharp.svg +1 -1
  660. package/dist/stripe-elements/svg/flag.svg +1 -1
  661. package/dist/stripe-elements/svg/flame-outline.svg +1 -1
  662. package/dist/stripe-elements/svg/flame-sharp.svg +1 -1
  663. package/dist/stripe-elements/svg/flame.svg +1 -1
  664. package/dist/stripe-elements/svg/flash-off-outline.svg +1 -1
  665. package/dist/stripe-elements/svg/flash-off-sharp.svg +1 -1
  666. package/dist/stripe-elements/svg/flash-off.svg +1 -1
  667. package/dist/stripe-elements/svg/flash-outline.svg +1 -1
  668. package/dist/stripe-elements/svg/flash-sharp.svg +1 -1
  669. package/dist/stripe-elements/svg/flash.svg +1 -1
  670. package/dist/stripe-elements/svg/flashlight-outline.svg +1 -1
  671. package/dist/stripe-elements/svg/flashlight-sharp.svg +1 -1
  672. package/dist/stripe-elements/svg/flashlight.svg +1 -1
  673. package/dist/stripe-elements/svg/flask-outline.svg +1 -1
  674. package/dist/stripe-elements/svg/flask-sharp.svg +1 -1
  675. package/dist/stripe-elements/svg/flask.svg +1 -1
  676. package/dist/stripe-elements/svg/flower-outline.svg +1 -1
  677. package/dist/stripe-elements/svg/flower-sharp.svg +1 -1
  678. package/dist/stripe-elements/svg/flower.svg +1 -1
  679. package/dist/stripe-elements/svg/folder-open-outline.svg +1 -1
  680. package/dist/stripe-elements/svg/folder-open-sharp.svg +1 -1
  681. package/dist/stripe-elements/svg/folder-open.svg +1 -1
  682. package/dist/stripe-elements/svg/folder-outline.svg +1 -1
  683. package/dist/stripe-elements/svg/folder-sharp.svg +1 -1
  684. package/dist/stripe-elements/svg/folder.svg +1 -1
  685. package/dist/stripe-elements/svg/football-outline.svg +1 -1
  686. package/dist/stripe-elements/svg/football-sharp.svg +1 -1
  687. package/dist/stripe-elements/svg/football.svg +1 -1
  688. package/dist/stripe-elements/svg/footsteps-outline.svg +1 -1
  689. package/dist/stripe-elements/svg/footsteps-sharp.svg +1 -1
  690. package/dist/stripe-elements/svg/footsteps.svg +1 -1
  691. package/dist/stripe-elements/svg/funnel-outline.svg +1 -1
  692. package/dist/stripe-elements/svg/funnel-sharp.svg +1 -1
  693. package/dist/stripe-elements/svg/funnel.svg +1 -1
  694. package/dist/stripe-elements/svg/game-controller-outline.svg +1 -1
  695. package/dist/stripe-elements/svg/game-controller-sharp.svg +1 -1
  696. package/dist/stripe-elements/svg/game-controller.svg +1 -1
  697. package/dist/stripe-elements/svg/gift-outline.svg +1 -1
  698. package/dist/stripe-elements/svg/gift-sharp.svg +1 -1
  699. package/dist/stripe-elements/svg/gift.svg +1 -1
  700. package/dist/stripe-elements/svg/git-branch-outline.svg +1 -1
  701. package/dist/stripe-elements/svg/git-branch-sharp.svg +1 -1
  702. package/dist/stripe-elements/svg/git-branch.svg +1 -1
  703. package/dist/stripe-elements/svg/git-commit-outline.svg +1 -1
  704. package/dist/stripe-elements/svg/git-commit-sharp.svg +1 -1
  705. package/dist/stripe-elements/svg/git-commit.svg +1 -1
  706. package/dist/stripe-elements/svg/git-compare-outline.svg +1 -1
  707. package/dist/stripe-elements/svg/git-compare-sharp.svg +1 -1
  708. package/dist/stripe-elements/svg/git-compare.svg +1 -1
  709. package/dist/stripe-elements/svg/git-merge-outline.svg +1 -1
  710. package/dist/stripe-elements/svg/git-merge-sharp.svg +1 -1
  711. package/dist/stripe-elements/svg/git-merge.svg +1 -1
  712. package/dist/stripe-elements/svg/git-network-outline.svg +1 -1
  713. package/dist/stripe-elements/svg/git-network-sharp.svg +1 -1
  714. package/dist/stripe-elements/svg/git-network.svg +1 -1
  715. package/dist/stripe-elements/svg/git-pull-request-outline.svg +1 -1
  716. package/dist/stripe-elements/svg/git-pull-request-sharp.svg +1 -1
  717. package/dist/stripe-elements/svg/git-pull-request.svg +1 -1
  718. package/dist/stripe-elements/svg/glasses-outline.svg +1 -1
  719. package/dist/stripe-elements/svg/glasses-sharp.svg +1 -1
  720. package/dist/stripe-elements/svg/glasses.svg +1 -1
  721. package/dist/stripe-elements/svg/globe-outline.svg +1 -1
  722. package/dist/stripe-elements/svg/globe-sharp.svg +1 -1
  723. package/dist/stripe-elements/svg/globe.svg +1 -1
  724. package/dist/stripe-elements/svg/golf-outline.svg +1 -1
  725. package/dist/stripe-elements/svg/golf-sharp.svg +1 -1
  726. package/dist/stripe-elements/svg/golf.svg +1 -1
  727. package/dist/stripe-elements/svg/grid-outline.svg +1 -1
  728. package/dist/stripe-elements/svg/grid-sharp.svg +1 -1
  729. package/dist/stripe-elements/svg/grid.svg +1 -1
  730. package/dist/stripe-elements/svg/hammer-outline.svg +1 -1
  731. package/dist/stripe-elements/svg/hammer-sharp.svg +1 -1
  732. package/dist/stripe-elements/svg/hammer.svg +1 -1
  733. package/dist/stripe-elements/svg/hand-left-outline.svg +1 -1
  734. package/dist/stripe-elements/svg/hand-left-sharp.svg +1 -1
  735. package/dist/stripe-elements/svg/hand-left.svg +1 -1
  736. package/dist/stripe-elements/svg/hand-right-outline.svg +1 -1
  737. package/dist/stripe-elements/svg/hand-right-sharp.svg +1 -1
  738. package/dist/stripe-elements/svg/hand-right.svg +1 -1
  739. package/dist/stripe-elements/svg/happy-outline.svg +1 -1
  740. package/dist/stripe-elements/svg/happy-sharp.svg +1 -1
  741. package/dist/stripe-elements/svg/happy.svg +1 -1
  742. package/dist/stripe-elements/svg/hardware-chip-outline.svg +1 -1
  743. package/dist/stripe-elements/svg/hardware-chip-sharp.svg +1 -1
  744. package/dist/stripe-elements/svg/hardware-chip.svg +1 -1
  745. package/dist/stripe-elements/svg/headset-outline.svg +1 -1
  746. package/dist/stripe-elements/svg/headset-sharp.svg +1 -1
  747. package/dist/stripe-elements/svg/headset.svg +1 -1
  748. package/dist/stripe-elements/svg/heart-circle-outline.svg +1 -1
  749. package/dist/stripe-elements/svg/heart-circle-sharp.svg +1 -1
  750. package/dist/stripe-elements/svg/heart-circle.svg +1 -1
  751. package/dist/stripe-elements/svg/heart-dislike-circle-outline.svg +1 -1
  752. package/dist/stripe-elements/svg/heart-dislike-circle-sharp.svg +1 -1
  753. package/dist/stripe-elements/svg/heart-dislike-circle.svg +1 -1
  754. package/dist/stripe-elements/svg/heart-dislike-outline.svg +1 -1
  755. package/dist/stripe-elements/svg/heart-dislike-sharp.svg +1 -1
  756. package/dist/stripe-elements/svg/heart-dislike.svg +1 -1
  757. package/dist/stripe-elements/svg/heart-half-outline.svg +1 -1
  758. package/dist/stripe-elements/svg/heart-half-sharp.svg +1 -1
  759. package/dist/stripe-elements/svg/heart-half.svg +1 -1
  760. package/dist/stripe-elements/svg/heart-outline.svg +1 -1
  761. package/dist/stripe-elements/svg/heart-sharp.svg +1 -1
  762. package/dist/stripe-elements/svg/heart.svg +1 -1
  763. package/dist/stripe-elements/svg/help-buoy-outline.svg +1 -1
  764. package/dist/stripe-elements/svg/help-buoy-sharp.svg +1 -1
  765. package/dist/stripe-elements/svg/help-buoy.svg +1 -1
  766. package/dist/stripe-elements/svg/help-circle-outline.svg +1 -1
  767. package/dist/stripe-elements/svg/help-circle-sharp.svg +1 -1
  768. package/dist/stripe-elements/svg/help-circle.svg +1 -1
  769. package/dist/stripe-elements/svg/help-outline.svg +1 -1
  770. package/dist/stripe-elements/svg/help-sharp.svg +1 -1
  771. package/dist/stripe-elements/svg/help.svg +1 -1
  772. package/dist/stripe-elements/svg/home-outline.svg +1 -1
  773. package/dist/stripe-elements/svg/home-sharp.svg +1 -1
  774. package/dist/stripe-elements/svg/home.svg +1 -1
  775. package/dist/stripe-elements/svg/hourglass-outline.svg +1 -1
  776. package/dist/stripe-elements/svg/hourglass-sharp.svg +1 -1
  777. package/dist/stripe-elements/svg/hourglass.svg +1 -1
  778. package/dist/stripe-elements/svg/ice-cream-outline.svg +1 -1
  779. package/dist/stripe-elements/svg/ice-cream-sharp.svg +1 -1
  780. package/dist/stripe-elements/svg/ice-cream.svg +1 -1
  781. package/dist/stripe-elements/svg/id-card-outline.svg +1 -1
  782. package/dist/stripe-elements/svg/id-card-sharp.svg +1 -1
  783. package/dist/stripe-elements/svg/id-card.svg +1 -1
  784. package/dist/stripe-elements/svg/image-outline.svg +1 -1
  785. package/dist/stripe-elements/svg/image-sharp.svg +1 -1
  786. package/dist/stripe-elements/svg/image.svg +1 -1
  787. package/dist/stripe-elements/svg/images-outline.svg +1 -1
  788. package/dist/stripe-elements/svg/images-sharp.svg +1 -1
  789. package/dist/stripe-elements/svg/images.svg +1 -1
  790. package/dist/stripe-elements/svg/infinite-outline.svg +1 -1
  791. package/dist/stripe-elements/svg/infinite-sharp.svg +1 -1
  792. package/dist/stripe-elements/svg/infinite.svg +1 -1
  793. package/dist/stripe-elements/svg/information-circle-outline.svg +1 -1
  794. package/dist/stripe-elements/svg/information-circle-sharp.svg +1 -1
  795. package/dist/stripe-elements/svg/information-circle.svg +1 -1
  796. package/dist/stripe-elements/svg/information-outline.svg +1 -1
  797. package/dist/stripe-elements/svg/information-sharp.svg +1 -1
  798. package/dist/stripe-elements/svg/information.svg +1 -1
  799. package/dist/stripe-elements/svg/invert-mode-outline.svg +1 -1
  800. package/dist/stripe-elements/svg/invert-mode-sharp.svg +1 -1
  801. package/dist/stripe-elements/svg/invert-mode.svg +1 -1
  802. package/dist/stripe-elements/svg/journal-outline.svg +1 -1
  803. package/dist/stripe-elements/svg/journal-sharp.svg +1 -1
  804. package/dist/stripe-elements/svg/journal.svg +1 -1
  805. package/dist/stripe-elements/svg/key-outline.svg +1 -1
  806. package/dist/stripe-elements/svg/key-sharp.svg +1 -1
  807. package/dist/stripe-elements/svg/key.svg +1 -1
  808. package/dist/stripe-elements/svg/keypad-outline.svg +1 -1
  809. package/dist/stripe-elements/svg/keypad-sharp.svg +1 -1
  810. package/dist/stripe-elements/svg/keypad.svg +1 -1
  811. package/dist/stripe-elements/svg/language-outline.svg +1 -1
  812. package/dist/stripe-elements/svg/language-sharp.svg +1 -1
  813. package/dist/stripe-elements/svg/language.svg +1 -1
  814. package/dist/stripe-elements/svg/laptop-outline.svg +1 -1
  815. package/dist/stripe-elements/svg/laptop-sharp.svg +1 -1
  816. package/dist/stripe-elements/svg/laptop.svg +1 -1
  817. package/dist/stripe-elements/svg/layers-outline.svg +1 -1
  818. package/dist/stripe-elements/svg/layers-sharp.svg +1 -1
  819. package/dist/stripe-elements/svg/layers.svg +1 -1
  820. package/dist/stripe-elements/svg/leaf-outline.svg +1 -1
  821. package/dist/stripe-elements/svg/leaf-sharp.svg +1 -1
  822. package/dist/stripe-elements/svg/leaf.svg +1 -1
  823. package/dist/stripe-elements/svg/library-outline.svg +1 -1
  824. package/dist/stripe-elements/svg/library-sharp.svg +1 -1
  825. package/dist/stripe-elements/svg/library.svg +1 -1
  826. package/dist/stripe-elements/svg/link-outline.svg +1 -1
  827. package/dist/stripe-elements/svg/link-sharp.svg +1 -1
  828. package/dist/stripe-elements/svg/link.svg +1 -1
  829. package/dist/stripe-elements/svg/list-circle-outline.svg +1 -1
  830. package/dist/stripe-elements/svg/list-circle-sharp.svg +1 -1
  831. package/dist/stripe-elements/svg/list-circle.svg +1 -1
  832. package/dist/stripe-elements/svg/list-outline.svg +1 -1
  833. package/dist/stripe-elements/svg/list-sharp.svg +1 -1
  834. package/dist/stripe-elements/svg/list.svg +1 -1
  835. package/dist/stripe-elements/svg/locate-outline.svg +1 -1
  836. package/dist/stripe-elements/svg/locate-sharp.svg +1 -1
  837. package/dist/stripe-elements/svg/locate.svg +1 -1
  838. package/dist/stripe-elements/svg/location-outline.svg +1 -1
  839. package/dist/stripe-elements/svg/location-sharp.svg +1 -1
  840. package/dist/stripe-elements/svg/location.svg +1 -1
  841. package/dist/stripe-elements/svg/lock-closed-outline.svg +1 -1
  842. package/dist/stripe-elements/svg/lock-closed-sharp.svg +1 -1
  843. package/dist/stripe-elements/svg/lock-closed.svg +1 -1
  844. package/dist/stripe-elements/svg/lock-open-outline.svg +1 -1
  845. package/dist/stripe-elements/svg/lock-open-sharp.svg +1 -1
  846. package/dist/stripe-elements/svg/lock-open.svg +1 -1
  847. package/dist/stripe-elements/svg/log-in-outline.svg +1 -1
  848. package/dist/stripe-elements/svg/log-in-sharp.svg +1 -1
  849. package/dist/stripe-elements/svg/log-in.svg +1 -1
  850. package/dist/stripe-elements/svg/log-out-outline.svg +1 -1
  851. package/dist/stripe-elements/svg/log-out-sharp.svg +1 -1
  852. package/dist/stripe-elements/svg/log-out.svg +1 -1
  853. package/dist/stripe-elements/svg/logo-alipay.svg +1 -1
  854. package/dist/stripe-elements/svg/logo-amazon.svg +1 -1
  855. package/dist/stripe-elements/svg/logo-amplify.svg +1 -1
  856. package/dist/stripe-elements/svg/logo-android.svg +1 -1
  857. package/dist/stripe-elements/svg/logo-angular.svg +1 -1
  858. package/dist/stripe-elements/svg/logo-appflow.svg +1 -0
  859. package/dist/stripe-elements/svg/logo-apple-appstore.svg +1 -1
  860. package/dist/stripe-elements/svg/logo-apple-ar.svg +1 -1
  861. package/dist/stripe-elements/svg/logo-apple.svg +1 -1
  862. package/dist/stripe-elements/svg/logo-behance.svg +1 -1
  863. package/dist/stripe-elements/svg/logo-bitbucket.svg +1 -1
  864. package/dist/stripe-elements/svg/logo-bitcoin.svg +1 -1
  865. package/dist/stripe-elements/svg/logo-buffer.svg +1 -1
  866. package/dist/stripe-elements/svg/logo-capacitor.svg +1 -1
  867. package/dist/stripe-elements/svg/logo-chrome.svg +1 -1
  868. package/dist/stripe-elements/svg/logo-closed-captioning.svg +1 -1
  869. package/dist/stripe-elements/svg/logo-codepen.svg +1 -1
  870. package/dist/stripe-elements/svg/logo-css3.svg +1 -1
  871. package/dist/stripe-elements/svg/logo-designernews.svg +1 -1
  872. package/dist/stripe-elements/svg/logo-deviantart.svg +1 -1
  873. package/dist/stripe-elements/svg/logo-discord.svg +1 -1
  874. package/dist/stripe-elements/svg/logo-docker.svg +1 -1
  875. package/dist/stripe-elements/svg/logo-dribbble.svg +1 -1
  876. package/dist/stripe-elements/svg/logo-dropbox.svg +1 -1
  877. package/dist/stripe-elements/svg/logo-edge.svg +1 -1
  878. package/dist/stripe-elements/svg/logo-electron.svg +1 -1
  879. package/dist/stripe-elements/svg/logo-euro.svg +1 -1
  880. package/dist/stripe-elements/svg/logo-facebook.svg +1 -1
  881. package/dist/stripe-elements/svg/logo-figma.svg +1 -1
  882. package/dist/stripe-elements/svg/logo-firebase.svg +1 -1
  883. package/dist/stripe-elements/svg/logo-firefox.svg +1 -1
  884. package/dist/stripe-elements/svg/logo-flickr.svg +1 -1
  885. package/dist/stripe-elements/svg/logo-foursquare.svg +1 -1
  886. package/dist/stripe-elements/svg/logo-github.svg +1 -1
  887. package/dist/stripe-elements/svg/logo-gitlab.svg +1 -1
  888. package/dist/stripe-elements/svg/logo-google-playstore.svg +1 -1
  889. package/dist/stripe-elements/svg/logo-google.svg +1 -1
  890. package/dist/stripe-elements/svg/logo-hackernews.svg +1 -1
  891. package/dist/stripe-elements/svg/logo-html5.svg +1 -1
  892. package/dist/stripe-elements/svg/logo-instagram.svg +1 -1
  893. package/dist/stripe-elements/svg/logo-ionic.svg +1 -1
  894. package/dist/stripe-elements/svg/logo-ionitron.svg +1 -1
  895. package/dist/stripe-elements/svg/logo-javascript.svg +1 -1
  896. package/dist/stripe-elements/svg/logo-laravel.svg +1 -1
  897. package/dist/stripe-elements/svg/logo-linkedin.svg +1 -1
  898. package/dist/stripe-elements/svg/logo-markdown.svg +1 -1
  899. package/dist/stripe-elements/svg/logo-mastodon.svg +1 -1
  900. package/dist/stripe-elements/svg/logo-medium.svg +1 -1
  901. package/dist/stripe-elements/svg/logo-microsoft.svg +1 -1
  902. package/dist/stripe-elements/svg/logo-no-smoking.svg +1 -1
  903. package/dist/stripe-elements/svg/logo-nodejs.svg +1 -1
  904. package/dist/stripe-elements/svg/logo-npm.svg +1 -1
  905. package/dist/stripe-elements/svg/logo-octocat.svg +1 -1
  906. package/dist/stripe-elements/svg/logo-paypal.svg +1 -1
  907. package/dist/stripe-elements/svg/logo-pinterest.svg +1 -1
  908. package/dist/stripe-elements/svg/logo-playstation.svg +1 -1
  909. package/dist/stripe-elements/svg/logo-pwa.svg +1 -1
  910. package/dist/stripe-elements/svg/logo-python.svg +1 -1
  911. package/dist/stripe-elements/svg/logo-react.svg +1 -1
  912. package/dist/stripe-elements/svg/logo-reddit.svg +1 -1
  913. package/dist/stripe-elements/svg/logo-rss.svg +1 -1
  914. package/dist/stripe-elements/svg/logo-sass.svg +1 -1
  915. package/dist/stripe-elements/svg/logo-skype.svg +1 -1
  916. package/dist/stripe-elements/svg/logo-slack.svg +1 -1
  917. package/dist/stripe-elements/svg/logo-snapchat.svg +1 -1
  918. package/dist/stripe-elements/svg/logo-soundcloud.svg +1 -1
  919. package/dist/stripe-elements/svg/logo-stackoverflow.svg +1 -1
  920. package/dist/stripe-elements/svg/logo-steam.svg +1 -1
  921. package/dist/stripe-elements/svg/logo-stencil.svg +1 -1
  922. package/dist/stripe-elements/svg/logo-tableau.svg +1 -1
  923. package/dist/stripe-elements/svg/logo-threads.svg +1 -0
  924. package/dist/stripe-elements/svg/logo-tiktok.svg +1 -1
  925. package/dist/stripe-elements/svg/logo-trapeze.svg +1 -0
  926. package/dist/stripe-elements/svg/logo-tumblr.svg +1 -1
  927. package/dist/stripe-elements/svg/logo-tux.svg +1 -1
  928. package/dist/stripe-elements/svg/logo-twitch.svg +1 -1
  929. package/dist/stripe-elements/svg/logo-twitter.svg +1 -1
  930. package/dist/stripe-elements/svg/logo-usd.svg +1 -1
  931. package/dist/stripe-elements/svg/logo-venmo.svg +1 -1
  932. package/dist/stripe-elements/svg/logo-vercel.svg +1 -1
  933. package/dist/stripe-elements/svg/logo-vimeo.svg +1 -1
  934. package/dist/stripe-elements/svg/logo-vk.svg +1 -1
  935. package/dist/stripe-elements/svg/logo-vue.svg +1 -1
  936. package/dist/stripe-elements/svg/logo-web-component.svg +1 -1
  937. package/dist/stripe-elements/svg/logo-wechat.svg +1 -1
  938. package/dist/stripe-elements/svg/logo-whatsapp.svg +1 -1
  939. package/dist/stripe-elements/svg/logo-windows.svg +1 -1
  940. package/dist/stripe-elements/svg/logo-wordpress.svg +1 -1
  941. package/dist/stripe-elements/svg/logo-x.svg +1 -0
  942. package/dist/stripe-elements/svg/logo-xbox.svg +1 -1
  943. package/dist/stripe-elements/svg/logo-xing.svg +1 -1
  944. package/dist/stripe-elements/svg/logo-yahoo.svg +1 -1
  945. package/dist/stripe-elements/svg/logo-yen.svg +1 -1
  946. package/dist/stripe-elements/svg/logo-youtube.svg +1 -1
  947. package/dist/stripe-elements/svg/magnet-outline.svg +1 -1
  948. package/dist/stripe-elements/svg/magnet-sharp.svg +1 -1
  949. package/dist/stripe-elements/svg/magnet.svg +1 -1
  950. package/dist/stripe-elements/svg/mail-open-outline.svg +1 -1
  951. package/dist/stripe-elements/svg/mail-open-sharp.svg +1 -1
  952. package/dist/stripe-elements/svg/mail-open.svg +1 -1
  953. package/dist/stripe-elements/svg/mail-outline.svg +1 -1
  954. package/dist/stripe-elements/svg/mail-sharp.svg +1 -1
  955. package/dist/stripe-elements/svg/mail-unread-outline.svg +1 -1
  956. package/dist/stripe-elements/svg/mail-unread-sharp.svg +1 -1
  957. package/dist/stripe-elements/svg/mail-unread.svg +1 -1
  958. package/dist/stripe-elements/svg/mail.svg +1 -1
  959. package/dist/stripe-elements/svg/male-female-outline.svg +1 -1
  960. package/dist/stripe-elements/svg/male-female-sharp.svg +1 -1
  961. package/dist/stripe-elements/svg/male-female.svg +1 -1
  962. package/dist/stripe-elements/svg/male-outline.svg +1 -1
  963. package/dist/stripe-elements/svg/male-sharp.svg +1 -1
  964. package/dist/stripe-elements/svg/male.svg +1 -1
  965. package/dist/stripe-elements/svg/man-outline.svg +1 -1
  966. package/dist/stripe-elements/svg/man-sharp.svg +1 -1
  967. package/dist/stripe-elements/svg/man.svg +1 -1
  968. package/dist/stripe-elements/svg/map-outline.svg +1 -1
  969. package/dist/stripe-elements/svg/map-sharp.svg +1 -1
  970. package/dist/stripe-elements/svg/map.svg +1 -1
  971. package/dist/stripe-elements/svg/medal-outline.svg +1 -1
  972. package/dist/stripe-elements/svg/medal-sharp.svg +1 -1
  973. package/dist/stripe-elements/svg/medal.svg +1 -1
  974. package/dist/stripe-elements/svg/medical-outline.svg +1 -1
  975. package/dist/stripe-elements/svg/medical-sharp.svg +1 -1
  976. package/dist/stripe-elements/svg/medical.svg +1 -1
  977. package/dist/stripe-elements/svg/medkit-outline.svg +1 -1
  978. package/dist/stripe-elements/svg/medkit-sharp.svg +1 -1
  979. package/dist/stripe-elements/svg/medkit.svg +1 -1
  980. package/dist/stripe-elements/svg/megaphone-outline.svg +1 -1
  981. package/dist/stripe-elements/svg/megaphone-sharp.svg +1 -1
  982. package/dist/stripe-elements/svg/megaphone.svg +1 -1
  983. package/dist/stripe-elements/svg/menu-outline.svg +1 -1
  984. package/dist/stripe-elements/svg/menu-sharp.svg +1 -1
  985. package/dist/stripe-elements/svg/menu.svg +1 -1
  986. package/dist/stripe-elements/svg/mic-circle-outline.svg +1 -1
  987. package/dist/stripe-elements/svg/mic-circle-sharp.svg +1 -1
  988. package/dist/stripe-elements/svg/mic-circle.svg +1 -1
  989. package/dist/stripe-elements/svg/mic-off-circle-outline.svg +1 -1
  990. package/dist/stripe-elements/svg/mic-off-circle-sharp.svg +1 -1
  991. package/dist/stripe-elements/svg/mic-off-circle.svg +1 -1
  992. package/dist/stripe-elements/svg/mic-off-outline.svg +1 -1
  993. package/dist/stripe-elements/svg/mic-off-sharp.svg +1 -1
  994. package/dist/stripe-elements/svg/mic-off.svg +1 -1
  995. package/dist/stripe-elements/svg/mic-outline.svg +1 -1
  996. package/dist/stripe-elements/svg/mic-sharp.svg +1 -1
  997. package/dist/stripe-elements/svg/mic.svg +1 -1
  998. package/dist/stripe-elements/svg/moon-outline.svg +1 -1
  999. package/dist/stripe-elements/svg/moon-sharp.svg +1 -1
  1000. package/dist/stripe-elements/svg/moon.svg +1 -1
  1001. package/dist/stripe-elements/svg/move-outline.svg +1 -1
  1002. package/dist/stripe-elements/svg/move-sharp.svg +1 -1
  1003. package/dist/stripe-elements/svg/move.svg +1 -1
  1004. package/dist/stripe-elements/svg/musical-note-outline.svg +1 -1
  1005. package/dist/stripe-elements/svg/musical-note-sharp.svg +1 -1
  1006. package/dist/stripe-elements/svg/musical-note.svg +1 -1
  1007. package/dist/stripe-elements/svg/musical-notes-outline.svg +1 -1
  1008. package/dist/stripe-elements/svg/musical-notes-sharp.svg +1 -1
  1009. package/dist/stripe-elements/svg/musical-notes.svg +1 -1
  1010. package/dist/stripe-elements/svg/navigate-circle-outline.svg +1 -1
  1011. package/dist/stripe-elements/svg/navigate-circle-sharp.svg +1 -1
  1012. package/dist/stripe-elements/svg/navigate-circle.svg +1 -1
  1013. package/dist/stripe-elements/svg/navigate-outline.svg +1 -1
  1014. package/dist/stripe-elements/svg/navigate-sharp.svg +1 -1
  1015. package/dist/stripe-elements/svg/navigate.svg +1 -1
  1016. package/dist/stripe-elements/svg/newspaper-outline.svg +1 -1
  1017. package/dist/stripe-elements/svg/newspaper-sharp.svg +1 -1
  1018. package/dist/stripe-elements/svg/newspaper.svg +1 -1
  1019. package/dist/stripe-elements/svg/notifications-circle-outline.svg +1 -1
  1020. package/dist/stripe-elements/svg/notifications-circle-sharp.svg +1 -1
  1021. package/dist/stripe-elements/svg/notifications-circle.svg +1 -1
  1022. package/dist/stripe-elements/svg/notifications-off-circle-outline.svg +1 -1
  1023. package/dist/stripe-elements/svg/notifications-off-circle-sharp.svg +1 -1
  1024. package/dist/stripe-elements/svg/notifications-off-circle.svg +1 -1
  1025. package/dist/stripe-elements/svg/notifications-off-outline.svg +1 -1
  1026. package/dist/stripe-elements/svg/notifications-off-sharp.svg +1 -1
  1027. package/dist/stripe-elements/svg/notifications-off.svg +1 -1
  1028. package/dist/stripe-elements/svg/notifications-outline.svg +1 -1
  1029. package/dist/stripe-elements/svg/notifications-sharp.svg +1 -1
  1030. package/dist/stripe-elements/svg/notifications.svg +1 -1
  1031. package/dist/stripe-elements/svg/nuclear-outline.svg +1 -1
  1032. package/dist/stripe-elements/svg/nuclear-sharp.svg +1 -1
  1033. package/dist/stripe-elements/svg/nuclear.svg +1 -1
  1034. package/dist/stripe-elements/svg/nutrition-outline.svg +1 -1
  1035. package/dist/stripe-elements/svg/nutrition-sharp.svg +1 -1
  1036. package/dist/stripe-elements/svg/nutrition.svg +1 -1
  1037. package/dist/stripe-elements/svg/open-outline.svg +1 -1
  1038. package/dist/stripe-elements/svg/open-sharp.svg +1 -1
  1039. package/dist/stripe-elements/svg/open.svg +1 -1
  1040. package/dist/stripe-elements/svg/options-outline.svg +1 -1
  1041. package/dist/stripe-elements/svg/options-sharp.svg +1 -1
  1042. package/dist/stripe-elements/svg/options.svg +1 -1
  1043. package/dist/stripe-elements/svg/paper-plane-outline.svg +1 -1
  1044. package/dist/stripe-elements/svg/paper-plane-sharp.svg +1 -1
  1045. package/dist/stripe-elements/svg/paper-plane.svg +1 -1
  1046. package/dist/stripe-elements/svg/partly-sunny-outline.svg +1 -1
  1047. package/dist/stripe-elements/svg/partly-sunny-sharp.svg +1 -1
  1048. package/dist/stripe-elements/svg/partly-sunny.svg +1 -1
  1049. package/dist/stripe-elements/svg/pause-circle-outline.svg +1 -1
  1050. package/dist/stripe-elements/svg/pause-circle-sharp.svg +1 -1
  1051. package/dist/stripe-elements/svg/pause-circle.svg +1 -1
  1052. package/dist/stripe-elements/svg/pause-outline.svg +1 -1
  1053. package/dist/stripe-elements/svg/pause-sharp.svg +1 -1
  1054. package/dist/stripe-elements/svg/pause.svg +1 -1
  1055. package/dist/stripe-elements/svg/paw-outline.svg +1 -1
  1056. package/dist/stripe-elements/svg/paw-sharp.svg +1 -1
  1057. package/dist/stripe-elements/svg/paw.svg +1 -1
  1058. package/dist/stripe-elements/svg/pencil-outline.svg +1 -1
  1059. package/dist/stripe-elements/svg/pencil-sharp.svg +1 -1
  1060. package/dist/stripe-elements/svg/pencil.svg +1 -1
  1061. package/dist/stripe-elements/svg/people-circle-outline.svg +1 -1
  1062. package/dist/stripe-elements/svg/people-circle-sharp.svg +1 -1
  1063. package/dist/stripe-elements/svg/people-circle.svg +1 -1
  1064. package/dist/stripe-elements/svg/people-outline.svg +1 -1
  1065. package/dist/stripe-elements/svg/people-sharp.svg +1 -1
  1066. package/dist/stripe-elements/svg/people.svg +1 -1
  1067. package/dist/stripe-elements/svg/person-add-outline.svg +1 -1
  1068. package/dist/stripe-elements/svg/person-add-sharp.svg +1 -1
  1069. package/dist/stripe-elements/svg/person-add.svg +1 -1
  1070. package/dist/stripe-elements/svg/person-circle-outline.svg +1 -1
  1071. package/dist/stripe-elements/svg/person-circle-sharp.svg +1 -1
  1072. package/dist/stripe-elements/svg/person-circle.svg +1 -1
  1073. package/dist/stripe-elements/svg/person-outline.svg +1 -1
  1074. package/dist/stripe-elements/svg/person-remove-outline.svg +1 -1
  1075. package/dist/stripe-elements/svg/person-remove-sharp.svg +1 -1
  1076. package/dist/stripe-elements/svg/person-remove.svg +1 -1
  1077. package/dist/stripe-elements/svg/person-sharp.svg +1 -1
  1078. package/dist/stripe-elements/svg/person.svg +1 -1
  1079. package/dist/stripe-elements/svg/phone-landscape-outline.svg +1 -1
  1080. package/dist/stripe-elements/svg/phone-landscape-sharp.svg +1 -1
  1081. package/dist/stripe-elements/svg/phone-landscape.svg +1 -1
  1082. package/dist/stripe-elements/svg/phone-portrait-outline.svg +1 -1
  1083. package/dist/stripe-elements/svg/phone-portrait-sharp.svg +1 -1
  1084. package/dist/stripe-elements/svg/phone-portrait.svg +1 -1
  1085. package/dist/stripe-elements/svg/pie-chart-outline.svg +1 -1
  1086. package/dist/stripe-elements/svg/pie-chart-sharp.svg +1 -1
  1087. package/dist/stripe-elements/svg/pie-chart.svg +1 -1
  1088. package/dist/stripe-elements/svg/pin-outline.svg +1 -1
  1089. package/dist/stripe-elements/svg/pin-sharp.svg +1 -1
  1090. package/dist/stripe-elements/svg/pin.svg +1 -1
  1091. package/dist/stripe-elements/svg/pint-outline.svg +1 -1
  1092. package/dist/stripe-elements/svg/pint-sharp.svg +1 -1
  1093. package/dist/stripe-elements/svg/pint.svg +1 -1
  1094. package/dist/stripe-elements/svg/pizza-outline.svg +1 -1
  1095. package/dist/stripe-elements/svg/pizza-sharp.svg +1 -1
  1096. package/dist/stripe-elements/svg/pizza.svg +1 -1
  1097. package/dist/stripe-elements/svg/planet-outline.svg +1 -1
  1098. package/dist/stripe-elements/svg/planet-sharp.svg +1 -1
  1099. package/dist/stripe-elements/svg/planet.svg +1 -1
  1100. package/dist/stripe-elements/svg/play-back-circle-outline.svg +1 -1
  1101. package/dist/stripe-elements/svg/play-back-circle-sharp.svg +1 -1
  1102. package/dist/stripe-elements/svg/play-back-circle.svg +1 -1
  1103. package/dist/stripe-elements/svg/play-back-outline.svg +1 -1
  1104. package/dist/stripe-elements/svg/play-back-sharp.svg +1 -1
  1105. package/dist/stripe-elements/svg/play-back.svg +1 -1
  1106. package/dist/stripe-elements/svg/play-circle-outline.svg +1 -1
  1107. package/dist/stripe-elements/svg/play-circle-sharp.svg +1 -1
  1108. package/dist/stripe-elements/svg/play-circle.svg +1 -1
  1109. package/dist/stripe-elements/svg/play-forward-circle-outline.svg +1 -1
  1110. package/dist/stripe-elements/svg/play-forward-circle-sharp.svg +1 -1
  1111. package/dist/stripe-elements/svg/play-forward-circle.svg +1 -1
  1112. package/dist/stripe-elements/svg/play-forward-outline.svg +1 -1
  1113. package/dist/stripe-elements/svg/play-forward-sharp.svg +1 -1
  1114. package/dist/stripe-elements/svg/play-forward.svg +1 -1
  1115. package/dist/stripe-elements/svg/play-outline.svg +1 -1
  1116. package/dist/stripe-elements/svg/play-sharp.svg +1 -1
  1117. package/dist/stripe-elements/svg/play-skip-back-circle-outline.svg +1 -1
  1118. package/dist/stripe-elements/svg/play-skip-back-circle-sharp.svg +1 -1
  1119. package/dist/stripe-elements/svg/play-skip-back-circle.svg +1 -1
  1120. package/dist/stripe-elements/svg/play-skip-back-outline.svg +1 -1
  1121. package/dist/stripe-elements/svg/play-skip-back-sharp.svg +1 -1
  1122. package/dist/stripe-elements/svg/play-skip-back.svg +1 -1
  1123. package/dist/stripe-elements/svg/play-skip-forward-circle-outline.svg +1 -1
  1124. package/dist/stripe-elements/svg/play-skip-forward-circle-sharp.svg +1 -1
  1125. package/dist/stripe-elements/svg/play-skip-forward-circle.svg +1 -1
  1126. package/dist/stripe-elements/svg/play-skip-forward-outline.svg +1 -1
  1127. package/dist/stripe-elements/svg/play-skip-forward-sharp.svg +1 -1
  1128. package/dist/stripe-elements/svg/play-skip-forward.svg +1 -1
  1129. package/dist/stripe-elements/svg/play.svg +1 -1
  1130. package/dist/stripe-elements/svg/podium-outline.svg +1 -1
  1131. package/dist/stripe-elements/svg/podium-sharp.svg +1 -1
  1132. package/dist/stripe-elements/svg/podium.svg +1 -1
  1133. package/dist/stripe-elements/svg/power-outline.svg +1 -1
  1134. package/dist/stripe-elements/svg/power-sharp.svg +1 -1
  1135. package/dist/stripe-elements/svg/power.svg +1 -1
  1136. package/dist/stripe-elements/svg/pricetag-outline.svg +1 -1
  1137. package/dist/stripe-elements/svg/pricetag-sharp.svg +1 -1
  1138. package/dist/stripe-elements/svg/pricetag.svg +1 -1
  1139. package/dist/stripe-elements/svg/pricetags-outline.svg +1 -1
  1140. package/dist/stripe-elements/svg/pricetags-sharp.svg +1 -1
  1141. package/dist/stripe-elements/svg/pricetags.svg +1 -1
  1142. package/dist/stripe-elements/svg/print-outline.svg +1 -1
  1143. package/dist/stripe-elements/svg/print-sharp.svg +1 -1
  1144. package/dist/stripe-elements/svg/print.svg +1 -1
  1145. package/dist/stripe-elements/svg/prism-outline.svg +1 -1
  1146. package/dist/stripe-elements/svg/prism-sharp.svg +1 -1
  1147. package/dist/stripe-elements/svg/prism.svg +1 -1
  1148. package/dist/stripe-elements/svg/pulse-outline.svg +1 -1
  1149. package/dist/stripe-elements/svg/pulse-sharp.svg +1 -1
  1150. package/dist/stripe-elements/svg/pulse.svg +1 -1
  1151. package/dist/stripe-elements/svg/push-outline.svg +1 -1
  1152. package/dist/stripe-elements/svg/push-sharp.svg +1 -1
  1153. package/dist/stripe-elements/svg/push.svg +1 -1
  1154. package/dist/stripe-elements/svg/qr-code-outline.svg +1 -1
  1155. package/dist/stripe-elements/svg/qr-code-sharp.svg +1 -1
  1156. package/dist/stripe-elements/svg/qr-code.svg +1 -1
  1157. package/dist/stripe-elements/svg/radio-button-off-outline.svg +1 -1
  1158. package/dist/stripe-elements/svg/radio-button-off-sharp.svg +1 -1
  1159. package/dist/stripe-elements/svg/radio-button-off.svg +1 -1
  1160. package/dist/stripe-elements/svg/radio-button-on-outline.svg +1 -1
  1161. package/dist/stripe-elements/svg/radio-button-on-sharp.svg +1 -1
  1162. package/dist/stripe-elements/svg/radio-button-on.svg +1 -1
  1163. package/dist/stripe-elements/svg/radio-outline.svg +1 -1
  1164. package/dist/stripe-elements/svg/radio-sharp.svg +1 -1
  1165. package/dist/stripe-elements/svg/radio.svg +1 -1
  1166. package/dist/stripe-elements/svg/rainy-outline.svg +1 -1
  1167. package/dist/stripe-elements/svg/rainy-sharp.svg +1 -1
  1168. package/dist/stripe-elements/svg/rainy.svg +1 -1
  1169. package/dist/stripe-elements/svg/reader-outline.svg +1 -1
  1170. package/dist/stripe-elements/svg/reader-sharp.svg +1 -1
  1171. package/dist/stripe-elements/svg/reader.svg +1 -1
  1172. package/dist/stripe-elements/svg/receipt-outline.svg +1 -1
  1173. package/dist/stripe-elements/svg/receipt-sharp.svg +1 -1
  1174. package/dist/stripe-elements/svg/receipt.svg +1 -1
  1175. package/dist/stripe-elements/svg/recording-outline.svg +1 -1
  1176. package/dist/stripe-elements/svg/recording-sharp.svg +1 -1
  1177. package/dist/stripe-elements/svg/recording.svg +1 -1
  1178. package/dist/stripe-elements/svg/refresh-circle-outline.svg +1 -1
  1179. package/dist/stripe-elements/svg/refresh-circle-sharp.svg +1 -1
  1180. package/dist/stripe-elements/svg/refresh-circle.svg +1 -1
  1181. package/dist/stripe-elements/svg/refresh-outline.svg +1 -1
  1182. package/dist/stripe-elements/svg/refresh-sharp.svg +1 -1
  1183. package/dist/stripe-elements/svg/refresh.svg +1 -1
  1184. package/dist/stripe-elements/svg/reload-circle-outline.svg +1 -1
  1185. package/dist/stripe-elements/svg/reload-circle-sharp.svg +1 -1
  1186. package/dist/stripe-elements/svg/reload-circle.svg +1 -1
  1187. package/dist/stripe-elements/svg/reload-outline.svg +1 -1
  1188. package/dist/stripe-elements/svg/reload-sharp.svg +1 -1
  1189. package/dist/stripe-elements/svg/reload.svg +1 -1
  1190. package/dist/stripe-elements/svg/remove-circle-outline.svg +1 -1
  1191. package/dist/stripe-elements/svg/remove-circle-sharp.svg +1 -1
  1192. package/dist/stripe-elements/svg/remove-circle.svg +1 -1
  1193. package/dist/stripe-elements/svg/remove-outline.svg +1 -1
  1194. package/dist/stripe-elements/svg/remove-sharp.svg +1 -1
  1195. package/dist/stripe-elements/svg/remove.svg +1 -1
  1196. package/dist/stripe-elements/svg/reorder-four-outline.svg +1 -1
  1197. package/dist/stripe-elements/svg/reorder-four-sharp.svg +1 -1
  1198. package/dist/stripe-elements/svg/reorder-four.svg +1 -1
  1199. package/dist/stripe-elements/svg/reorder-three-outline.svg +1 -1
  1200. package/dist/stripe-elements/svg/reorder-three-sharp.svg +1 -1
  1201. package/dist/stripe-elements/svg/reorder-three.svg +1 -1
  1202. package/dist/stripe-elements/svg/reorder-two-outline.svg +1 -1
  1203. package/dist/stripe-elements/svg/reorder-two-sharp.svg +1 -1
  1204. package/dist/stripe-elements/svg/reorder-two.svg +1 -1
  1205. package/dist/stripe-elements/svg/repeat-outline.svg +1 -1
  1206. package/dist/stripe-elements/svg/repeat-sharp.svg +1 -1
  1207. package/dist/stripe-elements/svg/repeat.svg +1 -1
  1208. package/dist/stripe-elements/svg/resize-outline.svg +1 -1
  1209. package/dist/stripe-elements/svg/resize-sharp.svg +1 -1
  1210. package/dist/stripe-elements/svg/resize.svg +1 -1
  1211. package/dist/stripe-elements/svg/restaurant-outline.svg +1 -1
  1212. package/dist/stripe-elements/svg/restaurant-sharp.svg +1 -1
  1213. package/dist/stripe-elements/svg/restaurant.svg +1 -1
  1214. package/dist/stripe-elements/svg/return-down-back-outline.svg +1 -1
  1215. package/dist/stripe-elements/svg/return-down-back-sharp.svg +1 -1
  1216. package/dist/stripe-elements/svg/return-down-back.svg +1 -1
  1217. package/dist/stripe-elements/svg/return-down-forward-outline.svg +1 -1
  1218. package/dist/stripe-elements/svg/return-down-forward-sharp.svg +1 -1
  1219. package/dist/stripe-elements/svg/return-down-forward.svg +1 -1
  1220. package/dist/stripe-elements/svg/return-up-back-outline.svg +1 -1
  1221. package/dist/stripe-elements/svg/return-up-back-sharp.svg +1 -1
  1222. package/dist/stripe-elements/svg/return-up-back.svg +1 -1
  1223. package/dist/stripe-elements/svg/return-up-forward-outline.svg +1 -1
  1224. package/dist/stripe-elements/svg/return-up-forward-sharp.svg +1 -1
  1225. package/dist/stripe-elements/svg/return-up-forward.svg +1 -1
  1226. package/dist/stripe-elements/svg/ribbon-outline.svg +1 -1
  1227. package/dist/stripe-elements/svg/ribbon-sharp.svg +1 -1
  1228. package/dist/stripe-elements/svg/ribbon.svg +1 -1
  1229. package/dist/stripe-elements/svg/rocket-outline.svg +1 -1
  1230. package/dist/stripe-elements/svg/rocket-sharp.svg +1 -1
  1231. package/dist/stripe-elements/svg/rocket.svg +1 -1
  1232. package/dist/stripe-elements/svg/rose-outline.svg +1 -1
  1233. package/dist/stripe-elements/svg/rose-sharp.svg +1 -1
  1234. package/dist/stripe-elements/svg/rose.svg +1 -1
  1235. package/dist/stripe-elements/svg/sad-outline.svg +1 -1
  1236. package/dist/stripe-elements/svg/sad-sharp.svg +1 -1
  1237. package/dist/stripe-elements/svg/sad.svg +1 -1
  1238. package/dist/stripe-elements/svg/save-outline.svg +1 -1
  1239. package/dist/stripe-elements/svg/save-sharp.svg +1 -1
  1240. package/dist/stripe-elements/svg/save.svg +1 -1
  1241. package/dist/stripe-elements/svg/scale-outline.svg +1 -1
  1242. package/dist/stripe-elements/svg/scale-sharp.svg +1 -1
  1243. package/dist/stripe-elements/svg/scale.svg +1 -1
  1244. package/dist/stripe-elements/svg/scan-circle-outline.svg +1 -1
  1245. package/dist/stripe-elements/svg/scan-circle-sharp.svg +1 -1
  1246. package/dist/stripe-elements/svg/scan-circle.svg +1 -1
  1247. package/dist/stripe-elements/svg/scan-outline.svg +1 -1
  1248. package/dist/stripe-elements/svg/scan-sharp.svg +1 -1
  1249. package/dist/stripe-elements/svg/scan.svg +1 -1
  1250. package/dist/stripe-elements/svg/school-outline.svg +1 -1
  1251. package/dist/stripe-elements/svg/school-sharp.svg +1 -1
  1252. package/dist/stripe-elements/svg/school.svg +1 -1
  1253. package/dist/stripe-elements/svg/search-circle-outline.svg +1 -1
  1254. package/dist/stripe-elements/svg/search-circle-sharp.svg +1 -1
  1255. package/dist/stripe-elements/svg/search-circle.svg +1 -1
  1256. package/dist/stripe-elements/svg/search-outline.svg +1 -1
  1257. package/dist/stripe-elements/svg/search-sharp.svg +1 -1
  1258. package/dist/stripe-elements/svg/search.svg +1 -1
  1259. package/dist/stripe-elements/svg/send-outline.svg +1 -1
  1260. package/dist/stripe-elements/svg/send-sharp.svg +1 -1
  1261. package/dist/stripe-elements/svg/send.svg +1 -1
  1262. package/dist/stripe-elements/svg/server-outline.svg +1 -1
  1263. package/dist/stripe-elements/svg/server-sharp.svg +1 -1
  1264. package/dist/stripe-elements/svg/server.svg +1 -1
  1265. package/dist/stripe-elements/svg/settings-outline.svg +1 -1
  1266. package/dist/stripe-elements/svg/settings-sharp.svg +1 -1
  1267. package/dist/stripe-elements/svg/settings.svg +1 -1
  1268. package/dist/stripe-elements/svg/shapes-outline.svg +1 -1
  1269. package/dist/stripe-elements/svg/shapes-sharp.svg +1 -1
  1270. package/dist/stripe-elements/svg/shapes.svg +1 -1
  1271. package/dist/stripe-elements/svg/share-outline.svg +1 -1
  1272. package/dist/stripe-elements/svg/share-sharp.svg +1 -1
  1273. package/dist/stripe-elements/svg/share-social-outline.svg +1 -1
  1274. package/dist/stripe-elements/svg/share-social-sharp.svg +1 -1
  1275. package/dist/stripe-elements/svg/share-social.svg +1 -1
  1276. package/dist/stripe-elements/svg/share.svg +1 -1
  1277. package/dist/stripe-elements/svg/shield-checkmark-outline.svg +1 -1
  1278. package/dist/stripe-elements/svg/shield-checkmark-sharp.svg +1 -1
  1279. package/dist/stripe-elements/svg/shield-checkmark.svg +1 -1
  1280. package/dist/stripe-elements/svg/shield-half-outline.svg +1 -1
  1281. package/dist/stripe-elements/svg/shield-half-sharp.svg +1 -1
  1282. package/dist/stripe-elements/svg/shield-half.svg +1 -1
  1283. package/dist/stripe-elements/svg/shield-outline.svg +1 -1
  1284. package/dist/stripe-elements/svg/shield-sharp.svg +1 -1
  1285. package/dist/stripe-elements/svg/shield.svg +1 -1
  1286. package/dist/stripe-elements/svg/shirt-outline.svg +1 -1
  1287. package/dist/stripe-elements/svg/shirt-sharp.svg +1 -1
  1288. package/dist/stripe-elements/svg/shirt.svg +1 -1
  1289. package/dist/stripe-elements/svg/shuffle-outline.svg +1 -1
  1290. package/dist/stripe-elements/svg/shuffle-sharp.svg +1 -1
  1291. package/dist/stripe-elements/svg/shuffle.svg +1 -1
  1292. package/dist/stripe-elements/svg/skull-outline.svg +1 -1
  1293. package/dist/stripe-elements/svg/skull-sharp.svg +1 -1
  1294. package/dist/stripe-elements/svg/skull.svg +1 -1
  1295. package/dist/stripe-elements/svg/snow-outline.svg +1 -1
  1296. package/dist/stripe-elements/svg/snow-sharp.svg +1 -1
  1297. package/dist/stripe-elements/svg/snow.svg +1 -1
  1298. package/dist/stripe-elements/svg/sparkles-outline.svg +1 -1
  1299. package/dist/stripe-elements/svg/sparkles-sharp.svg +1 -1
  1300. package/dist/stripe-elements/svg/sparkles.svg +1 -1
  1301. package/dist/stripe-elements/svg/speedometer-outline.svg +1 -1
  1302. package/dist/stripe-elements/svg/speedometer-sharp.svg +1 -1
  1303. package/dist/stripe-elements/svg/speedometer.svg +1 -1
  1304. package/dist/stripe-elements/svg/square-outline.svg +1 -1
  1305. package/dist/stripe-elements/svg/square-sharp.svg +1 -1
  1306. package/dist/stripe-elements/svg/square.svg +1 -1
  1307. package/dist/stripe-elements/svg/star-half-outline.svg +1 -1
  1308. package/dist/stripe-elements/svg/star-half-sharp.svg +1 -1
  1309. package/dist/stripe-elements/svg/star-half.svg +1 -1
  1310. package/dist/stripe-elements/svg/star-outline.svg +1 -1
  1311. package/dist/stripe-elements/svg/star-sharp.svg +1 -1
  1312. package/dist/stripe-elements/svg/star.svg +1 -1
  1313. package/dist/stripe-elements/svg/stats-chart-outline.svg +1 -1
  1314. package/dist/stripe-elements/svg/stats-chart-sharp.svg +1 -1
  1315. package/dist/stripe-elements/svg/stats-chart.svg +1 -1
  1316. package/dist/stripe-elements/svg/stop-circle-outline.svg +1 -1
  1317. package/dist/stripe-elements/svg/stop-circle-sharp.svg +1 -1
  1318. package/dist/stripe-elements/svg/stop-circle.svg +1 -1
  1319. package/dist/stripe-elements/svg/stop-outline.svg +1 -1
  1320. package/dist/stripe-elements/svg/stop-sharp.svg +1 -1
  1321. package/dist/stripe-elements/svg/stop.svg +1 -1
  1322. package/dist/stripe-elements/svg/stopwatch-outline.svg +1 -1
  1323. package/dist/stripe-elements/svg/stopwatch-sharp.svg +1 -1
  1324. package/dist/stripe-elements/svg/stopwatch.svg +1 -1
  1325. package/dist/stripe-elements/svg/storefront-outline.svg +1 -1
  1326. package/dist/stripe-elements/svg/storefront-sharp.svg +1 -1
  1327. package/dist/stripe-elements/svg/storefront.svg +1 -1
  1328. package/dist/stripe-elements/svg/subway-outline.svg +1 -1
  1329. package/dist/stripe-elements/svg/subway-sharp.svg +1 -1
  1330. package/dist/stripe-elements/svg/subway.svg +1 -1
  1331. package/dist/stripe-elements/svg/sunny-outline.svg +1 -1
  1332. package/dist/stripe-elements/svg/sunny-sharp.svg +1 -1
  1333. package/dist/stripe-elements/svg/sunny.svg +1 -1
  1334. package/dist/stripe-elements/svg/swap-horizontal-outline.svg +1 -1
  1335. package/dist/stripe-elements/svg/swap-horizontal-sharp.svg +1 -1
  1336. package/dist/stripe-elements/svg/swap-horizontal.svg +1 -1
  1337. package/dist/stripe-elements/svg/swap-vertical-outline.svg +1 -1
  1338. package/dist/stripe-elements/svg/swap-vertical-sharp.svg +1 -1
  1339. package/dist/stripe-elements/svg/swap-vertical.svg +1 -1
  1340. package/dist/stripe-elements/svg/sync-circle-outline.svg +1 -1
  1341. package/dist/stripe-elements/svg/sync-circle-sharp.svg +1 -1
  1342. package/dist/stripe-elements/svg/sync-circle.svg +1 -1
  1343. package/dist/stripe-elements/svg/sync-outline.svg +1 -1
  1344. package/dist/stripe-elements/svg/sync-sharp.svg +1 -1
  1345. package/dist/stripe-elements/svg/sync.svg +1 -1
  1346. package/dist/stripe-elements/svg/tablet-landscape-outline.svg +1 -1
  1347. package/dist/stripe-elements/svg/tablet-landscape-sharp.svg +1 -1
  1348. package/dist/stripe-elements/svg/tablet-landscape.svg +1 -1
  1349. package/dist/stripe-elements/svg/tablet-portrait-outline.svg +1 -1
  1350. package/dist/stripe-elements/svg/tablet-portrait-sharp.svg +1 -1
  1351. package/dist/stripe-elements/svg/tablet-portrait.svg +1 -1
  1352. package/dist/stripe-elements/svg/telescope-outline.svg +1 -1
  1353. package/dist/stripe-elements/svg/telescope-sharp.svg +1 -1
  1354. package/dist/stripe-elements/svg/telescope.svg +1 -1
  1355. package/dist/stripe-elements/svg/tennisball-outline.svg +1 -1
  1356. package/dist/stripe-elements/svg/tennisball-sharp.svg +1 -1
  1357. package/dist/stripe-elements/svg/tennisball.svg +1 -1
  1358. package/dist/stripe-elements/svg/terminal-outline.svg +1 -1
  1359. package/dist/stripe-elements/svg/terminal-sharp.svg +1 -1
  1360. package/dist/stripe-elements/svg/terminal.svg +1 -1
  1361. package/dist/stripe-elements/svg/text-outline.svg +1 -1
  1362. package/dist/stripe-elements/svg/text-sharp.svg +1 -1
  1363. package/dist/stripe-elements/svg/text.svg +1 -1
  1364. package/dist/stripe-elements/svg/thermometer-outline.svg +1 -1
  1365. package/dist/stripe-elements/svg/thermometer-sharp.svg +1 -1
  1366. package/dist/stripe-elements/svg/thermometer.svg +1 -1
  1367. package/dist/stripe-elements/svg/thumbs-down-outline.svg +1 -1
  1368. package/dist/stripe-elements/svg/thumbs-down-sharp.svg +1 -1
  1369. package/dist/stripe-elements/svg/thumbs-down.svg +1 -1
  1370. package/dist/stripe-elements/svg/thumbs-up-outline.svg +1 -1
  1371. package/dist/stripe-elements/svg/thumbs-up-sharp.svg +1 -1
  1372. package/dist/stripe-elements/svg/thumbs-up.svg +1 -1
  1373. package/dist/stripe-elements/svg/thunderstorm-outline.svg +1 -1
  1374. package/dist/stripe-elements/svg/thunderstorm-sharp.svg +1 -1
  1375. package/dist/stripe-elements/svg/thunderstorm.svg +1 -1
  1376. package/dist/stripe-elements/svg/ticket-outline.svg +1 -1
  1377. package/dist/stripe-elements/svg/ticket-sharp.svg +1 -1
  1378. package/dist/stripe-elements/svg/ticket.svg +1 -1
  1379. package/dist/stripe-elements/svg/time-outline.svg +1 -1
  1380. package/dist/stripe-elements/svg/time-sharp.svg +1 -1
  1381. package/dist/stripe-elements/svg/time.svg +1 -1
  1382. package/dist/stripe-elements/svg/timer-outline.svg +1 -1
  1383. package/dist/stripe-elements/svg/timer-sharp.svg +1 -1
  1384. package/dist/stripe-elements/svg/timer.svg +1 -1
  1385. package/dist/stripe-elements/svg/today-outline.svg +1 -1
  1386. package/dist/stripe-elements/svg/today-sharp.svg +1 -1
  1387. package/dist/stripe-elements/svg/today.svg +1 -1
  1388. package/dist/stripe-elements/svg/toggle-outline.svg +1 -1
  1389. package/dist/stripe-elements/svg/toggle-sharp.svg +1 -1
  1390. package/dist/stripe-elements/svg/toggle.svg +1 -1
  1391. package/dist/stripe-elements/svg/trail-sign-outline.svg +1 -1
  1392. package/dist/stripe-elements/svg/trail-sign-sharp.svg +1 -1
  1393. package/dist/stripe-elements/svg/trail-sign.svg +1 -1
  1394. package/dist/stripe-elements/svg/train-outline.svg +1 -1
  1395. package/dist/stripe-elements/svg/train-sharp.svg +1 -1
  1396. package/dist/stripe-elements/svg/train.svg +1 -1
  1397. package/dist/stripe-elements/svg/transgender-outline.svg +1 -1
  1398. package/dist/stripe-elements/svg/transgender-sharp.svg +1 -1
  1399. package/dist/stripe-elements/svg/transgender.svg +1 -1
  1400. package/dist/stripe-elements/svg/trash-bin-outline.svg +1 -1
  1401. package/dist/stripe-elements/svg/trash-bin-sharp.svg +1 -1
  1402. package/dist/stripe-elements/svg/trash-bin.svg +1 -1
  1403. package/dist/stripe-elements/svg/trash-outline.svg +1 -1
  1404. package/dist/stripe-elements/svg/trash-sharp.svg +1 -1
  1405. package/dist/stripe-elements/svg/trash.svg +1 -1
  1406. package/dist/stripe-elements/svg/trending-down-outline.svg +1 -1
  1407. package/dist/stripe-elements/svg/trending-down-sharp.svg +1 -1
  1408. package/dist/stripe-elements/svg/trending-down.svg +1 -1
  1409. package/dist/stripe-elements/svg/trending-up-outline.svg +1 -1
  1410. package/dist/stripe-elements/svg/trending-up-sharp.svg +1 -1
  1411. package/dist/stripe-elements/svg/trending-up.svg +1 -1
  1412. package/dist/stripe-elements/svg/triangle-outline.svg +1 -1
  1413. package/dist/stripe-elements/svg/triangle-sharp.svg +1 -1
  1414. package/dist/stripe-elements/svg/triangle.svg +1 -1
  1415. package/dist/stripe-elements/svg/trophy-outline.svg +1 -1
  1416. package/dist/stripe-elements/svg/trophy-sharp.svg +1 -1
  1417. package/dist/stripe-elements/svg/trophy.svg +1 -1
  1418. package/dist/stripe-elements/svg/tv-outline.svg +1 -1
  1419. package/dist/stripe-elements/svg/tv-sharp.svg +1 -1
  1420. package/dist/stripe-elements/svg/tv.svg +1 -1
  1421. package/dist/stripe-elements/svg/umbrella-outline.svg +1 -1
  1422. package/dist/stripe-elements/svg/umbrella-sharp.svg +1 -1
  1423. package/dist/stripe-elements/svg/umbrella.svg +1 -1
  1424. package/dist/stripe-elements/svg/unlink-outline.svg +1 -1
  1425. package/dist/stripe-elements/svg/unlink-sharp.svg +1 -1
  1426. package/dist/stripe-elements/svg/unlink.svg +1 -1
  1427. package/dist/stripe-elements/svg/videocam-off-outline.svg +1 -1
  1428. package/dist/stripe-elements/svg/videocam-off-sharp.svg +1 -1
  1429. package/dist/stripe-elements/svg/videocam-off.svg +1 -1
  1430. package/dist/stripe-elements/svg/videocam-outline.svg +1 -1
  1431. package/dist/stripe-elements/svg/videocam-sharp.svg +1 -1
  1432. package/dist/stripe-elements/svg/videocam.svg +1 -1
  1433. package/dist/stripe-elements/svg/volume-high-outline.svg +1 -1
  1434. package/dist/stripe-elements/svg/volume-high-sharp.svg +1 -1
  1435. package/dist/stripe-elements/svg/volume-high.svg +1 -1
  1436. package/dist/stripe-elements/svg/volume-low-outline.svg +1 -1
  1437. package/dist/stripe-elements/svg/volume-low-sharp.svg +1 -1
  1438. package/dist/stripe-elements/svg/volume-low.svg +1 -1
  1439. package/dist/stripe-elements/svg/volume-medium-outline.svg +1 -1
  1440. package/dist/stripe-elements/svg/volume-medium-sharp.svg +1 -1
  1441. package/dist/stripe-elements/svg/volume-medium.svg +1 -1
  1442. package/dist/stripe-elements/svg/volume-mute-outline.svg +1 -1
  1443. package/dist/stripe-elements/svg/volume-mute-sharp.svg +1 -1
  1444. package/dist/stripe-elements/svg/volume-mute.svg +1 -1
  1445. package/dist/stripe-elements/svg/volume-off-outline.svg +1 -1
  1446. package/dist/stripe-elements/svg/volume-off-sharp.svg +1 -1
  1447. package/dist/stripe-elements/svg/volume-off.svg +1 -1
  1448. package/dist/stripe-elements/svg/walk-outline.svg +1 -1
  1449. package/dist/stripe-elements/svg/walk-sharp.svg +1 -1
  1450. package/dist/stripe-elements/svg/walk.svg +1 -1
  1451. package/dist/stripe-elements/svg/wallet-outline.svg +1 -1
  1452. package/dist/stripe-elements/svg/wallet-sharp.svg +1 -1
  1453. package/dist/stripe-elements/svg/wallet.svg +1 -1
  1454. package/dist/stripe-elements/svg/warning-outline.svg +1 -1
  1455. package/dist/stripe-elements/svg/warning-sharp.svg +1 -1
  1456. package/dist/stripe-elements/svg/warning.svg +1 -1
  1457. package/dist/stripe-elements/svg/watch-outline.svg +1 -1
  1458. package/dist/stripe-elements/svg/watch-sharp.svg +1 -1
  1459. package/dist/stripe-elements/svg/watch.svg +1 -1
  1460. package/dist/stripe-elements/svg/water-outline.svg +1 -1
  1461. package/dist/stripe-elements/svg/water-sharp.svg +1 -1
  1462. package/dist/stripe-elements/svg/water.svg +1 -1
  1463. package/dist/stripe-elements/svg/wifi-outline.svg +1 -1
  1464. package/dist/stripe-elements/svg/wifi-sharp.svg +1 -1
  1465. package/dist/stripe-elements/svg/wifi.svg +1 -1
  1466. package/dist/stripe-elements/svg/wine-outline.svg +1 -1
  1467. package/dist/stripe-elements/svg/wine-sharp.svg +1 -1
  1468. package/dist/stripe-elements/svg/wine.svg +1 -1
  1469. package/dist/stripe-elements/svg/woman-outline.svg +1 -1
  1470. package/dist/stripe-elements/svg/woman-sharp.svg +1 -1
  1471. package/dist/stripe-elements/svg/woman.svg +1 -1
  1472. package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +264 -0
  1473. package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +124 -0
  1474. package/dist/types/components/stripe-modal/stripe-modal.d.ts +31 -0
  1475. package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +141 -136
  1476. package/dist/types/components.d.ts +231 -155
  1477. package/dist/types/interfaces.d.ts +17 -10
  1478. package/dist/types/services/card-element-manager.d.ts +56 -0
  1479. package/dist/types/services/factory.d.ts +22 -0
  1480. package/dist/types/services/interfaces.d.ts +95 -0
  1481. package/dist/types/services/stripe-service.d.ts +61 -0
  1482. package/dist/types/stencil-public-runtime.d.ts +137 -19
  1483. package/dist/types/utils/error.d.ts +10 -0
  1484. package/dist/types/utils/platform.d.ts +18 -18
  1485. package/dist/types/utils/utils.d.ts +1 -1
  1486. package/loader/cdn.js +1 -3
  1487. package/loader/index.cjs.js +1 -3
  1488. package/loader/index.d.ts +4 -1
  1489. package/loader/index.es2017.js +1 -3
  1490. package/loader/index.js +1 -3
  1491. package/package.json +26 -25
  1492. package/readme.md +29 -23
  1493. package/dist/cjs/index-0cec7387.js +0 -2053
  1494. package/dist/cjs/index-0cec7387.js.map +0 -1
  1495. package/dist/cjs/ion-icon.cjs.entry.js.map +0 -1
  1496. package/dist/cjs/stripe-payment-request-button.cjs.entry.js.map +0 -1
  1497. package/dist/cjs/stripe-payment-sheet.cjs.entry.js +0 -96
  1498. package/dist/cjs/stripe-payment-sheet.cjs.entry.js.map +0 -1
  1499. package/dist/cjs/stripe-payment_2.cjs.entry.js +0 -3509
  1500. package/dist/cjs/stripe-payment_2.cjs.entry.js.map +0 -1
  1501. package/dist/cjs/stripe.esm-603f3c17.js +0 -133
  1502. package/dist/cjs/stripe.esm-603f3c17.js.map +0 -1
  1503. package/dist/collection/components/stripe-element-modal/stripe-element-modal.js +0 -161
  1504. package/dist/collection/components/stripe-element-modal/stripe-element-modal.js.map +0 -1
  1505. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js +0 -10
  1506. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js.map +0 -1
  1507. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js +0 -120
  1508. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js.map +0 -1
  1509. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js +0 -10
  1510. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js.map +0 -1
  1511. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js +0 -18
  1512. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js.map +0 -1
  1513. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +0 -808
  1514. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js.map +0 -1
  1515. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js +0 -10
  1516. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js.map +0 -1
  1517. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js +0 -111
  1518. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js.map +0 -1
  1519. package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js +0 -487
  1520. package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js.map +0 -1
  1521. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js +0 -10
  1522. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js.map +0 -1
  1523. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js +0 -16
  1524. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js.map +0 -1
  1525. package/dist/components/stripe-element-modal.js +0 -75
  1526. package/dist/components/stripe-element-modal.js.map +0 -1
  1527. package/dist/components/stripe-payment-sheet.d.ts +0 -11
  1528. package/dist/components/stripe-payment-sheet.js +0 -153
  1529. package/dist/components/stripe-payment-sheet.js.map +0 -1
  1530. package/dist/components/stripe-payment-sheet2.js +0 -3404
  1531. package/dist/components/stripe-payment-sheet2.js.map +0 -1
  1532. package/dist/components/stripe-payment.js +0 -8
  1533. package/dist/components/stripe-payment.js.map +0 -1
  1534. package/dist/components/stripe-sheet.js +0 -8
  1535. package/dist/components/stripe-sheet.js.map +0 -1
  1536. package/dist/esm/index-58f9666b.js +0 -2023
  1537. package/dist/esm/index-58f9666b.js.map +0 -1
  1538. package/dist/esm/polyfills/core-js.js +0 -11
  1539. package/dist/esm/polyfills/css-shim.js +0 -1
  1540. package/dist/esm/polyfills/dom.js +0 -79
  1541. package/dist/esm/polyfills/es5-html-element.js +0 -1
  1542. package/dist/esm/polyfills/index.js +0 -34
  1543. package/dist/esm/polyfills/system.js +0 -6
  1544. package/dist/esm/stripe-payment-sheet.entry.js +0 -92
  1545. package/dist/esm/stripe-payment-sheet.entry.js.map +0 -1
  1546. package/dist/esm/stripe-payment_2.entry.js +0 -3504
  1547. package/dist/esm/stripe-payment_2.entry.js.map +0 -1
  1548. package/dist/esm/stripe.esm-bad47977.js +0 -131
  1549. package/dist/esm/stripe.esm-bad47977.js.map +0 -1
  1550. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +0 -143
  1551. package/dist/stripe-elements/p-06c00b5c.entry.js +0 -2
  1552. package/dist/stripe-elements/p-06c00b5c.entry.js.map +0 -1
  1553. package/dist/stripe-elements/p-1b4515a4.js +0 -3
  1554. package/dist/stripe-elements/p-1b4515a4.js.map +0 -1
  1555. package/dist/stripe-elements/p-3458123a.entry.js +0 -2
  1556. package/dist/stripe-elements/p-3458123a.entry.js.map +0 -1
  1557. package/dist/stripe-elements/p-3a90ad5d.entry.js +0 -2
  1558. package/dist/stripe-elements/p-3a90ad5d.entry.js.map +0 -1
  1559. package/dist/stripe-elements/p-b10d8613.js +0 -2
  1560. package/dist/stripe-elements/p-b10d8613.js.map +0 -1
  1561. package/dist/stripe-elements/p-c5a2b2e8.entry.js +0 -2
  1562. package/dist/stripe-elements/p-c5a2b2e8.entry.js.map +0 -1
  1563. package/dist/types/components/stripe-element-modal/stripe-element-modal.d.ts +0 -31
  1564. package/dist/types/components/stripe-payment-sheet/stripe-payment-sheet.d.ts +0 -278
  1565. package/dist/types/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.d.ts +0 -124
  1566. package/loader/package.json +0 -11
  1567. /package/dist/collection/components/{stripe-payment-sheet-modal/stripe-payment-sheet-modal.css → stripe-card-element-modal/stripe-card-element-modal.css} +0 -0
  1568. /package/dist/collection/components/{stripe-element-modal/stripe-element-modal.css → stripe-modal/stripe-modal.css} +0 -0
@@ -0,0 +1,3586 @@
1
+ import { getRenderingRef, forceUpdate, proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { c as checkPlatform } from './utils.js';
3
+ import { l as loadStripe, d as defineCustomElement$1 } from './stripe-payment-request-button2.js';
4
+
5
+ const isString = obj => typeof obj === 'string';
6
+ const defer = () => {
7
+ let res;
8
+ let rej;
9
+ const promise = new Promise((resolve, reject) => {
10
+ res = resolve;
11
+ rej = reject;
12
+ });
13
+ promise.resolve = res;
14
+ promise.reject = rej;
15
+ return promise;
16
+ };
17
+ const makeString = object => {
18
+ if (object == null) return '';
19
+ return '' + object;
20
+ };
21
+ const copy = (a, s, t) => {
22
+ a.forEach(m => {
23
+ if (s[m]) t[m] = s[m];
24
+ });
25
+ };
26
+ const lastOfPathSeparatorRegExp = /###/g;
27
+ const cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;
28
+ const canNotTraverseDeeper = object => !object || isString(object);
29
+ const getLastOfPath = (object, path, Empty) => {
30
+ const stack = !isString(path) ? path : path.split('.');
31
+ let stackIndex = 0;
32
+ while (stackIndex < stack.length - 1) {
33
+ if (canNotTraverseDeeper(object)) return {};
34
+ const key = cleanKey(stack[stackIndex]);
35
+ if (!object[key] && Empty) object[key] = new Empty();
36
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
37
+ object = object[key];
38
+ } else {
39
+ object = {};
40
+ }
41
+ ++stackIndex;
42
+ }
43
+ if (canNotTraverseDeeper(object)) return {};
44
+ return {
45
+ obj: object,
46
+ k: cleanKey(stack[stackIndex])
47
+ };
48
+ };
49
+ const setPath = (object, path, newValue) => {
50
+ const {
51
+ obj,
52
+ k
53
+ } = getLastOfPath(object, path, Object);
54
+ if (obj !== undefined || path.length === 1) {
55
+ obj[k] = newValue;
56
+ return;
57
+ }
58
+ let e = path[path.length - 1];
59
+ let p = path.slice(0, path.length - 1);
60
+ let last = getLastOfPath(object, p, Object);
61
+ while (last.obj === undefined && p.length) {
62
+ e = `${p[p.length - 1]}.${e}`;
63
+ p = p.slice(0, p.length - 1);
64
+ last = getLastOfPath(object, p, Object);
65
+ if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
66
+ last.obj = undefined;
67
+ }
68
+ }
69
+ last.obj[`${last.k}.${e}`] = newValue;
70
+ };
71
+ const pushPath = (object, path, newValue, concat) => {
72
+ const {
73
+ obj,
74
+ k
75
+ } = getLastOfPath(object, path, Object);
76
+ obj[k] = obj[k] || [];
77
+ obj[k].push(newValue);
78
+ };
79
+ const getPath = (object, path) => {
80
+ const {
81
+ obj,
82
+ k
83
+ } = getLastOfPath(object, path);
84
+ if (!obj) return undefined;
85
+ if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined;
86
+ return obj[k];
87
+ };
88
+ const getPathWithDefaults = (data, defaultData, key) => {
89
+ const value = getPath(data, key);
90
+ if (value !== undefined) {
91
+ return value;
92
+ }
93
+ return getPath(defaultData, key);
94
+ };
95
+ const deepExtend = (target, source, overwrite) => {
96
+ for (const prop in source) {
97
+ if (prop !== '__proto__' && prop !== 'constructor') {
98
+ if (prop in target) {
99
+ if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
100
+ if (overwrite) target[prop] = source[prop];
101
+ } else {
102
+ deepExtend(target[prop], source[prop], overwrite);
103
+ }
104
+ } else {
105
+ target[prop] = source[prop];
106
+ }
107
+ }
108
+ }
109
+ return target;
110
+ };
111
+ const regexEscape = str => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
112
+ var _entityMap = {
113
+ '&': '&amp;',
114
+ '<': '&lt;',
115
+ '>': '&gt;',
116
+ '"': '&quot;',
117
+ "'": '&#39;',
118
+ '/': '&#x2F;'
119
+ };
120
+ const escape = data => {
121
+ if (isString(data)) {
122
+ return data.replace(/[&<>"'\/]/g, s => _entityMap[s]);
123
+ }
124
+ return data;
125
+ };
126
+ class RegExpCache {
127
+ constructor(capacity) {
128
+ this.capacity = capacity;
129
+ this.regExpMap = new Map();
130
+ this.regExpQueue = [];
131
+ }
132
+ getRegExp(pattern) {
133
+ const regExpFromCache = this.regExpMap.get(pattern);
134
+ if (regExpFromCache !== undefined) {
135
+ return regExpFromCache;
136
+ }
137
+ const regExpNew = new RegExp(pattern);
138
+ if (this.regExpQueue.length === this.capacity) {
139
+ this.regExpMap.delete(this.regExpQueue.shift());
140
+ }
141
+ this.regExpMap.set(pattern, regExpNew);
142
+ this.regExpQueue.push(pattern);
143
+ return regExpNew;
144
+ }
145
+ }
146
+ const chars = [' ', ',', '?', '!', ';'];
147
+ const looksLikeObjectPathRegExpCache = new RegExpCache(20);
148
+ const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
149
+ nsSeparator = nsSeparator || '';
150
+ keySeparator = keySeparator || '';
151
+ const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
152
+ if (possibleChars.length === 0) return true;
153
+ const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\?' : c).join('|')})`);
154
+ let matched = !r.test(key);
155
+ if (!matched) {
156
+ const ki = key.indexOf(keySeparator);
157
+ if (ki > 0 && !r.test(key.substring(0, ki))) {
158
+ matched = true;
159
+ }
160
+ }
161
+ return matched;
162
+ };
163
+ const deepFind = (obj, path, keySeparator = '.') => {
164
+ if (!obj) return undefined;
165
+ if (obj[path]) {
166
+ if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;
167
+ return obj[path];
168
+ }
169
+ const tokens = path.split(keySeparator);
170
+ let current = obj;
171
+ for (let i = 0; i < tokens.length;) {
172
+ if (!current || typeof current !== 'object') {
173
+ return undefined;
174
+ }
175
+ let next;
176
+ let nextPath = '';
177
+ for (let j = i; j < tokens.length; ++j) {
178
+ if (j !== i) {
179
+ nextPath += keySeparator;
180
+ }
181
+ nextPath += tokens[j];
182
+ next = current[nextPath];
183
+ if (next !== undefined) {
184
+ if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {
185
+ continue;
186
+ }
187
+ i += j - i + 1;
188
+ break;
189
+ }
190
+ }
191
+ current = next;
192
+ }
193
+ return current;
194
+ };
195
+ const getCleanedCode = code => code?.replace('_', '-');
196
+
197
+ const consoleLogger = {
198
+ type: 'logger',
199
+ log(args) {
200
+ this.output('log', args);
201
+ },
202
+ warn(args) {
203
+ this.output('warn', args);
204
+ },
205
+ error(args) {
206
+ this.output('error', args);
207
+ },
208
+ output(type, args) {
209
+ console?.[type]?.apply?.(console, args);
210
+ }
211
+ };
212
+ class Logger {
213
+ constructor(concreteLogger, options = {}) {
214
+ this.init(concreteLogger, options);
215
+ }
216
+ init(concreteLogger, options = {}) {
217
+ this.prefix = options.prefix || 'i18next:';
218
+ this.logger = concreteLogger || consoleLogger;
219
+ this.options = options;
220
+ this.debug = options.debug;
221
+ }
222
+ log(...args) {
223
+ return this.forward(args, 'log', '', true);
224
+ }
225
+ warn(...args) {
226
+ return this.forward(args, 'warn', '', true);
227
+ }
228
+ error(...args) {
229
+ return this.forward(args, 'error', '');
230
+ }
231
+ deprecate(...args) {
232
+ return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
233
+ }
234
+ forward(args, lvl, prefix, debugOnly) {
235
+ if (debugOnly && !this.debug) return null;
236
+ if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
237
+ return this.logger[lvl](args);
238
+ }
239
+ create(moduleName) {
240
+ return new Logger(this.logger, {
241
+ ...{
242
+ prefix: `${this.prefix}:${moduleName}:`
243
+ },
244
+ ...this.options
245
+ });
246
+ }
247
+ clone(options) {
248
+ options = options || this.options;
249
+ options.prefix = options.prefix || this.prefix;
250
+ return new Logger(this.logger, options);
251
+ }
252
+ }
253
+ var baseLogger = new Logger();
254
+
255
+ class EventEmitter {
256
+ constructor() {
257
+ this.observers = {};
258
+ }
259
+ on(events, listener) {
260
+ events.split(' ').forEach(event => {
261
+ if (!this.observers[event]) this.observers[event] = new Map();
262
+ const numListeners = this.observers[event].get(listener) || 0;
263
+ this.observers[event].set(listener, numListeners + 1);
264
+ });
265
+ return this;
266
+ }
267
+ off(event, listener) {
268
+ if (!this.observers[event]) return;
269
+ if (!listener) {
270
+ delete this.observers[event];
271
+ return;
272
+ }
273
+ this.observers[event].delete(listener);
274
+ }
275
+ emit(event, ...args) {
276
+ if (this.observers[event]) {
277
+ const cloned = Array.from(this.observers[event].entries());
278
+ cloned.forEach(([observer, numTimesAdded]) => {
279
+ for (let i = 0; i < numTimesAdded; i++) {
280
+ observer(...args);
281
+ }
282
+ });
283
+ }
284
+ if (this.observers['*']) {
285
+ const cloned = Array.from(this.observers['*'].entries());
286
+ cloned.forEach(([observer, numTimesAdded]) => {
287
+ for (let i = 0; i < numTimesAdded; i++) {
288
+ observer.apply(observer, [event, ...args]);
289
+ }
290
+ });
291
+ }
292
+ }
293
+ }
294
+
295
+ class ResourceStore extends EventEmitter {
296
+ constructor(data, options = {
297
+ ns: ['translation'],
298
+ defaultNS: 'translation'
299
+ }) {
300
+ super();
301
+ this.data = data || {};
302
+ this.options = options;
303
+ if (this.options.keySeparator === undefined) {
304
+ this.options.keySeparator = '.';
305
+ }
306
+ if (this.options.ignoreJSONStructure === undefined) {
307
+ this.options.ignoreJSONStructure = true;
308
+ }
309
+ }
310
+ addNamespaces(ns) {
311
+ if (this.options.ns.indexOf(ns) < 0) {
312
+ this.options.ns.push(ns);
313
+ }
314
+ }
315
+ removeNamespaces(ns) {
316
+ const index = this.options.ns.indexOf(ns);
317
+ if (index > -1) {
318
+ this.options.ns.splice(index, 1);
319
+ }
320
+ }
321
+ getResource(lng, ns, key, options = {}) {
322
+ const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
323
+ const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
324
+ let path;
325
+ if (lng.indexOf('.') > -1) {
326
+ path = lng.split('.');
327
+ } else {
328
+ path = [lng, ns];
329
+ if (key) {
330
+ if (Array.isArray(key)) {
331
+ path.push(...key);
332
+ } else if (isString(key) && keySeparator) {
333
+ path.push(...key.split(keySeparator));
334
+ } else {
335
+ path.push(key);
336
+ }
337
+ }
338
+ }
339
+ const result = getPath(this.data, path);
340
+ if (!result && !ns && !key && lng.indexOf('.') > -1) {
341
+ lng = path[0];
342
+ ns = path[1];
343
+ key = path.slice(2).join('.');
344
+ }
345
+ if (result || !ignoreJSONStructure || !isString(key)) return result;
346
+ return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
347
+ }
348
+ addResource(lng, ns, key, value, options = {
349
+ silent: false
350
+ }) {
351
+ const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
352
+ let path = [lng, ns];
353
+ if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
354
+ if (lng.indexOf('.') > -1) {
355
+ path = lng.split('.');
356
+ value = ns;
357
+ ns = path[1];
358
+ }
359
+ this.addNamespaces(ns);
360
+ setPath(this.data, path, value);
361
+ if (!options.silent) this.emit('added', lng, ns, key, value);
362
+ }
363
+ addResources(lng, ns, resources, options = {
364
+ silent: false
365
+ }) {
366
+ for (const m in resources) {
367
+ if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
368
+ silent: true
369
+ });
370
+ }
371
+ if (!options.silent) this.emit('added', lng, ns, resources);
372
+ }
373
+ addResourceBundle(lng, ns, resources, deep, overwrite, options = {
374
+ silent: false,
375
+ skipCopy: false
376
+ }) {
377
+ let path = [lng, ns];
378
+ if (lng.indexOf('.') > -1) {
379
+ path = lng.split('.');
380
+ deep = resources;
381
+ resources = ns;
382
+ ns = path[1];
383
+ }
384
+ this.addNamespaces(ns);
385
+ let pack = getPath(this.data, path) || {};
386
+ if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
387
+ if (deep) {
388
+ deepExtend(pack, resources, overwrite);
389
+ } else {
390
+ pack = {
391
+ ...pack,
392
+ ...resources
393
+ };
394
+ }
395
+ setPath(this.data, path, pack);
396
+ if (!options.silent) this.emit('added', lng, ns, resources);
397
+ }
398
+ removeResourceBundle(lng, ns) {
399
+ if (this.hasResourceBundle(lng, ns)) {
400
+ delete this.data[lng][ns];
401
+ }
402
+ this.removeNamespaces(ns);
403
+ this.emit('removed', lng, ns);
404
+ }
405
+ hasResourceBundle(lng, ns) {
406
+ return this.getResource(lng, ns) !== undefined;
407
+ }
408
+ getResourceBundle(lng, ns) {
409
+ if (!ns) ns = this.options.defaultNS;
410
+ return this.getResource(lng, ns);
411
+ }
412
+ getDataByLanguage(lng) {
413
+ return this.data[lng];
414
+ }
415
+ hasLanguageSomeTranslations(lng) {
416
+ const data = this.getDataByLanguage(lng);
417
+ const n = data && Object.keys(data) || [];
418
+ return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);
419
+ }
420
+ toJSON() {
421
+ return this.data;
422
+ }
423
+ }
424
+
425
+ var postProcessor = {
426
+ processors: {},
427
+ addPostProcessor(module) {
428
+ this.processors[module.name] = module;
429
+ },
430
+ handle(processors, value, key, options, translator) {
431
+ processors.forEach(processor => {
432
+ value = this.processors[processor]?.process(value, key, options, translator) ?? value;
433
+ });
434
+ return value;
435
+ }
436
+ };
437
+
438
+ const PATH_KEY = Symbol('i18next/PATH_KEY');
439
+ function createProxy() {
440
+ const state = [];
441
+ const handler = Object.create(null);
442
+ let proxy;
443
+ handler.get = (target, key) => {
444
+ proxy?.revoke?.();
445
+ if (key === PATH_KEY) return state;
446
+ state.push(key);
447
+ proxy = Proxy.revocable(target, handler);
448
+ return proxy.proxy;
449
+ };
450
+ return Proxy.revocable(Object.create(null), handler).proxy;
451
+ }
452
+ function keysFromSelector(selector, opts) {
453
+ const {
454
+ [PATH_KEY]: path
455
+ } = selector(createProxy());
456
+ return path.join(opts?.keySeparator ?? '.');
457
+ }
458
+
459
+ const checkedLoadedFor = {};
460
+ const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
461
+ class Translator extends EventEmitter {
462
+ constructor(services, options = {}) {
463
+ super();
464
+ copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
465
+ this.options = options;
466
+ if (this.options.keySeparator === undefined) {
467
+ this.options.keySeparator = '.';
468
+ }
469
+ this.logger = baseLogger.create('translator');
470
+ }
471
+ changeLanguage(lng) {
472
+ if (lng) this.language = lng;
473
+ }
474
+ exists(key, o = {
475
+ interpolation: {}
476
+ }) {
477
+ const opt = {
478
+ ...o
479
+ };
480
+ if (key == null) return false;
481
+ const resolved = this.resolve(key, opt);
482
+ if (resolved?.res === undefined) return false;
483
+ const isObject = shouldHandleAsObject(resolved.res);
484
+ if (opt.returnObjects === false && isObject) {
485
+ return false;
486
+ }
487
+ return true;
488
+ }
489
+ extractFromKey(key, opt) {
490
+ let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
491
+ if (nsSeparator === undefined) nsSeparator = ':';
492
+ const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
493
+ let namespaces = opt.ns || this.options.defaultNS || [];
494
+ const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
495
+ const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
496
+ if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
497
+ const m = key.match(this.interpolator.nestingRegexp);
498
+ if (m && m.length > 0) {
499
+ return {
500
+ key,
501
+ namespaces: isString(namespaces) ? [namespaces] : namespaces
502
+ };
503
+ }
504
+ const parts = key.split(nsSeparator);
505
+ if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
506
+ key = parts.join(keySeparator);
507
+ }
508
+ return {
509
+ key,
510
+ namespaces: isString(namespaces) ? [namespaces] : namespaces
511
+ };
512
+ }
513
+ translate(keys, o, lastKey) {
514
+ let opt = typeof o === 'object' ? {
515
+ ...o
516
+ } : o;
517
+ if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
518
+ opt = this.options.overloadTranslationOptionHandler(arguments);
519
+ }
520
+ if (typeof opt === 'object') opt = {
521
+ ...opt
522
+ };
523
+ if (!opt) opt = {};
524
+ if (keys == null) return '';
525
+ if (typeof keys === 'function') keys = keysFromSelector(keys, {
526
+ ...this.options,
527
+ ...opt
528
+ });
529
+ if (!Array.isArray(keys)) keys = [String(keys)];
530
+ const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
531
+ const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
532
+ const {
533
+ key,
534
+ namespaces
535
+ } = this.extractFromKey(keys[keys.length - 1], opt);
536
+ const namespace = namespaces[namespaces.length - 1];
537
+ let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
538
+ if (nsSeparator === undefined) nsSeparator = ':';
539
+ const lng = opt.lng || this.language;
540
+ const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
541
+ if (lng?.toLowerCase() === 'cimode') {
542
+ if (appendNamespaceToCIMode) {
543
+ if (returnDetails) {
544
+ return {
545
+ res: `${namespace}${nsSeparator}${key}`,
546
+ usedKey: key,
547
+ exactUsedKey: key,
548
+ usedLng: lng,
549
+ usedNS: namespace,
550
+ usedParams: this.getUsedParamsDetails(opt)
551
+ };
552
+ }
553
+ return `${namespace}${nsSeparator}${key}`;
554
+ }
555
+ if (returnDetails) {
556
+ return {
557
+ res: key,
558
+ usedKey: key,
559
+ exactUsedKey: key,
560
+ usedLng: lng,
561
+ usedNS: namespace,
562
+ usedParams: this.getUsedParamsDetails(opt)
563
+ };
564
+ }
565
+ return key;
566
+ }
567
+ const resolved = this.resolve(keys, opt);
568
+ let res = resolved?.res;
569
+ const resUsedKey = resolved?.usedKey || key;
570
+ const resExactUsedKey = resolved?.exactUsedKey || key;
571
+ const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
572
+ const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays;
573
+ const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
574
+ const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
575
+ const hasDefaultValue = Translator.hasDefaultValue(opt);
576
+ const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : '';
577
+ const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {
578
+ ordinal: false
579
+ }) : '';
580
+ const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
581
+ const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
582
+ let resForObjHndl = res;
583
+ if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {
584
+ resForObjHndl = defaultValue;
585
+ }
586
+ const handleAsObject = shouldHandleAsObject(resForObjHndl);
587
+ const resType = Object.prototype.toString.apply(resForObjHndl);
588
+ if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
589
+ if (!opt.returnObjects && !this.options.returnObjects) {
590
+ if (!this.options.returnedObjectHandler) {
591
+ this.logger.warn('accessing an object - but returnObjects options is not enabled!');
592
+ }
593
+ const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
594
+ ...opt,
595
+ ns: namespaces
596
+ }) : `key '${key} (${this.language})' returned an object instead of string.`;
597
+ if (returnDetails) {
598
+ resolved.res = r;
599
+ resolved.usedParams = this.getUsedParamsDetails(opt);
600
+ return resolved;
601
+ }
602
+ return r;
603
+ }
604
+ if (keySeparator) {
605
+ const resTypeIsArray = Array.isArray(resForObjHndl);
606
+ const copy = resTypeIsArray ? [] : {};
607
+ const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
608
+ for (const m in resForObjHndl) {
609
+ if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {
610
+ const deepKey = `${newKeyToUse}${keySeparator}${m}`;
611
+ if (hasDefaultValue && !res) {
612
+ copy[m] = this.translate(deepKey, {
613
+ ...opt,
614
+ defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined,
615
+ ...{
616
+ joinArrays: false,
617
+ ns: namespaces
618
+ }
619
+ });
620
+ } else {
621
+ copy[m] = this.translate(deepKey, {
622
+ ...opt,
623
+ ...{
624
+ joinArrays: false,
625
+ ns: namespaces
626
+ }
627
+ });
628
+ }
629
+ if (copy[m] === deepKey) copy[m] = resForObjHndl[m];
630
+ }
631
+ }
632
+ res = copy;
633
+ }
634
+ } else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
635
+ res = res.join(joinArrays);
636
+ if (res) res = this.extendTranslation(res, keys, opt, lastKey);
637
+ } else {
638
+ let usedDefault = false;
639
+ let usedKey = false;
640
+ if (!this.isValidLookup(res) && hasDefaultValue) {
641
+ usedDefault = true;
642
+ res = defaultValue;
643
+ }
644
+ if (!this.isValidLookup(res)) {
645
+ usedKey = true;
646
+ res = key;
647
+ }
648
+ const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
649
+ const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
650
+ const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
651
+ if (usedKey || usedDefault || updateMissing) {
652
+ this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
653
+ if (keySeparator) {
654
+ const fk = this.resolve(key, {
655
+ ...opt,
656
+ keySeparator: false
657
+ });
658
+ if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
659
+ }
660
+ let lngs = [];
661
+ const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
662
+ if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
663
+ for (let i = 0; i < fallbackLngs.length; i++) {
664
+ lngs.push(fallbackLngs[i]);
665
+ }
666
+ } else if (this.options.saveMissingTo === 'all') {
667
+ lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
668
+ } else {
669
+ lngs.push(opt.lng || this.language);
670
+ }
671
+ const send = (l, k, specificDefaultValue) => {
672
+ const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
673
+ if (this.options.missingKeyHandler) {
674
+ this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);
675
+ } else if (this.backendConnector?.saveMissing) {
676
+ this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt);
677
+ }
678
+ this.emit('missingKey', l, namespace, k, res);
679
+ };
680
+ if (this.options.saveMissing) {
681
+ if (this.options.saveMissingPlurals && needsPluralHandling) {
682
+ lngs.forEach(language => {
683
+ const suffixes = this.pluralResolver.getSuffixes(language, opt);
684
+ if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
685
+ suffixes.push(`${this.options.pluralSeparator}zero`);
686
+ }
687
+ suffixes.forEach(suffix => {
688
+ send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);
689
+ });
690
+ });
691
+ } else {
692
+ send(lngs, key, defaultValue);
693
+ }
694
+ }
695
+ }
696
+ res = this.extendTranslation(res, keys, opt, resolved, lastKey);
697
+ if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {
698
+ res = `${namespace}${nsSeparator}${key}`;
699
+ }
700
+ if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
701
+ res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt);
702
+ }
703
+ }
704
+ if (returnDetails) {
705
+ resolved.res = res;
706
+ resolved.usedParams = this.getUsedParamsDetails(opt);
707
+ return resolved;
708
+ }
709
+ return res;
710
+ }
711
+ extendTranslation(res, key, opt, resolved, lastKey) {
712
+ if (this.i18nFormat?.parse) {
713
+ res = this.i18nFormat.parse(res, {
714
+ ...this.options.interpolation.defaultVariables,
715
+ ...opt
716
+ }, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
717
+ resolved
718
+ });
719
+ } else if (!opt.skipInterpolation) {
720
+ if (opt.interpolation) this.interpolator.init({
721
+ ...opt,
722
+ ...{
723
+ interpolation: {
724
+ ...this.options.interpolation,
725
+ ...opt.interpolation
726
+ }
727
+ }
728
+ });
729
+ const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
730
+ let nestBef;
731
+ if (skipOnVariables) {
732
+ const nb = res.match(this.interpolator.nestingRegexp);
733
+ nestBef = nb && nb.length;
734
+ }
735
+ let data = opt.replace && !isString(opt.replace) ? opt.replace : opt;
736
+ if (this.options.interpolation.defaultVariables) data = {
737
+ ...this.options.interpolation.defaultVariables,
738
+ ...data
739
+ };
740
+ res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
741
+ if (skipOnVariables) {
742
+ const na = res.match(this.interpolator.nestingRegexp);
743
+ const nestAft = na && na.length;
744
+ if (nestBef < nestAft) opt.nest = false;
745
+ }
746
+ if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
747
+ if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
748
+ if (lastKey?.[0] === args[0] && !opt.context) {
749
+ this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
750
+ return null;
751
+ }
752
+ return this.translate(...args, key);
753
+ }, opt);
754
+ if (opt.interpolation) this.interpolator.reset();
755
+ }
756
+ const postProcess = opt.postProcess || this.options.postProcess;
757
+ const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
758
+ if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) {
759
+ res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
760
+ i18nResolved: {
761
+ ...resolved,
762
+ usedParams: this.getUsedParamsDetails(opt)
763
+ },
764
+ ...opt
765
+ } : opt, this);
766
+ }
767
+ return res;
768
+ }
769
+ resolve(keys, opt = {}) {
770
+ let found;
771
+ let usedKey;
772
+ let exactUsedKey;
773
+ let usedLng;
774
+ let usedNS;
775
+ if (isString(keys)) keys = [keys];
776
+ keys.forEach(k => {
777
+ if (this.isValidLookup(found)) return;
778
+ const extracted = this.extractFromKey(k, opt);
779
+ const key = extracted.key;
780
+ usedKey = key;
781
+ let namespaces = extracted.namespaces;
782
+ if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
783
+ const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
784
+ const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
785
+ const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== '';
786
+ const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
787
+ namespaces.forEach(ns => {
788
+ if (this.isValidLookup(found)) return;
789
+ usedNS = ns;
790
+ if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
791
+ checkedLoadedFor[`${codes[0]}-${ns}`] = true;
792
+ this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
793
+ }
794
+ codes.forEach(code => {
795
+ if (this.isValidLookup(found)) return;
796
+ usedLng = code;
797
+ const finalKeys = [key];
798
+ if (this.i18nFormat?.addLookupKeys) {
799
+ this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
800
+ } else {
801
+ let pluralSuffix;
802
+ if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
803
+ const zeroSuffix = `${this.options.pluralSeparator}zero`;
804
+ const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
805
+ if (needsPluralHandling) {
806
+ if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
807
+ finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
808
+ }
809
+ finalKeys.push(key + pluralSuffix);
810
+ if (needsZeroSuffixLookup) {
811
+ finalKeys.push(key + zeroSuffix);
812
+ }
813
+ }
814
+ if (needsContextHandling) {
815
+ const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
816
+ finalKeys.push(contextKey);
817
+ if (needsPluralHandling) {
818
+ if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
819
+ finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
820
+ }
821
+ finalKeys.push(contextKey + pluralSuffix);
822
+ if (needsZeroSuffixLookup) {
823
+ finalKeys.push(contextKey + zeroSuffix);
824
+ }
825
+ }
826
+ }
827
+ }
828
+ let possibleKey;
829
+ while (possibleKey = finalKeys.pop()) {
830
+ if (!this.isValidLookup(found)) {
831
+ exactUsedKey = possibleKey;
832
+ found = this.getResource(code, ns, possibleKey, opt);
833
+ }
834
+ }
835
+ });
836
+ });
837
+ });
838
+ return {
839
+ res: found,
840
+ usedKey,
841
+ exactUsedKey,
842
+ usedLng,
843
+ usedNS
844
+ };
845
+ }
846
+ isValidLookup(res) {
847
+ return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
848
+ }
849
+ getResource(code, ns, key, options = {}) {
850
+ if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
851
+ return this.resourceStore.getResource(code, ns, key, options);
852
+ }
853
+ getUsedParamsDetails(options = {}) {
854
+ const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
855
+ const useOptionsReplaceForData = options.replace && !isString(options.replace);
856
+ let data = useOptionsReplaceForData ? options.replace : options;
857
+ if (useOptionsReplaceForData && typeof options.count !== 'undefined') {
858
+ data.count = options.count;
859
+ }
860
+ if (this.options.interpolation.defaultVariables) {
861
+ data = {
862
+ ...this.options.interpolation.defaultVariables,
863
+ ...data
864
+ };
865
+ }
866
+ if (!useOptionsReplaceForData) {
867
+ data = {
868
+ ...data
869
+ };
870
+ for (const key of optionsKeys) {
871
+ delete data[key];
872
+ }
873
+ }
874
+ return data;
875
+ }
876
+ static hasDefaultValue(options) {
877
+ const prefix = 'defaultValue';
878
+ for (const option in options) {
879
+ if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
880
+ return true;
881
+ }
882
+ }
883
+ return false;
884
+ }
885
+ }
886
+
887
+ class LanguageUtil {
888
+ constructor(options) {
889
+ this.options = options;
890
+ this.supportedLngs = this.options.supportedLngs || false;
891
+ this.logger = baseLogger.create('languageUtils');
892
+ }
893
+ getScriptPartFromCode(code) {
894
+ code = getCleanedCode(code);
895
+ if (!code || code.indexOf('-') < 0) return null;
896
+ const p = code.split('-');
897
+ if (p.length === 2) return null;
898
+ p.pop();
899
+ if (p[p.length - 1].toLowerCase() === 'x') return null;
900
+ return this.formatLanguageCode(p.join('-'));
901
+ }
902
+ getLanguagePartFromCode(code) {
903
+ code = getCleanedCode(code);
904
+ if (!code || code.indexOf('-') < 0) return code;
905
+ const p = code.split('-');
906
+ return this.formatLanguageCode(p[0]);
907
+ }
908
+ formatLanguageCode(code) {
909
+ if (isString(code) && code.indexOf('-') > -1) {
910
+ let formattedCode;
911
+ try {
912
+ formattedCode = Intl.getCanonicalLocales(code)[0];
913
+ } catch (e) {}
914
+ if (formattedCode && this.options.lowerCaseLng) {
915
+ formattedCode = formattedCode.toLowerCase();
916
+ }
917
+ if (formattedCode) return formattedCode;
918
+ if (this.options.lowerCaseLng) {
919
+ return code.toLowerCase();
920
+ }
921
+ return code;
922
+ }
923
+ return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
924
+ }
925
+ isSupportedCode(code) {
926
+ if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
927
+ code = this.getLanguagePartFromCode(code);
928
+ }
929
+ return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
930
+ }
931
+ getBestMatchFromCodes(codes) {
932
+ if (!codes) return null;
933
+ let found;
934
+ codes.forEach(code => {
935
+ if (found) return;
936
+ const cleanedLng = this.formatLanguageCode(code);
937
+ if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
938
+ });
939
+ if (!found && this.options.supportedLngs) {
940
+ codes.forEach(code => {
941
+ if (found) return;
942
+ const lngScOnly = this.getScriptPartFromCode(code);
943
+ if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
944
+ const lngOnly = this.getLanguagePartFromCode(code);
945
+ if (this.isSupportedCode(lngOnly)) return found = lngOnly;
946
+ found = this.options.supportedLngs.find(supportedLng => {
947
+ if (supportedLng === lngOnly) return supportedLng;
948
+ if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
949
+ if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;
950
+ if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
951
+ });
952
+ });
953
+ }
954
+ if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
955
+ return found;
956
+ }
957
+ getFallbackCodes(fallbacks, code) {
958
+ if (!fallbacks) return [];
959
+ if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
960
+ if (isString(fallbacks)) fallbacks = [fallbacks];
961
+ if (Array.isArray(fallbacks)) return fallbacks;
962
+ if (!code) return fallbacks.default || [];
963
+ let found = fallbacks[code];
964
+ if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
965
+ if (!found) found = fallbacks[this.formatLanguageCode(code)];
966
+ if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
967
+ if (!found) found = fallbacks.default;
968
+ return found || [];
969
+ }
970
+ toResolveHierarchy(code, fallbackCode) {
971
+ const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);
972
+ const codes = [];
973
+ const addCode = c => {
974
+ if (!c) return;
975
+ if (this.isSupportedCode(c)) {
976
+ codes.push(c);
977
+ } else {
978
+ this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
979
+ }
980
+ };
981
+ if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {
982
+ if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
983
+ if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
984
+ if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
985
+ } else if (isString(code)) {
986
+ addCode(this.formatLanguageCode(code));
987
+ }
988
+ fallbackCodes.forEach(fc => {
989
+ if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
990
+ });
991
+ return codes;
992
+ }
993
+ }
994
+
995
+ const suffixesOrder = {
996
+ zero: 0,
997
+ one: 1,
998
+ two: 2,
999
+ few: 3,
1000
+ many: 4,
1001
+ other: 5
1002
+ };
1003
+ const dummyRule = {
1004
+ select: count => count === 1 ? 'one' : 'other',
1005
+ resolvedOptions: () => ({
1006
+ pluralCategories: ['one', 'other']
1007
+ })
1008
+ };
1009
+ class PluralResolver {
1010
+ constructor(languageUtils, options = {}) {
1011
+ this.languageUtils = languageUtils;
1012
+ this.options = options;
1013
+ this.logger = baseLogger.create('pluralResolver');
1014
+ this.pluralRulesCache = {};
1015
+ }
1016
+ addRule(lng, obj) {
1017
+ this.rules[lng] = obj;
1018
+ }
1019
+ clearCache() {
1020
+ this.pluralRulesCache = {};
1021
+ }
1022
+ getRule(code, options = {}) {
1023
+ const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
1024
+ const type = options.ordinal ? 'ordinal' : 'cardinal';
1025
+ const cacheKey = JSON.stringify({
1026
+ cleanedCode,
1027
+ type
1028
+ });
1029
+ if (cacheKey in this.pluralRulesCache) {
1030
+ return this.pluralRulesCache[cacheKey];
1031
+ }
1032
+ let rule;
1033
+ try {
1034
+ rule = new Intl.PluralRules(cleanedCode, {
1035
+ type
1036
+ });
1037
+ } catch (err) {
1038
+ if (!Intl) {
1039
+ this.logger.error('No Intl support, please use an Intl polyfill!');
1040
+ return dummyRule;
1041
+ }
1042
+ if (!code.match(/-|_/)) return dummyRule;
1043
+ const lngPart = this.languageUtils.getLanguagePartFromCode(code);
1044
+ rule = this.getRule(lngPart, options);
1045
+ }
1046
+ this.pluralRulesCache[cacheKey] = rule;
1047
+ return rule;
1048
+ }
1049
+ needsPlural(code, options = {}) {
1050
+ let rule = this.getRule(code, options);
1051
+ if (!rule) rule = this.getRule('dev', options);
1052
+ return rule?.resolvedOptions().pluralCategories.length > 1;
1053
+ }
1054
+ getPluralFormsOfKey(code, key, options = {}) {
1055
+ return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
1056
+ }
1057
+ getSuffixes(code, options = {}) {
1058
+ let rule = this.getRule(code, options);
1059
+ if (!rule) rule = this.getRule('dev', options);
1060
+ if (!rule) return [];
1061
+ return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
1062
+ }
1063
+ getSuffix(code, count, options = {}) {
1064
+ const rule = this.getRule(code, options);
1065
+ if (rule) {
1066
+ return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
1067
+ }
1068
+ this.logger.warn(`no plural rule found for: ${code}`);
1069
+ return this.getSuffix('dev', count, options);
1070
+ }
1071
+ }
1072
+
1073
+ const deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true) => {
1074
+ let path = getPathWithDefaults(data, defaultData, key);
1075
+ if (!path && ignoreJSONStructure && isString(key)) {
1076
+ path = deepFind(data, key, keySeparator);
1077
+ if (path === undefined) path = deepFind(defaultData, key, keySeparator);
1078
+ }
1079
+ return path;
1080
+ };
1081
+ const regexSafe = val => val.replace(/\$/g, '$$$$');
1082
+ class Interpolator {
1083
+ constructor(options = {}) {
1084
+ this.logger = baseLogger.create('interpolator');
1085
+ this.options = options;
1086
+ this.format = options?.interpolation?.format || (value => value);
1087
+ this.init(options);
1088
+ }
1089
+ init(options = {}) {
1090
+ if (!options.interpolation) options.interpolation = {
1091
+ escapeValue: true
1092
+ };
1093
+ const {
1094
+ escape: escape$1,
1095
+ escapeValue,
1096
+ useRawValueToEscape,
1097
+ prefix,
1098
+ prefixEscaped,
1099
+ suffix,
1100
+ suffixEscaped,
1101
+ formatSeparator,
1102
+ unescapeSuffix,
1103
+ unescapePrefix,
1104
+ nestingPrefix,
1105
+ nestingPrefixEscaped,
1106
+ nestingSuffix,
1107
+ nestingSuffixEscaped,
1108
+ nestingOptionsSeparator,
1109
+ maxReplaces,
1110
+ alwaysFormat
1111
+ } = options.interpolation;
1112
+ this.escape = escape$1 !== undefined ? escape$1 : escape;
1113
+ this.escapeValue = escapeValue !== undefined ? escapeValue : true;
1114
+ this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;
1115
+ this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';
1116
+ this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';
1117
+ this.formatSeparator = formatSeparator || ',';
1118
+ this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';
1119
+ this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';
1120
+ this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');
1121
+ this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');
1122
+ this.nestingOptionsSeparator = nestingOptionsSeparator || ',';
1123
+ this.maxReplaces = maxReplaces || 1000;
1124
+ this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;
1125
+ this.resetRegExp();
1126
+ }
1127
+ reset() {
1128
+ if (this.options) this.init(this.options);
1129
+ }
1130
+ resetRegExp() {
1131
+ const getOrResetRegExp = (existingRegExp, pattern) => {
1132
+ if (existingRegExp?.source === pattern) {
1133
+ existingRegExp.lastIndex = 0;
1134
+ return existingRegExp;
1135
+ }
1136
+ return new RegExp(pattern, 'g');
1137
+ };
1138
+ this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
1139
+ this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
1140
+ this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
1141
+ }
1142
+ interpolate(str, data, lng, options) {
1143
+ let match;
1144
+ let value;
1145
+ let replaces;
1146
+ const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
1147
+ const handleFormat = key => {
1148
+ if (key.indexOf(this.formatSeparator) < 0) {
1149
+ const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
1150
+ return this.alwaysFormat ? this.format(path, undefined, lng, {
1151
+ ...options,
1152
+ ...data,
1153
+ interpolationkey: key
1154
+ }) : path;
1155
+ }
1156
+ const p = key.split(this.formatSeparator);
1157
+ const k = p.shift().trim();
1158
+ const f = p.join(this.formatSeparator).trim();
1159
+ return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
1160
+ ...options,
1161
+ ...data,
1162
+ interpolationkey: k
1163
+ });
1164
+ };
1165
+ this.resetRegExp();
1166
+ const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
1167
+ const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
1168
+ const todos = [{
1169
+ regex: this.regexpUnescape,
1170
+ safeValue: val => regexSafe(val)
1171
+ }, {
1172
+ regex: this.regexp,
1173
+ safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
1174
+ }];
1175
+ todos.forEach(todo => {
1176
+ replaces = 0;
1177
+ while (match = todo.regex.exec(str)) {
1178
+ const matchedVar = match[1].trim();
1179
+ value = handleFormat(matchedVar);
1180
+ if (value === undefined) {
1181
+ if (typeof missingInterpolationHandler === 'function') {
1182
+ const temp = missingInterpolationHandler(str, match, options);
1183
+ value = isString(temp) ? temp : '';
1184
+ } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
1185
+ value = '';
1186
+ } else if (skipOnVariables) {
1187
+ value = match[0];
1188
+ continue;
1189
+ } else {
1190
+ this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
1191
+ value = '';
1192
+ }
1193
+ } else if (!isString(value) && !this.useRawValueToEscape) {
1194
+ value = makeString(value);
1195
+ }
1196
+ const safeValue = todo.safeValue(value);
1197
+ str = str.replace(match[0], safeValue);
1198
+ if (skipOnVariables) {
1199
+ todo.regex.lastIndex += value.length;
1200
+ todo.regex.lastIndex -= match[0].length;
1201
+ } else {
1202
+ todo.regex.lastIndex = 0;
1203
+ }
1204
+ replaces++;
1205
+ if (replaces >= this.maxReplaces) {
1206
+ break;
1207
+ }
1208
+ }
1209
+ });
1210
+ return str;
1211
+ }
1212
+ nest(str, fc, options = {}) {
1213
+ let match;
1214
+ let value;
1215
+ let clonedOptions;
1216
+ const handleHasOptions = (key, inheritedOptions) => {
1217
+ const sep = this.nestingOptionsSeparator;
1218
+ if (key.indexOf(sep) < 0) return key;
1219
+ const c = key.split(new RegExp(`${sep}[ ]*{`));
1220
+ let optionsString = `{${c[1]}`;
1221
+ key = c[0];
1222
+ optionsString = this.interpolate(optionsString, clonedOptions);
1223
+ const matchedSingleQuotes = optionsString.match(/'/g);
1224
+ const matchedDoubleQuotes = optionsString.match(/"/g);
1225
+ if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
1226
+ optionsString = optionsString.replace(/'/g, '"');
1227
+ }
1228
+ try {
1229
+ clonedOptions = JSON.parse(optionsString);
1230
+ if (inheritedOptions) clonedOptions = {
1231
+ ...inheritedOptions,
1232
+ ...clonedOptions
1233
+ };
1234
+ } catch (e) {
1235
+ this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
1236
+ return `${key}${sep}${optionsString}`;
1237
+ }
1238
+ if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
1239
+ return key;
1240
+ };
1241
+ while (match = this.nestingRegexp.exec(str)) {
1242
+ let formatters = [];
1243
+ clonedOptions = {
1244
+ ...options
1245
+ };
1246
+ clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
1247
+ clonedOptions.applyPostProcessor = false;
1248
+ delete clonedOptions.defaultValue;
1249
+ const keyEndIndex = /{.*}/.test(match[1]) ? match[1].lastIndexOf('}') + 1 : match[1].indexOf(this.formatSeparator);
1250
+ if (keyEndIndex !== -1) {
1251
+ formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map(elem => elem.trim()).filter(Boolean);
1252
+ match[1] = match[1].slice(0, keyEndIndex);
1253
+ }
1254
+ value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
1255
+ if (value && match[0] === str && !isString(value)) return value;
1256
+ if (!isString(value)) value = makeString(value);
1257
+ if (!value) {
1258
+ this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
1259
+ value = '';
1260
+ }
1261
+ if (formatters.length) {
1262
+ value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
1263
+ ...options,
1264
+ interpolationkey: match[1].trim()
1265
+ }), value.trim());
1266
+ }
1267
+ str = str.replace(match[0], value);
1268
+ this.regexp.lastIndex = 0;
1269
+ }
1270
+ return str;
1271
+ }
1272
+ }
1273
+
1274
+ const parseFormatStr = formatStr => {
1275
+ let formatName = formatStr.toLowerCase().trim();
1276
+ const formatOptions = {};
1277
+ if (formatStr.indexOf('(') > -1) {
1278
+ const p = formatStr.split('(');
1279
+ formatName = p[0].toLowerCase().trim();
1280
+ const optStr = p[1].substring(0, p[1].length - 1);
1281
+ if (formatName === 'currency' && optStr.indexOf(':') < 0) {
1282
+ if (!formatOptions.currency) formatOptions.currency = optStr.trim();
1283
+ } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
1284
+ if (!formatOptions.range) formatOptions.range = optStr.trim();
1285
+ } else {
1286
+ const opts = optStr.split(';');
1287
+ opts.forEach(opt => {
1288
+ if (opt) {
1289
+ const [key, ...rest] = opt.split(':');
1290
+ const val = rest.join(':').trim().replace(/^'+|'+$/g, '');
1291
+ const trimmedKey = key.trim();
1292
+ if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
1293
+ if (val === 'false') formatOptions[trimmedKey] = false;
1294
+ if (val === 'true') formatOptions[trimmedKey] = true;
1295
+ if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
1296
+ }
1297
+ });
1298
+ }
1299
+ }
1300
+ return {
1301
+ formatName,
1302
+ formatOptions
1303
+ };
1304
+ };
1305
+ const createCachedFormatter = fn => {
1306
+ const cache = {};
1307
+ return (v, l, o) => {
1308
+ let optForCache = o;
1309
+ if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) {
1310
+ optForCache = {
1311
+ ...optForCache,
1312
+ [o.interpolationkey]: undefined
1313
+ };
1314
+ }
1315
+ const key = l + JSON.stringify(optForCache);
1316
+ let frm = cache[key];
1317
+ if (!frm) {
1318
+ frm = fn(getCleanedCode(l), o);
1319
+ cache[key] = frm;
1320
+ }
1321
+ return frm(v);
1322
+ };
1323
+ };
1324
+ const createNonCachedFormatter = fn => (v, l, o) => fn(getCleanedCode(l), o)(v);
1325
+ class Formatter {
1326
+ constructor(options = {}) {
1327
+ this.logger = baseLogger.create('formatter');
1328
+ this.options = options;
1329
+ this.init(options);
1330
+ }
1331
+ init(services, options = {
1332
+ interpolation: {}
1333
+ }) {
1334
+ this.formatSeparator = options.interpolation.formatSeparator || ',';
1335
+ const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
1336
+ this.formats = {
1337
+ number: cf((lng, opt) => {
1338
+ const formatter = new Intl.NumberFormat(lng, {
1339
+ ...opt
1340
+ });
1341
+ return val => formatter.format(val);
1342
+ }),
1343
+ currency: cf((lng, opt) => {
1344
+ const formatter = new Intl.NumberFormat(lng, {
1345
+ ...opt,
1346
+ style: 'currency'
1347
+ });
1348
+ return val => formatter.format(val);
1349
+ }),
1350
+ datetime: cf((lng, opt) => {
1351
+ const formatter = new Intl.DateTimeFormat(lng, {
1352
+ ...opt
1353
+ });
1354
+ return val => formatter.format(val);
1355
+ }),
1356
+ relativetime: cf((lng, opt) => {
1357
+ const formatter = new Intl.RelativeTimeFormat(lng, {
1358
+ ...opt
1359
+ });
1360
+ return val => formatter.format(val, opt.range || 'day');
1361
+ }),
1362
+ list: cf((lng, opt) => {
1363
+ const formatter = new Intl.ListFormat(lng, {
1364
+ ...opt
1365
+ });
1366
+ return val => formatter.format(val);
1367
+ })
1368
+ };
1369
+ }
1370
+ add(name, fc) {
1371
+ this.formats[name.toLowerCase().trim()] = fc;
1372
+ }
1373
+ addCached(name, fc) {
1374
+ this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
1375
+ }
1376
+ format(value, format, lng, options = {}) {
1377
+ const formats = format.split(this.formatSeparator);
1378
+ if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
1379
+ const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
1380
+ formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
1381
+ }
1382
+ const result = formats.reduce((mem, f) => {
1383
+ const {
1384
+ formatName,
1385
+ formatOptions
1386
+ } = parseFormatStr(f);
1387
+ if (this.formats[formatName]) {
1388
+ let formatted = mem;
1389
+ try {
1390
+ const valOptions = options?.formatParams?.[options.interpolationkey] || {};
1391
+ const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
1392
+ formatted = this.formats[formatName](mem, l, {
1393
+ ...formatOptions,
1394
+ ...options,
1395
+ ...valOptions
1396
+ });
1397
+ } catch (error) {
1398
+ this.logger.warn(error);
1399
+ }
1400
+ return formatted;
1401
+ } else {
1402
+ this.logger.warn(`there was no format function for ${formatName}`);
1403
+ }
1404
+ return mem;
1405
+ }, value);
1406
+ return result;
1407
+ }
1408
+ }
1409
+
1410
+ const removePending = (q, name) => {
1411
+ if (q.pending[name] !== undefined) {
1412
+ delete q.pending[name];
1413
+ q.pendingCount--;
1414
+ }
1415
+ };
1416
+ class Connector extends EventEmitter {
1417
+ constructor(backend, store, services, options = {}) {
1418
+ super();
1419
+ this.backend = backend;
1420
+ this.store = store;
1421
+ this.services = services;
1422
+ this.languageUtils = services.languageUtils;
1423
+ this.options = options;
1424
+ this.logger = baseLogger.create('backendConnector');
1425
+ this.waitingReads = [];
1426
+ this.maxParallelReads = options.maxParallelReads || 10;
1427
+ this.readingCalls = 0;
1428
+ this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
1429
+ this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
1430
+ this.state = {};
1431
+ this.queue = [];
1432
+ this.backend?.init?.(services, options.backend, options);
1433
+ }
1434
+ queueLoad(languages, namespaces, options, callback) {
1435
+ const toLoad = {};
1436
+ const pending = {};
1437
+ const toLoadLanguages = {};
1438
+ const toLoadNamespaces = {};
1439
+ languages.forEach(lng => {
1440
+ let hasAllNamespaces = true;
1441
+ namespaces.forEach(ns => {
1442
+ const name = `${lng}|${ns}`;
1443
+ if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
1444
+ this.state[name] = 2;
1445
+ } else if (this.state[name] < 0) ; else if (this.state[name] === 1) {
1446
+ if (pending[name] === undefined) pending[name] = true;
1447
+ } else {
1448
+ this.state[name] = 1;
1449
+ hasAllNamespaces = false;
1450
+ if (pending[name] === undefined) pending[name] = true;
1451
+ if (toLoad[name] === undefined) toLoad[name] = true;
1452
+ if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
1453
+ }
1454
+ });
1455
+ if (!hasAllNamespaces) toLoadLanguages[lng] = true;
1456
+ });
1457
+ if (Object.keys(toLoad).length || Object.keys(pending).length) {
1458
+ this.queue.push({
1459
+ pending,
1460
+ pendingCount: Object.keys(pending).length,
1461
+ loaded: {},
1462
+ errors: [],
1463
+ callback
1464
+ });
1465
+ }
1466
+ return {
1467
+ toLoad: Object.keys(toLoad),
1468
+ pending: Object.keys(pending),
1469
+ toLoadLanguages: Object.keys(toLoadLanguages),
1470
+ toLoadNamespaces: Object.keys(toLoadNamespaces)
1471
+ };
1472
+ }
1473
+ loaded(name, err, data) {
1474
+ const s = name.split('|');
1475
+ const lng = s[0];
1476
+ const ns = s[1];
1477
+ if (err) this.emit('failedLoading', lng, ns, err);
1478
+ if (!err && data) {
1479
+ this.store.addResourceBundle(lng, ns, data, undefined, undefined, {
1480
+ skipCopy: true
1481
+ });
1482
+ }
1483
+ this.state[name] = err ? -1 : 2;
1484
+ if (err && data) this.state[name] = 0;
1485
+ const loaded = {};
1486
+ this.queue.forEach(q => {
1487
+ pushPath(q.loaded, [lng], ns);
1488
+ removePending(q, name);
1489
+ if (err) q.errors.push(err);
1490
+ if (q.pendingCount === 0 && !q.done) {
1491
+ Object.keys(q.loaded).forEach(l => {
1492
+ if (!loaded[l]) loaded[l] = {};
1493
+ const loadedKeys = q.loaded[l];
1494
+ if (loadedKeys.length) {
1495
+ loadedKeys.forEach(n => {
1496
+ if (loaded[l][n] === undefined) loaded[l][n] = true;
1497
+ });
1498
+ }
1499
+ });
1500
+ q.done = true;
1501
+ if (q.errors.length) {
1502
+ q.callback(q.errors);
1503
+ } else {
1504
+ q.callback();
1505
+ }
1506
+ }
1507
+ });
1508
+ this.emit('loaded', loaded);
1509
+ this.queue = this.queue.filter(q => !q.done);
1510
+ }
1511
+ read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
1512
+ if (!lng.length) return callback(null, {});
1513
+ if (this.readingCalls >= this.maxParallelReads) {
1514
+ this.waitingReads.push({
1515
+ lng,
1516
+ ns,
1517
+ fcName,
1518
+ tried,
1519
+ wait,
1520
+ callback
1521
+ });
1522
+ return;
1523
+ }
1524
+ this.readingCalls++;
1525
+ const resolver = (err, data) => {
1526
+ this.readingCalls--;
1527
+ if (this.waitingReads.length > 0) {
1528
+ const next = this.waitingReads.shift();
1529
+ this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
1530
+ }
1531
+ if (err && data && tried < this.maxRetries) {
1532
+ setTimeout(() => {
1533
+ this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
1534
+ }, wait);
1535
+ return;
1536
+ }
1537
+ callback(err, data);
1538
+ };
1539
+ const fc = this.backend[fcName].bind(this.backend);
1540
+ if (fc.length === 2) {
1541
+ try {
1542
+ const r = fc(lng, ns);
1543
+ if (r && typeof r.then === 'function') {
1544
+ r.then(data => resolver(null, data)).catch(resolver);
1545
+ } else {
1546
+ resolver(null, r);
1547
+ }
1548
+ } catch (err) {
1549
+ resolver(err);
1550
+ }
1551
+ return;
1552
+ }
1553
+ return fc(lng, ns, resolver);
1554
+ }
1555
+ prepareLoading(languages, namespaces, options = {}, callback) {
1556
+ if (!this.backend) {
1557
+ this.logger.warn('No backend was added via i18next.use. Will not load resources.');
1558
+ return callback && callback();
1559
+ }
1560
+ if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
1561
+ if (isString(namespaces)) namespaces = [namespaces];
1562
+ const toLoad = this.queueLoad(languages, namespaces, options, callback);
1563
+ if (!toLoad.toLoad.length) {
1564
+ if (!toLoad.pending.length) callback();
1565
+ return null;
1566
+ }
1567
+ toLoad.toLoad.forEach(name => {
1568
+ this.loadOne(name);
1569
+ });
1570
+ }
1571
+ load(languages, namespaces, callback) {
1572
+ this.prepareLoading(languages, namespaces, {}, callback);
1573
+ }
1574
+ reload(languages, namespaces, callback) {
1575
+ this.prepareLoading(languages, namespaces, {
1576
+ reload: true
1577
+ }, callback);
1578
+ }
1579
+ loadOne(name, prefix = '') {
1580
+ const s = name.split('|');
1581
+ const lng = s[0];
1582
+ const ns = s[1];
1583
+ this.read(lng, ns, 'read', undefined, undefined, (err, data) => {
1584
+ if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
1585
+ if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
1586
+ this.loaded(name, err, data);
1587
+ });
1588
+ }
1589
+ saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}) {
1590
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
1591
+ this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
1592
+ return;
1593
+ }
1594
+ if (key === undefined || key === null || key === '') return;
1595
+ if (this.backend?.create) {
1596
+ const opts = {
1597
+ ...options,
1598
+ isUpdate
1599
+ };
1600
+ const fc = this.backend.create.bind(this.backend);
1601
+ if (fc.length < 6) {
1602
+ try {
1603
+ let r;
1604
+ if (fc.length === 5) {
1605
+ r = fc(languages, namespace, key, fallbackValue, opts);
1606
+ } else {
1607
+ r = fc(languages, namespace, key, fallbackValue);
1608
+ }
1609
+ if (r && typeof r.then === 'function') {
1610
+ r.then(data => clb(null, data)).catch(clb);
1611
+ } else {
1612
+ clb(null, r);
1613
+ }
1614
+ } catch (err) {
1615
+ clb(err);
1616
+ }
1617
+ } else {
1618
+ fc(languages, namespace, key, fallbackValue, clb, opts);
1619
+ }
1620
+ }
1621
+ if (!languages || !languages[0]) return;
1622
+ this.store.addResource(languages[0], namespace, key, fallbackValue);
1623
+ }
1624
+ }
1625
+
1626
+ const get = () => ({
1627
+ debug: false,
1628
+ initAsync: true,
1629
+ ns: ['translation'],
1630
+ defaultNS: ['translation'],
1631
+ fallbackLng: ['dev'],
1632
+ fallbackNS: false,
1633
+ supportedLngs: false,
1634
+ nonExplicitSupportedLngs: false,
1635
+ load: 'all',
1636
+ preload: false,
1637
+ simplifyPluralSuffix: true,
1638
+ keySeparator: '.',
1639
+ nsSeparator: ':',
1640
+ pluralSeparator: '_',
1641
+ contextSeparator: '_',
1642
+ partialBundledLanguages: false,
1643
+ saveMissing: false,
1644
+ updateMissing: false,
1645
+ saveMissingTo: 'fallback',
1646
+ saveMissingPlurals: true,
1647
+ missingKeyHandler: false,
1648
+ missingInterpolationHandler: false,
1649
+ postProcess: false,
1650
+ postProcessPassResolved: false,
1651
+ returnNull: false,
1652
+ returnEmptyString: true,
1653
+ returnObjects: false,
1654
+ joinArrays: false,
1655
+ returnedObjectHandler: false,
1656
+ parseMissingKeyHandler: false,
1657
+ appendNamespaceToMissingKey: false,
1658
+ appendNamespaceToCIMode: false,
1659
+ overloadTranslationOptionHandler: args => {
1660
+ let ret = {};
1661
+ if (typeof args[1] === 'object') ret = args[1];
1662
+ if (isString(args[1])) ret.defaultValue = args[1];
1663
+ if (isString(args[2])) ret.tDescription = args[2];
1664
+ if (typeof args[2] === 'object' || typeof args[3] === 'object') {
1665
+ const options = args[3] || args[2];
1666
+ Object.keys(options).forEach(key => {
1667
+ ret[key] = options[key];
1668
+ });
1669
+ }
1670
+ return ret;
1671
+ },
1672
+ interpolation: {
1673
+ escapeValue: true,
1674
+ format: value => value,
1675
+ prefix: '{{',
1676
+ suffix: '}}',
1677
+ formatSeparator: ',',
1678
+ unescapePrefix: '-',
1679
+ nestingPrefix: '$t(',
1680
+ nestingSuffix: ')',
1681
+ nestingOptionsSeparator: ',',
1682
+ maxReplaces: 1000,
1683
+ skipOnVariables: true
1684
+ },
1685
+ cacheInBuiltFormats: true
1686
+ });
1687
+ const transformOptions = options => {
1688
+ if (isString(options.ns)) options.ns = [options.ns];
1689
+ if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
1690
+ if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
1691
+ if (options.supportedLngs?.indexOf?.('cimode') < 0) {
1692
+ options.supportedLngs = options.supportedLngs.concat(['cimode']);
1693
+ }
1694
+ if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
1695
+ return options;
1696
+ };
1697
+
1698
+ const noop = () => {};
1699
+ const bindMemberFunctions = inst => {
1700
+ const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
1701
+ mems.forEach(mem => {
1702
+ if (typeof inst[mem] === 'function') {
1703
+ inst[mem] = inst[mem].bind(inst);
1704
+ }
1705
+ });
1706
+ };
1707
+ class I18n extends EventEmitter {
1708
+ constructor(options = {}, callback) {
1709
+ super();
1710
+ this.options = transformOptions(options);
1711
+ this.services = {};
1712
+ this.logger = baseLogger;
1713
+ this.modules = {
1714
+ external: []
1715
+ };
1716
+ bindMemberFunctions(this);
1717
+ if (callback && !this.isInitialized && !options.isClone) {
1718
+ if (!this.options.initAsync) {
1719
+ this.init(options, callback);
1720
+ return this;
1721
+ }
1722
+ setTimeout(() => {
1723
+ this.init(options, callback);
1724
+ }, 0);
1725
+ }
1726
+ }
1727
+ init(options = {}, callback) {
1728
+ this.isInitializing = true;
1729
+ if (typeof options === 'function') {
1730
+ callback = options;
1731
+ options = {};
1732
+ }
1733
+ if (options.defaultNS == null && options.ns) {
1734
+ if (isString(options.ns)) {
1735
+ options.defaultNS = options.ns;
1736
+ } else if (options.ns.indexOf('translation') < 0) {
1737
+ options.defaultNS = options.ns[0];
1738
+ }
1739
+ }
1740
+ const defOpts = get();
1741
+ this.options = {
1742
+ ...defOpts,
1743
+ ...this.options,
1744
+ ...transformOptions(options)
1745
+ };
1746
+ this.options.interpolation = {
1747
+ ...defOpts.interpolation,
1748
+ ...this.options.interpolation
1749
+ };
1750
+ if (options.keySeparator !== undefined) {
1751
+ this.options.userDefinedKeySeparator = options.keySeparator;
1752
+ }
1753
+ if (options.nsSeparator !== undefined) {
1754
+ this.options.userDefinedNsSeparator = options.nsSeparator;
1755
+ }
1756
+ const createClassOnDemand = ClassOrObject => {
1757
+ if (!ClassOrObject) return null;
1758
+ if (typeof ClassOrObject === 'function') return new ClassOrObject();
1759
+ return ClassOrObject;
1760
+ };
1761
+ if (!this.options.isClone) {
1762
+ if (this.modules.logger) {
1763
+ baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
1764
+ } else {
1765
+ baseLogger.init(null, this.options);
1766
+ }
1767
+ let formatter;
1768
+ if (this.modules.formatter) {
1769
+ formatter = this.modules.formatter;
1770
+ } else {
1771
+ formatter = Formatter;
1772
+ }
1773
+ const lu = new LanguageUtil(this.options);
1774
+ this.store = new ResourceStore(this.options.resources, this.options);
1775
+ const s = this.services;
1776
+ s.logger = baseLogger;
1777
+ s.resourceStore = this.store;
1778
+ s.languageUtils = lu;
1779
+ s.pluralResolver = new PluralResolver(lu, {
1780
+ prepend: this.options.pluralSeparator,
1781
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1782
+ });
1783
+ const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
1784
+ if (usingLegacyFormatFunction) {
1785
+ this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
1786
+ }
1787
+ if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
1788
+ s.formatter = createClassOnDemand(formatter);
1789
+ if (s.formatter.init) s.formatter.init(s, this.options);
1790
+ this.options.interpolation.format = s.formatter.format.bind(s.formatter);
1791
+ }
1792
+ s.interpolator = new Interpolator(this.options);
1793
+ s.utils = {
1794
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1795
+ };
1796
+ s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
1797
+ s.backendConnector.on('*', (event, ...args) => {
1798
+ this.emit(event, ...args);
1799
+ });
1800
+ if (this.modules.languageDetector) {
1801
+ s.languageDetector = createClassOnDemand(this.modules.languageDetector);
1802
+ if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
1803
+ }
1804
+ if (this.modules.i18nFormat) {
1805
+ s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
1806
+ if (s.i18nFormat.init) s.i18nFormat.init(this);
1807
+ }
1808
+ this.translator = new Translator(this.services, this.options);
1809
+ this.translator.on('*', (event, ...args) => {
1810
+ this.emit(event, ...args);
1811
+ });
1812
+ this.modules.external.forEach(m => {
1813
+ if (m.init) m.init(this);
1814
+ });
1815
+ }
1816
+ this.format = this.options.interpolation.format;
1817
+ if (!callback) callback = noop;
1818
+ if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1819
+ const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1820
+ if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
1821
+ }
1822
+ if (!this.services.languageDetector && !this.options.lng) {
1823
+ this.logger.warn('init: no languageDetector is used and no lng is defined');
1824
+ }
1825
+ const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
1826
+ storeApi.forEach(fcName => {
1827
+ this[fcName] = (...args) => this.store[fcName](...args);
1828
+ });
1829
+ const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
1830
+ storeApiChained.forEach(fcName => {
1831
+ this[fcName] = (...args) => {
1832
+ this.store[fcName](...args);
1833
+ return this;
1834
+ };
1835
+ });
1836
+ const deferred = defer();
1837
+ const load = () => {
1838
+ const finish = (err, t) => {
1839
+ this.isInitializing = false;
1840
+ if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');
1841
+ this.isInitialized = true;
1842
+ if (!this.options.isClone) this.logger.log('initialized', this.options);
1843
+ this.emit('initialized', this.options);
1844
+ deferred.resolve(t);
1845
+ callback(err, t);
1846
+ };
1847
+ if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
1848
+ this.changeLanguage(this.options.lng, finish);
1849
+ };
1850
+ if (this.options.resources || !this.options.initAsync) {
1851
+ load();
1852
+ } else {
1853
+ setTimeout(load, 0);
1854
+ }
1855
+ return deferred;
1856
+ }
1857
+ loadResources(language, callback = noop) {
1858
+ let usedCallback = callback;
1859
+ const usedLng = isString(language) ? language : this.language;
1860
+ if (typeof language === 'function') usedCallback = language;
1861
+ if (!this.options.resources || this.options.partialBundledLanguages) {
1862
+ if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
1863
+ const toLoad = [];
1864
+ const append = lng => {
1865
+ if (!lng) return;
1866
+ if (lng === 'cimode') return;
1867
+ const lngs = this.services.languageUtils.toResolveHierarchy(lng);
1868
+ lngs.forEach(l => {
1869
+ if (l === 'cimode') return;
1870
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
1871
+ });
1872
+ };
1873
+ if (!usedLng) {
1874
+ const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1875
+ fallbacks.forEach(l => append(l));
1876
+ } else {
1877
+ append(usedLng);
1878
+ }
1879
+ this.options.preload?.forEach?.(l => append(l));
1880
+ this.services.backendConnector.load(toLoad, this.options.ns, e => {
1881
+ if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
1882
+ usedCallback(e);
1883
+ });
1884
+ } else {
1885
+ usedCallback(null);
1886
+ }
1887
+ }
1888
+ reloadResources(lngs, ns, callback) {
1889
+ const deferred = defer();
1890
+ if (typeof lngs === 'function') {
1891
+ callback = lngs;
1892
+ lngs = undefined;
1893
+ }
1894
+ if (typeof ns === 'function') {
1895
+ callback = ns;
1896
+ ns = undefined;
1897
+ }
1898
+ if (!lngs) lngs = this.languages;
1899
+ if (!ns) ns = this.options.ns;
1900
+ if (!callback) callback = noop;
1901
+ this.services.backendConnector.reload(lngs, ns, err => {
1902
+ deferred.resolve();
1903
+ callback(err);
1904
+ });
1905
+ return deferred;
1906
+ }
1907
+ use(module) {
1908
+ if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
1909
+ if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
1910
+ if (module.type === 'backend') {
1911
+ this.modules.backend = module;
1912
+ }
1913
+ if (module.type === 'logger' || module.log && module.warn && module.error) {
1914
+ this.modules.logger = module;
1915
+ }
1916
+ if (module.type === 'languageDetector') {
1917
+ this.modules.languageDetector = module;
1918
+ }
1919
+ if (module.type === 'i18nFormat') {
1920
+ this.modules.i18nFormat = module;
1921
+ }
1922
+ if (module.type === 'postProcessor') {
1923
+ postProcessor.addPostProcessor(module);
1924
+ }
1925
+ if (module.type === 'formatter') {
1926
+ this.modules.formatter = module;
1927
+ }
1928
+ if (module.type === '3rdParty') {
1929
+ this.modules.external.push(module);
1930
+ }
1931
+ return this;
1932
+ }
1933
+ setResolvedLanguage(l) {
1934
+ if (!l || !this.languages) return;
1935
+ if (['cimode', 'dev'].indexOf(l) > -1) return;
1936
+ for (let li = 0; li < this.languages.length; li++) {
1937
+ const lngInLngs = this.languages[li];
1938
+ if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
1939
+ if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
1940
+ this.resolvedLanguage = lngInLngs;
1941
+ break;
1942
+ }
1943
+ }
1944
+ if (!this.resolvedLanguage && this.languages.indexOf(l) < 0 && this.store.hasLanguageSomeTranslations(l)) {
1945
+ this.resolvedLanguage = l;
1946
+ this.languages.unshift(l);
1947
+ }
1948
+ }
1949
+ changeLanguage(lng, callback) {
1950
+ this.isLanguageChangingTo = lng;
1951
+ const deferred = defer();
1952
+ this.emit('languageChanging', lng);
1953
+ const setLngProps = l => {
1954
+ this.language = l;
1955
+ this.languages = this.services.languageUtils.toResolveHierarchy(l);
1956
+ this.resolvedLanguage = undefined;
1957
+ this.setResolvedLanguage(l);
1958
+ };
1959
+ const done = (err, l) => {
1960
+ if (l) {
1961
+ if (this.isLanguageChangingTo === lng) {
1962
+ setLngProps(l);
1963
+ this.translator.changeLanguage(l);
1964
+ this.isLanguageChangingTo = undefined;
1965
+ this.emit('languageChanged', l);
1966
+ this.logger.log('languageChanged', l);
1967
+ }
1968
+ } else {
1969
+ this.isLanguageChangingTo = undefined;
1970
+ }
1971
+ deferred.resolve((...args) => this.t(...args));
1972
+ if (callback) callback(err, (...args) => this.t(...args));
1973
+ };
1974
+ const setLng = lngs => {
1975
+ if (!lng && !lngs && this.services.languageDetector) lngs = [];
1976
+ const fl = isString(lngs) ? lngs : lngs && lngs[0];
1977
+ const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [lngs] : lngs);
1978
+ if (l) {
1979
+ if (!this.language) {
1980
+ setLngProps(l);
1981
+ }
1982
+ if (!this.translator.language) this.translator.changeLanguage(l);
1983
+ this.services.languageDetector?.cacheUserLanguage?.(l);
1984
+ }
1985
+ this.loadResources(l, err => {
1986
+ done(err, l);
1987
+ });
1988
+ };
1989
+ if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
1990
+ setLng(this.services.languageDetector.detect());
1991
+ } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
1992
+ if (this.services.languageDetector.detect.length === 0) {
1993
+ this.services.languageDetector.detect().then(setLng);
1994
+ } else {
1995
+ this.services.languageDetector.detect(setLng);
1996
+ }
1997
+ } else {
1998
+ setLng(lng);
1999
+ }
2000
+ return deferred;
2001
+ }
2002
+ getFixedT(lng, ns, keyPrefix) {
2003
+ const fixedT = (key, opts, ...rest) => {
2004
+ let o;
2005
+ if (typeof opts !== 'object') {
2006
+ o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
2007
+ } else {
2008
+ o = {
2009
+ ...opts
2010
+ };
2011
+ }
2012
+ o.lng = o.lng || fixedT.lng;
2013
+ o.lngs = o.lngs || fixedT.lngs;
2014
+ o.ns = o.ns || fixedT.ns;
2015
+ if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
2016
+ const keySeparator = this.options.keySeparator || '.';
2017
+ let resultKey;
2018
+ if (o.keyPrefix && Array.isArray(key)) {
2019
+ resultKey = key.map(k => {
2020
+ if (typeof k === 'function') k = keysFromSelector(k, {
2021
+ ...this.options,
2022
+ ...opts
2023
+ });
2024
+ return `${o.keyPrefix}${keySeparator}${k}`;
2025
+ });
2026
+ } else {
2027
+ if (typeof key === 'function') key = keysFromSelector(key, {
2028
+ ...this.options,
2029
+ ...opts
2030
+ });
2031
+ resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
2032
+ }
2033
+ return this.t(resultKey, o);
2034
+ };
2035
+ if (isString(lng)) {
2036
+ fixedT.lng = lng;
2037
+ } else {
2038
+ fixedT.lngs = lng;
2039
+ }
2040
+ fixedT.ns = ns;
2041
+ fixedT.keyPrefix = keyPrefix;
2042
+ return fixedT;
2043
+ }
2044
+ t(...args) {
2045
+ return this.translator?.translate(...args);
2046
+ }
2047
+ exists(...args) {
2048
+ return this.translator?.exists(...args);
2049
+ }
2050
+ setDefaultNamespace(ns) {
2051
+ this.options.defaultNS = ns;
2052
+ }
2053
+ hasLoadedNamespace(ns, options = {}) {
2054
+ if (!this.isInitialized) {
2055
+ this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
2056
+ return false;
2057
+ }
2058
+ if (!this.languages || !this.languages.length) {
2059
+ this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
2060
+ return false;
2061
+ }
2062
+ const lng = options.lng || this.resolvedLanguage || this.languages[0];
2063
+ const fallbackLng = this.options ? this.options.fallbackLng : false;
2064
+ const lastLng = this.languages[this.languages.length - 1];
2065
+ if (lng.toLowerCase() === 'cimode') return true;
2066
+ const loadNotPending = (l, n) => {
2067
+ const loadState = this.services.backendConnector.state[`${l}|${n}`];
2068
+ return loadState === -1 || loadState === 0 || loadState === 2;
2069
+ };
2070
+ if (options.precheck) {
2071
+ const preResult = options.precheck(this, loadNotPending);
2072
+ if (preResult !== undefined) return preResult;
2073
+ }
2074
+ if (this.hasResourceBundle(lng, ns)) return true;
2075
+ if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
2076
+ if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
2077
+ return false;
2078
+ }
2079
+ loadNamespaces(ns, callback) {
2080
+ const deferred = defer();
2081
+ if (!this.options.ns) {
2082
+ if (callback) callback();
2083
+ return Promise.resolve();
2084
+ }
2085
+ if (isString(ns)) ns = [ns];
2086
+ ns.forEach(n => {
2087
+ if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
2088
+ });
2089
+ this.loadResources(err => {
2090
+ deferred.resolve();
2091
+ if (callback) callback(err);
2092
+ });
2093
+ return deferred;
2094
+ }
2095
+ loadLanguages(lngs, callback) {
2096
+ const deferred = defer();
2097
+ if (isString(lngs)) lngs = [lngs];
2098
+ const preloaded = this.options.preload || [];
2099
+ const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
2100
+ if (!newLngs.length) {
2101
+ if (callback) callback();
2102
+ return Promise.resolve();
2103
+ }
2104
+ this.options.preload = preloaded.concat(newLngs);
2105
+ this.loadResources(err => {
2106
+ deferred.resolve();
2107
+ if (callback) callback(err);
2108
+ });
2109
+ return deferred;
2110
+ }
2111
+ dir(lng) {
2112
+ if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
2113
+ if (!lng) return 'rtl';
2114
+ try {
2115
+ const l = new Intl.Locale(lng);
2116
+ if (l && l.getTextInfo) {
2117
+ const ti = l.getTextInfo();
2118
+ if (ti && ti.direction) return ti.direction;
2119
+ }
2120
+ } catch (e) {}
2121
+ const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
2122
+ const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
2123
+ if (lng.toLowerCase().indexOf('-latn') > 1) return 'ltr';
2124
+ return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
2125
+ }
2126
+ static createInstance(options = {}, callback) {
2127
+ const instance = new I18n(options, callback);
2128
+ instance.createInstance = I18n.createInstance;
2129
+ return instance;
2130
+ }
2131
+ cloneInstance(options = {}, callback = noop) {
2132
+ const forkResourceStore = options.forkResourceStore;
2133
+ if (forkResourceStore) delete options.forkResourceStore;
2134
+ const mergedOptions = {
2135
+ ...this.options,
2136
+ ...options,
2137
+ ...{
2138
+ isClone: true
2139
+ }
2140
+ };
2141
+ const clone = new I18n(mergedOptions);
2142
+ if (options.debug !== undefined || options.prefix !== undefined) {
2143
+ clone.logger = clone.logger.clone(options);
2144
+ }
2145
+ const membersToCopy = ['store', 'services', 'language'];
2146
+ membersToCopy.forEach(m => {
2147
+ clone[m] = this[m];
2148
+ });
2149
+ clone.services = {
2150
+ ...this.services
2151
+ };
2152
+ clone.services.utils = {
2153
+ hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
2154
+ };
2155
+ if (forkResourceStore) {
2156
+ const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
2157
+ prev[l] = {
2158
+ ...this.store.data[l]
2159
+ };
2160
+ prev[l] = Object.keys(prev[l]).reduce((acc, n) => {
2161
+ acc[n] = {
2162
+ ...prev[l][n]
2163
+ };
2164
+ return acc;
2165
+ }, prev[l]);
2166
+ return prev;
2167
+ }, {});
2168
+ clone.store = new ResourceStore(clonedData, mergedOptions);
2169
+ clone.services.resourceStore = clone.store;
2170
+ }
2171
+ clone.translator = new Translator(clone.services, mergedOptions);
2172
+ clone.translator.on('*', (event, ...args) => {
2173
+ clone.emit(event, ...args);
2174
+ });
2175
+ clone.init(mergedOptions, callback);
2176
+ clone.translator.options = mergedOptions;
2177
+ clone.translator.backendConnector.services.utils = {
2178
+ hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
2179
+ };
2180
+ return clone;
2181
+ }
2182
+ toJSON() {
2183
+ return {
2184
+ options: this.options,
2185
+ store: this.store,
2186
+ language: this.language,
2187
+ languages: this.languages,
2188
+ resolvedLanguage: this.resolvedLanguage
2189
+ };
2190
+ }
2191
+ }
2192
+ const instance = I18n.createInstance();
2193
+
2194
+ const {
2195
+ slice,
2196
+ forEach
2197
+ } = [];
2198
+ function defaults(obj) {
2199
+ forEach.call(slice.call(arguments, 1), source => {
2200
+ if (source) {
2201
+ for (const prop in source) {
2202
+ if (obj[prop] === undefined) obj[prop] = source[prop];
2203
+ }
2204
+ }
2205
+ });
2206
+ return obj;
2207
+ }
2208
+ function hasXSS(input) {
2209
+ if (typeof input !== 'string') return false;
2210
+
2211
+ // Common XSS attack patterns
2212
+ const xssPatterns = [/<\s*script.*?>/i, /<\s*\/\s*script\s*>/i, /<\s*img.*?on\w+\s*=/i, /<\s*\w+\s*on\w+\s*=.*?>/i, /javascript\s*:/i, /vbscript\s*:/i, /expression\s*\(/i, /eval\s*\(/i, /alert\s*\(/i, /document\.cookie/i, /document\.write\s*\(/i, /window\.location/i, /innerHTML/i];
2213
+ return xssPatterns.some(pattern => pattern.test(input));
2214
+ }
2215
+
2216
+ // eslint-disable-next-line no-control-regex
2217
+ const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
2218
+ const serializeCookie = function (name, val) {
2219
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
2220
+ path: '/'
2221
+ };
2222
+ const opt = options;
2223
+ const value = encodeURIComponent(val);
2224
+ let str = `${name}=${value}`;
2225
+ if (opt.maxAge > 0) {
2226
+ const maxAge = opt.maxAge - 0;
2227
+ if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
2228
+ str += `; Max-Age=${Math.floor(maxAge)}`;
2229
+ }
2230
+ if (opt.domain) {
2231
+ if (!fieldContentRegExp.test(opt.domain)) {
2232
+ throw new TypeError('option domain is invalid');
2233
+ }
2234
+ str += `; Domain=${opt.domain}`;
2235
+ }
2236
+ if (opt.path) {
2237
+ if (!fieldContentRegExp.test(opt.path)) {
2238
+ throw new TypeError('option path is invalid');
2239
+ }
2240
+ str += `; Path=${opt.path}`;
2241
+ }
2242
+ if (opt.expires) {
2243
+ if (typeof opt.expires.toUTCString !== 'function') {
2244
+ throw new TypeError('option expires is invalid');
2245
+ }
2246
+ str += `; Expires=${opt.expires.toUTCString()}`;
2247
+ }
2248
+ if (opt.httpOnly) str += '; HttpOnly';
2249
+ if (opt.secure) str += '; Secure';
2250
+ if (opt.sameSite) {
2251
+ const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
2252
+ switch (sameSite) {
2253
+ case true:
2254
+ str += '; SameSite=Strict';
2255
+ break;
2256
+ case 'lax':
2257
+ str += '; SameSite=Lax';
2258
+ break;
2259
+ case 'strict':
2260
+ str += '; SameSite=Strict';
2261
+ break;
2262
+ case 'none':
2263
+ str += '; SameSite=None';
2264
+ break;
2265
+ default:
2266
+ throw new TypeError('option sameSite is invalid');
2267
+ }
2268
+ }
2269
+ if (opt.partitioned) str += '; Partitioned';
2270
+ return str;
2271
+ };
2272
+ const cookie = {
2273
+ create(name, value, minutes, domain) {
2274
+ let cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
2275
+ path: '/',
2276
+ sameSite: 'strict'
2277
+ };
2278
+ if (minutes) {
2279
+ cookieOptions.expires = new Date();
2280
+ cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
2281
+ }
2282
+ if (domain) cookieOptions.domain = domain;
2283
+ document.cookie = serializeCookie(name, value, cookieOptions);
2284
+ },
2285
+ read(name) {
2286
+ const nameEQ = `${name}=`;
2287
+ const ca = document.cookie.split(';');
2288
+ for (let i = 0; i < ca.length; i++) {
2289
+ let c = ca[i];
2290
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
2291
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
2292
+ }
2293
+ return null;
2294
+ },
2295
+ remove(name, domain) {
2296
+ this.create(name, '', -1, domain);
2297
+ }
2298
+ };
2299
+ var cookie$1 = {
2300
+ name: 'cookie',
2301
+ // Deconstruct the options object and extract the lookupCookie property
2302
+ lookup(_ref) {
2303
+ let {
2304
+ lookupCookie
2305
+ } = _ref;
2306
+ if (lookupCookie && typeof document !== 'undefined') {
2307
+ return cookie.read(lookupCookie) || undefined;
2308
+ }
2309
+ return undefined;
2310
+ },
2311
+ // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
2312
+ cacheUserLanguage(lng, _ref2) {
2313
+ let {
2314
+ lookupCookie,
2315
+ cookieMinutes,
2316
+ cookieDomain,
2317
+ cookieOptions
2318
+ } = _ref2;
2319
+ if (lookupCookie && typeof document !== 'undefined') {
2320
+ cookie.create(lookupCookie, lng, cookieMinutes, cookieDomain, cookieOptions);
2321
+ }
2322
+ }
2323
+ };
2324
+
2325
+ var querystring = {
2326
+ name: 'querystring',
2327
+ // Deconstruct the options object and extract the lookupQuerystring property
2328
+ lookup(_ref) {
2329
+ let {
2330
+ lookupQuerystring
2331
+ } = _ref;
2332
+ let found;
2333
+ if (typeof window !== 'undefined') {
2334
+ let {
2335
+ search
2336
+ } = window.location;
2337
+ if (!window.location.search && window.location.hash?.indexOf('?') > -1) {
2338
+ search = window.location.hash.substring(window.location.hash.indexOf('?'));
2339
+ }
2340
+ const query = search.substring(1);
2341
+ const params = query.split('&');
2342
+ for (let i = 0; i < params.length; i++) {
2343
+ const pos = params[i].indexOf('=');
2344
+ if (pos > 0) {
2345
+ const key = params[i].substring(0, pos);
2346
+ if (key === lookupQuerystring) {
2347
+ found = params[i].substring(pos + 1);
2348
+ }
2349
+ }
2350
+ }
2351
+ }
2352
+ return found;
2353
+ }
2354
+ };
2355
+
2356
+ var hash = {
2357
+ name: 'hash',
2358
+ // Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
2359
+ lookup(_ref) {
2360
+ let {
2361
+ lookupHash,
2362
+ lookupFromHashIndex
2363
+ } = _ref;
2364
+ let found;
2365
+ if (typeof window !== 'undefined') {
2366
+ const {
2367
+ hash
2368
+ } = window.location;
2369
+ if (hash && hash.length > 2) {
2370
+ const query = hash.substring(1);
2371
+ if (lookupHash) {
2372
+ const params = query.split('&');
2373
+ for (let i = 0; i < params.length; i++) {
2374
+ const pos = params[i].indexOf('=');
2375
+ if (pos > 0) {
2376
+ const key = params[i].substring(0, pos);
2377
+ if (key === lookupHash) {
2378
+ found = params[i].substring(pos + 1);
2379
+ }
2380
+ }
2381
+ }
2382
+ }
2383
+ if (found) return found;
2384
+ if (!found && lookupFromHashIndex > -1) {
2385
+ const language = hash.match(/\/([a-zA-Z-]*)/g);
2386
+ if (!Array.isArray(language)) return undefined;
2387
+ const index = typeof lookupFromHashIndex === 'number' ? lookupFromHashIndex : 0;
2388
+ return language[index]?.replace('/', '');
2389
+ }
2390
+ }
2391
+ }
2392
+ return found;
2393
+ }
2394
+ };
2395
+
2396
+ let hasLocalStorageSupport = null;
2397
+ const localStorageAvailable = () => {
2398
+ if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
2399
+ try {
2400
+ hasLocalStorageSupport = typeof window !== 'undefined' && window.localStorage !== null;
2401
+ if (!hasLocalStorageSupport) {
2402
+ return false;
2403
+ }
2404
+ const testKey = 'i18next.translate.boo';
2405
+ window.localStorage.setItem(testKey, 'foo');
2406
+ window.localStorage.removeItem(testKey);
2407
+ } catch (e) {
2408
+ hasLocalStorageSupport = false;
2409
+ }
2410
+ return hasLocalStorageSupport;
2411
+ };
2412
+ var localStorage = {
2413
+ name: 'localStorage',
2414
+ // Deconstruct the options object and extract the lookupLocalStorage property
2415
+ lookup(_ref) {
2416
+ let {
2417
+ lookupLocalStorage
2418
+ } = _ref;
2419
+ if (lookupLocalStorage && localStorageAvailable()) {
2420
+ return window.localStorage.getItem(lookupLocalStorage) || undefined; // Undefined ensures type consistency with the previous version of this function
2421
+ }
2422
+ return undefined;
2423
+ },
2424
+ // Deconstruct the options object and extract the lookupLocalStorage property
2425
+ cacheUserLanguage(lng, _ref2) {
2426
+ let {
2427
+ lookupLocalStorage
2428
+ } = _ref2;
2429
+ if (lookupLocalStorage && localStorageAvailable()) {
2430
+ window.localStorage.setItem(lookupLocalStorage, lng);
2431
+ }
2432
+ }
2433
+ };
2434
+
2435
+ let hasSessionStorageSupport = null;
2436
+ const sessionStorageAvailable = () => {
2437
+ if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
2438
+ try {
2439
+ hasSessionStorageSupport = typeof window !== 'undefined' && window.sessionStorage !== null;
2440
+ if (!hasSessionStorageSupport) {
2441
+ return false;
2442
+ }
2443
+ const testKey = 'i18next.translate.boo';
2444
+ window.sessionStorage.setItem(testKey, 'foo');
2445
+ window.sessionStorage.removeItem(testKey);
2446
+ } catch (e) {
2447
+ hasSessionStorageSupport = false;
2448
+ }
2449
+ return hasSessionStorageSupport;
2450
+ };
2451
+ var sessionStorage = {
2452
+ name: 'sessionStorage',
2453
+ lookup(_ref) {
2454
+ let {
2455
+ lookupSessionStorage
2456
+ } = _ref;
2457
+ if (lookupSessionStorage && sessionStorageAvailable()) {
2458
+ return window.sessionStorage.getItem(lookupSessionStorage) || undefined;
2459
+ }
2460
+ return undefined;
2461
+ },
2462
+ cacheUserLanguage(lng, _ref2) {
2463
+ let {
2464
+ lookupSessionStorage
2465
+ } = _ref2;
2466
+ if (lookupSessionStorage && sessionStorageAvailable()) {
2467
+ window.sessionStorage.setItem(lookupSessionStorage, lng);
2468
+ }
2469
+ }
2470
+ };
2471
+
2472
+ var navigator$1 = {
2473
+ name: 'navigator',
2474
+ lookup(options) {
2475
+ const found = [];
2476
+ if (typeof navigator !== 'undefined') {
2477
+ const {
2478
+ languages,
2479
+ userLanguage,
2480
+ language
2481
+ } = navigator;
2482
+ if (languages) {
2483
+ // chrome only; not an array, so can't use .push.apply instead of iterating
2484
+ for (let i = 0; i < languages.length; i++) {
2485
+ found.push(languages[i]);
2486
+ }
2487
+ }
2488
+ if (userLanguage) {
2489
+ found.push(userLanguage);
2490
+ }
2491
+ if (language) {
2492
+ found.push(language);
2493
+ }
2494
+ }
2495
+ return found.length > 0 ? found : undefined;
2496
+ }
2497
+ };
2498
+
2499
+ var htmlTag = {
2500
+ name: 'htmlTag',
2501
+ // Deconstruct the options object and extract the htmlTag property
2502
+ lookup(_ref) {
2503
+ let {
2504
+ htmlTag
2505
+ } = _ref;
2506
+ let found;
2507
+ const internalHtmlTag = htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
2508
+ if (internalHtmlTag && typeof internalHtmlTag.getAttribute === 'function') {
2509
+ found = internalHtmlTag.getAttribute('lang');
2510
+ }
2511
+ return found;
2512
+ }
2513
+ };
2514
+
2515
+ var path = {
2516
+ name: 'path',
2517
+ // Deconstruct the options object and extract the lookupFromPathIndex property
2518
+ lookup(_ref) {
2519
+ let {
2520
+ lookupFromPathIndex
2521
+ } = _ref;
2522
+ if (typeof window === 'undefined') return undefined;
2523
+ const language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
2524
+ if (!Array.isArray(language)) return undefined;
2525
+ const index = typeof lookupFromPathIndex === 'number' ? lookupFromPathIndex : 0;
2526
+ return language[index]?.replace('/', '');
2527
+ }
2528
+ };
2529
+
2530
+ var subdomain = {
2531
+ name: 'subdomain',
2532
+ lookup(_ref) {
2533
+ let {
2534
+ lookupFromSubdomainIndex
2535
+ } = _ref;
2536
+ // If given get the subdomain index else 1
2537
+ const internalLookupFromSubdomainIndex = typeof lookupFromSubdomainIndex === 'number' ? lookupFromSubdomainIndex + 1 : 1;
2538
+ // get all matches if window.location. is existing
2539
+ // first item of match is the match itself and the second is the first group match which should be the first subdomain match
2540
+ // is the hostname no public domain get the or option of localhost
2541
+ const language = typeof window !== 'undefined' && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
2542
+
2543
+ // if there is no match (null) return undefined
2544
+ if (!language) return undefined;
2545
+ // return the given group match
2546
+ return language[internalLookupFromSubdomainIndex];
2547
+ }
2548
+ };
2549
+
2550
+ // some environments, throws when accessing document.cookie
2551
+ let canCookies = false;
2552
+ try {
2553
+ canCookies = true;
2554
+ // eslint-disable-next-line no-empty
2555
+ } catch (e) {}
2556
+ const order = ['querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'];
2557
+ if (!canCookies) order.splice(1, 1);
2558
+ const getDefaults = () => ({
2559
+ order,
2560
+ lookupQuerystring: 'lng',
2561
+ lookupCookie: 'i18next',
2562
+ lookupLocalStorage: 'i18nextLng',
2563
+ lookupSessionStorage: 'i18nextLng',
2564
+ // cache user language
2565
+ caches: ['localStorage'],
2566
+ excludeCacheFor: ['cimode'],
2567
+ // cookieMinutes: 10,
2568
+ // cookieDomain: 'myDomain'
2569
+
2570
+ convertDetectedLanguage: l => l
2571
+ });
2572
+ class Browser {
2573
+ constructor(services) {
2574
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2575
+ this.type = 'languageDetector';
2576
+ this.detectors = {};
2577
+ this.init(services, options);
2578
+ }
2579
+ init() {
2580
+ let services = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
2581
+ languageUtils: {}
2582
+ };
2583
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2584
+ let i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2585
+ this.services = services;
2586
+ this.options = defaults(options, this.options || {}, getDefaults());
2587
+ if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
2588
+ this.options.convertDetectedLanguage = l => l.replace('-', '_');
2589
+ }
2590
+
2591
+ // backwards compatibility
2592
+ if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
2593
+ this.i18nOptions = i18nOptions;
2594
+ this.addDetector(cookie$1);
2595
+ this.addDetector(querystring);
2596
+ this.addDetector(localStorage);
2597
+ this.addDetector(sessionStorage);
2598
+ this.addDetector(navigator$1);
2599
+ this.addDetector(htmlTag);
2600
+ this.addDetector(path);
2601
+ this.addDetector(subdomain);
2602
+ this.addDetector(hash);
2603
+ }
2604
+ addDetector(detector) {
2605
+ this.detectors[detector.name] = detector;
2606
+ return this;
2607
+ }
2608
+ detect() {
2609
+ let detectionOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.order;
2610
+ let detected = [];
2611
+ detectionOrder.forEach(detectorName => {
2612
+ if (this.detectors[detectorName]) {
2613
+ let lookup = this.detectors[detectorName].lookup(this.options);
2614
+ if (lookup && typeof lookup === 'string') lookup = [lookup];
2615
+ if (lookup) detected = detected.concat(lookup);
2616
+ }
2617
+ });
2618
+ detected = detected.filter(d => d !== undefined && d !== null && !hasXSS(d)).map(d => this.options.convertDetectedLanguage(d));
2619
+ if (this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
2620
+ return detected.length > 0 ? detected[0] : null; // a little backward compatibility
2621
+ }
2622
+ cacheUserLanguage(lng) {
2623
+ let caches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.options.caches;
2624
+ if (!caches) return;
2625
+ if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
2626
+ caches.forEach(cacheName => {
2627
+ if (this.detectors[cacheName]) this.detectors[cacheName].cacheUserLanguage(lng, this.options);
2628
+ });
2629
+ }
2630
+ }
2631
+ Browser.type = 'languageDetector';
2632
+
2633
+ instance.use(Browser).init({
2634
+ fallbackLng: 'en',
2635
+ debug: false,
2636
+ resources: {
2637
+ en: {
2638
+ translation: {},
2639
+ },
2640
+ ja: {
2641
+ translation: {
2642
+ 'Pay': '支払う',
2643
+ 'Failed to load Stripe': 'ライブラリの読み込みに失敗しました。',
2644
+ 'Add your payment information': '支払情報を追加',
2645
+ 'Add card': 'カードを追加',
2646
+ 'Add a card': 'カードを追加',
2647
+ 'Add': '追加',
2648
+ 'Card information': 'カード情報',
2649
+ 'Card Number': 'カード番号',
2650
+ 'MM / YY': '月 / 年',
2651
+ 'CVC': 'セキュリティコード(CVC)',
2652
+ 'Country or region': '地域',
2653
+ 'Postal Code': '郵便番号',
2654
+ },
2655
+ },
2656
+ 'pt-BR': {
2657
+ translation: {
2658
+ 'Pay': 'Pagar',
2659
+ 'Failed to load Stripe': 'Falha ao ler Stripe',
2660
+ 'Add your payment information': 'Informações do seu Pagamento',
2661
+ 'Add card': 'Adicionar Cartão',
2662
+ 'Add a card': 'Adicionar um Cartão',
2663
+ 'Add': 'Adicionar',
2664
+ 'Card information': 'Informações do Cartão',
2665
+ 'Card Number': 'Número do Cartão',
2666
+ 'MM / YY': 'MM / AA',
2667
+ 'CVC': 'Número de Segurança(CVC)',
2668
+ 'Country or region': 'País ou região',
2669
+ 'Postal Code': 'Cep',
2670
+ },
2671
+ },
2672
+ },
2673
+ });
2674
+ const i18n = instance;
2675
+
2676
+ const appendToMap = (map, propName, value) => {
2677
+ const items = map.get(propName);
2678
+ if (!items) {
2679
+ map.set(propName, [value]);
2680
+ }
2681
+ else if (!items.includes(value)) {
2682
+ items.push(value);
2683
+ }
2684
+ };
2685
+ const debounce = (fn, ms) => {
2686
+ let timeoutId;
2687
+ return (...args) => {
2688
+ if (timeoutId) {
2689
+ clearTimeout(timeoutId);
2690
+ }
2691
+ timeoutId = setTimeout(() => {
2692
+ timeoutId = 0;
2693
+ fn(...args);
2694
+ }, ms);
2695
+ };
2696
+ };
2697
+
2698
+ /**
2699
+ * Check if a possible element isConnected.
2700
+ * The property might not be there, so we check for it.
2701
+ *
2702
+ * We want it to return true if isConnected is not a property,
2703
+ * otherwise we would remove these elements and would not update.
2704
+ *
2705
+ * Better leak in Edge than to be useless.
2706
+ */
2707
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
2708
+ const cleanupElements = debounce((map) => {
2709
+ for (let key of map.keys()) {
2710
+ map.set(key, map.get(key).filter(isConnected));
2711
+ }
2712
+ }, 2_000);
2713
+ const stencilSubscription = () => {
2714
+ if (typeof getRenderingRef !== 'function') {
2715
+ // If we are not in a stencil project, we do nothing.
2716
+ // This function is not really exported by @stencil/core.
2717
+ return {};
2718
+ }
2719
+ const elmsToUpdate = new Map();
2720
+ return {
2721
+ dispose: () => elmsToUpdate.clear(),
2722
+ get: (propName) => {
2723
+ const elm = getRenderingRef();
2724
+ if (elm) {
2725
+ appendToMap(elmsToUpdate, propName, elm);
2726
+ }
2727
+ },
2728
+ set: (propName) => {
2729
+ const elements = elmsToUpdate.get(propName);
2730
+ if (elements) {
2731
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
2732
+ }
2733
+ cleanupElements(elmsToUpdate);
2734
+ },
2735
+ reset: () => {
2736
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
2737
+ cleanupElements(elmsToUpdate);
2738
+ },
2739
+ };
2740
+ };
2741
+
2742
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
2743
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
2744
+ const unwrappedState = unwrap(defaultState);
2745
+ let states = new Map(Object.entries(unwrappedState ?? {}));
2746
+ const handlers = {
2747
+ dispose: [],
2748
+ get: [],
2749
+ set: [],
2750
+ reset: [],
2751
+ };
2752
+ // Track onChange listeners to enable removeListener functionality
2753
+ const changeListeners = new Map();
2754
+ const reset = () => {
2755
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
2756
+ // otherwise, the state won't be properly reset
2757
+ states = new Map(Object.entries(unwrap(defaultState) ?? {}));
2758
+ handlers.reset.forEach((cb) => cb());
2759
+ };
2760
+ const dispose = () => {
2761
+ // Call first dispose as resetting the state would
2762
+ // cause less updates ;)
2763
+ handlers.dispose.forEach((cb) => cb());
2764
+ reset();
2765
+ };
2766
+ const get = (propName) => {
2767
+ handlers.get.forEach((cb) => cb(propName));
2768
+ return states.get(propName);
2769
+ };
2770
+ const set = (propName, value) => {
2771
+ const oldValue = states.get(propName);
2772
+ if (shouldUpdate(value, oldValue, propName)) {
2773
+ states.set(propName, value);
2774
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
2775
+ }
2776
+ };
2777
+ const state = (typeof Proxy === 'undefined'
2778
+ ? {}
2779
+ : new Proxy(unwrappedState, {
2780
+ get(_, propName) {
2781
+ return get(propName);
2782
+ },
2783
+ ownKeys(_) {
2784
+ return Array.from(states.keys());
2785
+ },
2786
+ getOwnPropertyDescriptor() {
2787
+ return {
2788
+ enumerable: true,
2789
+ configurable: true,
2790
+ };
2791
+ },
2792
+ has(_, propName) {
2793
+ return states.has(propName);
2794
+ },
2795
+ set(_, propName, value) {
2796
+ set(propName, value);
2797
+ return true;
2798
+ },
2799
+ }));
2800
+ const on = (eventName, callback) => {
2801
+ handlers[eventName].push(callback);
2802
+ return () => {
2803
+ removeFromArray(handlers[eventName], callback);
2804
+ };
2805
+ };
2806
+ const onChange = (propName, cb) => {
2807
+ const setHandler = (key, newValue) => {
2808
+ if (key === propName) {
2809
+ cb(newValue);
2810
+ }
2811
+ };
2812
+ const resetHandler = () => cb(unwrap(defaultState)[propName]);
2813
+ // Register the handlers
2814
+ const unSet = on('set', setHandler);
2815
+ const unReset = on('reset', resetHandler);
2816
+ // Track the relationship between the user callback and internal handlers
2817
+ changeListeners.set(cb, { setHandler, resetHandler, propName });
2818
+ return () => {
2819
+ unSet();
2820
+ unReset();
2821
+ changeListeners.delete(cb);
2822
+ };
2823
+ };
2824
+ const use = (...subscriptions) => {
2825
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
2826
+ if (subscription.set) {
2827
+ unsubs.push(on('set', subscription.set));
2828
+ }
2829
+ if (subscription.get) {
2830
+ unsubs.push(on('get', subscription.get));
2831
+ }
2832
+ if (subscription.reset) {
2833
+ unsubs.push(on('reset', subscription.reset));
2834
+ }
2835
+ if (subscription.dispose) {
2836
+ unsubs.push(on('dispose', subscription.dispose));
2837
+ }
2838
+ return unsubs;
2839
+ }, []);
2840
+ return () => unsubs.forEach((unsub) => unsub());
2841
+ };
2842
+ const forceUpdate = (key) => {
2843
+ const oldValue = states.get(key);
2844
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
2845
+ };
2846
+ const removeListener = (propName, listener) => {
2847
+ const listenerInfo = changeListeners.get(listener);
2848
+ if (listenerInfo && listenerInfo.propName === propName) {
2849
+ // Remove the specific handlers that were created for this listener
2850
+ removeFromArray(handlers.set, listenerInfo.setHandler);
2851
+ removeFromArray(handlers.reset, listenerInfo.resetHandler);
2852
+ changeListeners.delete(listener);
2853
+ }
2854
+ };
2855
+ return {
2856
+ state,
2857
+ get,
2858
+ set,
2859
+ on,
2860
+ onChange,
2861
+ use,
2862
+ dispose,
2863
+ reset,
2864
+ forceUpdate,
2865
+ removeListener,
2866
+ };
2867
+ };
2868
+ const removeFromArray = (array, item) => {
2869
+ const index = array.indexOf(item);
2870
+ if (index >= 0) {
2871
+ array[index] = array[array.length - 1];
2872
+ array.length--;
2873
+ }
2874
+ };
2875
+
2876
+ const createStore = (defaultState, shouldUpdate) => {
2877
+ const map = createObservableMap(defaultState, shouldUpdate);
2878
+ map.use(stencilSubscription());
2879
+ return map;
2880
+ };
2881
+
2882
+ /**
2883
+ * Core Stripe Service
2884
+ * Manages Stripe.js initialization and Elements instance only
2885
+ * Does NOT manage specific element types (Card, Payment, etc.)
2886
+ */
2887
+ class StripeServiceClass {
2888
+ constructor() {
2889
+ this.store = createStore({
2890
+ loadStripeStatus: '',
2891
+ applicationName: 'stripe-pwa-elements',
2892
+ });
2893
+ this.changeListeners = new Map();
2894
+ }
2895
+ /**
2896
+ * Get the reactive state object
2897
+ * Components can use this directly in render() for automatic reactivity
2898
+ */
2899
+ get state() {
2900
+ return this.store.state;
2901
+ }
2902
+ /**
2903
+ * Register a callback for when a specific state property changes
2904
+ * @param key - The state property to watch
2905
+ * @param callback - Function to call when the property changes
2906
+ * @returns Unsubscribe function
2907
+ */
2908
+ onChange(key, callback) {
2909
+ const dispose = this.store.onChange(key, callback);
2910
+ // Track listeners for cleanup
2911
+ if (!this.changeListeners.has(key)) {
2912
+ this.changeListeners.set(key, []);
2913
+ }
2914
+ this.changeListeners.get(key).push(dispose);
2915
+ return dispose;
2916
+ }
2917
+ /**
2918
+ * Initialize Stripe.js client
2919
+ * @param publishableKey - Your Stripe publishable API key
2920
+ * @param options - Optional configuration
2921
+ */
2922
+ async initialize(publishableKey, options) {
2923
+ // Update configuration
2924
+ this.store.state.publishableKey = publishableKey;
2925
+ if (options === null || options === void 0 ? void 0 : options.stripeAccount) {
2926
+ this.store.state.stripeAccount = options.stripeAccount;
2927
+ }
2928
+ if (options === null || options === void 0 ? void 0 : options.applicationName) {
2929
+ this.store.state.applicationName = options.applicationName;
2930
+ }
2931
+ // If Stripe.js already loaded with same config, do nothing
2932
+ if (this.store.state.stripe && this.store.state.publishableKey === publishableKey && this.store.state.stripeAccount === (options === null || options === void 0 ? void 0 : options.stripeAccount)) {
2933
+ return;
2934
+ }
2935
+ this.store.state.loadStripeStatus = 'loading';
2936
+ try {
2937
+ const stripe = await loadStripe(publishableKey, {
2938
+ stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
2939
+ });
2940
+ // Register app info
2941
+ stripe.registerAppInfo({
2942
+ name: this.store.state.applicationName,
2943
+ });
2944
+ this.store.state.stripe = stripe;
2945
+ this.store.state.elements = stripe.elements();
2946
+ this.store.state.loadStripeStatus = 'success';
2947
+ }
2948
+ catch (e) {
2949
+ console.error('Failed to load Stripe.js:', e);
2950
+ this.store.state.loadStripeStatus = 'failure';
2951
+ }
2952
+ }
2953
+ /**
2954
+ * Get the current Stripe instance
2955
+ */
2956
+ getStripe() {
2957
+ return this.store.state.stripe;
2958
+ }
2959
+ /**
2960
+ * Get the current Elements instance
2961
+ */
2962
+ getElements() {
2963
+ return this.store.state.elements;
2964
+ }
2965
+ /**
2966
+ * Reset the service to initial state
2967
+ * Useful for testing and cleanup
2968
+ */
2969
+ reset() {
2970
+ this.store.reset();
2971
+ }
2972
+ /**
2973
+ * Dispose of all listeners and reset state
2974
+ * Should be called in test cleanup
2975
+ */
2976
+ dispose() {
2977
+ // Dispose all onChange listeners
2978
+ this.changeListeners.forEach(listeners => {
2979
+ listeners.forEach(dispose => dispose());
2980
+ });
2981
+ this.changeListeners.clear();
2982
+ // Dispose the store
2983
+ this.store.dispose();
2984
+ }
2985
+ }
2986
+ /**
2987
+ * Singleton instance of StripeService (for backward compatibility)
2988
+ * New code should use ServiceFactory for better testability
2989
+ *
2990
+ * @deprecated Use ServiceFactory.createStripeService() for better DI support
2991
+ */
2992
+ new StripeServiceClass();
2993
+
2994
+ /**
2995
+ * Card Element Manager
2996
+ * Manages Stripe Card Elements (cardNumber, cardExpiry, cardCvc)
2997
+ * with dependency injection of StripeService
2998
+ */
2999
+ class CardElementManager {
3000
+ /**
3001
+ * Constructor with dependency injection
3002
+ * @param stripeService - Injected Stripe service instance
3003
+ */
3004
+ constructor(stripeService) {
3005
+ this.stripeService = stripeService;
3006
+ this.store = createStore({
3007
+ errorMessage: '',
3008
+ errorSource: undefined,
3009
+ });
3010
+ }
3011
+ /**
3012
+ * Get current card element state (reactive)
3013
+ */
3014
+ getState() {
3015
+ return this.store.state;
3016
+ }
3017
+ /**
3018
+ * Initialize and mount card elements to DOM
3019
+ * @param containerElement - Parent element containing mount points
3020
+ * @returns Promise resolving to card element instances
3021
+ */
3022
+ async initialize(containerElement) {
3023
+ const elements = this.stripeService.getElements();
3024
+ if (!elements) {
3025
+ throw new Error('StripeService not initialized. Call StripeService.initialize() first.');
3026
+ }
3027
+ // Unmount if already initialized
3028
+ if (this.cardElements) {
3029
+ this.unmount();
3030
+ }
3031
+ // Create and mount card number element
3032
+ const cardNumber = elements.create('cardNumber', {
3033
+ placeholder: i18n.t('Card Number'),
3034
+ });
3035
+ const cardNumberElement = await this.findElement(containerElement, '#card-number');
3036
+ cardNumber.mount(cardNumberElement);
3037
+ cardNumber.on('change', this.handleCardError('cardNumber'));
3038
+ // Create and mount card expiry element
3039
+ const cardExpiry = elements.create('cardExpiry');
3040
+ const cardExpiryElement = await this.findElement(containerElement, '#card-expiry');
3041
+ cardExpiry.mount(cardExpiryElement);
3042
+ cardExpiry.on('change', this.handleCardError('cardExpiry'));
3043
+ // Create and mount card CVC element
3044
+ const cardCVC = elements.create('cardCvc');
3045
+ const cardCVCElement = await this.findElement(containerElement, '#card-cvc');
3046
+ cardCVC.mount(cardCVCElement);
3047
+ cardCVC.on('change', this.handleCardError('cardCvc'));
3048
+ this.cardElements = {
3049
+ cardNumber,
3050
+ cardExpiry,
3051
+ cardCVC,
3052
+ };
3053
+ return this.cardElements;
3054
+ }
3055
+ /**
3056
+ * Get mounted card element instances
3057
+ */
3058
+ getElements() {
3059
+ return this.cardElements;
3060
+ }
3061
+ /**
3062
+ * Set error message (triggers reactivity)
3063
+ */
3064
+ setError(message) {
3065
+ this.store.set('errorMessage', message);
3066
+ }
3067
+ /**
3068
+ * Clear error message (triggers reactivity)
3069
+ */
3070
+ clearError() {
3071
+ this.store.set('errorMessage', '');
3072
+ this.store.set('errorSource', undefined);
3073
+ }
3074
+ /**
3075
+ * Unmount all card elements
3076
+ */
3077
+ unmount() {
3078
+ var _a, _b, _c;
3079
+ if (!this.cardElements) {
3080
+ return;
3081
+ }
3082
+ (_a = this.cardElements.cardNumber) === null || _a === void 0 ? void 0 : _a.unmount();
3083
+ (_b = this.cardElements.cardExpiry) === null || _b === void 0 ? void 0 : _b.unmount();
3084
+ (_c = this.cardElements.cardCVC) === null || _c === void 0 ? void 0 : _c.unmount();
3085
+ this.cardElements = undefined;
3086
+ }
3087
+ /**
3088
+ * Handle card element errors
3089
+ * Only clears error if it's from the same element type
3090
+ * Uses store.set() to trigger reactivity
3091
+ */
3092
+ handleCardError(elementType) {
3093
+ return ({ error }) => {
3094
+ if (error) {
3095
+ this.store.set('errorMessage', error.message);
3096
+ this.store.set('errorSource', elementType);
3097
+ return;
3098
+ }
3099
+ // Only clear error if it originated from the same element
3100
+ if (this.store.state.errorSource === elementType) {
3101
+ this.store.set('errorMessage', '');
3102
+ this.store.set('errorSource', undefined);
3103
+ }
3104
+ };
3105
+ }
3106
+ /**
3107
+ * Wait for an element to appear in the DOM
3108
+ * @param containerElement - Parent element to search in
3109
+ * @param selector - CSS selector
3110
+ * @param timeout - Timeout in milliseconds (default: 5000ms)
3111
+ * @returns Promise that resolves to the found element or rejects on timeout
3112
+ */
3113
+ findElement(containerElement, selector, timeout = 5000) {
3114
+ return new Promise((resolve, reject) => {
3115
+ const elem = containerElement.querySelector(selector);
3116
+ if (elem) {
3117
+ return resolve(elem);
3118
+ }
3119
+ const timeoutId = setTimeout(() => {
3120
+ observer.disconnect();
3121
+ reject(new Error(`Element "${selector}" not found within ${timeout}ms`));
3122
+ }, timeout);
3123
+ const observer = new MutationObserver(() => {
3124
+ const elem = containerElement.querySelector(selector);
3125
+ if (elem) {
3126
+ clearTimeout(timeoutId);
3127
+ observer.disconnect();
3128
+ resolve(elem);
3129
+ }
3130
+ });
3131
+ observer.observe(containerElement, {
3132
+ childList: true,
3133
+ subtree: true,
3134
+ });
3135
+ });
3136
+ }
3137
+ }
3138
+
3139
+ /**
3140
+ * Service Factory
3141
+ * Creates service instances with proper dependency injection
3142
+ * Can be mocked in tests for better testability
3143
+ */
3144
+ class ServiceFactory {
3145
+ /**
3146
+ * Create a new StripeService instance
3147
+ */
3148
+ createStripeService() {
3149
+ return new StripeServiceClass();
3150
+ }
3151
+ /**
3152
+ * Create a new CardElementManager instance
3153
+ * @param stripeService - Injected StripeService dependency
3154
+ */
3155
+ createCardElementManager(stripeService) {
3156
+ return new CardElementManager(stripeService);
3157
+ }
3158
+ }
3159
+ /**
3160
+ * Default factory instance
3161
+ * Can be replaced with a mock in tests
3162
+ */
3163
+ const serviceFactory = new ServiceFactory();
3164
+
3165
+ class StripeAPIError extends Error {
3166
+ constructor(error) {
3167
+ super(error.message);
3168
+ this.code = error.code;
3169
+ this.docUrl = error.doc_url;
3170
+ this.message = error.message;
3171
+ this.param = error.param;
3172
+ this.requestLogUrl = error.request_log_url;
3173
+ this.type = error.type;
3174
+ }
3175
+ }
3176
+
3177
+ const stripeCardElementCss = ":root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap .StripeElement{padding:8px 16px;min-height:64px;border-bottom:1px solid var(--color-input-border);border-radius:4px;display:flex;justify-content:center;align-items:center}.stripe-payment-sheet-wrap .StripeElement>.__PrivateStripeElement{width:100%}.stripe-payment-sheet-wrap .stripe-input-box{background-color:#fff;border-radius:2px;filter:drop-shadow(0 0 1px var(--color-input-border))}.stripe-payment-sheet-wrap .stripe-input-column .StripeElement{border-right:1px solid var(--color-input-border)}.stripe-payment-sheet-wrap .stripe-input-column .StripeElement:last-child{border-right:none}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info label{color:var(--color-label)}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:8px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}";
3178
+
3179
+ const StripeCardElement = /*@__PURE__*/ proxyCustomElement(class StripeCardElement extends HTMLElement {
3180
+ /**
3181
+ * Get Stripe.js, and initialize elements
3182
+ * @param publishableKey
3183
+ * @param options
3184
+ * @example
3185
+ * ```
3186
+ * const stripeElement = document.createElement('stripe-card-element');
3187
+ * customElements
3188
+ * .whenDefined('stripe-card-element')
3189
+ * .then(() => {
3190
+ * tripeElement.initStripe('pk_test_XXXXXXXXX')
3191
+ * })
3192
+ * ```
3193
+ */
3194
+ async initStripe(publishableKey, options) {
3195
+ await this.stripeService.initialize(publishableKey, {
3196
+ stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
3197
+ applicationName: this.applicationName,
3198
+ });
3199
+ // If already successfully loaded, initialize elements immediately
3200
+ if (this.stripeService.state.loadStripeStatus === 'success') {
3201
+ await this.initElement();
3202
+ this.stripeLoadedEventHandler();
3203
+ }
3204
+ else {
3205
+ // Otherwise, wait for successful load
3206
+ const unsubscribe = this.stripeService.onChange('loadStripeStatus', async (newState) => {
3207
+ if (newState !== 'success') {
3208
+ return;
3209
+ }
3210
+ await this.initElement();
3211
+ this.stripeLoadedEventHandler();
3212
+ unsubscribe(); // Clean up listener after first success
3213
+ });
3214
+ }
3215
+ }
3216
+ /**
3217
+ * Update the form submit progress
3218
+ * @param progress
3219
+ * @returns
3220
+ * @example
3221
+ * ```
3222
+ * const stripeElement = document.createElement('stripe-card-element');
3223
+ * customElements
3224
+ * .whenDefined('stripe-card-element')
3225
+ * .then(() => {
3226
+ * // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.
3227
+ * stripeElement.setAttribute('should-use-default-form-submit-action', false)
3228
+ * stripeElement.addEventListener('formSubmit', async props => {
3229
+ * const {
3230
+ * detail: { stripe, cardNumber, event },
3231
+ * } = props;
3232
+ * const result = await stripe.createPaymentMethod({
3233
+ * type: 'card',
3234
+ * card: cardNumber,
3235
+ * });
3236
+ * console.log(result);
3237
+ * stripeElement.updateProgress('success')
3238
+ * });
3239
+ * })
3240
+ */
3241
+ async updateProgress(progress) {
3242
+ this.progress = progress;
3243
+ return this;
3244
+ }
3245
+ /**
3246
+ * Set error message
3247
+ * @param errorMessage string
3248
+ * @returns
3249
+ * @example
3250
+ * ```
3251
+ * const stripeElement = document.createElement('stripe-card-element');
3252
+ * customElements
3253
+ * .whenDefined('stripe-card-element')
3254
+ * .then(() => {
3255
+ * // You must set the attributes to stop running default form submit action when you want to listen the 'formSubmit' event.
3256
+ * stripeElement.setAttribute('should-use-default-form-submit-action', false)
3257
+ * stripeElement.addEventListener('formSubmit', async props => {
3258
+ * try {
3259
+ * throw new Error('debug')
3260
+ * } catch (e) {
3261
+ * stripeElement.setErrorMessage(`Error: ${e.message}`)
3262
+ * stripeElement.updateProgress('failure')
3263
+ * }
3264
+ * });
3265
+ * })
3266
+ */
3267
+ async setErrorMessage(errorMessage) {
3268
+ this.cardElementManager.setError(errorMessage);
3269
+ return this;
3270
+ }
3271
+ updatePublishableKey(publishableKey) {
3272
+ const options = {};
3273
+ options.stripeAccount = this.stripeService.state.stripeAccount;
3274
+ const hasOptionValue = Object.values(options).filter(Boolean).length > 0;
3275
+ this.initStripe(publishableKey, hasOptionValue ? options : undefined);
3276
+ }
3277
+ updateStripeAccountId(stripeAccount) {
3278
+ this.initStripe(this.stripeService.state.publishableKey, {
3279
+ stripeAccount: stripeAccount,
3280
+ });
3281
+ }
3282
+ /**
3283
+ * @param option
3284
+ * @private
3285
+ */
3286
+ async setPaymentRequestOption(option) {
3287
+ this.paymentRequestOption = option;
3288
+ this.createPaymentRequestButton();
3289
+ return this;
3290
+ }
3291
+ stripeLoadedEventHandler() {
3292
+ const event = {
3293
+ stripe: this.stripeService.getStripe(),
3294
+ };
3295
+ if (this.stripeDidLoaded) {
3296
+ this.stripeDidLoaded(event);
3297
+ }
3298
+ this.stripeLoaded.emit(event);
3299
+ }
3300
+ async formSubmitEventHandler() {
3301
+ const cardElements = this.cardElementManager.getElements();
3302
+ const stripe = this.stripeService.getStripe();
3303
+ if (!cardElements) {
3304
+ console.error('Card elements not initialized');
3305
+ return;
3306
+ }
3307
+ this.formSubmit.emit({
3308
+ cardCVCElement: cardElements.cardCVC,
3309
+ cardExpiryElement: cardElements.cardExpiry,
3310
+ cardNumberElement: cardElements.cardNumber,
3311
+ stripe,
3312
+ });
3313
+ }
3314
+ async defaultFormSubmitResultHandler(result) {
3315
+ this.defaultFormSubmitResult.emit(result);
3316
+ }
3317
+ componentWillUpdate() {
3318
+ if (!this.stripeService.state.publishableKey) {
3319
+ return;
3320
+ }
3321
+ if (['success', 'loading'].includes(this.stripeService.state.loadStripeStatus)) {
3322
+ return;
3323
+ }
3324
+ this.initStripe(this.stripeService.state.publishableKey, {
3325
+ stripeAccount: this.stripeService.state.stripeAccount,
3326
+ });
3327
+ this.createPaymentRequestButton();
3328
+ }
3329
+ /**
3330
+ * Default form submit action (just call a confirmCardPayment).
3331
+ * If you don't want use it, please set `should-use-default-form-submit-action="false"`
3332
+ * @param event
3333
+ * @param param1
3334
+ */
3335
+ async defaultFormSubmitAction(event, { stripe, cardNumberElement, intentClientSecret }) {
3336
+ event.preventDefault();
3337
+ try {
3338
+ const { intentType } = this;
3339
+ const result = await (() => {
3340
+ if (intentType === 'payment') {
3341
+ return stripe.confirmCardPayment(intentClientSecret, {
3342
+ payment_method: {
3343
+ card: cardNumberElement,
3344
+ },
3345
+ });
3346
+ }
3347
+ return stripe.confirmCardSetup(intentClientSecret, {
3348
+ payment_method: {
3349
+ card: cardNumberElement,
3350
+ },
3351
+ });
3352
+ })();
3353
+ if (result.error) {
3354
+ throw new StripeAPIError(result.error);
3355
+ }
3356
+ this.defaultFormSubmitResultHandler(result);
3357
+ }
3358
+ catch (e) {
3359
+ console.error(e);
3360
+ this.defaultFormSubmitResultHandler(e);
3361
+ throw e;
3362
+ }
3363
+ }
3364
+ constructor(registerHost) {
3365
+ super();
3366
+ if (registerHost !== false) {
3367
+ this.__registerHost();
3368
+ }
3369
+ this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
3370
+ this.formSubmit = createEvent(this, "formSubmit", 7);
3371
+ this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
3372
+ /**
3373
+ * Default submit handle type.
3374
+ * If you want to use `setupIntent`, should update this attribute.
3375
+ */
3376
+ this.intentType = 'payment';
3377
+ /**
3378
+ * If true, show zip code field
3379
+ */
3380
+ this.zip = true;
3381
+ /**
3382
+ * Payment sheet title
3383
+ * By default we recommended to use these string
3384
+ * - 'Add your payment information' -> PaymentSheet / PaymentFlow(Android)
3385
+ * - 'Add a card' -> PaymentFlow(iOS)
3386
+ * These strings will translated automatically by this library.
3387
+ */
3388
+ this.sheetTitle = 'Add your payment information';
3389
+ /**
3390
+ * Submit button label
3391
+ * By default we recommended to use these string
3392
+ * - 'Pay' -> PaymentSheet
3393
+ * - 'Add' -> PaymentFlow(Android)
3394
+ * - 'Add card' -> PaymentFlow(iOS)
3395
+ * - 'Add a card' -> PaymentFlow(iOS)
3396
+ * These strings will translated automatically by this library.
3397
+ *
3398
+ */
3399
+ this.buttonLabel = 'Pay';
3400
+ /**
3401
+ * The progress status of the checkout process
3402
+ */
3403
+ this.progress = '';
3404
+ /**
3405
+ * zip code
3406
+ */
3407
+ this.zipCode = '';
3408
+ /**
3409
+ * Overwrite the application name that registered
3410
+ * For wrapper library (like Capacitor)
3411
+ */
3412
+ this.applicationName = 'stripe-pwa-elements';
3413
+ /**
3414
+ * Show the form label
3415
+ */
3416
+ this.showLabel = false;
3417
+ /**
3418
+ * The component will provide a function to call the `stripe.confirmCardPayment`API.
3419
+ * If you want to customize the behavior, should set false.
3420
+ * And listen the 'formSubmit' event on the element
3421
+ */
3422
+ this.shouldUseDefaultFormSubmitAction = true;
3423
+ // Dependency Injection via factory
3424
+ this.stripeService = serviceFactory.createStripeService();
3425
+ this.cardElementManager = serviceFactory.createCardElementManager(this.stripeService);
3426
+ if (this.publishableKey) {
3427
+ this.initStripe(this.publishableKey, {
3428
+ stripeAccount: this.stripeAccount,
3429
+ });
3430
+ }
3431
+ }
3432
+ /**
3433
+ * Initialize Component using Stripe Element
3434
+ */
3435
+ async initElement() {
3436
+ // Initialize card elements
3437
+ await this.cardElementManager.initialize(this.el);
3438
+ // Add form submit listener scoped to this component instance
3439
+ const formElement = this.el.querySelector('#stripe-card-element');
3440
+ if (!formElement) {
3441
+ console.error('Form element #stripe-card-element not found');
3442
+ return;
3443
+ }
3444
+ formElement.addEventListener('submit', async (e) => {
3445
+ const cardElements = this.cardElementManager.getElements();
3446
+ const stripe = this.stripeService.getStripe();
3447
+ const { intentClientSecret } = this;
3448
+ if (!cardElements || !stripe) {
3449
+ console.error('Stripe not properly initialized');
3450
+ return;
3451
+ }
3452
+ const submitEventProps = {
3453
+ cardCVCElement: cardElements.cardCVC,
3454
+ cardExpiryElement: cardElements.cardExpiry,
3455
+ cardNumberElement: cardElements.cardNumber,
3456
+ stripe,
3457
+ intentClientSecret,
3458
+ zipCode: this.zipCode,
3459
+ };
3460
+ this.progress = 'loading';
3461
+ try {
3462
+ if (this.handleSubmit) {
3463
+ await this.handleSubmit(e, submitEventProps);
3464
+ }
3465
+ else if (this.shouldUseDefaultFormSubmitAction === true && intentClientSecret) {
3466
+ await this.defaultFormSubmitAction(e, submitEventProps);
3467
+ }
3468
+ else {
3469
+ e.preventDefault();
3470
+ }
3471
+ await this.formSubmitEventHandler();
3472
+ if (this.handleSubmit || this.shouldUseDefaultFormSubmitAction === true) {
3473
+ this.progress = 'success';
3474
+ }
3475
+ }
3476
+ catch (e) {
3477
+ this.cardElementManager.setError(e.message);
3478
+ this.progress = 'failure';
3479
+ }
3480
+ });
3481
+ }
3482
+ componentDidLoad() {
3483
+ this.el.classList.add(checkPlatform());
3484
+ }
3485
+ disconnectedCallback() {
3486
+ this.cardElementManager.unmount();
3487
+ }
3488
+ /**
3489
+ * Create payment request button
3490
+ * It's just proxy of stripe-payment-request-button
3491
+ */
3492
+ createPaymentRequestButton() {
3493
+ const { showPaymentRequestButton, paymentRequestOption } = this;
3494
+ if (!showPaymentRequestButton || !paymentRequestOption) {
3495
+ return null;
3496
+ }
3497
+ if (!document) {
3498
+ return null;
3499
+ }
3500
+ const targetElement = this.el.querySelector('#stripe-payment-request-button');
3501
+ if (!targetElement) {
3502
+ console.error('Target element #stripe-payment-request-button not found');
3503
+ return null;
3504
+ }
3505
+ const stripePaymentRequestElement = document.createElement('stripe-payment-request-button');
3506
+ targetElement.appendChild(stripePaymentRequestElement);
3507
+ const { paymentRequestPaymentMethodHandler, paymentRequestShippingOptionChangeHandler, paymentRequestShippingAddressChangeHandler } = paymentRequestOption;
3508
+ customElements.whenDefined('stripe-payment-request-button').then(() => {
3509
+ stripePaymentRequestElement.setPaymentRequestOption(paymentRequestOption);
3510
+ if (paymentRequestPaymentMethodHandler) {
3511
+ stripePaymentRequestElement.setPaymentMethodEventHandler(paymentRequestPaymentMethodHandler);
3512
+ }
3513
+ if (paymentRequestShippingOptionChangeHandler) {
3514
+ stripePaymentRequestElement.setPaymentRequestShippingOptionEventHandler(paymentRequestShippingOptionChangeHandler);
3515
+ }
3516
+ if (paymentRequestShippingAddressChangeHandler) {
3517
+ stripePaymentRequestElement.setPaymentRequestShippingAddressEventHandler(paymentRequestShippingAddressChangeHandler);
3518
+ }
3519
+ return stripePaymentRequestElement.initStripe(this.publishableKey);
3520
+ });
3521
+ }
3522
+ render() {
3523
+ const { loadStripeStatus } = this.stripeService.state;
3524
+ const { errorMessage } = this.cardElementManager.getState();
3525
+ if (loadStripeStatus === 'failure') {
3526
+ return h("p", null, i18n.t('Failed to load Stripe'));
3527
+ }
3528
+ const disabled = this.progress === 'loading';
3529
+ return (h("div", { class: "stripe-payment-sheet-wrap" }, h("form", { id: "stripe-card-element" }, h("div", { class: "stripe-heading" }, i18n.t(this.sheetTitle)), h("div", { id: "stripe-payment-request-button" }), h("div", null, h("div", { class: "stripe-section-title" }, i18n.t('Card information'))), h("div", { class: "payment-info card visible" }, h("fieldset", { class: "stripe-input-box" }, h("div", null, h("label", null, this.showLabel ? h("lenged", null, i18n.t('Card Number')) : null, h("div", { id: "card-number" }))), h("div", { class: "stripe-input-column", style: { display: 'flex' } }, h("label", { style: { width: '50%' } }, this.showLabel ? h("lenged", null, i18n.t('MM / YY')) : null, h("div", { id: "card-expiry" })), h("label", { style: { width: '50%' } }, this.showLabel ? h("lenged", null, i18n.t('CVC')) : null, h("div", { id: "card-cvc" }))))), h("div", { id: "card-errors", class: "stripe-element-errors" }, errorMessage), this.zip ? (h("div", { style: { marginTop: '1.5rem' } }, h("div", { class: "stripe-section-title" }, i18n.t('Country or region')))) : null, this.zip ? (h("div", { class: "payment-info card visible" }, h("fieldset", { class: "stripe-input-box" }, h("div", null, h("label", null, this.showLabel ? h("lenged", null, i18n.t('Postal Code')) : null, h("input", { id: "zip", name: "zip", type: "text", inputmode: "numeric", class: "stripe-input-box StripeElement", style: { width: '100%' }, placeholder: i18n.t('Postal Code'), value: this.zipCode, onInput: e => {
3530
+ this.zipCode = e.target.value;
3531
+ } })))))) : null, h("div", { style: { marginTop: '32px' } }, h("button", { type: "submit", disabled: disabled }, this.progress === 'loading' ? i18n.t('Loading') : i18n.t(this.buttonLabel))))));
3532
+ }
3533
+ get el() { return this; }
3534
+ static get watchers() { return {
3535
+ "publishableKey": ["updatePublishableKey"],
3536
+ "stripeAccount": ["updateStripeAccountId"]
3537
+ }; }
3538
+ static get style() { return stripeCardElementCss; }
3539
+ }, [256, "stripe-card-element", {
3540
+ "intentType": [1, "intent-type"],
3541
+ "zip": [4],
3542
+ "sheetTitle": [1, "sheet-title"],
3543
+ "buttonLabel": [1, "button-label"],
3544
+ "publishableKey": [1, "publishable-key"],
3545
+ "stripeAccount": [1, "stripe-account"],
3546
+ "applicationName": [1, "application-name"],
3547
+ "showLabel": [4, "show-label"],
3548
+ "intentClientSecret": [1, "intent-client-secret"],
3549
+ "shouldUseDefaultFormSubmitAction": [4, "should-use-default-form-submit-action"],
3550
+ "showPaymentRequestButton": [4, "show-payment-request-button"],
3551
+ "handleSubmit": [1040],
3552
+ "stripeDidLoaded": [1040],
3553
+ "progress": [32],
3554
+ "zipCode": [32],
3555
+ "paymentRequestOption": [32],
3556
+ "initStripe": [64],
3557
+ "updateProgress": [64],
3558
+ "setErrorMessage": [64],
3559
+ "setPaymentRequestOption": [64]
3560
+ }, undefined, {
3561
+ "publishableKey": ["updatePublishableKey"],
3562
+ "stripeAccount": ["updateStripeAccountId"]
3563
+ }]);
3564
+ function defineCustomElement() {
3565
+ if (typeof customElements === "undefined") {
3566
+ return;
3567
+ }
3568
+ const components = ["stripe-card-element", "stripe-payment-request-button"];
3569
+ components.forEach(tagName => { switch (tagName) {
3570
+ case "stripe-card-element":
3571
+ if (!customElements.get(tagName)) {
3572
+ customElements.define(tagName, StripeCardElement);
3573
+ }
3574
+ break;
3575
+ case "stripe-payment-request-button":
3576
+ if (!customElements.get(tagName)) {
3577
+ defineCustomElement$1();
3578
+ }
3579
+ break;
3580
+ } });
3581
+ }
3582
+
3583
+ export { StripeCardElement as S, defineCustomElement as d };
3584
+ //# sourceMappingURL=stripe-card-element2.js.map
3585
+
3586
+ //# sourceMappingURL=stripe-card-element2.js.map