@verbb/formie-browser 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/dist/chunks/{address-country-Rx6GQTND.js → address-country-BcEQKw0T.js} +11 -5
- package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-BWGINCSA.js} +3 -3
- package/dist/chunks/address-state-DI3ndhMU.js +365 -0
- package/dist/chunks/{api-BUb6P-xu.js → api-BK9b340y.js} +93 -63
- package/dist/chunks/{api-DqpfkZWL.js → api-Dxl_CKw-.js} +202 -193
- package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
- package/dist/chunks/{async-nPFRNQ06.js → async-2GdXNFCE.js} +18 -1
- package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-BwtuyN_O.js} +3 -3
- package/dist/chunks/calculations-YEoVCG2q.js +310 -0
- package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DWLoQFKB.js} +6 -5
- package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
- package/dist/chunks/{combobox-C0EuExSI.js → combobox-Ba08_cHL.js} +340 -328
- package/dist/chunks/conditions-Ceeg6ReZ.js +467 -0
- package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
- package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
- package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
- package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
- package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
- package/dist/chunks/{date-picker-F9BUBDSW.js → date-picker-DaPvMrop.js} +467 -443
- package/dist/chunks/{dist-D6i-VNgM.js → dist-ZLeW0zZ3.js} +1281 -453
- package/dist/chunks/{eway-D9_m8ooj.js → eway-uw0DzU-L.js} +5 -5
- package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
- package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-B8_mH012.js} +119 -99
- package/dist/chunks/friendly-captcha-v1-CVXaXgDO.js +34 -0
- package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-DkeIVTKI.js} +6 -5
- package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
- package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-c4wLJdOt.js} +2 -2
- package/dist/chunks/google-address-JHYvjwgN.js +168 -0
- package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-Dt3ELLlP.js} +4 -4
- package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
- package/dist/chunks/http-C2QdHuWO.js +27 -0
- package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
- package/dist/chunks/{loqate-CJPzBmSm.js → loqate-m51iPyO1.js} +3 -3
- package/dist/chunks/{mollie-Bibhl67p.js → mollie-Bn0PX173.js} +2 -2
- package/dist/chunks/{moneris-H2wSqk9h.js → moneris-BRbUvI4t.js} +3 -3
- package/dist/chunks/opayo-BwWdInEP.js +188 -0
- package/dist/chunks/{paddle-DkvIxQdG.js → paddle-CympHVvd.js} +4 -4
- package/dist/chunks/{password-validation-D06uH9va.js → password-validation-C8_uO_c_.js} +18 -12
- package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-h75h6wae.js} +8 -6
- package/dist/chunks/{payway-CwDkC7YZ.js → payway-C9rHTCC_.js} +4 -4
- package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-B8fv-L5_.js} +80 -63
- package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BnZGQ-L1.js} +11 -11
- package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
- package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CUs8BO6V.js} +4 -4
- package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-DTbTw-MF.js} +2 -2
- package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-P1McW4Pv.js} +4 -4
- package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-FGDqozSP.js} +4 -4
- package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CflUHeZD.js} +4 -4
- package/dist/chunks/{repeater-BVnPUqTj.js → repeater-CyhDbozO.js} +60 -40
- package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
- package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
- package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/chunks/{scripts-CbQ7agX3.js → scripts-DrccjrFv.js} +1 -1
- package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
- package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
- package/dist/chunks/{signature-IOhuicje.js → signature-7cldFbqj.js} +138 -112
- package/dist/chunks/skip-CEW89ExY.js +7 -0
- package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C3QLYxFT.js} +2 -2
- package/dist/chunks/{square-DwdcOI1G.js → square-C1z5DPVw.js} +9 -7
- package/dist/chunks/{stripe-DaoG2FT1.js → stripe-Dmkdkq1y.js} +11 -12
- package/dist/chunks/{summary-Dks0gXS3.js → summary-Bn-g5SDx.js} +48 -46
- package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
- package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
- package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
- package/dist/chunks/{table-CAjCJHrL.js → table-j7MlLLCc.js} +22 -16
- package/dist/chunks/{text-limit-BGaY0jhI.js → text-limit-LGMPhFuC.js} +40 -34
- package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
- package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-ptihQfLl.js} +4 -4
- package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BW7l-BhF.js} +459 -387
- package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
- package/dist/css/formie-base.css +104 -1
- package/dist/css/theme/_messages.css +2 -0
- package/dist/css/theme/_tokens.css +31 -25
- package/dist/css/theme/forms/_form.css +5 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1779 -1415
- package/dist/js/contracts/client.d.ts +5 -3
- package/dist/js/contracts/client.d.ts.map +1 -1
- package/dist/js/contracts/common.d.ts +2 -2
- package/dist/js/contracts/common.d.ts.map +1 -1
- package/dist/js/contracts/modules.d.ts +37 -12
- package/dist/js/contracts/modules.d.ts.map +1 -1
- package/dist/js/contracts/schema.d.ts +20 -38
- package/dist/js/contracts/schema.d.ts.map +1 -1
- package/dist/js/contracts/theme.d.ts +4 -1
- package/dist/js/contracts/theme.d.ts.map +1 -1
- package/dist/js/core/client-rendered-modules.d.ts +17 -0
- package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/field-error-aria.d.ts +23 -0
- package/dist/js/core/field-error-aria.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +10 -8
- package/dist/js/core/hydrate-modules.d.ts.map +1 -1
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts +3 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/core/validation-focus.d.ts.map +1 -1
- package/dist/js/modules/address/address-finder.d.ts +1 -1
- package/dist/js/modules/address/address-finder.d.ts.map +1 -1
- package/dist/js/modules/address/factories.d.ts +3 -3
- package/dist/js/modules/address/factories.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +12 -1
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/index.d.ts +2 -2
- package/dist/js/modules/address/index.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts +11 -11
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/index.d.ts +2 -2
- package/dist/js/modules/captchas/index.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +2 -2
- package/dist/js/modules/fields/address-country.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts +2 -2
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/calculations.d.ts +2 -2
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +2 -2
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
- package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +3 -1
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts +2 -2
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-link.d.ts +2 -2
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts +2 -2
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts +2 -2
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/hidden.d.ts +2 -2
- package/dist/js/modules/fields/hidden.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts +2 -2
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/password-validation.d.ts +2 -2
- package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts +2 -2
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts +2 -2
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/rich-text.d.ts +2 -2
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
- package/dist/js/modules/fields/shared.d.ts +1 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts +2 -2
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts +2 -2
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-likert.d.ts +2 -2
- package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rank.d.ts +2 -2
- package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rating.d.ts +2 -2
- package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
- package/dist/js/modules/fields/table.d.ts +2 -2
- package/dist/js/modules/fields/table.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts +2 -2
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +2 -2
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/modules/loader.d.ts +10 -4
- package/dist/js/modules/loader.d.ts.map +1 -1
- package/dist/js/modules/payments/bpoint.d.ts +1 -1
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
- package/dist/js/modules/payments/eway.d.ts +1 -1
- package/dist/js/modules/payments/eway.d.ts.map +1 -1
- package/dist/js/modules/payments/factories.d.ts +7 -7
- package/dist/js/modules/payments/factories.d.ts.map +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
- package/dist/js/modules/payments/index.d.ts +2 -2
- package/dist/js/modules/payments/index.d.ts.map +1 -1
- package/dist/js/modules/payments/mollie.d.ts +1 -1
- package/dist/js/modules/payments/mollie.d.ts.map +1 -1
- package/dist/js/modules/payments/moneris.d.ts +1 -1
- package/dist/js/modules/payments/moneris.d.ts.map +1 -1
- package/dist/js/modules/payments/opayo.d.ts +1 -1
- package/dist/js/modules/payments/opayo.d.ts.map +1 -1
- package/dist/js/modules/payments/paddle.d.ts +1 -1
- package/dist/js/modules/payments/paddle.d.ts.map +1 -1
- package/dist/js/modules/payments/paypal.d.ts +1 -1
- package/dist/js/modules/payments/paypal.d.ts.map +1 -1
- package/dist/js/modules/payments/payway.d.ts +1 -1
- package/dist/js/modules/payments/payway.d.ts.map +1 -1
- package/dist/js/modules/payments/square.d.ts +1 -1
- package/dist/js/modules/payments/square.d.ts.map +1 -1
- package/dist/js/modules/payments/stripe.d.ts +1 -1
- package/dist/js/modules/payments/stripe.d.ts.map +1 -1
- package/dist/js/modules/payments/utils.d.ts +6 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -1
- package/dist/js/modules/registry.d.ts +6 -4
- package/dist/js/modules/registry.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
- package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +3 -3
- package/dist/js/theme/theme-classes.d.ts.map +1 -1
- package/dist/js/transport/forms-api.d.ts +5 -3
- package/dist/js/transport/forms-api.d.ts.map +1 -1
- package/dist/js/utils/async.d.ts +1 -0
- package/dist/js/utils/async.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +2 -2
- package/dist/js/utils/country-from-ip.d.ts.map +1 -1
- package/dist/js/utils/csrf.d.ts +17 -0
- package/dist/js/utils/csrf.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +1 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -1
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
- package/dist/js/utils/field-references.types.d.ts +1 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -1
- package/dist/js/utils/http.d.ts +3 -1
- package/dist/js/utils/http.d.ts.map +1 -1
- package/dist/js/utils/request-profile.d.ts +4 -0
- package/dist/js/utils/request-profile.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/rules/email.d.ts.map +1 -1
- package/dist/js/validation/rules/match.d.ts.map +1 -1
- package/dist/js/validation/rules/number.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/rules/shared.d.ts.map +1 -1
- package/dist/js/validation/rules/url.d.ts.map +1 -1
- package/dist/js/validation/skip.d.ts +7 -0
- package/dist/js/validation/skip.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +43 -12
- package/src/css/formie-base.css +104 -1
- package/src/css/theme/_messages.css +2 -0
- package/src/css/theme/_tokens.css +31 -25
- package/src/css/theme/forms/_form.css +5 -1
- package/src/index.ts +13 -8
- package/src/js/contracts/client.ts +5 -3
- package/src/js/contracts/common.ts +5 -6
- package/src/js/contracts/modules.ts +41 -12
- package/src/js/contracts/schema.ts +21 -43
- package/src/js/contracts/theme.ts +6 -1
- package/src/js/core/client-rendered-modules.ts +69 -0
- package/src/js/core/create-formie-client.ts +132 -86
- package/src/js/core/field-error-aria.ts +93 -0
- package/src/js/core/hydrate-modules.ts +54 -29
- package/src/js/core/submit-result-state.ts +51 -45
- package/src/js/core/submit-result-ui.ts +25 -68
- package/src/js/core/validation-focus.ts +20 -20
- package/src/js/modules/address/address-finder.ts +1 -1
- package/src/js/modules/address/factories.ts +15 -13
- package/src/js/modules/address/google-address.ts +102 -40
- package/src/js/modules/address/index.ts +2 -2
- package/src/js/modules/address/loqate.ts +1 -1
- package/src/js/modules/address/place-kit.ts +14 -8
- package/src/js/modules/captchas/captcha-eu.ts +2 -2
- package/src/js/modules/captchas/factories.ts +66 -42
- package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
- package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
- package/src/js/modules/captchas/hcaptcha.ts +5 -5
- package/src/js/modules/captchas/index.ts +2 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
- package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
- package/src/js/modules/captchas/snaptcha.ts +1 -1
- package/src/js/modules/captchas/turnstile.ts +3 -3
- package/src/js/modules/fields/address-country.ts +11 -9
- package/src/js/modules/fields/address-state.ts +94 -35
- package/src/js/modules/fields/calculations.ts +5 -3
- package/src/js/modules/fields/checkbox-radio.ts +24 -42
- package/src/js/modules/fields/combobox.ts +28 -9
- package/src/js/modules/fields/conditions/config.ts +17 -20
- package/src/js/modules/fields/conditions/effects.ts +25 -29
- package/src/js/modules/fields/conditions/evaluator.ts +21 -29
- package/src/js/modules/fields/conditions/references.ts +16 -5
- package/src/js/modules/fields/conditions/submission-context.ts +80 -0
- package/src/js/modules/fields/conditions/types.ts +3 -1
- package/src/js/modules/fields/conditions/values.ts +31 -6
- package/src/js/modules/fields/conditions.ts +65 -18
- package/src/js/modules/fields/custom-google-maps.ts +5 -3
- package/src/js/modules/fields/custom-link.ts +5 -3
- package/src/js/modules/fields/custom-maps.ts +5 -3
- package/src/js/modules/fields/date-picker.ts +40 -7
- package/src/js/modules/fields/file-upload.ts +62 -23
- package/src/js/modules/fields/hidden.ts +5 -3
- package/src/js/modules/fields/index.ts +2 -2
- package/src/js/modules/fields/password-validation.ts +5 -3
- package/src/js/modules/fields/phone-country.ts +35 -8
- package/src/js/modules/fields/repeater.ts +60 -7
- package/src/js/modules/fields/rich-text.ts +20 -4
- package/src/js/modules/fields/shared.ts +13 -0
- package/src/js/modules/fields/signature.ts +24 -4
- package/src/js/modules/fields/summary.ts +8 -20
- package/src/js/modules/fields/survey-likert.ts +5 -3
- package/src/js/modules/fields/survey-rank.ts +21 -3
- package/src/js/modules/fields/survey-rating.ts +17 -3
- package/src/js/modules/fields/table.ts +5 -3
- package/src/js/modules/fields/text-limit.ts +5 -3
- package/src/js/modules/fields/upload-manager.ts +244 -67
- package/src/js/modules/loader.ts +345 -281
- package/src/js/modules/payments/bpoint.ts +2 -2
- package/src/js/modules/payments/eway.ts +2 -2
- package/src/js/modules/payments/factories.ts +53 -52
- package/src/js/modules/payments/go-cardless.ts +1 -1
- package/src/js/modules/payments/index.ts +2 -2
- package/src/js/modules/payments/mollie.ts +1 -1
- package/src/js/modules/payments/moneris.ts +2 -2
- package/src/js/modules/payments/opayo.ts +21 -8
- package/src/js/modules/payments/paddle.ts +10 -6
- package/src/js/modules/payments/payment.ts +22 -18
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +2 -2
- package/src/js/modules/payments/square.ts +2 -2
- package/src/js/modules/payments/stripe.ts +5 -5
- package/src/js/modules/payments/utils.ts +14 -0
- package/src/js/modules/registry.ts +19 -11
- package/src/js/submit/pipeline.ts +10 -11
- package/src/js/theme/browser-theme-state.generated.ts +25 -0
- package/src/js/theme/theme-classes.ts +3 -3
- package/src/js/transport/forms-api.ts +66 -67
- package/src/js/utils/async.ts +34 -0
- package/src/js/utils/country-from-ip.ts +14 -9
- package/src/js/utils/csrf.ts +136 -0
- package/src/js/utils/field-references.parser.ts +13 -113
- package/src/js/utils/field-references.resolver.ts +27 -64
- package/src/js/utils/field-references.row-scope.ts +1 -1
- package/src/js/utils/field-references.types.ts +1 -0
- package/src/js/utils/http.ts +5 -5
- package/src/js/utils/request-profile.ts +10 -0
- package/src/js/utils/unload-warning.ts +12 -4
- package/src/js/validation/rules/email.ts +3 -5
- package/src/js/validation/rules/match.ts +2 -1
- package/src/js/validation/rules/minmax.ts +4 -43
- package/src/js/validation/rules/number.ts +3 -47
- package/src/js/validation/rules/pattern.ts +3 -8
- package/src/js/validation/rules/required.ts +14 -1
- package/src/js/validation/rules/shared.ts +5 -1
- package/src/js/validation/rules/url.ts +3 -10
- package/src/js/validation/skip.ts +9 -0
- package/src/js/validation/submit-readiness.ts +9 -2
- package/src/js/validation/validator.ts +49 -61
- package/dist/chunks/address-state-BwE01m2_.js +0 -344
- package/dist/chunks/calculations-Dv3hYb8_.js +0 -299
- package/dist/chunks/conditions-CPH1snCx.js +0 -424
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
- package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
- package/dist/chunks/google-address-BH3Zhi06.js +0 -161
- package/dist/chunks/http-D-JExro7.js +0 -27
- package/dist/chunks/opayo-CR0DtsLa.js +0 -179
- package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
- package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
- package/src/js/modules/fields/conditions/transforms.ts +0 -206
- package/src/js/modules/payments/stub-payment-module.ts +0 -87
|
@@ -1,64 +1,327 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../formie-core/dist/index.js
|
|
2
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
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
4
|
get: ((e) => i[e]).bind(null, d),
|
|
5
5
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
6
6
|
});
|
|
7
7
|
return e;
|
|
8
|
-
}, c = (n, r,
|
|
8
|
+
}, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
9
9
|
value: n,
|
|
10
10
|
enumerable: !0
|
|
11
|
-
}) :
|
|
12
|
-
function l(e) {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
}) : o, n));
|
|
12
|
+
function l(e, t, n) {
|
|
13
|
+
let r = t.scope;
|
|
14
|
+
if (r === "count") return { value: e.length };
|
|
15
|
+
if (r === "all") return { value: e };
|
|
16
|
+
if (r === "first") return { value: e[0] ?? null };
|
|
17
|
+
if (r === "last") return { value: e[e.length - 1] ?? null };
|
|
18
|
+
if (r === "current" || r === "index") {
|
|
19
|
+
let i = r === "current" ? n : /^[0-9]+$/.test(t.index ?? "") ? Number(t.index) : void 0;
|
|
20
|
+
return i !== void 0 && i >= 0 && i < e.length ? { value: e[i] } : { diagnostic: "invalidRowScope" };
|
|
21
|
+
}
|
|
22
|
+
if (r === "rows") {
|
|
23
|
+
let n = t.rows ?? "";
|
|
24
|
+
if (!/^(?:even|odd|every:[1-9]\d*|[1-9]\d*(?:\s*-\s*[1-9]\d*)?(?:\s*,\s*[1-9]\d*(?:\s*-\s*[1-9]\d*)?)*)$/.test(n)) return { diagnostic: "invalidRowScope" };
|
|
25
|
+
let r = e.filter((e, t) => n === "even" ? t % 2 == 1 : n === "odd" ? t % 2 == 0 : n.startsWith("every:") ? t % Number(n.slice(6)) === 0 : n.split(",").some((e) => {
|
|
26
|
+
let [n, r = n] = e.split("-").map(Number);
|
|
27
|
+
return t + 1 >= Math.min(n, r) && t + 1 <= Math.max(n, r);
|
|
28
|
+
}));
|
|
29
|
+
return { value: r.length === 1 ? r[0] : r };
|
|
30
|
+
}
|
|
31
|
+
return { diagnostic: "missingRowScope" };
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
var u = {
|
|
34
|
+
version: 1,
|
|
35
|
+
operators: {
|
|
36
|
+
"=": [
|
|
37
|
+
"text",
|
|
38
|
+
"number",
|
|
39
|
+
"boolean",
|
|
40
|
+
"date",
|
|
41
|
+
"time",
|
|
42
|
+
"datetime",
|
|
43
|
+
"collection"
|
|
44
|
+
],
|
|
45
|
+
"!=": [
|
|
46
|
+
"text",
|
|
47
|
+
"number",
|
|
48
|
+
"boolean",
|
|
49
|
+
"date",
|
|
50
|
+
"time",
|
|
51
|
+
"datetime",
|
|
52
|
+
"collection"
|
|
53
|
+
],
|
|
54
|
+
">": [
|
|
55
|
+
"text",
|
|
56
|
+
"number",
|
|
57
|
+
"date",
|
|
58
|
+
"time",
|
|
59
|
+
"datetime"
|
|
60
|
+
],
|
|
61
|
+
"<": [
|
|
62
|
+
"text",
|
|
63
|
+
"number",
|
|
64
|
+
"date",
|
|
65
|
+
"time",
|
|
66
|
+
"datetime"
|
|
67
|
+
],
|
|
68
|
+
contains: ["text", "collection"],
|
|
69
|
+
notContains: ["text", "collection"],
|
|
70
|
+
startsWith: ["text"],
|
|
71
|
+
endsWith: ["text"],
|
|
72
|
+
empty: [
|
|
73
|
+
"text",
|
|
74
|
+
"number",
|
|
75
|
+
"boolean",
|
|
76
|
+
"date",
|
|
77
|
+
"time",
|
|
78
|
+
"datetime",
|
|
79
|
+
"collection"
|
|
80
|
+
],
|
|
81
|
+
notEmpty: [
|
|
82
|
+
"text",
|
|
83
|
+
"number",
|
|
84
|
+
"boolean",
|
|
85
|
+
"date",
|
|
86
|
+
"time",
|
|
87
|
+
"datetime",
|
|
88
|
+
"collection"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}, d = (e) => ({
|
|
92
|
+
value: null,
|
|
93
|
+
diagnostics: [{ code: e }]
|
|
94
|
+
}), f = (e) => typeof e == "number" && !Number.isFinite(e) ? null : e == null ? "" : [
|
|
95
|
+
"string",
|
|
96
|
+
"number",
|
|
97
|
+
"boolean"
|
|
98
|
+
].includes(typeof e) ? String(e) : null, p = (e) => e.replace(/^[ \t\r\n\v\f]+|[ \t\r\n\v\f]+$/g, "");
|
|
99
|
+
function m(e) {
|
|
100
|
+
if (!["number", "string"].includes(typeof e) || !/^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/.test(p(String(e)))) return null;
|
|
101
|
+
let t = Number(e);
|
|
102
|
+
return Number.isFinite(t) ? t : null;
|
|
23
103
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
104
|
+
function h(e, t) {
|
|
105
|
+
if (t === "text") return f(e);
|
|
106
|
+
if (t === "number") return m(e);
|
|
107
|
+
if (t === "boolean") {
|
|
108
|
+
if (typeof e == "boolean") return e;
|
|
109
|
+
let t = p(f(e) ?? "").toLowerCase();
|
|
110
|
+
return [
|
|
111
|
+
"true",
|
|
112
|
+
"1",
|
|
113
|
+
"yes",
|
|
114
|
+
"on"
|
|
115
|
+
].includes(t) ? !0 : ![
|
|
116
|
+
"false",
|
|
117
|
+
"0",
|
|
118
|
+
"no",
|
|
119
|
+
"off"
|
|
120
|
+
].includes(t) && null;
|
|
121
|
+
}
|
|
122
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
123
|
+
let n = e;
|
|
124
|
+
if ((t === "date" ? [
|
|
125
|
+
"year",
|
|
126
|
+
"month",
|
|
127
|
+
"day"
|
|
128
|
+
] : t === "time" ? ["hour", "minute"] : [
|
|
129
|
+
"year",
|
|
130
|
+
"month",
|
|
131
|
+
"day",
|
|
132
|
+
"hour",
|
|
133
|
+
"minute"
|
|
134
|
+
]).some((e) => !/^[0-9]+$/.test(String(n[e]))) || "_input" in n || n.second != null && !/^[0-9]+$/.test(String(n.second))) return null;
|
|
135
|
+
let r = Number(n.hour ?? 0);
|
|
136
|
+
if (n.ampm != null) {
|
|
137
|
+
if (!["AM", "PM"].includes(String(n.ampm)) || r < 1 || r > 12) return null;
|
|
138
|
+
r = r % 12 + (n.ampm === "PM" ? 12 : 0);
|
|
139
|
+
}
|
|
140
|
+
let i = `${String(n.year ?? 1970).padStart(4, "0")}-${String(n.month ?? 1).padStart(2, "0")}-${String(n.day ?? 1).padStart(2, "0")}`, a = `${String(r).padStart(2, "0")}:${String(n.minute ?? 0).padStart(2, "0")}:${String(n.second ?? 0).padStart(2, "0")}`;
|
|
141
|
+
if (t === "datetime") {
|
|
142
|
+
if (h(i, "date") === null || h(a, "time") === null) return null;
|
|
143
|
+
let e = String(n.timezone ?? "UTC");
|
|
144
|
+
if (/^(Z|[+-][0-9]{2}:[0-9]{2})$/.test(e)) return h(`${i}T${a}${e}`, "datetime");
|
|
145
|
+
try {
|
|
146
|
+
let t = Date.parse(`${i}T${a}Z`), n = new Intl.DateTimeFormat("en-GB", {
|
|
147
|
+
timeZone: e,
|
|
148
|
+
year: "numeric",
|
|
149
|
+
month: "2-digit",
|
|
150
|
+
day: "2-digit",
|
|
151
|
+
hour: "2-digit",
|
|
152
|
+
minute: "2-digit",
|
|
153
|
+
second: "2-digit",
|
|
154
|
+
hourCycle: "h23"
|
|
155
|
+
}), r = (e) => {
|
|
156
|
+
let t = Object.fromEntries(n.formatToParts(e).map((e) => [e.type, e.value]));
|
|
157
|
+
return Date.parse(`${t.year.padStart(4, "0")}-${t.month}-${t.day}T${t.hour}:${t.minute}:${t.second}Z`);
|
|
158
|
+
}, o = new Set([
|
|
159
|
+
-864e5,
|
|
160
|
+
0,
|
|
161
|
+
864e5
|
|
162
|
+
].map((e) => t - (r(t + e) - (t + e))).filter((e) => r(e) === t));
|
|
163
|
+
return o.size === 1 ? [...o][0] / 1e3 : null;
|
|
164
|
+
} catch {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
e = t === "date" ? i : a;
|
|
169
|
+
}
|
|
170
|
+
if (typeof e != "string") return null;
|
|
171
|
+
if (t === "time") {
|
|
172
|
+
let t = e.match(/^([0-9]{2}):([0-9]{2})(?::([0-9]{2}))?$/);
|
|
173
|
+
return t && Number(t[1]) < 24 && Number(t[2]) < 60 && Number(t[3] ?? 0) < 60 ? Number(t[1]) * 3600 + Number(t[2]) * 60 + Number(t[3] ?? 0) : null;
|
|
174
|
+
}
|
|
175
|
+
let n = e.match(t === "date" ? /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/ : /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[+-][0-9]{2}:[0-9]{2})$/);
|
|
176
|
+
if (!n || Number(n[1]) < 1) return null;
|
|
177
|
+
let r = Number(n[1]), i = [
|
|
178
|
+
31,
|
|
179
|
+
r % 4 == 0 && (r % 100 != 0 || r % 400 == 0) ? 29 : 28,
|
|
180
|
+
31,
|
|
181
|
+
30,
|
|
182
|
+
31,
|
|
183
|
+
30,
|
|
184
|
+
31,
|
|
185
|
+
31,
|
|
186
|
+
30,
|
|
187
|
+
31,
|
|
188
|
+
30,
|
|
189
|
+
31
|
|
190
|
+
];
|
|
191
|
+
if (Number(n[2]) < 1 || Number(n[2]) > 12 || Number(n[3]) < 1 || Number(n[3]) > i[Number(n[2]) - 1] || t === "datetime" && (Number(n[4]) > 23 || Number(n[5]) > 59 || Number(n[6]) > 59 || n[7] !== "Z" && (Number(n[7].slice(1, 3)) > 23 || Number(n[7].slice(4)) > 59))) return null;
|
|
192
|
+
let a = Date.parse(t === "date" ? `${e}T00:00:00Z` : e);
|
|
193
|
+
return Number.isFinite(a) ? a / 1e3 : null;
|
|
32
194
|
}
|
|
33
|
-
function
|
|
34
|
-
return e
|
|
195
|
+
function g(e) {
|
|
196
|
+
return e && typeof e == "object" ? Object.values(e).flatMap(g) : [e];
|
|
35
197
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
198
|
+
function _(e, t, n, r = "text") {
|
|
199
|
+
if (!u.operators[e]?.includes(r)) return d("unsupportedOperator");
|
|
200
|
+
if (e === "empty" || e === "notEmpty") {
|
|
201
|
+
if (t && typeof t == "object" && !Array.isArray(t) && ![
|
|
202
|
+
"collection",
|
|
203
|
+
"date",
|
|
204
|
+
"time",
|
|
205
|
+
"datetime"
|
|
206
|
+
].includes(r)) return d("invalidValue");
|
|
207
|
+
let n = t == null || typeof t == "object" && !!t && Object.keys(t).length === 0 || typeof t == "string" && p(t) === "";
|
|
208
|
+
return {
|
|
209
|
+
value: e === "empty" ? n : !n,
|
|
210
|
+
diagnostics: []
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (r === "collection") {
|
|
214
|
+
if (t != null && typeof t != "object") return d("invalidValue");
|
|
215
|
+
let r = g(t ?? []), i = Array.isArray(n) ? n : [n];
|
|
216
|
+
if ([...r, ...i].some((e) => f(e) === null)) return d("invalidValue");
|
|
217
|
+
let a = r.some((e) => i.some((t) => f(e) === f(t)));
|
|
218
|
+
return {
|
|
219
|
+
value: ["!=", "notContains"].includes(e) ? !a : a,
|
|
220
|
+
diagnostics: []
|
|
221
|
+
};
|
|
52
222
|
}
|
|
223
|
+
let i = h(t, r), a = h(n, r);
|
|
224
|
+
if (i === null || a === null) return d("invalidValue");
|
|
225
|
+
let o = r === "text" ? ((e, t) => {
|
|
226
|
+
let n = Array.from(e, (e) => e.codePointAt(0)), r = Array.from(t, (e) => e.codePointAt(0));
|
|
227
|
+
for (let e = 0; e < Math.min(n.length, r.length); e++) if (n[e] !== r[e]) return n[e] - r[e];
|
|
228
|
+
return n.length - r.length;
|
|
229
|
+
})(String(i), String(a)) : i === a ? 0 : i > a ? 1 : -1;
|
|
230
|
+
return {
|
|
231
|
+
value: {
|
|
232
|
+
"=": i === a,
|
|
233
|
+
"!=": i !== a,
|
|
234
|
+
">": o > 0,
|
|
235
|
+
"<": o < 0,
|
|
236
|
+
contains: String(i).includes(String(a)),
|
|
237
|
+
notContains: !String(i).includes(String(a)),
|
|
238
|
+
startsWith: String(i).startsWith(String(a)),
|
|
239
|
+
endsWith: String(i).endsWith(String(a))
|
|
240
|
+
}[e],
|
|
241
|
+
diagnostics: []
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function v(e, t) {
|
|
245
|
+
let n = t.flatMap((e, t) => e.diagnostics.map((e) => ({
|
|
246
|
+
...e,
|
|
247
|
+
rule: t
|
|
248
|
+
})));
|
|
249
|
+
return ["all", "any"].includes(e) ? n.length || t.some((e) => e.value === null) ? {
|
|
250
|
+
value: null,
|
|
251
|
+
diagnostics: n
|
|
252
|
+
} : {
|
|
253
|
+
value: e === "all" ? t.every((e) => e.value === !0) : t.some((e) => e.value === !0),
|
|
254
|
+
diagnostics: []
|
|
255
|
+
} : d("invalidSchema");
|
|
53
256
|
}
|
|
54
|
-
function
|
|
55
|
-
let n = e.conditionRule
|
|
257
|
+
function y(e, t) {
|
|
258
|
+
let n = v(e.conditionRule, t.map((e) => typeof e == "boolean" ? {
|
|
259
|
+
value: e,
|
|
260
|
+
diagnostics: []
|
|
261
|
+
} : e)), r = n.value === !0;
|
|
56
262
|
return {
|
|
57
|
-
finalResult:
|
|
58
|
-
shouldHide:
|
|
263
|
+
finalResult: r,
|
|
264
|
+
shouldHide: ["show", "enable"].includes(e.showRule) ? !r : r,
|
|
265
|
+
evaluation: n
|
|
59
266
|
};
|
|
60
267
|
}
|
|
61
|
-
var
|
|
268
|
+
var b = /* @__PURE__ */ new Map();
|
|
269
|
+
function x(e) {
|
|
270
|
+
return e == null || e === !1 || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0;
|
|
271
|
+
}
|
|
272
|
+
function S(e, t, n = {}) {
|
|
273
|
+
let r = n.empty ?? x(e), i = n.label ?? "This field", a = (e, n) => t.messages?.[e] ?? t.message ?? n;
|
|
274
|
+
if (t.type === "required") return r ? a("required", `${i} cannot be blank.`) : null;
|
|
275
|
+
if (r) return null;
|
|
276
|
+
if (t.type === "email") return typeof e == "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) ? null : a("email", `${i} is not a valid email address.`);
|
|
277
|
+
if (t.type === "number") {
|
|
278
|
+
let n = m(e);
|
|
279
|
+
return n === null ? a("number", `${i} is not a valid number.`) : t.min != null && n < t.min ? a("numberMin", `${i} must be no less than ${t.min}.`) : t.max != null && n > t.max ? a("numberMax", `${i} must be no greater than ${t.max}.`) : null;
|
|
280
|
+
}
|
|
281
|
+
if (t.type === "url") {
|
|
282
|
+
try {
|
|
283
|
+
let t = new URL(String(e));
|
|
284
|
+
if (["http:", "https:"].includes(t.protocol)) return null;
|
|
285
|
+
} catch {}
|
|
286
|
+
return a("url", `${i} is not a valid URL.`);
|
|
287
|
+
}
|
|
288
|
+
if (t.type === "pattern") try {
|
|
289
|
+
let n = t.pattern instanceof RegExp ? t.pattern : typeof t.pattern == "string" ? RegExp(`^(?:${t.pattern})$`) : null;
|
|
290
|
+
return n ? (n.lastIndex = 0, n.test(String(e)) ? null : a("pattern", `${i} is not a valid format.`)) : null;
|
|
291
|
+
} catch {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
if (t.type === "match") return n.comparison === void 0 || e === n.comparison ? null : a("match", `${i} must match ${n.comparisonLabel ?? "the other field"}.`);
|
|
295
|
+
if (t.type === "minmaxOptions" && Array.isArray(e)) {
|
|
296
|
+
if (t.min != null && e.length < t.min) return a("minOptions", `Please select at least ${t.min} options.`);
|
|
297
|
+
if (t.max != null && e.length > t.max) return a("maxOptions", `Please select no more than ${t.max} options.`);
|
|
298
|
+
}
|
|
299
|
+
return b.get(t.type)?.(e, t, n) ?? null;
|
|
300
|
+
}
|
|
301
|
+
function C(e) {
|
|
302
|
+
let t = e;
|
|
303
|
+
if (!t || t.contractVersion !== 2 || ![
|
|
304
|
+
"server-rendered",
|
|
305
|
+
"client-rendered",
|
|
306
|
+
"cp-edit"
|
|
307
|
+
].includes(t.surface) || !Array.isArray(t.entries)) throw Error("Unsupported browser module contractVersion. Update Formie and its browser packages together.");
|
|
308
|
+
let n = /* @__PURE__ */ new Set();
|
|
309
|
+
for (let e of t.entries) {
|
|
310
|
+
if (!e || typeof e.key != "string" || !e.key || n.has(e.key) || typeof e.moduleId != "string" || !/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/.test(e.moduleId) || "src" in e || !Array.isArray(e.targets) || e.targets.length === 0 || typeof e.required != "boolean" || !e.config || typeof e.config != "object" || Array.isArray(e.config) || ![
|
|
311
|
+
"field",
|
|
312
|
+
"captcha",
|
|
313
|
+
"payment",
|
|
314
|
+
"address",
|
|
315
|
+
"core"
|
|
316
|
+
].includes(e.kind)) throw Error("Invalid browser module entry. Check the registered module ID, occurrence key, kind and targets.");
|
|
317
|
+
for (let t of e.targets) {
|
|
318
|
+
let e = t && typeof t == "object" ? Object.keys(t).length : 0;
|
|
319
|
+
if (!(t && (t.type === "form" && e === 1 || t.type === "field" && e === 2 && typeof t.uid == "string" && t.uid !== "" || t.type === "page" && e === 2 && typeof t.id == "string" && t.id !== "" || t.type === "action" && e === 2 && typeof t.action == "string" && t.action !== "" || t.type === "selector" && e === 2 && typeof t.selector == "string" && t.selector !== ""))) throw Error("Invalid browser module target. Fields require a form-field instance UID.");
|
|
320
|
+
}
|
|
321
|
+
n.add(e.key);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
var w = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
62
325
|
(function(n, r) {
|
|
63
326
|
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
327
|
})(e, function(e) {
|
|
@@ -122,7 +385,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
122
385
|
}
|
|
123
386
|
this.next();
|
|
124
387
|
}), 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;
|
|
388
|
+
if (e == null || !(e instanceof i) || e.tokens.length !== this.tokens.length) return !1;
|
|
126
389
|
let t = e.position;
|
|
127
390
|
e.position = 0;
|
|
128
391
|
let n = !0;
|
|
@@ -137,16 +400,16 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
137
400
|
}), t(this, "diff", (e) => {
|
|
138
401
|
let t = [];
|
|
139
402
|
if (!this.isEqualTo(e)) {
|
|
140
|
-
let n = e.position;
|
|
403
|
+
let n = 0, r = e.position;
|
|
141
404
|
e.position = 0;
|
|
142
|
-
for (let
|
|
143
|
-
let
|
|
144
|
-
|
|
145
|
-
index:
|
|
146
|
-
diff:
|
|
147
|
-
}), e.position < e.tokens.length - 1 && e.next()
|
|
405
|
+
for (let r of this.tokens) {
|
|
406
|
+
let i = r.diff(e.current);
|
|
407
|
+
i.length > 0 && t.push({
|
|
408
|
+
index: n,
|
|
409
|
+
diff: i
|
|
410
|
+
}), e.position < e.tokens.length - 1 && e.next(), n++;
|
|
148
411
|
}
|
|
149
|
-
e.position =
|
|
412
|
+
e.position = r;
|
|
150
413
|
}
|
|
151
414
|
return t;
|
|
152
415
|
}), this.expression = e, this.position = 0, this.tokens = n;
|
|
@@ -163,7 +426,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
163
426
|
}
|
|
164
427
|
class a {
|
|
165
428
|
constructor(e, n, r) {
|
|
166
|
-
t(this, "test", (e, t = null) => this.type === e && (t === null || this.value === t)), t(this, "isEqualTo", (e) =>
|
|
429
|
+
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
430
|
let t = [];
|
|
168
431
|
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
432
|
}), this.value = n, this.type = e, this.cursor = r;
|
|
@@ -304,32 +567,33 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
304
567
|
else r.push(".", c, l);
|
|
305
568
|
i += l.length + 2;
|
|
306
569
|
} else r.push(o);
|
|
307
|
-
for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1)
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
570
|
+
for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1) {
|
|
571
|
+
if (n += "\\", (h = o.charCodeAt(0)) < 32 || h > 126) switch (o) {
|
|
572
|
+
case "\n":
|
|
573
|
+
n += "n";
|
|
574
|
+
break;
|
|
575
|
+
case " ":
|
|
576
|
+
n += "t";
|
|
577
|
+
break;
|
|
578
|
+
case "\r":
|
|
579
|
+
n += "r";
|
|
580
|
+
break;
|
|
581
|
+
case "\x07":
|
|
582
|
+
n += "a";
|
|
583
|
+
break;
|
|
584
|
+
case "\v":
|
|
585
|
+
n += "v";
|
|
586
|
+
break;
|
|
587
|
+
case "\b":
|
|
588
|
+
n += "b";
|
|
589
|
+
break;
|
|
590
|
+
case "\f":
|
|
591
|
+
n += "f";
|
|
592
|
+
break;
|
|
593
|
+
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);
|
|
594
|
+
}
|
|
595
|
+
else n += o;
|
|
596
|
+
} else n += o;
|
|
333
597
|
return n;
|
|
334
598
|
}
|
|
335
599
|
class _ {
|
|
@@ -376,7 +640,20 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
376
640
|
right: r
|
|
377
641
|
}, { operator: e }), t(this, "compile", (e) => {
|
|
378
642
|
let t = this.attributes.operator;
|
|
379
|
-
|
|
643
|
+
if (t !== "matches") {
|
|
644
|
+
if (t !== "contains") {
|
|
645
|
+
if (t !== "starts with") {
|
|
646
|
+
if (t !== "ends with") {
|
|
647
|
+
if (t === "in" || t === "not in") {
|
|
648
|
+
let n = t === "not in" ? "=== -1" : ">= 0";
|
|
649
|
+
e.raw("(function(__l, __r){return __r.indexOf(__l) " + n + ";})(").compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
t === ".." ? e.raw("(function(__s, __e){var __r=[];for(var __i=__s;__i<=__e;__i++){__r.push(__i);}return __r;})(").compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")") : 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(")");
|
|
653
|
+
} else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().endsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())");
|
|
654
|
+
} else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().startsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())");
|
|
655
|
+
} else e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().includes(").compile(this.nodes.right).raw(".toString().toLowerCase())");
|
|
656
|
+
} else e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")");
|
|
380
657
|
}), t(this, "evaluate", (e, t) => {
|
|
381
658
|
let n = this.attributes.operator, r = this.nodes.left.evaluate(e, t);
|
|
382
659
|
if (v.functions[n] !== void 0) {
|
|
@@ -627,8 +904,8 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
627
904
|
let n = this.nodes.node.evaluate(e, t);
|
|
628
905
|
if (n === null && (this.nodes.attribute.isNullSafe || this.attributes.is_null_coalesce)) return this.attributes.is_short_circuited = !0, null;
|
|
629
906
|
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
907
|
let r = this.nodes.attribute.attributes.value;
|
|
908
|
+
if (typeof n != "object") throw Error(`Unable to get property "${r}" on a non-object: ` + typeof n);
|
|
632
909
|
return this.attributes.is_null_coalesce ? n[r] ?? null : n[r];
|
|
633
910
|
case E.METHOD_CALL:
|
|
634
911
|
let i = this.nodes.node.evaluate(e, t);
|
|
@@ -690,21 +967,21 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
690
967
|
this.nodes.expr2,
|
|
691
968
|
")"
|
|
692
969
|
]), t(this, "_addNullCoalesceAttributeToGetAttrNodes", (e) => {
|
|
693
|
-
if (
|
|
970
|
+
if (e instanceof E) {
|
|
694
971
|
e.attributes.is_null_coalesce = !0;
|
|
695
972
|
for (let t of Object.values(e.nodes)) this._addNullCoalesceAttributeToGetAttrNodes(t);
|
|
696
973
|
}
|
|
697
974
|
}), this.name = "NullCoalesceNode";
|
|
698
975
|
}
|
|
699
976
|
}
|
|
700
|
-
class
|
|
977
|
+
class ee extends _ {
|
|
701
978
|
constructor(e) {
|
|
702
979
|
super({}, { name: e }), t(this, "compile", (e) => {
|
|
703
980
|
e.raw(this.attributes.name + " ?? null");
|
|
704
981
|
}), t(this, "evaluate", (e, t) => null), t(this, "toArray", () => [this.attributes.name + " ?? null"]), this.name = "NullCoalescedNameNode";
|
|
705
982
|
}
|
|
706
983
|
}
|
|
707
|
-
class
|
|
984
|
+
class te {
|
|
708
985
|
constructor(e = {}) {
|
|
709
986
|
t(this, "functions", {}), t(this, "unaryOperators", {
|
|
710
987
|
not: { precedence: 50 },
|
|
@@ -850,7 +1127,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
850
1127
|
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
1128
|
}), t(this, "parseExpression", (e = 0) => {
|
|
852
1129
|
let t = this.getPrimary(), n = this.tokenStream.current;
|
|
853
|
-
if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("
|
|
1130
|
+
if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("Too many executions on '" + n.toString() + "' of '" + this.tokenStream.toString() + "'");
|
|
854
1131
|
for (; n.test(a.OPERATOR_TYPE) && this.binaryOperators[n.value] !== void 0 && this.binaryOperators[n.value] !== null && this.binaryOperators[n.value].precedence >= e;) {
|
|
855
1132
|
let e = this.binaryOperators[n.value];
|
|
856
1133
|
this.tokenStream.next();
|
|
@@ -965,7 +1242,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
965
1242
|
if (1 & this.flags) n = e.value;
|
|
966
1243
|
else {
|
|
967
1244
|
if (!this.hasVariable(e.value)) {
|
|
968
|
-
if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new
|
|
1245
|
+
if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new ee(e.value);
|
|
969
1246
|
throw new r(`Variable "${e.value}" is not valid`, e.cursor, this.tokenStream.expression, e.value, this.getNames());
|
|
970
1247
|
}
|
|
971
1248
|
n = e.value, this.objectMatches[n] !== void 0 && (n = this.getNames()[this.objectMatches[n]]);
|
|
@@ -985,7 +1262,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
985
1262
|
return this.parsePostfixExpression(t);
|
|
986
1263
|
}
|
|
987
1264
|
}
|
|
988
|
-
class
|
|
1265
|
+
class ne {
|
|
989
1266
|
constructor(e) {
|
|
990
1267
|
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
1268
|
let t = this.source;
|
|
@@ -997,22 +1274,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
997
1274
|
else if (Number.isInteger(e) || +e === e && (!isFinite(e) || e % 1)) this.raw(e);
|
|
998
1275
|
else if (e === null) this.raw("null");
|
|
999
1276
|
else if (typeof e == "boolean") this.raw(e ? "true" : "false");
|
|
1000
|
-
else if (
|
|
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)) {
|
|
1277
|
+
else if (Array.isArray(e)) {
|
|
1006
1278
|
this.raw("[");
|
|
1007
1279
|
let t = !0;
|
|
1008
1280
|
for (let n of e) t || this.raw(", "), t = !1, this.repr(n);
|
|
1009
1281
|
this.raw("]");
|
|
1282
|
+
} else if (typeof e == "object") {
|
|
1283
|
+
this.raw("{");
|
|
1284
|
+
let t = !0;
|
|
1285
|
+
for (let n of Object.keys(e)) t || this.raw(", "), t = !1, this.repr(n), this.raw(":"), this.repr(e[n]);
|
|
1286
|
+
this.raw("}");
|
|
1010
1287
|
} else this.string(e);
|
|
1011
1288
|
return this;
|
|
1012
1289
|
}), this.source = "", this.functions = e;
|
|
1013
1290
|
}
|
|
1014
1291
|
}
|
|
1015
|
-
class
|
|
1292
|
+
class re {
|
|
1016
1293
|
constructor(e) {
|
|
1017
1294
|
this.expression = e;
|
|
1018
1295
|
}
|
|
@@ -1020,7 +1297,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1020
1297
|
return this.expression;
|
|
1021
1298
|
}
|
|
1022
1299
|
}
|
|
1023
|
-
class
|
|
1300
|
+
class O extends re {
|
|
1024
1301
|
constructor(e, n) {
|
|
1025
1302
|
super(e), t(this, "getNodes", () => this.nodes), this.nodes = n;
|
|
1026
1303
|
}
|
|
@@ -1030,7 +1307,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1030
1307
|
switch (e.name) {
|
|
1031
1308
|
case "ConstantNode": return new b(e.attributes?.value, !!e.isIdentifier, !!e.isNullSafe);
|
|
1032
1309
|
case "NameNode": return new C(e.attributes?.name);
|
|
1033
|
-
case "NullCoalescedNameNode": return new
|
|
1310
|
+
case "NullCoalescedNameNode": return new ee(e.attributes?.name);
|
|
1034
1311
|
case "UnaryNode": return new y(e.attributes?.operator, n(e.nodes?.node));
|
|
1035
1312
|
case "BinaryNode": return new v(e.attributes?.operator, n(e.nodes?.left), n(e.nodes?.right));
|
|
1036
1313
|
case "ConditionalNode": return new x(n(e.nodes?.expr1), n(e.nodes?.expr2), n(e.nodes?.expr3));
|
|
@@ -1048,7 +1325,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1048
1325
|
return t;
|
|
1049
1326
|
}
|
|
1050
1327
|
case "FunctionNode": {
|
|
1051
|
-
let t = n(e.nodes?.
|
|
1328
|
+
let t = n(e.nodes?.fnArguments);
|
|
1052
1329
|
return new S(e.attributes?.name, t);
|
|
1053
1330
|
}
|
|
1054
1331
|
case "GetAttrNode": {
|
|
@@ -1074,8 +1351,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1074
1351
|
return t.attributes = e.attributes || {}, t;
|
|
1075
1352
|
}
|
|
1076
1353
|
}
|
|
1077
|
-
}, r = t.expression
|
|
1078
|
-
return new M(r, ((e) => {
|
|
1354
|
+
}, r = t.expression, i = ((e) => {
|
|
1079
1355
|
if (e == null) return e;
|
|
1080
1356
|
if (e.name) return n(e);
|
|
1081
1357
|
if (Array.isArray(e)) return e.map(n);
|
|
@@ -1085,14 +1361,15 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1085
1361
|
return t;
|
|
1086
1362
|
}
|
|
1087
1363
|
return e;
|
|
1088
|
-
})(t.nodes)
|
|
1364
|
+
})(t.nodes);
|
|
1365
|
+
return new O(r, i);
|
|
1089
1366
|
}
|
|
1090
1367
|
}
|
|
1091
|
-
var
|
|
1092
|
-
class
|
|
1368
|
+
var ie;
|
|
1369
|
+
class ae {
|
|
1093
1370
|
constructor(e = 0) {
|
|
1094
1371
|
t(this, "createCacheItem", (e, t, n) => {
|
|
1095
|
-
let r = new
|
|
1372
|
+
let r = new k();
|
|
1096
1373
|
return r.key = e, r.value = t, r.isHit = n, r.defaultLifetime = this.defaultLifetime, r;
|
|
1097
1374
|
}), t(this, "get", (e, t, n = null, r = null) => {
|
|
1098
1375
|
let i = this.getItem(e);
|
|
@@ -1101,12 +1378,12 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1101
1378
|
let t = this.hasItem(e), n = null;
|
|
1102
1379
|
return t ? n = this.values[e] : this.values[e] = null, (0, this.createCacheItem)(e, n, t);
|
|
1103
1380
|
}), t(this, "getItems", (e) => {
|
|
1104
|
-
for (let t of e) typeof t == "string" || this.expiries[t] ||
|
|
1381
|
+
for (let t of e) typeof t == "string" || this.expiries[t] || k.validateKey(t);
|
|
1105
1382
|
return this.generateItems(e, (/* @__PURE__ */ new Date()).getTime() / 1e3, this.createCacheItem);
|
|
1106
1383
|
}), t(this, "deleteItems", (e) => {
|
|
1107
1384
|
for (let t of e) this.deleteItem(t);
|
|
1108
1385
|
return !0;
|
|
1109
|
-
}), t(this, "save", (e) =>
|
|
1386
|
+
}), t(this, "save", (e) => e instanceof k && (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) || (k.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] || k.validateKey(e), delete this.values[e], delete this.expiries[e], !0)), t(this, "reset", () => {
|
|
1110
1387
|
this.clear();
|
|
1111
1388
|
}), t(this, "generateItems", (e, t, n) => {
|
|
1112
1389
|
let r = [];
|
|
@@ -1118,7 +1395,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1118
1395
|
}), this.defaultLifetime = e, this.values = {}, this.expiries = {};
|
|
1119
1396
|
}
|
|
1120
1397
|
}
|
|
1121
|
-
class
|
|
1398
|
+
class k {
|
|
1122
1399
|
constructor() {
|
|
1123
1400
|
t(this, "getKey", () => this.key), t(this, "get", () => this.value), t(this, "set", (e) => (this.value = e, this)), t(this, "expiresAt", (e) => {
|
|
1124
1401
|
if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
|
|
@@ -1146,7 +1423,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1146
1423
|
}), 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
1424
|
}
|
|
1148
1425
|
}
|
|
1149
|
-
|
|
1426
|
+
ie = k, t(k, "METADATA_EXPIRY_OFFSET", 1527506807), t(k, "RESERVED_CHARACTERS", [
|
|
1150
1427
|
"{",
|
|
1151
1428
|
"}",
|
|
1152
1429
|
"(",
|
|
@@ -1155,13 +1432,13 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1155
1432
|
"\\",
|
|
1156
1433
|
"@",
|
|
1157
1434
|
":"
|
|
1158
|
-
]), t(
|
|
1435
|
+
]), t(k, "validateKey", (e) => {
|
|
1159
1436
|
if (typeof e != "string") throw Error(`Cache key must be string, "${typeof e}" given.`);
|
|
1160
1437
|
if (e === "") throw Error("Cache key length must be greater than zero");
|
|
1161
|
-
for (let t of
|
|
1438
|
+
for (let t of ie.RESERVED_CHARACTERS) if (e.indexOf(t) >= 0) throw Error(`Cache key "${e}" contains reserved character "${t}".`);
|
|
1162
1439
|
return e;
|
|
1163
1440
|
});
|
|
1164
|
-
class
|
|
1441
|
+
class oe extends Error {
|
|
1165
1442
|
constructor(e) {
|
|
1166
1443
|
super(e), this.name = "LogicException";
|
|
1167
1444
|
}
|
|
@@ -1169,7 +1446,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1169
1446
|
return `${this.name}: ${this.message}`;
|
|
1170
1447
|
}
|
|
1171
1448
|
}
|
|
1172
|
-
class
|
|
1449
|
+
class A {
|
|
1173
1450
|
constructor(e, n, r) {
|
|
1174
1451
|
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
1452
|
}
|
|
@@ -1185,10 +1462,10 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1185
1462
|
return new this(t || r[r.length - 1], (...e) => `${n}(${e.join(", ")})`, (e, ...t) => i(...t));
|
|
1186
1463
|
}
|
|
1187
1464
|
}
|
|
1188
|
-
class
|
|
1465
|
+
class se {
|
|
1189
1466
|
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
|
|
1467
|
+
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) => {
|
|
1468
|
+
if (e instanceof O) return e;
|
|
1192
1469
|
t.sort((e, t) => {
|
|
1193
1470
|
let n = e, r = t;
|
|
1194
1471
|
return typeof e == "object" && (n = Object.values(e)[0]), typeof t == "object" && (r = Object.values(t)[0]), n.localeCompare(r);
|
|
@@ -1199,13 +1476,17 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1199
1476
|
typeof e == "object" && (t = Object.keys(e)[0] + ":" + Object.values(e)[0]), r.push(t);
|
|
1200
1477
|
}
|
|
1201
1478
|
let i = this.cache.getItem(this.fixedEncodeURIComponent(e + "//" + r.join("|"))), a = i.get();
|
|
1202
|
-
|
|
1479
|
+
if (a === null) {
|
|
1480
|
+
let r = this.getParser().parse(this.getLexer().tokenize(e), t, n);
|
|
1481
|
+
a = new O(e, r), i.set(a), this.cache.save(i);
|
|
1482
|
+
}
|
|
1483
|
+
return a;
|
|
1203
1484
|
}), 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
|
|
1485
|
+
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
1486
|
}), t(this, "fixedEncodeURIComponent", (e) => encodeURIComponent(e).replace(/[!'()*]/g, function(e) {
|
|
1206
1487
|
return "%" + e.charCodeAt(0).toString(16);
|
|
1207
1488
|
})), t(this, "register", (e, t, n) => {
|
|
1208
|
-
if (this.parser !== null) throw new
|
|
1489
|
+
if (this.parser !== null) throw new oe("Registering functions after calling evaluate(), compile(), or parse() is not supported.");
|
|
1209
1490
|
this.functions[e] = {
|
|
1210
1491
|
compiler: t,
|
|
1211
1492
|
evaluator: n
|
|
@@ -1214,19 +1495,19 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1214
1495
|
this.register(e.getName(), e.getCompiler(), e.getEvaluator());
|
|
1215
1496
|
}), t(this, "registerProvider", (e) => {
|
|
1216
1497
|
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
|
|
1498
|
+
}), t(this, "getLexer", () => (this.lexer === null && (this.lexer = { tokenize: o }), this.lexer)), t(this, "getParser", () => (this.parser === null && (this.parser = new te(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 ae(), this._registerBuiltinFunctions();
|
|
1218
1499
|
for (let e of n) this.registerProvider(e);
|
|
1219
1500
|
}
|
|
1220
1501
|
_registerBuiltinFunctions() {
|
|
1221
|
-
let e =
|
|
1222
|
-
this.addFunction(e), this.addFunction(t), this.addFunction(new
|
|
1502
|
+
let e = A.fromJavascript("Math.min", "min"), t = A.fromJavascript("Math.max", "max");
|
|
1503
|
+
this.addFunction(e), this.addFunction(t), this.addFunction(new A("constant", function(e) {
|
|
1223
1504
|
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
1505
|
}, function(e, t) {
|
|
1225
1506
|
if (typeof t != "string" || !t) return;
|
|
1226
1507
|
let n = (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}, t.split(".").reduce((e, t) => e?.[t], r));
|
|
1227
1508
|
var r;
|
|
1228
1509
|
return n === void 0 && e && Object.prototype.hasOwnProperty.call(e, t) && (n = e[t]), n;
|
|
1229
|
-
})), this.addFunction(new
|
|
1510
|
+
})), this.addFunction(new A("enum", function(e) {
|
|
1230
1511
|
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
1512
|
}, function(e, t) {
|
|
1232
1513
|
if (typeof t != "string" || !t) return;
|
|
@@ -1236,30 +1517,32 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1236
1517
|
}));
|
|
1237
1518
|
}
|
|
1238
1519
|
}
|
|
1239
|
-
class
|
|
1520
|
+
class j {
|
|
1240
1521
|
getFunctions() {
|
|
1241
|
-
throw Error("getFunctions must be implemented by " + this.name);
|
|
1522
|
+
throw Error("getFunctions must be implemented by " + this.constructor.name);
|
|
1242
1523
|
}
|
|
1243
1524
|
}
|
|
1244
|
-
let
|
|
1245
|
-
|
|
1525
|
+
let ce = new A("isset", function(e) {
|
|
1526
|
+
if (/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')$/.test(e)) throw Error("isset() does not support compile() when called with a string-literal path (e.g. isset(\"foo.bar\")). Use an expression path instead (e.g. isset(foo.bar) or isset(foo?.bar)), or call evaluate() directly.");
|
|
1527
|
+
return `(function(){try{var __v=(${e});return __v!==null&&__v!==undefined;}catch(e){return false;}})()`;
|
|
1246
1528
|
}, function(e, t) {
|
|
1247
1529
|
if (typeof t != "string") return t != null;
|
|
1248
1530
|
if (!(t.split(/[.\[]/)[0] in e)) return !0;
|
|
1249
1531
|
let n = "", r = [], i = "", a = "";
|
|
1250
1532
|
for (let e = 0; e < t.length; e++) {
|
|
1251
1533
|
let o = t[e];
|
|
1252
|
-
if (o !== "]")
|
|
1253
|
-
if (
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1534
|
+
if (o !== "]") {
|
|
1535
|
+
if (o !== "[") {
|
|
1536
|
+
if (i === "object" && (!/[A-z0-9_]/.test(o) || e === t.length - 1)) {
|
|
1537
|
+
let n = !1;
|
|
1538
|
+
if (e === t.length - 1 && (a += o, n = !0), i = "", r.push({
|
|
1539
|
+
type: "object",
|
|
1540
|
+
attribute: a
|
|
1541
|
+
}), a = "", n) continue;
|
|
1542
|
+
}
|
|
1543
|
+
o === "." ? (i = "object", a = "") : i ? a += o : n += o;
|
|
1544
|
+
} else i = "array", a = "";
|
|
1545
|
+
} else i = "", r.push({
|
|
1263
1546
|
type: "array",
|
|
1264
1547
|
index: a.replace(/"/g, "").replace(/'/g, "")
|
|
1265
1548
|
}), a = "";
|
|
@@ -1282,28 +1565,38 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1282
1565
|
return !1;
|
|
1283
1566
|
}
|
|
1284
1567
|
return e[n] !== void 0;
|
|
1285
|
-
})
|
|
1286
|
-
function
|
|
1568
|
+
});
|
|
1569
|
+
function le(...e) {
|
|
1570
|
+
let [t, n, r] = e, i = t, a = n;
|
|
1571
|
+
if (e.length < 2 || i === void 0 || a === void 0) return null;
|
|
1572
|
+
if (i === "" || !1 === i || i === null) return !1;
|
|
1573
|
+
if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
|
|
1574
|
+
!0 === i && (i = "1");
|
|
1575
|
+
let o = i + "", s = (a + "").split(o);
|
|
1576
|
+
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));
|
|
1577
|
+
}
|
|
1578
|
+
let ue = (e) => Object.entries(e);
|
|
1579
|
+
function de(e) {
|
|
1287
1580
|
return typeof e == "object" && !!e;
|
|
1288
1581
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1582
|
+
function fe(e) {
|
|
1583
|
+
return de(e) && !function(e) {
|
|
1291
1584
|
return Array.isArray(e);
|
|
1292
1585
|
}(e);
|
|
1293
1586
|
}
|
|
1294
|
-
function
|
|
1587
|
+
function pe(e) {
|
|
1295
1588
|
return function(e) {
|
|
1296
|
-
return
|
|
1589
|
+
return de(e);
|
|
1297
1590
|
}(e) ? e : {};
|
|
1298
1591
|
}
|
|
1299
|
-
let
|
|
1300
|
-
function
|
|
1592
|
+
let M = typeof window == "object" && window !== null ? window : typeof global == "object" && global !== null ? global : {};
|
|
1593
|
+
function me() {
|
|
1301
1594
|
let e = (() => {
|
|
1302
|
-
let e =
|
|
1303
|
-
typeof e == "object" && e || (e = {},
|
|
1595
|
+
let e = M.$locutus;
|
|
1596
|
+
typeof e == "object" && e || (e = {}, M.$locutus = e);
|
|
1304
1597
|
let t = e.php;
|
|
1305
1598
|
return typeof t == "object" && t || (t = {}, e.php = t), t;
|
|
1306
|
-
})(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a =
|
|
1599
|
+
})(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a = fe(t) ? t : {}, o = ((e) => fe(e))(n) ? n : {}, s = ((e) => fe(e))(r) ? r : {}, c = Array.isArray(i) ? i : [];
|
|
1307
1600
|
t !== a && (e.ini = a), n !== o && (e.locales = o), r !== s && (e.localeCategories = s), i !== c && (e.pointers = c);
|
|
1308
1601
|
let l = e.locale_default;
|
|
1309
1602
|
return {
|
|
@@ -1314,11 +1607,42 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1314
1607
|
locale_default: typeof l == "string" ? l : void 0
|
|
1315
1608
|
};
|
|
1316
1609
|
}
|
|
1317
|
-
function
|
|
1318
|
-
let t =
|
|
1610
|
+
function he(e) {
|
|
1611
|
+
let t = me().ini[e];
|
|
1319
1612
|
return t && t.local_value !== void 0 ? t.local_value === null ? "" : String(t.local_value) : "";
|
|
1320
1613
|
}
|
|
1321
|
-
function
|
|
1614
|
+
function ge(e) {
|
|
1615
|
+
if (e === void 0) throw Error("strlen() expects exactly 1 argument, 0 given");
|
|
1616
|
+
let t = e + "";
|
|
1617
|
+
if ((he("unicode.semantics") || "off") === "off") return t.length;
|
|
1618
|
+
let n = 0, r = 0, i = function(e, t) {
|
|
1619
|
+
let n = e.charCodeAt(t);
|
|
1620
|
+
if (n >= 55296 && n <= 56319) {
|
|
1621
|
+
if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
|
|
1622
|
+
let n = e.charCodeAt(t + 1);
|
|
1623
|
+
if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
|
|
1624
|
+
return e.charAt(t) + e.charAt(t + 1);
|
|
1625
|
+
}
|
|
1626
|
+
if (n >= 56320 && n <= 57343) {
|
|
1627
|
+
if (t === 0) throw Error("Low surrogate without preceding high surrogate");
|
|
1628
|
+
let n = e.charCodeAt(t - 1);
|
|
1629
|
+
if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
|
|
1630
|
+
return !1;
|
|
1631
|
+
}
|
|
1632
|
+
return e.charAt(t);
|
|
1633
|
+
};
|
|
1634
|
+
for (n = 0, r = 0; n < t.length; n++) !1 !== i(t, n) && r++;
|
|
1635
|
+
return r;
|
|
1636
|
+
}
|
|
1637
|
+
function _e(e) {
|
|
1638
|
+
if (e === void 0) throw Error("strtolower() expects exactly 1 argument, 0 given");
|
|
1639
|
+
return (e + "").toLowerCase();
|
|
1640
|
+
}
|
|
1641
|
+
function ve(e) {
|
|
1642
|
+
if (e === void 0) throw Error("strtoupper() expects exactly 1 argument, 0 given");
|
|
1643
|
+
return (e + "").toUpperCase();
|
|
1644
|
+
}
|
|
1645
|
+
function ye(e, t, n) {
|
|
1322
1646
|
let r = function(e) {
|
|
1323
1647
|
if (typeof e == "boolean") return e ? "1" : "";
|
|
1324
1648
|
if (typeof e == "string") return e;
|
|
@@ -1326,17 +1650,25 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1326
1650
|
if (e === void 0) return "";
|
|
1327
1651
|
if (typeof e == "object") return Array.isArray(e) ? "Array" : e === null ? "" : "Object";
|
|
1328
1652
|
throw Error("Unsupported value type");
|
|
1329
|
-
}(e), i =
|
|
1653
|
+
}(e), i = he("unicode.semantics") === "on" ? r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || [] : null, a = i ? i.length : r.length, o = a;
|
|
1330
1654
|
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
1655
|
}
|
|
1332
|
-
function
|
|
1656
|
+
function be(e, t, n) {
|
|
1657
|
+
let r = 0;
|
|
1658
|
+
return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
1659
|
+
}
|
|
1660
|
+
function xe(e, t, n) {
|
|
1661
|
+
let r = 0;
|
|
1662
|
+
return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
1663
|
+
}
|
|
1664
|
+
function Se(e, ...t) {
|
|
1333
1665
|
let n = {};
|
|
1334
1666
|
if (t.length < 1) return n;
|
|
1335
|
-
let r =
|
|
1336
|
-
e: for (let [e, i] of
|
|
1667
|
+
let r = pe(e);
|
|
1668
|
+
e: for (let [e, i] of ue(r)) {
|
|
1337
1669
|
for (let e of t) {
|
|
1338
|
-
let t =
|
|
1339
|
-
for (let [, e] of
|
|
1670
|
+
let t = pe(e), n = !1;
|
|
1671
|
+
for (let [, e] of ue(t)) if (e === i) {
|
|
1340
1672
|
n = !0;
|
|
1341
1673
|
break;
|
|
1342
1674
|
}
|
|
@@ -1346,12 +1678,12 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1346
1678
|
}
|
|
1347
1679
|
return n;
|
|
1348
1680
|
}
|
|
1349
|
-
let
|
|
1681
|
+
let Ce = (e) => {
|
|
1350
1682
|
if (!e || typeof e != "object") return !1;
|
|
1351
1683
|
let t = Object.getPrototypeOf(e);
|
|
1352
1684
|
return t === Array.prototype || t === Object.prototype;
|
|
1353
1685
|
};
|
|
1354
|
-
function
|
|
1686
|
+
function we(e, t = 0) {
|
|
1355
1687
|
let n = 0;
|
|
1356
1688
|
if (e == null) return 0;
|
|
1357
1689
|
if (typeof e != "object") return 1;
|
|
@@ -1362,51 +1694,48 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1362
1694
|
for (let t of Object.keys(e)) {
|
|
1363
1695
|
n++;
|
|
1364
1696
|
let r = e[Number(t)];
|
|
1365
|
-
i &&
|
|
1697
|
+
i && Ce(r) && (n += we(r, 1));
|
|
1366
1698
|
}
|
|
1367
1699
|
return n;
|
|
1368
1700
|
}
|
|
1369
|
-
for (let t
|
|
1370
|
-
n++;
|
|
1371
|
-
let r = e[t];
|
|
1372
|
-
i && K(r) && (n += q(r, 1));
|
|
1373
|
-
}
|
|
1701
|
+
for (let t of Object.values(e)) n++, i && Ce(t) && (n += we(t, 1));
|
|
1374
1702
|
return n;
|
|
1375
1703
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1704
|
+
function Te(...e) {
|
|
1705
|
+
let t, n = "", r = "", i = "";
|
|
1706
|
+
if (e.length === 1) {
|
|
1707
|
+
let [n] = e;
|
|
1708
|
+
t = n;
|
|
1709
|
+
} else {
|
|
1710
|
+
let [n, r] = e;
|
|
1711
|
+
i = String(n ?? ""), t = r;
|
|
1712
|
+
}
|
|
1713
|
+
if (typeof t == "object" && t) {
|
|
1714
|
+
if (Array.isArray(t)) return t.join(i);
|
|
1715
|
+
for (let e in t) n += r + t[e], r = i;
|
|
1716
|
+
return n;
|
|
1717
|
+
}
|
|
1718
|
+
return String(t);
|
|
1719
|
+
}
|
|
1720
|
+
let Ee = new A("implode", function(e, t) {
|
|
1721
|
+
return `__runtime.implode(${e}, ${t})`;
|
|
1378
1722
|
}, function(e, t, n) {
|
|
1379
|
-
return
|
|
1380
|
-
|
|
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
|
-
}), ae = new I("count", function(e, t) {
|
|
1723
|
+
return Te(t, n);
|
|
1724
|
+
}), De = new A("count", function(e, t) {
|
|
1396
1725
|
let n = "";
|
|
1397
|
-
return t && (n = `, ${t}`), `count(${e}${n})`;
|
|
1726
|
+
return t && (n = `, ${t}`), `__runtime.count(${e}${n})`;
|
|
1398
1727
|
}, function(e, t, n) {
|
|
1399
|
-
return
|
|
1400
|
-
}),
|
|
1728
|
+
return we(t, n);
|
|
1729
|
+
}), Oe = new A("array_intersect", function(e, ...t) {
|
|
1401
1730
|
let n = "";
|
|
1402
|
-
return t.length > 0 && (n = ", " + t.join(", ")), `array_intersect(${e}${n})`;
|
|
1731
|
+
return t.length > 0 && (n = ", " + t.join(", ")), `__runtime.array_intersect(${e}${n})`;
|
|
1403
1732
|
}, function(e) {
|
|
1404
1733
|
let t = [], n = !0;
|
|
1405
1734
|
for (let e = 1; e < arguments.length; e++) t.push(arguments[e]), Array.isArray(arguments[e]) || (n = !1);
|
|
1406
|
-
let r =
|
|
1735
|
+
let r = Se.apply(null, t);
|
|
1407
1736
|
return n ? Object.values(r) : r;
|
|
1408
1737
|
});
|
|
1409
|
-
function
|
|
1738
|
+
function ke(e, t) {
|
|
1410
1739
|
let n, r = /* @__PURE__ */ new Date(), i = [
|
|
1411
1740
|
"Sun",
|
|
1412
1741
|
"Mon",
|
|
@@ -1428,7 +1757,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1428
1757
|
"November",
|
|
1429
1758
|
"December"
|
|
1430
1759
|
], a = /\\?(.?)/gi, o = function(e, t) {
|
|
1431
|
-
return r = e, Object.
|
|
1760
|
+
return r = e, Object.hasOwn(n, r) ? String(n[e]()) : t;
|
|
1432
1761
|
var r;
|
|
1433
1762
|
}, s = function(e, t) {
|
|
1434
1763
|
let n = String(e);
|
|
@@ -1563,7 +1892,8 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1563
1892
|
}, 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
1893
|
var c, l;
|
|
1565
1894
|
}
|
|
1566
|
-
|
|
1895
|
+
let Ae = "[ \\t]+", N = "[ \\t]*", P = "(?:([ap])\\.?m\\.?([\\t ]|$))", F = "(2[0-4]|[01]?[0-9])", I = "([01][0-9]|2[0-4])", L = "(0?[1-9]|1[0-2])", R = "([0-5]?[0-9])", z = "([0-5][0-9])", je = "(60|[0-5]?[0-9])", B = "(60|[0-5][0-9])", Me = "(?:\\.([0-9]+))", Ne = "sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?", Pe = "next|last|previous|this", Fe = "(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|" + Ne, V = "([0-9]{1,4})", H = "([0-9]{4})", U = "(1[0-2]|0?[0-9])", W = "(0[0-9]|1[0-2])", G = "(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)", K = "(0[0-9]|[1-2][0-9]|3[01])", Ie = "january|february|march|april|may|june|july|august|september|october|november|december", q = "jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec", J = "(" + Ie + "|" + q + "|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", Le = "((?:GMT)?([+-])" + F + ":?" + R + "?)", Y = J + "[ .\\t-]*" + G + "[,.stndrh\\t ]*";
|
|
1896
|
+
function X(e, t) {
|
|
1567
1897
|
switch (t?.toLowerCase()) {
|
|
1568
1898
|
case "a":
|
|
1569
1899
|
e += e === 12 ? -12 : 0;
|
|
@@ -1572,11 +1902,11 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1572
1902
|
}
|
|
1573
1903
|
return e;
|
|
1574
1904
|
}
|
|
1575
|
-
function
|
|
1905
|
+
function Z(e) {
|
|
1576
1906
|
let t = +e;
|
|
1577
1907
|
return e.length < 4 && t < 100 && (t += t < 70 ? 2e3 : 1900), t;
|
|
1578
1908
|
}
|
|
1579
|
-
function
|
|
1909
|
+
function Q(e) {
|
|
1580
1910
|
return {
|
|
1581
1911
|
jan: 0,
|
|
1582
1912
|
january: 0,
|
|
@@ -1616,7 +1946,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1616
1946
|
xii: 11
|
|
1617
1947
|
}[e.toLowerCase()] ?? NaN;
|
|
1618
1948
|
}
|
|
1619
|
-
function
|
|
1949
|
+
function Re(e, t = 0) {
|
|
1620
1950
|
return {
|
|
1621
1951
|
mon: 1,
|
|
1622
1952
|
monday: 1,
|
|
@@ -1634,13 +1964,13 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1634
1964
|
sunday: 0
|
|
1635
1965
|
}[e.toLowerCase()] || t;
|
|
1636
1966
|
}
|
|
1637
|
-
function
|
|
1967
|
+
function ze(e, t = NaN) {
|
|
1638
1968
|
let n = e?.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i);
|
|
1639
1969
|
if (!n) return t;
|
|
1640
1970
|
let r = n[1] === "-" ? -1 : 1, i = +(n[2] ?? 0), a = +(n[4] ?? 0);
|
|
1641
1971
|
return n[4] || n[3] || (a = Math.floor(i % 100), i = Math.floor(i / 100)), r * (60 * i + a) * 60;
|
|
1642
1972
|
}
|
|
1643
|
-
let
|
|
1973
|
+
let Be = {
|
|
1644
1974
|
acdt: 37800,
|
|
1645
1975
|
acst: 34200,
|
|
1646
1976
|
addt: -7200,
|
|
@@ -1829,22 +2159,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1829
2159
|
regex: /^(first|last) day of/i,
|
|
1830
2160
|
name: "firstdayof | lastdayof",
|
|
1831
2161
|
callback(e, t) {
|
|
1832
|
-
t.toLowerCase() === "first" ?
|
|
2162
|
+
this.firstOrLastDayOfMonth = t.toLowerCase() === "first" ? 1 : -1;
|
|
1833
2163
|
}
|
|
1834
2164
|
},
|
|
1835
2165
|
backOrFrontOf: {
|
|
1836
|
-
regex:
|
|
2166
|
+
regex: RegExp("^(back|front) of " + F + N + P + "?", "i"),
|
|
1837
2167
|
name: "backof | frontof",
|
|
1838
2168
|
callback(e, t, n, r) {
|
|
1839
2169
|
let i = +n, a = 15;
|
|
1840
|
-
return t.toLowerCase() === "back" || (--i, a = 45), i =
|
|
2170
|
+
return t.toLowerCase() === "back" || (--i, a = 45), i = X(i, r), this.resetTime() && this.time(i, a, 0, 0);
|
|
1841
2171
|
}
|
|
1842
2172
|
},
|
|
1843
2173
|
mssqltime: {
|
|
1844
|
-
regex:
|
|
2174
|
+
regex: RegExp("^" + L + ":" + z + ":" + B + "[:.]([0-9]+)" + P, "i"),
|
|
1845
2175
|
name: "mssqltime",
|
|
1846
2176
|
callback(e, t, n, r, i, a) {
|
|
1847
|
-
return this.time(
|
|
2177
|
+
return this.time(X(+t, a), +n, +r, +i.substr(0, 3));
|
|
1848
2178
|
}
|
|
1849
2179
|
},
|
|
1850
2180
|
oracledate: {
|
|
@@ -1869,175 +2199,175 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1869
2199
|
}
|
|
1870
2200
|
},
|
|
1871
2201
|
timeLong12: {
|
|
1872
|
-
regex:
|
|
2202
|
+
regex: RegExp("^" + L + "[:.]" + R + "[:.]" + B + N + P, "i"),
|
|
1873
2203
|
name: "timelong12",
|
|
1874
2204
|
callback(e, t, n, r, i) {
|
|
1875
|
-
return this.time(
|
|
2205
|
+
return this.time(X(+t, i), +n, +r, 0);
|
|
1876
2206
|
}
|
|
1877
2207
|
},
|
|
1878
2208
|
timeShort12: {
|
|
1879
|
-
regex:
|
|
2209
|
+
regex: RegExp("^" + L + "[:.]" + z + N + P, "i"),
|
|
1880
2210
|
name: "timeshort12",
|
|
1881
2211
|
callback(e, t, n, r) {
|
|
1882
|
-
return this.time(
|
|
2212
|
+
return this.time(X(+t, r), +n, 0, 0);
|
|
1883
2213
|
}
|
|
1884
2214
|
},
|
|
1885
2215
|
timeTiny12: {
|
|
1886
|
-
regex:
|
|
2216
|
+
regex: RegExp("^" + L + N + P, "i"),
|
|
1887
2217
|
name: "timetiny12",
|
|
1888
2218
|
callback(e, t, n) {
|
|
1889
|
-
return this.time(
|
|
2219
|
+
return this.time(X(+t, n), 0, 0, 0);
|
|
1890
2220
|
}
|
|
1891
2221
|
},
|
|
1892
2222
|
soap: {
|
|
1893
|
-
regex:
|
|
2223
|
+
regex: RegExp("^" + H + "-" + W + "-" + K + "T" + I + ":" + z + ":" + B + Me + Le + "?", "i"),
|
|
1894
2224
|
name: "soap",
|
|
1895
2225
|
callback(e, t, n, r, i, a, o, s, c) {
|
|
1896
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(
|
|
2226
|
+
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(ze(c));
|
|
1897
2227
|
}
|
|
1898
2228
|
},
|
|
1899
2229
|
wddx: {
|
|
1900
|
-
regex:
|
|
2230
|
+
regex: RegExp("^" + H + "-" + U + "-" + G + "T" + F + ":" + R + ":" + je),
|
|
1901
2231
|
name: "wddx",
|
|
1902
2232
|
callback(e, t, n, r, i, a, o) {
|
|
1903
2233
|
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1904
2234
|
}
|
|
1905
2235
|
},
|
|
1906
2236
|
exif: {
|
|
1907
|
-
regex:
|
|
2237
|
+
regex: RegExp("^" + H + ":" + W + ":" + K + " " + I + ":" + z + ":" + B, "i"),
|
|
1908
2238
|
name: "exif",
|
|
1909
2239
|
callback(e, t, n, r, i, a, o) {
|
|
1910
2240
|
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1911
2241
|
}
|
|
1912
2242
|
},
|
|
1913
2243
|
xmlRpc: {
|
|
1914
|
-
regex:
|
|
2244
|
+
regex: RegExp("^" + H + W + K + "T" + F + ":" + z + ":" + B),
|
|
1915
2245
|
name: "xmlrpc",
|
|
1916
2246
|
callback(e, t, n, r, i, a, o) {
|
|
1917
2247
|
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1918
2248
|
}
|
|
1919
2249
|
},
|
|
1920
2250
|
xmlRpcNoColon: {
|
|
1921
|
-
regex:
|
|
2251
|
+
regex: RegExp("^" + H + W + K + "[Tt]" + F + z + B),
|
|
1922
2252
|
name: "xmlrpcnocolon",
|
|
1923
2253
|
callback(e, t, n, r, i, a, o) {
|
|
1924
2254
|
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1925
2255
|
}
|
|
1926
2256
|
},
|
|
1927
2257
|
clf: {
|
|
1928
|
-
regex:
|
|
2258
|
+
regex: RegExp("^" + G + "/(" + q + ")/" + H + ":" + I + ":" + z + ":" + B + Ae + Le, "i"),
|
|
1929
2259
|
name: "clf",
|
|
1930
2260
|
callback(e, t, n, r, i, a, o, s) {
|
|
1931
|
-
return this.ymd(+r,
|
|
2261
|
+
return this.ymd(+r, Q(n), +t) && this.time(+i, +a, +o, 0) && this.zone(ze(s));
|
|
1932
2262
|
}
|
|
1933
2263
|
},
|
|
1934
2264
|
iso8601long: {
|
|
1935
|
-
regex:
|
|
2265
|
+
regex: RegExp("^t?" + F + "[:.]" + R + "[:.]" + je + Me, "i"),
|
|
1936
2266
|
name: "iso8601long",
|
|
1937
2267
|
callback(e, t, n, r, i) {
|
|
1938
2268
|
return this.time(+t, +n, +r, +i.substr(0, 3));
|
|
1939
2269
|
}
|
|
1940
2270
|
},
|
|
1941
2271
|
dateTextual: {
|
|
1942
|
-
regex:
|
|
2272
|
+
regex: RegExp("^" + J + "[ .\\t-]*" + G + "[,.stndrh\\t ]+" + V, "i"),
|
|
1943
2273
|
name: "datetextual",
|
|
1944
2274
|
callback(e, t, n, r) {
|
|
1945
|
-
return this.ymd(
|
|
2275
|
+
return this.ymd(Z(r), Q(t), +n);
|
|
1946
2276
|
}
|
|
1947
2277
|
},
|
|
1948
2278
|
pointedDate4: {
|
|
1949
|
-
regex:
|
|
2279
|
+
regex: RegExp("^" + G + "[.\\t-]" + U + "[.-]" + H),
|
|
1950
2280
|
name: "pointeddate4",
|
|
1951
2281
|
callback(e, t, n, r) {
|
|
1952
2282
|
return this.ymd(+r, n - 1, +t);
|
|
1953
2283
|
}
|
|
1954
2284
|
},
|
|
1955
2285
|
pointedDate2: {
|
|
1956
|
-
regex:
|
|
2286
|
+
regex: RegExp("^" + G + "[.\\t]" + U + "\\.([0-9]{2})"),
|
|
1957
2287
|
name: "pointeddate2",
|
|
1958
2288
|
callback(e, t, n, r) {
|
|
1959
|
-
return this.ymd(
|
|
2289
|
+
return this.ymd(Z(r), n - 1, +t);
|
|
1960
2290
|
}
|
|
1961
2291
|
},
|
|
1962
2292
|
timeLong24: {
|
|
1963
|
-
regex:
|
|
2293
|
+
regex: RegExp("^t?" + F + "[:.]" + R + "[:.]" + je),
|
|
1964
2294
|
name: "timelong24",
|
|
1965
2295
|
callback(e, t, n, r) {
|
|
1966
2296
|
return this.time(+t, +n, +r, 0);
|
|
1967
2297
|
}
|
|
1968
2298
|
},
|
|
1969
2299
|
dateNoColon: {
|
|
1970
|
-
regex:
|
|
2300
|
+
regex: RegExp("^" + H + W + K),
|
|
1971
2301
|
name: "datenocolon",
|
|
1972
2302
|
callback(e, t, n, r) {
|
|
1973
2303
|
return this.ymd(+t, n - 1, +r);
|
|
1974
2304
|
}
|
|
1975
2305
|
},
|
|
1976
2306
|
pgydotd: {
|
|
1977
|
-
regex:
|
|
2307
|
+
regex: RegExp("^" + H + "\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),
|
|
1978
2308
|
name: "pgydotd",
|
|
1979
2309
|
callback(e, t, n) {
|
|
1980
2310
|
return this.ymd(+t, 0, +n);
|
|
1981
2311
|
}
|
|
1982
2312
|
},
|
|
1983
2313
|
timeShort24: {
|
|
1984
|
-
regex:
|
|
2314
|
+
regex: RegExp("^t?" + F + "[:.]" + R, "i"),
|
|
1985
2315
|
name: "timeshort24",
|
|
1986
2316
|
callback(e, t, n) {
|
|
1987
2317
|
return this.time(+t, +n, 0, 0);
|
|
1988
2318
|
}
|
|
1989
2319
|
},
|
|
1990
2320
|
iso8601noColon: {
|
|
1991
|
-
regex:
|
|
2321
|
+
regex: RegExp("^t?" + I + z + B, "i"),
|
|
1992
2322
|
name: "iso8601nocolon",
|
|
1993
2323
|
callback(e, t, n, r) {
|
|
1994
2324
|
return this.time(+t, +n, +r, 0);
|
|
1995
2325
|
}
|
|
1996
2326
|
},
|
|
1997
2327
|
iso8601dateSlash: {
|
|
1998
|
-
regex:
|
|
2328
|
+
regex: RegExp("^" + H + "/" + W + "/" + K + "/"),
|
|
1999
2329
|
name: "iso8601dateslash",
|
|
2000
2330
|
callback(e, t, n, r) {
|
|
2001
2331
|
return this.ymd(+t, n - 1, +r);
|
|
2002
2332
|
}
|
|
2003
2333
|
},
|
|
2004
2334
|
dateSlash: {
|
|
2005
|
-
regex:
|
|
2335
|
+
regex: RegExp("^" + H + "/" + U + "/" + G),
|
|
2006
2336
|
name: "dateslash",
|
|
2007
2337
|
callback(e, t, n, r) {
|
|
2008
2338
|
return this.ymd(+t, n - 1, +r);
|
|
2009
2339
|
}
|
|
2010
2340
|
},
|
|
2011
2341
|
american: {
|
|
2012
|
-
regex:
|
|
2342
|
+
regex: RegExp("^" + U + "/" + G + "/" + V),
|
|
2013
2343
|
name: "american",
|
|
2014
2344
|
callback(e, t, n, r) {
|
|
2015
|
-
return this.ymd(
|
|
2345
|
+
return this.ymd(Z(r), t - 1, +n);
|
|
2016
2346
|
}
|
|
2017
2347
|
},
|
|
2018
2348
|
americanShort: {
|
|
2019
|
-
regex:
|
|
2349
|
+
regex: RegExp("^" + U + "/" + G),
|
|
2020
2350
|
name: "americanshort",
|
|
2021
2351
|
callback(e, t, n) {
|
|
2022
2352
|
return this.ymd(this.y, t - 1, +n);
|
|
2023
2353
|
}
|
|
2024
2354
|
},
|
|
2025
2355
|
gnuDateShortOrIso8601date2: {
|
|
2026
|
-
regex:
|
|
2356
|
+
regex: RegExp("^" + V + "-" + U + "-" + G),
|
|
2027
2357
|
name: "gnudateshort | iso8601date2",
|
|
2028
2358
|
callback(e, t, n, r) {
|
|
2029
|
-
return this.ymd(
|
|
2359
|
+
return this.ymd(Z(t), n - 1, +r);
|
|
2030
2360
|
}
|
|
2031
2361
|
},
|
|
2032
2362
|
iso8601date4: {
|
|
2033
|
-
regex:
|
|
2363
|
+
regex: RegExp("^([+-]?[0-9]{4})-" + W + "-" + K),
|
|
2034
2364
|
name: "iso8601date4",
|
|
2035
2365
|
callback(e, t, n, r) {
|
|
2036
2366
|
return this.ymd(+t, n - 1, +r);
|
|
2037
2367
|
}
|
|
2038
2368
|
},
|
|
2039
2369
|
gnuNoColon: {
|
|
2040
|
-
regex:
|
|
2370
|
+
regex: RegExp("^t?" + I + z, "i"),
|
|
2041
2371
|
name: "gnunocolon",
|
|
2042
2372
|
callback(e, t, n) {
|
|
2043
2373
|
switch (this.times) {
|
|
@@ -2048,63 +2378,63 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2048
2378
|
}
|
|
2049
2379
|
},
|
|
2050
2380
|
gnuDateShorter: {
|
|
2051
|
-
regex:
|
|
2381
|
+
regex: RegExp("^" + H + "-" + U),
|
|
2052
2382
|
name: "gnudateshorter",
|
|
2053
2383
|
callback(e, t, n) {
|
|
2054
2384
|
return this.ymd(+t, n - 1, 1);
|
|
2055
2385
|
}
|
|
2056
2386
|
},
|
|
2057
2387
|
pgTextReverse: {
|
|
2058
|
-
regex:
|
|
2388
|
+
regex: RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-(" + q + ")-" + K, "i"),
|
|
2059
2389
|
name: "pgtextreverse",
|
|
2060
2390
|
callback(e, t, n, r) {
|
|
2061
|
-
return this.ymd(
|
|
2391
|
+
return this.ymd(Z(t), Q(n), +r);
|
|
2062
2392
|
}
|
|
2063
2393
|
},
|
|
2064
2394
|
dateFull: {
|
|
2065
|
-
regex:
|
|
2395
|
+
regex: RegExp("^" + G + "[ \\t.-]*" + J + "[ \\t.-]*" + V, "i"),
|
|
2066
2396
|
name: "datefull",
|
|
2067
2397
|
callback(e, t, n, r) {
|
|
2068
|
-
return this.ymd(
|
|
2398
|
+
return this.ymd(Z(r), Q(n), +t);
|
|
2069
2399
|
}
|
|
2070
2400
|
},
|
|
2071
2401
|
dateNoDay: {
|
|
2072
|
-
regex:
|
|
2402
|
+
regex: RegExp("^" + J + "[ .\\t-]*" + H, "i"),
|
|
2073
2403
|
name: "datenoday",
|
|
2074
2404
|
callback(e, t, n) {
|
|
2075
|
-
return this.ymd(+n,
|
|
2405
|
+
return this.ymd(+n, Q(t), 1);
|
|
2076
2406
|
}
|
|
2077
2407
|
},
|
|
2078
2408
|
dateNoDayRev: {
|
|
2079
|
-
regex:
|
|
2409
|
+
regex: RegExp("^" + H + "[ .\\t-]*" + J, "i"),
|
|
2080
2410
|
name: "datenodayrev",
|
|
2081
2411
|
callback(e, t, n) {
|
|
2082
|
-
return this.ymd(+t,
|
|
2412
|
+
return this.ymd(+t, Q(n), 1);
|
|
2083
2413
|
}
|
|
2084
2414
|
},
|
|
2085
2415
|
pgTextShort: {
|
|
2086
|
-
regex:
|
|
2416
|
+
regex: RegExp("^(" + q + ")-" + K + "-" + V, "i"),
|
|
2087
2417
|
name: "pgtextshort",
|
|
2088
2418
|
callback(e, t, n, r) {
|
|
2089
|
-
return this.ymd(
|
|
2419
|
+
return this.ymd(Z(r), Q(t), +n);
|
|
2090
2420
|
}
|
|
2091
2421
|
},
|
|
2092
2422
|
dateNoYear: {
|
|
2093
|
-
regex:
|
|
2423
|
+
regex: RegExp("^" + Y, "i"),
|
|
2094
2424
|
name: "datenoyear",
|
|
2095
2425
|
callback(e, t, n) {
|
|
2096
|
-
return this.ymd(this.y,
|
|
2426
|
+
return this.ymd(this.y, Q(t), +n);
|
|
2097
2427
|
}
|
|
2098
2428
|
},
|
|
2099
2429
|
dateNoYearRev: {
|
|
2100
|
-
regex:
|
|
2430
|
+
regex: RegExp("^" + G + "[ .\\t-]*" + J, "i"),
|
|
2101
2431
|
name: "datenoyearrev",
|
|
2102
2432
|
callback(e, t, n) {
|
|
2103
|
-
return this.ymd(this.y,
|
|
2433
|
+
return this.ymd(this.y, Q(n), +t);
|
|
2104
2434
|
}
|
|
2105
2435
|
},
|
|
2106
2436
|
isoWeekDay: {
|
|
2107
|
-
regex:
|
|
2437
|
+
regex: RegExp("^" + H + "-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),
|
|
2108
2438
|
name: "isoweekday | isoweek",
|
|
2109
2439
|
callback(e, t, n, r) {
|
|
2110
2440
|
let i = r ? +r : 1;
|
|
@@ -2114,7 +2444,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2114
2444
|
}
|
|
2115
2445
|
},
|
|
2116
2446
|
relativeText: {
|
|
2117
|
-
regex:
|
|
2447
|
+
regex: RegExp("^(first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth|" + Pe + ")" + Ae + "(" + Fe + ")", "i"),
|
|
2118
2448
|
name: "relativetext",
|
|
2119
2449
|
callback(e, t, n) {
|
|
2120
2450
|
let { amount: r } = function(e) {
|
|
@@ -2194,53 +2524,53 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2194
2524
|
case "sat":
|
|
2195
2525
|
case "saturday":
|
|
2196
2526
|
case "sun":
|
|
2197
|
-
case "sunday": this.resetTime(), this.weekday =
|
|
2527
|
+
case "sunday": this.resetTime(), this.weekday = Re(n, 7), this.weekdayBehavior = 1, this.rd += 7 * (r > 0 ? r - 1 : r);
|
|
2198
2528
|
}
|
|
2199
2529
|
}
|
|
2200
2530
|
},
|
|
2201
2531
|
relative: {
|
|
2202
|
-
regex:
|
|
2532
|
+
regex: RegExp("^([+-]*)[ \\t]*(\\d+)[ \\t]*(" + Fe + "|week)", "i"),
|
|
2203
2533
|
name: "relative",
|
|
2204
2534
|
callback(e, t, n, r) {
|
|
2205
|
-
let i =
|
|
2535
|
+
let i = t.replace(/[^-]/g, "").length, a = +n * (-1) ** i;
|
|
2206
2536
|
switch (r.toLowerCase()) {
|
|
2207
2537
|
case "sec":
|
|
2208
2538
|
case "secs":
|
|
2209
2539
|
case "second":
|
|
2210
2540
|
case "seconds":
|
|
2211
|
-
this.rs +=
|
|
2541
|
+
this.rs += a;
|
|
2212
2542
|
break;
|
|
2213
2543
|
case "min":
|
|
2214
2544
|
case "mins":
|
|
2215
2545
|
case "minute":
|
|
2216
2546
|
case "minutes":
|
|
2217
|
-
this.ri +=
|
|
2547
|
+
this.ri += a;
|
|
2218
2548
|
break;
|
|
2219
2549
|
case "hour":
|
|
2220
2550
|
case "hours":
|
|
2221
|
-
this.rh +=
|
|
2551
|
+
this.rh += a;
|
|
2222
2552
|
break;
|
|
2223
2553
|
case "day":
|
|
2224
2554
|
case "days":
|
|
2225
|
-
this.rd +=
|
|
2555
|
+
this.rd += a;
|
|
2226
2556
|
break;
|
|
2227
2557
|
case "fortnight":
|
|
2228
2558
|
case "fortnights":
|
|
2229
2559
|
case "forthnight":
|
|
2230
2560
|
case "forthnights":
|
|
2231
|
-
this.rd += 14 *
|
|
2561
|
+
this.rd += 14 * a;
|
|
2232
2562
|
break;
|
|
2233
2563
|
case "week":
|
|
2234
2564
|
case "weeks":
|
|
2235
|
-
this.rd += 7 *
|
|
2565
|
+
this.rd += 7 * a;
|
|
2236
2566
|
break;
|
|
2237
2567
|
case "month":
|
|
2238
2568
|
case "months":
|
|
2239
|
-
this.rm +=
|
|
2569
|
+
this.rm += a;
|
|
2240
2570
|
break;
|
|
2241
2571
|
case "year":
|
|
2242
2572
|
case "years":
|
|
2243
|
-
this.ry +=
|
|
2573
|
+
this.ry += a;
|
|
2244
2574
|
break;
|
|
2245
2575
|
case "mon":
|
|
2246
2576
|
case "monday":
|
|
@@ -2255,19 +2585,19 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2255
2585
|
case "sat":
|
|
2256
2586
|
case "saturday":
|
|
2257
2587
|
case "sun":
|
|
2258
|
-
case "sunday": this.resetTime(), this.weekday =
|
|
2588
|
+
case "sunday": this.resetTime(), this.weekday = Re(r, 7), this.weekdayBehavior = 1, this.rd += 7 * (a > 0 ? a - 1 : a);
|
|
2259
2589
|
}
|
|
2260
2590
|
}
|
|
2261
2591
|
},
|
|
2262
2592
|
dayText: {
|
|
2263
|
-
regex:
|
|
2593
|
+
regex: RegExp("^(" + Ne + ")", "i"),
|
|
2264
2594
|
name: "daytext",
|
|
2265
2595
|
callback(e, t) {
|
|
2266
|
-
this.resetTime(), this.weekday =
|
|
2596
|
+
this.resetTime(), this.weekday = Re(t, 0), this.weekdayBehavior !== 2 && (this.weekdayBehavior = 1);
|
|
2267
2597
|
}
|
|
2268
2598
|
},
|
|
2269
2599
|
relativeTextWeek: {
|
|
2270
|
-
regex:
|
|
2600
|
+
regex: RegExp("^(" + Pe + ")" + Ae + "week", "i"),
|
|
2271
2601
|
name: "relativetextweek",
|
|
2272
2602
|
callback(e, t) {
|
|
2273
2603
|
switch (this.weekdayBehavior = 2, t.toLowerCase()) {
|
|
@@ -2284,24 +2614,24 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2284
2614
|
}
|
|
2285
2615
|
},
|
|
2286
2616
|
monthFullOrMonthAbbr: {
|
|
2287
|
-
regex:
|
|
2617
|
+
regex: RegExp("^(" + Ie + "|" + q + ")", "i"),
|
|
2288
2618
|
name: "monthfull | monthabbr",
|
|
2289
2619
|
callback(e, t) {
|
|
2290
|
-
return this.ymd(this.y,
|
|
2620
|
+
return this.ymd(this.y, Q(t), this.d);
|
|
2291
2621
|
}
|
|
2292
2622
|
},
|
|
2293
2623
|
tzCorrection: {
|
|
2294
|
-
regex:
|
|
2624
|
+
regex: RegExp("^" + Le, "i"),
|
|
2295
2625
|
name: "tzcorrection",
|
|
2296
2626
|
callback(e) {
|
|
2297
|
-
return this.zone(
|
|
2627
|
+
return this.zone(ze(e));
|
|
2298
2628
|
}
|
|
2299
2629
|
},
|
|
2300
2630
|
tzAbbr: {
|
|
2301
2631
|
regex: /* @__PURE__ */ RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),
|
|
2302
2632
|
name: "tzabbr",
|
|
2303
2633
|
callback(e, t) {
|
|
2304
|
-
let n =
|
|
2634
|
+
let n = Be[t.toLowerCase()];
|
|
2305
2635
|
return n != null && !Number.isNaN(n) && this.zone(n);
|
|
2306
2636
|
}
|
|
2307
2637
|
},
|
|
@@ -2313,7 +2643,7 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2313
2643
|
}
|
|
2314
2644
|
},
|
|
2315
2645
|
year4: {
|
|
2316
|
-
regex:
|
|
2646
|
+
regex: RegExp("^" + H),
|
|
2317
2647
|
name: "year4",
|
|
2318
2648
|
callback(e, t) {
|
|
2319
2649
|
return this.y = +t, !0;
|
|
@@ -2324,34 +2654,34 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2324
2654
|
name: "whitespace"
|
|
2325
2655
|
},
|
|
2326
2656
|
dateShortWithTimeLong: {
|
|
2327
|
-
regex:
|
|
2657
|
+
regex: RegExp("^" + Y + "t?" + F + "[:.]" + R + "[:.]" + je, "i"),
|
|
2328
2658
|
name: "dateshortwithtimelong",
|
|
2329
2659
|
callback(e, t, n, r, i, a) {
|
|
2330
|
-
return this.ymd(this.y,
|
|
2660
|
+
return this.ymd(this.y, Q(t), +n) && this.time(+r, +i, +a, 0);
|
|
2331
2661
|
}
|
|
2332
2662
|
},
|
|
2333
2663
|
dateShortWithTimeLong12: {
|
|
2334
|
-
regex:
|
|
2664
|
+
regex: RegExp("^" + Y + L + "[:.]" + R + "[:.]" + B + N + P, "i"),
|
|
2335
2665
|
name: "dateshortwithtimelong12",
|
|
2336
2666
|
callback(e, t, n, r, i, a, o) {
|
|
2337
|
-
return this.ymd(this.y,
|
|
2667
|
+
return this.ymd(this.y, Q(t), +n) && this.time(X(+r, o), +i, +a, 0);
|
|
2338
2668
|
}
|
|
2339
2669
|
},
|
|
2340
2670
|
dateShortWithTimeShort: {
|
|
2341
|
-
regex:
|
|
2671
|
+
regex: RegExp("^" + Y + "t?" + F + "[:.]" + R, "i"),
|
|
2342
2672
|
name: "dateshortwithtimeshort",
|
|
2343
2673
|
callback(e, t, n, r, i) {
|
|
2344
|
-
return this.ymd(this.y,
|
|
2674
|
+
return this.ymd(this.y, Q(t), +n) && this.time(+r, +i, 0, 0);
|
|
2345
2675
|
}
|
|
2346
2676
|
},
|
|
2347
2677
|
dateShortWithTimeShort12: {
|
|
2348
|
-
regex:
|
|
2678
|
+
regex: RegExp("^" + Y + L + "[:.]" + z + N + P, "i"),
|
|
2349
2679
|
name: "dateshortwithtimeshort12",
|
|
2350
2680
|
callback(e, t, n, r, i, a) {
|
|
2351
|
-
return this.ymd(this.y,
|
|
2681
|
+
return this.ymd(this.y, Q(t), +n) && this.time(X(+r, a), +i, 0, 0);
|
|
2352
2682
|
}
|
|
2353
2683
|
}
|
|
2354
|
-
},
|
|
2684
|
+
}, Ve = {
|
|
2355
2685
|
y: NaN,
|
|
2356
2686
|
m: NaN,
|
|
2357
2687
|
d: NaN,
|
|
@@ -2413,174 +2743,459 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2413
2743
|
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;
|
|
2414
2744
|
}
|
|
2415
2745
|
};
|
|
2416
|
-
|
|
2746
|
+
function He(e, t) {
|
|
2747
|
+
let n = t ?? Math.floor(Date.now() / 1e3), r = [
|
|
2748
|
+
$.yesterday,
|
|
2749
|
+
$.now,
|
|
2750
|
+
$.noon,
|
|
2751
|
+
$.midnightOrToday,
|
|
2752
|
+
$.tomorrow,
|
|
2753
|
+
$.timestamp,
|
|
2754
|
+
$.firstOrLastDay,
|
|
2755
|
+
$.backOrFrontOf,
|
|
2756
|
+
$.timeTiny12,
|
|
2757
|
+
$.timeShort12,
|
|
2758
|
+
$.timeLong12,
|
|
2759
|
+
$.mssqltime,
|
|
2760
|
+
$.oracledate,
|
|
2761
|
+
$.timeShort24,
|
|
2762
|
+
$.timeLong24,
|
|
2763
|
+
$.iso8601long,
|
|
2764
|
+
$.gnuNoColon,
|
|
2765
|
+
$.iso8601noColon,
|
|
2766
|
+
$.americanShort,
|
|
2767
|
+
$.american,
|
|
2768
|
+
$.iso8601date4,
|
|
2769
|
+
$.iso8601dateSlash,
|
|
2770
|
+
$.dateSlash,
|
|
2771
|
+
$.gnuDateShortOrIso8601date2,
|
|
2772
|
+
$.gnuDateShorter,
|
|
2773
|
+
$.dateFull,
|
|
2774
|
+
$.pointedDate4,
|
|
2775
|
+
$.pointedDate2,
|
|
2776
|
+
$.dateNoDay,
|
|
2777
|
+
$.dateNoDayRev,
|
|
2778
|
+
$.dateTextual,
|
|
2779
|
+
$.dateNoYear,
|
|
2780
|
+
$.dateNoYearRev,
|
|
2781
|
+
$.dateNoColon,
|
|
2782
|
+
$.xmlRpc,
|
|
2783
|
+
$.xmlRpcNoColon,
|
|
2784
|
+
$.soap,
|
|
2785
|
+
$.wddx,
|
|
2786
|
+
$.exif,
|
|
2787
|
+
$.pgydotd,
|
|
2788
|
+
$.isoWeekDay,
|
|
2789
|
+
$.pgTextShort,
|
|
2790
|
+
$.pgTextReverse,
|
|
2791
|
+
$.clf,
|
|
2792
|
+
$.year4,
|
|
2793
|
+
$.ago,
|
|
2794
|
+
$.dayText,
|
|
2795
|
+
$.relativeTextWeek,
|
|
2796
|
+
$.relativeText,
|
|
2797
|
+
$.monthFullOrMonthAbbr,
|
|
2798
|
+
$.tzCorrection,
|
|
2799
|
+
$.tzAbbr,
|
|
2800
|
+
$.dateShortWithTimeShort12,
|
|
2801
|
+
$.dateShortWithTimeLong12,
|
|
2802
|
+
$.dateShortWithTimeShort,
|
|
2803
|
+
$.dateShortWithTimeLong,
|
|
2804
|
+
$.relative,
|
|
2805
|
+
$.whitespace
|
|
2806
|
+
], i = { ...Ve };
|
|
2807
|
+
for (; e.length;) {
|
|
2808
|
+
let t = null, n = null;
|
|
2809
|
+
for (let i of r) {
|
|
2810
|
+
let r = e.match(i.regex);
|
|
2811
|
+
r && (!t || r[0].length > t[0].length) && (t = r, n = i);
|
|
2812
|
+
}
|
|
2813
|
+
if (!n || !t || n.callback && !1 === n.callback.apply(i, t)) return !1;
|
|
2814
|
+
e = e.substr(t[0].length), n = null, t = null;
|
|
2815
|
+
}
|
|
2816
|
+
return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
|
|
2817
|
+
}
|
|
2818
|
+
function Ue(e) {
|
|
2819
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2820
|
+
}
|
|
2821
|
+
var We, Ge = { exports: {} }, Ke = Ue((We || (We = 1, function(e) {
|
|
2822
|
+
e.exports = function() {
|
|
2823
|
+
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
2824
|
+
name: "en",
|
|
2825
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
2826
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
2827
|
+
ordinal: function(e) {
|
|
2828
|
+
var t = [
|
|
2829
|
+
"th",
|
|
2830
|
+
"st",
|
|
2831
|
+
"nd",
|
|
2832
|
+
"rd"
|
|
2833
|
+
], n = e % 100;
|
|
2834
|
+
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
2835
|
+
}
|
|
2836
|
+
}, _ = function(e, t, n) {
|
|
2837
|
+
var r = String(e);
|
|
2838
|
+
return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
|
|
2839
|
+
}, v = {
|
|
2840
|
+
s: _,
|
|
2841
|
+
z: function(e) {
|
|
2842
|
+
var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
|
|
2843
|
+
return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
|
|
2844
|
+
},
|
|
2845
|
+
m: function e(t, n) {
|
|
2846
|
+
if (t.date() < n.date()) return -e(n, t);
|
|
2847
|
+
var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
|
|
2848
|
+
return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
|
|
2849
|
+
},
|
|
2850
|
+
a: function(e) {
|
|
2851
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
2852
|
+
},
|
|
2853
|
+
p: function(e) {
|
|
2854
|
+
return {
|
|
2855
|
+
M: l,
|
|
2856
|
+
y: d,
|
|
2857
|
+
w: c,
|
|
2858
|
+
d: s,
|
|
2859
|
+
D: f,
|
|
2860
|
+
h: o,
|
|
2861
|
+
m: a,
|
|
2862
|
+
s: i,
|
|
2863
|
+
ms: r,
|
|
2864
|
+
Q: u
|
|
2865
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
2866
|
+
},
|
|
2867
|
+
u: function(e) {
|
|
2868
|
+
return e === void 0;
|
|
2869
|
+
}
|
|
2870
|
+
}, y = "en", b = {};
|
|
2871
|
+
b[y] = g;
|
|
2872
|
+
var x = "$isDayjsObject", S = function(e) {
|
|
2873
|
+
return e instanceof E || !(!e || !e[x]);
|
|
2874
|
+
}, C = function e(t, n, r) {
|
|
2875
|
+
var i;
|
|
2876
|
+
if (!t) return y;
|
|
2877
|
+
if (typeof t == "string") {
|
|
2878
|
+
var a = t.toLowerCase();
|
|
2879
|
+
b[a] && (i = a), n && (b[a] = n, i = a);
|
|
2880
|
+
var o = t.split("-");
|
|
2881
|
+
if (!i && o.length > 1) return e(o[0]);
|
|
2882
|
+
} else {
|
|
2883
|
+
var s = t.name;
|
|
2884
|
+
b[s] = t, i = s;
|
|
2885
|
+
}
|
|
2886
|
+
return !r && i && (y = i), i || !r && y;
|
|
2887
|
+
}, w = function(e, t) {
|
|
2888
|
+
if (S(e)) return e.clone();
|
|
2889
|
+
var n = typeof t == "object" ? t : {};
|
|
2890
|
+
return n.date = e, n.args = arguments, new E(n);
|
|
2891
|
+
}, T = v;
|
|
2892
|
+
T.l = C, T.i = S, T.w = function(e, t) {
|
|
2893
|
+
return w(e, {
|
|
2894
|
+
locale: t.$L,
|
|
2895
|
+
utc: t.$u,
|
|
2896
|
+
x: t.$x,
|
|
2897
|
+
$offset: t.$offset
|
|
2898
|
+
});
|
|
2899
|
+
};
|
|
2900
|
+
var E = function() {
|
|
2901
|
+
function g(e) {
|
|
2902
|
+
this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
|
|
2903
|
+
}
|
|
2904
|
+
var _ = g.prototype;
|
|
2905
|
+
return _.parse = function(e) {
|
|
2906
|
+
this.$d = function(e) {
|
|
2907
|
+
var t = e.date, n = e.utc;
|
|
2908
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
2909
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
2910
|
+
if (t instanceof Date) return new Date(t);
|
|
2911
|
+
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
2912
|
+
var r = t.match(m);
|
|
2913
|
+
if (r) {
|
|
2914
|
+
var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
|
|
2915
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
return new Date(t);
|
|
2919
|
+
}(e), this.init();
|
|
2920
|
+
}, _.init = function() {
|
|
2921
|
+
var e = this.$d;
|
|
2922
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
2923
|
+
}, _.$utils = function() {
|
|
2924
|
+
return T;
|
|
2925
|
+
}, _.isValid = function() {
|
|
2926
|
+
return this.$d.toString() !== p;
|
|
2927
|
+
}, _.isSame = function(e, t) {
|
|
2928
|
+
var n = w(e);
|
|
2929
|
+
return this.startOf(t) <= n && n <= this.endOf(t);
|
|
2930
|
+
}, _.isAfter = function(e, t) {
|
|
2931
|
+
return w(e) < this.startOf(t);
|
|
2932
|
+
}, _.isBefore = function(e, t) {
|
|
2933
|
+
return this.endOf(t) < w(e);
|
|
2934
|
+
}, _.$g = function(e, t, n) {
|
|
2935
|
+
return T.u(e) ? this[t] : this.set(n, e);
|
|
2936
|
+
}, _.unix = function() {
|
|
2937
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
2938
|
+
}, _.valueOf = function() {
|
|
2939
|
+
return this.$d.getTime();
|
|
2940
|
+
}, _.startOf = function(e, t) {
|
|
2941
|
+
var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
|
|
2942
|
+
var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
|
|
2943
|
+
return r ? i : i.endOf(s);
|
|
2944
|
+
}, m = function(e, t) {
|
|
2945
|
+
return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
|
|
2946
|
+
0,
|
|
2947
|
+
0,
|
|
2948
|
+
0,
|
|
2949
|
+
0
|
|
2950
|
+
] : [
|
|
2951
|
+
23,
|
|
2952
|
+
59,
|
|
2953
|
+
59,
|
|
2954
|
+
999
|
|
2955
|
+
]).slice(t)), n);
|
|
2956
|
+
}, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
|
|
2957
|
+
switch (u) {
|
|
2958
|
+
case d: return r ? p(1, 0) : p(31, 11);
|
|
2959
|
+
case l: return r ? p(1, g) : p(0, g + 1);
|
|
2960
|
+
case c:
|
|
2961
|
+
var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
|
|
2962
|
+
return p(r ? _ - b : _ + (6 - b), g);
|
|
2963
|
+
case s:
|
|
2964
|
+
case f: return m(v + "Hours", 0);
|
|
2965
|
+
case o: return m(v + "Minutes", 1);
|
|
2966
|
+
case a: return m(v + "Seconds", 2);
|
|
2967
|
+
case i: return m(v + "Milliseconds", 3);
|
|
2968
|
+
default: return this.clone();
|
|
2969
|
+
}
|
|
2970
|
+
}, _.endOf = function(e) {
|
|
2971
|
+
return this.startOf(e, !1);
|
|
2972
|
+
}, _.$set = function(e, t) {
|
|
2973
|
+
var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
|
|
2974
|
+
if (c === l || c === d) {
|
|
2975
|
+
var h = this.clone().set(f, 1);
|
|
2976
|
+
h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
|
|
2977
|
+
} else p && this.$d[p](m);
|
|
2978
|
+
return this.init(), this;
|
|
2979
|
+
}, _.set = function(e, t) {
|
|
2980
|
+
return this.clone().$set(e, t);
|
|
2981
|
+
}, _.get = function(e) {
|
|
2982
|
+
return this[T.p(e)]();
|
|
2983
|
+
}, _.add = function(r, u) {
|
|
2984
|
+
var f, p = this;
|
|
2985
|
+
r = Number(r);
|
|
2986
|
+
var m = T.p(u), h = function(e) {
|
|
2987
|
+
var t = w(p);
|
|
2988
|
+
return T.w(t.date(t.date() + Math.round(e * r)), p);
|
|
2989
|
+
};
|
|
2990
|
+
if (m === l) return this.set(l, this.$M + r);
|
|
2991
|
+
if (m === d) return this.set(d, this.$y + r);
|
|
2992
|
+
if (m === s) return h(1);
|
|
2993
|
+
if (m === c) return h(7);
|
|
2994
|
+
var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
|
|
2995
|
+
return T.w(_, this);
|
|
2996
|
+
}, _.subtract = function(e, t) {
|
|
2997
|
+
return this.add(-1 * e, t);
|
|
2998
|
+
}, _.format = function(e) {
|
|
2999
|
+
var t = this, n = this.$locale();
|
|
3000
|
+
if (!this.isValid()) return n.invalidDate || p;
|
|
3001
|
+
var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
|
|
3002
|
+
return e && (e[n] || e(t, r)) || i[n].slice(0, a);
|
|
3003
|
+
}, f = function(e) {
|
|
3004
|
+
return T.s(a % 12 || 12, e, "0");
|
|
3005
|
+
}, m = u || function(e, t, n) {
|
|
3006
|
+
var r = e < 12 ? "AM" : "PM";
|
|
3007
|
+
return n ? r.toLowerCase() : r;
|
|
3008
|
+
};
|
|
3009
|
+
return r.replace(h, function(e, r) {
|
|
3010
|
+
return r || function(e) {
|
|
3011
|
+
switch (e) {
|
|
3012
|
+
case "YY": return String(t.$y).slice(-2);
|
|
3013
|
+
case "YYYY": return T.s(t.$y, 4, "0");
|
|
3014
|
+
case "M": return s + 1;
|
|
3015
|
+
case "MM": return T.s(s + 1, 2, "0");
|
|
3016
|
+
case "MMM": return d(n.monthsShort, s, l, 3);
|
|
3017
|
+
case "MMMM": return d(l, s);
|
|
3018
|
+
case "D": return t.$D;
|
|
3019
|
+
case "DD": return T.s(t.$D, 2, "0");
|
|
3020
|
+
case "d": return String(t.$W);
|
|
3021
|
+
case "dd": return d(n.weekdaysMin, t.$W, c, 2);
|
|
3022
|
+
case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
|
|
3023
|
+
case "dddd": return c[t.$W];
|
|
3024
|
+
case "H": return String(a);
|
|
3025
|
+
case "HH": return T.s(a, 2, "0");
|
|
3026
|
+
case "h": return f(1);
|
|
3027
|
+
case "hh": return f(2);
|
|
3028
|
+
case "a": return m(a, o, !0);
|
|
3029
|
+
case "A": return m(a, o, !1);
|
|
3030
|
+
case "m": return String(o);
|
|
3031
|
+
case "mm": return T.s(o, 2, "0");
|
|
3032
|
+
case "s": return String(t.$s);
|
|
3033
|
+
case "ss": return T.s(t.$s, 2, "0");
|
|
3034
|
+
case "SSS": return T.s(t.$ms, 3, "0");
|
|
3035
|
+
case "Z": return i;
|
|
3036
|
+
}
|
|
3037
|
+
return null;
|
|
3038
|
+
}(e) || i.replace(":", "");
|
|
3039
|
+
});
|
|
3040
|
+
}, _.utcOffset = function() {
|
|
3041
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
3042
|
+
}, _.diff = function(r, f, p) {
|
|
3043
|
+
var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
|
|
3044
|
+
return T.m(h, _);
|
|
3045
|
+
};
|
|
3046
|
+
switch (g) {
|
|
3047
|
+
case d:
|
|
3048
|
+
m = b() / 12;
|
|
3049
|
+
break;
|
|
3050
|
+
case l:
|
|
3051
|
+
m = b();
|
|
3052
|
+
break;
|
|
3053
|
+
case u:
|
|
3054
|
+
m = b() / 3;
|
|
3055
|
+
break;
|
|
3056
|
+
case c:
|
|
3057
|
+
m = (y - v) / 6048e5;
|
|
3058
|
+
break;
|
|
3059
|
+
case s:
|
|
3060
|
+
m = (y - v) / 864e5;
|
|
3061
|
+
break;
|
|
3062
|
+
case o:
|
|
3063
|
+
m = y / n;
|
|
3064
|
+
break;
|
|
3065
|
+
case a:
|
|
3066
|
+
m = y / t;
|
|
3067
|
+
break;
|
|
3068
|
+
case i:
|
|
3069
|
+
m = y / e;
|
|
3070
|
+
break;
|
|
3071
|
+
default: m = y;
|
|
3072
|
+
}
|
|
3073
|
+
return p ? m : T.a(m);
|
|
3074
|
+
}, _.daysInMonth = function() {
|
|
3075
|
+
return this.endOf(l).$D;
|
|
3076
|
+
}, _.$locale = function() {
|
|
3077
|
+
return b[this.$L];
|
|
3078
|
+
}, _.locale = function(e, t) {
|
|
3079
|
+
if (!e) return this.$L;
|
|
3080
|
+
var n = this.clone(), r = C(e, t, !0);
|
|
3081
|
+
return r && (n.$L = r), n;
|
|
3082
|
+
}, _.clone = function() {
|
|
3083
|
+
return T.w(this.$d, this);
|
|
3084
|
+
}, _.toDate = function() {
|
|
3085
|
+
return new Date(this.valueOf());
|
|
3086
|
+
}, _.toJSON = function() {
|
|
3087
|
+
return this.isValid() ? this.toISOString() : null;
|
|
3088
|
+
}, _.toISOString = function() {
|
|
3089
|
+
return this.$d.toISOString();
|
|
3090
|
+
}, _.toString = function() {
|
|
3091
|
+
return this.$d.toUTCString();
|
|
3092
|
+
}, g;
|
|
3093
|
+
}(), D = E.prototype;
|
|
3094
|
+
return w.prototype = D, [
|
|
3095
|
+
["$ms", r],
|
|
3096
|
+
["$s", i],
|
|
3097
|
+
["$m", a],
|
|
3098
|
+
["$H", o],
|
|
3099
|
+
["$W", s],
|
|
3100
|
+
["$M", l],
|
|
3101
|
+
["$y", d],
|
|
3102
|
+
["$D", f]
|
|
3103
|
+
].forEach(function(e) {
|
|
3104
|
+
D[e[1]] = function(t) {
|
|
3105
|
+
return this.$g(t, e[0], e[1]);
|
|
3106
|
+
};
|
|
3107
|
+
}), w.extend = function(e, t) {
|
|
3108
|
+
return e.$i ||= (e(t, E, w), !0), w;
|
|
3109
|
+
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
3110
|
+
return w(1e3 * e);
|
|
3111
|
+
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3112
|
+
}();
|
|
3113
|
+
}(Ge)), Ge.exports));
|
|
3114
|
+
let qe = (e) => typeof e == "string", Je = (e, t) => e.format(t), Ye = {
|
|
3115
|
+
isString: qe,
|
|
3116
|
+
strLen: (e) => qe(e) ? e.length : 0,
|
|
3117
|
+
isEmail: (e) => !!qe(e) && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),
|
|
3118
|
+
isPhone: (e) => !!qe(e) && (e.substring(0, 2) === "+1" && (e = e.substring(2)), /^\d{10}$/.test(e.replace(/\D/g, ""))),
|
|
3119
|
+
isNull: (e) => e === null,
|
|
3120
|
+
isCurrency: (e) => /(?=.*?\d)^\$?(([1-9]\d{0,2}(,\d{3})*)|\d+)?(\.\d{1,2})?$/.test(e),
|
|
3121
|
+
now: () => Ke(),
|
|
3122
|
+
dateFormat: Je,
|
|
3123
|
+
year: (e) => Je(e, "YYYY"),
|
|
3124
|
+
date: (e) => Je(e, "YYYY-MM-DD"),
|
|
3125
|
+
string: (e) => e == null || e.toString === void 0 ? "" : e.toString(),
|
|
3126
|
+
int: (e) => parseInt(e)
|
|
3127
|
+
}, Xe = {
|
|
3128
|
+
strtolower: _e,
|
|
3129
|
+
strtoupper: ve,
|
|
3130
|
+
explode: le,
|
|
3131
|
+
strlen: ge,
|
|
3132
|
+
strstr: be,
|
|
3133
|
+
stristr: xe,
|
|
3134
|
+
substr: ye,
|
|
3135
|
+
implode: Te,
|
|
3136
|
+
count: we,
|
|
3137
|
+
array_intersect: (...e) => Oe.getEvaluator()(null, ...e),
|
|
3138
|
+
date: ke,
|
|
3139
|
+
strtotime: He
|
|
3140
|
+
};
|
|
3141
|
+
e.AbstractProvider = j, e.ArrayAdapter = ae, e.ArrayProvider = class extends j {
|
|
2417
3142
|
getFunctions() {
|
|
2418
3143
|
return [
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
3144
|
+
Ee,
|
|
3145
|
+
De,
|
|
3146
|
+
Oe
|
|
2422
3147
|
];
|
|
2423
3148
|
}
|
|
2424
|
-
}, e.BasicProvider = class extends
|
|
3149
|
+
}, e.BasicProvider = class extends j {
|
|
2425
3150
|
getFunctions() {
|
|
2426
|
-
return [
|
|
3151
|
+
return [ce];
|
|
2427
3152
|
}
|
|
2428
|
-
}, e.Compiler =
|
|
3153
|
+
}, e.CacheItem = k, e.CompileRuntime = Xe, e.Compiler = ne, e.DateProvider = class extends j {
|
|
2429
3154
|
getFunctions() {
|
|
2430
|
-
return [new
|
|
3155
|
+
return [new A("date", function(e, t) {
|
|
2431
3156
|
let n = "";
|
|
2432
|
-
return t && (n = `, ${t}`), `date(${e}${n})`;
|
|
3157
|
+
return t && (n = `, ${t}`), `__runtime.date(${e}${n})`;
|
|
2433
3158
|
}, function(e, t, n) {
|
|
2434
|
-
return
|
|
2435
|
-
}), new
|
|
3159
|
+
return ke(t, n);
|
|
3160
|
+
}), new A("strtotime", function(e, t) {
|
|
2436
3161
|
let n = "";
|
|
2437
|
-
return t && (n = `, ${t}`), `strtotime(${e}${n})`;
|
|
3162
|
+
return t && (n = `, ${t}`), `__runtime.strtotime(${e}${n})`;
|
|
2438
3163
|
}, function(e, t, n) {
|
|
2439
|
-
return
|
|
2440
|
-
let n = t ?? Math.floor(Date.now() / 1e3), r = [
|
|
2441
|
-
$.yesterday,
|
|
2442
|
-
$.now,
|
|
2443
|
-
$.noon,
|
|
2444
|
-
$.midnightOrToday,
|
|
2445
|
-
$.tomorrow,
|
|
2446
|
-
$.timestamp,
|
|
2447
|
-
$.firstOrLastDay,
|
|
2448
|
-
$.backOrFrontOf,
|
|
2449
|
-
$.timeTiny12,
|
|
2450
|
-
$.timeShort12,
|
|
2451
|
-
$.timeLong12,
|
|
2452
|
-
$.mssqltime,
|
|
2453
|
-
$.oracledate,
|
|
2454
|
-
$.timeShort24,
|
|
2455
|
-
$.timeLong24,
|
|
2456
|
-
$.iso8601long,
|
|
2457
|
-
$.gnuNoColon,
|
|
2458
|
-
$.iso8601noColon,
|
|
2459
|
-
$.americanShort,
|
|
2460
|
-
$.american,
|
|
2461
|
-
$.iso8601date4,
|
|
2462
|
-
$.iso8601dateSlash,
|
|
2463
|
-
$.dateSlash,
|
|
2464
|
-
$.gnuDateShortOrIso8601date2,
|
|
2465
|
-
$.gnuDateShorter,
|
|
2466
|
-
$.dateFull,
|
|
2467
|
-
$.pointedDate4,
|
|
2468
|
-
$.pointedDate2,
|
|
2469
|
-
$.dateNoDay,
|
|
2470
|
-
$.dateNoDayRev,
|
|
2471
|
-
$.dateTextual,
|
|
2472
|
-
$.dateNoYear,
|
|
2473
|
-
$.dateNoYearRev,
|
|
2474
|
-
$.dateNoColon,
|
|
2475
|
-
$.xmlRpc,
|
|
2476
|
-
$.xmlRpcNoColon,
|
|
2477
|
-
$.soap,
|
|
2478
|
-
$.wddx,
|
|
2479
|
-
$.exif,
|
|
2480
|
-
$.pgydotd,
|
|
2481
|
-
$.isoWeekDay,
|
|
2482
|
-
$.pgTextShort,
|
|
2483
|
-
$.pgTextReverse,
|
|
2484
|
-
$.clf,
|
|
2485
|
-
$.year4,
|
|
2486
|
-
$.ago,
|
|
2487
|
-
$.dayText,
|
|
2488
|
-
$.relativeTextWeek,
|
|
2489
|
-
$.relativeText,
|
|
2490
|
-
$.monthFullOrMonthAbbr,
|
|
2491
|
-
$.tzCorrection,
|
|
2492
|
-
$.tzAbbr,
|
|
2493
|
-
$.dateShortWithTimeShort12,
|
|
2494
|
-
$.dateShortWithTimeLong12,
|
|
2495
|
-
$.dateShortWithTimeShort,
|
|
2496
|
-
$.dateShortWithTimeLong,
|
|
2497
|
-
$.relative,
|
|
2498
|
-
$.whitespace
|
|
2499
|
-
], i = { ...le };
|
|
2500
|
-
for (; e.length;) {
|
|
2501
|
-
let t = null, n = null;
|
|
2502
|
-
for (let i of r) {
|
|
2503
|
-
let r = e.match(i.regex);
|
|
2504
|
-
r && (!t || r[0].length > t[0].length) && (t = r, n = i);
|
|
2505
|
-
}
|
|
2506
|
-
if (!n || !t || n.callback && !1 === n.callback.apply(i, t)) return !1;
|
|
2507
|
-
e = e.substr(t[0].length), n = null, t = null;
|
|
2508
|
-
}
|
|
2509
|
-
return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
|
|
2510
|
-
}(t, n);
|
|
3164
|
+
return He(t, n);
|
|
2511
3165
|
})];
|
|
2512
3166
|
}
|
|
2513
|
-
}, e.ExpressionFunction =
|
|
3167
|
+
}, e.Expression = re, e.ExpressionFunction = A, e.ExpressionLanguage = se, e.IGNORE_UNKNOWN_FUNCTIONS = 2, e.IGNORE_UNKNOWN_VARIABLES = 1, e.Node = _, e.OPERATOR_LEFT = 1, e.OPERATOR_RIGHT = 2, e.ParsedExpression = O, e.Parser = te, e.StringProvider = class extends j {
|
|
2514
3168
|
getFunctions() {
|
|
2515
3169
|
return [
|
|
2516
|
-
new
|
|
2517
|
-
|
|
2518
|
-
}(t)),
|
|
2519
|
-
new
|
|
2520
|
-
return (e
|
|
2521
|
-
}(t)),
|
|
2522
|
-
new I("explode", (e, t, n = "null") => `explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => function(...e) {
|
|
2523
|
-
let [t, n, r] = e, i = t, a = n;
|
|
2524
|
-
if (e.length < 2 || i === void 0 || a === void 0) return null;
|
|
2525
|
-
if (i === "" || !1 === i || i === null) return !1;
|
|
2526
|
-
if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
|
|
2527
|
-
!0 === i && (i = "1");
|
|
2528
|
-
let o = i + "", s = (a + "").split(o);
|
|
2529
|
-
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));
|
|
2530
|
-
}(t, n, r)),
|
|
2531
|
-
new I("strlen", function(e) {
|
|
2532
|
-
return `strlen(${e});`;
|
|
3170
|
+
new A("strtolower", (e) => "__runtime.strtolower(" + e + ")", (e, t) => _e(t)),
|
|
3171
|
+
new A("strtoupper", (e) => "__runtime.strtoupper(" + e + ")", (e, t) => ve(t)),
|
|
3172
|
+
new A("explode", (e, t, n = "null") => `__runtime.explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => le(t, n, r)),
|
|
3173
|
+
new A("strlen", function(e) {
|
|
3174
|
+
return `__runtime.strlen(${e})`;
|
|
2533
3175
|
}, function(e, t) {
|
|
2534
|
-
return
|
|
2535
|
-
let t = e + "";
|
|
2536
|
-
if ((G("unicode.semantics") || "off") === "off") return t.length;
|
|
2537
|
-
let n = 0, r = 0, i = function(e, t) {
|
|
2538
|
-
let n = e.charCodeAt(t);
|
|
2539
|
-
if (n >= 55296 && n <= 56319) {
|
|
2540
|
-
if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
|
|
2541
|
-
let n = e.charCodeAt(t + 1);
|
|
2542
|
-
if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
|
|
2543
|
-
return e.charAt(t) + e.charAt(t + 1);
|
|
2544
|
-
}
|
|
2545
|
-
if (n >= 56320 && n <= 57343) {
|
|
2546
|
-
if (t === 0) throw Error("Low surrogate without preceding high surrogate");
|
|
2547
|
-
let n = e.charCodeAt(t - 1);
|
|
2548
|
-
if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
|
|
2549
|
-
return !1;
|
|
2550
|
-
}
|
|
2551
|
-
return e.charAt(t);
|
|
2552
|
-
};
|
|
2553
|
-
for (n = 0, r = 0; n < t.length; n++) !1 !== i(t, n) && r++;
|
|
2554
|
-
return r;
|
|
2555
|
-
}(t);
|
|
3176
|
+
return ge(t);
|
|
2556
3177
|
}),
|
|
2557
|
-
new
|
|
3178
|
+
new A("strstr", function(e, t, n) {
|
|
2558
3179
|
let r = "";
|
|
2559
|
-
return n && (r = `, ${n}`), `strstr(${e}, ${t}${r})
|
|
3180
|
+
return n && (r = `, ${n}`), `__runtime.strstr(${e}, ${t}${r})`;
|
|
2560
3181
|
}, function(e, t, n, r) {
|
|
2561
|
-
return
|
|
2562
|
-
let r = 0;
|
|
2563
|
-
return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
2564
|
-
}(t, n, r);
|
|
3182
|
+
return be(t, n, r);
|
|
2565
3183
|
}),
|
|
2566
|
-
new
|
|
3184
|
+
new A("stristr", function(e, t, n) {
|
|
2567
3185
|
let r = "";
|
|
2568
|
-
return n && (r = `, ${n}`), `stristr(${e}, ${t}${r})
|
|
3186
|
+
return n && (r = `, ${n}`), `__runtime.stristr(${e}, ${t}${r})`;
|
|
2569
3187
|
}, function(e, t, n, r) {
|
|
2570
|
-
return
|
|
2571
|
-
let r = 0;
|
|
2572
|
-
return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
2573
|
-
}(t, n, r);
|
|
3188
|
+
return xe(t, n, r);
|
|
2574
3189
|
}),
|
|
2575
|
-
new
|
|
3190
|
+
new A("substr", function(e, t, n) {
|
|
2576
3191
|
let r = "";
|
|
2577
|
-
return n && (r = `, ${n}`), `substr(${e}, ${t}${r})
|
|
3192
|
+
return n && (r = `, ${n}`), `__runtime.substr(${e}, ${t}${r})`;
|
|
2578
3193
|
}, function(e, t, n, r) {
|
|
2579
|
-
return
|
|
3194
|
+
return ye(t, n, r);
|
|
2580
3195
|
})
|
|
2581
3196
|
];
|
|
2582
3197
|
}
|
|
2583
|
-
}, e.default =
|
|
3198
|
+
}, e.SyntaxError = r, e.Token = a, e.TokenStream = i, e.default = se, e.defaultCustomFunctions = Ye, e.tokenize = o, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
2584
3199
|
}), function(e) {
|
|
2585
3200
|
var t = e.ExpressionLanguage;
|
|
2586
3201
|
if (t && typeof t.ExpressionLanguage == "function") {
|
|
@@ -2590,22 +3205,22 @@ var _ = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2590
3205
|
}), e.ExpressionLanguage = n;
|
|
2591
3206
|
}
|
|
2592
3207
|
}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : e);
|
|
2593
|
-
})))(), 1),
|
|
2594
|
-
function
|
|
2595
|
-
let e =
|
|
3208
|
+
})))(), 1), T = null;
|
|
3209
|
+
function E() {
|
|
3210
|
+
let e = w, t = e.ExpressionLanguage || e.default || w;
|
|
2596
3211
|
if (typeof t != "function") throw TypeError("Unable to resolve expression-language constructor.");
|
|
2597
3212
|
return t;
|
|
2598
3213
|
}
|
|
2599
|
-
function
|
|
2600
|
-
return
|
|
3214
|
+
function D() {
|
|
3215
|
+
return T ??= new (E())(), T;
|
|
2601
3216
|
}
|
|
2602
|
-
function
|
|
3217
|
+
function ee(e) {
|
|
2603
3218
|
return (e.formula?.expression || e.formula?.formula || "").trim();
|
|
2604
3219
|
}
|
|
2605
|
-
function
|
|
3220
|
+
function te(e) {
|
|
2606
3221
|
return Object.entries(e.formula?.variables || {}).filter((e) => !!e[1]?.sourceKey);
|
|
2607
3222
|
}
|
|
2608
|
-
function
|
|
3223
|
+
function ne(e, t) {
|
|
2609
3224
|
return Object.entries(e).forEach(([t, n]) => {
|
|
2610
3225
|
if (Array.isArray(n)) {
|
|
2611
3226
|
let r = n.map((e) => typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : e), i = r.filter((e) => typeof e == "number");
|
|
@@ -2615,45 +3230,258 @@ function C(e, t) {
|
|
|
2615
3230
|
typeof n == "string" && n.trim() !== "" && !Number.isNaN(Number(n)) && (e[t] = Number(n));
|
|
2616
3231
|
}), e;
|
|
2617
3232
|
}
|
|
2618
|
-
function
|
|
3233
|
+
function re(e, t) {
|
|
2619
3234
|
if (t.formatting !== "number") return typeof e == "number" || typeof e == "string" ? e : "";
|
|
2620
3235
|
let n = e;
|
|
2621
3236
|
Array.isArray(n) && (n = n.reduce((e, t) => e + Number(t || 0), 0));
|
|
2622
3237
|
let r = typeof t.decimals == "number" ? t.decimals : 0, i = Number(n || 0).toFixed(r);
|
|
2623
3238
|
return `${t.prefix || ""}${i}${t.suffix || ""}`;
|
|
2624
3239
|
}
|
|
2625
|
-
function
|
|
3240
|
+
function O(e, t) {
|
|
2626
3241
|
let n = e.type?.endsWith("\\Number");
|
|
2627
3242
|
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;
|
|
2628
3243
|
}
|
|
2629
|
-
function
|
|
2630
|
-
return
|
|
3244
|
+
function ie(e, t, n) {
|
|
3245
|
+
return re(D().evaluate(e, t), n);
|
|
3246
|
+
}
|
|
3247
|
+
var ae = /* @__PURE__ */ new Map();
|
|
3248
|
+
async function k(e, t, n = {}) {
|
|
3249
|
+
let r = n.profile ?? "same-origin-browser", i = oe(e, n, t.headers), a = await fetch(e, {
|
|
3250
|
+
...t,
|
|
3251
|
+
headers: i,
|
|
3252
|
+
credentials: r === "cross-origin-public" ? "omit" : "same-origin"
|
|
3253
|
+
}), o = new URL(e, typeof location > "u" ? "http://localhost" : location.href).origin, s = a.headers.get("X-Formie-Session");
|
|
3254
|
+
return r === "cross-origin-public" && s && ae.set(o, s), a;
|
|
3255
|
+
}
|
|
3256
|
+
function oe(e, t = {}, n) {
|
|
3257
|
+
let r = t.profile ?? "same-origin-browser";
|
|
3258
|
+
if (!["same-origin-browser", "cross-origin-public"].includes(r)) throw Error("Client-rendered forms require a public browser profile. Use administrative API mutations for trusted administration.");
|
|
3259
|
+
let i = new Headers(n);
|
|
3260
|
+
i.set("X-Formie-Profile", r);
|
|
3261
|
+
let a = new URL(e, typeof location > "u" ? "http://localhost" : location.href).origin;
|
|
3262
|
+
if (r === "cross-origin-public") {
|
|
3263
|
+
let e = t.publicSession ?? ae.get(a);
|
|
3264
|
+
e && i.set("X-Formie-Session", e);
|
|
3265
|
+
}
|
|
3266
|
+
return i;
|
|
2631
3267
|
}
|
|
2632
|
-
var
|
|
3268
|
+
var A = (() => {
|
|
3269
|
+
if (typeof Intl > "u") return null;
|
|
2633
3270
|
let e = Intl.Segmenter;
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
3271
|
+
if (!e) return null;
|
|
3272
|
+
try {
|
|
3273
|
+
return new e(void 0, { granularity: "grapheme" });
|
|
3274
|
+
} catch {
|
|
3275
|
+
return null;
|
|
3276
|
+
}
|
|
3277
|
+
})(), se = /[^\s\u0085]+/gu, j = (() => {
|
|
3278
|
+
try {
|
|
3279
|
+
return /* @__PURE__ */ RegExp("(?:\\p{Regional_Indicator}{2}|\\p{Extended_Pictographic}[\\p{Emoji_Modifier}\\p{M}\\u{E0020}-\\u{E007F}]*(?:\\u{200D}\\p{Extended_Pictographic}[\\p{Emoji_Modifier}\\p{M}\\u{E0020}-\\u{E007F}]*)*|[\\s\\S])\\p{M}*", "gu");
|
|
3280
|
+
} catch {
|
|
3281
|
+
return null;
|
|
3282
|
+
}
|
|
3283
|
+
})();
|
|
3284
|
+
function ce(e) {
|
|
3285
|
+
return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent || "" : e.replace(/<[^>]*>/g, "");
|
|
2638
3286
|
}
|
|
2639
|
-
function
|
|
2640
|
-
return
|
|
3287
|
+
function le(e) {
|
|
3288
|
+
return ce(e);
|
|
2641
3289
|
}
|
|
2642
|
-
function
|
|
2643
|
-
return
|
|
3290
|
+
function ue(e) {
|
|
3291
|
+
return le(e).replace(/[\s\u0085]+/g, " ").trim();
|
|
2644
3292
|
}
|
|
2645
|
-
function
|
|
2646
|
-
return
|
|
3293
|
+
function de(e) {
|
|
3294
|
+
return A ? Array.from(A.segment(e)).length : j ? e.match(j)?.length || 0 : Array.from(e).length;
|
|
2647
3295
|
}
|
|
2648
|
-
function
|
|
2649
|
-
return e.match(
|
|
3296
|
+
function fe(e) {
|
|
3297
|
+
return e.match(se)?.length || 0;
|
|
2650
3298
|
}
|
|
2651
|
-
function
|
|
2652
|
-
let t =
|
|
3299
|
+
function pe(e) {
|
|
3300
|
+
let t = le(e), n = ue(e);
|
|
2653
3301
|
return {
|
|
2654
|
-
graphemeCount:
|
|
2655
|
-
wordCount:
|
|
3302
|
+
graphemeCount: de(t),
|
|
3303
|
+
wordCount: fe(n)
|
|
3304
|
+
};
|
|
3305
|
+
}
|
|
3306
|
+
var M = { username: "user:name" };
|
|
3307
|
+
Object.entries({
|
|
3308
|
+
form: ["name", "handle"],
|
|
3309
|
+
submission: [
|
|
3310
|
+
"id",
|
|
3311
|
+
"uid",
|
|
3312
|
+
"title",
|
|
3313
|
+
"url",
|
|
3314
|
+
"date",
|
|
3315
|
+
"site",
|
|
3316
|
+
"status"
|
|
3317
|
+
],
|
|
3318
|
+
site: [
|
|
3319
|
+
"id",
|
|
3320
|
+
"name",
|
|
3321
|
+
"handle",
|
|
3322
|
+
"url",
|
|
3323
|
+
"language"
|
|
3324
|
+
]
|
|
3325
|
+
}).forEach(([e, t]) => {
|
|
3326
|
+
t.forEach((t) => {
|
|
3327
|
+
M[`${e}.${t}`] = `${e}:${t}`;
|
|
3328
|
+
});
|
|
3329
|
+
}), Object.entries({
|
|
3330
|
+
form: ["Name", "Handle"],
|
|
3331
|
+
submission: [
|
|
3332
|
+
"Title",
|
|
3333
|
+
"Url",
|
|
3334
|
+
"Id",
|
|
3335
|
+
"Uid",
|
|
3336
|
+
"Date",
|
|
3337
|
+
"Site",
|
|
3338
|
+
"Status"
|
|
3339
|
+
],
|
|
3340
|
+
system: [
|
|
3341
|
+
"Name",
|
|
3342
|
+
"Email",
|
|
3343
|
+
"ReplyTo"
|
|
3344
|
+
],
|
|
3345
|
+
site: [
|
|
3346
|
+
"Name",
|
|
3347
|
+
"Handle",
|
|
3348
|
+
"Url",
|
|
3349
|
+
"Id",
|
|
3350
|
+
"Language"
|
|
3351
|
+
],
|
|
3352
|
+
user: [
|
|
3353
|
+
"Ip",
|
|
3354
|
+
"Id",
|
|
3355
|
+
"Email",
|
|
3356
|
+
"FullName",
|
|
3357
|
+
"FirstName",
|
|
3358
|
+
"LastName"
|
|
3359
|
+
]
|
|
3360
|
+
}).forEach(([e, t]) => {
|
|
3361
|
+
t.forEach((t) => {
|
|
3362
|
+
M[e + t] = `${e}:${t[0].toLowerCase()}${t.slice(1)}`;
|
|
3363
|
+
});
|
|
3364
|
+
}), Object.entries({
|
|
3365
|
+
dateUs: "m/d/Y",
|
|
3366
|
+
dateInt: "d/m/Y",
|
|
3367
|
+
time12: "h:i a",
|
|
3368
|
+
time24: "H:i"
|
|
3369
|
+
}).forEach(([e, t]) => {
|
|
3370
|
+
M[e] = `timestamp;transform=format;preset=custom;pattern=${encodeURIComponent(t)}`;
|
|
3371
|
+
});
|
|
3372
|
+
function me(e) {
|
|
3373
|
+
let t = {
|
|
3374
|
+
raw: e,
|
|
3375
|
+
target: "",
|
|
3376
|
+
identifier: "",
|
|
3377
|
+
selector: "",
|
|
3378
|
+
default: "",
|
|
3379
|
+
transformerId: "",
|
|
3380
|
+
transformerParams: {},
|
|
3381
|
+
version: 1,
|
|
3382
|
+
isValid: !1
|
|
3383
|
+
}, n = (e) => ({
|
|
3384
|
+
...t,
|
|
3385
|
+
diagnostic: e
|
|
3386
|
+
}), r = e.trim().match(/^\{([^{}]+)\}$/);
|
|
3387
|
+
if (!r) return n("invalidSyntax");
|
|
3388
|
+
let i = r[1].replace(/^field\./, "field:"), a = i.indexOf("|"), o = a < 0 ? "" : i.slice(a + 1);
|
|
3389
|
+
i = a < 0 ? i : i.slice(0, a);
|
|
3390
|
+
let s = i.indexOf(";"), c = s < 0 ? i : i.slice(0, s);
|
|
3391
|
+
i = (Object.prototype.hasOwnProperty.call(M, c) ? M[c] : c) + (s < 0 ? "" : i.slice(s));
|
|
3392
|
+
let [l, ...u] = i.split(";"), d = Object.create(null);
|
|
3393
|
+
try {
|
|
3394
|
+
for (let e of u) {
|
|
3395
|
+
let t = e.match(/^([a-zA-Z][a-zA-Z0-9_]*)=(.*)$/);
|
|
3396
|
+
if (!t || Object.prototype.hasOwnProperty.call(d, t[1])) return n("invalidMetadata");
|
|
3397
|
+
d[t[1]] = decodeURIComponent(t[2]);
|
|
3398
|
+
}
|
|
3399
|
+
if ((d.v ?? "1") !== "1") return n("unsupportedVersion");
|
|
3400
|
+
delete d.v;
|
|
3401
|
+
let e = l.indexOf(":"), r = e < 0 ? l : l.slice(0, e), i = e < 0 ? "" : l.slice(e + 1);
|
|
3402
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r)) return n("invalidSource");
|
|
3403
|
+
let a = "";
|
|
3404
|
+
if (r === "field" && i.includes(":")) {
|
|
3405
|
+
let e = i.indexOf(":");
|
|
3406
|
+
a = i.slice(e + 1), i = i.slice(0, e);
|
|
3407
|
+
}
|
|
3408
|
+
if (![
|
|
3409
|
+
"timestamp",
|
|
3410
|
+
"allFields",
|
|
3411
|
+
"allContentFields",
|
|
3412
|
+
"allVisibleFields"
|
|
3413
|
+
].includes(r) && !i || /[\s{}]/.test(i + a)) return n("invalidIdentifier");
|
|
3414
|
+
let s = d.transform ?? "";
|
|
3415
|
+
return delete d.transform, {
|
|
3416
|
+
...t,
|
|
3417
|
+
target: r,
|
|
3418
|
+
identifier: decodeURIComponent(i),
|
|
3419
|
+
selector: decodeURIComponent(a),
|
|
3420
|
+
default: decodeURIComponent(o),
|
|
3421
|
+
transformerId: s,
|
|
3422
|
+
transformerParams: d,
|
|
3423
|
+
isValid: !0
|
|
3424
|
+
};
|
|
3425
|
+
} catch {
|
|
3426
|
+
return n("invalidEncoding");
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
function he(e, t) {
|
|
3430
|
+
let n = me(e);
|
|
3431
|
+
if (!n.isValid) return {
|
|
3432
|
+
expression: n,
|
|
3433
|
+
diagnostic: "invalidExpression"
|
|
3434
|
+
};
|
|
3435
|
+
let r = `${n.target}:${n.identifier}`, i = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
3436
|
+
if (!i(t.definitions, r)) return {
|
|
3437
|
+
expression: n,
|
|
3438
|
+
diagnostic: n.target === "field" ? "missingField" : "unknownSource"
|
|
3439
|
+
};
|
|
3440
|
+
let a = t.definitions[r];
|
|
3441
|
+
if (!a.availability.browser) return {
|
|
3442
|
+
expression: n,
|
|
3443
|
+
diagnostic: "forbiddenSource"
|
|
3444
|
+
};
|
|
3445
|
+
if (Object.keys(n.transformerParams).some((e) => [
|
|
3446
|
+
"scope",
|
|
3447
|
+
"index",
|
|
3448
|
+
"rows"
|
|
3449
|
+
].includes(e))) return {
|
|
3450
|
+
expression: n,
|
|
3451
|
+
diagnostic: "invalidRowScope"
|
|
3452
|
+
};
|
|
3453
|
+
if (n.selector && !a.selectors?.includes(n.selector)) return {
|
|
3454
|
+
expression: n,
|
|
3455
|
+
diagnostic: "invalidSelector"
|
|
3456
|
+
};
|
|
3457
|
+
let o = n.selector ? `${r}:${n.selector}` : r;
|
|
3458
|
+
if (!i(t.values, o)) return {
|
|
3459
|
+
expression: n,
|
|
3460
|
+
diagnostic: "missingField"
|
|
3461
|
+
};
|
|
3462
|
+
let s = t.values[o];
|
|
3463
|
+
if (n.transformerId) {
|
|
3464
|
+
let e = t.transforms?.[n.transformerId];
|
|
3465
|
+
if (!e) return {
|
|
3466
|
+
expression: n,
|
|
3467
|
+
diagnostic: "unknownTransform"
|
|
3468
|
+
};
|
|
3469
|
+
if (!e.browser) return {
|
|
3470
|
+
expression: n,
|
|
3471
|
+
diagnostic: "forbiddenSource"
|
|
3472
|
+
};
|
|
3473
|
+
if (a.transforms && !a.transforms.includes(n.transformerId) || !e.accepts(s) || Object.keys(n.transformerParams).some((t) => !e.parameters.includes(t)) || (s = e.resolve(s, n.transformerParams), !e.acceptsOutput(s))) return {
|
|
3474
|
+
expression: n,
|
|
3475
|
+
diagnostic: "invalidType"
|
|
3476
|
+
};
|
|
3477
|
+
} else if (Object.keys(n.transformerParams).length) return {
|
|
3478
|
+
expression: n,
|
|
3479
|
+
diagnostic: "invalidExpression"
|
|
3480
|
+
};
|
|
3481
|
+
return (s === "" || s == null || Array.isArray(s) && s.length === 0) && n.default && (s = n.default), {
|
|
3482
|
+
expression: n,
|
|
3483
|
+
value: s
|
|
2656
3484
|
};
|
|
2657
3485
|
}
|
|
2658
3486
|
//#endregion
|
|
2659
|
-
export {
|
|
3487
|
+
export { oe as a, _ as c, l as d, me as f, ie as h, S as i, y as l, C as m, ee as n, te as o, pe as p, O as r, ne as s, k as t, he as u };
|