@verbb/formie-browser 1.0.1 → 1.0.2

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 (346) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunks/address-finder-CQW81kY0.js +37 -0
  3. package/dist/chunks/bpoint-D8OjLmsn.js +26 -0
  4. package/dist/chunks/calculations-BqZsENCq.js +147 -0
  5. package/dist/chunks/captcha-eu-DIa6aUWz.js +34 -0
  6. package/dist/chunks/checkbox-radio-BI-UjgMF.js +136 -0
  7. package/dist/chunks/conditions-BVl6jTYo.js +433 -0
  8. package/dist/chunks/date-picker-69TgvErA.js +4994 -0
  9. package/dist/chunks/eway-1GPxH6DU.js +74 -0
  10. package/dist/chunks/file-upload-BDZZftgL.js +281 -0
  11. package/dist/chunks/friendly-captcha-v1-DA2QPKA3.js +33 -0
  12. package/dist/chunks/friendly-captcha-v2-BorOWiz_.js +38 -0
  13. package/dist/chunks/go-cardless-DwBgERcA.js +24 -0
  14. package/dist/chunks/google-address-BcTBncyS.js +162 -0
  15. package/dist/chunks/hcaptcha-BchdVCqq.js +56 -0
  16. package/dist/chunks/hidden-D8RqSPt7.js +31 -0
  17. package/dist/chunks/index-BEsfee-D.js +1839 -0
  18. package/dist/chunks/index-BP7Unm5Y.js +863 -0
  19. package/dist/chunks/index-C1ZOKiAi.js +4229 -0
  20. package/dist/chunks/loqate-nXuTX7In.js +55 -0
  21. package/dist/chunks/mollie-qdCynQCd.js +24 -0
  22. package/dist/chunks/moneris-BNEA-laO.js +101 -0
  23. package/dist/chunks/opayo-BJtXOkuK.js +122 -0
  24. package/dist/chunks/paddle-D72Pa8kr.js +60 -0
  25. package/dist/chunks/paypal-Cqt2bned.js +100 -0
  26. package/dist/chunks/payway-BjCqsc0H.js +56 -0
  27. package/dist/chunks/phone-country-K9pYAlzM.js +3765 -0
  28. package/dist/chunks/place-kit-Dg6f_UoM.js +42 -0
  29. package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +1299 -0
  30. package/dist/chunks/recaptcha-enterprise--VYAeeqz.js +71 -0
  31. package/dist/chunks/recaptcha-shared-PSIEEEe1.js +15 -0
  32. package/dist/chunks/recaptcha-v2-checkbox-atBNe5ml.js +41 -0
  33. package/dist/chunks/recaptcha-v2-invisible-DnBufNPT.js +59 -0
  34. package/dist/chunks/recaptcha-v3-CF6O8rDj.js +28 -0
  35. package/dist/chunks/repeater-CB7Yojvx.js +124 -0
  36. package/dist/chunks/rich-text-nAV_SQZo.js +304 -0
  37. package/dist/chunks/scripts-BkAAux0i.js +36 -0
  38. package/dist/chunks/sdk-3SicTWby.js +1559 -0
  39. package/dist/chunks/shared-DGqeMvcJ.js +80 -0
  40. package/dist/chunks/signature-BT6CsQ6n.js +550 -0
  41. package/dist/chunks/snaptcha-C7qQo02f.js +8 -0
  42. package/dist/chunks/square-C5AH3trb.js +46 -0
  43. package/dist/chunks/stripe-EJK0RyUv.js +202 -0
  44. package/dist/chunks/styles-C3aqgtek.js +21 -0
  45. package/dist/chunks/summary-DC_ipXCU.js +126 -0
  46. package/dist/chunks/table-BEAI99qo.js +95 -0
  47. package/dist/chunks/text-limit-Blgq5G-G.js +135 -0
  48. package/dist/chunks/turnstile-_uCRwnU-.js +59 -0
  49. package/dist/chunks/utils-BntI3W4S.js +6149 -0
  50. package/dist/index.d.ts +30 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +39 -3205
  53. package/dist/js/compatibility/dom-adapter.d.ts +12 -0
  54. package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
  55. package/dist/js/compatibility/event-map.d.ts +25 -0
  56. package/dist/js/compatibility/event-map.d.ts.map +1 -0
  57. package/dist/js/compatibility/validator-adapter.d.ts +17 -0
  58. package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
  59. package/dist/js/contracts/client.d.ts +40 -0
  60. package/dist/js/contracts/client.d.ts.map +1 -0
  61. package/dist/js/contracts/common.d.ts +5 -0
  62. package/dist/js/contracts/common.d.ts.map +1 -0
  63. package/dist/js/contracts/modules.d.ts +47 -0
  64. package/dist/js/contracts/modules.d.ts.map +1 -0
  65. package/dist/js/contracts/schema.d.ts +79 -0
  66. package/dist/js/contracts/schema.d.ts.map +1 -0
  67. package/dist/js/contracts/theme.d.ts +2 -0
  68. package/dist/js/contracts/theme.d.ts.map +1 -0
  69. package/dist/js/core/create-formie-client.d.ts +3 -0
  70. package/dist/js/core/create-formie-client.d.ts.map +1 -0
  71. package/dist/js/core/dom-events.d.ts +2 -0
  72. package/dist/js/core/dom-events.d.ts.map +1 -0
  73. package/dist/js/core/formie.d.ts +27 -0
  74. package/dist/js/core/formie.d.ts.map +1 -0
  75. package/dist/js/core/hydrate-modules.d.ts +22 -0
  76. package/dist/js/core/hydrate-modules.d.ts.map +1 -0
  77. package/dist/js/core/page-client-event.d.ts +9 -0
  78. package/dist/js/core/page-client-event.d.ts.map +1 -0
  79. package/dist/js/core/page-tab-errors.d.ts +2 -0
  80. package/dist/js/core/page-tab-errors.d.ts.map +1 -0
  81. package/dist/js/core/submit-flow.d.ts +21 -0
  82. package/dist/js/core/submit-flow.d.ts.map +1 -0
  83. package/dist/js/core/submit-result-state.d.ts +8 -0
  84. package/dist/js/core/submit-result-state.d.ts.map +1 -0
  85. package/dist/js/core/submit-result-ui.d.ts +10 -0
  86. package/dist/js/core/submit-result-ui.d.ts.map +1 -0
  87. package/dist/js/events/event-bus.d.ts +21 -0
  88. package/dist/js/events/event-bus.d.ts.map +1 -0
  89. package/dist/js/modules/address/address-finder.d.ts +2 -0
  90. package/dist/js/modules/address/address-finder.d.ts.map +1 -0
  91. package/dist/js/modules/address/api.d.ts +8 -0
  92. package/dist/js/modules/address/api.d.ts.map +1 -0
  93. package/dist/js/modules/address/constants.d.ts +15 -0
  94. package/dist/js/modules/address/constants.d.ts.map +1 -0
  95. package/dist/js/modules/address/factories.d.ts +35 -0
  96. package/dist/js/modules/address/factories.d.ts.map +1 -0
  97. package/dist/js/modules/address/google-address.d.ts +2 -0
  98. package/dist/js/modules/address/google-address.d.ts.map +1 -0
  99. package/dist/js/modules/address/host.d.ts +30 -0
  100. package/dist/js/modules/address/host.d.ts.map +1 -0
  101. package/dist/js/modules/address/index.d.ts +3 -0
  102. package/dist/js/modules/address/index.d.ts.map +1 -0
  103. package/dist/js/modules/address/loqate.d.ts +2 -0
  104. package/dist/js/modules/address/loqate.d.ts.map +1 -0
  105. package/dist/js/modules/address/place-kit.d.ts +2 -0
  106. package/dist/js/modules/address/place-kit.d.ts.map +1 -0
  107. package/dist/js/modules/captchas/api.d.ts +9 -0
  108. package/dist/js/modules/captchas/api.d.ts.map +1 -0
  109. package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
  110. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
  111. package/dist/js/modules/captchas/constants.d.ts +5 -0
  112. package/dist/js/modules/captchas/constants.d.ts.map +1 -0
  113. package/dist/js/modules/captchas/factories.d.ts +63 -0
  114. package/dist/js/modules/captchas/factories.d.ts.map +1 -0
  115. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
  116. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
  117. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
  118. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
  119. package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
  120. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
  121. package/dist/js/modules/captchas/host.d.ts +78 -0
  122. package/dist/js/modules/captchas/host.d.ts.map +1 -0
  123. package/dist/js/modules/captchas/index.d.ts +3 -0
  124. package/dist/js/modules/captchas/index.d.ts.map +1 -0
  125. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
  126. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
  127. package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
  128. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
  129. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
  130. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
  131. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
  132. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
  133. package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
  134. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
  135. package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
  136. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
  137. package/dist/js/modules/captchas/turnstile.d.ts +2 -0
  138. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
  139. package/dist/js/modules/captchas/utils.d.ts +13 -0
  140. package/dist/js/modules/captchas/utils.d.ts.map +1 -0
  141. package/dist/js/modules/fields/calculations.d.ts +3 -0
  142. package/dist/js/modules/fields/calculations.d.ts.map +1 -0
  143. package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
  144. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
  145. package/dist/js/modules/fields/conditions/config.d.ts +5 -0
  146. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
  147. package/dist/js/modules/fields/conditions/effects.d.ts +2 -0
  148. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
  149. package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
  150. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
  151. package/dist/js/modules/fields/conditions/references.d.ts +5 -0
  152. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
  153. package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
  154. package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
  155. package/dist/js/modules/fields/conditions/types.d.ts +30 -0
  156. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
  157. package/dist/js/modules/fields/conditions/values.d.ts +5 -0
  158. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
  159. package/dist/js/modules/fields/conditions.d.ts +3 -0
  160. package/dist/js/modules/fields/conditions.d.ts.map +1 -0
  161. package/dist/js/modules/fields/date-picker.d.ts +3 -0
  162. package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
  163. package/dist/js/modules/fields/file-upload.d.ts +3 -0
  164. package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
  165. package/dist/js/modules/fields/hidden.d.ts +3 -0
  166. package/dist/js/modules/fields/hidden.d.ts.map +1 -0
  167. package/dist/js/modules/fields/index.d.ts +3 -0
  168. package/dist/js/modules/fields/index.d.ts.map +1 -0
  169. package/dist/js/modules/fields/phone-country.d.ts +3 -0
  170. package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
  171. package/dist/js/modules/fields/repeater.d.ts +3 -0
  172. package/dist/js/modules/fields/repeater.d.ts.map +1 -0
  173. package/dist/js/modules/fields/rich-text.d.ts +3 -0
  174. package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
  175. package/dist/js/modules/fields/shared.d.ts +20 -0
  176. package/dist/js/modules/fields/shared.d.ts.map +1 -0
  177. package/dist/js/modules/fields/signature.d.ts +3 -0
  178. package/dist/js/modules/fields/signature.d.ts.map +1 -0
  179. package/dist/js/modules/fields/summary.d.ts +3 -0
  180. package/dist/js/modules/fields/summary.d.ts.map +1 -0
  181. package/dist/js/modules/fields/table.d.ts +3 -0
  182. package/dist/js/modules/fields/table.d.ts.map +1 -0
  183. package/dist/js/modules/fields/text-limit.d.ts +3 -0
  184. package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
  185. package/dist/js/modules/loader.d.ts +11 -0
  186. package/dist/js/modules/loader.d.ts.map +1 -0
  187. package/dist/js/modules/payments/api.d.ts +8 -0
  188. package/dist/js/modules/payments/api.d.ts.map +1 -0
  189. package/dist/js/modules/payments/bpoint.d.ts +2 -0
  190. package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
  191. package/dist/js/modules/payments/constants.d.ts +5 -0
  192. package/dist/js/modules/payments/constants.d.ts.map +1 -0
  193. package/dist/js/modules/payments/eway.d.ts +9 -0
  194. package/dist/js/modules/payments/eway.d.ts.map +1 -0
  195. package/dist/js/modules/payments/factories.d.ts +54 -0
  196. package/dist/js/modules/payments/factories.d.ts.map +1 -0
  197. package/dist/js/modules/payments/go-cardless.d.ts +2 -0
  198. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
  199. package/dist/js/modules/payments/host.d.ts +70 -0
  200. package/dist/js/modules/payments/host.d.ts.map +1 -0
  201. package/dist/js/modules/payments/index.d.ts +3 -0
  202. package/dist/js/modules/payments/index.d.ts.map +1 -0
  203. package/dist/js/modules/payments/mollie.d.ts +2 -0
  204. package/dist/js/modules/payments/mollie.d.ts.map +1 -0
  205. package/dist/js/modules/payments/moneris.d.ts +2 -0
  206. package/dist/js/modules/payments/moneris.d.ts.map +1 -0
  207. package/dist/js/modules/payments/opayo.d.ts +25 -0
  208. package/dist/js/modules/payments/opayo.d.ts.map +1 -0
  209. package/dist/js/modules/payments/paddle.d.ts +2 -0
  210. package/dist/js/modules/payments/paddle.d.ts.map +1 -0
  211. package/dist/js/modules/payments/paypal.d.ts +2 -0
  212. package/dist/js/modules/payments/paypal.d.ts.map +1 -0
  213. package/dist/js/modules/payments/payway.d.ts +2 -0
  214. package/dist/js/modules/payments/payway.d.ts.map +1 -0
  215. package/dist/js/modules/payments/square.d.ts +2 -0
  216. package/dist/js/modules/payments/square.d.ts.map +1 -0
  217. package/dist/js/modules/payments/stripe.d.ts +2 -0
  218. package/dist/js/modules/payments/stripe.d.ts.map +1 -0
  219. package/dist/js/modules/payments/utils.d.ts +17 -0
  220. package/dist/js/modules/payments/utils.d.ts.map +1 -0
  221. package/dist/js/modules/registry.d.ts +9 -0
  222. package/dist/js/modules/registry.d.ts.map +1 -0
  223. package/dist/js/modules/styles.d.ts +2 -0
  224. package/dist/js/modules/styles.d.ts.map +1 -0
  225. package/dist/js/submit/pipeline.d.ts +18 -0
  226. package/dist/js/submit/pipeline.d.ts.map +1 -0
  227. package/dist/js/theme/theme-classes.d.ts +10 -0
  228. package/dist/js/theme/theme-classes.d.ts.map +1 -0
  229. package/dist/js/transport/forms-api.d.ts +11 -0
  230. package/dist/js/transport/forms-api.d.ts.map +1 -0
  231. package/dist/js/utils/async.d.ts +8 -0
  232. package/dist/js/utils/async.d.ts.map +1 -0
  233. package/dist/js/utils/debug.d.ts +10 -0
  234. package/dist/js/utils/debug.d.ts.map +1 -0
  235. package/dist/js/utils/event-names.d.ts +13 -0
  236. package/dist/js/utils/event-names.d.ts.map +1 -0
  237. package/dist/js/utils/field-references.d.ts +6 -0
  238. package/dist/js/utils/field-references.d.ts.map +1 -0
  239. package/dist/js/utils/field-references.keys.d.ts +4 -0
  240. package/dist/js/utils/field-references.keys.d.ts.map +1 -0
  241. package/dist/js/utils/field-references.parser.d.ts +3 -0
  242. package/dist/js/utils/field-references.parser.d.ts.map +1 -0
  243. package/dist/js/utils/field-references.registry.d.ts +3 -0
  244. package/dist/js/utils/field-references.registry.d.ts.map +1 -0
  245. package/dist/js/utils/field-references.resolver.d.ts +4 -0
  246. package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
  247. package/dist/js/utils/field-references.types.d.ts +27 -0
  248. package/dist/js/utils/field-references.types.d.ts.map +1 -0
  249. package/dist/js/utils/fields.d.ts +5 -0
  250. package/dist/js/utils/fields.d.ts.map +1 -0
  251. package/dist/js/utils/http.d.ts +9 -0
  252. package/dist/js/utils/http.d.ts.map +1 -0
  253. package/dist/js/utils/i18n.d.ts +7 -0
  254. package/dist/js/utils/i18n.d.ts.map +1 -0
  255. package/dist/js/utils/scripts.d.ts +13 -0
  256. package/dist/js/utils/scripts.d.ts.map +1 -0
  257. package/dist/js/utils/unload-warning.d.ts +10 -0
  258. package/dist/js/utils/unload-warning.d.ts.map +1 -0
  259. package/dist/js/validation/rules/email.d.ts +4 -0
  260. package/dist/js/validation/rules/email.d.ts.map +1 -0
  261. package/dist/js/validation/rules/match.d.ts +4 -0
  262. package/dist/js/validation/rules/match.d.ts.map +1 -0
  263. package/dist/js/validation/rules/number.d.ts +4 -0
  264. package/dist/js/validation/rules/number.d.ts.map +1 -0
  265. package/dist/js/validation/rules/required.d.ts +4 -0
  266. package/dist/js/validation/rules/required.d.ts.map +1 -0
  267. package/dist/js/validation/rules/shared.d.ts +7 -0
  268. package/dist/js/validation/rules/shared.d.ts.map +1 -0
  269. package/dist/js/validation/rules/url.d.ts +4 -0
  270. package/dist/js/validation/rules/url.d.ts.map +1 -0
  271. package/dist/js/validation/rules.d.ts +10 -0
  272. package/dist/js/validation/rules.d.ts.map +1 -0
  273. package/dist/js/validation/types.d.ts +44 -0
  274. package/dist/js/validation/types.d.ts.map +1 -0
  275. package/dist/js/validation/validator.d.ts +53 -0
  276. package/dist/js/validation/validator.d.ts.map +1 -0
  277. package/package.json +3 -2
  278. package/src/js/modules/fields/file-upload.ts +1 -1
  279. package/src/js/modules/fields/repeater.ts +1 -1
  280. package/src/js/modules/fields/rich-text.ts +2 -2
  281. package/src/js/modules/fields/signature.ts +1 -1
  282. package/src/js/modules/fields/summary.ts +1 -1
  283. package/src/js/modules/fields/table.ts +1 -1
  284. package/src/js/modules/fields/text-limit.ts +1 -1
  285. package/src/js/modules/payments/paypal.ts +1 -1
  286. package/src/js/modules/payments/payway.ts +1 -1
  287. package/src/js/modules/payments/stripe.ts +1 -1
  288. package/dist/chunks/address-finder-DfMCiW89.js +0 -47
  289. package/dist/chunks/api-CbqEMQT5.js +0 -181
  290. package/dist/chunks/api-DE7LfK-R.js +0 -960
  291. package/dist/chunks/api-DOfDzYC_.js +0 -538
  292. package/dist/chunks/async-B3DUf1GZ.js +0 -26
  293. package/dist/chunks/bpoint-Ciy3yY9Q.js +0 -34
  294. package/dist/chunks/calculations-CkYAqO_-.js +0 -197
  295. package/dist/chunks/captcha-eu-DnOWhMwr.js +0 -43
  296. package/dist/chunks/checkbox-radio-0x7Tc0br.js +0 -197
  297. package/dist/chunks/chunk-K6L4z4UQ.js +0 -24
  298. package/dist/chunks/conditions-4fXKhEJS.js +0 -609
  299. package/dist/chunks/date-picker-B6iZkjHS.js +0 -6204
  300. package/dist/chunks/debug-KnZeKYBI.js +0 -39
  301. package/dist/chunks/dist-D09GnXMW.js +0 -2663
  302. package/dist/chunks/event-names-DamGPtXR.js +0 -51
  303. package/dist/chunks/eway-DEAYcwT0.js +0 -86
  304. package/dist/chunks/field-references.keys-BpBZ_quS.js +0 -24
  305. package/dist/chunks/field-references.resolver-Ba6xhiJC.js +0 -183
  306. package/dist/chunks/file-upload-BIj85NFH.js +0 -428
  307. package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +0 -40
  308. package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +0 -47
  309. package/dist/chunks/friendly-challenge-Dg8XkStd.js +0 -1101
  310. package/dist/chunks/go-cardless-CuND59rR.js +0 -26
  311. package/dist/chunks/google-address--uR8WDSm.js +0 -208
  312. package/dist/chunks/hcaptcha-CmaFUesv.js +0 -72
  313. package/dist/chunks/hidden-CYnZYple.js +0 -36
  314. package/dist/chunks/http-18nn97DZ.js +0 -29
  315. package/dist/chunks/i18n-vUh-KGiH.js +0 -55
  316. package/dist/chunks/loqate-BICNJlVK.js +0 -97
  317. package/dist/chunks/mollie-DwlsgHZ1.js +0 -26
  318. package/dist/chunks/moneris-B_IFZFTx.js +0 -159
  319. package/dist/chunks/opayo-U2x_TOII.js +0 -192
  320. package/dist/chunks/paddle-BqXFrc79.js +0 -75
  321. package/dist/chunks/paypal-VowQ3ilP.js +0 -121
  322. package/dist/chunks/payway-VOO-ajyg.js +0 -75
  323. package/dist/chunks/phone-country-B6Me4lK0.js +0 -3317
  324. package/dist/chunks/place-kit-ldUl-u9w.js +0 -56
  325. package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +0 -1771
  326. package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +0 -72
  327. package/dist/chunks/recaptcha-shared-DTI4qWVR.js +0 -22
  328. package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +0 -49
  329. package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +0 -62
  330. package/dist/chunks/recaptcha-v3-EAlWhnkX.js +0 -33
  331. package/dist/chunks/repeater-BPm7Mkyn.js +0 -149
  332. package/dist/chunks/rich-text-CHSly1Hq.js +0 -438
  333. package/dist/chunks/scripts-BGD_iU_6.js +0 -41
  334. package/dist/chunks/sdk-B7u9fTlP.js +0 -2103
  335. package/dist/chunks/shared-DC6_1u8X.js +0 -85
  336. package/dist/chunks/signature-DNMCgrMd.js +0 -763
  337. package/dist/chunks/snaptcha-CCDunGeb.js +0 -8
  338. package/dist/chunks/square-BLqK51rS.js +0 -61
  339. package/dist/chunks/stripe-B6ZcDQdx.js +0 -273
  340. package/dist/chunks/styles-BIh6g7V_.js +0 -22
  341. package/dist/chunks/summary-BTG0uIOt.js +0 -189
  342. package/dist/chunks/table-BTYc0Qm8.js +0 -122
  343. package/dist/chunks/text-limit-CgBMu4sJ.js +0 -177
  344. package/dist/chunks/theme-classes-vSHpdCUO.js +0 -59
  345. package/dist/chunks/turnstile-DP0bdR7T.js +0 -68
  346. package/dist/chunks/utils-ByrEVYrJ.js +0 -49584
@@ -0,0 +1,1559 @@
1
+ function M(e) {
2
+ let t, n;
3
+ return { promise: new Promise((r, o) => {
4
+ t = r, n = o;
5
+ }), resolve: t, reject: n };
6
+ }
7
+ function C(e, t) {
8
+ return e.lastIndexOf(t, 0) === 0;
9
+ }
10
+ var ye = /^((?:\w+:)?\/\/([^\/]+))/;
11
+ function ge(e) {
12
+ let t = [];
13
+ const n = Object.keys(e), i = encodeURIComponent;
14
+ for (let r = 0; r < n.length; r++)
15
+ t.push(`${i(n[r])}=${i(e[n[r]])}`);
16
+ return t.join("&");
17
+ }
18
+ function S(e) {
19
+ const t = document.location;
20
+ if (C(e, "/") || C(e, "."))
21
+ return t.origin ? t.origin : t.protocol + "//" + t.host;
22
+ const n = e.match(ye);
23
+ if (!n) throw new Error("Invalid URL: " + e);
24
+ return n[1];
25
+ }
26
+ var we = class {
27
+ constructor(e) {
28
+ this.ready = !1, this.buffer = [], this.id = e.id, this.type = e.type, this.element = e.element, this.onReady = e.onReady, this.origin = S(e.element.src);
29
+ }
30
+ send(e) {
31
+ this.ready ? this.element.contentWindow.postMessage(e, this.origin) : this.buffer.push(e);
32
+ }
33
+ setReady(e) {
34
+ this.onReady(), this.ready = e, this.ready && this.flush();
35
+ }
36
+ flush() {
37
+ for (let e = 0; e < this.buffer.length; e++)
38
+ this.element.contentWindow.postMessage(this.buffer[e], this.origin);
39
+ this.buffer = [];
40
+ }
41
+ };
42
+ function be(e, t) {
43
+ return e === "*" || t.has(e);
44
+ }
45
+ var Ae = class {
46
+ constructor() {
47
+ this.origins = /* @__PURE__ */ new Set(), this.targets = {}, this.answered = /* @__PURE__ */ new Set(), this.onReceiveRootMessage = () => {
48
+ }, window.addEventListener("message", (e) => {
49
+ this.onReceive(e);
50
+ });
51
+ }
52
+ /**
53
+ * Adds a listener for root messages.
54
+ * @internal
55
+ */
56
+ listen(e) {
57
+ let t = this.onReceiveRootMessage;
58
+ this.onReceiveRootMessage = (n) => {
59
+ t(n), e(n);
60
+ };
61
+ }
62
+ /**
63
+ * Add origins to allow messages from.
64
+ * @internal
65
+ */
66
+ addOrigins(e) {
67
+ e.forEach((t) => this.origins.add(t));
68
+ }
69
+ /**
70
+ * Send from the local root
71
+ * @param msg
72
+ * @internal
73
+ */
74
+ send(e) {
75
+ if (e.from_id) {
76
+ const i = this.targets[e.from_id];
77
+ if (!i) {
78
+ console.error(`[bus] Unexpected message from unknown sender ${e.from_id}`, e);
79
+ return;
80
+ }
81
+ (e.type === "widget_announce" || e.type === "agent_announce") && i.setReady(!0);
82
+ }
83
+ const t = e.rid;
84
+ if (t) {
85
+ if (this.answered.has(t + e.to_id))
86
+ return;
87
+ this.answered.add(t + e.to_id);
88
+ }
89
+ if (e.to_id === "") {
90
+ this.onReceiveRootMessage(e);
91
+ return;
92
+ }
93
+ const n = this.targets[e.to_id];
94
+ if (!n) {
95
+ console.error(`[bus] Unexpected message to unknown target ${e.to_id}`, e);
96
+ return;
97
+ }
98
+ n.send(e);
99
+ }
100
+ onReceive(e) {
101
+ if (!be(e.origin, this.origins))
102
+ return;
103
+ const t = e.data;
104
+ !t || !t._frc || this.send(t);
105
+ }
106
+ /**
107
+ * @param ct
108
+ * @internal
109
+ */
110
+ registerTarget(e) {
111
+ this.targets[e.id] = e;
112
+ }
113
+ /**
114
+ * @internal
115
+ */
116
+ registerTargetIFrame(e, t, n, i) {
117
+ const r = M();
118
+ let o = new Promise((u) => setTimeout(() => u("timeout"), i));
119
+ const s = new we({
120
+ id: t,
121
+ element: n,
122
+ type: e,
123
+ onReady: () => r.resolve("registered")
124
+ });
125
+ return this.registerTarget(s), Promise.race([r.promise, o]);
126
+ }
127
+ /**
128
+ * @internal
129
+ */
130
+ removeTarget(e) {
131
+ delete this.targets[e];
132
+ }
133
+ };
134
+ function D(e, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
135
+ let n = "";
136
+ for (let i = 0; i < e; i++)
137
+ n += t.charAt(Math.floor(Math.random() * t.length));
138
+ return n;
139
+ }
140
+ function ke(e) {
141
+ const t = e.slice();
142
+ for (let n = t.length - 1; n > 0; n--) {
143
+ const i = Math.floor(Math.random() * (n + 1)), r = t[n];
144
+ t[n] = t[i], t[i] = r;
145
+ }
146
+ return t;
147
+ }
148
+ var ee = "frc_sc", te = "frc_sid", ne = "__", j = "0", Fe = "__" + D(10);
149
+ function K(e) {
150
+ {
151
+ let t = 0;
152
+ try {
153
+ t = parseInt(sessionStorage.getItem(ee) || "", 10);
154
+ } catch {
155
+ }
156
+ isNaN(t) && (t = 0), e && t++, j = t.toString();
157
+ try {
158
+ sessionStorage.setItem(ee, j);
159
+ } catch {
160
+ }
161
+ }
162
+ return j;
163
+ }
164
+ function U() {
165
+ let e;
166
+ try {
167
+ e = sessionStorage.getItem(te);
168
+ } catch {
169
+ return Fe;
170
+ }
171
+ return e || (e = D(12), sessionStorage.setItem(te, e)), e;
172
+ }
173
+ var xe = class {
174
+ constructor(e) {
175
+ this.mem = /* @__PURE__ */ new Map(), this.storePrefix = e;
176
+ }
177
+ get(e) {
178
+ const t = this.storePrefix + ne + e;
179
+ try {
180
+ const n = sessionStorage.getItem(t);
181
+ return n === null ? void 0 : n;
182
+ } catch {
183
+ }
184
+ return this.mem.get(e);
185
+ }
186
+ set(e, t) {
187
+ const n = this.storePrefix + ne + e;
188
+ try {
189
+ t === void 0 ? (this.mem.delete(e), sessionStorage.removeItem(n)) : (this.mem.set(e, t), sessionStorage.setItem(n, t));
190
+ } catch {
191
+ }
192
+ }
193
+ }, Re = typeof navigator < "u" && navigator.userAgentData !== void 0;
194
+ function _e() {
195
+ const e = document.querySelectorAll(".frc-captcha"), t = document.querySelectorAll(".frc-risk-intelligence");
196
+ return [e, t];
197
+ }
198
+ function he(e) {
199
+ let t = e;
200
+ for (; t; ) {
201
+ if (t.tagName === "FORM")
202
+ return t;
203
+ if (t.parentElement) {
204
+ t = t.parentElement;
205
+ continue;
206
+ }
207
+ const n = t.parentNode;
208
+ if (n && n.host) {
209
+ t = n.host;
210
+ continue;
211
+ }
212
+ t = null;
213
+ }
214
+ return null;
215
+ }
216
+ function fe(e, t) {
217
+ e.addEventListener("focusin", t, { once: !0, passive: !0 });
218
+ }
219
+ function me(e, t) {
220
+ const n = document.createElement("input");
221
+ return n.type = "hidden", n.style.display = "none", n.name = t, e.appendChild(n), n;
222
+ }
223
+ function De(e, t, n) {
224
+ e.style[t] === "" && (e.style[t] = n);
225
+ }
226
+ function Ce(e) {
227
+ const t = De;
228
+ t(e, "position", "relative"), t(e, "height", "70px"), t(e, "padding", "0"), t(e, "width", "316px"), t(e, "maxWidth", "100%"), t(e, "maxHeight", "100%"), t(e, "overflow", "hidden"), t(e, "borderRadius", "4px");
229
+ }
230
+ function Se(e) {
231
+ e.removeAttribute("style");
232
+ }
233
+ function H(e) {
234
+ document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", e);
235
+ }
236
+ function W(e, t) {
237
+ let n;
238
+ typeof window.CustomEvent == "function" ? n = new CustomEvent(t.name, {
239
+ bubbles: !0,
240
+ detail: t
241
+ }) : (n = document.createEvent("CustomEvent"), n.initCustomEvent(t.name, !0, !1, t)), e.dispatchEvent(n);
242
+ }
243
+ function Ie(e) {
244
+ for (; !e.lang || typeof e.lang != "string"; )
245
+ if (e = e.parentElement, !e)
246
+ return null;
247
+ return e.lang;
248
+ }
249
+ var z = {
250
+ ar: {
251
+ title: "التحقق من مكافحة الروبوتات",
252
+ connecting: "التحقق من مكافحة الروبوتات قيد الاتصال…",
253
+ retrying: `استغرق الاتصال بالتحقق من مكافحة الروبوتات وقتًا طويلاً.
254
+
255
+ إعادة المحاولة…`,
256
+ failed: "فشل الاتصال بالتحقق من مكافحة الروبوتات."
257
+ },
258
+ bg: {
259
+ title: "Проверка срещу роботи",
260
+ connecting: "Зарежда се задачата…",
261
+ retrying: `Неуспешно свързване.
262
+
263
+ Опит за повторно свързване…`,
264
+ failed: "Неуспешно свързване."
265
+ },
266
+ ca: {
267
+ title: "Verificació anti-robot",
268
+ connecting: "Carregant el desafiament…",
269
+ retrying: `Errada de conexió.
270
+
271
+ Reintentant…`,
272
+ failed: "Errada de conexió."
273
+ },
274
+ cs: {
275
+ title: "Ověření proti robotům",
276
+ connecting: "Připojování kontroly proti robotům…",
277
+ retrying: `Připojení kontroly proti robotům trvalo příliš dlouho.
278
+
279
+ Opakuji pokus…`,
280
+ failed: "Kontrola proti robotům se nepodařilo připojit."
281
+ },
282
+ da: {
283
+ title: "Anti-robot-verifikation",
284
+ connecting: "Anti-robot-kontrol forbinder…",
285
+ retrying: `Anti-robot-kontrol tog for lang tid at oprette forbindelse.
286
+
287
+ Prøver igen…`,
288
+ failed: "Anti-robot-kontrol kunne ikke oprette forbindelse."
289
+ },
290
+ nl: {
291
+ title: "Anti-robotcheck",
292
+ connecting: "Verbinden met Anti-robotcheck…",
293
+ retrying: `Verbinden met Anti-robotcheck mislukt.
294
+
295
+ Opnieuw aan het proberen…`,
296
+ failed: "Verbinden met Anti-robotcheck mislukt."
297
+ },
298
+ en: {
299
+ title: "Anti-Robot verification",
300
+ connecting: "Anti-Robot check connecting…",
301
+ retrying: `Anti-Robot check took too long to connect.
302
+
303
+ Retrying…`,
304
+ failed: "Anti-Robot check failed to connect."
305
+ },
306
+ fi: {
307
+ title: "Robottien torjunnan vahvistus",
308
+ connecting: "Robottien torjunnan tarkistus käynnissä…",
309
+ retrying: `Robottien torjunnan tarkistus kesti liian kauan.
310
+
311
+ Yritetään uudelleen…`,
312
+ failed: "Robottien torjunnan tarkistus epäonnistui."
313
+ },
314
+ fr: {
315
+ title: "Vérification anti-robot",
316
+ connecting: "Connexion à la vérification anti-robot…",
317
+ retrying: `La connexion à la vérification anti-robot a pris trop de temps.
318
+
319
+ Nouvelle tentative…`,
320
+ failed: "Échec de la connexion à la vérification anti-robot."
321
+ },
322
+ de: {
323
+ title: "Anti-Roboter-Verifizierung",
324
+ connecting: "Verbindung zur Anti-Roboter-Verifizierung wird hergestellt…",
325
+ retrying: `Verbindung zur Anti-Roboter-Verifizierung hat zu lange gedauert.
326
+
327
+ Erneuter Versuch…`,
328
+ failed: "Verbindung zur Anti-Roboter-Verifizierung ist fehlgeschlagen."
329
+ },
330
+ hi: {
331
+ title: "एंटी-रोबोट सत्यापन",
332
+ connecting: "चुनौती लोड हो रही है…",
333
+ retrying: `कनेक्शन विफल.
334
+
335
+ पुनः प्रयास कर रहे हैं…`,
336
+ failed: "कनेक्शन विफल."
337
+ },
338
+ hu: {
339
+ title: "Robotellenőrzés",
340
+ connecting: "Robotellenőrzés csatlakozás…",
341
+ retrying: `A robotellenőrzés túl sokáig tartott a csatlakozáshoz.
342
+
343
+ Újrapróbálom…`,
344
+ failed: "A robotellenőrzés nem tudott csatlakozni."
345
+ },
346
+ id: {
347
+ title: "Verifikasi Anti-Robot",
348
+ connecting: "Pemeriksaan Anti-Robot sedang terhubung…",
349
+ retrying: `Pemeriksaan Anti-Robot memakan waktu terlalu lama untuk terhubung.
350
+
351
+ Mencoba lagi…`,
352
+ failed: "Pemeriksaan Anti-Robot gagal terhubung."
353
+ },
354
+ ja: {
355
+ title: "ロボット防止認証",
356
+ connecting: "チャレンジを読み込んでいます…",
357
+ retrying: `接続失敗.
358
+
359
+ 再試行中…`,
360
+ failed: "接続失敗."
361
+ },
362
+ it: {
363
+ title: "Verifica anti-robot",
364
+ connecting: "Connessione verifica anti-robot in corso…",
365
+ retrying: `La connessione alla verifica anti-robot ha richiesto troppo tempo.
366
+
367
+ Riprovando…`,
368
+ failed: "Impossibile connettersi alla verifica anti-robot."
369
+ },
370
+ nb: {
371
+ title: "Anti-robot-verifisering",
372
+ connecting: "Laster inn utfordring…",
373
+ retrying: `Klarte ikke å koble til.
374
+
375
+ Prøver igjen…`,
376
+ failed: "Klarte ikke å koble til."
377
+ },
378
+ pl: {
379
+ title: "Weryfikacja antyrobotowa",
380
+ connecting: "Łączenie się z kontrolą antyrobotową…",
381
+ retrying: `Łączenie się z kontrolą antyrobotową trwało zbyt długo.
382
+
383
+ Ponowna próba…`,
384
+ failed: "Nie udało się połączyć z kontrolą antyrobotową."
385
+ },
386
+ ro: {
387
+ title: "Verificare anti-robot",
388
+ connecting: "Se incarca testul…",
389
+ retrying: `Conexiunea a esuat.
390
+
391
+ Reincercare…`,
392
+ failed: "Conexiunea a esuat."
393
+ },
394
+ pt: {
395
+ title: "Verificação anti-robô",
396
+ connecting: "Verificação anti-robô a ligar…",
397
+ retrying: `A verificação anti-robô demorou demasiado tempo a ligar-se.
398
+
399
+ A tentar novamente…`,
400
+ failed: "A verificação anti-robô não conseguiu ligar-se."
401
+ },
402
+ ru: {
403
+ title: "Проверка антиробота",
404
+ connecting: "Подключение к проверке антиробота…",
405
+ retrying: `Подключение к проверке антиробота заняло слишком много времени.
406
+
407
+ Повторяем попытку…`,
408
+ failed: "Не удалось подключиться к проверке антиробота."
409
+ },
410
+ sk: {
411
+ title: "Overovanie proti robotom",
412
+ connecting: "Pripojenie kontroly proti robotom…",
413
+ retrying: `Pripojenie kontroly proti robotom trvalo príliš dlho.
414
+
415
+ Opakujem pokus…`,
416
+ failed: "Pripojenie kontroly proti robotom sa nepodarilo."
417
+ },
418
+ sl: {
419
+ title: "Preverjanje proti robotom",
420
+ connecting: "Nalaganje izziva…",
421
+ retrying: `Povezava ni uspela.
422
+
423
+ Ponovni poskus…`,
424
+ failed: "Povezava ni uspela."
425
+ },
426
+ es: {
427
+ title: "Verificación antirrobot",
428
+ connecting: "Conectando verificación antirrobot…",
429
+ retrying: `La verificación antirrobot tardó demasiado en conectarse.
430
+
431
+ Reintentando…`,
432
+ failed: "Error al conectar la verificación antirrobot."
433
+ },
434
+ sv: {
435
+ title: "Anti-robotverifiering",
436
+ connecting: "Anti-robotverifiering ansluter…",
437
+ retrying: `Anti-robotverifiering tog för lång tid att ansluta.
438
+
439
+ Försöker igen…`,
440
+ failed: "Anti-robotverifiering kunde inte ansluta."
441
+ },
442
+ th: {
443
+ title: "การตรวจสอบป้องกันบอท",
444
+ connecting: "กำลังโหลดการท้าทาย…",
445
+ retrying: `เชื่อมต่อไม่สำเร็จ.
446
+
447
+ กำลังลองใหม่…`,
448
+ failed: "เชื่อมต่อไม่สำเร็จ."
449
+ },
450
+ tr: {
451
+ title: "Robot önleme doğrulaması",
452
+ connecting: "Robot önleme kontrolü bağlanıyor…",
453
+ retrying: `Robot önleme kontrolü bağlanmak için çok uzun sürdü.
454
+
455
+ Yeniden deniyor…`,
456
+ failed: "Robot önleme kontrolü bağlanamadı."
457
+ },
458
+ vi: {
459
+ title: "Xác minh chống robot",
460
+ connecting: "Kiểm tra robot đang kết nối…",
461
+ retrying: `Kiểm tra chống robot mất quá nhiều thời gian để kết nối.
462
+
463
+ Đang thử lại…`,
464
+ failed: "Kiểm tra chống robot không thể kết nối."
465
+ },
466
+ zh: {
467
+ title: "反机器人验证",
468
+ connecting: "反机器人验证正在连接…",
469
+ retrying: `反机器人验证连接耗时过长。
470
+
471
+ 正在重试…`,
472
+ failed: "反机器人验证连接失败。"
473
+ }
474
+ }, Me = ["ar", "he", "fa", "ur", "ps", "sd", "yi"];
475
+ function $(e) {
476
+ return e.toLowerCase().split("-")[0].split("_")[0];
477
+ }
478
+ function V(e) {
479
+ return e = $(e), Me.indexOf(e) !== -1;
480
+ }
481
+ function pe(e) {
482
+ return e = $(e), (z[e] || z.en).title + " - Widget";
483
+ }
484
+ function Y(e, t) {
485
+ return e = $(e), (z[e] || z.en)[t];
486
+ }
487
+ var Ee = "FrcFrameId", ve = "frc-i-agent", Oe = "frc-i-widget", Te = "frc-widget-placeholder";
488
+ function Pe(e, t, n) {
489
+ const i = {
490
+ origin: document.location.origin,
491
+ sess_id: U(),
492
+ sess_c: K(!0),
493
+ comm_id: t,
494
+ sdk_v: "1.0.0",
495
+ v: "1",
496
+ agent_id: t,
497
+ ts: Date.now().toString()
498
+ }, r = document.createElement("iframe");
499
+ r.className = ve, r.dataset[Ee] = t, r.src = n + "?" + ge(i), r.frcSDK = e;
500
+ const o = r.style;
501
+ return o.width = o.height = o.border = o.visibility = "0", o.display = "none", r;
502
+ }
503
+ function Ne(e, t, n, i) {
504
+ const r = document.createElement("iframe"), o = Z(i), s = {
505
+ origin: document.location.origin,
506
+ sess_id: U(),
507
+ sess_c: K(!0),
508
+ comm_id: t,
509
+ sdk_v: "1.0.0",
510
+ v: "1",
511
+ agent_id: e,
512
+ lang: o,
513
+ sitekey: i.sitekey || "",
514
+ ts: Date.now().toString()
515
+ };
516
+ i.theme && (s.theme = i.theme), Re && (r.allow = "clipboard-write"), r.frameBorder = "0", r.src = n + "?" + ge(s), r.className = Oe, r.title = pe(o), r.dataset[Ee] = t;
517
+ const u = r.style;
518
+ return u.border = u.visibility = "0", u.position = "absolute", u.height = u.width = "100%", u.userSelect = "none", u["-webkit-tap-highlight-color"] = "transparent", u.display = "none", i.element.appendChild(r), r;
519
+ }
520
+ function Le(e) {
521
+ const t = document.createElement("div");
522
+ t.classList.add(Te);
523
+ const n = t.style, i = e.theme === "dark" || e.theme === "auto" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
524
+ return n.color = i ? "#fff" : "#222", n.backgroundColor = i ? "#171717" : "#fafafa", n.borderRadius = "4px", n.border = "1px solid", n.borderColor = "#ddd", n.padding = "8px", n.height = n.width = "100%", n.fontSize = "14px", n.boxSizing = "border-box", G(n), e.element.appendChild(t), t;
525
+ }
526
+ function G(e) {
527
+ e.textDecoration = e.fontStyle = "none", e.fontWeight = "500", e.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', e.lineHeight = "1", e.letterSpacing = "-0.0125rem";
528
+ }
529
+ function Be(e) {
530
+ const t = document.createElement("div");
531
+ t.classList.add("frc-banner");
532
+ const n = Z(e), i = e.theme === "dark" || e.theme === "auto" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
533
+ let r = "#565656", o = "#a2a2a2";
534
+ i && (r = "#a2a2a2", o = "#565656");
535
+ const s = t.style;
536
+ s.position = "absolute", s.bottom = "6px", V(n) ? s.left = "6px" : s.right = "6px", s.lineHeight = "1";
537
+ const u = document.createElement("a");
538
+ u.href = "https://friendlycaptcha.com", u.rel = "noopener";
539
+ const c = u.style;
540
+ G(c), c.color = r, c.fontSize = "10px", c.userSelect = "none", c.textDecorationLine = "underline", c.textDecorationThickness = "1px", c.textDecorationColor = o, c.letterSpacing = "-0.0125rem", u.target = "_blank", u.textContent = "Friendly Captcha", u.onmouseenter = () => c.textDecorationColor = r, u.onmouseleave = () => c.textDecorationColor = o, t.appendChild(u), e.element.appendChild(t);
541
+ }
542
+ function Z(e) {
543
+ let t = e.language;
544
+ return (!t || t === "html") && (t = Ie(e.element) || ""), t;
545
+ }
546
+ function We(e, t, n) {
547
+ const i = (s, u) => {
548
+ const c = document.createElement("a");
549
+ c.href = s, c.target = "_blank", c.rel = "noopener", c.textContent = u;
550
+ const a = c.style;
551
+ return G(a), a.textDecoration = "underline", a.color = "#565656", c.onmouseenter = () => a.textDecoration = "none", c.onmouseleave = () => a.textDecoration = "underline", c;
552
+ }, r = Y(n, "failed"), o = [i(`${t}/connectionTest`, r)];
553
+ e.textContent = "", o.forEach((s) => e.appendChild(s));
554
+ }
555
+ function Q() {
556
+ const e = window.performance;
557
+ return e ? e.now() : 0;
558
+ }
559
+ function ze(e, t, n, i) {
560
+ const r = Q(), o = n.getBoundingClientRect(), s = {
561
+ v: 1,
562
+ tt: e,
563
+ pnow: r,
564
+ sm: t,
565
+ el: {
566
+ bcr: [o.left, o.top, o.width, o.height],
567
+ con: document.body.contains(n)
568
+ },
569
+ stack: new Error().stack || "",
570
+ we: !!window.event,
571
+ weit: !!window.event && !!window.event.isTrusted
572
+ };
573
+ return i && (s.ev = {
574
+ ts: i.timeStamp,
575
+ rt: !!i.relatedTarget,
576
+ // @ts-ignore: not present in every browser
577
+ eot: !!i.explicitOriginalTarget,
578
+ it: i.isTrusted
579
+ }), s;
580
+ }
581
+ function J(e, ...t) {
582
+ for (let i = 0; i < t.length; i++) {
583
+ const r = t[i];
584
+ for (var n in r)
585
+ r.hasOwnProperty(n) && (e[n] = r[n]);
586
+ }
587
+ return e;
588
+ }
589
+ var je = "frc-captcha-response", He = class {
590
+ /**
591
+ * You don't want to create this yourself, use `FriendlyCaptcha.createWidget` instead.
592
+ * @internal
593
+ */
594
+ constructor(e) {
595
+ this.state = "init", this.response = ".UNINITIALIZED", this.focusEventPending = !1, this.isDestroyed = !1, this.id = e.id;
596
+ const t = e.createOpts;
597
+ if (this.e = t.element, this.ready = e.registered, !this.e) throw new Error("No element provided to mount widget under.");
598
+ this.e.frcWidget = this, this.formFieldName = t.formFieldName === void 0 ? je : t.formFieldName, this.sitekey = t.sitekey, this._reset = e.callbacks.onReset, this._destroy = e.callbacks.onDestroy, this._trigger = e.callbacks.onTrigger, this.startMode = e.createOpts.startMode || "focus", this.formFieldName !== null && (this.hiddenFormEl = me(this.e, this.formFieldName)), this.setState({ response: ".UNCONNECTED", state: "init" }), this.ready.then(() => {
599
+ this.handleStartMode();
600
+ });
601
+ }
602
+ handleStartMode() {
603
+ if (this.startMode === "focus" && !this.focusEventPending && !this.isDestroyed) {
604
+ const e = he(this.e);
605
+ e && (this.focusEventPending = !0, fe(e, (t) => {
606
+ this.trigger("focus", { ev: t }), this.focusEventPending = !1;
607
+ }));
608
+ } else this.startMode === "auto" && this.trigger("auto");
609
+ }
610
+ /**
611
+ * Reset the widget, removing any progress.
612
+ *
613
+ * Optional argument: an object with the name of the trigger that caused the reset.
614
+ * You would usually keep this empty. This is the `trigger` field in the `frc:widget.reset` event, which defaults to `root`.
615
+ */
616
+ reset(e = { trigger: "root" }) {
617
+ if (this.isDestroyed) throw new Error("Can not reset destroyed widget.");
618
+ this.setState({ response: ".RESET", state: "reset", resetTrigger: e.trigger }), this._reset(e), this.handleStartMode();
619
+ }
620
+ /**
621
+ * Destroy the widget.
622
+ *
623
+ * This removes the `element` that the widget was mounted to as well as the hidden `frc-captcha-response` form field.
624
+ */
625
+ destroy() {
626
+ this.isDestroyed = !0, this.hiddenFormEl && this.hiddenFormEl.remove(), this.hiddenFormEl = void 0, this.setState({ response: ".DESTROYED", state: "destroyed" }), this._destroy();
627
+ }
628
+ /**
629
+ * @internal
630
+ */
631
+ trigger(e, t = {}) {
632
+ if (this.isDestroyed) throw new Error("Can not start destroyed widget.");
633
+ const n = ze(e, this.startMode, this.e, t.ev);
634
+ this._trigger({ trigger: n });
635
+ }
636
+ /**
637
+ * Trigger the widget to start a challenge.
638
+ * The widget will start a challenge solving in the background.
639
+ *
640
+ * * In `interactive` mode, the user will need to click the widget to complete the process.
641
+ * * In `noninteractive` mode, the widget will complete the process automatically.
642
+ *
643
+ */
644
+ start() {
645
+ this.trigger("programmatic");
646
+ }
647
+ /**
648
+ * Sets the state of the widget, this is for internal use.
649
+ * It is unlikely this is useful to call yourself.
650
+ * @internal
651
+ */
652
+ setState(e) {
653
+ const t = this.state !== e.state;
654
+ this.response = e.response, this.state = e.state, this.hiddenFormEl && this.e.isConnected !== !1 && (this.hiddenFormEl.value = e.response), t && this.dispatchWidgetEvent({ name: "frc:widget.statechange", error: e.error, mode: e.mode }), this.state === "expired" ? this.dispatchWidgetEvent({ name: "frc:widget.expire" }) : this.state === "completed" ? this.dispatchWidgetEvent({ name: "frc:widget.complete" }) : this.state === "error" ? this.dispatchWidgetEvent({ name: "frc:widget.error", error: e.error }) : this.state === "reset" && this.dispatchWidgetEvent({ name: "frc:widget.reset", trigger: e.resetTrigger });
655
+ }
656
+ dispatchWidgetEvent(e) {
657
+ const t = {
658
+ response: this.response,
659
+ state: this.state,
660
+ id: this.id
661
+ };
662
+ J(t, e), W(this.e, t);
663
+ }
664
+ /**
665
+ * Shorthand for `this.getElement().addEventListener` (that is strictly typed in Typescript)
666
+ */
667
+ addEventListener(e, t, n) {
668
+ this.e.addEventListener(e, t, n);
669
+ }
670
+ /**
671
+ * Shorthand for `this.getElement().removeEventListener` (that is strictly typed in Typescript)
672
+ */
673
+ removeEventListener(e, t, n) {
674
+ this.e.removeEventListener(e, t, n);
675
+ }
676
+ /**
677
+ * The current state of the widget.
678
+ */
679
+ getState() {
680
+ return this.state;
681
+ }
682
+ /**
683
+ * The current response of the widget. This is the value that should be sent to the server and is embedded in HTML forms.
684
+ */
685
+ getResponse() {
686
+ return this.response;
687
+ }
688
+ /**
689
+ * The HTML element that contains the widget.
690
+ */
691
+ getElement() {
692
+ return this.e;
693
+ }
694
+ }, Ve = function(e) {
695
+ return typeof e == "function";
696
+ }, Ye = function(e) {
697
+ const t = [], n = /* @__PURE__ */ new Map(), i = function() {
698
+ return t.splice(0, t.length);
699
+ }, r = window, o = (function() {
700
+ try {
701
+ const d = document.createElement("iframe");
702
+ d.style.display = "none", (document.body || document.head).appendChild(d);
703
+ const h = d ? d.contentWindow : 0;
704
+ return d.remove(), h || r;
705
+ } catch {
706
+ return r;
707
+ }
708
+ })(), s = Function.prototype.toString, u = function(...d) {
709
+ const h = Ve(this) ? n.get(this) : !1, l = this === u ? s : h || this;
710
+ return s.apply(l, d);
711
+ };
712
+ Function.prototype.toString = u;
713
+ const c = function() {
714
+ return (o.Error || r.Error)("FriendlyCaptcha_DummyTrace").stack || "";
715
+ }, a = "prototype", m = r.EventTarget ? r.EventTarget[a].dispatchEvent : {}, f = [
716
+ // Getters as non-function
717
+ ["Document." + a + ".documentElement", r.Document[a], "documentElement"],
718
+ ["Element." + a + ".shadowRoot", r.Element[a], "shadowRoot"],
719
+ ["Node." + a + ".nodeType", r.Node[a], "nodeType"],
720
+ // Values holding functions
721
+ ["Object.is", r.Object, "is"],
722
+ ["Array." + a + ".slice", r.Array[a], "slice"],
723
+ ["Document." + a + ".querySelectorAll", r.Document[a], "querySelectorAll"],
724
+ ["Document." + a + ".createElement", r.Document[a], "createElement"],
725
+ ["EventTarget." + a + ".dispatchEvent", m, "dispatchEvent"]
726
+ ];
727
+ return e.disableEvalPatching || f.push(["eval", r, "eval"]), f.forEach(function([g, d, h]) {
728
+ const l = Object.getOwnPropertyDescriptor(d, h), p = l && (l.get || l.set);
729
+ if (l) {
730
+ if (p) {
731
+ if (!l.get)
732
+ return;
733
+ } else if (typeof l.value != "object" && typeof l.value != "function")
734
+ return;
735
+ } else return;
736
+ let x = 0, A = 0;
737
+ const k = function(...w) {
738
+ const v = Date.now();
739
+ if (v - x >= 1e3 && (A = 0, x = v), A < 50) {
740
+ const _ = {
741
+ d: v,
742
+ pnow: Q(),
743
+ n: g,
744
+ st: c()
745
+ };
746
+ t.length > 2e4 && t.splice(0, 1e3), t.push(_), A++;
747
+ }
748
+ return (p ? l.get : l.value).apply(this, w);
749
+ };
750
+ try {
751
+ const E = p ? l.get ? l.get() : void 0 : l.value();
752
+ E && (k.length = E.length, k.name = E.name);
753
+ } catch {
754
+ }
755
+ try {
756
+ const E = J({}, l);
757
+ p ? E.get = k : E.value = k, Object.defineProperty(d, h, E), n.set(k, p ? l.get : l.value);
758
+ } catch {
759
+ }
760
+ }), i;
761
+ };
762
+ function F() {
763
+ const e = [0, 0, 0, 0, 0, 0, 0];
764
+ return {
765
+ s: e,
766
+ add(t) {
767
+ const n = ++e[0], i = t - e[1], r = i / n, o = r * r, s = i * r * (n - 1);
768
+ e[1] += r, e[4] += s * o * (n * n - 3 * n + 3) + 6 * o * e[2] - 4 * r * e[3], e[3] += s * r * (n - 2) - 3 * r * e[2], e[2] += s, n == 1 ? e[5] = e[6] = t : (t < e[5] && (e[5] = t), t > e[6] && (e[6] = t));
769
+ }
770
+ };
771
+ }
772
+ var b = "addEventListener", R = Math, ie;
773
+ function re() {
774
+ return /Android/i.test(navigator.userAgent);
775
+ }
776
+ function y(e, t, n = !1, i) {
777
+ const r = F();
778
+ let o = !1, s;
779
+ return H(() => {
780
+ i = i || document.body, i[b](e, (u) => {
781
+ (!o || n) && (s = u.timeStamp, o = !0);
782
+ }), i[b](t, (u) => {
783
+ o && (r.add(u.timeStamp - s), o = !1);
784
+ });
785
+ }), r.s;
786
+ }
787
+ function Xe(e) {
788
+ const t = [];
789
+ for (let n = 0; n < e.length; n++)
790
+ t.push(0), document[b](e[n], (i) => t[n]++);
791
+ return t;
792
+ }
793
+ function qe() {
794
+ const e = [0, 0, 0, 0, 0, 0, 0, 0], t = {
795
+ 8: 1,
796
+ // Backspace
797
+ 46: 1,
798
+ // Delete
799
+ 9: 2,
800
+ // Tab
801
+ 45: 3,
802
+ // Insert
803
+ 17: 4,
804
+ // Control
805
+ 13: 5,
806
+ // Enter
807
+ 37: 6,
808
+ // Arrow keys
809
+ 38: 6,
810
+ 39: 6,
811
+ 40: 6,
812
+ 33: 7,
813
+ // Page up/down
814
+ 34: 7
815
+ };
816
+ return document[b]("keydown", (n) => {
817
+ const i = n.keyCode;
818
+ t[i] ? e[t[i]]++ : i >= 112 && i <= 123 && e[0]++;
819
+ }), e;
820
+ }
821
+ function oe(e, t, n, i) {
822
+ return R.sqrt(R.pow(e - t, 2) + R.pow(n - i, 2));
823
+ }
824
+ function se(e, t, n) {
825
+ return R.sqrt(R.pow(e, 2) + R.pow(t, 2) + R.pow(n, 2));
826
+ }
827
+ function ue(e, t) {
828
+ let n = t - e;
829
+ return n += n > 180 ? -360 : n < -180 ? 360 : 0, n;
830
+ }
831
+ var Ke = class {
832
+ constructor(e) {
833
+ this.rn = 0, this.i = 0, this.smel = {
834
+ n: 0,
835
+ ts: 0,
836
+ d: 0
837
+ };
838
+ const t = "mouse", n = this.smel, i = (o) => {
839
+ n.n || (n.fts = o.timeStamp, n.fxy = [o.clientX, o.clientY, o.screenX, o.screenY]), n.n++, o.type === t + "leave" && (n.d += o.timeStamp - n.ts), n.ts = o.timeStamp, n.xy = [o.clientX, o.clientY];
840
+ }, r = document;
841
+ H(() => {
842
+ const o = r.body;
843
+ o[b](t + "enter", i), o[b](t + "leave", i);
844
+ }), this.bh = {
845
+ onoff: {
846
+ kdu: y("keydown", "keyup"),
847
+ cse: y("compositionstart", "compositionend"),
848
+ mdu: y(t + "down", t + "up"),
849
+ mle: y(t + "leave", t + "enter"),
850
+ med: y(t + "enter", t + "down", !0),
851
+ semd: y("scrollend", t + "down", !0, r),
852
+ se: y("scroll", "scrollend", !1, r),
853
+ pdc: y("pointerdown", "pointercancel", !0),
854
+ mmc: y(t + "move", "click", !0),
855
+ tse: y("touchstart", "touchend"),
856
+ fikd: y("focusin", "keydown", !0)
857
+ },
858
+ nev: Xe([
859
+ t + "out",
860
+ "pointercancel",
861
+ "focus",
862
+ "focusin",
863
+ "blur",
864
+ "visibilitychange",
865
+ "copy",
866
+ "paste",
867
+ "cut",
868
+ "contextmenu",
869
+ "click",
870
+ "auxclick",
871
+ "wheel",
872
+ "resize"
873
+ ]),
874
+ nk: qe(),
875
+ mov: this.setupMovementMetrics(),
876
+ dm: this.setupMotionMetrics(),
877
+ do: this.setupOrientationMetrics()
878
+ }, this.dep = e.disableEvalPatching || !1, this.takeTraceRecords = Ye(e);
879
+ }
880
+ setupMovementMetrics() {
881
+ let e, t = [];
882
+ const i = F(), r = F(), o = F(), s = {
883
+ t: i.s,
884
+ v: o.s,
885
+ d: r.s,
886
+ ns: 0
887
+ }, u = () => {
888
+ const a = t[t.length - 1];
889
+ if (t.length >= 1e4 / 50 || // A reasonable upper bound
890
+ a && (a[0] && this.tm.timeStamp === a[1] || // Last sample was touch and timestamp is unchanged.
891
+ !a[0] && this.mm.timeStamp === a[1])) {
892
+ if (clearInterval(e), e = void 0, t.length === 1) {
893
+ s.ns++, t = [];
894
+ return;
895
+ }
896
+ const f = t[0];
897
+ i.add(a[1] - f[1]), r.add(oe(a[2], f[2], a[3], f[3]));
898
+ for (let g = 1; g < t.length; g++) {
899
+ const d = t[g], h = t[g - 1], l = oe(d[2], h[2], d[3], h[3]) * 1e3, p = d[1] - h[1];
900
+ o.add(l / p);
901
+ }
902
+ t = [];
903
+ return;
904
+ }
905
+ let m = 0;
906
+ if (a ? m = a[0] : this.mm && this.tm ? m = this.mm.timeStamp > this.tm.timeStamp ? 0 : 1 : this.mm || (m = 1), m) {
907
+ const f = this.tm.touches[0];
908
+ f && t.push([1, this.tm.timeStamp, f.screenX, f.screenY]);
909
+ } else
910
+ t.push([0, this.mm.timeStamp, this.mm.screenX, this.mm.screenY]);
911
+ };
912
+ let c = -1;
913
+ return H(() => {
914
+ const a = document.body;
915
+ a[b]("mousemove", (m) => {
916
+ this.mm = m, e === void 0 && (u(), e = setInterval(u, 50));
917
+ }), a[b]("touchmove", (m) => {
918
+ this.tm = m;
919
+ const f = m.touches[0];
920
+ if (f) {
921
+ const g = f.radiusX + f.radiusY * 1.234;
922
+ g !== c && (c = g, this.rn++);
923
+ }
924
+ e === void 0 && (u(), e = setInterval(u, 50));
925
+ });
926
+ }), s;
927
+ }
928
+ /**
929
+ * @internal
930
+ */
931
+ setupMotionMetrics() {
932
+ const e = F(), t = F(), n = {
933
+ n: 0,
934
+ ts: 0,
935
+ ac: e.s,
936
+ rr: t.s,
937
+ i: 0,
938
+ g: !1
939
+ };
940
+ return re() && window[b]("devicemotion", (i) => {
941
+ n.ts = i.timeStamp, n.i = i.interval, n.g = !i.acceleration;
942
+ const r = i.acceleration || i.accelerationIncludingGravity;
943
+ r && e.add(se(r.x, r.y, r.z));
944
+ const o = i.rotationRate;
945
+ o && t.add(se(o.alpha, o.beta, o.gamma));
946
+ }), n;
947
+ }
948
+ /**
949
+ * @internal
950
+ */
951
+ setupOrientationMetrics() {
952
+ const e = F(), t = F(), n = {
953
+ fts: 0,
954
+ ts: 0,
955
+ gd: e.s,
956
+ bd: t.s
957
+ };
958
+ if (!re())
959
+ return n;
960
+ let i;
961
+ return window[b]("deviceorientation", (r) => {
962
+ r.gamma == null || r.beta == null || r.alpha == null || (n.ts = r.timeStamp, n.a = r.alpha, n.b = r.beta, n.g = r.gamma, i ? (e.add(ue(r.gamma, n.g)), t.add(ue(n.b, r.beta))) : (n.fts = n.ts, i = !0));
963
+ }), n;
964
+ }
965
+ /**
966
+ * @internal
967
+ */
968
+ gmm() {
969
+ const e = this.mm;
970
+ return e && {
971
+ xy: [
972
+ e.clientX,
973
+ e.clientY,
974
+ e.screenX,
975
+ e.screenY,
976
+ e.offsetX,
977
+ e.offsetY,
978
+ e.pageX,
979
+ e.pageY,
980
+ e.movementX,
981
+ e.movementY
982
+ ],
983
+ ts: e.timeStamp
984
+ };
985
+ }
986
+ /**
987
+ * @internal
988
+ */
989
+ gtm() {
990
+ const e = this.tm, t = e && e.touches, n = t && t[0];
991
+ return e && n && {
992
+ id: n.identifier,
993
+ xy: [n.clientX, n.clientY, n.screenX, n.screenY, n.pageX, n.pageY],
994
+ r: [n.radiusX, n.radiusX, n.rotationAngle, n.force],
995
+ n: t.length,
996
+ ts: e.timeStamp,
997
+ rn: this.rn
998
+ };
999
+ }
1000
+ /**
1001
+ * @internal
1002
+ */
1003
+ get(e) {
1004
+ const t = document.body, n = window, i = n.performance;
1005
+ return {
1006
+ v: 1,
1007
+ i: ++this.i,
1008
+ hl: history.length,
1009
+ fe: !!window.frameElement,
1010
+ dep: this.dep,
1011
+ wid: e,
1012
+ sc: parseInt(K(!1)),
1013
+ sid: U(),
1014
+ conv: 0,
1015
+ t: {
1016
+ pnow: Q(),
1017
+ pto: i && i.timeOrigin || 0,
1018
+ ts: Date.now()
1019
+ },
1020
+ dims: {
1021
+ d: [
1022
+ n.innerWidth,
1023
+ n.innerHeight,
1024
+ n.outerWidth,
1025
+ n.outerHeight,
1026
+ n.screenX,
1027
+ n.screenY,
1028
+ n.pageXOffset,
1029
+ n.pageYOffset,
1030
+ t.clientWidth,
1031
+ t.clientHeight
1032
+ ],
1033
+ dpr: n.devicePixelRatio
1034
+ },
1035
+ mel: this.smel,
1036
+ mm: this.gmm(),
1037
+ tm: this.gtm(),
1038
+ bh: this.bh,
1039
+ stack: new Error().stack || "",
1040
+ trc: this.takeTraceRecords()
1041
+ };
1042
+ }
1043
+ };
1044
+ function Ue(e) {
1045
+ return ie || (ie = new Ke(e));
1046
+ }
1047
+ var ae = (e) => e.map((t) => `https://${t}.frcapi.com`).join(","), X = {
1048
+ eu: ae(["eu", "eu0", "eu1"]),
1049
+ global: ae(["global", "global0", "global1"])
1050
+ }, q = (e) => e.split(",").map((t) => t.trim()).filter((t) => !!t), $e = (e) => q(X[e] || e);
1051
+ function O(e) {
1052
+ const t = e || X.global, n = q(t).reduce((i, r) => i.concat($e(r)), []).map(S);
1053
+ return n.length > 0 ? n : q(X.global).map(S);
1054
+ }
1055
+ function Ge() {
1056
+ const e = document.querySelector('meta[name="frc-disable-eval-patching"]');
1057
+ return e ? !!e.content : !1;
1058
+ }
1059
+ function T() {
1060
+ const e = document.querySelector('meta[name="frc-api-endpoint"]');
1061
+ if (e) return e.content;
1062
+ const t = document.currentScript;
1063
+ if (t) {
1064
+ const i = t.dataset.frcApiEndpoint;
1065
+ if (i) return i;
1066
+ }
1067
+ const n = document.querySelector(".frc-captcha[data-api-endpoint]");
1068
+ if (n) {
1069
+ const i = n.dataset.apiEndpoint;
1070
+ if (i) return i;
1071
+ }
1072
+ }
1073
+ function Ze() {
1074
+ const e = window.Intl;
1075
+ if (!e || !e.DateTimeFormat)
1076
+ return;
1077
+ const t = new e.DateTimeFormat();
1078
+ if (!(!t || !t.resolvedOptions))
1079
+ return t.resolvedOptions().timeZone;
1080
+ }
1081
+ var P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
1082
+ function Qe(e) {
1083
+ return window.TextEncoder ? Je(new TextEncoder().encode(e)) : "";
1084
+ }
1085
+ function Je(e) {
1086
+ const t = e.length;
1087
+ let n = "";
1088
+ for (let i = 0; i < t; i += 3) {
1089
+ const r = e[i + 0], o = e[i + 1], s = e[i + 2];
1090
+ let u = "";
1091
+ u += P.charAt(r >>> 2), u += P.charAt((r & 3) << 4 | o >>> 4), u += P.charAt((o & 15) << 2 | s >>> 6), u += P.charAt(s & 63), n += u;
1092
+ }
1093
+ return t % 3 === 2 ? n = n.substring(0, n.length - 1) + "=" : t % 3 === 1 && (n = n.substring(0, n.length - 2) + "=="), n;
1094
+ }
1095
+ var et = "frc-risk-intelligence-token", tt = class {
1096
+ /**
1097
+ * This class is only instantiated by the SDK by calling FriendlyCaptchaSDK.attach()
1098
+ * Do not create a handle manually.
1099
+ *
1100
+ * @internal
1101
+ */
1102
+ constructor(e) {
1103
+ if (this.timeout = null, this.data = null, this.e = e.element, !this.e) throw new Error("No element provided for mounting Risk Intelligence handle.");
1104
+ this.e.frcRiskIntelligence = this, this.formFieldName = e.formFieldName === void 0 ? et : e.formFieldName, this.formFieldName !== null && (this.hiddenFormEl = me(this.e, this.formFieldName)), this.startMode = e.startMode || "focus", this.requestRiskIntelligence = e.riskIntelligence, this.handleStartMode();
1105
+ }
1106
+ handleStartMode() {
1107
+ if (this.startMode === "none")
1108
+ console.warn('Risk Intelligence <div> found with data-start="none" (no-op), skipping...', this.e);
1109
+ else if (this.startMode === "auto")
1110
+ this.request();
1111
+ else {
1112
+ const e = he(this.e);
1113
+ e ? fe(e, () => {
1114
+ this.request();
1115
+ }) : console.warn(
1116
+ 'Risk Intelligence <div> with startMode of "focus" found without a parent <form> element, skipping...',
1117
+ this.e
1118
+ );
1119
+ }
1120
+ }
1121
+ request() {
1122
+ this.requestRiskIntelligence().then((e) => {
1123
+ this.timeout !== null && clearTimeout(this.timeout), this.timeout = setTimeout(() => {
1124
+ W(this.e, {
1125
+ name: "frc:riskintelligence.expire"
1126
+ });
1127
+ }, e.expiresAt - Date.now()), this.data = {
1128
+ token: e.token,
1129
+ expiresAt: e.expiresAt
1130
+ }, this.hiddenFormEl && (this.hiddenFormEl.value = e.token), W(this.e, {
1131
+ name: "frc:riskintelligence.complete",
1132
+ token: e.token,
1133
+ expiresAt: e.expiresAt
1134
+ });
1135
+ }).catch((e) => {
1136
+ W(this.e, {
1137
+ name: "frc:riskintelligence.error",
1138
+ error: {
1139
+ code: e.code,
1140
+ detail: e.detail
1141
+ }
1142
+ });
1143
+ });
1144
+ }
1145
+ /**
1146
+ * @returns Risk Intelligence data if request is done and `null` if not.
1147
+ */
1148
+ getData() {
1149
+ return this.data;
1150
+ }
1151
+ /**
1152
+ * @returns The HTML element used to configure the Risk Intelligence request.
1153
+ */
1154
+ getElement() {
1155
+ return this.e;
1156
+ }
1157
+ /**
1158
+ * Shorthand for `this.getElement().addEventListener` (that is strictly typed in Typescript)
1159
+ */
1160
+ addEventListener(e, t, n) {
1161
+ this.e.addEventListener(e, t, n);
1162
+ }
1163
+ /**
1164
+ * Shorthand for `this.getElement().removeEventListener` (that is strictly typed in Typescript)
1165
+ */
1166
+ removeEventListener(e, t, n) {
1167
+ this.e.removeEventListener(e, t, n);
1168
+ }
1169
+ };
1170
+ function nt(e) {
1171
+ return e.length === 0 ? [] : [e[0]].concat(ke(e.slice(1)));
1172
+ }
1173
+ function N(e, t) {
1174
+ const n = t.length;
1175
+ if (n === 0) return -1;
1176
+ if (e <= 2 || n === 1) return 0;
1177
+ const i = n - 1, r = e - 2;
1178
+ return r <= i ? r : 1 + Math.floor(Math.random() * i);
1179
+ }
1180
+ function ce(e, t, n) {
1181
+ const i = S(e), r = S(t);
1182
+ let o = C(e, i) ? e.slice(i.length) : e;
1183
+ o.length === 0 ? o = "/" : C(o, "/") || (o = "/" + o);
1184
+ const s = o.indexOf("?") === -1 ? "?" : "&";
1185
+ return r + o + s + "retry=" + n;
1186
+ }
1187
+ var it = "/api/v2/captcha/agent", rt = "/api/v2/captcha/widget", L = "FrcFrameId", le = "FrcAgentOriginKey", ot = 1e3 * 60 * 60 * 36, de = 5, B, I = 0, st = class {
1188
+ constructor(e = {}) {
1189
+ if (this.agents = /* @__PURE__ */ new Map(), this.agentState = /* @__PURE__ */ new Map(), this.widgets = /* @__PURE__ */ new Map(), this._attached = M(), this.attached = this._attached.promise, this.riskIntelligencePromises = /* @__PURE__ */ new Map(), this.clearRiskIntelligencePromises = /* @__PURE__ */ new Map(), this.riskIntelligenceHandles = [], this.apiEndpoint = e.apiEndpoint, B = B || new Ae(), B.listen((t) => this.onReceiveMessage(t)), this.bus = B, I++, I > 1 && console.warn(
1190
+ "Multiple Friendly Captcha SDKs created, this is not recommended. Please use a single SDK instance."
1191
+ ), this.signals = Ue({
1192
+ disableEvalPatching: e.disableEvalPatching || Ge()
1193
+ }), e.startAgent) {
1194
+ const t = O(this.apiEndpoint || T()), n = this.getRetryOrigins(t);
1195
+ this.ensureAgentIFrame(n);
1196
+ }
1197
+ this.setupPeriodicRefresh();
1198
+ }
1199
+ getRetryOrigins(e) {
1200
+ return nt(e);
1201
+ }
1202
+ onReceiveMessage(e) {
1203
+ if (e.type === "root_set_response") {
1204
+ const t = this.widgets.get(e.widget_id);
1205
+ if (!t) {
1206
+ I === 1 && console.warn(`Received set response message for widget ${e.widget_id} that doesn't exist`);
1207
+ return;
1208
+ }
1209
+ t.setState(e);
1210
+ } else if (C(e.type, "root_store"))
1211
+ this.handleStoreMessage(e);
1212
+ else if (e.type === "root_signals_get")
1213
+ this.handleSignalsGetMessage(e);
1214
+ else if (e.type === "widget_language_change")
1215
+ this.handleWidgetLanguageChange(e);
1216
+ else if (e.type === "widget_reset") {
1217
+ const t = this.widgets.get(e.from_id);
1218
+ if (!t) {
1219
+ I === 1 && console.warn(`Received reset message for widget ${e.from_id} that doesn't exist`);
1220
+ return;
1221
+ }
1222
+ t.reset({ trigger: "widget" });
1223
+ } else C(e.type, "root_risk_intelligence") && this.handleRiskIntelligenceMessage(e);
1224
+ }
1225
+ handleRiskIntelligenceMessage(e) {
1226
+ if (e.type === "root_risk_intelligence_generate_reply") {
1227
+ const t = this.riskIntelligencePromises.get(e.uid);
1228
+ t ? (e.data ? t.resolve(e.data) : e.error ? t.reject(e.error) : console.warn("Received risk intelligence generate reply message with no data"), this.riskIntelligencePromises.delete(e.uid)) : console.warn("Received risk intelligence generate reply message with no promise to resolve");
1229
+ } else if (e.type === "root_risk_intelligence_clear_reply") {
1230
+ const t = this.clearRiskIntelligencePromises.get(e.uid);
1231
+ t ? e.error ? t.reject(e.error) : t.resolve() : console.warn("Received risk intelligence clear reply message with no promise to resolve"), this.clearRiskIntelligencePromises.delete(e.uid);
1232
+ }
1233
+ }
1234
+ handleWidgetLanguageChange(e) {
1235
+ const t = this.widgets.get(e.from_id);
1236
+ if (!t) {
1237
+ I === 1 && console.warn(`Received language change message for widget ${e.from_id} that doesn't exist`);
1238
+ return;
1239
+ }
1240
+ const n = t.getElement(), i = n.querySelector("iframe");
1241
+ i && (i.title = pe(e.language));
1242
+ const r = n.querySelector(".frc-banner");
1243
+ if (r) {
1244
+ const o = r.style;
1245
+ V(e.language) ? (o.left = "6px", o.right = "auto") : (o.left = "auto", o.right = "6px");
1246
+ }
1247
+ }
1248
+ handleSignalsGetMessage(e) {
1249
+ const t = this.signals.get(e.widget_id);
1250
+ this.bus.send({
1251
+ type: "root_signals_get_reply",
1252
+ from_id: "",
1253
+ to_id: e.from_id,
1254
+ _frc: 1,
1255
+ rid: e.rid,
1256
+ value: t
1257
+ });
1258
+ }
1259
+ handleStoreMessage(e) {
1260
+ const t = e.from_id, n = this.agentState.get(t);
1261
+ if (!n) {
1262
+ console.error(`Store not found ${t}`);
1263
+ return;
1264
+ }
1265
+ e.type === "root_store_get" ? this.bus.send({
1266
+ type: "root_store_get_reply",
1267
+ from_id: "",
1268
+ to_id: t,
1269
+ _frc: 1,
1270
+ rid: e.rid,
1271
+ value: n.store.get(e.key),
1272
+ sa: !0
1273
+ // Backwards compatibility: we always say that storage access is possible.
1274
+ }) : e.type === "root_store_set" && (n.store.set(e.key, e.value), this.bus.send({
1275
+ type: "root_store_set_reply",
1276
+ from_id: "",
1277
+ to_id: t,
1278
+ _frc: 1,
1279
+ rid: e.rid,
1280
+ sa: !0
1281
+ // Backwards compatibility: we always say that storage access is possible.
1282
+ }));
1283
+ }
1284
+ /**
1285
+ * Ensures an agent iframe exists for the configured primary origin in `retryOrigins`.
1286
+ *
1287
+ * Reuses an existing iframe when possible (within this SDK instance and across SDK
1288
+ * instances on the same page), otherwise creates and registers a new one with retry
1289
+ * failover across `retryOrigins`.
1290
+ *
1291
+ * @param retryOrigins - Ordered retry origins with the primary origin at index 0.
1292
+ * @returns String - The agent ID for the reused or newly created iframe.
1293
+ */
1294
+ ensureAgentIFrame(e) {
1295
+ let t = 1;
1296
+ const n = N(t, e), i = e[n], r = i + it, o = de, s = this.agents.get(i);
1297
+ if (s && s.dataset[L])
1298
+ return s.dataset[L];
1299
+ let u = document.getElementsByClassName(ve);
1300
+ for (let d = 0; d < u.length; d++) {
1301
+ const h = u[d];
1302
+ if (h.dataset[le] === i && h.dataset[L])
1303
+ return this.agents.set(i, h), h.dataset[L];
1304
+ }
1305
+ const c = "a_" + D(12), a = Pe(this, c, r);
1306
+ a.dataset[le] = i;
1307
+ const m = a.src;
1308
+ let f = i;
1309
+ this.agents.set(i, a), this.agentState.set(c, { store: new xe(i), origin: i }), document.body.appendChild(a);
1310
+ const g = () => {
1311
+ this.bus.registerTargetIFrame("agent", c, a, this.getRetryTimeout(t)).then((d) => {
1312
+ if (d === "timeout") {
1313
+ if (t >= o) {
1314
+ console.error(`[Friendly Captcha] Failed to load agent iframe after ${t - 1} retries.`), a.remove(), this.agents.delete(i);
1315
+ return;
1316
+ }
1317
+ const h = t + 1, l = N(h, e);
1318
+ f = e[l] || f, console.warn("[Friendly Captcha] Retrying agent iframe load."), a.src = ce(m, f, h - 1), t = h, g();
1319
+ }
1320
+ });
1321
+ };
1322
+ return g(), c;
1323
+ }
1324
+ /**
1325
+ * @internal
1326
+ */
1327
+ setupPeriodicRefresh() {
1328
+ let e = 1;
1329
+ setInterval(() => {
1330
+ const t = "&expire=" + e++;
1331
+ this.agents.forEach((n, i) => {
1332
+ n.src += t;
1333
+ }), this.widgets.forEach((n, i) => {
1334
+ const r = n.getElement().querySelector("iframe");
1335
+ r.src += t;
1336
+ });
1337
+ }, ot);
1338
+ }
1339
+ /**
1340
+ * @internal
1341
+ */
1342
+ getRetryTimeout(e) {
1343
+ return (1.5 + Math.pow(e, 1.8)) * 1e3;
1344
+ }
1345
+ /**
1346
+ * Attaches a widget to given element or elements if they are not attached to yet.
1347
+ *
1348
+ * You can pass one or more HTML elements to attach to, or undefined. If `undefined` is passed, the HTML page is scanned
1349
+ * for unattached widget elements (= elements with the `frc-captcha` class).
1350
+ *
1351
+ * Returns handles to the newly-attached elements.
1352
+ * @public
1353
+ */
1354
+ attach(e) {
1355
+ const [t, n] = _e();
1356
+ for (let o = 0; o < n.length; o++) {
1357
+ const s = n[o];
1358
+ if (s && !s.frcRiskIntelligence) {
1359
+ const u = s.dataset, c = u.sitekey;
1360
+ if (!c) {
1361
+ console.warn("Risk Intelligence <div> found with no sitekey, skipping...", s);
1362
+ continue;
1363
+ }
1364
+ this.riskIntelligenceHandles.push(
1365
+ new tt({
1366
+ element: s,
1367
+ formFieldName: u.formFieldName,
1368
+ startMode: u.start,
1369
+ riskIntelligence: () => this.riskIntelligence({
1370
+ sitekey: c,
1371
+ apiEndpoint: u.apiEndpoint
1372
+ })
1373
+ })
1374
+ );
1375
+ }
1376
+ }
1377
+ e === void 0 && (e = t), Array.isArray(e) || e instanceof NodeList || (e = [e]);
1378
+ const i = [];
1379
+ for (let o = 0; o < e.length; o++) {
1380
+ const s = e[o];
1381
+ if (s && !s.frcWidget) {
1382
+ const u = s.dataset, c = {
1383
+ element: s,
1384
+ sitekey: u.sitekey,
1385
+ formFieldName: u.formFieldName,
1386
+ apiEndpoint: u.apiEndpoint,
1387
+ language: u.lang,
1388
+ theme: u.theme,
1389
+ // Perhaps we should we check for valid values?
1390
+ startMode: u.start
1391
+ // Perhaps we should we check for valid values?
1392
+ };
1393
+ i.push(this.createWidget(c));
1394
+ }
1395
+ }
1396
+ const r = this.getAllWidgets();
1397
+ return this._attached.resolve(r), this.attached = Promise.resolve(r), i;
1398
+ }
1399
+ /**
1400
+ * Creates a Friendly Captcha widget with given options under given HTML element.
1401
+ * @public
1402
+ */
1403
+ createWidget(e) {
1404
+ const t = O(e.apiEndpoint || this.apiEndpoint || T()), n = this.getRetryOrigins(t);
1405
+ let i = 1;
1406
+ this.bus.addOrigins(t);
1407
+ const r = n[N(i, n)] || t[0], o = this.ensureAgentIFrame(n), s = "w_" + D(12), u = (w) => {
1408
+ const v = { from_id: s, to_id: o, _frc: 1 };
1409
+ this.bus.send(J(v, w));
1410
+ }, c = {
1411
+ onDestroy: () => {
1412
+ u({ type: "root_destroy_widget" }), this.bus.removeTarget(s), this.widgets.delete(s), e.element.innerHTML = "", Se(e.element);
1413
+ },
1414
+ onReset: () => {
1415
+ u({ type: "root_reset_widget" });
1416
+ },
1417
+ onTrigger: (w) => {
1418
+ u({ type: "root_trigger_widget", trigger: w.trigger });
1419
+ }
1420
+ }, a = M(), m = new He({
1421
+ id: s,
1422
+ createOpts: e,
1423
+ callbacks: c,
1424
+ registered: a.promise
1425
+ });
1426
+ this.widgets.set(s, m);
1427
+ const f = r + rt, g = Ne(o, s, f, e), d = de, h = g.src;
1428
+ let l = r;
1429
+ const p = Le(e);
1430
+ Ce(e.element), Be(e);
1431
+ let x = Z(e);
1432
+ V(x) && (e.element.dir = "rtl");
1433
+ const A = p.style;
1434
+ p.textContent = Y(x, "connecting");
1435
+ function k(w) {
1436
+ const v = Qe(
1437
+ JSON.stringify({
1438
+ sdk_v: "1.0.0",
1439
+ sitekey: e.sitekey || "",
1440
+ retry: i + "",
1441
+ endpoint: l,
1442
+ ua: navigator.userAgent,
1443
+ tz: Ze() || ""
1444
+ })
1445
+ );
1446
+ let _ = ".ERROR.UNREACHABLE";
1447
+ v && (_ += "~" + v), m.setState({
1448
+ state: "error",
1449
+ response: _,
1450
+ error: { code: "network_error", detail: w }
1451
+ });
1452
+ }
1453
+ const E = () => {
1454
+ this.bus.registerTargetIFrame("widget", s, g, this.getRetryTimeout(i)).then((w) => {
1455
+ if (w === "timeout") {
1456
+ if (i >= d) {
1457
+ console.error(`[Friendly Captcha] Failed to load widget iframe after ${i - 1} retries.`), k("Widget load timeout, stopped retrying"), A.borderColor = "#f00", A.fontSize = "12px", We(p, S(g.src), x);
1458
+ return;
1459
+ }
1460
+ const v = i + 1, _ = N(v, n);
1461
+ l = n[_] || l, A.backgroundColor = "#fee", A.color = "#222", p.textContent = Y(x, "retrying") + ` (${i})`, console.warn(`[Friendly Captcha] Retrying widget ${s} iframe load.`), k("Widget load timeout, will retry"), g.src = ce(h, l, v - 1), i = v, E();
1462
+ } else w === "registered" && (e.element.removeChild(p), g.style.display = "");
1463
+ });
1464
+ };
1465
+ return E(), a.resolve(), m;
1466
+ }
1467
+ /**
1468
+ * Creates a Risk Intelligence token generation request, returning a Promise that resolves
1469
+ * to the generated token.
1470
+ *
1471
+ * @public
1472
+ */
1473
+ riskIntelligence(e) {
1474
+ const t = O(e.apiEndpoint || this.apiEndpoint || T()), n = this.getRetryOrigins(t);
1475
+ this.bus.addOrigins(t);
1476
+ const i = this.ensureAgentIFrame(n), r = D(8);
1477
+ this.bus.send({
1478
+ type: "root_risk_intelligence_generate",
1479
+ to_id: i,
1480
+ from_id: "",
1481
+ _frc: 1,
1482
+ sitekey: e.sitekey,
1483
+ bypassCache: e.bypassCache || !1,
1484
+ uid: r
1485
+ });
1486
+ const o = M();
1487
+ return this.riskIntelligencePromises.set(r, o), o.promise;
1488
+ }
1489
+ /**
1490
+ * Clears cached Risk Intelligence tokens. Cached tokens for a given sitekey can be cleared
1491
+ * by specifying it; if a sitekey is not specified, all tokens will be cleared from the cache.
1492
+ *
1493
+ * @public
1494
+ */
1495
+ clearRiskIntelligence(e) {
1496
+ const t = O(e?.apiEndpoint || this.apiEndpoint || T()), n = this.getRetryOrigins(t);
1497
+ this.bus.addOrigins(t);
1498
+ const i = this.ensureAgentIFrame(n), r = D(8);
1499
+ this.bus.send({
1500
+ type: "root_risk_intelligence_clear",
1501
+ to_id: i,
1502
+ from_id: "",
1503
+ _frc: 1,
1504
+ sitekey: e?.sitekey,
1505
+ uid: r
1506
+ });
1507
+ const o = M();
1508
+ return this.clearRiskIntelligencePromises.set(r, o), o.promise;
1509
+ }
1510
+ /**
1511
+ * Returns all current widgets known about (in an unspecified order).
1512
+ * @public
1513
+ */
1514
+ getAllWidgets() {
1515
+ const e = [];
1516
+ return this.widgets.forEach((t) => {
1517
+ e.push(t);
1518
+ }), e;
1519
+ }
1520
+ /**
1521
+ * Retrieves a widget by its widget ID.
1522
+ * @public
1523
+ */
1524
+ getWidgetById(e) {
1525
+ return this.widgets.get(e);
1526
+ }
1527
+ /**
1528
+ * Returns all current Risk Intelligence handles known about (in an unspecified order).
1529
+ * @public
1530
+ */
1531
+ getAllRiskIntelligenceHandles() {
1532
+ const e = [];
1533
+ return this.riskIntelligenceHandles.forEach((t) => {
1534
+ e.push(t);
1535
+ }), e;
1536
+ }
1537
+ /**
1538
+ * Completely remove all widgets and background agents related to the SDK on this page.
1539
+ * @public
1540
+ */
1541
+ clear() {
1542
+ this.widgets.forEach((e) => {
1543
+ e.destroy();
1544
+ }), this.agents.forEach((e) => {
1545
+ e.remove();
1546
+ }), this.agents.clear();
1547
+ }
1548
+ }, ut = "frc:widget.statechange", at = "frc:widget.complete", ct = "frc:widget.expire", lt = "frc:widget.error", dt = "frc:widget.reset", gt = "frc:riskintelligence.complete", ht = "frc:riskintelligence.error", ft = "frc:riskintelligence.expire";
1549
+ export {
1550
+ gt as FRCRiskIntelligenceCompleteEventName,
1551
+ ht as FRCRiskIntelligenceErrorEventName,
1552
+ ft as FRCRiskIntelligenceExpireEventName,
1553
+ at as FRCWidgetCompleteEventName,
1554
+ lt as FRCWidgetErrorEventName,
1555
+ ct as FRCWidgetExpireEventName,
1556
+ dt as FRCWidgetResetEventName,
1557
+ ut as FRCWidgetStateChangeEventName,
1558
+ st as FriendlyCaptchaSDK
1559
+ };