@verbb/formie-browser 1.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 (490) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE.md +40 -0
  3. package/README.md +34 -0
  4. package/dist/chunks/address-finder-DfMCiW89.js +47 -0
  5. package/dist/chunks/api-CbqEMQT5.js +181 -0
  6. package/dist/chunks/api-DE7LfK-R.js +960 -0
  7. package/dist/chunks/api-DOfDzYC_.js +538 -0
  8. package/dist/chunks/async-B3DUf1GZ.js +26 -0
  9. package/dist/chunks/bpoint-Ciy3yY9Q.js +34 -0
  10. package/dist/chunks/calculations-CkYAqO_-.js +197 -0
  11. package/dist/chunks/captcha-eu-DnOWhMwr.js +43 -0
  12. package/dist/chunks/checkbox-radio-0x7Tc0br.js +197 -0
  13. package/dist/chunks/chunk-K6L4z4UQ.js +24 -0
  14. package/dist/chunks/conditions-4fXKhEJS.js +609 -0
  15. package/dist/chunks/date-picker-B6iZkjHS.js +6204 -0
  16. package/dist/chunks/debug-KnZeKYBI.js +39 -0
  17. package/dist/chunks/dist-D09GnXMW.js +2663 -0
  18. package/dist/chunks/event-names-DamGPtXR.js +51 -0
  19. package/dist/chunks/eway-DEAYcwT0.js +86 -0
  20. package/dist/chunks/field-references.keys-BpBZ_quS.js +24 -0
  21. package/dist/chunks/field-references.resolver-Ba6xhiJC.js +183 -0
  22. package/dist/chunks/file-upload-Bh63PQSE.js +430 -0
  23. package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +40 -0
  24. package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +47 -0
  25. package/dist/chunks/friendly-challenge-Dg8XkStd.js +1101 -0
  26. package/dist/chunks/go-cardless-CuND59rR.js +26 -0
  27. package/dist/chunks/google-address--uR8WDSm.js +208 -0
  28. package/dist/chunks/hcaptcha-CmaFUesv.js +72 -0
  29. package/dist/chunks/hidden-CYnZYple.js +36 -0
  30. package/dist/chunks/http-18nn97DZ.js +29 -0
  31. package/dist/chunks/i18n-vUh-KGiH.js +55 -0
  32. package/dist/chunks/loqate-BICNJlVK.js +97 -0
  33. package/dist/chunks/mollie-DwlsgHZ1.js +26 -0
  34. package/dist/chunks/moneris-B_IFZFTx.js +159 -0
  35. package/dist/chunks/opayo-U2x_TOII.js +192 -0
  36. package/dist/chunks/paddle-BqXFrc79.js +75 -0
  37. package/dist/chunks/paypal-Cn_DYGDb.js +121 -0
  38. package/dist/chunks/payway-Rnq796eC.js +75 -0
  39. package/dist/chunks/phone-country-B6Me4lK0.js +3317 -0
  40. package/dist/chunks/place-kit-ldUl-u9w.js +56 -0
  41. package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +1771 -0
  42. package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +72 -0
  43. package/dist/chunks/recaptcha-shared-DTI4qWVR.js +22 -0
  44. package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +49 -0
  45. package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +62 -0
  46. package/dist/chunks/recaptcha-v3-EAlWhnkX.js +33 -0
  47. package/dist/chunks/repeater-CXD1eLSn.js +151 -0
  48. package/dist/chunks/rich-text-DkmZRhGj.js +442 -0
  49. package/dist/chunks/scripts-BGD_iU_6.js +41 -0
  50. package/dist/chunks/sdk-B7u9fTlP.js +2103 -0
  51. package/dist/chunks/shared-DC6_1u8X.js +85 -0
  52. package/dist/chunks/signature-E9KyYXS1.js +765 -0
  53. package/dist/chunks/snaptcha-CCDunGeb.js +8 -0
  54. package/dist/chunks/square-BLqK51rS.js +61 -0
  55. package/dist/chunks/stripe-B8gHpZNC.js +273 -0
  56. package/dist/chunks/styles-BIh6g7V_.js +22 -0
  57. package/dist/chunks/summary-EcNE0cvg.js +191 -0
  58. package/dist/chunks/table-yxEDL6kA.js +124 -0
  59. package/dist/chunks/text-limit-D0H_Ca2c.js +179 -0
  60. package/dist/chunks/theme-classes-vSHpdCUO.js +59 -0
  61. package/dist/chunks/turnstile-DP0bdR7T.js +68 -0
  62. package/dist/chunks/utils-ByrEVYrJ.js +49584 -0
  63. package/dist/css/formie-base.css +78 -0
  64. package/dist/css/formie-theme.css +19 -0
  65. package/dist/css/formie.css +2 -0
  66. package/dist/css/theme/_buttons.css +249 -0
  67. package/dist/css/theme/_loading.css +37 -0
  68. package/dist/css/theme/_messages.css +39 -0
  69. package/dist/css/theme/_progress.css +62 -0
  70. package/dist/css/theme/_tokens.css +361 -0
  71. package/dist/css/theme/_typography.css +70 -0
  72. package/dist/css/theme/fields/_address.css +17 -0
  73. package/dist/css/theme/fields/_check-radio.css +108 -0
  74. package/dist/css/theme/fields/_file.css +58 -0
  75. package/dist/css/theme/fields/_group.css +13 -0
  76. package/dist/css/theme/fields/_input.css +48 -0
  77. package/dist/css/theme/fields/_nested.css +19 -0
  78. package/dist/css/theme/fields/_repeater.css +69 -0
  79. package/dist/css/theme/fields/_rich-text.css +201 -0
  80. package/dist/css/theme/fields/_select.css +37 -0
  81. package/dist/css/theme/fields/_signature.css +39 -0
  82. package/dist/css/theme/fields/_summary.css +53 -0
  83. package/dist/css/theme/fields/_table.css +121 -0
  84. package/dist/css/theme/fields/_text-limit.css +10 -0
  85. package/dist/css/theme/forms/_field.css +62 -0
  86. package/dist/css/theme/forms/_form.css +166 -0
  87. package/dist/css/theme/integrations/_payment-modal.css +32 -0
  88. package/dist/css/theme/integrations/_paypal.css +10 -0
  89. package/dist/css/theme/integrations/_payway.css +10 -0
  90. package/dist/css/theme/integrations/_stripe.css +24 -0
  91. package/dist/css/theme/utilities/_accessibility.css +13 -0
  92. package/dist/css/theme-base/_controls.css +41 -0
  93. package/dist/css/theme-base/_primitives.css +34 -0
  94. package/dist/index.d.ts +30 -0
  95. package/dist/index.d.ts.map +1 -0
  96. package/dist/index.js +3206 -0
  97. package/dist/js/compatibility/dom-adapter.d.ts +12 -0
  98. package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
  99. package/dist/js/compatibility/event-map.d.ts +25 -0
  100. package/dist/js/compatibility/event-map.d.ts.map +1 -0
  101. package/dist/js/compatibility/validator-adapter.d.ts +17 -0
  102. package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
  103. package/dist/js/contracts/client.d.ts +40 -0
  104. package/dist/js/contracts/client.d.ts.map +1 -0
  105. package/dist/js/contracts/common.d.ts +5 -0
  106. package/dist/js/contracts/common.d.ts.map +1 -0
  107. package/dist/js/contracts/modules.d.ts +47 -0
  108. package/dist/js/contracts/modules.d.ts.map +1 -0
  109. package/dist/js/contracts/schema.d.ts +79 -0
  110. package/dist/js/contracts/schema.d.ts.map +1 -0
  111. package/dist/js/contracts/theme.d.ts +2 -0
  112. package/dist/js/contracts/theme.d.ts.map +1 -0
  113. package/dist/js/core/create-formie-client.d.ts +3 -0
  114. package/dist/js/core/create-formie-client.d.ts.map +1 -0
  115. package/dist/js/core/dom-events.d.ts +2 -0
  116. package/dist/js/core/dom-events.d.ts.map +1 -0
  117. package/dist/js/core/formie.d.ts +27 -0
  118. package/dist/js/core/formie.d.ts.map +1 -0
  119. package/dist/js/core/hydrate-modules.d.ts +22 -0
  120. package/dist/js/core/hydrate-modules.d.ts.map +1 -0
  121. package/dist/js/core/page-client-event.d.ts +9 -0
  122. package/dist/js/core/page-client-event.d.ts.map +1 -0
  123. package/dist/js/core/page-tab-errors.d.ts +2 -0
  124. package/dist/js/core/page-tab-errors.d.ts.map +1 -0
  125. package/dist/js/core/submit-flow.d.ts +21 -0
  126. package/dist/js/core/submit-flow.d.ts.map +1 -0
  127. package/dist/js/core/submit-result-state.d.ts +8 -0
  128. package/dist/js/core/submit-result-state.d.ts.map +1 -0
  129. package/dist/js/core/submit-result-ui.d.ts +10 -0
  130. package/dist/js/core/submit-result-ui.d.ts.map +1 -0
  131. package/dist/js/events/event-bus.d.ts +21 -0
  132. package/dist/js/events/event-bus.d.ts.map +1 -0
  133. package/dist/js/modules/address/address-finder.d.ts +2 -0
  134. package/dist/js/modules/address/address-finder.d.ts.map +1 -0
  135. package/dist/js/modules/address/api.d.ts +8 -0
  136. package/dist/js/modules/address/api.d.ts.map +1 -0
  137. package/dist/js/modules/address/constants.d.ts +15 -0
  138. package/dist/js/modules/address/constants.d.ts.map +1 -0
  139. package/dist/js/modules/address/factories.d.ts +35 -0
  140. package/dist/js/modules/address/factories.d.ts.map +1 -0
  141. package/dist/js/modules/address/google-address.d.ts +2 -0
  142. package/dist/js/modules/address/google-address.d.ts.map +1 -0
  143. package/dist/js/modules/address/host.d.ts +30 -0
  144. package/dist/js/modules/address/host.d.ts.map +1 -0
  145. package/dist/js/modules/address/index.d.ts +3 -0
  146. package/dist/js/modules/address/index.d.ts.map +1 -0
  147. package/dist/js/modules/address/loqate.d.ts +2 -0
  148. package/dist/js/modules/address/loqate.d.ts.map +1 -0
  149. package/dist/js/modules/address/place-kit.d.ts +2 -0
  150. package/dist/js/modules/address/place-kit.d.ts.map +1 -0
  151. package/dist/js/modules/captchas/api.d.ts +9 -0
  152. package/dist/js/modules/captchas/api.d.ts.map +1 -0
  153. package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
  154. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
  155. package/dist/js/modules/captchas/constants.d.ts +5 -0
  156. package/dist/js/modules/captchas/constants.d.ts.map +1 -0
  157. package/dist/js/modules/captchas/factories.d.ts +63 -0
  158. package/dist/js/modules/captchas/factories.d.ts.map +1 -0
  159. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
  160. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
  161. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
  162. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
  163. package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
  164. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
  165. package/dist/js/modules/captchas/host.d.ts +78 -0
  166. package/dist/js/modules/captchas/host.d.ts.map +1 -0
  167. package/dist/js/modules/captchas/index.d.ts +3 -0
  168. package/dist/js/modules/captchas/index.d.ts.map +1 -0
  169. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
  170. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
  171. package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
  172. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
  173. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
  174. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
  175. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
  176. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
  177. package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
  178. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
  179. package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
  180. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
  181. package/dist/js/modules/captchas/turnstile.d.ts +2 -0
  182. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
  183. package/dist/js/modules/captchas/utils.d.ts +13 -0
  184. package/dist/js/modules/captchas/utils.d.ts.map +1 -0
  185. package/dist/js/modules/fields/calculations.d.ts +3 -0
  186. package/dist/js/modules/fields/calculations.d.ts.map +1 -0
  187. package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
  188. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
  189. package/dist/js/modules/fields/conditions/config.d.ts +5 -0
  190. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
  191. package/dist/js/modules/fields/conditions/effects.d.ts +2 -0
  192. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
  193. package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
  194. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
  195. package/dist/js/modules/fields/conditions/references.d.ts +5 -0
  196. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
  197. package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
  198. package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
  199. package/dist/js/modules/fields/conditions/types.d.ts +30 -0
  200. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
  201. package/dist/js/modules/fields/conditions/values.d.ts +5 -0
  202. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
  203. package/dist/js/modules/fields/conditions.d.ts +3 -0
  204. package/dist/js/modules/fields/conditions.d.ts.map +1 -0
  205. package/dist/js/modules/fields/date-picker.d.ts +3 -0
  206. package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
  207. package/dist/js/modules/fields/file-upload.d.ts +3 -0
  208. package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
  209. package/dist/js/modules/fields/hidden.d.ts +3 -0
  210. package/dist/js/modules/fields/hidden.d.ts.map +1 -0
  211. package/dist/js/modules/fields/index.d.ts +3 -0
  212. package/dist/js/modules/fields/index.d.ts.map +1 -0
  213. package/dist/js/modules/fields/phone-country.d.ts +3 -0
  214. package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
  215. package/dist/js/modules/fields/repeater.d.ts +3 -0
  216. package/dist/js/modules/fields/repeater.d.ts.map +1 -0
  217. package/dist/js/modules/fields/rich-text.d.ts +3 -0
  218. package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
  219. package/dist/js/modules/fields/shared.d.ts +20 -0
  220. package/dist/js/modules/fields/shared.d.ts.map +1 -0
  221. package/dist/js/modules/fields/signature.d.ts +3 -0
  222. package/dist/js/modules/fields/signature.d.ts.map +1 -0
  223. package/dist/js/modules/fields/summary.d.ts +3 -0
  224. package/dist/js/modules/fields/summary.d.ts.map +1 -0
  225. package/dist/js/modules/fields/table.d.ts +3 -0
  226. package/dist/js/modules/fields/table.d.ts.map +1 -0
  227. package/dist/js/modules/fields/text-limit.d.ts +3 -0
  228. package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
  229. package/dist/js/modules/loader.d.ts +11 -0
  230. package/dist/js/modules/loader.d.ts.map +1 -0
  231. package/dist/js/modules/payments/api.d.ts +8 -0
  232. package/dist/js/modules/payments/api.d.ts.map +1 -0
  233. package/dist/js/modules/payments/bpoint.d.ts +2 -0
  234. package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
  235. package/dist/js/modules/payments/constants.d.ts +5 -0
  236. package/dist/js/modules/payments/constants.d.ts.map +1 -0
  237. package/dist/js/modules/payments/eway.d.ts +9 -0
  238. package/dist/js/modules/payments/eway.d.ts.map +1 -0
  239. package/dist/js/modules/payments/factories.d.ts +54 -0
  240. package/dist/js/modules/payments/factories.d.ts.map +1 -0
  241. package/dist/js/modules/payments/go-cardless.d.ts +2 -0
  242. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
  243. package/dist/js/modules/payments/host.d.ts +70 -0
  244. package/dist/js/modules/payments/host.d.ts.map +1 -0
  245. package/dist/js/modules/payments/index.d.ts +3 -0
  246. package/dist/js/modules/payments/index.d.ts.map +1 -0
  247. package/dist/js/modules/payments/mollie.d.ts +2 -0
  248. package/dist/js/modules/payments/mollie.d.ts.map +1 -0
  249. package/dist/js/modules/payments/moneris.d.ts +2 -0
  250. package/dist/js/modules/payments/moneris.d.ts.map +1 -0
  251. package/dist/js/modules/payments/opayo.d.ts +25 -0
  252. package/dist/js/modules/payments/opayo.d.ts.map +1 -0
  253. package/dist/js/modules/payments/paddle.d.ts +2 -0
  254. package/dist/js/modules/payments/paddle.d.ts.map +1 -0
  255. package/dist/js/modules/payments/paypal.d.ts +2 -0
  256. package/dist/js/modules/payments/paypal.d.ts.map +1 -0
  257. package/dist/js/modules/payments/payway.d.ts +2 -0
  258. package/dist/js/modules/payments/payway.d.ts.map +1 -0
  259. package/dist/js/modules/payments/square.d.ts +2 -0
  260. package/dist/js/modules/payments/square.d.ts.map +1 -0
  261. package/dist/js/modules/payments/stripe.d.ts +2 -0
  262. package/dist/js/modules/payments/stripe.d.ts.map +1 -0
  263. package/dist/js/modules/payments/utils.d.ts +17 -0
  264. package/dist/js/modules/payments/utils.d.ts.map +1 -0
  265. package/dist/js/modules/registry.d.ts +9 -0
  266. package/dist/js/modules/registry.d.ts.map +1 -0
  267. package/dist/js/modules/styles.d.ts +2 -0
  268. package/dist/js/modules/styles.d.ts.map +1 -0
  269. package/dist/js/submit/pipeline.d.ts +18 -0
  270. package/dist/js/submit/pipeline.d.ts.map +1 -0
  271. package/dist/js/theme/theme-classes.d.ts +10 -0
  272. package/dist/js/theme/theme-classes.d.ts.map +1 -0
  273. package/dist/js/transport/forms-api.d.ts +11 -0
  274. package/dist/js/transport/forms-api.d.ts.map +1 -0
  275. package/dist/js/utils/async.d.ts +8 -0
  276. package/dist/js/utils/async.d.ts.map +1 -0
  277. package/dist/js/utils/debug.d.ts +10 -0
  278. package/dist/js/utils/debug.d.ts.map +1 -0
  279. package/dist/js/utils/event-names.d.ts +13 -0
  280. package/dist/js/utils/event-names.d.ts.map +1 -0
  281. package/dist/js/utils/field-references.d.ts +6 -0
  282. package/dist/js/utils/field-references.d.ts.map +1 -0
  283. package/dist/js/utils/field-references.keys.d.ts +4 -0
  284. package/dist/js/utils/field-references.keys.d.ts.map +1 -0
  285. package/dist/js/utils/field-references.parser.d.ts +3 -0
  286. package/dist/js/utils/field-references.parser.d.ts.map +1 -0
  287. package/dist/js/utils/field-references.registry.d.ts +3 -0
  288. package/dist/js/utils/field-references.registry.d.ts.map +1 -0
  289. package/dist/js/utils/field-references.resolver.d.ts +4 -0
  290. package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
  291. package/dist/js/utils/field-references.types.d.ts +27 -0
  292. package/dist/js/utils/field-references.types.d.ts.map +1 -0
  293. package/dist/js/utils/fields.d.ts +5 -0
  294. package/dist/js/utils/fields.d.ts.map +1 -0
  295. package/dist/js/utils/http.d.ts +9 -0
  296. package/dist/js/utils/http.d.ts.map +1 -0
  297. package/dist/js/utils/i18n.d.ts +7 -0
  298. package/dist/js/utils/i18n.d.ts.map +1 -0
  299. package/dist/js/utils/scripts.d.ts +13 -0
  300. package/dist/js/utils/scripts.d.ts.map +1 -0
  301. package/dist/js/utils/unload-warning.d.ts +10 -0
  302. package/dist/js/utils/unload-warning.d.ts.map +1 -0
  303. package/dist/js/validation/rules/email.d.ts +4 -0
  304. package/dist/js/validation/rules/email.d.ts.map +1 -0
  305. package/dist/js/validation/rules/match.d.ts +4 -0
  306. package/dist/js/validation/rules/match.d.ts.map +1 -0
  307. package/dist/js/validation/rules/number.d.ts +4 -0
  308. package/dist/js/validation/rules/number.d.ts.map +1 -0
  309. package/dist/js/validation/rules/required.d.ts +4 -0
  310. package/dist/js/validation/rules/required.d.ts.map +1 -0
  311. package/dist/js/validation/rules/shared.d.ts +7 -0
  312. package/dist/js/validation/rules/shared.d.ts.map +1 -0
  313. package/dist/js/validation/rules/url.d.ts +4 -0
  314. package/dist/js/validation/rules/url.d.ts.map +1 -0
  315. package/dist/js/validation/rules.d.ts +10 -0
  316. package/dist/js/validation/rules.d.ts.map +1 -0
  317. package/dist/js/validation/types.d.ts +44 -0
  318. package/dist/js/validation/types.d.ts.map +1 -0
  319. package/dist/js/validation/validator.d.ts +53 -0
  320. package/dist/js/validation/validator.d.ts.map +1 -0
  321. package/package.json +78 -0
  322. package/src/css/formie-base.css +78 -0
  323. package/src/css/formie-theme.css +19 -0
  324. package/src/css/formie.css +2 -0
  325. package/src/css/theme/_buttons.css +249 -0
  326. package/src/css/theme/_loading.css +37 -0
  327. package/src/css/theme/_messages.css +39 -0
  328. package/src/css/theme/_progress.css +62 -0
  329. package/src/css/theme/_tokens.css +361 -0
  330. package/src/css/theme/_typography.css +70 -0
  331. package/src/css/theme/fields/_address.css +17 -0
  332. package/src/css/theme/fields/_check-radio.css +108 -0
  333. package/src/css/theme/fields/_file.css +58 -0
  334. package/src/css/theme/fields/_group.css +13 -0
  335. package/src/css/theme/fields/_input.css +48 -0
  336. package/src/css/theme/fields/_nested.css +19 -0
  337. package/src/css/theme/fields/_repeater.css +69 -0
  338. package/src/css/theme/fields/_rich-text.css +201 -0
  339. package/src/css/theme/fields/_select.css +37 -0
  340. package/src/css/theme/fields/_signature.css +39 -0
  341. package/src/css/theme/fields/_summary.css +53 -0
  342. package/src/css/theme/fields/_table.css +121 -0
  343. package/src/css/theme/fields/_text-limit.css +10 -0
  344. package/src/css/theme/forms/_field.css +62 -0
  345. package/src/css/theme/forms/_form.css +166 -0
  346. package/src/css/theme/integrations/_payment-modal.css +32 -0
  347. package/src/css/theme/integrations/_paypal.css +10 -0
  348. package/src/css/theme/integrations/_payway.css +10 -0
  349. package/src/css/theme/integrations/_stripe.css +24 -0
  350. package/src/css/theme/utilities/_accessibility.css +13 -0
  351. package/src/css/theme-base/_controls.css +41 -0
  352. package/src/css/theme-base/_primitives.css +34 -0
  353. package/src/icons/rich-text/aligncenter.svg +6 -0
  354. package/src/icons/rich-text/alignleft.svg +6 -0
  355. package/src/icons/rich-text/alignright.svg +6 -0
  356. package/src/icons/rich-text/bold.svg +4 -0
  357. package/src/icons/rich-text/clear.svg +6 -0
  358. package/src/icons/rich-text/code.svg +4 -0
  359. package/src/icons/rich-text/heading1.svg +3 -0
  360. package/src/icons/rich-text/heading2.svg +3 -0
  361. package/src/icons/rich-text/image.svg +6 -0
  362. package/src/icons/rich-text/italic.svg +5 -0
  363. package/src/icons/rich-text/line.svg +3 -0
  364. package/src/icons/rich-text/link.svg +4 -0
  365. package/src/icons/rich-text/olist.svg +8 -0
  366. package/src/icons/rich-text/paragraph.svg +3 -0
  367. package/src/icons/rich-text/quote.svg +4 -0
  368. package/src/icons/rich-text/strikethrough.svg +4 -0
  369. package/src/icons/rich-text/ulist.svg +8 -0
  370. package/src/icons/rich-text/underline.svg +4 -0
  371. package/src/index.ts +125 -0
  372. package/src/js/compatibility/dom-adapter.ts +129 -0
  373. package/src/js/compatibility/event-map.ts +72 -0
  374. package/src/js/compatibility/validator-adapter.ts +105 -0
  375. package/src/js/contracts/client.ts +43 -0
  376. package/src/js/contracts/common.ts +14 -0
  377. package/src/js/contracts/modules.ts +53 -0
  378. package/src/js/contracts/schema.ts +83 -0
  379. package/src/js/contracts/theme.ts +1 -0
  380. package/src/js/core/create-formie-client.ts +1519 -0
  381. package/src/js/core/dom-events.ts +8 -0
  382. package/src/js/core/formie.ts +242 -0
  383. package/src/js/core/hydrate-modules.ts +102 -0
  384. package/src/js/core/page-client-event.ts +129 -0
  385. package/src/js/core/page-tab-errors.ts +37 -0
  386. package/src/js/core/submit-flow.ts +120 -0
  387. package/src/js/core/submit-result-state.ts +597 -0
  388. package/src/js/core/submit-result-ui.ts +448 -0
  389. package/src/js/events/event-bus.ts +109 -0
  390. package/src/js/modules/address/address-finder.ts +85 -0
  391. package/src/js/modules/address/api.ts +22 -0
  392. package/src/js/modules/address/constants.ts +15 -0
  393. package/src/js/modules/address/factories.ts +203 -0
  394. package/src/js/modules/address/google-address.ts +345 -0
  395. package/src/js/modules/address/host.ts +137 -0
  396. package/src/js/modules/address/index.ts +10 -0
  397. package/src/js/modules/address/loqate.ts +128 -0
  398. package/src/js/modules/address/place-kit.ts +94 -0
  399. package/src/js/modules/captchas/api.ts +25 -0
  400. package/src/js/modules/captchas/captcha-eu.ts +86 -0
  401. package/src/js/modules/captchas/constants.ts +4 -0
  402. package/src/js/modules/captchas/factories.ts +485 -0
  403. package/src/js/modules/captchas/friendly-captcha-v1.ts +65 -0
  404. package/src/js/modules/captchas/friendly-captcha-v2.ts +84 -0
  405. package/src/js/modules/captchas/hcaptcha.ts +153 -0
  406. package/src/js/modules/captchas/host.ts +448 -0
  407. package/src/js/modules/captchas/index.ts +16 -0
  408. package/src/js/modules/captchas/recaptcha-enterprise.ts +138 -0
  409. package/src/js/modules/captchas/recaptcha-shared.ts +69 -0
  410. package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +72 -0
  411. package/src/js/modules/captchas/recaptcha-v2-invisible.ts +108 -0
  412. package/src/js/modules/captchas/recaptcha-v3.ts +62 -0
  413. package/src/js/modules/captchas/snaptcha.ts +10 -0
  414. package/src/js/modules/captchas/turnstile.ts +131 -0
  415. package/src/js/modules/captchas/utils.ts +85 -0
  416. package/src/js/modules/fields/calculations.ts +273 -0
  417. package/src/js/modules/fields/checkbox-radio.ts +295 -0
  418. package/src/js/modules/fields/conditions/config.ts +79 -0
  419. package/src/js/modules/fields/conditions/effects.ts +166 -0
  420. package/src/js/modules/fields/conditions/evaluator.ts +44 -0
  421. package/src/js/modules/fields/conditions/references.ts +165 -0
  422. package/src/js/modules/fields/conditions/transforms.ts +206 -0
  423. package/src/js/modules/fields/conditions/types.ts +33 -0
  424. package/src/js/modules/fields/conditions/values.ts +115 -0
  425. package/src/js/modules/fields/conditions.ts +229 -0
  426. package/src/js/modules/fields/date-picker.ts +272 -0
  427. package/src/js/modules/fields/file-upload.ts +628 -0
  428. package/src/js/modules/fields/hidden.ts +58 -0
  429. package/src/js/modules/fields/index.ts +19 -0
  430. package/src/js/modules/fields/phone-country.ts +226 -0
  431. package/src/js/modules/fields/repeater.ts +231 -0
  432. package/src/js/modules/fields/rich-text.ts +217 -0
  433. package/src/js/modules/fields/shared.ts +238 -0
  434. package/src/js/modules/fields/signature.ts +202 -0
  435. package/src/js/modules/fields/summary.ts +272 -0
  436. package/src/js/modules/fields/table.ts +197 -0
  437. package/src/js/modules/fields/text-limit.ts +280 -0
  438. package/src/js/modules/loader.ts +331 -0
  439. package/src/js/modules/payments/api.ts +20 -0
  440. package/src/js/modules/payments/bpoint.ts +48 -0
  441. package/src/js/modules/payments/constants.ts +17 -0
  442. package/src/js/modules/payments/eway.ts +132 -0
  443. package/src/js/modules/payments/factories.ts +332 -0
  444. package/src/js/modules/payments/go-cardless.ts +37 -0
  445. package/src/js/modules/payments/host.ts +459 -0
  446. package/src/js/modules/payments/index.ts +17 -0
  447. package/src/js/modules/payments/mollie.ts +38 -0
  448. package/src/js/modules/payments/moneris.ts +216 -0
  449. package/src/js/modules/payments/opayo.ts +272 -0
  450. package/src/js/modules/payments/paddle.ts +111 -0
  451. package/src/js/modules/payments/payment.ts +183 -0
  452. package/src/js/modules/payments/paypal.ts +214 -0
  453. package/src/js/modules/payments/payway.ts +114 -0
  454. package/src/js/modules/payments/square.ts +106 -0
  455. package/src/js/modules/payments/stripe.ts +426 -0
  456. package/src/js/modules/payments/stub-payment-module.ts +87 -0
  457. package/src/js/modules/payments/utils.ts +60 -0
  458. package/src/js/modules/registry.ts +38 -0
  459. package/src/js/modules/styles.ts +29 -0
  460. package/src/js/submit/pipeline.ts +514 -0
  461. package/src/js/theme/theme-classes.ts +106 -0
  462. package/src/js/transport/forms-api.ts +345 -0
  463. package/src/js/utils/async.ts +81 -0
  464. package/src/js/utils/debug.ts +59 -0
  465. package/src/js/utils/event-names.ts +60 -0
  466. package/src/js/utils/field-references.keys.ts +47 -0
  467. package/src/js/utils/field-references.parser.ts +121 -0
  468. package/src/js/utils/field-references.registry.ts +50 -0
  469. package/src/js/utils/field-references.resolver.ts +115 -0
  470. package/src/js/utils/field-references.ts +11 -0
  471. package/src/js/utils/field-references.types.ts +31 -0
  472. package/src/js/utils/fields.ts +58 -0
  473. package/src/js/utils/http.ts +51 -0
  474. package/src/js/utils/i18n.ts +98 -0
  475. package/src/js/utils/scripts.ts +84 -0
  476. package/src/js/utils/unload-warning.ts +190 -0
  477. package/src/js/validation/rules/email.ts +18 -0
  478. package/src/js/validation/rules/match.ts +26 -0
  479. package/src/js/validation/rules/minmax.ts +47 -0
  480. package/src/js/validation/rules/number.ts +55 -0
  481. package/src/js/validation/rules/pattern.ts +29 -0
  482. package/src/js/validation/rules/required.ts +30 -0
  483. package/src/js/validation/rules/shared.ts +47 -0
  484. package/src/js/validation/rules/url.ts +23 -0
  485. package/src/js/validation/rules.ts +16 -0
  486. package/src/js/validation/types.ts +50 -0
  487. package/src/js/validation/validator.ts +643 -0
  488. package/src/vendor.d.ts +100 -0
  489. package/src/vite-env.d.ts +22 -0
  490. package/vite-dev.mjs +22 -0
@@ -0,0 +1,2663 @@
1
+ //#region ../formie-core/dist/index.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
3
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
+ get: ((e) => i[e]).bind(null, d),
5
+ enumerable: !(s = n(i, d)) || s.enumerable
6
+ });
7
+ return e;
8
+ }, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
9
+ value: n,
10
+ enumerable: !0
11
+ }) : a, n));
12
+ function l(e) {
13
+ return Array.isArray(e) ? e.map((e) => String(e ?? "")) : [String(e ?? "")];
14
+ }
15
+ function u(e, t) {
16
+ return e.some((e) => t.includes(e));
17
+ }
18
+ function d(e, t) {
19
+ return e.some((e) => t.some((t) => t === e || t.includes(e)));
20
+ }
21
+ function f(e, t, n) {
22
+ return t.some((t) => e.some((e) => n(e, t)));
23
+ }
24
+ function p(e, t, n) {
25
+ return t.some((t) => {
26
+ let r = Number.parseFloat(t);
27
+ return Number.isFinite(r) ? e.some((e) => {
28
+ let t = Number.parseFloat(e);
29
+ return Number.isFinite(t) ? n(t, r) : !1;
30
+ }) : !1;
31
+ });
32
+ }
33
+ function m(e) {
34
+ return e.length === 0 || e.every((e) => e.trim() === "");
35
+ }
36
+ function h(e, t, n = {}) {
37
+ let r = String(e.condition || ""), i = l(e.value), a = n.visibility ?? null;
38
+ switch (r) {
39
+ case "=": return u(i, t);
40
+ case "!=": return !u(i, t);
41
+ case ">": return p(t, i, (e, t) => e > t);
42
+ case "<": return p(t, i, (e, t) => e < t);
43
+ case "contains": return d(i, t);
44
+ case "notContains": return !d(i, t);
45
+ case "startsWith": return f(t, i, (e, t) => e.startsWith(t));
46
+ case "endsWith": return f(t, i, (e, t) => e.endsWith(t));
47
+ case "empty": return m(t);
48
+ case "notEmpty": return !m(t);
49
+ case "visible": return a === !0;
50
+ case "hidden": return a === !1;
51
+ default: return !1;
52
+ }
53
+ }
54
+ function g(e, t) {
55
+ let n = e.conditionRule === "any" ? t.includes(!0) : t.every((e) => e === !0);
56
+ return {
57
+ finalResult: n,
58
+ shouldHide: n && e.showRule !== "show" || !n && e.showRule === "show"
59
+ };
60
+ }
61
+ var H = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
62
+ (function(n, r) {
63
+ typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r((n = typeof globalThis < "u" ? globalThis : n || self).ExpressionLanguage = {});
64
+ })(e, function(e) {
65
+ function t(e, t, n) {
66
+ return (t = function(e) {
67
+ var t = function(e, t) {
68
+ if (typeof e != "object" || !e) return e;
69
+ var n = e[Symbol.toPrimitive];
70
+ if (n !== void 0) {
71
+ var r = n.call(e, t);
72
+ if (typeof r != "object") return r;
73
+ throw TypeError("@@toPrimitive must return a primitive value.");
74
+ }
75
+ return (t === "string" ? String : Number)(e);
76
+ }(e, "string");
77
+ return typeof t == "symbol" ? t : t + "";
78
+ }(t)) in e ? Object.defineProperty(e, t, {
79
+ value: n,
80
+ enumerable: !0,
81
+ configurable: !0,
82
+ writable: !0
83
+ }) : e[t] = n, e;
84
+ }
85
+ let n = function(e, t) {
86
+ if (e.length === 0) return t.length;
87
+ if (t.length === 0) return e.length;
88
+ let n, r, i = [];
89
+ for (n = 0; n <= t.length; n++) i[n] = [n];
90
+ for (r = 0; r <= e.length; r++) i[0] === void 0 && (i[0] = []), i[0][r] = r;
91
+ for (n = 1; n <= t.length; n++) for (r = 1; r <= e.length; r++) t.charAt(n - 1) === e.charAt(r - 1) ? i[n][r] = i[n - 1][r - 1] : i[n][r] = Math.min(i[n - 1][r - 1] + 1, Math.min(i[n][r - 1] + 1, i[n - 1][r] + 1));
92
+ return i[t.length] === void 0 && (i[t.length] = []), i[t.length][e.length];
93
+ };
94
+ class r extends Error {
95
+ constructor(e, t, n, r, i) {
96
+ super(e), this.name = "SyntaxError", this.cursor = t, this.expression = n, this.subject = r, this.proposals = i;
97
+ }
98
+ toString() {
99
+ let e = `${this.name}: ${this.message} around position ${this.cursor}`;
100
+ if (this.expression && (e += ` for expression \`${this.expression}\``), e += ".", this.subject && this.proposals) {
101
+ let t = 2 ** 53 - 1, r = null;
102
+ for (let e of this.proposals) {
103
+ let i = n(this.subject, e);
104
+ i < t && (r = e, t = i);
105
+ }
106
+ r !== null && t < 3 && (e += ` Did you mean "${r}"?`);
107
+ }
108
+ return e;
109
+ }
110
+ }
111
+ class i {
112
+ constructor(e, n) {
113
+ t(this, "next", () => {
114
+ if (this.position += 1, this.tokens[this.position] === void 0) throw new r("Unexpected end of expression", this.last.cursor, this.expression);
115
+ }), t(this, "expect", (e, t, n) => {
116
+ let i = this.current;
117
+ if (!i.test(e, t)) {
118
+ let a = "";
119
+ n && (a = n + ". ");
120
+ let o = "";
121
+ throw t && (o = ` with value "${t}"`), a += `Unexpected token "${i.type}" of value "${i.value}" ("${e}" expected${o})`, new r(a, i.cursor, this.expression);
122
+ }
123
+ this.next();
124
+ }), t(this, "isEOF", () => a.EOF_TYPE === this.current.type), t(this, "isEqualTo", (e) => {
125
+ if (e == null || !e instanceof i || e.tokens.length !== this.tokens.length) return !1;
126
+ let t = e.position;
127
+ e.position = 0;
128
+ let n = !0;
129
+ for (let t of this.tokens) {
130
+ if (!e.current.isEqualTo(t)) {
131
+ n = !1;
132
+ break;
133
+ }
134
+ e.position < e.tokens.length - 1 && e.next();
135
+ }
136
+ return e.position = t, n;
137
+ }), t(this, "diff", (e) => {
138
+ let t = [];
139
+ if (!this.isEqualTo(e)) {
140
+ let n = e.position;
141
+ e.position = 0;
142
+ for (let n of this.tokens) {
143
+ let r = n.diff(e.current);
144
+ r.length > 0 && t.push({
145
+ index: 0,
146
+ diff: r
147
+ }), e.position < e.tokens.length - 1 && e.next();
148
+ }
149
+ e.position = n;
150
+ }
151
+ return t;
152
+ }), this.expression = e, this.position = 0, this.tokens = n;
153
+ }
154
+ get current() {
155
+ return this.tokens[this.position];
156
+ }
157
+ get last() {
158
+ return this.tokens[this.position - 1];
159
+ }
160
+ toString() {
161
+ return this.tokens.join("\n");
162
+ }
163
+ }
164
+ class a {
165
+ constructor(e, n, r) {
166
+ t(this, "test", (e, t = null) => this.type === e && (t === null || this.value === t)), t(this, "isEqualTo", (e) => !(e == null || !e instanceof a) && e.value == this.value && e.type === this.type && e.cursor === this.cursor), t(this, "diff", (e) => {
167
+ let t = [];
168
+ return this.isEqualTo(e) || (e.value !== this.value && t.push(`Value: ${e.value} != ${this.value}`), e.cursor !== this.cursor && t.push(`Cursor: ${e.cursor} != ${this.cursor}`), e.type !== this.type && t.push(`Type: ${e.type} != ${this.type}`)), t;
169
+ }), this.value = n, this.type = e, this.cursor = r;
170
+ }
171
+ toString() {
172
+ return `${this.cursor} [${this.type}] ${this.value}`;
173
+ }
174
+ }
175
+ function o(e) {
176
+ let t = 0, n = [], o = [], c = (e = e.replace(/\r|\n|\t|\v|\f/g, " ")).length;
177
+ for (; t < c;) {
178
+ if (e[t] === " ") {
179
+ ++t;
180
+ continue;
181
+ }
182
+ if (e.substr(t, 2) === "/*") {
183
+ let n = e.indexOf("*/", t + 2);
184
+ if (n === -1) {
185
+ t = c;
186
+ break;
187
+ }
188
+ t = n + 2;
189
+ continue;
190
+ }
191
+ let i = s(e.substr(t));
192
+ if (i !== null) {
193
+ let e = i.length, r = i.replace(/_/g, "");
194
+ i = r.indexOf(".") === -1 && r.indexOf("e") === -1 && r.indexOf("E") === -1 ? parseInt(r, 10) : parseFloat(r), n.push(new a(a.NUMBER_TYPE, i, t + 1)), t += e;
195
+ } else if ("([{".indexOf(e[t]) >= 0) o.push([e[t], t]), n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
196
+ else if (")]}".indexOf(e[t]) >= 0) {
197
+ if (o.length === 0) throw new r(`Unexpected "${e[t]}"`, t, e);
198
+ let [i, s] = o.pop(), c = i.replace("(", ")").replace("{", "}").replace("[", "]");
199
+ if (e[t] !== c) throw new r(`Unclosed "${i}"`, s, e);
200
+ n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
201
+ } else {
202
+ let i = u(e.substr(t));
203
+ if (i !== null) n.push(new a(a.STRING_TYPE, i.captured, t + 1)), t += i.length;
204
+ else if (e.substr(t, 2) === "\\\\") n.push(new a(a.PUNCTUATION_TYPE, "\\", t + 1)), t += 2;
205
+ else {
206
+ let i = n.length > 0 ? n[n.length - 1] : null;
207
+ if (i && i.type === a.PUNCTUATION_TYPE && (i.value === "." || i.value === "?.")) {
208
+ let i = m(e.substr(t));
209
+ if (i) n.push(new a(a.NAME_TYPE, i, t + 1)), t += i.length;
210
+ else {
211
+ let i = p(e.substr(t));
212
+ if (i) n.push(new a(a.OPERATOR_TYPE, i, t + 1)), t += i.length;
213
+ else if (e.substr(t, 2) === "?." || e.substr(t, 2) === "??") n.push(new a(a.PUNCTUATION_TYPE, e.substr(t, 2), t + 1)), t += 2;
214
+ else {
215
+ if (!(".,?:".indexOf(e[t]) >= 0)) throw new r(`Unexpected character "${e[t]}"`, t, e);
216
+ n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
217
+ }
218
+ }
219
+ } else {
220
+ let i = p(e.substr(t));
221
+ if (i) n.push(new a(a.OPERATOR_TYPE, i, t + 1)), t += i.length;
222
+ else if (e.substr(t, 2) === "?." || e.substr(t, 2) === "??") n.push(new a(a.PUNCTUATION_TYPE, e.substr(t, 2), t + 1)), t += 2;
223
+ else if (".,?:".indexOf(e[t]) >= 0) n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
224
+ else {
225
+ let i = m(e.substr(t));
226
+ if (!i) throw new r(`Unexpected character "${e[t]}"`, t, e);
227
+ n.push(new a(a.NAME_TYPE, i, t + 1)), t += i.length;
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ if (n.push(new a(a.EOF_TYPE, null, t + 1)), o.length > 0) {
234
+ let [t, n] = o.pop();
235
+ throw new r(`Unclosed "${t}"`, n, e);
236
+ }
237
+ return new i(e, n);
238
+ }
239
+ function s(e) {
240
+ let t = null, n = e.match(/^(?:((?:\d(?:_?\d)*)\.(?:\d(?:_?\d)*)|\.(?:\d(?:_?\d)*)|(?:\d(?:_?\d)*))(?:[eE][+-]?\d(?:_?\d)*)?)/);
241
+ return n && n.length > 0 && (t = n[0]), t;
242
+ }
243
+ t(a, "EOF_TYPE", "end of expression"), t(a, "NAME_TYPE", "name"), t(a, "NUMBER_TYPE", "number"), t(a, "STRING_TYPE", "string"), t(a, "OPERATOR_TYPE", "operator"), t(a, "PUNCTUATION_TYPE", "punctuation");
244
+ let c = /^"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/s;
245
+ function l(e, t) {
246
+ return t === "\"" ? e = e.replace(/\\\"/g, "\"") : t === "'" && (e = e.replace(/\\'/g, "'")), e = e.replace(/\\\\/g, "\\");
247
+ }
248
+ function u(e) {
249
+ let t = null;
250
+ if (["'", "\""].indexOf(e.substr(0, 1)) === -1) return t;
251
+ let n = c.exec(e);
252
+ return n !== null && n.length > 0 && (t = n[1] === void 0 ? { captured: l(n[2], "'") } : { captured: l(n[1], "\"") }, t.length = n[0].length), t;
253
+ }
254
+ let d = /* @__PURE__ */ "&&,and,||,or,+,-,**,*,/,%,&,|,^,>>,<<,===,!==,!=,==,<=,>=,<,>,contains,matches,starts with,ends with,not in,in,not,!,xor,~,..".split(","), f = [
255
+ "and",
256
+ "or",
257
+ "matches",
258
+ "contains",
259
+ "starts with",
260
+ "ends with",
261
+ "not in",
262
+ "in",
263
+ "not",
264
+ "xor"
265
+ ];
266
+ function p(e) {
267
+ let t = null;
268
+ for (let n of d) if (e.substr(0, n.length) === n) {
269
+ f.indexOf(n) >= 0 ? e.substr(0, n.length + 1) === n + " " && (t = n) : t = n;
270
+ break;
271
+ }
272
+ return t;
273
+ }
274
+ function m(e) {
275
+ let t = null, n = e.match(/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/);
276
+ return n && n.length > 0 && (t = n[0]), t;
277
+ }
278
+ function h(e) {
279
+ return /boolean|number|string/.test(typeof e);
280
+ }
281
+ function g(e, t) {
282
+ var n = "", r = [], i = 0, a = 0, o = "", s = "", c = "", l = "", u = "", d = 0, f = 0, p = 0, m = 0, h = 0, g = [], _ = "", v = /%([\dA-Fa-f]+)/g, y = function(e, t) {
283
+ return (e += "").length < t ? Array(++t - e.length).join("0") + e : e;
284
+ };
285
+ for (i = 0; i < t.length; i++) if (o = t.charAt(i), s = t.charAt(i + 1), o === "\\" && s && /\d/.test(s)) {
286
+ if (m = i + (p = (c = t.slice(i + 1).match(/^\d+/)[0]).length) + 1, t.charAt(m) + t.charAt(m + 1) === "..") {
287
+ if (d = c.charCodeAt(0), /\\\d/.test(t.charAt(m + 2) + t.charAt(m + 3))) l = t.slice(m + 3).match(/^\d+/)[0], i += 1;
288
+ else {
289
+ if (!t.charAt(m + 2)) throw Error("Range with no end point");
290
+ l = t.charAt(m + 2);
291
+ }
292
+ if ((f = l.charCodeAt(0)) > d) for (a = d; a <= f; a++) r.push(String.fromCharCode(a));
293
+ else r.push(".", c, l);
294
+ i += l.length + 2;
295
+ } else u = String.fromCharCode(parseInt(c, 8)), r.push(u);
296
+ i += p;
297
+ } else if (s + t.charAt(i + 2) === "..") {
298
+ if (d = (c = o).charCodeAt(0), /\\\d/.test(t.charAt(i + 3) + t.charAt(i + 4))) l = t.slice(i + 4).match(/^\d+/)[0], i += 1;
299
+ else {
300
+ if (!t.charAt(i + 3)) throw Error("Range with no end point");
301
+ l = t.charAt(i + 3);
302
+ }
303
+ if ((f = l.charCodeAt(0)) > d) for (a = d; a <= f; a++) r.push(String.fromCharCode(a));
304
+ else r.push(".", c, l);
305
+ i += l.length + 2;
306
+ } else r.push(o);
307
+ for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1) if (n += "\\", (h = o.charCodeAt(0)) < 32 || h > 126) switch (o) {
308
+ case "\n":
309
+ n += "n";
310
+ break;
311
+ case " ":
312
+ n += "t";
313
+ break;
314
+ case "\r":
315
+ n += "r";
316
+ break;
317
+ case "\x07":
318
+ n += "a";
319
+ break;
320
+ case "\v":
321
+ n += "v";
322
+ break;
323
+ case "\b":
324
+ n += "b";
325
+ break;
326
+ case "\f":
327
+ n += "f";
328
+ break;
329
+ default: for (_ = encodeURIComponent(o), (g = v.exec(_)) !== null && (n += y(parseInt(g[1], 16).toString(8), 3)); (g = v.exec(_)) !== null;) n += "\\" + y(parseInt(g[1], 16).toString(8), 3);
330
+ }
331
+ else n += o;
332
+ else n += o;
333
+ return n;
334
+ }
335
+ class _ {
336
+ constructor(e = {}, n = {}) {
337
+ t(this, "compile", (e) => {
338
+ for (let t of Object.values(this.nodes)) t.compile(e);
339
+ }), t(this, "evaluate", (e, t) => {
340
+ let n = [];
341
+ for (let r of Object.values(this.nodes)) n.push(r.evaluate(e, t));
342
+ return n;
343
+ }), t(this, "toArray", () => {
344
+ throw Error(`Dumping a "${this.name}" instance is not supported yet.`);
345
+ }), t(this, "dump", () => {
346
+ let e = "";
347
+ for (let t of this.toArray()) e += h(t) ? t : t.dump();
348
+ return e;
349
+ }), t(this, "dumpString", (e) => `"${g(e, "\0 \"\\")}"`), t(this, "isHash", (e) => {
350
+ let t = 0;
351
+ for (let n of Object.keys(e)) if (n = parseInt(n), n !== t++) return !0;
352
+ return !1;
353
+ }), this.name = "Node", this.nodes = e, this.attributes = n;
354
+ }
355
+ toString() {
356
+ let e = [];
357
+ for (let t of Object.keys(this.attributes)) {
358
+ let n = "null";
359
+ this.attributes[t] && (n = this.attributes[t].toString()), e.push(`${t}: '${n}'`);
360
+ }
361
+ let t = [this.name + "(" + e.join(", ")];
362
+ if (this.nodes.length > 0) {
363
+ for (let e of Object.values(this.nodes)) {
364
+ let n = e.toString().split("\n");
365
+ for (let e of n) t.push(" " + e);
366
+ }
367
+ t.push(")");
368
+ } else t[0] += ")";
369
+ return t.join("\n");
370
+ }
371
+ }
372
+ class v extends _ {
373
+ constructor(e, n, r) {
374
+ super({
375
+ left: n,
376
+ right: r
377
+ }, { operator: e }), t(this, "compile", (e) => {
378
+ let t = this.attributes.operator;
379
+ t === "matches" ? e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")") : t === "contains" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().includes(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "starts with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().startsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "ends with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().endsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : v.functions[t] === void 0 ? (v.operators[t] !== void 0 && (t = v.operators[t]), e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")) : e.raw(`${v.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
380
+ }), t(this, "evaluate", (e, t) => {
381
+ let n = this.attributes.operator, r = this.nodes.left.evaluate(e, t);
382
+ if (v.functions[n] !== void 0) {
383
+ let i = this.nodes.right.evaluate(e, t);
384
+ switch (n) {
385
+ case "not in": return i.indexOf(r) === -1;
386
+ case "in": return i.indexOf(r) >= 0;
387
+ case "..": return function(e, t) {
388
+ let n = [];
389
+ for (let r = e; r <= t; r++) n.push(r);
390
+ return n;
391
+ }(r, i);
392
+ case "**": return r ** +i;
393
+ }
394
+ }
395
+ let i = null;
396
+ switch (n) {
397
+ case "or":
398
+ case "||": return r || (i = this.nodes.right.evaluate(e, t)), r || i;
399
+ case "and":
400
+ case "&&": return r && (i = this.nodes.right.evaluate(e, t)), r && i;
401
+ case "xor": return i = this.nodes.right.evaluate(e, t), i && !r || r && !i;
402
+ case "<<": return i = this.nodes.right.evaluate(e, t), r << i;
403
+ case ">>": return i = this.nodes.right.evaluate(e, t), r >> i;
404
+ }
405
+ switch (i = this.nodes.right.evaluate(e, t), n) {
406
+ case "|": return r | i;
407
+ case "^": return r ^ i;
408
+ case "&": return r & i;
409
+ case "==": return r == i;
410
+ case "===": return r === i;
411
+ case "!=": return r != i;
412
+ case "!==": return r !== i;
413
+ case "<": return r < i;
414
+ case ">": return r > i;
415
+ case ">=": return r >= i;
416
+ case "<=": return r <= i;
417
+ case "not in": return i.indexOf(r) === -1;
418
+ case "in": return i.indexOf(r) >= 0;
419
+ case "+": return r + i;
420
+ case "-": return r - i;
421
+ case "~": return r.toString() + i.toString();
422
+ case "*": return r * i;
423
+ case "/": return r / i;
424
+ case "%": return r % i;
425
+ case "matches":
426
+ if (r == null) return !1;
427
+ let e = i.match(v.regex_expression);
428
+ return new RegExp(e[1], e[2]).test(r);
429
+ case "contains": return r.toString().toLowerCase().includes(i.toString().toLowerCase());
430
+ case "starts with": return r.toString().toLowerCase().startsWith(i.toString().toLowerCase());
431
+ case "ends with": return r.toString().toLowerCase().endsWith(i.toString().toLowerCase());
432
+ }
433
+ }), t(this, "toArray", () => [
434
+ "(",
435
+ this.nodes.left,
436
+ " " + this.attributes.operator + " ",
437
+ this.nodes.right,
438
+ ")"
439
+ ]), this.name = "BinaryNode";
440
+ }
441
+ }
442
+ t(v, "regex_expression", /\/(.+)\/(.*)/), t(v, "operators", {
443
+ "~": ".",
444
+ and: "&&",
445
+ or: "||",
446
+ xor: "xor",
447
+ "<<": "<<",
448
+ ">>": ">>"
449
+ }), t(v, "functions", {
450
+ "**": "Math.pow",
451
+ "..": "range",
452
+ in: "includes",
453
+ "not in": "!includes"
454
+ });
455
+ class y extends _ {
456
+ constructor(e, n) {
457
+ super({ node: n }, { operator: e }), t(this, "compile", (e) => {
458
+ e.raw("(").raw(y.operators[this.attributes.operator]).compile(this.nodes.node).raw(")");
459
+ }), t(this, "evaluate", (e, t) => {
460
+ let n = this.nodes.node.evaluate(e, t);
461
+ switch (this.attributes.operator) {
462
+ case "not":
463
+ case "!": return !n;
464
+ case "-": return -n;
465
+ case "~": return ~n;
466
+ }
467
+ return n;
468
+ }), t(this, "toArray", () => [
469
+ "(",
470
+ this.attributes.operator + " ",
471
+ this.nodes.node,
472
+ ")"
473
+ ]), this.name = "UnaryNode";
474
+ }
475
+ }
476
+ t(y, "operators", {
477
+ "!": "!",
478
+ not: "!",
479
+ "+": "+",
480
+ "-": "-",
481
+ "~": "~"
482
+ });
483
+ class b extends _ {
484
+ constructor(e, n = !1, r = !1) {
485
+ super({}, { value: e }), t(this, "compile", (e) => {
486
+ e.repr(this.attributes.value, this.isIdentifier);
487
+ }), t(this, "evaluate", (e, t) => this.attributes.value), t(this, "toArray", () => {
488
+ let e = [], t = this.attributes.value;
489
+ if (this.isIdentifier) e.push(t);
490
+ else if (!0 === t) e.push("true");
491
+ else if (!1 === t) e.push("false");
492
+ else if (t === null) e.push("null");
493
+ else if (typeof t == "number") e.push(t);
494
+ else if (typeof t == "string") e.push(this.dumpString(t));
495
+ else if (Array.isArray(t)) {
496
+ for (let n of t) e.push(","), e.push(new b(n));
497
+ e[0] = "[", e.push("]");
498
+ } else if (this.isHash(t)) {
499
+ for (let n of Object.keys(t)) e.push(", "), e.push(new b(n)), e.push(": "), e.push(new b(t[n]));
500
+ e[0] = "{", e.push("}");
501
+ }
502
+ return e;
503
+ }), this.isIdentifier = n, this.isNullSafe = r, this.name = "ConstantNode";
504
+ }
505
+ }
506
+ class x extends _ {
507
+ constructor(e, n, r) {
508
+ super({
509
+ expr1: e,
510
+ expr2: n,
511
+ expr3: r
512
+ }), t(this, "compile", (e) => {
513
+ e.raw("((").compile(this.nodes.expr1).raw(") ? (").compile(this.nodes.expr2).raw(") : (").compile(this.nodes.expr3).raw("))");
514
+ }), t(this, "evaluate", (e, t) => this.nodes.expr1.evaluate(e, t) ? this.nodes.expr2.evaluate(e, t) : this.nodes.expr3.evaluate(e, t)), t(this, "toArray", () => [
515
+ "(",
516
+ this.nodes.expr1,
517
+ " ? ",
518
+ this.nodes.expr2,
519
+ " : ",
520
+ this.nodes.expr3,
521
+ ")"
522
+ ]), this.name = "ConditionalNode";
523
+ }
524
+ }
525
+ class ee extends _ {
526
+ constructor(e, n) {
527
+ super({ fnArguments: n }, { name: e }), t(this, "compile", (e) => {
528
+ let t = [];
529
+ for (let n of Object.values(this.nodes.fnArguments.nodes)) t.push(e.subcompile(n));
530
+ let n = e.getFunction(this.attributes.name);
531
+ e.raw(n.compiler.apply(null, t));
532
+ }), t(this, "evaluate", (e, t) => {
533
+ let n = [t];
534
+ for (let r of Object.values(this.nodes.fnArguments.nodes)) n.push(r.evaluate(e, t));
535
+ return e[this.attributes.name].evaluator.apply(null, n);
536
+ }), t(this, "toArray", () => {
537
+ let e = [];
538
+ e.push(this.attributes.name);
539
+ for (let t of Object.values(this.nodes.fnArguments.nodes)) e.push(", "), e.push(t);
540
+ return e[1] = "(", e.push(")"), e;
541
+ }), this.name = "FunctionNode";
542
+ }
543
+ }
544
+ class te extends _ {
545
+ constructor(e) {
546
+ super({}, { name: e }), t(this, "compile", (e) => {
547
+ e.raw(this.attributes.name);
548
+ }), t(this, "evaluate", (e, t) => t[this.attributes.name]), t(this, "toArray", () => [this.attributes.name]), this.name = "NameNode";
549
+ }
550
+ }
551
+ class S extends _ {
552
+ constructor() {
553
+ super(), t(this, "addElement", (e, t = null) => {
554
+ t === null ? t = new b(++this.index) : this.type === "Array" && (this.type = "Object"), this.nodes[(++this.keyIndex).toString()] = t, this.nodes[(++this.keyIndex).toString()] = e;
555
+ }), t(this, "compile", (e) => {
556
+ this.type === "Object" ? e.raw("{") : e.raw("["), this.compileArguments(e, this.type !== "Array"), this.type === "Object" ? e.raw("}") : e.raw("]");
557
+ }), t(this, "evaluate", (e, t) => {
558
+ let n;
559
+ if (this.type === "Array") {
560
+ n = [];
561
+ for (let r of this.getKeyValuePairs()) n.push(r.value.evaluate(e, t));
562
+ } else {
563
+ n = {};
564
+ for (let r of this.getKeyValuePairs()) n[r.key.evaluate(e, t)] = r.value.evaluate(e, t);
565
+ }
566
+ return n;
567
+ }), t(this, "toArray", () => {
568
+ let e = {};
569
+ for (let t of this.getKeyValuePairs()) e[t.key.attributes.value] = t.value;
570
+ let t = [];
571
+ if (this.isHash(e)) {
572
+ for (let n of Object.keys(e)) t.push(", "), t.push(new b(n)), t.push(": "), t.push(e[n]);
573
+ t[0] = "{", t.push("}");
574
+ } else {
575
+ for (let n of Object.values(e)) t.push(", "), t.push(n);
576
+ t[0] = "[", t.push("]");
577
+ }
578
+ return t;
579
+ }), t(this, "getKeyValuePairs", () => {
580
+ let e, t, n, r = [], i = Object.values(this.nodes);
581
+ for (e = 0, t = i.length; e < t; e += 2) n = i.slice(e, e + 2), r.push({
582
+ key: n[0],
583
+ value: n[1]
584
+ });
585
+ return r;
586
+ }), t(this, "compileArguments", (e, t = !0) => {
587
+ let n = !0;
588
+ for (let r of this.getKeyValuePairs()) n || e.raw(", "), n = !1, t && e.compile(r.key).raw(": "), e.compile(r.value);
589
+ }), this.name = "ArrayNode", this.type = "Array", this.index = -1, this.keyIndex = -1;
590
+ }
591
+ }
592
+ class C extends S {
593
+ constructor() {
594
+ super(), t(this, "compile", (e) => {
595
+ this.compileArguments(e, !1);
596
+ }), t(this, "toArray", () => {
597
+ let e = [];
598
+ for (let t of this.getKeyValuePairs()) e.push(t.value), e.push(", ");
599
+ return e.pop(), e;
600
+ }), this.name = "ArgumentsNode";
601
+ }
602
+ }
603
+ class w extends _ {
604
+ constructor(e, n, r, i) {
605
+ super({
606
+ node: e,
607
+ attribute: n,
608
+ fnArguments: r
609
+ }, {
610
+ type: i,
611
+ is_null_coalesce: !1,
612
+ is_short_circuited: !1
613
+ }), t(this, "compile", (e) => {
614
+ let t = this.nodes.attribute instanceof b && this.nodes.attribute.isNullSafe;
615
+ switch (this.attributes.type) {
616
+ case w.PROPERTY_CALL:
617
+ e.compile(this.nodes.node).raw(t ? "?." : ".").raw(this.nodes.attribute.attributes.value);
618
+ break;
619
+ case w.METHOD_CALL:
620
+ e.compile(this.nodes.node).raw(t ? "?." : ".").raw(this.nodes.attribute.attributes.value).raw("(").compile(this.nodes.fnArguments).raw(")");
621
+ break;
622
+ case w.ARRAY_CALL: e.compile(this.nodes.node).raw("[").compile(this.nodes.attribute).raw("]");
623
+ }
624
+ }), t(this, "evaluate", (e, t) => {
625
+ switch (this.attributes.type) {
626
+ case w.PROPERTY_CALL:
627
+ let n = this.nodes.node.evaluate(e, t);
628
+ if (n === null && (this.nodes.attribute.isNullSafe || this.attributes.is_null_coalesce)) return this.attributes.is_short_circuited = !0, null;
629
+ if (n === null && this.isShortCircuited()) return null;
630
+ if (typeof n != "object") throw Error(`Unable to get property "${r}" on a non-object: ` + typeof n);
631
+ let r = this.nodes.attribute.attributes.value;
632
+ return this.attributes.is_null_coalesce ? n[r] ?? null : n[r];
633
+ case w.METHOD_CALL:
634
+ let i = this.nodes.node.evaluate(e, t);
635
+ if (i === null && this.nodes.attribute.isNullSafe) return this.attributes.is_short_circuited = !0, null;
636
+ if (i === null && this.isShortCircuited()) return null;
637
+ let a = this.nodes.attribute.attributes.value;
638
+ if (typeof i != "object") throw Error(`Unable to call method "${a}" on a non-object: ` + typeof i);
639
+ if (i[a] === void 0) throw Error(`Method "${a}" is undefined on object.`);
640
+ if (typeof i[a] != "function") throw Error(`Method "${a}" is not a function on object.`);
641
+ let o = this.nodes.fnArguments.evaluate(e, t);
642
+ return i[a].apply(null, o);
643
+ case w.ARRAY_CALL:
644
+ let s = this.nodes.node.evaluate(e, t);
645
+ if (s === null && this.isShortCircuited()) return null;
646
+ if (!(Array.isArray(s) || typeof s == "object" || s === null && this.attributes.is_null_coalesce)) throw Error("Unable to get an item on a non-array: " + typeof s);
647
+ return this.attributes.is_null_coalesce ? s ? s[this.nodes.attribute.evaluate(e, t)] ?? null : null : s[this.nodes.attribute.evaluate(e, t)];
648
+ }
649
+ }), t(this, "toArray", () => {
650
+ let e = this.nodes.attribute instanceof b && this.nodes.attribute.isNullSafe;
651
+ switch (this.attributes.type) {
652
+ case w.PROPERTY_CALL: return [
653
+ this.nodes.node,
654
+ e ? "?." : ".",
655
+ this.nodes.attribute
656
+ ];
657
+ case w.METHOD_CALL: return [
658
+ this.nodes.node,
659
+ e ? "?." : ".",
660
+ this.nodes.attribute,
661
+ "(",
662
+ this.nodes.fnArguments,
663
+ ")"
664
+ ];
665
+ case w.ARRAY_CALL: return [
666
+ this.nodes.node,
667
+ "[",
668
+ this.nodes.attribute,
669
+ "]"
670
+ ];
671
+ }
672
+ }), this.name = "GetAttrNode";
673
+ }
674
+ isShortCircuited() {
675
+ return this.attributes.is_short_circuited || this.nodes.node instanceof w && this.nodes.node.isShortCircuited();
676
+ }
677
+ }
678
+ t(w, "PROPERTY_CALL", 1), t(w, "METHOD_CALL", 2), t(w, "ARRAY_CALL", 3);
679
+ class T extends _ {
680
+ constructor(e, n) {
681
+ super({
682
+ expr1: e,
683
+ expr2: n
684
+ }), t(this, "compile", (e) => {
685
+ e.raw("((").compile(this.nodes.expr1).raw(") ?? (").compile(this.nodes.expr2).raw("))");
686
+ }), t(this, "evaluate", (e, t) => (this.nodes.expr1 instanceof w && this._addNullCoalesceAttributeToGetAttrNodes(this.nodes.expr1), this.nodes.expr1.evaluate(e, t) ?? this.nodes.expr2.evaluate(e, t))), t(this, "toArray", () => [
687
+ "(",
688
+ this.nodes.expr1,
689
+ ") ?? (",
690
+ this.nodes.expr2,
691
+ ")"
692
+ ]), t(this, "_addNullCoalesceAttributeToGetAttrNodes", (e) => {
693
+ if (!(!e instanceof w)) {
694
+ e.attributes.is_null_coalesce = !0;
695
+ for (let t of Object.values(e.nodes)) this._addNullCoalesceAttributeToGetAttrNodes(t);
696
+ }
697
+ }), this.name = "NullCoalesceNode";
698
+ }
699
+ }
700
+ class E extends _ {
701
+ constructor(e) {
702
+ super({}, { name: e }), t(this, "compile", (e) => {
703
+ e.raw(this.attributes.name + " ?? null");
704
+ }), t(this, "evaluate", (e, t) => null), t(this, "toArray", () => [this.attributes.name + " ?? null"]), this.name = "NullCoalescedNameNode";
705
+ }
706
+ }
707
+ class D {
708
+ constructor(e = {}) {
709
+ t(this, "functions", {}), t(this, "unaryOperators", {
710
+ not: { precedence: 50 },
711
+ "!": { precedence: 50 },
712
+ "-": { precedence: 500 },
713
+ "+": { precedence: 500 },
714
+ "~": { precedence: 500 }
715
+ }), t(this, "binaryOperators", {
716
+ or: {
717
+ precedence: 10,
718
+ associativity: 1
719
+ },
720
+ "||": {
721
+ precedence: 10,
722
+ associativity: 1
723
+ },
724
+ xor: {
725
+ precedence: 12,
726
+ associativity: 1
727
+ },
728
+ and: {
729
+ precedence: 15,
730
+ associativity: 1
731
+ },
732
+ "&&": {
733
+ precedence: 15,
734
+ associativity: 1
735
+ },
736
+ "|": {
737
+ precedence: 16,
738
+ associativity: 1
739
+ },
740
+ "^": {
741
+ precedence: 17,
742
+ associativity: 1
743
+ },
744
+ "&": {
745
+ precedence: 18,
746
+ associativity: 1
747
+ },
748
+ "==": {
749
+ precedence: 20,
750
+ associativity: 1
751
+ },
752
+ "===": {
753
+ precedence: 20,
754
+ associativity: 1
755
+ },
756
+ "!=": {
757
+ precedence: 20,
758
+ associativity: 1
759
+ },
760
+ "!==": {
761
+ precedence: 20,
762
+ associativity: 1
763
+ },
764
+ "<": {
765
+ precedence: 20,
766
+ associativity: 1
767
+ },
768
+ ">": {
769
+ precedence: 20,
770
+ associativity: 1
771
+ },
772
+ ">=": {
773
+ precedence: 20,
774
+ associativity: 1
775
+ },
776
+ "<=": {
777
+ precedence: 20,
778
+ associativity: 1
779
+ },
780
+ "not in": {
781
+ precedence: 20,
782
+ associativity: 1
783
+ },
784
+ in: {
785
+ precedence: 20,
786
+ associativity: 1
787
+ },
788
+ matches: {
789
+ precedence: 20,
790
+ associativity: 1
791
+ },
792
+ contains: {
793
+ precedence: 20,
794
+ associativity: 1
795
+ },
796
+ "starts with": {
797
+ precedence: 20,
798
+ associativity: 1
799
+ },
800
+ "ends with": {
801
+ precedence: 20,
802
+ associativity: 1
803
+ },
804
+ "..": {
805
+ precedence: 25,
806
+ associativity: 1
807
+ },
808
+ "<<": {
809
+ precedence: 25,
810
+ associativity: 1
811
+ },
812
+ ">>": {
813
+ precedence: 25,
814
+ associativity: 1
815
+ },
816
+ "+": {
817
+ precedence: 30,
818
+ associativity: 1
819
+ },
820
+ "-": {
821
+ precedence: 30,
822
+ associativity: 1
823
+ },
824
+ "~": {
825
+ precedence: 40,
826
+ associativity: 1
827
+ },
828
+ "*": {
829
+ precedence: 60,
830
+ associativity: 1
831
+ },
832
+ "/": {
833
+ precedence: 60,
834
+ associativity: 1
835
+ },
836
+ "%": {
837
+ precedence: 60,
838
+ associativity: 1
839
+ },
840
+ "**": {
841
+ precedence: 200,
842
+ associativity: 2
843
+ }
844
+ }), t(this, "parse", (e, t = [], n = 0) => {
845
+ this.tokenStream = e, this.names = t, this.objectMatches = {}, this.cachedNames = null, this.nestedExecutions = 0, this.flags = n;
846
+ let i = this.parseExpression();
847
+ if (!this.tokenStream.isEOF()) throw new r(`Unexpected token "${this.tokenStream.current.type}" of value "${this.tokenStream.current.value}"`, this.tokenStream.current.cursor, this.tokenStream.expression);
848
+ return i;
849
+ }), t(this, "lint", (e, t = [], n = 0) => {
850
+ t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), this.parse(e, t, n);
851
+ }), t(this, "parseExpression", (e = 0) => {
852
+ let t = this.getPrimary(), n = this.tokenStream.current;
853
+ if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("Way to many executions on '" + n.toString() + "' of '" + this.tokenStream.toString() + "'");
854
+ for (; n.test(a.OPERATOR_TYPE) && this.binaryOperators[n.value] !== void 0 && this.binaryOperators[n.value] !== null && this.binaryOperators[n.value].precedence >= e;) {
855
+ let e = this.binaryOperators[n.value];
856
+ this.tokenStream.next();
857
+ let r = this.parseExpression(e.associativity === 1 ? e.precedence + 1 : e.precedence);
858
+ t = new v(n.value, t, r), n = this.tokenStream.current;
859
+ }
860
+ return e === 0 ? this.parseConditionalExpression(t) : t;
861
+ }), t(this, "getPrimary", () => {
862
+ let e = this.tokenStream.current;
863
+ if (e.test(a.OPERATOR_TYPE) && this.unaryOperators[e.value] !== void 0 && this.unaryOperators[e.value] !== null) {
864
+ let t = this.unaryOperators[e.value];
865
+ this.tokenStream.next();
866
+ let n = this.parseExpression(t.precedence);
867
+ return this.parsePostfixExpression(new y(e.value, n));
868
+ }
869
+ if (e.test(a.PUNCTUATION_TYPE, "(")) {
870
+ this.tokenStream.next();
871
+ let e = this.parseExpression();
872
+ return this.tokenStream.expect(a.PUNCTUATION_TYPE, ")", "An opened parenthesis is not properly closed"), this.parsePostfixExpression(e);
873
+ }
874
+ return this.parsePrimaryExpression();
875
+ }), t(this, "hasVariable", (e) => this.getNames().indexOf(e) >= 0), t(this, "getNames", () => {
876
+ if (this.cachedNames !== null) return this.cachedNames;
877
+ if (this.names && this.names.length > 0) {
878
+ let e = [], t = 0;
879
+ this.objectMatches = {};
880
+ for (let n of this.names) typeof n == "object" ? (this.objectMatches[Object.values(n)[0]] = t, e.push(Object.keys(n)[0]), e.push(Object.values(n)[0])) : e.push(n), t++;
881
+ return this.cachedNames = e, e;
882
+ }
883
+ return [];
884
+ }), t(this, "parseArrayExpression", () => {
885
+ this.tokenStream.expect(a.PUNCTUATION_TYPE, "[", "An array element was expected");
886
+ let e = new S(), t = !0;
887
+ for (; !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "]") && (t || (this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "An array element must be followed by a comma"), !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "]")));) t = !1, e.addElement(this.parseExpression());
888
+ return this.tokenStream.expect(a.PUNCTUATION_TYPE, "]", "An opened array is not properly closed"), e;
889
+ }), t(this, "parseHashExpression", () => {
890
+ this.tokenStream.expect(a.PUNCTUATION_TYPE, "{", "A hash element was expected");
891
+ let e = new S(), t = !0;
892
+ for (; !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "}") && (t || (this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "A hash value must be followed by a comma"), !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "}")));) {
893
+ t = !1;
894
+ let n = null;
895
+ if (this.tokenStream.current.test(a.STRING_TYPE) || this.tokenStream.current.test(a.NAME_TYPE) || this.tokenStream.current.test(a.NUMBER_TYPE)) n = new b(this.tokenStream.current.value), this.tokenStream.next();
896
+ else {
897
+ if (!this.tokenStream.current.test(a.PUNCTUATION_TYPE, "(")) {
898
+ let e = this.tokenStream.current;
899
+ throw new r(`A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "${e.type}" of value "${e.value}"`, e.cursor, this.tokenStream.expression);
900
+ }
901
+ n = this.parseExpression();
902
+ }
903
+ this.tokenStream.expect(a.PUNCTUATION_TYPE, ":", "A hash key must be followed by a colon (:)");
904
+ let i = this.parseExpression();
905
+ e.addElement(i, n);
906
+ }
907
+ return this.tokenStream.expect(a.PUNCTUATION_TYPE, "}", "An opened hash is not properly closed"), e;
908
+ }), t(this, "parsePostfixExpression", (e) => {
909
+ let t = this.tokenStream.current;
910
+ for (; a.PUNCTUATION_TYPE === t.type;) {
911
+ if (t.value === "." || t.value === "?.") {
912
+ let n = t.value === "?.";
913
+ if (this.tokenStream.next(), t = this.tokenStream.current, this.tokenStream.next(), a.NAME_TYPE !== t.type && (a.OPERATOR_TYPE !== t.type || !/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/.test(t.value))) throw new r("Expected name", t.cursor, this.tokenStream.expression);
914
+ let i = new b(t.value, !0, n), o = new C(), s = null;
915
+ if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "(")) {
916
+ s = w.METHOD_CALL;
917
+ for (let e of Object.values(this.parseArguments().nodes)) o.addElement(e);
918
+ } else s = w.PROPERTY_CALL;
919
+ e = new w(e, i, o, s);
920
+ } else {
921
+ if (t.value !== "[") break;
922
+ {
923
+ this.tokenStream.next();
924
+ let t = this.parseExpression();
925
+ this.tokenStream.expect(a.PUNCTUATION_TYPE, "]"), e = new w(e, t, new C(), w.ARRAY_CALL);
926
+ }
927
+ }
928
+ t = this.tokenStream.current;
929
+ }
930
+ return e;
931
+ }), t(this, "parseArguments", () => {
932
+ let e = [];
933
+ for (this.tokenStream.expect(a.PUNCTUATION_TYPE, "(", "A list of arguments must begin with an opening parenthesis"); !this.tokenStream.current.test(a.PUNCTUATION_TYPE, ")");) e.length !== 0 && this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "Arguments must be separated by a comma"), e.push(this.parseExpression());
934
+ return this.tokenStream.expect(a.PUNCTUATION_TYPE, ")", "A list of arguments must be closed by a parenthesis"), new _(e);
935
+ }), this.functions = e, this.tokenStream = null, this.names = null, this.objectMatches = {}, this.cachedNames = null, this.nestedExecutions = 0, this.flags = 0;
936
+ }
937
+ parseConditionalExpression(e) {
938
+ for (; this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??");) {
939
+ this.tokenStream.next();
940
+ let t = this.parseExpression();
941
+ e = new T(e, t);
942
+ }
943
+ for (; this.tokenStream.current.test(a.PUNCTUATION_TYPE, "?");) {
944
+ let t, n;
945
+ this.tokenStream.next(), this.tokenStream.current.test(a.PUNCTUATION_TYPE, ":") ? (this.tokenStream.next(), t = e, n = this.parseExpression()) : (t = this.parseExpression(), this.tokenStream.current.test(a.PUNCTUATION_TYPE, ":") ? (this.tokenStream.next(), n = this.parseExpression()) : t instanceof b && typeof t.attributes?.value == "string" ? n = new b("") : t instanceof x ? (n = t.nodes.expr3, t = t.nodes.expr2) : (n = t, t = e)), e = new x(e, t, n);
946
+ }
947
+ return e;
948
+ }
949
+ parsePrimaryExpression() {
950
+ let e = this.tokenStream.current, t = null;
951
+ switch (e.type) {
952
+ case a.NAME_TYPE:
953
+ switch (this.tokenStream.next(), e.value) {
954
+ case "true":
955
+ case "TRUE": return new b(!0);
956
+ case "false":
957
+ case "FALSE": return new b(!1);
958
+ case "null":
959
+ case "NULL": return new b(null);
960
+ default: if (this.tokenStream.current.value === "(") {
961
+ if (this.functions[e.value] === void 0 && !(2 & this.flags)) throw new r(`The function "${e.value}" does not exist`, e.cursor, this.tokenStream.expression, e.values, Object.keys(this.functions));
962
+ t = new ee(e.value, this.parseArguments());
963
+ } else {
964
+ let n = null;
965
+ if (1 & this.flags) n = e.value;
966
+ else {
967
+ if (!this.hasVariable(e.value)) {
968
+ if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new E(e.value);
969
+ throw new r(`Variable "${e.value}" is not valid`, e.cursor, this.tokenStream.expression, e.value, this.getNames());
970
+ }
971
+ n = e.value, this.objectMatches[n] !== void 0 && (n = this.getNames()[this.objectMatches[n]]);
972
+ }
973
+ t = new te(n);
974
+ }
975
+ }
976
+ break;
977
+ case a.NUMBER_TYPE:
978
+ case a.STRING_TYPE: return this.tokenStream.next(), new b(e.value);
979
+ default: if (e.test(a.PUNCTUATION_TYPE, "[")) t = this.parseArrayExpression();
980
+ else {
981
+ if (!e.test(a.PUNCTUATION_TYPE, "{")) throw new r(`Unexpected token "${e.type}" of value "${e.value}"`, e.cursor, this.tokenStream.expression);
982
+ t = this.parseHashExpression();
983
+ }
984
+ }
985
+ return this.parsePostfixExpression(t);
986
+ }
987
+ }
988
+ class ne {
989
+ constructor(e) {
990
+ t(this, "getFunction", (e) => this.functions[e]), t(this, "getSource", () => this.source), t(this, "reset", () => (this.source = "", this)), t(this, "compile", (e) => (e.compile(this), this)), t(this, "subcompile", (e) => {
991
+ let t = this.source;
992
+ this.source = "", e.compile(this);
993
+ let n = this.source;
994
+ return this.source = t, n;
995
+ }), t(this, "raw", (e) => (this.source += e, this)), t(this, "string", (e) => (this.source += "\"" + g(e, "\0 \"$\\") + "\"", this)), t(this, "repr", (e, t = !1) => {
996
+ if (t) this.raw(e);
997
+ else if (Number.isInteger(e) || +e === e && (!isFinite(e) || e % 1)) this.raw(e);
998
+ else if (e === null) this.raw("null");
999
+ else if (typeof e == "boolean") this.raw(e ? "true" : "false");
1000
+ else if (typeof e == "object") {
1001
+ this.raw("{");
1002
+ let t = !0;
1003
+ for (let n of Object.keys(e)) t || this.raw(", "), t = !1, this.repr(n), this.raw(":"), this.repr(e[n]);
1004
+ this.raw("}");
1005
+ } else if (Array.isArray(e)) {
1006
+ this.raw("[");
1007
+ let t = !0;
1008
+ for (let n of e) t || this.raw(", "), t = !1, this.repr(n);
1009
+ this.raw("]");
1010
+ } else this.string(e);
1011
+ return this;
1012
+ }), this.source = "", this.functions = e;
1013
+ }
1014
+ }
1015
+ class re {
1016
+ constructor(e) {
1017
+ this.expression = e;
1018
+ }
1019
+ toString() {
1020
+ return this.expression;
1021
+ }
1022
+ }
1023
+ class O extends re {
1024
+ constructor(e, n) {
1025
+ super(e), t(this, "getNodes", () => this.nodes), this.nodes = n;
1026
+ }
1027
+ static fromJSON(e) {
1028
+ let t = typeof e == "string" ? JSON.parse(e) : e, n = (e) => {
1029
+ if (e == null || e instanceof _ || typeof e != "object" || !e.name) return e;
1030
+ switch (e.name) {
1031
+ case "ConstantNode": return new b(e.attributes?.value, !!e.isIdentifier, !!e.isNullSafe);
1032
+ case "NameNode": return new te(e.attributes?.name);
1033
+ case "NullCoalescedNameNode": return new E(e.attributes?.name);
1034
+ case "UnaryNode": return new y(e.attributes?.operator, n(e.nodes?.node));
1035
+ case "BinaryNode": return new v(e.attributes?.operator, n(e.nodes?.left), n(e.nodes?.right));
1036
+ case "ConditionalNode": return new x(n(e.nodes?.expr1), n(e.nodes?.expr2), n(e.nodes?.expr3));
1037
+ case "NullCoalesceNode": return new T(n(e.nodes?.expr1), n(e.nodes?.expr2));
1038
+ case "ArgumentsNode": {
1039
+ let t = new C();
1040
+ typeof e.type == "string" && (t.type = e.type), typeof e.index == "number" && (t.index = e.index), typeof e.keyIndex == "number" && (t.keyIndex = e.keyIndex), t.nodes = {};
1041
+ for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
1042
+ return t;
1043
+ }
1044
+ case "ArrayNode": {
1045
+ let t = new S();
1046
+ typeof e.type == "string" && (t.type = e.type), typeof e.index == "number" && (t.index = e.index), typeof e.keyIndex == "number" && (t.keyIndex = e.keyIndex), t.nodes = {};
1047
+ for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
1048
+ return t;
1049
+ }
1050
+ case "FunctionNode": {
1051
+ let t = n(e.nodes?.arguments);
1052
+ return new ee(e.attributes?.name, t);
1053
+ }
1054
+ case "GetAttrNode": {
1055
+ let t = new w(n(e.nodes?.node), n(e.nodes?.attribute), n(e.nodes?.fnArguments), e.attributes?.type);
1056
+ return e.attributes && typeof e.attributes.is_null_coalesce == "boolean" && (t.attributes.is_null_coalesce = e.attributes.is_null_coalesce), e.attributes && typeof e.attributes.is_short_circuited == "boolean" && (t.attributes.is_short_circuited = e.attributes.is_short_circuited), t;
1057
+ }
1058
+ case "Node": {
1059
+ let t = new _();
1060
+ if (Array.isArray(e.nodes)) t.nodes = e.nodes.map(n);
1061
+ else {
1062
+ t.nodes = {};
1063
+ for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
1064
+ }
1065
+ return t.attributes = e.attributes || {}, t;
1066
+ }
1067
+ default: {
1068
+ let t = new _();
1069
+ if (t.name = e.name, Array.isArray(e.nodes)) t.nodes = e.nodes.map(n);
1070
+ else {
1071
+ t.nodes = {};
1072
+ for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
1073
+ }
1074
+ return t.attributes = e.attributes || {}, t;
1075
+ }
1076
+ }
1077
+ }, r = t.expression;
1078
+ return new O(r, ((e) => {
1079
+ if (e == null) return e;
1080
+ if (e.name) return n(e);
1081
+ if (Array.isArray(e)) return e.map(n);
1082
+ if (typeof e == "object") {
1083
+ let t = {};
1084
+ for (let r of Object.keys(e)) t[r] = n(e[r]);
1085
+ return t;
1086
+ }
1087
+ return e;
1088
+ })(t.nodes));
1089
+ }
1090
+ }
1091
+ var k;
1092
+ class A {
1093
+ constructor(e = 0) {
1094
+ t(this, "createCacheItem", (e, t, n) => {
1095
+ let r = new j();
1096
+ return r.key = e, r.value = t, r.isHit = n, r.defaultLifetime = this.defaultLifetime, r;
1097
+ }), t(this, "get", (e, t, n = null, r = null) => {
1098
+ let i = this.getItem(e);
1099
+ return i.isHit || this.save(i.set(t(i, !0))), i.get();
1100
+ }), t(this, "getItem", (e) => {
1101
+ let t = this.hasItem(e), n = null;
1102
+ return t ? n = this.values[e] : this.values[e] = null, (0, this.createCacheItem)(e, n, t);
1103
+ }), t(this, "getItems", (e) => {
1104
+ for (let t of e) typeof t == "string" || this.expiries[t] || j.validateKey(t);
1105
+ return this.generateItems(e, (/* @__PURE__ */ new Date()).getTime() / 1e3, this.createCacheItem);
1106
+ }), t(this, "deleteItems", (e) => {
1107
+ for (let t of e) this.deleteItem(t);
1108
+ return !0;
1109
+ }), t(this, "save", (e) => !(!e instanceof j) && (e.expiry !== null && e.expiry <= (/* @__PURE__ */ new Date()).getTime() / 1e3 ? (this.deleteItem(e.key), !0) : (e.expiry === null && 0 < e.defaultLifetime && (e.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.defaultLifetime), this.values[e.key] = e.value, this.expiries[e.key] = e.expiry || 2 ** 53 - 1, !0))), t(this, "saveDeferred", (e) => this.save(e)), t(this, "commit", () => !0), t(this, "delete", (e) => this.deleteItem(e)), t(this, "getValues", () => this.values), t(this, "hasItem", (e) => !!(typeof e == "string" && this.expiries[e] && this.expiries[e] > (/* @__PURE__ */ new Date()).getTime() / 1e3) || (j.validateKey(e), !!this.expiries[e] && !this.deleteItem(e))), t(this, "clear", () => (this.values = {}, this.expiries = {}, !0)), t(this, "deleteItem", (e) => (typeof e == "string" && this.expiries[e] || j.validateKey(e), delete this.values[e], delete this.expiries[e], !0)), t(this, "reset", () => {
1110
+ this.clear();
1111
+ }), t(this, "generateItems", (e, t, n) => {
1112
+ let r = [];
1113
+ for (let i of e) {
1114
+ let e = null, a = !!this.expiries[i];
1115
+ a || !(this.expiries[i] > t) && this.deleteItem(i) ? e = this.values[i] : this.values[i] = null, r[i] = n(i, e, a);
1116
+ }
1117
+ return r;
1118
+ }), this.defaultLifetime = e, this.values = {}, this.expiries = {};
1119
+ }
1120
+ }
1121
+ class j {
1122
+ constructor() {
1123
+ t(this, "getKey", () => this.key), t(this, "get", () => this.value), t(this, "set", (e) => (this.value = e, this)), t(this, "expiresAt", (e) => {
1124
+ if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
1125
+ else {
1126
+ if (!(e instanceof Date)) throw Error(`Expiration date must be instance of Date or be null, "${e.name}" given`);
1127
+ this.expiry = e.getTime() / 1e3;
1128
+ }
1129
+ return this;
1130
+ }), t(this, "expiresAfter", (e) => {
1131
+ if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
1132
+ else {
1133
+ if (!Number.isInteger(e)) throw Error(`Expiration date must be an integer or be null, "${e.name}" given`);
1134
+ this.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e;
1135
+ }
1136
+ return this;
1137
+ }), t(this, "tag", (e) => {
1138
+ if (!this.isTaggable) throw Error(`Cache item "${this.key}" comes from a non tag-aware pool: you cannot tag it.`);
1139
+ Array.isArray(e) || (e = [e]);
1140
+ for (let t of e) {
1141
+ if (typeof t != "string") throw Error(`Cache tag must by a string, "${typeof t}" given.`);
1142
+ if (this.newMetadata.tags[t] && t === "") throw Error("Cache tag length must be greater than zero");
1143
+ this.newMetadata.tags[t] = t;
1144
+ }
1145
+ return this;
1146
+ }), t(this, "getMetadata", () => this.metadata), this.key = null, this.value = null, this.isHit = !1, this.expiry = null, this.defaultLifetime = null, this.metadata = {}, this.newMetadata = {}, this.innerItem = null, this.poolHash = null, this.isTaggable = !1;
1147
+ }
1148
+ }
1149
+ k = j, t(j, "METADATA_EXPIRY_OFFSET", 1527506807), t(j, "RESERVED_CHARACTERS", [
1150
+ "{",
1151
+ "}",
1152
+ "(",
1153
+ ")",
1154
+ "/",
1155
+ "\\",
1156
+ "@",
1157
+ ":"
1158
+ ]), t(j, "validateKey", (e) => {
1159
+ if (typeof e != "string") throw Error(`Cache key must be string, "${typeof e}" given.`);
1160
+ if (e === "") throw Error("Cache key length must be greater than zero");
1161
+ for (let t of k.RESERVED_CHARACTERS) if (e.indexOf(t) >= 0) throw Error(`Cache key "${e}" contains reserved character "${t}".`);
1162
+ return e;
1163
+ });
1164
+ class M extends Error {
1165
+ constructor(e) {
1166
+ super(e), this.name = "LogicException";
1167
+ }
1168
+ toString() {
1169
+ return `${this.name}: ${this.message}`;
1170
+ }
1171
+ }
1172
+ class N {
1173
+ constructor(e, n, r) {
1174
+ t(this, "getName", () => this.name), t(this, "getCompiler", () => this.compiler), t(this, "getEvaluator", () => this.evaluator), this.name = e, this.compiler = n, this.evaluator = r;
1175
+ }
1176
+ static fromJavascript(e, t = null) {
1177
+ if (typeof e != "string" || e.length === 0) throw TypeError("A JavaScript function name (string) must be provided.");
1178
+ let n = e.replace(/^\/+/, ""), r = n.split("."), i = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {};
1179
+ for (let e of r) {
1180
+ if (i == null) break;
1181
+ i = i[e];
1182
+ }
1183
+ if (typeof i != "function") throw Error(`JavaScript function "${n}" does not exist.`);
1184
+ if (!t && r.length > 1) throw Error(`An expression function name must be defined when JavaScript function "${n}" is namespaced.`);
1185
+ return new this(t || r[r.length - 1], (...e) => `${n}(${e.join(", ")})`, (e, ...t) => i(...t));
1186
+ }
1187
+ }
1188
+ class P {
1189
+ constructor(e = null, n = []) {
1190
+ t(this, "compile", (e, t = []) => this.getCompiler().compile(this.parse(e, t).getNodes()).getSource()), t(this, "evaluate", (e, t = {}) => this.parse(e, Object.keys(t)).getNodes().evaluate(this.functions, t)), t(this, "parse", (e, t, n = 0) => {
1191
+ if (e instanceof O) return e;
1192
+ t.sort((e, t) => {
1193
+ let n = e, r = t;
1194
+ return typeof e == "object" && (n = Object.values(e)[0]), typeof t == "object" && (r = Object.values(t)[0]), n.localeCompare(r);
1195
+ });
1196
+ let r = [];
1197
+ for (let e of t) {
1198
+ let t = e;
1199
+ typeof e == "object" && (t = Object.keys(e)[0] + ":" + Object.values(e)[0]), r.push(t);
1200
+ }
1201
+ let i = this.cache.getItem(this.fixedEncodeURIComponent(e + "//" + r.join("|"))), a = i.get();
1202
+ return a === null && (a = new O(e, this.getParser().parse(this.getLexer().tokenize(e), t, n)), i.set(a), this.cache.save(i)), a;
1203
+ }), t(this, "lint", (e, t = null, n = 0) => {
1204
+ t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), e instanceof O || this.getParser().lint(this.getLexer().tokenize(e), t, n);
1205
+ }), t(this, "fixedEncodeURIComponent", (e) => encodeURIComponent(e).replace(/[!'()*]/g, function(e) {
1206
+ return "%" + e.charCodeAt(0).toString(16);
1207
+ })), t(this, "register", (e, t, n) => {
1208
+ if (this.parser !== null) throw new M("Registering functions after calling evaluate(), compile(), or parse() is not supported.");
1209
+ this.functions[e] = {
1210
+ compiler: t,
1211
+ evaluator: n
1212
+ };
1213
+ }), t(this, "addFunction", (e) => {
1214
+ this.register(e.getName(), e.getCompiler(), e.getEvaluator());
1215
+ }), t(this, "registerProvider", (e) => {
1216
+ for (let t of e.getFunctions()) this.addFunction(t);
1217
+ }), t(this, "getLexer", () => (this.lexer === null && (this.lexer = { tokenize: o }), this.lexer)), t(this, "getParser", () => (this.parser === null && (this.parser = new D(this.functions)), this.parser)), t(this, "getCompiler", () => (this.compiler === null && (this.compiler = new ne(this.functions)), this.compiler.reset())), this.functions = [], this.lexer = null, this.parser = null, this.compiler = null, this.cache = e || new A(), this._registerBuiltinFunctions();
1218
+ for (let e of n) this.registerProvider(e);
1219
+ }
1220
+ _registerBuiltinFunctions() {
1221
+ let e = N.fromJavascript("Math.min", "min"), t = N.fromJavascript("Math.max", "max");
1222
+ this.addFunction(e), this.addFunction(t), this.addFunction(new N("constant", function(e) {
1223
+ return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));return __n.split('.').reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
1224
+ }, function(e, t) {
1225
+ if (typeof t != "string" || !t) return;
1226
+ let n = (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, t.split(".").reduce((e, t) => e?.[t], r));
1227
+ var r;
1228
+ return n === void 0 && e && Object.prototype.hasOwnProperty.call(e, t) && (n = e[t]), n;
1229
+ })), this.addFunction(new N("enum", function(e) {
1230
+ return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));if(typeof __n!=='string'||!__n)return undefined;var s=String(__n);var keys=[],buf='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c===46||c===92){if(buf){keys.push(buf);buf='';}continue;}if(c===58){if(i+1<s.length&&s.charCodeAt(i+1)===58){if(buf){keys.push(buf);buf='';}i++;continue;}}buf+=s[i];}if(buf)keys.push(buf);return keys.reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
1231
+ }, function(e, t) {
1232
+ if (typeof t != "string" || !t) return;
1233
+ let n = String(t).replace(/\\/g, ".").replace(/::/g, ".");
1234
+ var r;
1235
+ return n ? (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, n.split(".").reduce((e, t) => e?.[t], r)) : void 0;
1236
+ }));
1237
+ }
1238
+ }
1239
+ class F {
1240
+ getFunctions() {
1241
+ throw Error("getFunctions must be implemented by " + this.name);
1242
+ }
1243
+ }
1244
+ let ie = new N("isset", function(e) {
1245
+ return `isset(${e})`;
1246
+ }, function(e, t) {
1247
+ if (typeof t != "string") return t != null;
1248
+ if (!(t.split(/[.\[]/)[0] in e)) return !0;
1249
+ let n = "", r = [], i = "", a = "";
1250
+ for (let e = 0; e < t.length; e++) {
1251
+ let o = t[e];
1252
+ if (o !== "]") if (o !== "[") {
1253
+ if (i === "object" && (!/[A-z0-9_]/.test(o) || e === t.length - 1)) {
1254
+ let n = !1;
1255
+ if (e === t.length - 1 && (a += o, n = !0), i = "", r.push({
1256
+ type: "object",
1257
+ attribute: a
1258
+ }), a = "", n) continue;
1259
+ }
1260
+ o === "." ? (i = "object", a = "") : i ? a += o : n += o;
1261
+ } else i = "array", a = "";
1262
+ else i = "", r.push({
1263
+ type: "array",
1264
+ index: a.replace(/"/g, "").replace(/'/g, "")
1265
+ }), a = "";
1266
+ }
1267
+ if (r.length > 0) {
1268
+ if (e[n] !== void 0) {
1269
+ let t = e[n];
1270
+ for (let e of r) {
1271
+ if (e.type === "array") {
1272
+ if (t[e.index] === void 0) return !1;
1273
+ t = t[e.index];
1274
+ }
1275
+ if (e.type === "object") {
1276
+ if (t[e.attribute] === void 0) return !1;
1277
+ t = t[e.attribute];
1278
+ }
1279
+ }
1280
+ return !0;
1281
+ }
1282
+ return !1;
1283
+ }
1284
+ return e[n] !== void 0;
1285
+ }), ae = (e) => Object.entries(e);
1286
+ function oe(e) {
1287
+ return typeof e == "object" && !!e;
1288
+ }
1289
+ function se(e) {
1290
+ return oe(e) && !function(e) {
1291
+ return Array.isArray(e);
1292
+ }(e);
1293
+ }
1294
+ function ce(e) {
1295
+ return function(e) {
1296
+ return oe(e);
1297
+ }(e) ? e : {};
1298
+ }
1299
+ let I = typeof window == "object" && window !== null ? window : typeof global == "object" && global !== null ? global : {};
1300
+ function le() {
1301
+ let e = (() => {
1302
+ let e = I.$locutus;
1303
+ typeof e == "object" && e || (e = {}, I.$locutus = e);
1304
+ let t = e.php;
1305
+ return typeof t == "object" && t || (t = {}, e.php = t), t;
1306
+ })(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a = se(t) ? t : {}, o = ((e) => se(e))(n) ? n : {}, s = ((e) => se(e))(r) ? r : {}, c = Array.isArray(i) ? i : [];
1307
+ t !== a && (e.ini = a), n !== o && (e.locales = o), r !== s && (e.localeCategories = s), i !== c && (e.pointers = c);
1308
+ let l = e.locale_default;
1309
+ return {
1310
+ ini: a,
1311
+ locales: o,
1312
+ localeCategories: s,
1313
+ pointers: c,
1314
+ locale_default: typeof l == "string" ? l : void 0
1315
+ };
1316
+ }
1317
+ function L(e) {
1318
+ let t = le().ini[e];
1319
+ return t && t.local_value !== void 0 ? t.local_value === null ? "" : String(t.local_value) : "";
1320
+ }
1321
+ function ue(e, t, n) {
1322
+ let r = function(e) {
1323
+ if (typeof e == "boolean") return e ? "1" : "";
1324
+ if (typeof e == "string") return e;
1325
+ if (typeof e == "number") return isNaN(e) ? "NAN" : isFinite(e) ? e + "" : (e < 0 ? "-" : "") + "INF";
1326
+ if (e === void 0) return "";
1327
+ if (typeof e == "object") return Array.isArray(e) ? "Array" : e === null ? "" : "Object";
1328
+ throw Error("Unsupported value type");
1329
+ }(e), i = L("unicode.semantics") === "on" ? r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || [] : null, a = i ? i.length : r.length, o = a;
1330
+ return t < 0 && (t += o), n !== void 0 && (o = n < 0 ? n + o : n + t), !(t > a || t < 0 || t > o) && (i ? i.slice(t, o).join("") : r.slice(t, o));
1331
+ }
1332
+ function de(e, ...t) {
1333
+ let n = {};
1334
+ if (t.length < 1) return n;
1335
+ let r = ce(e);
1336
+ e: for (let [e, i] of ae(r)) {
1337
+ for (let e of t) {
1338
+ let t = ce(e), n = !1;
1339
+ for (let [, e] of ae(t)) if (e === i) {
1340
+ n = !0;
1341
+ break;
1342
+ }
1343
+ if (!n) continue e;
1344
+ }
1345
+ n[e] = i;
1346
+ }
1347
+ return n;
1348
+ }
1349
+ let fe = (e) => {
1350
+ if (!e || typeof e != "object") return !1;
1351
+ let t = Object.getPrototypeOf(e);
1352
+ return t === Array.prototype || t === Object.prototype;
1353
+ };
1354
+ function pe(e, t = 0) {
1355
+ let n = 0;
1356
+ if (e == null) return 0;
1357
+ if (typeof e != "object") return 1;
1358
+ let r = Object.getPrototypeOf(e);
1359
+ if (r !== Array.prototype && r !== Object.prototype) return 1;
1360
+ let i = t === "COUNT_RECURSIVE" || t === 1;
1361
+ if (Array.isArray(e)) {
1362
+ for (let t of Object.keys(e)) {
1363
+ n++;
1364
+ let r = e[Number(t)];
1365
+ i && fe(r) && (n += pe(r, 1));
1366
+ }
1367
+ return n;
1368
+ }
1369
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t)) {
1370
+ n++;
1371
+ let r = e[t];
1372
+ i && fe(r) && (n += pe(r, 1));
1373
+ }
1374
+ return n;
1375
+ }
1376
+ let me = new N("implode", function(e, t) {
1377
+ return `implode(${e}, ${t})`;
1378
+ }, function(e, t, n) {
1379
+ return function(...e) {
1380
+ let t, n = "", r = "", i = "";
1381
+ if (e.length === 1) {
1382
+ let [n] = e;
1383
+ t = n;
1384
+ } else {
1385
+ let [n, r] = e;
1386
+ i = String(n ?? ""), t = r;
1387
+ }
1388
+ if (typeof t == "object" && t) {
1389
+ if (Array.isArray(t)) return t.join(i);
1390
+ for (let e in t) n += r + t[e], r = i;
1391
+ return n;
1392
+ }
1393
+ return String(t);
1394
+ }(t, n);
1395
+ }), he = new N("count", function(e, t) {
1396
+ let n = "";
1397
+ return t && (n = `, ${t}`), `count(${e}${n})`;
1398
+ }, function(e, t, n) {
1399
+ return pe(t, n);
1400
+ }), ge = new N("array_intersect", function(e, ...t) {
1401
+ let n = "";
1402
+ return t.length > 0 && (n = ", " + t.join(", ")), `array_intersect(${e}${n})`;
1403
+ }, function(e) {
1404
+ let t = [], n = !0;
1405
+ for (let e = 1; e < arguments.length; e++) t.push(arguments[e]), Array.isArray(arguments[e]) || (n = !1);
1406
+ let r = de.apply(null, t);
1407
+ return n ? Object.values(r) : r;
1408
+ });
1409
+ function _e(e, t) {
1410
+ let n, r = /* @__PURE__ */ new Date(), i = [
1411
+ "Sun",
1412
+ "Mon",
1413
+ "Tues",
1414
+ "Wednes",
1415
+ "Thurs",
1416
+ "Fri",
1417
+ "Satur",
1418
+ "January",
1419
+ "February",
1420
+ "March",
1421
+ "April",
1422
+ "May",
1423
+ "June",
1424
+ "July",
1425
+ "August",
1426
+ "September",
1427
+ "October",
1428
+ "November",
1429
+ "December"
1430
+ ], a = /\\?(.?)/gi, o = function(e, t) {
1431
+ return r = e, Object.prototype.hasOwnProperty.call(n, r) ? String(n[e]()) : t;
1432
+ var r;
1433
+ }, s = function(e, t) {
1434
+ let n = String(e);
1435
+ for (; n.length < t;) n = "0" + n;
1436
+ return n;
1437
+ };
1438
+ return n = {
1439
+ d: function() {
1440
+ return s(n.j(), 2);
1441
+ },
1442
+ D: function() {
1443
+ return String(n.l()).slice(0, 3);
1444
+ },
1445
+ j: function() {
1446
+ return r.getDate();
1447
+ },
1448
+ l: function() {
1449
+ return (i[Number(n.w())] ?? "") + "day";
1450
+ },
1451
+ N: function() {
1452
+ return Number(n.w()) || 7;
1453
+ },
1454
+ S: function() {
1455
+ let e = Number(n.j()), t = e % 10;
1456
+ return t <= 3 && Number.parseInt(String(e % 100 / 10), 10) === 1 && (t = 0), [
1457
+ "st",
1458
+ "nd",
1459
+ "rd"
1460
+ ][t - 1] || "th";
1461
+ },
1462
+ w: function() {
1463
+ return r.getDay();
1464
+ },
1465
+ z: function() {
1466
+ let e = new Date(Number(n.Y()), Number(n.n()) - 1, Number(n.j())), t = new Date(Number(n.Y()), 0, 1);
1467
+ return Math.round((e.getTime() - t.getTime()) / 864e5);
1468
+ },
1469
+ W: function() {
1470
+ let e = new Date(Number(n.Y()), Number(n.n()) - 1, Number(n.j()) - Number(n.N()) + 3), t = new Date(e.getFullYear(), 0, 4);
1471
+ return s(1 + Math.round((e.getTime() - t.getTime()) / 864e5 / 7), 2);
1472
+ },
1473
+ F: function() {
1474
+ return i[6 + Number(n.n())] ?? "";
1475
+ },
1476
+ m: function() {
1477
+ return s(n.n(), 2);
1478
+ },
1479
+ M: function() {
1480
+ return String(n.F()).slice(0, 3);
1481
+ },
1482
+ n: function() {
1483
+ return r.getMonth() + 1;
1484
+ },
1485
+ t: function() {
1486
+ return new Date(Number(n.Y()), Number(n.n()), 0).getDate();
1487
+ },
1488
+ L: function() {
1489
+ let e = Number(n.Y());
1490
+ return +(e % 4 == 0 && e % 100 != 0 || e % 400 == 0);
1491
+ },
1492
+ o: function() {
1493
+ let e = Number(n.n()), t = Number(n.W());
1494
+ return Number(n.Y()) + (e === 12 && t < 9 ? 1 : e === 1 && t > 9 ? -1 : 0);
1495
+ },
1496
+ Y: function() {
1497
+ return r.getFullYear();
1498
+ },
1499
+ y: function() {
1500
+ return String(n.Y()).slice(-2);
1501
+ },
1502
+ a: function() {
1503
+ return r.getHours() > 11 ? "pm" : "am";
1504
+ },
1505
+ A: function() {
1506
+ return String(n.a()).toUpperCase();
1507
+ },
1508
+ B: function() {
1509
+ let e = 3600 * r.getUTCHours(), t = 60 * r.getUTCMinutes(), n = r.getUTCSeconds();
1510
+ return s(Math.floor((e + t + n + 3600) / 86.4) % 1e3, 3);
1511
+ },
1512
+ g: function() {
1513
+ return Number(n.G()) % 12 || 12;
1514
+ },
1515
+ G: function() {
1516
+ return r.getHours();
1517
+ },
1518
+ h: function() {
1519
+ return s(n.g(), 2);
1520
+ },
1521
+ H: function() {
1522
+ return s(n.G(), 2);
1523
+ },
1524
+ i: function() {
1525
+ return s(r.getMinutes(), 2);
1526
+ },
1527
+ s: function() {
1528
+ return s(r.getSeconds(), 2);
1529
+ },
1530
+ u: function() {
1531
+ return s(1e3 * r.getMilliseconds(), 6);
1532
+ },
1533
+ e: function() {
1534
+ throw Error("Not supported (see source code of date() for timezone on how to add support)");
1535
+ },
1536
+ I: function() {
1537
+ let e = new Date(Number(n.Y()), 0), t = Date.UTC(Number(n.Y()), 0), r = new Date(Number(n.Y()), 6), i = Date.UTC(Number(n.Y()), 6);
1538
+ return e.getTime() - t === r.getTime() - i ? 0 : 1;
1539
+ },
1540
+ O: function() {
1541
+ let e = r.getTimezoneOffset(), t = Math.abs(e);
1542
+ return (e > 0 ? "-" : "+") + s(100 * Math.floor(t / 60) + t % 60, 4);
1543
+ },
1544
+ P: function() {
1545
+ let e = String(n.O());
1546
+ return e.slice(0, 3) + ":" + e.slice(3, 5);
1547
+ },
1548
+ T: function() {
1549
+ return "UTC";
1550
+ },
1551
+ Z: function() {
1552
+ return 60 * -r.getTimezoneOffset();
1553
+ },
1554
+ c: function() {
1555
+ return "Y-m-d\\TH:i:sP".replace(a, o);
1556
+ },
1557
+ r: function() {
1558
+ return "D, d M Y H:i:s O".replace(a, o);
1559
+ },
1560
+ U: function() {
1561
+ return r.getTime() / 1e3 | 0;
1562
+ }
1563
+ }, c = e, r = (l = t) === void 0 ? /* @__PURE__ */ new Date() : l instanceof Date ? new Date(l) : /* @__PURE__ */ new Date(1e3 * Number(l)), c.replace(a, o);
1564
+ var c, l;
1565
+ }
1566
+ let R = "[ \\t]*", z = "(?:([ap])\\.?m\\.?([\\t ]|$))", B = "(2[0-4]|[01]?[0-9])", ve = "([01][0-9]|2[0-4])", V = "(0?[1-9]|1[0-2])", ye = "([0-5][0-9])", be = "sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?", xe = "next|last|previous|this";
1567
+ "" + be;
1568
+ let H = "([0-9]{4})", Se = "(1[0-2]|0?[0-9])", U = "(0[0-9]|1[0-2])", W = "(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)", Ce = "(0[0-9]|[1-2][0-9]|3[01])", we = "january|february|march|april|may|june|july|august|september|october|november|december", Te = "jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec", G = "(" + we + "|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})";
1569
+ "" + B;
1570
+ let K = G + "[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*";
1571
+ function q(e, t) {
1572
+ switch (t?.toLowerCase()) {
1573
+ case "a":
1574
+ e += e === 12 ? -12 : 0;
1575
+ break;
1576
+ case "p": e += e === 12 ? 0 : 12;
1577
+ }
1578
+ return e;
1579
+ }
1580
+ function J(e) {
1581
+ let t = +e;
1582
+ return e.length < 4 && t < 100 && (t += t < 70 ? 2e3 : 1900), t;
1583
+ }
1584
+ function Y(e) {
1585
+ return {
1586
+ jan: 0,
1587
+ january: 0,
1588
+ i: 0,
1589
+ feb: 1,
1590
+ february: 1,
1591
+ ii: 1,
1592
+ mar: 2,
1593
+ march: 2,
1594
+ iii: 2,
1595
+ apr: 3,
1596
+ april: 3,
1597
+ iv: 3,
1598
+ may: 4,
1599
+ v: 4,
1600
+ jun: 5,
1601
+ june: 5,
1602
+ vi: 5,
1603
+ jul: 6,
1604
+ july: 6,
1605
+ vii: 6,
1606
+ aug: 7,
1607
+ august: 7,
1608
+ viii: 7,
1609
+ sep: 8,
1610
+ sept: 8,
1611
+ september: 8,
1612
+ ix: 8,
1613
+ oct: 9,
1614
+ october: 9,
1615
+ x: 9,
1616
+ nov: 10,
1617
+ november: 10,
1618
+ xi: 10,
1619
+ dec: 11,
1620
+ december: 11,
1621
+ xii: 11
1622
+ }[e.toLowerCase()] ?? NaN;
1623
+ }
1624
+ function Ee(e, t = 0) {
1625
+ return {
1626
+ mon: 1,
1627
+ monday: 1,
1628
+ tue: 2,
1629
+ tuesday: 2,
1630
+ wed: 3,
1631
+ wednesday: 3,
1632
+ thu: 4,
1633
+ thursday: 4,
1634
+ fri: 5,
1635
+ friday: 5,
1636
+ sat: 6,
1637
+ saturday: 6,
1638
+ sun: 0,
1639
+ sunday: 0
1640
+ }[e.toLowerCase()] || t;
1641
+ }
1642
+ function X(e, t = NaN) {
1643
+ let n = e?.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i);
1644
+ if (!n) return t;
1645
+ let r = n[1] === "-" ? -1 : 1, i = +(n[2] ?? 0), a = +(n[4] ?? 0);
1646
+ return n[4] || n[3] || (a = Math.floor(i % 100), i = Math.floor(i / 100)), r * (60 * i + a) * 60;
1647
+ }
1648
+ let Z = {
1649
+ acdt: 37800,
1650
+ acst: 34200,
1651
+ addt: -7200,
1652
+ adt: -10800,
1653
+ aedt: 39600,
1654
+ aest: 36e3,
1655
+ ahdt: -32400,
1656
+ ahst: -36e3,
1657
+ akdt: -28800,
1658
+ akst: -32400,
1659
+ amt: -13840,
1660
+ apt: -10800,
1661
+ ast: -14400,
1662
+ awdt: 32400,
1663
+ awst: 28800,
1664
+ awt: -10800,
1665
+ bdst: 7200,
1666
+ bdt: -36e3,
1667
+ bmt: -14309,
1668
+ bst: 3600,
1669
+ cast: 34200,
1670
+ cat: 7200,
1671
+ cddt: -14400,
1672
+ cdt: -18e3,
1673
+ cemt: 10800,
1674
+ cest: 7200,
1675
+ cet: 3600,
1676
+ cmt: -15408,
1677
+ cpt: -18e3,
1678
+ cst: -21600,
1679
+ cwt: -18e3,
1680
+ chst: 36e3,
1681
+ dmt: -1521,
1682
+ eat: 10800,
1683
+ eddt: -10800,
1684
+ edt: -14400,
1685
+ eest: 10800,
1686
+ eet: 7200,
1687
+ emt: -26248,
1688
+ ept: -14400,
1689
+ est: -18e3,
1690
+ ewt: -14400,
1691
+ ffmt: -14660,
1692
+ fmt: -4056,
1693
+ gdt: 39600,
1694
+ gmt: 0,
1695
+ gst: 36e3,
1696
+ hdt: -34200,
1697
+ hkst: 32400,
1698
+ hkt: 28800,
1699
+ hmt: -19776,
1700
+ hpt: -34200,
1701
+ hst: -36e3,
1702
+ hwt: -34200,
1703
+ iddt: 14400,
1704
+ idt: 10800,
1705
+ imt: 25025,
1706
+ ist: 7200,
1707
+ jdt: 36e3,
1708
+ jmt: 8440,
1709
+ jst: 32400,
1710
+ kdt: 36e3,
1711
+ kmt: 5736,
1712
+ kst: 30600,
1713
+ lst: 9394,
1714
+ mddt: -18e3,
1715
+ mdst: 16279,
1716
+ mdt: -21600,
1717
+ mest: 7200,
1718
+ met: 3600,
1719
+ mmt: 9017,
1720
+ mpt: -21600,
1721
+ msd: 14400,
1722
+ msk: 10800,
1723
+ mst: -25200,
1724
+ mwt: -21600,
1725
+ nddt: -5400,
1726
+ ndt: -9052,
1727
+ npt: -9e3,
1728
+ nst: -12600,
1729
+ nwt: -9e3,
1730
+ nzdt: 46800,
1731
+ nzmt: 41400,
1732
+ nzst: 43200,
1733
+ pddt: -21600,
1734
+ pdt: -25200,
1735
+ pkst: 21600,
1736
+ pkt: 18e3,
1737
+ plmt: 25590,
1738
+ pmt: -13236,
1739
+ ppmt: -17340,
1740
+ ppt: -25200,
1741
+ pst: -28800,
1742
+ pwt: -25200,
1743
+ qmt: -18840,
1744
+ rmt: 5794,
1745
+ sast: 7200,
1746
+ sdmt: -16800,
1747
+ sjmt: -20173,
1748
+ smt: -13884,
1749
+ sst: -39600,
1750
+ tbmt: 10751,
1751
+ tmt: 12344,
1752
+ uct: 0,
1753
+ utc: 0,
1754
+ wast: 7200,
1755
+ wat: 3600,
1756
+ wemt: 7200,
1757
+ west: 3600,
1758
+ wet: 0,
1759
+ wib: 25200,
1760
+ wita: 28800,
1761
+ wit: 32400,
1762
+ wmt: 5040,
1763
+ yddt: -25200,
1764
+ ydt: -28800,
1765
+ ypt: -28800,
1766
+ yst: -32400,
1767
+ ywt: -28800,
1768
+ a: 3600,
1769
+ b: 7200,
1770
+ c: 10800,
1771
+ d: 14400,
1772
+ e: 18e3,
1773
+ f: 21600,
1774
+ g: 25200,
1775
+ h: 28800,
1776
+ i: 32400,
1777
+ k: 36e3,
1778
+ l: 39600,
1779
+ m: 43200,
1780
+ n: -3600,
1781
+ o: -7200,
1782
+ p: -10800,
1783
+ q: -14400,
1784
+ r: -18e3,
1785
+ s: -21600,
1786
+ t: -25200,
1787
+ u: -28800,
1788
+ v: -32400,
1789
+ w: -36e3,
1790
+ x: -39600,
1791
+ y: -43200,
1792
+ z: 0
1793
+ }, Q = {
1794
+ yesterday: {
1795
+ regex: /^yesterday/i,
1796
+ name: "yesterday",
1797
+ callback() {
1798
+ return --this.rd, this.resetTime();
1799
+ }
1800
+ },
1801
+ now: {
1802
+ regex: /^now/i,
1803
+ name: "now"
1804
+ },
1805
+ noon: {
1806
+ regex: /^noon/i,
1807
+ name: "noon",
1808
+ callback() {
1809
+ return this.resetTime() && this.time(12, 0, 0, 0);
1810
+ }
1811
+ },
1812
+ midnightOrToday: {
1813
+ regex: /^(midnight|today)/i,
1814
+ name: "midnight | today",
1815
+ callback() {
1816
+ return this.resetTime();
1817
+ }
1818
+ },
1819
+ tomorrow: {
1820
+ regex: /^tomorrow/i,
1821
+ name: "tomorrow",
1822
+ callback() {
1823
+ return this.rd += 1, this.resetTime();
1824
+ }
1825
+ },
1826
+ timestamp: {
1827
+ regex: /^@(-?\d+)/i,
1828
+ name: "timestamp",
1829
+ callback(e, t) {
1830
+ return this.rs += +t, this.y = 1970, this.m = 0, this.d = 1, this.dates = 0, this.resetTime() && this.zone(0);
1831
+ }
1832
+ },
1833
+ firstOrLastDay: {
1834
+ regex: /^(first|last) day of/i,
1835
+ name: "firstdayof | lastdayof",
1836
+ callback(e, t) {
1837
+ t.toLowerCase() === "first" ? this.firstOrLastDayOfMonth = 1 : this.firstOrLastDayOfMonth = -1;
1838
+ }
1839
+ },
1840
+ backOrFrontOf: {
1841
+ regex: RegExp("^(back|front) of " + B + R + z + "?", "i"),
1842
+ name: "backof | frontof",
1843
+ callback(e, t, n, r) {
1844
+ let i = +n, a = 15;
1845
+ return t.toLowerCase() === "back" || (--i, a = 45), i = q(i, r), this.resetTime() && this.time(i, a, 0, 0);
1846
+ }
1847
+ },
1848
+ mssqltime: {
1849
+ regex: RegExp("^" + V + ":([0-5][0-9]):(60|[0-5][0-9])[:.]([0-9]+)(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
1850
+ name: "mssqltime",
1851
+ callback(e, t, n, r, i, a) {
1852
+ return this.time(q(+t, a), +n, +r, +i.substr(0, 3));
1853
+ }
1854
+ },
1855
+ oracledate: {
1856
+ regex: /^(\d{2})-([A-Z]{3})-(\d{2})$/i,
1857
+ name: "d-M-y",
1858
+ callback(e, t, n, r) {
1859
+ let i = {
1860
+ JAN: 0,
1861
+ FEB: 1,
1862
+ MAR: 2,
1863
+ APR: 3,
1864
+ MAY: 4,
1865
+ JUN: 5,
1866
+ JUL: 6,
1867
+ AUG: 7,
1868
+ SEP: 8,
1869
+ OCT: 9,
1870
+ NOV: 10,
1871
+ DEC: 11
1872
+ }[n.toUpperCase()] ?? NaN;
1873
+ return this.ymd(2e3 + parseInt(r, 10), i, parseInt(t, 10));
1874
+ }
1875
+ },
1876
+ timeLong12: {
1877
+ regex: RegExp("^" + V + "[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
1878
+ name: "timelong12",
1879
+ callback(e, t, n, r, i) {
1880
+ return this.time(q(+t, i), +n, +r, 0);
1881
+ }
1882
+ },
1883
+ timeShort12: {
1884
+ regex: RegExp("^" + V + "[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
1885
+ name: "timeshort12",
1886
+ callback(e, t, n, r) {
1887
+ return this.time(q(+t, r), +n, 0, 0);
1888
+ }
1889
+ },
1890
+ timeTiny12: {
1891
+ regex: RegExp("^" + V + R + z, "i"),
1892
+ name: "timetiny12",
1893
+ callback(e, t, n) {
1894
+ return this.time(q(+t, n), 0, 0, 0);
1895
+ }
1896
+ },
1897
+ soap: {
1898
+ regex: RegExp("^" + H + "-(0[0-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])(?:\\.([0-9]+))((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)?", "i"),
1899
+ name: "soap",
1900
+ callback(e, t, n, r, i, a, o, s, c) {
1901
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(X(c));
1902
+ }
1903
+ },
1904
+ wddx: {
1905
+ regex: RegExp("^" + H + "-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)T(2[0-4]|[01]?[0-9]):([0-5]?[0-9]):(60|[0-5]?[0-9])"),
1906
+ name: "wddx",
1907
+ callback(e, t, n, r, i, a, o) {
1908
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1909
+ }
1910
+ },
1911
+ exif: {
1912
+ regex: RegExp("^" + H + ":(0[0-9]|1[0-2]):(0[0-9]|[1-2][0-9]|3[01]) ([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])", "i"),
1913
+ name: "exif",
1914
+ callback(e, t, n, r, i, a, o) {
1915
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1916
+ }
1917
+ },
1918
+ xmlRpc: {
1919
+ regex: RegExp("^" + H + U + Ce + "T(2[0-4]|[01]?[0-9]):([0-5][0-9]):(60|[0-5][0-9])"),
1920
+ name: "xmlrpc",
1921
+ callback(e, t, n, r, i, a, o) {
1922
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1923
+ }
1924
+ },
1925
+ xmlRpcNoColon: {
1926
+ regex: RegExp("^" + H + U + Ce + "[Tt](2[0-4]|[01]?[0-9])([0-5][0-9])(60|[0-5][0-9])"),
1927
+ name: "xmlrpcnocolon",
1928
+ callback(e, t, n, r, i, a, o) {
1929
+ return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
1930
+ }
1931
+ },
1932
+ clf: {
1933
+ regex: RegExp("^" + W + "/(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)/([0-9]{4}):([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])[ \\t]+((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
1934
+ name: "clf",
1935
+ callback(e, t, n, r, i, a, o, s) {
1936
+ return this.ymd(+r, Y(n), +t) && this.time(+i, +a, +o, 0) && this.zone(X(s));
1937
+ }
1938
+ },
1939
+ iso8601long: {
1940
+ regex: RegExp("^t?" + B + "[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])(?:\\.([0-9]+))", "i"),
1941
+ name: "iso8601long",
1942
+ callback(e, t, n, r, i) {
1943
+ return this.time(+t, +n, +r, +i.substr(0, 3));
1944
+ }
1945
+ },
1946
+ dateTextual: {
1947
+ regex: RegExp("^" + G + "[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]+([0-9]{1,4})", "i"),
1948
+ name: "datetextual",
1949
+ callback(e, t, n, r) {
1950
+ return this.ymd(J(r), Y(t), +n);
1951
+ }
1952
+ },
1953
+ pointedDate4: {
1954
+ regex: RegExp("^" + W + "[.\\t-](1[0-2]|0?[0-9])[.-]([0-9]{4})"),
1955
+ name: "pointeddate4",
1956
+ callback(e, t, n, r) {
1957
+ return this.ymd(+r, n - 1, +t);
1958
+ }
1959
+ },
1960
+ pointedDate2: {
1961
+ regex: RegExp("^" + W + "[.\\t](1[0-2]|0?[0-9])\\.([0-9]{2})"),
1962
+ name: "pointeddate2",
1963
+ callback(e, t, n, r) {
1964
+ return this.ymd(J(r), n - 1, +t);
1965
+ }
1966
+ },
1967
+ timeLong24: {
1968
+ regex: RegExp("^t?" + B + "[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])"),
1969
+ name: "timelong24",
1970
+ callback(e, t, n, r) {
1971
+ return this.time(+t, +n, +r, 0);
1972
+ }
1973
+ },
1974
+ dateNoColon: {
1975
+ regex: RegExp("^" + H + U + Ce),
1976
+ name: "datenocolon",
1977
+ callback(e, t, n, r) {
1978
+ return this.ymd(+t, n - 1, +r);
1979
+ }
1980
+ },
1981
+ pgydotd: {
1982
+ regex: RegExp("^" + H + "\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),
1983
+ name: "pgydotd",
1984
+ callback(e, t, n) {
1985
+ return this.ymd(+t, 0, +n);
1986
+ }
1987
+ },
1988
+ timeShort24: {
1989
+ regex: RegExp("^t?" + B + "[:.]([0-5]?[0-9])", "i"),
1990
+ name: "timeshort24",
1991
+ callback(e, t, n) {
1992
+ return this.time(+t, +n, 0, 0);
1993
+ }
1994
+ },
1995
+ iso8601noColon: {
1996
+ regex: RegExp("^t?" + ve + ye + "(60|[0-5][0-9])", "i"),
1997
+ name: "iso8601nocolon",
1998
+ callback(e, t, n, r) {
1999
+ return this.time(+t, +n, +r, 0);
2000
+ }
2001
+ },
2002
+ iso8601dateSlash: {
2003
+ regex: RegExp("^" + H + "/(0[0-9]|1[0-2])/(0[0-9]|[1-2][0-9]|3[01])/"),
2004
+ name: "iso8601dateslash",
2005
+ callback(e, t, n, r) {
2006
+ return this.ymd(+t, n - 1, +r);
2007
+ }
2008
+ },
2009
+ dateSlash: {
2010
+ regex: RegExp("^" + H + "/(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2011
+ name: "dateslash",
2012
+ callback(e, t, n, r) {
2013
+ return this.ymd(+t, n - 1, +r);
2014
+ }
2015
+ },
2016
+ american: {
2017
+ regex: RegExp("^" + Se + "/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)/([0-9]{1,4})"),
2018
+ name: "american",
2019
+ callback(e, t, n, r) {
2020
+ return this.ymd(J(r), t - 1, +n);
2021
+ }
2022
+ },
2023
+ americanShort: {
2024
+ regex: RegExp("^" + Se + "/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2025
+ name: "americanshort",
2026
+ callback(e, t, n) {
2027
+ return this.ymd(this.y, t - 1, +n);
2028
+ }
2029
+ },
2030
+ gnuDateShortOrIso8601date2: {
2031
+ regex: RegExp("^([0-9]{1,4})-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
2032
+ name: "gnudateshort | iso8601date2",
2033
+ callback(e, t, n, r) {
2034
+ return this.ymd(J(t), n - 1, +r);
2035
+ }
2036
+ },
2037
+ iso8601date4: {
2038
+ regex: RegExp("^([+-]?[0-9]{4})-" + U + "-(0[0-9]|[1-2][0-9]|3[01])"),
2039
+ name: "iso8601date4",
2040
+ callback(e, t, n, r) {
2041
+ return this.ymd(+t, n - 1, +r);
2042
+ }
2043
+ },
2044
+ gnuNoColon: {
2045
+ regex: RegExp("^t?" + ve + ye, "i"),
2046
+ name: "gnunocolon",
2047
+ callback(e, t, n) {
2048
+ switch (this.times) {
2049
+ case 0: return this.time(+t, +n, 0, this.f);
2050
+ case 1: return this.y = 100 * t + +n, this.times++, !0;
2051
+ default: return !1;
2052
+ }
2053
+ }
2054
+ },
2055
+ gnuDateShorter: {
2056
+ regex: RegExp("^" + H + "-(1[0-2]|0?[0-9])"),
2057
+ name: "gnudateshorter",
2058
+ callback(e, t, n) {
2059
+ return this.ymd(+t, n - 1, 1);
2060
+ }
2061
+ },
2062
+ pgTextReverse: {
2063
+ regex: RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-(" + Te + ")-(0[0-9]|[1-2][0-9]|3[01])", "i"),
2064
+ name: "pgtextreverse",
2065
+ callback(e, t, n, r) {
2066
+ return this.ymd(J(t), Y(n), +r);
2067
+ }
2068
+ },
2069
+ dateFull: {
2070
+ regex: RegExp("^" + W + "[ \\t.-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ \\t.-]*([0-9]{1,4})", "i"),
2071
+ name: "datefull",
2072
+ callback(e, t, n, r) {
2073
+ return this.ymd(J(r), Y(n), +t);
2074
+ }
2075
+ },
2076
+ dateNoDay: {
2077
+ regex: RegExp("^" + G + "[ .\\t-]*([0-9]{4})", "i"),
2078
+ name: "datenoday",
2079
+ callback(e, t, n) {
2080
+ return this.ymd(+n, Y(t), 1);
2081
+ }
2082
+ },
2083
+ dateNoDayRev: {
2084
+ regex: RegExp("^" + H + "[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
2085
+ name: "datenodayrev",
2086
+ callback(e, t, n) {
2087
+ return this.ymd(+t, Y(n), 1);
2088
+ }
2089
+ },
2090
+ pgTextShort: {
2091
+ regex: RegExp("^(" + Te + ")-(0[0-9]|[1-2][0-9]|3[01])-([0-9]{1,4})", "i"),
2092
+ name: "pgtextshort",
2093
+ callback(e, t, n, r) {
2094
+ return this.ymd(J(r), Y(t), +n);
2095
+ }
2096
+ },
2097
+ dateNoYear: {
2098
+ regex: RegExp("^" + K, "i"),
2099
+ name: "datenoyear",
2100
+ callback(e, t, n) {
2101
+ return this.ymd(this.y, Y(t), +n);
2102
+ }
2103
+ },
2104
+ dateNoYearRev: {
2105
+ regex: RegExp("^" + W + "[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
2106
+ name: "datenoyearrev",
2107
+ callback(e, t, n) {
2108
+ return this.ymd(this.y, Y(n), +t);
2109
+ }
2110
+ },
2111
+ isoWeekDay: {
2112
+ regex: RegExp("^" + H + "-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),
2113
+ name: "isoweekday | isoweek",
2114
+ callback(e, t, n, r) {
2115
+ let i = r ? +r : 1;
2116
+ if (!this.ymd(+t, 0, 1)) return !1;
2117
+ let a = new Date(this.y, this.m, this.d).getDay();
2118
+ return a = 0 - (a > 4 ? a - 7 : a), this.rd += a + 7 * (n - 1) + i, !0;
2119
+ }
2120
+ },
2121
+ relativeText: {
2122
+ regex: RegExp("^(first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth|" + xe + ")[ \\t]+((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?)", "i"),
2123
+ name: "relativetext",
2124
+ callback(e, t, n) {
2125
+ let { amount: r } = function(e) {
2126
+ let t = e.toLowerCase();
2127
+ return {
2128
+ amount: {
2129
+ last: -1,
2130
+ previous: -1,
2131
+ this: 0,
2132
+ first: 1,
2133
+ next: 1,
2134
+ second: 2,
2135
+ third: 3,
2136
+ fourth: 4,
2137
+ fifth: 5,
2138
+ sixth: 6,
2139
+ seventh: 7,
2140
+ eight: 8,
2141
+ eighth: 8,
2142
+ ninth: 9,
2143
+ tenth: 10,
2144
+ eleventh: 11,
2145
+ twelfth: 12
2146
+ }[t] ?? 0,
2147
+ behavior: { this: 1 }[t] || 0
2148
+ };
2149
+ }(t);
2150
+ switch (n.toLowerCase()) {
2151
+ case "sec":
2152
+ case "secs":
2153
+ case "second":
2154
+ case "seconds":
2155
+ this.rs += r;
2156
+ break;
2157
+ case "min":
2158
+ case "mins":
2159
+ case "minute":
2160
+ case "minutes":
2161
+ this.ri += r;
2162
+ break;
2163
+ case "hour":
2164
+ case "hours":
2165
+ this.rh += r;
2166
+ break;
2167
+ case "day":
2168
+ case "days":
2169
+ this.rd += r;
2170
+ break;
2171
+ case "fortnight":
2172
+ case "fortnights":
2173
+ case "forthnight":
2174
+ case "forthnights":
2175
+ this.rd += 14 * r;
2176
+ break;
2177
+ case "week":
2178
+ case "weeks":
2179
+ this.rd += 7 * r;
2180
+ break;
2181
+ case "month":
2182
+ case "months":
2183
+ this.rm += r;
2184
+ break;
2185
+ case "year":
2186
+ case "years":
2187
+ this.ry += r;
2188
+ break;
2189
+ case "mon":
2190
+ case "monday":
2191
+ case "tue":
2192
+ case "tuesday":
2193
+ case "wed":
2194
+ case "wednesday":
2195
+ case "thu":
2196
+ case "thursday":
2197
+ case "fri":
2198
+ case "friday":
2199
+ case "sat":
2200
+ case "saturday":
2201
+ case "sun":
2202
+ case "sunday": this.resetTime(), this.weekday = Ee(n, 7), this.weekdayBehavior = 1, this.rd += 7 * (r > 0 ? r - 1 : r);
2203
+ }
2204
+ }
2205
+ },
2206
+ relative: {
2207
+ regex: RegExp("^([+-]*)[ \\t]*(\\d+)" + R + "((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?|week)", "i"),
2208
+ name: "relative",
2209
+ callback(e, t, n, r) {
2210
+ let i = n * (-1) ** t.replace(/[^-]/g, "").length;
2211
+ switch (r.toLowerCase()) {
2212
+ case "sec":
2213
+ case "secs":
2214
+ case "second":
2215
+ case "seconds":
2216
+ this.rs += i;
2217
+ break;
2218
+ case "min":
2219
+ case "mins":
2220
+ case "minute":
2221
+ case "minutes":
2222
+ this.ri += i;
2223
+ break;
2224
+ case "hour":
2225
+ case "hours":
2226
+ this.rh += i;
2227
+ break;
2228
+ case "day":
2229
+ case "days":
2230
+ this.rd += i;
2231
+ break;
2232
+ case "fortnight":
2233
+ case "fortnights":
2234
+ case "forthnight":
2235
+ case "forthnights":
2236
+ this.rd += 14 * i;
2237
+ break;
2238
+ case "week":
2239
+ case "weeks":
2240
+ this.rd += 7 * i;
2241
+ break;
2242
+ case "month":
2243
+ case "months":
2244
+ this.rm += i;
2245
+ break;
2246
+ case "year":
2247
+ case "years":
2248
+ this.ry += i;
2249
+ break;
2250
+ case "mon":
2251
+ case "monday":
2252
+ case "tue":
2253
+ case "tuesday":
2254
+ case "wed":
2255
+ case "wednesday":
2256
+ case "thu":
2257
+ case "thursday":
2258
+ case "fri":
2259
+ case "friday":
2260
+ case "sat":
2261
+ case "saturday":
2262
+ case "sun":
2263
+ case "sunday": this.resetTime(), this.weekday = Ee(r, 7), this.weekdayBehavior = 1, this.rd += 7 * (i > 0 ? i - 1 : i);
2264
+ }
2265
+ }
2266
+ },
2267
+ dayText: {
2268
+ regex: RegExp("^(" + be + ")", "i"),
2269
+ name: "daytext",
2270
+ callback(e, t) {
2271
+ this.resetTime(), this.weekday = Ee(t, 0), this.weekdayBehavior !== 2 && (this.weekdayBehavior = 1);
2272
+ }
2273
+ },
2274
+ relativeTextWeek: {
2275
+ regex: RegExp("^(" + xe + ")[ \\t]+week", "i"),
2276
+ name: "relativetextweek",
2277
+ callback(e, t) {
2278
+ switch (this.weekdayBehavior = 2, t.toLowerCase()) {
2279
+ case "this":
2280
+ this.rd += 0;
2281
+ break;
2282
+ case "next":
2283
+ this.rd += 7;
2284
+ break;
2285
+ case "last":
2286
+ case "previous": this.rd -= 7;
2287
+ }
2288
+ isNaN(this.weekday) && (this.weekday = 1);
2289
+ }
2290
+ },
2291
+ monthFullOrMonthAbbr: {
2292
+ regex: RegExp("^(" + we + "|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)", "i"),
2293
+ name: "monthfull | monthabbr",
2294
+ callback(e, t) {
2295
+ return this.ymd(this.y, Y(t), this.d);
2296
+ }
2297
+ },
2298
+ tzCorrection: {
2299
+ regex: RegExp("^((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
2300
+ name: "tzcorrection",
2301
+ callback(e) {
2302
+ return this.zone(X(e));
2303
+ }
2304
+ },
2305
+ tzAbbr: {
2306
+ regex: /* @__PURE__ */ RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),
2307
+ name: "tzabbr",
2308
+ callback(e, t) {
2309
+ let n = Z[t.toLowerCase()];
2310
+ return n != null && !Number.isNaN(n) && this.zone(n);
2311
+ }
2312
+ },
2313
+ ago: {
2314
+ regex: /^ago/i,
2315
+ name: "ago",
2316
+ callback() {
2317
+ this.ry = -this.ry, this.rm = -this.rm, this.rd = -this.rd, this.rh = -this.rh, this.ri = -this.ri, this.rs = -this.rs, this.rf = -this.rf;
2318
+ }
2319
+ },
2320
+ year4: {
2321
+ regex: RegExp("^" + H),
2322
+ name: "year4",
2323
+ callback(e, t) {
2324
+ return this.y = +t, !0;
2325
+ }
2326
+ },
2327
+ whitespace: {
2328
+ regex: /^[ .,\t]+/,
2329
+ name: "whitespace"
2330
+ },
2331
+ dateShortWithTimeLong: {
2332
+ regex: RegExp("^" + K + "t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])", "i"),
2333
+ name: "dateshortwithtimelong",
2334
+ callback(e, t, n, r, i, a) {
2335
+ return this.ymd(this.y, Y(t), +n) && this.time(+r, +i, +a, 0);
2336
+ }
2337
+ },
2338
+ dateShortWithTimeLong12: {
2339
+ regex: RegExp("^" + K + V + "[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2340
+ name: "dateshortwithtimelong12",
2341
+ callback(e, t, n, r, i, a, o) {
2342
+ return this.ymd(this.y, Y(t), +n) && this.time(q(+r, o), +i, +a, 0);
2343
+ }
2344
+ },
2345
+ dateShortWithTimeShort: {
2346
+ regex: RegExp("^" + K + "t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])", "i"),
2347
+ name: "dateshortwithtimeshort",
2348
+ callback(e, t, n, r, i) {
2349
+ return this.ymd(this.y, Y(t), +n) && this.time(+r, +i, 0, 0);
2350
+ }
2351
+ },
2352
+ dateShortWithTimeShort12: {
2353
+ regex: RegExp("^" + K + V + "[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
2354
+ name: "dateshortwithtimeshort12",
2355
+ callback(e, t, n, r, i, a) {
2356
+ return this.ymd(this.y, Y(t), +n) && this.time(q(+r, a), +i, 0, 0);
2357
+ }
2358
+ }
2359
+ }, De = {
2360
+ y: NaN,
2361
+ m: NaN,
2362
+ d: NaN,
2363
+ h: NaN,
2364
+ i: NaN,
2365
+ s: NaN,
2366
+ f: NaN,
2367
+ ry: 0,
2368
+ rm: 0,
2369
+ rd: 0,
2370
+ rh: 0,
2371
+ ri: 0,
2372
+ rs: 0,
2373
+ rf: 0,
2374
+ weekday: NaN,
2375
+ weekdayBehavior: 0,
2376
+ firstOrLastDayOfMonth: 0,
2377
+ z: NaN,
2378
+ dates: 0,
2379
+ times: 0,
2380
+ zones: 0,
2381
+ ymd(e, t, n) {
2382
+ return !(this.dates > 0) && (this.dates++, this.y = e, this.m = t, this.d = n, !0);
2383
+ },
2384
+ time(e, t, n, r) {
2385
+ return !(this.times > 0) && (this.times++, this.h = e, this.i = t, this.s = n, this.f = r, !0);
2386
+ },
2387
+ resetTime() {
2388
+ return this.h = 0, this.i = 0, this.s = 0, this.f = 0, this.times = 0, !0;
2389
+ },
2390
+ zone(e) {
2391
+ return this.zones <= 1 && (this.zones++, this.z = e, !0);
2392
+ },
2393
+ toDate(e) {
2394
+ switch (this.dates && !this.times && (this.h = this.i = this.s = this.f = 0), isNaN(this.y) && (this.y = e.getFullYear()), isNaN(this.m) && (this.m = e.getMonth()), isNaN(this.d) && (this.d = e.getDate()), isNaN(this.h) && (this.h = e.getHours()), isNaN(this.i) && (this.i = e.getMinutes()), isNaN(this.s) && (this.s = e.getSeconds()), isNaN(this.f) && (this.f = e.getMilliseconds()), this.firstOrLastDayOfMonth) {
2395
+ case 1:
2396
+ this.d = 1;
2397
+ break;
2398
+ case -1: this.d = 0, this.m += 1;
2399
+ }
2400
+ if (!isNaN(this.weekday)) {
2401
+ let t = new Date(e.getTime());
2402
+ t.setFullYear(this.y, this.m, this.d), t.setHours(this.h, this.i, this.s, this.f);
2403
+ let n = t.getDay();
2404
+ if (this.weekdayBehavior === 2) n === 0 && this.weekday !== 0 && (this.weekday = -6), this.weekday === 0 && n !== 0 && (this.weekday = 7), this.d -= n, this.d += this.weekday;
2405
+ else {
2406
+ let e = this.weekday - n;
2407
+ (this.rd < 0 && e < 0 || this.rd >= 0 && e <= -this.weekdayBehavior) && (e += 7), this.weekday >= 0 ? this.d += e : this.d -= 7 - (Math.abs(this.weekday) - n), this.weekday = NaN;
2408
+ }
2409
+ }
2410
+ this.y += this.ry, this.m += this.rm, this.d += this.rd, this.h += this.rh, this.i += this.ri, this.s += this.rs, this.f += this.rf, this.ry = this.rm = this.rd = 0, this.rh = this.ri = this.rs = this.rf = 0;
2411
+ let t = new Date(e.getTime());
2412
+ switch (t.setFullYear(this.y, this.m, this.d), t.setHours(this.h, this.i, this.s, this.f), this.firstOrLastDayOfMonth) {
2413
+ case 1:
2414
+ t.setDate(1);
2415
+ break;
2416
+ case -1: t.setMonth(t.getMonth() + 1, 0);
2417
+ }
2418
+ return isNaN(this.z) || t.getTimezoneOffset() === this.z || (t.setUTCFullYear(t.getFullYear(), t.getMonth(), t.getDate()), t.setUTCHours(t.getHours(), t.getMinutes(), t.getSeconds() - this.z, t.getMilliseconds())), t;
2419
+ }
2420
+ };
2421
+ e.AbstractProvider = F, e.ArrayAdapter = A, e.ArrayProvider = class extends F {
2422
+ getFunctions() {
2423
+ return [
2424
+ me,
2425
+ he,
2426
+ ge
2427
+ ];
2428
+ }
2429
+ }, e.BasicProvider = class extends F {
2430
+ getFunctions() {
2431
+ return [ie];
2432
+ }
2433
+ }, e.Compiler = ne, e.DateProvider = class extends F {
2434
+ getFunctions() {
2435
+ return [new N("date", function(e, t) {
2436
+ let n = "";
2437
+ return t && (n = `, ${t}`), `date(${e}${n})`;
2438
+ }, function(e, t, n) {
2439
+ return _e(t, n);
2440
+ }), new N("strtotime", function(e, t) {
2441
+ let n = "";
2442
+ return t && (n = `, ${t}`), `strtotime(${e}${n})`;
2443
+ }, function(e, t, n) {
2444
+ return function(e, t) {
2445
+ let n = t ?? Math.floor(Date.now() / 1e3), r = [
2446
+ Q.yesterday,
2447
+ Q.now,
2448
+ Q.noon,
2449
+ Q.midnightOrToday,
2450
+ Q.tomorrow,
2451
+ Q.timestamp,
2452
+ Q.firstOrLastDay,
2453
+ Q.backOrFrontOf,
2454
+ Q.timeTiny12,
2455
+ Q.timeShort12,
2456
+ Q.timeLong12,
2457
+ Q.mssqltime,
2458
+ Q.oracledate,
2459
+ Q.timeShort24,
2460
+ Q.timeLong24,
2461
+ Q.iso8601long,
2462
+ Q.gnuNoColon,
2463
+ Q.iso8601noColon,
2464
+ Q.americanShort,
2465
+ Q.american,
2466
+ Q.iso8601date4,
2467
+ Q.iso8601dateSlash,
2468
+ Q.dateSlash,
2469
+ Q.gnuDateShortOrIso8601date2,
2470
+ Q.gnuDateShorter,
2471
+ Q.dateFull,
2472
+ Q.pointedDate4,
2473
+ Q.pointedDate2,
2474
+ Q.dateNoDay,
2475
+ Q.dateNoDayRev,
2476
+ Q.dateTextual,
2477
+ Q.dateNoYear,
2478
+ Q.dateNoYearRev,
2479
+ Q.dateNoColon,
2480
+ Q.xmlRpc,
2481
+ Q.xmlRpcNoColon,
2482
+ Q.soap,
2483
+ Q.wddx,
2484
+ Q.exif,
2485
+ Q.pgydotd,
2486
+ Q.isoWeekDay,
2487
+ Q.pgTextShort,
2488
+ Q.pgTextReverse,
2489
+ Q.clf,
2490
+ Q.year4,
2491
+ Q.ago,
2492
+ Q.dayText,
2493
+ Q.relativeTextWeek,
2494
+ Q.relativeText,
2495
+ Q.monthFullOrMonthAbbr,
2496
+ Q.tzCorrection,
2497
+ Q.tzAbbr,
2498
+ Q.dateShortWithTimeShort12,
2499
+ Q.dateShortWithTimeLong12,
2500
+ Q.dateShortWithTimeShort,
2501
+ Q.dateShortWithTimeLong,
2502
+ Q.relative,
2503
+ Q.whitespace
2504
+ ], i = { ...De };
2505
+ for (; e.length;) {
2506
+ let t = null, n = null;
2507
+ for (let i of r) {
2508
+ let r = e.match(i.regex);
2509
+ r && (!t || r[0].length > t[0].length) && (t = r, n = i);
2510
+ }
2511
+ if (!n || !t || n.callback && !1 === n.callback.apply(i, t)) return !1;
2512
+ e = e.substr(t[0].length), n = null, t = null;
2513
+ }
2514
+ return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
2515
+ }(t, n);
2516
+ })];
2517
+ }
2518
+ }, e.ExpressionFunction = N, e.ExpressionLanguage = P, e.IGNORE_UNKNOWN_FUNCTIONS = 2, e.IGNORE_UNKNOWN_VARIABLES = 1, e.Parser = D, e.StringProvider = class extends F {
2519
+ getFunctions() {
2520
+ return [
2521
+ new N("strtolower", (e) => "strtolower(" + e + ")", (e, t) => function(e) {
2522
+ return (e + "").toLowerCase();
2523
+ }(t)),
2524
+ new N("strtoupper", (e) => "strtoupper(" + e + ")", (e, t) => function(e) {
2525
+ return (e + "").toUpperCase();
2526
+ }(t)),
2527
+ new N("explode", (e, t, n = "null") => `explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => function(...e) {
2528
+ let [t, n, r] = e, i = t, a = n;
2529
+ if (e.length < 2 || i === void 0 || a === void 0) return null;
2530
+ if (i === "" || !1 === i || i === null) return !1;
2531
+ if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
2532
+ !0 === i && (i = "1");
2533
+ let o = i + "", s = (a + "").split(o);
2534
+ return r === void 0 ? s : (r === 0 && (r = 1), r > 0 ? r >= s.length ? s : s.slice(0, r - 1).concat([s.slice(r - 1).join(o)]) : -r >= s.length ? [] : (s.splice(s.length + r), s));
2535
+ }(t, n, r)),
2536
+ new N("strlen", function(e) {
2537
+ return `strlen(${e});`;
2538
+ }, function(e, t) {
2539
+ return function(e) {
2540
+ let t = e + "";
2541
+ if ((L("unicode.semantics") || "off") === "off") return t.length;
2542
+ let n = 0, r = 0, i = function(e, t) {
2543
+ let n = e.charCodeAt(t);
2544
+ if (n >= 55296 && n <= 56319) {
2545
+ if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
2546
+ let n = e.charCodeAt(t + 1);
2547
+ if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
2548
+ return e.charAt(t) + e.charAt(t + 1);
2549
+ }
2550
+ if (n >= 56320 && n <= 57343) {
2551
+ if (t === 0) throw Error("Low surrogate without preceding high surrogate");
2552
+ let n = e.charCodeAt(t - 1);
2553
+ if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
2554
+ return !1;
2555
+ }
2556
+ return e.charAt(t);
2557
+ };
2558
+ for (n = 0, r = 0; n < t.length; n++) !1 !== i(t, n) && r++;
2559
+ return r;
2560
+ }(t);
2561
+ }),
2562
+ new N("strstr", function(e, t, n) {
2563
+ let r = "";
2564
+ return n && (r = `, ${n}`), `strstr(${e}, ${t}${r});`;
2565
+ }, function(e, t, n, r) {
2566
+ return function(e, t, n) {
2567
+ let r = 0;
2568
+ return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
2569
+ }(t, n, r);
2570
+ }),
2571
+ new N("stristr", function(e, t, n) {
2572
+ let r = "";
2573
+ return n && (r = `, ${n}`), `stristr(${e}, ${t}${r});`;
2574
+ }, function(e, t, n, r) {
2575
+ return function(e, t, n) {
2576
+ let r = 0;
2577
+ return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
2578
+ }(t, n, r);
2579
+ }),
2580
+ new N("substr", function(e, t, n) {
2581
+ let r = "";
2582
+ return n && (r = `, ${n}`), `substr(${e}, ${t}${r});`;
2583
+ }, function(e, t, n, r) {
2584
+ return ue(t, n, r);
2585
+ })
2586
+ ];
2587
+ }
2588
+ }, e.default = P, e.tokenize = o, Object.defineProperty(e, "__esModule", { value: !0 });
2589
+ }), function(e) {
2590
+ var t = e.ExpressionLanguage;
2591
+ if (t && typeof t.ExpressionLanguage == "function") {
2592
+ var n = t.ExpressionLanguage;
2593
+ Object.keys(t).forEach(function(e) {
2594
+ e in n || (n[e] = t[e]);
2595
+ }), e.ExpressionLanguage = n;
2596
+ }
2597
+ }(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : e);
2598
+ })))(), 1), Se = null;
2599
+ function U() {
2600
+ let e = H, t = e.ExpressionLanguage || e.default || H;
2601
+ if (typeof t != "function") throw TypeError("Unable to resolve expression-language constructor.");
2602
+ return t;
2603
+ }
2604
+ function W() {
2605
+ return Se ??= new (U())(), Se;
2606
+ }
2607
+ function Ce(e) {
2608
+ return (e.formula?.expression || e.formula?.formula || "").trim();
2609
+ }
2610
+ function we(e) {
2611
+ return Object.entries(e.formula?.variables || {}).filter((e) => !!e[1]?.sourceKey);
2612
+ }
2613
+ function Te(e, t) {
2614
+ return Object.entries(e).forEach(([t, n]) => {
2615
+ if (Array.isArray(n)) {
2616
+ e[t] = n.map((e) => typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : e);
2617
+ return;
2618
+ }
2619
+ typeof n == "string" && n.trim() !== "" && !Number.isNaN(Number(n)) && (e[t] = Number(n));
2620
+ }), e;
2621
+ }
2622
+ function G(e, t) {
2623
+ if (t.formatting !== "number") return typeof e == "number" || typeof e == "string" ? e : "";
2624
+ let n = e;
2625
+ Array.isArray(n) && (n = n.reduce((e, t) => e + Number(t || 0), 0));
2626
+ let r = typeof t.decimals == "number" ? t.decimals : 0, i = Number(n || 0).toFixed(r);
2627
+ return `${t.prefix || ""}${i}${t.suffix || ""}`;
2628
+ }
2629
+ function K(e, t) {
2630
+ let n = e.type?.endsWith("\\Number");
2631
+ return e.type?.endsWith("\\Checkboxes") ? Array.isArray(t) ? t.length ? t : "" : t ? [t] : "" : Array.isArray(t) ? t.length ? n ? t.map((e) => Number(e || 0)) : t : "" : n ? Number(t || 0) : t;
2632
+ }
2633
+ function q(e, t, n) {
2634
+ return G(W().evaluate(e, t), n);
2635
+ }
2636
+ var Ae = (() => {
2637
+ let e = Intl.Segmenter;
2638
+ return e ? new e(void 0, { granularity: "grapheme" }) : null;
2639
+ })(), je = /[\p{L}\p{N}\p{M}]+(?:['’._-][\p{L}\p{N}\p{M}]+)*/gu;
2640
+ function Me(e) {
2641
+ return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent || "" : e.replace(/<[^>]*>/g, " ");
2642
+ }
2643
+ function Ne(e) {
2644
+ return Me(e);
2645
+ }
2646
+ function Pe(e) {
2647
+ return Ne(e).replace(/[\s\t\n\r]+/g, " ").trim();
2648
+ }
2649
+ function Fe(e) {
2650
+ return Ae ? Array.from(Ae.segment(e)).length : Array.from(e).length;
2651
+ }
2652
+ function Ie(e) {
2653
+ return e.match(je)?.length || 0;
2654
+ }
2655
+ function Le(e) {
2656
+ let t = Ne(e), n = Pe(e);
2657
+ return {
2658
+ graphemeCount: Fe(t),
2659
+ wordCount: Ie(n)
2660
+ };
2661
+ }
2662
+ //#endregion
2663
+ export { g as a, we as c, Te as i, K as n, h as o, Le as r, q as s, Ce as t };