From fd7e5a6a83a255c5231ea4b4c97cf1e0917d4cd0 Mon Sep 17 00:00:00 2001 From: William Dutton Date: Wed, 15 Jan 2025 13:57:31 +1000 Subject: [PATCH] QOLDEV-942 API Server Version:9.2.8 formiojs:4.21.5 premium:2.0.6 grid:1.4.0 --- .github/workspace/formiojs/package-lock.json | 75 +++++++++++--------- .github/workspace/formiojs/package.json | 3 +- .github/workspace/prem/package-lock.json | 15 ++-- .github/workspace/prem/package.json | 3 +- lib/changelog.md | 40 ++++++----- lib/formio.changelog.md | 49 +++++++++++++ lib/formio.full.js | 34 ++++----- lib/formio.full.min.js | 2 +- lib/formio.full.min.js.LICENSE.txt | 8 +-- lib/premium.js | 8 +-- lib/premium.min.js | 2 +- lib/versions.txt | 8 +-- package.json | 4 +- 13 files changed, 157 insertions(+), 94 deletions(-) diff --git a/.github/workspace/formiojs/package-lock.json b/.github/workspace/formiojs/package-lock.json index c63692f1..ec212ad4 100644 --- a/.github/workspace/formiojs/package-lock.json +++ b/.github/workspace/formiojs/package-lock.json @@ -9,15 +9,15 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "formiojs": "4.21.2", + "formiojs": "4.21.5", "moment": "^2.29.4" }, "devDependencies": {} }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -27,7 +27,7 @@ }, "node_modules/@formio/bootstrap3": { "version": "2.12.4-rc.1", - "resolved": "https://registry.npmjs.org/@formio/bootstrap3/-/bootstrap3-2.12.4-rc.1.tgz", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/bootstrap3/-/bootstrap3-2.12.4-rc.1.tgz", "integrity": "sha512-4B5rs+w9tAk5i+wbdw2/NrTxPqnDX7/W19tiTd9lfXnIGQmaj0ecMEVqDmOJg8pIlyU02g3c4ih6JnA/JVmUbA==", "license": "MIT", "dependencies": { @@ -36,7 +36,7 @@ }, "node_modules/@formio/choices.js": { "version": "10.2.1", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.1.tgz", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/choices.js/-/choices.js-10.2.1.tgz", "integrity": "sha512-NCE5u7jG3XGokJP16MyAbVSUptKu/mpJYAxd4PPIoLiO/l9Do5uoOQ0MgNb9qG9qABJiOX+qNRE8q8RybY/SwQ==", "license": "MIT", "dependencies": { @@ -47,19 +47,19 @@ }, "node_modules/@formio/semantic": { "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@formio/semantic/-/semantic-2.6.1.tgz", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/semantic/-/semantic-2.6.1.tgz", "integrity": "sha512-obp1BT5UnzD+uYBbqmnsTfO2hGxI2A2iR/cj3P5JUFLYSBpnr3TS2ShQ7Ee5GCRRtJPu0JnljuJj+YSKLCMuhg==", "license": "MIT" }, "node_modules/@formio/text-mask-addons": { - "version": "3.8.0-formio.2", - "resolved": "https://registry.npmjs.org/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz", - "integrity": "sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA==", + "version": "3.8.0-formio.4", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.4.tgz", + "integrity": "sha512-vhkeIyuL+1rtC9S4IW8O3JCwroPtvJrkrcMO4wyELNqMIgQRKbiyBAitZfUP4tY04xdB5lxAinbzdwb+NMdX6w==", "license": "Unlicense" }, "node_modules/@formio/vanilla-text-mask": { "version": "5.1.1-formio.1", - "resolved": "https://registry.npmjs.org/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", "integrity": "sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ==", "license": "Unlicense" }, @@ -77,10 +77,16 @@ "resolved": "https://registry.npmjs.org/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz", "integrity": "sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==" }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "optional": true + }, "node_modules/abortcontroller-polyfill": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", - "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.8.tgz", + "integrity": "sha512-9f1iZ2uWh92VcrU9Y8x+LdM4DLj75VE0MJB8zuF1iUnroEptStw+DQ8EQPMUdfe5k+PkB1uUfDQfWbhstH8LrQ==" }, "node_modules/animation-frame-polyfill": { "version": "1.0.2", @@ -130,9 +136,9 @@ } }, "node_modules/core-js": { - "version": "3.37.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", - "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz", + "integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -215,9 +221,12 @@ } }, "node_modules/dompurify": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", - "integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==" + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", + "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } }, "node_modules/downloadjs": { "version": "1.4.7", @@ -262,9 +271,9 @@ } }, "node_modules/formiojs": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.21.2.tgz", - "integrity": "sha512-IOTA1NLkow/Dv6yrN4NYLXC/Hb51cM7e+A89MuTa6CHg9VbH6x2jeB3DZ0DxgxrpUnklDJCLHKt342kCu661OA==", + "version": "4.21.5", + "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.21.5.tgz", + "integrity": "sha512-gHbj+Pj0hejvRYyypFpPzH9EkUkgnp+E3XrnWaHGsiEQ8xJ1oLb56Z8yN0TWP+ktw9hyN/EeFeZrQVkP1k2hcQ==", "dependencies": { "@formio/bootstrap3": "2.12.4-rc.1", "@formio/choices.js": "10.2.1", @@ -289,7 +298,7 @@ "fetch-ponyfill": "^7.1.0", "i18next": "22.4.12", "idb": "^7.1.1", - "inputmask": "^5.0.8", + "inputmask": "^5.0.9", "ismobilejs": "^1.1.1", "json-logic-js": "^2.0.2", "jstimezonedetect": "^1.0.7", @@ -362,9 +371,9 @@ "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==" }, "node_modules/json-logic-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.2.tgz", - "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.5.tgz", + "integrity": "sha512-rTT2+lqcuUmj4DgWfmzupZqQDA64AdmYqizzMPWj3DxGdfFNsxPpcNVSaTj4l8W2tG/+hg7/mQhxjU3aPacO6g==" }, "node_modules/jstimezonedetect": { "version": "1.0.7", @@ -405,9 +414,9 @@ } }, "node_modules/moment-timezone": { - "version": "0.5.45", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", - "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", + "version": "0.5.46", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.46.tgz", + "integrity": "sha512-ZXm9b36esbe7OmdABqIWJuBBiLLwAjrN7CE+7sYdCCx82Nabt1wHDj8TVseS59QIlfFPbOoiBPm6ca9BioG4hw==", "dependencies": { "moment": "^2.29.4" }, @@ -445,9 +454,9 @@ "integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==" }, "node_modules/quill": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz", - "integrity": "sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz", + "integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==", "dependencies": { "eventemitter3": "^5.0.1", "lodash-es": "^4.17.21", diff --git a/.github/workspace/formiojs/package.json b/.github/workspace/formiojs/package.json index 80f65995..27279a36 100644 --- a/.github/workspace/formiojs/package.json +++ b/.github/workspace/formiojs/package.json @@ -23,6 +23,7 @@ "last 3 Chrome versions" ], "scripts": { + "build": "npm install && npm run copy-all && npm run update", "update": "npm update `npm outdated | awk '{print $1}' | tr '\n' ' '` ", "copy-formiojs": "cp -rf node_modules/formiojs/dist/formio.full* ../../../lib; cp -rf node_modules/formiojs/dist/fonts ../../../lib; cp node_modules/formiojs/Changelog.md ../../../lib/formio.changelog.md; ", "cleanup": "rm -rf ../../../lib/*server*", @@ -30,7 +31,7 @@ }, "devDependencies": {}, "dependencies": { - "formiojs": "4.21.2", + "formiojs": "4.21.5", "moment": "^2.29.4" } } diff --git a/.github/workspace/prem/package-lock.json b/.github/workspace/prem/package-lock.json index 5f07881f..53792a84 100644 --- a/.github/workspace/prem/package-lock.json +++ b/.github/workspace/prem/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@formio/premium": "2.0.3", + "@formio/premium": "2.0.6", "moment": "^2.29.4" }, "devDependencies": {} @@ -50,9 +50,9 @@ } }, "node_modules/@formio/premium": { - "version": "2.0.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/premium/-/premium-2.0.3.tgz", - "integrity": "sha512-2BEJ1/5WZZqCZdTOTA1cyABAk8kCUYU7/FCTYkZjccyLxaF3RchbKzhbQqC7tdayvJyFgTDlZn7BGduWlpUEEg==", + "version": "2.0.6", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/premium/-/premium-2.0.6.tgz", + "integrity": "sha512-vTPbIXsIsEW7vVLEfYEsU7qWMUCQWvWRJbG5gOhHcMbsWz4XgxaVix3KDZDKErK3W4mr76MhM4NAnCLj0yIvhQ==", "dependencies": { "@juggle/resize-observer": "^3.4.0", "@zxing/library": "^0.18.6", @@ -955,10 +955,9 @@ "peer": true }, "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "license": "MIT", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "engines": { "node": "*" } diff --git a/.github/workspace/prem/package.json b/.github/workspace/prem/package.json index 8022339a..f7a6f7d4 100644 --- a/.github/workspace/prem/package.json +++ b/.github/workspace/prem/package.json @@ -23,6 +23,7 @@ "last 3 Chrome versions" ], "scripts": { + "build": "npm install && npm run copy-all && npm run update", "update": "npm update `npm outdated | awk '{print $1}' | tr '\n' ' '` ", "copy-formios-prem-changelog": "cp node_modules/@formio/premium/Changelog.md ../../../lib/premium.changelog.md", "copy-formios-prem": "cp -rf node_modules/@formio/premium/dist/* ../../../lib", @@ -31,7 +32,7 @@ }, "devDependencies": {}, "dependencies": { - "@formio/premium": "2.0.3", + "@formio/premium": "2.0.6", "moment": "^2.29.4" } } diff --git a/lib/changelog.md b/lib/changelog.md index f9031d9f..b5c5f007 100644 --- a/lib/changelog.md +++ b/lib/changelog.md @@ -1,18 +1,22 @@ -# August 12, 2024 Release -## API Server Version 9.2.2 -Included Correlated Libraries -* portal@9.2.1 -* formiojs@4.21.2 -* core@2.2.1 -* vm@0.2.2 -* formio@4.2.2 -* premium@2.0.3 -* grid@1.4.0 -* formviewpro@1.108.1 -* formmanager@1.106.1 -* offline@4.9.1 -* formio/uswds@2.5.1 -* vpat@2.5.2 -* reporting@1.0.3 -## Fixed -* FIO-8778 Data Map | Data Map is always submitted with empty object value \ No newline at end of file +# November 5, 2024 Release +## API Server Version 9.2.8 +sha256:c454267d6d78727ceff59fdcd17b575691a63c826411f85178e86c178c570cda + +### Included Correlated Libraries +- portal@9.2.6 +- formiojs@4.21.5 +- core@2.3.0-rc.20 +- vm@0.2.8 +- formio@4.2.8 +- premium@2.0.6 +- grid@1.4.0 +- formviewpro@1.108.6 +- formmanager@1.106.6 +- offline@4.9.4 +- formio/uswds@2.5.2 +- vpat@2.5.2 +- reporting@1.0.3 + +### Fixed +- FIO-9255 fixed an issue where nested forms lose data after submission if some parent has conditional components +- FIO-9181 Conditions based on save as reference select component are not triggering correctly on Print to PDF diff --git a/lib/formio.changelog.md b/lib/formio.changelog.md index 983079d7..c813eb16 100644 --- a/lib/formio.changelog.md +++ b/lib/formio.changelog.md @@ -4,6 +4,55 @@ All notable changes to this project will be documented in this file The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 4.21.5 +### Changed + - Official Release + +## 4.21.5-rc.6 +### Changed + - FIO-9105: trigger error in test + - FIO-8944 fixed navigation through the errors list + - FIO-8660: Fixed email component re-rendering with unique setting option + +## 4.21.5-rc.5 +### Changed + - Bugfix: allow paths for valueProperty + +## 4.21.5-rc.4 + +## 4.21.5-rc.1 +### Changed + - FIO-8962 Fixed screen shifting when validation errors pop up in an embedded Wizard form + +## 4.21.4 +### Changed + - Official Release + +## 4.21.4-rc.2 +### Changed + - Revert "FIO-8797: set empty day component value to the empty string" + - Revert "FIO-8798: updated shape of the data of day component with hidden fields" + +## 4.21.4-rc.1 +### Changed + - FIO-8964 updated version of inputmask lib + - FIO-8797: set empty day component value to the empty string + - FIO-8795 fixed selected data after removing row + - FIO-8798: updated shape of the data of day component with hidden fields + - FIO-8849: fixed an issue where value of the selctboxes/radio with URL data source are not available in simple conditons UI + - FIO-8799 updated conditional tab for Time Component + - FIO-8874: fixed conditional value field for time component + - FIO-8866-8864: fixed simple conditions operators for recaptcha + - FIO-8900-8899: made only 2 operators available for address component in conditionals ui and fixed setting an empty value for address + +## 4.21.3 +### Changed + - Official Release + +## 4.21.3-rc.1 +### Changed + - FIO-7779: update pathing for nested container components and add test + ## 4.21.2 ### Changed - Official Release diff --git a/lib/formio.full.js b/lib/formio.full.js index 6b78b017..9c98f78c 100644 --- a/lib/formio.full.js +++ b/lib/formio.full.js @@ -81,7 +81,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.GlobalFormio = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.match.js */ \"./node_modules/core-js/modules/es.string.match.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fetchPonyfill2 = _interopRequireDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _browserCookies = _interopRequireDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nvar _providers = _interopRequireDefault(__webpack_require__(/*! ./providers */ \"./lib/providers/index.js\"));\nvar _intersection2 = _interopRequireDefault(__webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\"));\nvar _get2 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _cloneDeep2 = _interopRequireDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar _defaults2 = _interopRequireDefault(__webpack_require__(/*! lodash/defaults */ \"./node_modules/lodash/defaults.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _jwtDecode = _interopRequireDefault(__webpack_require__(/*! jwt-decode */ \"./node_modules/jwt-decode/build/jwt-decode.esm.js\"));\n__webpack_require__(/*! ./polyfills */ \"./lib/polyfills/index.js\");\nvar _CDN = _interopRequireDefault(__webpack_require__(/*! ./CDN */ \"./lib/CDN.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _fetchPonyfill = (0, _fetchPonyfill2[\"default\"])({\n Promise: _nativePromiseOnly[\"default\"]\n }),\n fetch = _fetchPonyfill.fetch,\n Headers = _fetchPonyfill.Headers;\nvar isBoolean = function isBoolean(val) {\n return _typeof(val) === _typeof(true);\n};\nvar isNil = function isNil(val) {\n return val === null || val === undefined;\n};\nvar isObject = function isObject(val) {\n return val && _typeof(val) === 'object';\n};\nfunction cloneResponse(response) {\n var copy = (0, _cloneDeep2[\"default\"])(response);\n if (Array.isArray(response)) {\n copy.skip = response.skip;\n copy.limit = response.limit;\n copy.serverCount = response.serverCount;\n }\n return copy;\n}\n\n/**\n * The Formio interface class.\n *\n * let formio = new Formio('https://examples.form.io/example');\n */\nvar Formio = /*#__PURE__*/function () {\n /* eslint-disable max-statements */\n function Formio(path) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Formio);\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n\n // Initialize our variables.\n this.base = '';\n this.projectsUrl = '';\n this.projectUrl = '';\n this.projectId = '';\n this.roleUrl = '';\n this.rolesUrl = '';\n this.roleId = '';\n this.formUrl = '';\n this.formsUrl = '';\n this.formId = '';\n this.submissionsUrl = '';\n this.submissionUrl = '';\n this.submissionId = '';\n this.actionsUrl = '';\n this.actionId = '';\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n this.query = '';\n\n // Store the original path and options.\n this.path = path;\n this.options = options;\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base')) {\n this.base = options.base;\n } else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n } else if (typeof window !== 'undefined') {\n this.base = window.location.href.match(/http[s]?:\\/\\/api./)[0];\n }\n if (!path) {\n // Allow user to create new projects if this was instantiated without\n // a url\n this.projectUrl = Formio.projectUrl || \"\".concat(this.base, \"/project\");\n this.projectsUrl = \"\".concat(this.base, \"/project\");\n this.projectId = false;\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('project')) {\n this.projectUrl = options.project;\n }\n var project = this.projectUrl || Formio.projectUrl;\n var projectRegEx = /(^|\\/)(project)($|\\/[^/]+)/;\n var isProjectUrl = path.search(projectRegEx) !== -1;\n\n // The baseURL is the same as the projectUrl, and does not contain \"/project/MONGO_ID\" in\n // its domain. This is almost certainly against the Open Source server.\n if (project && this.base === project && !isProjectUrl) {\n this.noProject = true;\n this.projectUrl = this.base;\n }\n\n // Normalize to an absolute path.\n if (path.indexOf('http') !== 0 && path.indexOf('//') !== 0) {\n path = this.base + path;\n }\n var hostparts = this.getUrlParts(path);\n var parts = [];\n var hostName = hostparts[1] + hostparts[2];\n path = hostparts.length > 3 ? hostparts[3] : '';\n var queryparts = path.split('?');\n if (queryparts.length > 1) {\n path = queryparts[0];\n this.query = \"?\".concat(queryparts[1]);\n }\n\n // Register a specific path.\n var registerPath = function registerPath(name, base) {\n _this[\"\".concat(name, \"sUrl\")] = \"\".concat(base, \"/\").concat(name);\n var regex = new RegExp(\"/\".concat(name, \"/([^/]+)\"));\n if (path.search(regex) !== -1) {\n parts = path.match(regex);\n _this[\"\".concat(name, \"Url\")] = parts ? base + parts[0] : '';\n _this[\"\".concat(name, \"Id\")] = parts.length > 1 ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n\n // Register an array of items.\n var registerItems = function registerItems(items, base, staticBase) {\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n if (Array.isArray(item)) {\n registerItems(item, base, true);\n } else {\n var newBase = registerPath(item, base);\n base = staticBase ? base : newBase;\n }\n }\n }\n };\n if (!this.projectUrl || this.projectUrl === this.base) {\n // If a project uses Subdirectories path type, we need to specify a projectUrl\n if (!this.projectUrl && !isProjectUrl && Formio.pathType === 'Subdirectories') {\n var regex = \"^\".concat(hostName.replace(/\\//g, '\\\\/'), \".[^/]+\");\n var match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\n } else {\n this.projectUrl = hostName;\n }\n }\n // Check if we have a specified path type.\n var isNotSubdomainType = false;\n if (Formio.pathType) {\n isNotSubdomainType = Formio.pathType !== 'Subdomains';\n }\n if (!this.noProject) {\n // Determine the projectUrl and projectId\n if (isProjectUrl) {\n // Get project id as project/:projectId.\n registerItems(['project'], hostName);\n path = path.replace(projectRegEx, '');\n } else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts.length > 3 && path.split('/').length > 1) {\n var isFile = path.match(/.json/);\n var pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n } else {\n pathParts.shift(); // Throw away the first /.\n this.projectId = pathParts.shift();\n path = \"/\".concat(pathParts.join('/'));\n this.projectUrl = \"\".concat(hostName, \"/\").concat(this.projectId);\n }\n }\n } else {\n // Get project id from subdomain.\n if (hostparts.length > 2 && (hostparts[2].split('.').length > 2 || hostName.includes('localhost')) && !isNotSubdomainType) {\n this.projectUrl = hostName;\n this.projectId = hostparts[2].split('.')[0];\n }\n }\n this.projectsUrl = this.projectsUrl || \"\".concat(this.base, \"/project\");\n }\n\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n } else {\n var subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n var subs = path.match(subRegEx);\n this.pathType = subs && subs.length > 1 ? subs[1] : '';\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = \"\".concat(this.projectUrl, \"/form\");\n this.formUrl = path ? this.projectUrl + path : '';\n this.formId = path.replace(/^\\/+|\\/+$/g, '');\n var items = ['submission', 'action', 'v'];\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n this[\"\".concat(item, \"sUrl\")] = \"\".concat(this.projectUrl + path, \"/\").concat(item);\n if (this.pathType === item && subs.length > 2 && subs[2]) {\n this[\"\".concat(item, \"Id\")] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[\"\".concat(item, \"Url\")] = this.projectUrl + path + subs[0];\n }\n }\n }\n }\n\n // Set the app url if it is not set.\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = this.projectUrl;\n }\n }\n /* eslint-enable max-statements */\n _createClass(Formio, [{\n key: \"delete\",\n value: function _delete(type, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n }, {\n key: \"index\",\n value: function index(type, query, opts) {\n var _url = \"\".concat(type, \"Url\");\n query = query || '';\n if (query && isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n }, {\n key: \"save\",\n value: function save(type, data, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n var method = this[_id] || data._id ? 'put' : 'post';\n var reqUrl = this[_id] ? this[_url] : this[\"\".concat(type, \"sUrl\")];\n if (!this[_id] && data._id && method === 'put' && !reqUrl.includes(data._id)) {\n reqUrl += \"/\".concat(data._id);\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n }, {\n key: \"load\",\n value: function load(type, query, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? \"\".concat(this.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = this.query;\n }\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject(\"Missing \".concat(_id));\n }\n var url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId)) && parseInt(this.vId) !== 0) {\n url += url.match(/\\?/) ? '&' : '?';\n url += \"formRevision=\".concat(this.vId);\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return Formio.makeRequest.apply(Formio, [this].concat(args));\n }\n }, {\n key: \"loadProject\",\n value: function loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n }, {\n key: \"saveProject\",\n value: function saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n }, {\n key: \"deleteProject\",\n value: function deleteProject(opts) {\n return this[\"delete\"]('project', opts);\n }\n }, {\n key: \"loadRole\",\n value: function loadRole(opts) {\n return this.load('role', null, opts);\n }\n }, {\n key: \"saveRole\",\n value: function saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n }, {\n key: \"deleteRole\",\n value: function deleteRole(opts) {\n return this[\"delete\"]('role', opts);\n }\n }, {\n key: \"loadRoles\",\n value: function loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n }, {\n key: \"loadForm\",\n value: function loadForm(query, opts) {\n var _this2 = this;\n return this.load('form', query, opts).then(function (currentForm) {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(_this2.vId))) {\n return currentForm;\n }\n // If a submission already exists but form is marked to load current version of form.\n if (currentForm.revisions === 'current' && _this2.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == _this2.vId || currentForm.revisionId === _this2.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = _this2.query ? \"\".concat(_this2.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = _this2.query;\n }\n return _this2.makeRequest('form', _this2.vUrl + query, 'get', null, opts).then(function (revisionForm) {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\n // Using object.assign so we don't cross polinate multiple form loads.\n return Object.assign({}, currentForm);\n })\n // If we couldn't load the revision, just return the original form.\n [\"catch\"](function () {\n return Object.assign({}, currentForm);\n });\n });\n }\n }, {\n key: \"saveForm\",\n value: function saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n }, {\n key: \"deleteForm\",\n value: function deleteForm(opts) {\n return this[\"delete\"]('form', opts);\n }\n }, {\n key: \"loadForms\",\n value: function loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission(query, opts) {\n var _this3 = this;\n return this.load('submission', query, opts).then(function (submission) {\n _this3.vId = submission._frid || submission._fvid;\n _this3.vUrl = \"\".concat(_this3.formUrl, \"/v/\").concat(_this3.vId);\n return submission;\n });\n }\n }, {\n key: \"saveSubmission\",\n value: function saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId))) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission(opts) {\n return this[\"delete\"]('submission', opts);\n }\n }, {\n key: \"loadSubmissions\",\n value: function loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n }, {\n key: \"loadAction\",\n value: function loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n }, {\n key: \"saveAction\",\n value: function saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n }, {\n key: \"deleteAction\",\n value: function deleteAction(opts) {\n return this[\"delete\"]('action', opts);\n }\n }, {\n key: \"loadActions\",\n value: function loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n }, {\n key: \"availableActions\",\n value: function availableActions() {\n return this.makeRequest('availableActions', \"\".concat(this.formUrl, \"/actions\"));\n }\n }, {\n key: \"actionInfo\",\n value: function actionInfo(name) {\n return this.makeRequest('actionInfo', \"\".concat(this.formUrl, \"/actions/\").concat(name));\n }\n }, {\n key: \"isObjectId\",\n value: function isObjectId(id) {\n var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n }, {\n key: \"getProjectId\",\n value: function getProjectId() {\n if (!this.projectId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.projectId);\n } else {\n return this.loadProject().then(function (project) {\n return project._id;\n });\n }\n }\n }, {\n key: \"getFormId\",\n value: function getFormId() {\n if (!this.formId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.formId);\n } else {\n return this.loadForm().then(function (form) {\n return form._id;\n });\n }\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(options) {\n return Formio.currentUser(this, options);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo() {\n return Formio.accessInfo(this);\n }\n\n /**\n * Sets OAuth Logout URL.\n *\n * @return {*}\n */\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n return Formio.getToken(Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Sets the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"setToken\",\n value: function setToken(token, options) {\n return Formio.setToken(token, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns a temporary authentication token for single purpose token generation.\n */\n }, {\n key: \"getTempToken\",\n value: function getTempToken(expire, allowed, options) {\n var token = Formio.getToken(options);\n if (!token) {\n return _nativePromiseOnly[\"default\"].reject('You must be authenticated to generate a temporary auth token.');\n }\n var authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', \"\".concat(authUrl, \"/token\"), 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n\n /**\n * Get a download url for a submission PDF of this submission.\n *\n * @return {*}\n */\n }, {\n key: \"getDownloadUrl\",\n value: function getDownloadUrl(form) {\n var _this4 = this;\n if (!this.submissionId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (!form) {\n // Make sure to load the form first.\n return this.loadForm().then(function (_form) {\n if (!_form) {\n return '';\n }\n return _this4.getDownloadUrl(_form);\n });\n }\n var apiUrl = \"/project/\".concat(form.project);\n apiUrl += \"/form/\".concat(form._id);\n apiUrl += \"/submission/\".concat(this.submissionId);\n var postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n var download = this.base + apiUrl;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.getTempToken(3600, \"GET:\".concat(apiUrl)).then(function (tempToken) {\n download += \"?token=\".concat(tempToken.key);\n resolve(download);\n }, function () {\n resolve(download);\n })[\"catch\"](reject);\n });\n }\n }, {\n key: \"uploadFile\",\n value: function uploadFile(storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n var _this5 = this;\n var requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', storage);\n if (Provider) {\n var provider = new Provider(_this5);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"downloadFile\",\n value: function downloadFile(file, options) {\n var _this6 = this;\n var requestArgs = {\n method: 'download',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this6);\n return provider.downloadFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(file, options) {\n var _this7 = this;\n var requestArgs = {\n method: 'delete',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this7);\n return provider.deleteFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n\n /**\n * Returns the user permissions to a form and submission.\n *\n * @param user - The user or current user if undefined. For anonymous, use \"null\"\n * @param form - The form or current form if undefined. For no form check, use \"null\"\n * @param submission - The submisison or \"index\" if undefined.\n *\n * @return {create: boolean, read: boolean, edit: boolean, delete: boolean}\n */\n }, {\n key: \"userPermissions\",\n value: function userPermissions(user, form, submission) {\n return _nativePromiseOnly[\"default\"].all([form !== undefined ? _nativePromiseOnly[\"default\"].resolve(form) : this.loadForm(), user !== undefined ? _nativePromiseOnly[\"default\"].resolve(user) : this.currentUser(), submission !== undefined || !this.submissionId ? _nativePromiseOnly[\"default\"].resolve(submission) : this.loadSubmission(), this.accessInfo()]).then(function (results) {\n var form = results.shift();\n var user = results.shift() || {\n _id: false,\n roles: []\n };\n var submission = results.shift();\n var access = results.shift();\n var permMap = {\n create: 'create',\n read: 'read',\n update: 'edit',\n \"delete\": 'delete'\n };\n var perms = {\n user: user,\n form: form,\n access: access,\n create: false,\n read: false,\n edit: false,\n \"delete\": false\n };\n for (var roleName in access.roles) {\n if (access.roles.hasOwnProperty(roleName)) {\n var role = access.roles[roleName];\n if (role[\"default\"] && user._id === false) {\n // User is anonymous. Add the anonymous role.\n user.roles.push(role._id);\n } else if (role.admin && user.roles.indexOf(role._id) !== -1) {\n perms.create = true;\n perms.read = true;\n perms[\"delete\"] = true;\n perms.edit = true;\n return perms;\n }\n }\n }\n if (form && form.submissionAccess) {\n for (var i = 0; i < form.submissionAccess.length; i++) {\n var permission = form.submissionAccess[i];\n var _permission$type$spli = permission.type.split('_'),\n _permission$type$spli2 = _slicedToArray(_permission$type$spli, 2),\n perm = _permission$type$spli2[0],\n scope = _permission$type$spli2[1];\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, _intersection2[\"default\"])(permission.roles, user.roles).length) {\n perms[permMap[perm]] = scope === 'all' || !submission || user._id === submission.owner;\n }\n }\n }\n }\n // check for Group Permissions\n if (submission) {\n // we would anyway need to loop through components for create permission, so we'll do that for all of them\n (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component && component.defaultPermission) {\n var value = (0, _get2[\"default\"])(submission.data, path);\n // make it work for single-select Group and multi-select Group\n var groups = Array.isArray(value) ? value : [value];\n groups.forEach(function (group) {\n if (group && group._id &&\n // group id is present\n user.roles.indexOf(group._id) > -1 // user has group id in his roles\n ) {\n if (component.defaultPermission === 'read') {\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'create') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'write') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n }\n if (component.defaultPermission === 'admin') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n perms[permMap[\"delete\"]] = true;\n }\n }\n });\n }\n });\n }\n return perms;\n });\n }\n\n /**\n * Determine if the current user can submit a form.\n * @return {*}\n */\n }, {\n key: \"canSubmit\",\n value: function canSubmit() {\n var _this8 = this;\n return this.userPermissions().then(function (perms) {\n // If there is user and they cannot create, then check anonymous user permissions.\n if (!perms.create && Formio.getUser()) {\n return _this8.userPermissions(null).then(function (anonPerms) {\n if (anonPerms.create) {\n Formio.setUser(null);\n return true;\n }\n return false;\n });\n }\n return perms.create;\n });\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n }], [{\n key: \"useSessionToken\",\n value: function useSessionToken(options) {\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n var user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', true);\n }\n }, {\n key: \"loadProjects\",\n value: function loadProjects(query, opts) {\n query = query || '';\n if (isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return Formio.makeStaticRequest(\"\".concat(Formio.baseUrl, \"/project\").concat(query), 'GET', null, opts);\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url, formio) {\n var base = formio && formio.base ? formio.base : Formio.baseUrl;\n var regex = '^(http[s]?:\\\\/\\\\/)';\n if (base && url.indexOf(base) === 0) {\n regex += \"(\".concat(base.replace(/^http[s]?:\\/\\//, ''), \")\");\n } else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n }, {\n key: \"serialize\",\n value: function serialize(obj, _interpolate) {\n var str = [];\n var interpolate = function interpolate(item) {\n return _interpolate ? _interpolate(item) : item;\n };\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(\"\".concat(encodeURIComponent(p), \"=\").concat(encodeURIComponent(interpolate(obj[p]))));\n }\n }\n return str.join('&');\n }\n }, {\n key: \"getRequestArgs\",\n value: function getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n var requestArgs = {\n url: url,\n method: method,\n data: data || null,\n opts: opts\n };\n if (type) {\n requestArgs.type = type;\n }\n if (formio) {\n requestArgs.formio = formio;\n }\n return requestArgs;\n }\n }, {\n key: \"makeStaticRequest\",\n value: function makeStaticRequest(url, method, data, opts) {\n var requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('staticRequest', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest(formio, type, url, method, data, opts) {\n if (!formio) {\n return Formio.makeStaticRequest(url, method, data, opts);\n }\n var requestArgs = Formio.getRequestArgs(formio, type, url, method, data, opts);\n requestArgs.opts = requestArgs.opts || {};\n requestArgs.opts.formio = formio;\n\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, _defaults2[\"default\"])(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('request', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n }, {\n key: \"request\",\n value: function request(url, method, data, header, opts) {\n if (!url) {\n return _nativePromiseOnly[\"default\"].reject('No url provided');\n }\n var _Formio = Formio;\n method = (method || 'GET').toUpperCase();\n\n // For reverse compatibility, if they provided the ignoreCache parameter,\n // then change it back to the options format where that is a parameter.\n if (isBoolean(opts)) {\n opts = {\n ignoreCache: opts\n };\n }\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n\n // Generate a cachekey.\n var cacheKey = btoa(encodeURI(url));\n\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && _Formio.cache.hasOwnProperty(cacheKey)) {\n return _nativePromiseOnly[\"default\"].resolve(cloneResponse(_Formio.cache[cacheKey]));\n }\n\n // Set up and fetch request\n var headers = header || new Headers(opts.headers || {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var token = _Formio.getToken(opts);\n if (token && !opts.noToken) {\n headers.append('x-jwt-token', token);\n }\n\n // The fetch-ponyfill can't handle a proper Headers class anymore. Change it back to an object.\n var headerObj = {};\n headers.forEach(function (value, name) {\n headerObj[name] = value;\n });\n var options = {\n method: method,\n headers: headerObj,\n mode: 'cors'\n };\n if (data) {\n options.body = JSON.stringify(data);\n }\n\n // Allow plugins to alter the options.\n options = _Formio.pluginAlter('requestOptions', options, url);\n if (options.namespace || _Formio.namespace) {\n opts.namespace = options.namespace || _Formio.namespace;\n }\n var requestToken = options.headers['x-jwt-token'];\n var result = _Formio.pluginAlter('wrapFetchRequestPromise', _Formio.fetch(url, options), {\n url: url,\n method: method,\n data: data,\n opts: opts\n }).then(function (response) {\n // Allow plugins to respond.\n response = _Formio.pluginAlter('requestResponse', response, _Formio, data);\n if (!response.ok) {\n if (response.status === 440) {\n _Formio.setToken(null, opts);\n _Formio.events.emit('formio.sessionExpired', response.body);\n } else if (response.status === 401) {\n _Formio.events.emit('formio.unauthorized', response.body);\n } else if (response.status === 416) {\n _Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n } else if (response.status === 504) {\n return _nativePromiseOnly[\"default\"].reject(new Error('Network request failed'));\n }\n\n // Parse and return the error as a rejected promise to reject this promise\n return (response.headers.get('content-type').includes('application/json') ? response.json() : response.text()).then(function (error) {\n return _nativePromiseOnly[\"default\"].reject(error);\n });\n }\n\n // Handle fetch results\n var token = response.headers.get('x-jwt-token');\n\n // In some strange cases, the fetch library will return an x-jwt-token without sending\n // one to the server. This has even been debugged on the server to verify that no token\n // was introduced with the request, but the response contains a token. This is an Invalid\n // case where we do not send an x-jwt-token and get one in return for any GET request.\n var tokenIntroduced = false;\n if (method === 'GET' && !requestToken && token && !opts.external && !url.includes('token=') && !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 && response.status < 300 && token && token !== '' && !tokenIntroduced) {\n _Formio.setToken(token, opts);\n }\n // 204 is no content. Don't try to .json() it.\n if (response.status === 204) {\n return {};\n }\n var getResult = response.headers.get('content-type').includes('application/json') ? response.json() : response.text();\n return getResult.then(function (result) {\n // Add some content-range metadata to the result here\n var range = response.headers.get('content-range');\n if (range && isObject(result)) {\n range = range.split('/');\n if (range[0] !== '*') {\n var skipLimit = range[0].split('-');\n result.skip = Number(skipLimit[0]);\n result.limit = skipLimit[1] - skipLimit[0] + 1;\n }\n result.serverCount = range[1] === '*' ? range[1] : Number(range[1]);\n }\n if (!opts.getHeaders) {\n return result;\n }\n var headers = {};\n response.headers.forEach(function (item, key) {\n headers[key] = item;\n });\n\n // Return the result with the headers.\n return {\n result: result,\n headers: headers\n };\n });\n }).then(function (result) {\n if (opts.getHeaders) {\n return result;\n }\n\n // Cache the response.\n if (method === 'GET') {\n _Formio.cache[cacheKey] = result;\n }\n return cloneResponse(result);\n })[\"catch\"](function (err) {\n if (err === 'Bad Token') {\n _Formio.setToken(null, opts);\n _Formio.events.emit('formio.badToken', err);\n }\n if (err.message) {\n err = new Error(\"Could not connect to API server (\".concat(err.message, \"): \").concat(url));\n err.networkError = true;\n }\n if (method === 'GET') {\n delete _Formio.cache[cacheKey];\n }\n return _nativePromiseOnly[\"default\"].reject(err);\n });\n return result;\n }\n\n // Needed to maintain reverse compatability...\n }, {\n key: \"token\",\n get: function get() {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n return Formio.tokens.formioToken || '';\n }\n\n // Needed to maintain reverse compatability...\n ,\n set: function set(token) {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n Formio.tokens.formioToken = token || '';\n }\n }, {\n key: \"setToken\",\n value: function setToken() {\n var token = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var opts = arguments.length > 1 ? arguments[1] : undefined;\n token = token || '';\n opts = typeof opts === 'string' ? {\n namespace: opts\n } : opts || {};\n var tokenName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"Token\");\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!token) {\n if (!opts.fromUser) {\n opts.fromToken = true;\n Formio.setUser(null, opts);\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.removeItem(tokenName);\n } catch (err) {\n _browserCookies[\"default\"].erase(tokenName, {\n path: '/'\n });\n }\n Formio.tokens[tokenName] = token;\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n if (Formio.tokens[tokenName] !== token) {\n Formio.tokens[tokenName] = token;\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(tokenName, token);\n } catch (err) {\n _browserCookies[\"default\"].set(tokenName, token, {\n path: '/'\n });\n }\n }\n // Return or updates the current user\n return this.currentUserResolved ? Formio.currentUser(opts.formio, opts) : _nativePromiseOnly[\"default\"].resolve(null);\n }\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var decodedTokenName = options.decode ? \"\".concat(tokenName, \"Decoded\") : tokenName;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (Formio.tokens[decodedTokenName]) {\n return Formio.tokens[decodedTokenName];\n }\n try {\n var token = localStorage.getItem('useSessionToken') ? sessionStorage.getItem(tokenName) : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, _jwtDecode[\"default\"])(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n } catch (e) {\n Formio.tokens[tokenName] = _browserCookies[\"default\"].get(tokenName);\n return Formio.tokens[tokenName];\n }\n }\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var logoutURIName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"LogoutAuthUrl\");\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n }, {\n key: \"setUser\",\n value: function setUser(user) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var userName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"User\");\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\n\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n return storage.removeItem(userName);\n } catch (err) {\n return _browserCookies[\"default\"].erase(userName, {\n path: '/'\n });\n }\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(userName, JSON.stringify(user));\n } catch (err) {\n _browserCookies[\"default\"].set(userName, JSON.stringify(user), {\n path: '/'\n });\n }\n\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n }, {\n key: \"getUser\",\n value: function getUser(options) {\n options = options || {};\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n try {\n return JSON.parse((localStorage.getItem('useSessionToken') ? sessionStorage : localStorage).getItem(userName) || null);\n } catch (e) {\n return JSON.parse(_browserCookies[\"default\"].get(userName));\n }\n }\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n }, {\n key: \"getBaseUrl\",\n value: function getBaseUrl() {\n return Formio.baseUrl;\n }\n }, {\n key: \"setApiUrl\",\n value: function setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n }, {\n key: \"getApiUrl\",\n value: function getApiUrl() {\n return Formio.getBaseUrl();\n }\n }, {\n key: \"setAppUrl\",\n value: function setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setProjectUrl\",\n value: function setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setAuthUrl\",\n value: function setAuthUrl(url) {\n Formio.authUrl = url;\n }\n }, {\n key: \"getAppUrl\",\n value: function getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n }, {\n key: \"getProjectUrl\",\n value: function getProjectUrl() {\n return Formio.projectUrl;\n }\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n Formio.cache = {};\n }\n }, {\n key: \"noop\",\n value: function noop() {}\n }, {\n key: \"identity\",\n value: function identity(value) {\n return value;\n }\n }, {\n key: \"deregisterPlugin\",\n value: function deregisterPlugin(plugin) {\n var beforeLength = Formio.plugins.length;\n Formio.plugins = Formio.plugins.filter(function (p) {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || Formio.noop).call(plugin, Formio);\n return false;\n });\n return beforeLength !== Formio.plugins.length;\n }\n }, {\n key: \"registerPlugin\",\n value: function registerPlugin(plugin, name) {\n var __Formio = Formio;\n __Formio.plugins.push(plugin);\n __Formio.plugins.sort(function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n });\n plugin.__name = name;\n (plugin.init || __Formio.noop).call(plugin, __Formio);\n }\n }, {\n key: \"getPlugin\",\n value: function getPlugin(name) {\n var _iterator = _createForOfIteratorHelper(Formio.plugins),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var plugin = _step.value;\n if (plugin.__name === name) {\n return plugin;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"pluginWait\",\n value: function pluginWait(pluginFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return _nativePromiseOnly[\"default\"].all(Formio.plugins.map(function (plugin) {\n var _ref;\n return (_ref = plugin[pluginFn] || Formio.noop).call.apply(_ref, [plugin].concat(args));\n }));\n }\n }, {\n key: \"pluginGet\",\n value: function pluginGet(pluginFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n var callPlugin = function callPlugin(index) {\n var _ref2;\n var plugin = Formio.plugins[index];\n if (!plugin) {\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n return _nativePromiseOnly[\"default\"].resolve((_ref2 = plugin[pluginFn] || Formio.noop).call.apply(_ref2, [plugin].concat(args))).then(function (result) {\n if (!isNil(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n }\n }, {\n key: \"pluginAlter\",\n value: function pluginAlter(pluginFn, value) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n args[_key4 - 2] = arguments[_key4];\n }\n return Formio.plugins.reduce(function (value, plugin) {\n return (plugin[pluginFn] || Formio.identity).apply(void 0, [value].concat(args));\n }, value);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', \"\".concat(projectUrl, \"/access\"));\n }\n }, {\n key: \"projectRoles\",\n value: function projectRoles(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', \"\".concat(projectUrl, \"/role\"));\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(formio, options) {\n var _this9 = this;\n var authUrl = Formio.authUrl;\n if (!authUrl) {\n authUrl = formio ? formio.projectUrl : Formio.projectUrl || Formio.baseUrl;\n }\n authUrl += '/current';\n var user = Formio.getUser(options);\n if (user) {\n return Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(user), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n var token = Formio.getToken(options);\n if ((!options || !options.external) && !token) {\n return Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(null), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n this.currentUserResolved = false;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options).then(function (response) {\n _this9.currentUserResolved = true;\n Formio.setUser(response, options);\n return response;\n });\n }\n }, {\n key: \"logout\",\n value: function logout(formio, options) {\n options = options || {};\n options.formio = formio;\n var projectUrl = Formio.authUrl ? Formio.authUrl : formio ? formio.projectUrl : Formio.baseUrl;\n var logout = function logout() {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', \"\".concat(projectUrl, \"/logout\")).then(function (result) {\n logout();\n return result;\n })[\"catch\"](function (err) {\n logout();\n throw err;\n });\n }\n }, {\n key: \"pageQuery\",\n value: function pageQuery() {\n var pageQuery = {};\n pageQuery.paths = [];\n var hashes = location.hash.substr(1).replace(/\\?/g, '&').split('&');\n var parts = [];\n location.search.substr(1).split('&').forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n });\n hashes.forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n } else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n }, {\n key: \"oAuthCurrentUser\",\n value: function oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: \"Bearer \".concat(token)\n }\n });\n }\n }, {\n key: \"samlInit\",\n value: function samlInit(options) {\n options = options || {};\n var query = Formio.pageQuery();\n if (query.saml) {\n Formio.setUser(null);\n var retVal = Formio.setToken(query.saml);\n var uri = window.location.toString();\n uri = uri.substring(0, uri.indexOf('?'));\n if (window.location.hash) {\n uri += window.location.hash;\n }\n window.history.replaceState({}, document.title, uri);\n return retVal;\n }\n\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n\n // go to the saml sso endpoint for this project.\n var authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = \"\".concat(authUrl, \"/saml/sso?relay=\").concat(encodeURI(options.relay));\n return false;\n }\n }, {\n key: \"oktaInit\",\n value: function oktaInit(options) {\n options = options || {};\n if ((typeof OktaAuth === \"undefined\" ? \"undefined\" : _typeof(OktaAuth)) !== undefined) {\n options.OktaAuth = OktaAuth;\n }\n if (_typeof(options.OktaAuth) === undefined) {\n var errorMessage = 'Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.';\n console.warn(errorMessage);\n return _nativePromiseOnly[\"default\"].reject(errorMessage);\n }\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n var Okta = options.OktaAuth;\n delete options.OktaAuth;\n var authClient = new Okta(options);\n authClient.tokenManager.get('accessToken').then(function (accessToken) {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n } else if (location.hash) {\n authClient.token.parseFromUrl().then(function (token) {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })[\"catch\"](function (err) {\n console.warn(err);\n reject(err);\n });\n } else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: \"ssoInit\",\n value: function ssoInit(type, options) {\n switch (type) {\n case 'saml':\n return Formio.samlInit(options);\n case 'okta':\n return Formio.oktaInit(options);\n default:\n console.warn('Unknown SSO type');\n return _nativePromiseOnly[\"default\"].reject('Unknown SSO type');\n }\n }\n }, {\n key: \"requireLibrary\",\n value: function requireLibrary(name, property, src, polling, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n return Formio.libraries[name].resolve();\n };\n }\n\n // See if the plugin already exists.\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\n } else {\n src = Array.isArray(src) ? src : [src];\n src.forEach(function (lib) {\n var attrs = {};\n var elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true,\n referrerpolicy: 'origin'\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top of the page.\n var element = document.createElement(elementType);\n if (element.setAttribute) {\n for (var attr in attrs) {\n element.setAttribute(attr, attrs[attr]);\n }\n }\n if (onload) {\n element.addEventListener('load', function () {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n var _document = document,\n head = _document.head;\n if (head) {\n head.appendChild(element);\n }\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n var interval = setInterval(function () {\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n var lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n }, {\n key: \"libraryReady\",\n value: function libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) && Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n }\n }, {\n key: \"addToGlobal\",\n value: function addToGlobal(global) {\n if (_typeof(global) === 'object' && !global.Formio) {\n global.Formio = Formio;\n }\n }\n }, {\n key: \"setPathType\",\n value: function setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n }, {\n key: \"getPathType\",\n value: function getPathType() {\n return Formio.pathType;\n }\n }, {\n key: \"rulesEntities\",\n get: function get() {\n return {\n ValueSources: Formio.ValueSources,\n Conjunctions: Formio.Conjunctions,\n Operators: Formio.Operators,\n Transformers: Formio.Transformers,\n QuickRules: Formio.QuickRules,\n Rules: Formio.Rules\n };\n }\n }, {\n key: \"GlobalFormio\",\n get: function get() {\n if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Formio) {\n return __webpack_require__.g.Formio;\n } else if (typeof window !== 'undefined' && window.Formio) {\n return window.Formio;\n }\n return Formio;\n }\n }]);\n return Formio;\n}(); // Define all the static properties.\n_defineProperty(Formio, \"currentUserResolved\", true);\nFormio.libraries = {};\nFormio.Promise = _nativePromiseOnly[\"default\"];\nFormio.fetch = fetch;\nFormio.Headers = Headers;\nFormio.baseUrl = 'https://api.form.io';\nFormio.projectUrl = Formio.baseUrl;\nFormio.authUrl = '';\nFormio.projectUrlSet = false;\nFormio.plugins = [];\nFormio.cache = {};\nFormio.Providers = _providers[\"default\"];\nFormio.version = '4.21.2';\nFormio.pathType = '';\nFormio.events = new _EventEmitter[\"default\"]();\nFormio.cdn = new _CDN[\"default\"]();\nif ((Formio.version || '').includes('rc')) {\n Formio.cdn.setBaseUrl('https://cdn.test-form.io');\n}\nif (typeof __webpack_require__.g !== 'undefined') {\n Formio.addToGlobal(__webpack_require__.g);\n}\nif (typeof window !== 'undefined') {\n Formio.addToGlobal(window);\n}\nvar GlobalFormio = Formio.GlobalFormio;\nexports.GlobalFormio = GlobalFormio;\nvar _default = Formio;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/Formio.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.GlobalFormio = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.match.js */ \"./node_modules/core-js/modules/es.string.match.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fetchPonyfill2 = _interopRequireDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _browserCookies = _interopRequireDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nvar _providers = _interopRequireDefault(__webpack_require__(/*! ./providers */ \"./lib/providers/index.js\"));\nvar _intersection2 = _interopRequireDefault(__webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\"));\nvar _get2 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _cloneDeep2 = _interopRequireDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar _defaults2 = _interopRequireDefault(__webpack_require__(/*! lodash/defaults */ \"./node_modules/lodash/defaults.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _jwtDecode = _interopRequireDefault(__webpack_require__(/*! jwt-decode */ \"./node_modules/jwt-decode/build/jwt-decode.esm.js\"));\n__webpack_require__(/*! ./polyfills */ \"./lib/polyfills/index.js\");\nvar _CDN = _interopRequireDefault(__webpack_require__(/*! ./CDN */ \"./lib/CDN.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _fetchPonyfill = (0, _fetchPonyfill2[\"default\"])({\n Promise: _nativePromiseOnly[\"default\"]\n }),\n fetch = _fetchPonyfill.fetch,\n Headers = _fetchPonyfill.Headers;\nvar isBoolean = function isBoolean(val) {\n return _typeof(val) === _typeof(true);\n};\nvar isNil = function isNil(val) {\n return val === null || val === undefined;\n};\nvar isObject = function isObject(val) {\n return val && _typeof(val) === 'object';\n};\nfunction cloneResponse(response) {\n var copy = (0, _cloneDeep2[\"default\"])(response);\n if (Array.isArray(response)) {\n copy.skip = response.skip;\n copy.limit = response.limit;\n copy.serverCount = response.serverCount;\n }\n return copy;\n}\n\n/**\n * The Formio interface class.\n *\n * let formio = new Formio('https://examples.form.io/example');\n */\nvar Formio = /*#__PURE__*/function () {\n /* eslint-disable max-statements */\n function Formio(path) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Formio);\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n\n // Initialize our variables.\n this.base = '';\n this.projectsUrl = '';\n this.projectUrl = '';\n this.projectId = '';\n this.roleUrl = '';\n this.rolesUrl = '';\n this.roleId = '';\n this.formUrl = '';\n this.formsUrl = '';\n this.formId = '';\n this.submissionsUrl = '';\n this.submissionUrl = '';\n this.submissionId = '';\n this.actionsUrl = '';\n this.actionId = '';\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n this.query = '';\n\n // Store the original path and options.\n this.path = path;\n this.options = options;\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base')) {\n this.base = options.base;\n } else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n } else if (typeof window !== 'undefined') {\n this.base = window.location.href.match(/http[s]?:\\/\\/api./)[0];\n }\n if (!path) {\n // Allow user to create new projects if this was instantiated without\n // a url\n this.projectUrl = Formio.projectUrl || \"\".concat(this.base, \"/project\");\n this.projectsUrl = \"\".concat(this.base, \"/project\");\n this.projectId = false;\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('project')) {\n this.projectUrl = options.project;\n }\n var project = this.projectUrl || Formio.projectUrl;\n var projectRegEx = /(^|\\/)(project)($|\\/[^/]+)/;\n var isProjectUrl = path.search(projectRegEx) !== -1;\n\n // The baseURL is the same as the projectUrl, and does not contain \"/project/MONGO_ID\" in\n // its domain. This is almost certainly against the Open Source server.\n if (project && this.base === project && !isProjectUrl) {\n this.noProject = true;\n this.projectUrl = this.base;\n }\n\n // Normalize to an absolute path.\n if (path.indexOf('http') !== 0 && path.indexOf('//') !== 0) {\n path = this.base + path;\n }\n var hostparts = this.getUrlParts(path);\n var parts = [];\n var hostName = hostparts[1] + hostparts[2];\n path = hostparts.length > 3 ? hostparts[3] : '';\n var queryparts = path.split('?');\n if (queryparts.length > 1) {\n path = queryparts[0];\n this.query = \"?\".concat(queryparts[1]);\n }\n\n // Register a specific path.\n var registerPath = function registerPath(name, base) {\n _this[\"\".concat(name, \"sUrl\")] = \"\".concat(base, \"/\").concat(name);\n var regex = new RegExp(\"/\".concat(name, \"/([^/]+)\"));\n if (path.search(regex) !== -1) {\n parts = path.match(regex);\n _this[\"\".concat(name, \"Url\")] = parts ? base + parts[0] : '';\n _this[\"\".concat(name, \"Id\")] = parts.length > 1 ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n\n // Register an array of items.\n var registerItems = function registerItems(items, base, staticBase) {\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n if (Array.isArray(item)) {\n registerItems(item, base, true);\n } else {\n var newBase = registerPath(item, base);\n base = staticBase ? base : newBase;\n }\n }\n }\n };\n if (!this.projectUrl || this.projectUrl === this.base) {\n // If a project uses Subdirectories path type, we need to specify a projectUrl\n if (!this.projectUrl && !isProjectUrl && Formio.pathType === 'Subdirectories') {\n var regex = \"^\".concat(hostName.replace(/\\//g, '\\\\/'), \".[^/]+\");\n var match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\n } else {\n this.projectUrl = hostName;\n }\n }\n // Check if we have a specified path type.\n var isNotSubdomainType = false;\n if (Formio.pathType) {\n isNotSubdomainType = Formio.pathType !== 'Subdomains';\n }\n if (!this.noProject) {\n // Determine the projectUrl and projectId\n if (isProjectUrl) {\n // Get project id as project/:projectId.\n registerItems(['project'], hostName);\n path = path.replace(projectRegEx, '');\n } else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts.length > 3 && path.split('/').length > 1) {\n var isFile = path.match(/.json/);\n var pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n } else {\n pathParts.shift(); // Throw away the first /.\n this.projectId = pathParts.shift();\n path = \"/\".concat(pathParts.join('/'));\n this.projectUrl = \"\".concat(hostName, \"/\").concat(this.projectId);\n }\n }\n } else {\n // Get project id from subdomain.\n if (hostparts.length > 2 && (hostparts[2].split('.').length > 2 || hostName.includes('localhost')) && !isNotSubdomainType) {\n this.projectUrl = hostName;\n this.projectId = hostparts[2].split('.')[0];\n }\n }\n this.projectsUrl = this.projectsUrl || \"\".concat(this.base, \"/project\");\n }\n\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n } else {\n var subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n var subs = path.match(subRegEx);\n this.pathType = subs && subs.length > 1 ? subs[1] : '';\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = \"\".concat(this.projectUrl, \"/form\");\n this.formUrl = path ? this.projectUrl + path : '';\n this.formId = path.replace(/^\\/+|\\/+$/g, '');\n var items = ['submission', 'action', 'v'];\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n this[\"\".concat(item, \"sUrl\")] = \"\".concat(this.projectUrl + path, \"/\").concat(item);\n if (this.pathType === item && subs.length > 2 && subs[2]) {\n this[\"\".concat(item, \"Id\")] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[\"\".concat(item, \"Url\")] = this.projectUrl + path + subs[0];\n }\n }\n }\n }\n\n // Set the app url if it is not set.\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = this.projectUrl;\n }\n }\n /* eslint-enable max-statements */\n _createClass(Formio, [{\n key: \"delete\",\n value: function _delete(type, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n }, {\n key: \"index\",\n value: function index(type, query, opts) {\n var _url = \"\".concat(type, \"Url\");\n query = query || '';\n if (query && isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n }, {\n key: \"save\",\n value: function save(type, data, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n var method = this[_id] || data._id ? 'put' : 'post';\n var reqUrl = this[_id] ? this[_url] : this[\"\".concat(type, \"sUrl\")];\n if (!this[_id] && data._id && method === 'put' && !reqUrl.includes(data._id)) {\n reqUrl += \"/\".concat(data._id);\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n }, {\n key: \"load\",\n value: function load(type, query, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? \"\".concat(this.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = this.query;\n }\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject(\"Missing \".concat(_id));\n }\n var url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId)) && parseInt(this.vId) !== 0) {\n url += url.match(/\\?/) ? '&' : '?';\n url += \"formRevision=\".concat(this.vId);\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return Formio.makeRequest.apply(Formio, [this].concat(args));\n }\n }, {\n key: \"loadProject\",\n value: function loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n }, {\n key: \"saveProject\",\n value: function saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n }, {\n key: \"deleteProject\",\n value: function deleteProject(opts) {\n return this[\"delete\"]('project', opts);\n }\n }, {\n key: \"loadRole\",\n value: function loadRole(opts) {\n return this.load('role', null, opts);\n }\n }, {\n key: \"saveRole\",\n value: function saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n }, {\n key: \"deleteRole\",\n value: function deleteRole(opts) {\n return this[\"delete\"]('role', opts);\n }\n }, {\n key: \"loadRoles\",\n value: function loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n }, {\n key: \"loadForm\",\n value: function loadForm(query, opts) {\n var _this2 = this;\n return this.load('form', query, opts).then(function (currentForm) {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(_this2.vId))) {\n return currentForm;\n }\n // If a submission already exists but form is marked to load current version of form.\n if (currentForm.revisions === 'current' && _this2.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == _this2.vId || currentForm.revisionId === _this2.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = _this2.query ? \"\".concat(_this2.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = _this2.query;\n }\n return _this2.makeRequest('form', _this2.vUrl + query, 'get', null, opts).then(function (revisionForm) {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\n // Using object.assign so we don't cross polinate multiple form loads.\n return Object.assign({}, currentForm);\n })\n // If we couldn't load the revision, just return the original form.\n [\"catch\"](function () {\n return Object.assign({}, currentForm);\n });\n });\n }\n }, {\n key: \"saveForm\",\n value: function saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n }, {\n key: \"deleteForm\",\n value: function deleteForm(opts) {\n return this[\"delete\"]('form', opts);\n }\n }, {\n key: \"loadForms\",\n value: function loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission(query, opts) {\n var _this3 = this;\n return this.load('submission', query, opts).then(function (submission) {\n _this3.vId = submission._frid || submission._fvid;\n _this3.vUrl = \"\".concat(_this3.formUrl, \"/v/\").concat(_this3.vId);\n return submission;\n });\n }\n }, {\n key: \"saveSubmission\",\n value: function saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId))) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission(opts) {\n return this[\"delete\"]('submission', opts);\n }\n }, {\n key: \"loadSubmissions\",\n value: function loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n }, {\n key: \"loadAction\",\n value: function loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n }, {\n key: \"saveAction\",\n value: function saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n }, {\n key: \"deleteAction\",\n value: function deleteAction(opts) {\n return this[\"delete\"]('action', opts);\n }\n }, {\n key: \"loadActions\",\n value: function loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n }, {\n key: \"availableActions\",\n value: function availableActions() {\n return this.makeRequest('availableActions', \"\".concat(this.formUrl, \"/actions\"));\n }\n }, {\n key: \"actionInfo\",\n value: function actionInfo(name) {\n return this.makeRequest('actionInfo', \"\".concat(this.formUrl, \"/actions/\").concat(name));\n }\n }, {\n key: \"isObjectId\",\n value: function isObjectId(id) {\n var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n }, {\n key: \"getProjectId\",\n value: function getProjectId() {\n if (!this.projectId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.projectId);\n } else {\n return this.loadProject().then(function (project) {\n return project._id;\n });\n }\n }\n }, {\n key: \"getFormId\",\n value: function getFormId() {\n if (!this.formId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.formId);\n } else {\n return this.loadForm().then(function (form) {\n return form._id;\n });\n }\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(options) {\n return Formio.currentUser(this, options);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo() {\n return Formio.accessInfo(this);\n }\n\n /**\n * Sets OAuth Logout URL.\n *\n * @return {*}\n */\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n return Formio.getToken(Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Sets the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"setToken\",\n value: function setToken(token, options) {\n return Formio.setToken(token, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns a temporary authentication token for single purpose token generation.\n */\n }, {\n key: \"getTempToken\",\n value: function getTempToken(expire, allowed, options) {\n var token = Formio.getToken(options);\n if (!token) {\n return _nativePromiseOnly[\"default\"].reject('You must be authenticated to generate a temporary auth token.');\n }\n var authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', \"\".concat(authUrl, \"/token\"), 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n\n /**\n * Get a download url for a submission PDF of this submission.\n *\n * @return {*}\n */\n }, {\n key: \"getDownloadUrl\",\n value: function getDownloadUrl(form) {\n var _this4 = this;\n if (!this.submissionId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (!form) {\n // Make sure to load the form first.\n return this.loadForm().then(function (_form) {\n if (!_form) {\n return '';\n }\n return _this4.getDownloadUrl(_form);\n });\n }\n var apiUrl = \"/project/\".concat(form.project);\n apiUrl += \"/form/\".concat(form._id);\n apiUrl += \"/submission/\".concat(this.submissionId);\n var postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n var download = this.base + apiUrl;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.getTempToken(3600, \"GET:\".concat(apiUrl)).then(function (tempToken) {\n download += \"?token=\".concat(tempToken.key);\n resolve(download);\n }, function () {\n resolve(download);\n })[\"catch\"](reject);\n });\n }\n }, {\n key: \"uploadFile\",\n value: function uploadFile(storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n var _this5 = this;\n var requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', storage);\n if (Provider) {\n var provider = new Provider(_this5);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"downloadFile\",\n value: function downloadFile(file, options) {\n var _this6 = this;\n var requestArgs = {\n method: 'download',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this6);\n return provider.downloadFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(file, options) {\n var _this7 = this;\n var requestArgs = {\n method: 'delete',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this7);\n return provider.deleteFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n\n /**\n * Returns the user permissions to a form and submission.\n *\n * @param user - The user or current user if undefined. For anonymous, use \"null\"\n * @param form - The form or current form if undefined. For no form check, use \"null\"\n * @param submission - The submisison or \"index\" if undefined.\n *\n * @return {create: boolean, read: boolean, edit: boolean, delete: boolean}\n */\n }, {\n key: \"userPermissions\",\n value: function userPermissions(user, form, submission) {\n return _nativePromiseOnly[\"default\"].all([form !== undefined ? _nativePromiseOnly[\"default\"].resolve(form) : this.loadForm(), user !== undefined ? _nativePromiseOnly[\"default\"].resolve(user) : this.currentUser(), submission !== undefined || !this.submissionId ? _nativePromiseOnly[\"default\"].resolve(submission) : this.loadSubmission(), this.accessInfo()]).then(function (results) {\n var form = results.shift();\n var user = results.shift() || {\n _id: false,\n roles: []\n };\n var submission = results.shift();\n var access = results.shift();\n var permMap = {\n create: 'create',\n read: 'read',\n update: 'edit',\n \"delete\": 'delete'\n };\n var perms = {\n user: user,\n form: form,\n access: access,\n create: false,\n read: false,\n edit: false,\n \"delete\": false\n };\n for (var roleName in access.roles) {\n if (access.roles.hasOwnProperty(roleName)) {\n var role = access.roles[roleName];\n if (role[\"default\"] && user._id === false) {\n // User is anonymous. Add the anonymous role.\n user.roles.push(role._id);\n } else if (role.admin && user.roles.indexOf(role._id) !== -1) {\n perms.create = true;\n perms.read = true;\n perms[\"delete\"] = true;\n perms.edit = true;\n return perms;\n }\n }\n }\n if (form && form.submissionAccess) {\n for (var i = 0; i < form.submissionAccess.length; i++) {\n var permission = form.submissionAccess[i];\n var _permission$type$spli = permission.type.split('_'),\n _permission$type$spli2 = _slicedToArray(_permission$type$spli, 2),\n perm = _permission$type$spli2[0],\n scope = _permission$type$spli2[1];\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, _intersection2[\"default\"])(permission.roles, user.roles).length) {\n perms[permMap[perm]] = scope === 'all' || !submission || user._id === submission.owner;\n }\n }\n }\n }\n // check for Group Permissions\n if (submission) {\n // we would anyway need to loop through components for create permission, so we'll do that for all of them\n (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component && component.defaultPermission) {\n var value = (0, _get2[\"default\"])(submission.data, path);\n // make it work for single-select Group and multi-select Group\n var groups = Array.isArray(value) ? value : [value];\n groups.forEach(function (group) {\n if (group && group._id &&\n // group id is present\n user.roles.indexOf(group._id) > -1 // user has group id in his roles\n ) {\n if (component.defaultPermission === 'read') {\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'create') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'write') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n }\n if (component.defaultPermission === 'admin') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n perms[permMap[\"delete\"]] = true;\n }\n }\n });\n }\n });\n }\n return perms;\n });\n }\n\n /**\n * Determine if the current user can submit a form.\n * @return {*}\n */\n }, {\n key: \"canSubmit\",\n value: function canSubmit() {\n var _this8 = this;\n return this.userPermissions().then(function (perms) {\n // If there is user and they cannot create, then check anonymous user permissions.\n if (!perms.create && Formio.getUser()) {\n return _this8.userPermissions(null).then(function (anonPerms) {\n if (anonPerms.create) {\n Formio.setUser(null);\n return true;\n }\n return false;\n });\n }\n return perms.create;\n });\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n }], [{\n key: \"useSessionToken\",\n value: function useSessionToken(options) {\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n var user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', true);\n }\n }, {\n key: \"loadProjects\",\n value: function loadProjects(query, opts) {\n query = query || '';\n if (isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return Formio.makeStaticRequest(\"\".concat(Formio.baseUrl, \"/project\").concat(query), 'GET', null, opts);\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url, formio) {\n var base = formio && formio.base ? formio.base : Formio.baseUrl;\n var regex = '^(http[s]?:\\\\/\\\\/)';\n if (base && url.indexOf(base) === 0) {\n regex += \"(\".concat(base.replace(/^http[s]?:\\/\\//, ''), \")\");\n } else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n }, {\n key: \"serialize\",\n value: function serialize(obj, _interpolate) {\n var str = [];\n var interpolate = function interpolate(item) {\n return _interpolate ? _interpolate(item) : item;\n };\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(\"\".concat(encodeURIComponent(p), \"=\").concat(encodeURIComponent(interpolate(obj[p]))));\n }\n }\n return str.join('&');\n }\n }, {\n key: \"getRequestArgs\",\n value: function getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n var requestArgs = {\n url: url,\n method: method,\n data: data || null,\n opts: opts\n };\n if (type) {\n requestArgs.type = type;\n }\n if (formio) {\n requestArgs.formio = formio;\n }\n return requestArgs;\n }\n }, {\n key: \"makeStaticRequest\",\n value: function makeStaticRequest(url, method, data, opts) {\n var requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('staticRequest', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest(formio, type, url, method, data, opts) {\n if (!formio) {\n return Formio.makeStaticRequest(url, method, data, opts);\n }\n var requestArgs = Formio.getRequestArgs(formio, type, url, method, data, opts);\n requestArgs.opts = requestArgs.opts || {};\n requestArgs.opts.formio = formio;\n\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, _defaults2[\"default\"])(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('request', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n }, {\n key: \"request\",\n value: function request(url, method, data, header, opts) {\n if (!url) {\n return _nativePromiseOnly[\"default\"].reject('No url provided');\n }\n var _Formio = Formio;\n method = (method || 'GET').toUpperCase();\n\n // For reverse compatibility, if they provided the ignoreCache parameter,\n // then change it back to the options format where that is a parameter.\n if (isBoolean(opts)) {\n opts = {\n ignoreCache: opts\n };\n }\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n\n // Generate a cachekey.\n var cacheKey = btoa(encodeURI(url));\n\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && _Formio.cache.hasOwnProperty(cacheKey)) {\n return _nativePromiseOnly[\"default\"].resolve(cloneResponse(_Formio.cache[cacheKey]));\n }\n\n // Set up and fetch request\n var headers = header || new Headers(opts.headers || {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var token = _Formio.getToken(opts);\n if (token && !opts.noToken) {\n headers.append('x-jwt-token', token);\n }\n\n // The fetch-ponyfill can't handle a proper Headers class anymore. Change it back to an object.\n var headerObj = {};\n headers.forEach(function (value, name) {\n headerObj[name] = value;\n });\n var options = {\n method: method,\n headers: headerObj,\n mode: 'cors'\n };\n if (data) {\n options.body = JSON.stringify(data);\n }\n\n // Allow plugins to alter the options.\n options = _Formio.pluginAlter('requestOptions', options, url);\n if (options.namespace || _Formio.namespace) {\n opts.namespace = options.namespace || _Formio.namespace;\n }\n var requestToken = options.headers['x-jwt-token'];\n var result = _Formio.pluginAlter('wrapFetchRequestPromise', _Formio.fetch(url, options), {\n url: url,\n method: method,\n data: data,\n opts: opts\n }).then(function (response) {\n // Allow plugins to respond.\n response = _Formio.pluginAlter('requestResponse', response, _Formio, data);\n if (!response.ok) {\n if (response.status === 440) {\n _Formio.setToken(null, opts);\n _Formio.events.emit('formio.sessionExpired', response.body);\n } else if (response.status === 401) {\n _Formio.events.emit('formio.unauthorized', response.body);\n } else if (response.status === 416) {\n _Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n } else if (response.status === 504) {\n return _nativePromiseOnly[\"default\"].reject(new Error('Network request failed'));\n }\n\n // Parse and return the error as a rejected promise to reject this promise\n return (response.headers.get('content-type').includes('application/json') ? response.json() : response.text()).then(function (error) {\n return _nativePromiseOnly[\"default\"].reject(error);\n });\n }\n\n // Handle fetch results\n var token = response.headers.get('x-jwt-token');\n\n // In some strange cases, the fetch library will return an x-jwt-token without sending\n // one to the server. This has even been debugged on the server to verify that no token\n // was introduced with the request, but the response contains a token. This is an Invalid\n // case where we do not send an x-jwt-token and get one in return for any GET request.\n var tokenIntroduced = false;\n if (method === 'GET' && !requestToken && token && !opts.external && !url.includes('token=') && !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 && response.status < 300 && token && token !== '' && !tokenIntroduced) {\n _Formio.setToken(token, opts);\n }\n // 204 is no content. Don't try to .json() it.\n if (response.status === 204) {\n return {};\n }\n var getResult = response.headers.get('content-type').includes('application/json') ? response.json() : response.text();\n return getResult.then(function (result) {\n // Add some content-range metadata to the result here\n var range = response.headers.get('content-range');\n if (range && isObject(result)) {\n range = range.split('/');\n if (range[0] !== '*') {\n var skipLimit = range[0].split('-');\n result.skip = Number(skipLimit[0]);\n result.limit = skipLimit[1] - skipLimit[0] + 1;\n }\n result.serverCount = range[1] === '*' ? range[1] : Number(range[1]);\n }\n if (!opts.getHeaders) {\n return result;\n }\n var headers = {};\n response.headers.forEach(function (item, key) {\n headers[key] = item;\n });\n\n // Return the result with the headers.\n return {\n result: result,\n headers: headers\n };\n });\n }).then(function (result) {\n if (opts.getHeaders) {\n return result;\n }\n\n // Cache the response.\n if (method === 'GET') {\n _Formio.cache[cacheKey] = result;\n }\n return cloneResponse(result);\n })[\"catch\"](function (err) {\n if (err === 'Bad Token') {\n _Formio.setToken(null, opts);\n _Formio.events.emit('formio.badToken', err);\n }\n if (err.message) {\n err = new Error(\"Could not connect to API server (\".concat(err.message, \"): \").concat(url));\n err.networkError = true;\n }\n if (method === 'GET') {\n delete _Formio.cache[cacheKey];\n }\n return _nativePromiseOnly[\"default\"].reject(err);\n });\n return result;\n }\n\n // Needed to maintain reverse compatability...\n }, {\n key: \"token\",\n get: function get() {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n return Formio.tokens.formioToken || '';\n }\n\n // Needed to maintain reverse compatability...\n ,\n set: function set(token) {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n Formio.tokens.formioToken = token || '';\n }\n }, {\n key: \"setToken\",\n value: function setToken() {\n var token = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var opts = arguments.length > 1 ? arguments[1] : undefined;\n token = token || '';\n opts = typeof opts === 'string' ? {\n namespace: opts\n } : opts || {};\n var tokenName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"Token\");\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!token) {\n if (!opts.fromUser) {\n opts.fromToken = true;\n Formio.setUser(null, opts);\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.removeItem(tokenName);\n } catch (err) {\n _browserCookies[\"default\"].erase(tokenName, {\n path: '/'\n });\n }\n Formio.tokens[tokenName] = token;\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n if (Formio.tokens[tokenName] !== token) {\n Formio.tokens[tokenName] = token;\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(tokenName, token);\n } catch (err) {\n _browserCookies[\"default\"].set(tokenName, token, {\n path: '/'\n });\n }\n }\n // Return or updates the current user\n return this.currentUserResolved ? Formio.currentUser(opts.formio, opts) : _nativePromiseOnly[\"default\"].resolve(null);\n }\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var decodedTokenName = options.decode ? \"\".concat(tokenName, \"Decoded\") : tokenName;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (Formio.tokens[decodedTokenName]) {\n return Formio.tokens[decodedTokenName];\n }\n try {\n var token = localStorage.getItem('useSessionToken') ? sessionStorage.getItem(tokenName) : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, _jwtDecode[\"default\"])(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n } catch (e) {\n Formio.tokens[tokenName] = _browserCookies[\"default\"].get(tokenName);\n return Formio.tokens[tokenName];\n }\n }\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var logoutURIName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"LogoutAuthUrl\");\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n }, {\n key: \"setUser\",\n value: function setUser(user) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var userName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"User\");\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\n\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n return storage.removeItem(userName);\n } catch (err) {\n return _browserCookies[\"default\"].erase(userName, {\n path: '/'\n });\n }\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(userName, JSON.stringify(user));\n } catch (err) {\n _browserCookies[\"default\"].set(userName, JSON.stringify(user), {\n path: '/'\n });\n }\n\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n }, {\n key: \"getUser\",\n value: function getUser(options) {\n options = options || {};\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n try {\n return JSON.parse((localStorage.getItem('useSessionToken') ? sessionStorage : localStorage).getItem(userName) || null);\n } catch (e) {\n return JSON.parse(_browserCookies[\"default\"].get(userName));\n }\n }\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n }, {\n key: \"getBaseUrl\",\n value: function getBaseUrl() {\n return Formio.baseUrl;\n }\n }, {\n key: \"setApiUrl\",\n value: function setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n }, {\n key: \"getApiUrl\",\n value: function getApiUrl() {\n return Formio.getBaseUrl();\n }\n }, {\n key: \"setAppUrl\",\n value: function setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setProjectUrl\",\n value: function setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setAuthUrl\",\n value: function setAuthUrl(url) {\n Formio.authUrl = url;\n }\n }, {\n key: \"getAppUrl\",\n value: function getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n }, {\n key: \"getProjectUrl\",\n value: function getProjectUrl() {\n return Formio.projectUrl;\n }\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n Formio.cache = {};\n }\n }, {\n key: \"noop\",\n value: function noop() {}\n }, {\n key: \"identity\",\n value: function identity(value) {\n return value;\n }\n }, {\n key: \"deregisterPlugin\",\n value: function deregisterPlugin(plugin) {\n var beforeLength = Formio.plugins.length;\n Formio.plugins = Formio.plugins.filter(function (p) {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || Formio.noop).call(plugin, Formio);\n return false;\n });\n return beforeLength !== Formio.plugins.length;\n }\n }, {\n key: \"registerPlugin\",\n value: function registerPlugin(plugin, name) {\n var __Formio = Formio;\n __Formio.plugins.push(plugin);\n __Formio.plugins.sort(function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n });\n plugin.__name = name;\n (plugin.init || __Formio.noop).call(plugin, __Formio);\n }\n }, {\n key: \"getPlugin\",\n value: function getPlugin(name) {\n var _iterator = _createForOfIteratorHelper(Formio.plugins),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var plugin = _step.value;\n if (plugin.__name === name) {\n return plugin;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"pluginWait\",\n value: function pluginWait(pluginFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return _nativePromiseOnly[\"default\"].all(Formio.plugins.map(function (plugin) {\n var _ref;\n return (_ref = plugin[pluginFn] || Formio.noop).call.apply(_ref, [plugin].concat(args));\n }));\n }\n }, {\n key: \"pluginGet\",\n value: function pluginGet(pluginFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n var callPlugin = function callPlugin(index) {\n var _ref2;\n var plugin = Formio.plugins[index];\n if (!plugin) {\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n return _nativePromiseOnly[\"default\"].resolve((_ref2 = plugin[pluginFn] || Formio.noop).call.apply(_ref2, [plugin].concat(args))).then(function (result) {\n if (!isNil(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n }\n }, {\n key: \"pluginAlter\",\n value: function pluginAlter(pluginFn, value) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n args[_key4 - 2] = arguments[_key4];\n }\n return Formio.plugins.reduce(function (value, plugin) {\n return (plugin[pluginFn] || Formio.identity).apply(void 0, [value].concat(args));\n }, value);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', \"\".concat(projectUrl, \"/access\"));\n }\n }, {\n key: \"projectRoles\",\n value: function projectRoles(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', \"\".concat(projectUrl, \"/role\"));\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(formio, options) {\n var _this9 = this;\n var authUrl = Formio.authUrl;\n if (!authUrl) {\n authUrl = formio ? formio.projectUrl : Formio.projectUrl || Formio.baseUrl;\n }\n authUrl += '/current';\n var user = Formio.getUser(options);\n if (user) {\n return Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(user), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n var token = Formio.getToken(options);\n if ((!options || !options.external) && !token) {\n return Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(null), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n this.currentUserResolved = false;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options).then(function (response) {\n _this9.currentUserResolved = true;\n Formio.setUser(response, options);\n return response;\n });\n }\n }, {\n key: \"logout\",\n value: function logout(formio, options) {\n options = options || {};\n options.formio = formio;\n var projectUrl = Formio.authUrl ? Formio.authUrl : formio ? formio.projectUrl : Formio.baseUrl;\n var logout = function logout() {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', \"\".concat(projectUrl, \"/logout\")).then(function (result) {\n logout();\n return result;\n })[\"catch\"](function (err) {\n logout();\n throw err;\n });\n }\n }, {\n key: \"pageQuery\",\n value: function pageQuery() {\n var pageQuery = {};\n pageQuery.paths = [];\n var hashes = location.hash.substr(1).replace(/\\?/g, '&').split('&');\n var parts = [];\n location.search.substr(1).split('&').forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n });\n hashes.forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n } else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n }, {\n key: \"oAuthCurrentUser\",\n value: function oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: \"Bearer \".concat(token)\n }\n });\n }\n }, {\n key: \"samlInit\",\n value: function samlInit(options) {\n options = options || {};\n var query = Formio.pageQuery();\n if (query.saml) {\n Formio.setUser(null);\n var retVal = Formio.setToken(query.saml);\n var uri = window.location.toString();\n uri = uri.substring(0, uri.indexOf('?'));\n if (window.location.hash) {\n uri += window.location.hash;\n }\n window.history.replaceState({}, document.title, uri);\n return retVal;\n }\n\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n\n // go to the saml sso endpoint for this project.\n var authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = \"\".concat(authUrl, \"/saml/sso?relay=\").concat(encodeURI(options.relay));\n return false;\n }\n }, {\n key: \"oktaInit\",\n value: function oktaInit(options) {\n options = options || {};\n if ((typeof OktaAuth === \"undefined\" ? \"undefined\" : _typeof(OktaAuth)) !== undefined) {\n options.OktaAuth = OktaAuth;\n }\n if (_typeof(options.OktaAuth) === undefined) {\n var errorMessage = 'Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.';\n console.warn(errorMessage);\n return _nativePromiseOnly[\"default\"].reject(errorMessage);\n }\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n var Okta = options.OktaAuth;\n delete options.OktaAuth;\n var authClient = new Okta(options);\n authClient.tokenManager.get('accessToken').then(function (accessToken) {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n } else if (location.hash) {\n authClient.token.parseFromUrl().then(function (token) {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })[\"catch\"](function (err) {\n console.warn(err);\n reject(err);\n });\n } else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: \"ssoInit\",\n value: function ssoInit(type, options) {\n switch (type) {\n case 'saml':\n return Formio.samlInit(options);\n case 'okta':\n return Formio.oktaInit(options);\n default:\n console.warn('Unknown SSO type');\n return _nativePromiseOnly[\"default\"].reject('Unknown SSO type');\n }\n }\n }, {\n key: \"requireLibrary\",\n value: function requireLibrary(name, property, src, polling, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n return Formio.libraries[name].resolve();\n };\n }\n\n // See if the plugin already exists.\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\n } else {\n src = Array.isArray(src) ? src : [src];\n src.forEach(function (lib) {\n var attrs = {};\n var elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true,\n referrerpolicy: 'origin'\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top of the page.\n var element = document.createElement(elementType);\n if (element.setAttribute) {\n for (var attr in attrs) {\n element.setAttribute(attr, attrs[attr]);\n }\n }\n if (onload) {\n element.addEventListener('load', function () {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n var _document = document,\n head = _document.head;\n if (head) {\n head.appendChild(element);\n }\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n var interval = setInterval(function () {\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n var lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n }, {\n key: \"libraryReady\",\n value: function libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) && Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n }\n }, {\n key: \"addToGlobal\",\n value: function addToGlobal(global) {\n if (_typeof(global) === 'object' && !global.Formio) {\n global.Formio = Formio;\n }\n }\n }, {\n key: \"setPathType\",\n value: function setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n }, {\n key: \"getPathType\",\n value: function getPathType() {\n return Formio.pathType;\n }\n }, {\n key: \"rulesEntities\",\n get: function get() {\n return {\n ValueSources: Formio.ValueSources,\n Conjunctions: Formio.Conjunctions,\n Operators: Formio.Operators,\n Transformers: Formio.Transformers,\n QuickRules: Formio.QuickRules,\n Rules: Formio.Rules\n };\n }\n }, {\n key: \"GlobalFormio\",\n get: function get() {\n if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Formio) {\n return __webpack_require__.g.Formio;\n } else if (typeof window !== 'undefined' && window.Formio) {\n return window.Formio;\n }\n return Formio;\n }\n }]);\n return Formio;\n}(); // Define all the static properties.\n_defineProperty(Formio, \"currentUserResolved\", true);\nFormio.libraries = {};\nFormio.Promise = _nativePromiseOnly[\"default\"];\nFormio.fetch = fetch;\nFormio.Headers = Headers;\nFormio.baseUrl = 'https://api.form.io';\nFormio.projectUrl = Formio.baseUrl;\nFormio.authUrl = '';\nFormio.projectUrlSet = false;\nFormio.plugins = [];\nFormio.cache = {};\nFormio.Providers = _providers[\"default\"];\nFormio.version = '4.21.5';\nFormio.pathType = '';\nFormio.events = new _EventEmitter[\"default\"]();\nFormio.cdn = new _CDN[\"default\"]();\nif ((Formio.version || '').includes('rc')) {\n Formio.cdn.setBaseUrl('https://cdn.test-form.io');\n}\nif (typeof __webpack_require__.g !== 'undefined') {\n Formio.addToGlobal(__webpack_require__.g);\n}\nif (typeof window !== 'undefined') {\n Formio.addToGlobal(window);\n}\nvar GlobalFormio = Formio.GlobalFormio;\nexports.GlobalFormio = GlobalFormio;\nvar _default = Formio;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/Formio.js?"); /***/ }), @@ -136,7 +136,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Webform2 = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Wizard = /*#__PURE__*/function (_Webform) {\n _inherits(Wizard, _Webform);\n var _super = _createSuper(Wizard);\n /**\n * Constructor for wizard based forms\n * @param element Dom element to place this wizard.\n * @param {Object} options Options object, supported options are:\n * - breadcrumbSettings.clickable: true (default) determines if the breadcrumb bar is clickable or not\n * - buttonSettings.show*(Previous, Next, Cancel): true (default) determines if the button is shown or not\n * - allowPrevious: false (default) determines if the breadcrumb bar is clickable or not for visited tabs\n */\n function Wizard() {\n var _this;\n _classCallCheck(this, Wizard);\n var element, options;\n if (arguments[0] instanceof HTMLElement || arguments[1]) {\n element = arguments[0];\n options = arguments[1] || {};\n } else {\n options = arguments[0] || {};\n }\n options.display = 'wizard';\n _this = _super.call(this, element, options);\n _this.pages = [];\n _this.prefixComps = [];\n _this.suffixComps = [];\n _this.components = [];\n _this.originalComponents = [];\n _this.page = 0;\n _this.currentPanel = null;\n _this.currentPanels = null;\n _this.currentNextPage = 0;\n _this._seenPages = [0];\n _this.subWizards = [];\n _this.allPages = [];\n _this.lastPromise = _nativePromiseOnly[\"default\"].resolve();\n _this.enabledIndex = 0;\n _this.editMode = false;\n _this.originalOptions = _lodash[\"default\"].cloneDeep(_this.options);\n return _this;\n }\n _createClass(Wizard, [{\n key: \"isLastPage\",\n value: function isLastPage() {\n var next = this.getNextPage();\n if (_lodash[\"default\"].isNumber(next)) {\n return next === -1;\n }\n return _lodash[\"default\"].isNull(next);\n }\n }, {\n key: \"getPages\",\n value: function getPages() {\n var _this2 = this;\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _args$all = args.all,\n all = _args$all === void 0 ? false : _args$all;\n var pages = this.hasExtraPages ? this.components : this.pages;\n var filteredPages = pages.filter(all ? _lodash[\"default\"].identity : function (p, index) {\n return _this2._seenPages.includes(index);\n });\n return filteredPages;\n }\n }, {\n key: \"hasExtraPages\",\n get: function get() {\n return !_lodash[\"default\"].isEmpty(this.subWizards);\n }\n }, {\n key: \"data\",\n get: function get() {\n return _get(_getPrototypeOf(Wizard.prototype), \"data\", this);\n },\n set: function set(value) {\n var _this3 = this;\n this._data = value;\n _lodash[\"default\"].each(this.getPages({\n all: true\n }), function (component) {\n component.data = _this3.componentContext(component);\n });\n }\n }, {\n key: \"localData\",\n get: function get() {\n var _this$pages$this$page, _this$pages$this$page2;\n return ((_this$pages$this$page = this.pages[this.page]) === null || _this$pages$this$page === void 0 ? void 0 : (_this$pages$this$page2 = _this$pages$this$page.root) === null || _this$pages$this$page2 === void 0 ? void 0 : _this$pages$this$page2.submission.data) || this.submission.data;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var visible = _get(_getPrototypeOf(Wizard.prototype), \"checkConditions\", this).call(this, data, flags, row);\n this.establishPages(data);\n return visible;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.submitting ? this.getPages({\n all: this.isLastPage()\n }) : _get(_getPrototypeOf(Wizard.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.getPages({\n all: true\n }).forEach(function (page) {\n return page.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$pages,\n _this4 = this;\n // Check for and initlize button settings object\n this.options.buttonSettings = _lodash[\"default\"].defaults(this.options.buttonSettings, {\n showPrevious: true,\n showNext: true,\n showSubmit: true,\n showCancel: !this.options.readOnly\n });\n if (!this.isSecondInit) {\n var _this$options, _this$options$breadcr;\n this.isClickableDefined = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : (_this$options$breadcr = _this$options.breadcrumbSettings) === null || _this$options$breadcr === void 0 ? void 0 : _this$options$breadcr.hasOwnProperty('clickable');\n this.isSecondInit = true;\n }\n this.options.breadcrumbSettings = _lodash[\"default\"].defaults(this.options.breadcrumbSettings, {\n clickable: true\n });\n this.options.allowPrevious = this.options.allowPrevious || false;\n this.page = 0;\n var onReady = _get(_getPrototypeOf(Wizard.prototype), \"init\", this).call(this);\n this.setComponentSchema();\n if ((_this$pages = this.pages) !== null && _this$pages !== void 0 && _this$pages[this.page]) {\n this.component = this.pages[this.page].component;\n }\n this.on('subWizardsUpdated', function (subForm) {\n var subWizard = _this4.subWizards.find(function (subWizard) {\n var _subWizard$subForm;\n return (subForm === null || subForm === void 0 ? void 0 : subForm.id) && ((_subWizard$subForm = subWizard.subForm) === null || _subWizard$subForm === void 0 ? void 0 : _subWizard$subForm.id) === (subForm === null || subForm === void 0 ? void 0 : subForm.id);\n });\n if (_this4.subWizards.length && subWizard) {\n subWizard.subForm.setValue(subForm._submission, {}, true);\n _this4.establishPages();\n _this4.redraw();\n }\n });\n return onReady;\n }\n }, {\n key: \"wizardKey\",\n get: function get() {\n return \"wizard-\".concat(this.id);\n }\n }, {\n key: \"wizard\",\n get: function get() {\n return this.form;\n },\n set: function set(form) {\n this.setForm(form);\n }\n }, {\n key: \"buttons\",\n get: function get() {\n var _this5 = this;\n var buttons = {};\n [{\n name: 'cancel',\n method: 'cancel'\n }, {\n name: 'previous',\n method: 'prevPage'\n }, {\n name: 'next',\n method: 'nextPage'\n }, {\n name: 'submit',\n method: 'submit'\n }].forEach(function (button) {\n if (_this5.hasButton(button.name)) {\n buttons[button.name] = button;\n }\n });\n return buttons;\n }\n }, {\n key: \"buttonOrder\",\n get: function get() {\n var _this$options$propert, _this$options$propert2, _this$options$propert3;\n var defaultButtonOrder = ['cancel', 'previous', 'next', 'submit'];\n return (_this$options$propert = (_this$options$propert2 = this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : (_this$options$propert3 = _this$options$propert2.wizardButtonOrder) === null || _this$options$propert3 === void 0 ? void 0 : _this$options$propert3.toLowerCase().split(', ')) !== null && _this$options$propert !== void 0 ? _this$options$propert : defaultButtonOrder;\n }\n }, {\n key: \"renderContext\",\n get: function get() {\n var _this$root, _this$root$component;\n return {\n disableWizardSubmit: this.form.disableWizardSubmit,\n wizardKey: this.wizardKey,\n isBreadcrumbClickable: this.isBreadcrumbClickable(),\n isSubForm: !!this.parent && !((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$component = _this$root.component) !== null && _this$root$component !== void 0 && _this$root$component.type) === 'wizard',\n panels: this.allPages.length ? this.allPages.map(function (page) {\n return page.component;\n }) : this.pages.map(function (page) {\n return page.component;\n }),\n buttons: this.buttons,\n currentPage: this.page,\n buttonOrder: this.buttonOrder\n };\n }\n }, {\n key: \"prepareNavigationSettings\",\n value: function prepareNavigationSettings(ctx) {\n var currentPanel = this.currentPanel;\n if (currentPanel && currentPanel.buttonSettings) {\n Object.keys(currentPanel.buttonSettings).forEach(function () {\n Object.keys(ctx.buttons).forEach(function (key) {\n if (typeof currentPanel.buttonSettings[key] !== 'undefined' && !currentPanel.buttonSettings[key] || ctx.isSubForm) {\n ctx.buttons[key] = null;\n }\n });\n });\n }\n return this.renderTemplate('wizardNav', ctx);\n }\n }, {\n key: \"prepareHeaderSettings\",\n value: function prepareHeaderSettings(ctx, headerType) {\n if (this.currentPanel && this.currentPanel.breadcrumb === 'none' || ctx.isSubForm) {\n return null;\n }\n return this.renderTemplate(headerType, ctx);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this6 = this;\n var ctx = this.renderContext;\n if (this.component.key) {\n ctx.panels.map(function (panel) {\n if (panel.key === _this6.component.key) {\n _this6.currentPanel = panel;\n ctx.wizardPageTooltip = _this6.getFormattedTooltip(panel.tooltip);\n }\n });\n }\n var wizardNav = this.prepareNavigationSettings(ctx);\n var wizardHeaderType = \"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', ''));\n var wizardHeaderLocation = _lodash[\"default\"].get(this.form, 'settings.wizardHeaderLocation', 'left');\n var wizardHeader = this.prepareHeaderSettings(ctx, wizardHeaderType);\n return this.renderTemplate('wizard', _objectSpread(_objectSpread({}, ctx), {}, {\n className: _get(_getPrototypeOf(Wizard.prototype), \"getClassName\", this).call(this),\n wizardHeader: wizardHeader,\n wizardHeaderType: wizardHeaderType,\n wizardHeaderLocation: wizardHeaderLocation,\n wizardNav: wizardNav,\n components: this.renderComponents([].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)))\n }), this.builderMode ? 'builder' : 'form');\n }\n }, {\n key: \"redrawNavigation\",\n value: function redrawNavigation() {\n if (this.element) {\n var navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n if (navElement) {\n var _this$loadRefs;\n this.detachNav();\n navElement.outerHTML = this.renderTemplate('wizardNav', this.renderContext);\n navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n this.loadRefs(navElement, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _this$loadRefs));\n this.attachNav();\n }\n }\n }\n }, {\n key: \"redrawHeader\",\n value: function redrawHeader() {\n if (this.element) {\n var headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n if (headerElement) {\n var _this$loadRefs2;\n this.detachHeader();\n headerElement.outerHTML = this.renderTemplate(\"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', '')), this.renderContext);\n headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n this.loadRefs(headerElement, (_this$loadRefs2 = {}, _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs2));\n this.attachHeader();\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs3,\n _this7 = this;\n this.element = element;\n this.loadRefs(element, (_this$loadRefs3 = {}, _defineProperty(_this$loadRefs3, this.wizardKey, 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-header\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs3));\n if ((this.options.readOnly || this.editMode) && !this.enabledIndex) {\n var _this$pages2;\n this.enabledIndex = ((_this$pages2 = this.pages) === null || _this$pages2 === void 0 ? void 0 : _this$pages2.length) - 1;\n }\n this.hook('attachWebform', element, this);\n var promises = this.attachComponents(this.refs[this.wizardKey], [].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)));\n this.attachNav();\n this.attachHeader();\n return promises.then(function () {\n _this7.emit('render', {\n component: _this7.currentPage,\n page: _this7.page\n });\n if (_this7.component.scrollToTop) {\n _this7.scrollPageToTop();\n }\n });\n }\n }, {\n key: \"scrollPageToTop\",\n value: function scrollPageToTop() {\n var _this$refs;\n var pageTop = (_this$refs = this.refs[\"\".concat(this.wizardKey, \"-header\")]) !== null && _this$refs !== void 0 ? _this$refs : this.refs[this.wizardKey];\n if (!pageTop) {\n return;\n }\n if ('scrollIntoView' in pageTop) {\n pageTop.scrollIntoView(true);\n } else {\n this.scrollIntoView(pageTop);\n }\n }\n }, {\n key: \"isBreadcrumbClickable\",\n value: function isBreadcrumbClickable() {\n var _this8 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this8.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return this.isClickableDefined ? this.options.breadcrumbSettings.clickable : _lodash[\"default\"].get(currentPage, 'component.breadcrumbClickable', true);\n }\n }, {\n key: \"isAllowPrevious\",\n value: function isAllowPrevious() {\n var _this9 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this9.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return _lodash[\"default\"].get(currentPage.component, 'allowPrevious', this.options.allowPrevious);\n }\n }, {\n key: \"handleNaviageteOnEnter\",\n value: function handleNaviageteOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.next.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"handleSaveOnEnter\",\n value: function handleSaveOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.submit.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"attachNav\",\n value: function attachNav() {\n var _this10 = this;\n if (this.component.navigateOnEnter) {\n this.addEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.addEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n var buttonElement = _this10.refs[\"\".concat(_this10.wizardKey, \"-\").concat(button.name)];\n _this10.addEventListener(buttonElement, 'click', function (event) {\n event.preventDefault();\n\n // Disable the button until done.\n buttonElement.setAttribute('disabled', 'disabled');\n _this10.setLoading(buttonElement, true);\n\n // Call the button method, then re-enable the button.\n _this10[button.method]().then(function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n })[\"catch\"](function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n });\n });\n });\n }\n }, {\n key: \"emitWizardPageSelected\",\n value: function emitWizardPageSelected(index) {\n this.emit('wizardPageSelected', this.pages[index], index);\n }\n }, {\n key: \"attachHeader\",\n value: function attachHeader() {\n var _this11 = this;\n var isAllowPrevious = this.isAllowPrevious();\n this.attachTooltips(this.refs[\"\".concat(this.wizardKey, \"-tooltip\")], this.currentPanel.tooltip);\n if (this.isBreadcrumbClickable() || isAllowPrevious) {\n var _this$refs2;\n (_this$refs2 = this.refs[\"\".concat(this.wizardKey, \"-link\")]) === null || _this$refs2 === void 0 ? void 0 : _this$refs2.forEach(function (link, index) {\n if (!isAllowPrevious || index <= _this11.enabledIndex) {\n _this11.addEventListener(link, 'click', function (event) {\n _this11.emit('wizardNavigationClicked', _this11.pages[index]);\n event.preventDefault();\n return _this11.setPage(index).then(function () {\n _this11.emitWizardPageSelected(index);\n });\n });\n }\n });\n }\n }\n }, {\n key: \"detachNav\",\n value: function detachNav() {\n var _this12 = this;\n if (this.component.navigateOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n _this12.removeEventListener(_this12.refs[\"\".concat(_this12.wizardKey, \"-\").concat(button.name)], 'click');\n });\n }\n }, {\n key: \"detachHeader\",\n value: function detachHeader() {\n var _this13 = this;\n if (this.refs[\"\".concat(this.wizardKey, \"-link\")]) {\n this.refs[\"\".concat(this.wizardKey, \"-link\")].forEach(function (link) {\n _this13.removeEventListener(link, 'click');\n });\n }\n }\n }, {\n key: \"transformPages\",\n value: function transformPages() {\n var _this14 = this;\n var allComponents = [];\n var components = this.getSortedComponents(this);\n var defferedComponents = [];\n this.allPages = [];\n\n // Get all components including all nested components and line up in the correct order\n var getAllComponents = function getAllComponents(nestedComp, compsArr) {\n var pushAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var nestedPages = [];\n var dataArrayComponents = ['datagrid', 'editgrid', 'dynamicWizard'];\n var currentComponents = nestedComp !== null && nestedComp !== void 0 && nestedComp.subForm ? _this14.getSortedComponents(nestedComp.subForm) : (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.components) || [];\n var visibleComponents = currentComponents.filter(function (comp) {\n return comp._visible;\n });\n var filteredComponents = visibleComponents.filter(function (comp) {\n return !dataArrayComponents.includes(comp.component.type) && (comp.type !== 'form' || comp.isNestedWizard);\n });\n var additionalComponents = currentComponents.filter(function (comp) {\n var _comp$subForm;\n return ((_comp$subForm = comp.subForm) === null || _comp$subForm === void 0 ? void 0 : _comp$subForm._form.display) !== 'wizard';\n });\n var hasNested = false;\n (0, _utils.eachComponent)(filteredComponents, function (comp) {\n if (comp && comp.component) {\n if (comp.component.type === 'panel' && comp !== null && comp !== void 0 && comp.parent.wizard && !getAllComponents(comp, compsArr, false)) {\n if (pushAllowed) {\n _this14.setRootPanelId(comp);\n nestedPages.push(comp);\n }\n hasNested = true;\n }\n if (comp.isNestedWizard && comp.subForm) {\n var hasNestedForm = getAllComponents(comp, nestedPages, pushAllowed);\n if (!hasNested) {\n hasNested = hasNestedForm;\n }\n }\n }\n }, true);\n if (nestedComp.component.type === 'panel') {\n if (!hasNested && pushAllowed) {\n _this14.setRootPanelId(nestedComp);\n compsArr.push(nestedComp);\n }\n if (hasNested && additionalComponents.length) {\n var newComp = _lodash[\"default\"].clone(nestedComp);\n newComp.components = additionalComponents;\n _this14.setRootPanelId(newComp);\n defferedComponents.push(newComp);\n }\n }\n if (pushAllowed) {\n compsArr.push.apply(compsArr, _toConsumableArray(defferedComponents).concat(nestedPages));\n defferedComponents = [];\n }\n return hasNested;\n };\n components.forEach(function (component) {\n if (component.visible) {\n getAllComponents(component, allComponents);\n }\n }, []);\n\n // recalculate pages only for root wizards, including the situation when the wizard is in a wrapper\n if (this.localRoot && this.id === this.localRoot.id) {\n allComponents.forEach(function (comp, index) {\n comp.eachComponent(function (component) {\n component.page = index;\n });\n });\n }\n this.allPages = allComponents;\n }\n }, {\n key: \"getSortedComponents\",\n value: function getSortedComponents(_ref) {\n var components = _ref.components,\n originalComponents = _ref.originalComponents;\n // sorts components if they were shuffled after the conditional logic\n var currentComponents = [];\n var currentPages = [];\n if (components && components.length) {\n components.map(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n originalComponents === null || originalComponents === void 0 ? void 0 : originalComponents.forEach(function (item) {\n if (!item.key) {\n item.key = item.title;\n }\n if (currentPages[item.key]) {\n currentComponents.push(currentPages[item.key]);\n }\n });\n return currentComponents;\n }\n }, {\n key: \"findRootPanel\",\n value: function findRootPanel(component) {\n var _component$parent;\n return (_component$parent = component.parent) !== null && _component$parent !== void 0 && _component$parent.parent ? this.findRootPanel(component.parent) : component;\n }\n }, {\n key: \"setRootPanelId\",\n value: function setRootPanelId(component) {\n var _component$parent2;\n if (component.rootPanelId && component.rootPanelId !== component.id) {\n return;\n }\n var parent = (_component$parent2 = component.parent) !== null && _component$parent2 !== void 0 && _component$parent2.parent ? this.findRootPanel(component.parent) : component;\n component.rootPanelId = parent.id;\n }\n }, {\n key: \"establishPages\",\n value: function establishPages() {\n var _this15 = this;\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.data;\n this.pages = [];\n this.prefixComps = [];\n this.suffixComps = [];\n var visible = [];\n var currentPages = {};\n var pageOptions = _objectSpread(_objectSpread({}, _lodash[\"default\"].clone(this.options)), this.parent ? {\n root: this\n } : {});\n if (this.components && this.components.length) {\n this.components.forEach(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n if (this.originalComponents) {\n this.originalComponents.forEach(function (item) {\n if (item.type === 'panel') {\n if (!item.key) {\n item.key = item.title;\n }\n var page = currentPages[item.key];\n var forceShow = _this15.shouldForceShow(item);\n var forceHide = _this15.shouldForceHide(item);\n var isVisible = !page ? (0, _utils.checkCondition)(item, data, data, _this15.component, _this15) && !item.hidden : page.visible;\n if (forceShow) {\n isVisible = true;\n } else if (forceHide) {\n isVisible = false;\n }\n if (isVisible) {\n visible.push(item);\n if (page) {\n _this15.pages.push(page);\n }\n }\n if (!page && isVisible) {\n page = _this15.createComponent(item, pageOptions);\n page.visible = isVisible;\n _this15.pages.push(page);\n page.eachComponent(function (component) {\n component.page = _this15.pages.length - 1;\n });\n }\n } else if (item.type !== 'button') {\n if (!_this15.pages.length) {\n _this15.prefixComps.push(_this15.createComponent(item, pageOptions));\n } else {\n _this15.suffixComps.push(_this15.createComponent(item, pageOptions));\n }\n }\n });\n }\n if (this.pages.length) {\n this.emit('pagesChanged');\n }\n this.transformPages();\n if (this.allPages && this.allPages.length) {\n this.updatePages();\n }\n return visible;\n }\n }, {\n key: \"updatePages\",\n value: function updatePages() {\n this.pages = this.allPages;\n }\n }, {\n key: \"addComponents\",\n value: function addComponents() {\n this.establishPages();\n }\n }, {\n key: \"setPage\",\n value: function setPage(num) {\n var _this16 = this;\n if (num === this.page) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (num >= 0 && num < this.pages.length) {\n this.page = num;\n this.pageFieldLogic(num);\n this.getNextPage();\n var parentNum = num;\n if (this.hasExtraPages) {\n var pageFromPages = this.pages[num];\n var pageFromComponents = this.components[num];\n if (!pageFromComponents || (pageFromPages === null || pageFromPages === void 0 ? void 0 : pageFromPages.id) !== pageFromComponents.id) {\n parentNum = this.components.findIndex(function (comp) {\n var _this16$pages, _this16$pages$parentN;\n return comp.id === ((_this16$pages = _this16.pages) === null || _this16$pages === void 0 ? void 0 : (_this16$pages$parentN = _this16$pages[parentNum]) === null || _this16$pages$parentN === void 0 ? void 0 : _this16$pages$parentN.rootPanelId);\n });\n }\n }\n if (!this._seenPages.includes(parentNum)) {\n this._seenPages = this._seenPages.concat(parentNum);\n }\n this.redraw().then(function () {\n _this16.checkData(_this16.submission.data);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n } else if (!this.pages.length) {\n this.redraw();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return _nativePromiseOnly[\"default\"].reject('Page not found');\n }\n }, {\n key: \"pageFieldLogic\",\n value: function pageFieldLogic(page) {\n var _this$pages3;\n if ((_this$pages3 = this.pages) !== null && _this$pages3 !== void 0 && _this$pages3[page]) {\n // Handle field logic on pages.\n this.component = this.pages[page].component;\n this.originalComponent = (0, _utils.fastCloneDeep)(this.component);\n this.fieldLogic(this.data);\n // If disabled changed, be sure to distribute the setting.\n this.disabled = this.shouldDisabled;\n }\n }\n }, {\n key: \"currentPage\",\n get: function get() {\n return this.pages && this.pages.length >= this.page ? this.pages[this.page] : {\n components: []\n };\n }\n }, {\n key: \"getNextPage\",\n value: function getNextPage() {\n var _this$pages4;\n if ((_this$pages4 = this.pages) !== null && _this$pages4 !== void 0 && _this$pages4[this.page]) {\n var data = this.submission.data;\n var form = this.pages[this.page].component;\n // Check conditional nextPage\n if (form) {\n var page = this.pages.length > this.page + 1 && !this.showAllErrors ? this.page + 1 : -1;\n if (form.nextPage) {\n var next = this.evaluate(form.nextPage, {\n next: page,\n data: data,\n page: page,\n form: form\n }, 'next');\n if (next === null) {\n this.currentNextPage = null;\n return null;\n }\n var pageNum = parseInt(next, 10);\n if (!isNaN(parseInt(pageNum, 10)) && isFinite(pageNum)) {\n this.currentNextPage = pageNum;\n return pageNum;\n }\n this.currentNextPage = this.getPageIndexByKey(next);\n return this.currentNextPage;\n }\n this.currentNextPage = page;\n return page;\n }\n this.currentNextPage = null;\n }\n return null;\n }\n }, {\n key: \"getPreviousPage\",\n value: function getPreviousPage() {\n return this.page - 1;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var pages = this.getPages();\n return _nativePromiseOnly[\"default\"].all(pages.map(function (page) {\n page.options.beforeSubmit = true;\n return page.beforeSubmit();\n }));\n }\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this17 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this17.hook(next ? 'beforeNext' : 'beforePrev', _this17.currentPage, _this17.submission, function (err) {\n if (err) {\n _this17.showErrors(err, true);\n reject(err);\n }\n var form = _this17.currentPage;\n if (form) {\n form.beforePage(next).then(resolve)[\"catch\"](reject);\n } else {\n resolve();\n }\n });\n });\n }\n }, {\n key: \"emitNextPage\",\n value: function emitNextPage() {\n this.emit('nextPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"nextPage\",\n value: function nextPage() {\n var _this18 = this;\n // Read-only forms should not worry about validation before going to next page, nor should they submit.\n if (this.options.readOnly) {\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n _this18.emitNextPage();\n });\n });\n }\n\n // Validate the form, before go to the next page\n if (this.checkValidity(this.localData, true, this.localData, true)) {\n this.checkData(this.submission.data);\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n if (!(_this18.options.readOnly || _this18.editMode) && _this18.enabledIndex < _this18.page) {\n _this18.enabledIndex = _this18.page;\n _this18.redraw();\n }\n _this18.emitNextPage();\n });\n });\n } else {\n this.currentPage.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n this.scrollIntoView(this.element);\n return _nativePromiseOnly[\"default\"].reject(this.showErrors([], true));\n }\n }\n }, {\n key: \"emitPrevPage\",\n value: function emitPrevPage() {\n this.emit('prevPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"prevPage\",\n value: function prevPage() {\n var _this19 = this;\n return this.beforePage().then(function () {\n return _this19.setPage(_this19.getPreviousPage()).then(function () {\n _this19.emitPrevPage();\n });\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var _this20 = this;\n if (this.options.readOnly) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (_get(_getPrototypeOf(Wizard.prototype), \"cancel\", this).call(this, noconfirm)) {\n this.setPristine(true);\n return this.setPage(0).then(function () {\n if (_this20.enabledIndex) {\n _this20.enabledIndex = 0;\n }\n _this20.onChange({\n resetValue: true\n });\n _this20.redraw();\n return _this20.page;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"getPageIndexByKey\",\n value: function getPageIndexByKey(key) {\n var pageIndex = this.page;\n this.pages.forEach(function (page, index) {\n if (page.component.key === key) {\n pageIndex = index;\n return false;\n }\n });\n return pageIndex;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.wizard;\n }\n }, {\n key: \"setComponentSchema\",\n value: function setComponentSchema() {\n var _this21 = this;\n var pageKeys = {};\n this.originalComponents = [];\n this.component.components.map(function (item) {\n if (item.type === 'panel') {\n item.key = (0, _utils.uniqueKey)(pageKeys, item.key || 'panel');\n pageKeys[item.key] = true;\n if (_this21.wizard.full) {\n _this21.options.show = _this21.options.show || {};\n _this21.options.show[item.key] = true;\n } else if (_this21.wizard.hasOwnProperty('full') && !_lodash[\"default\"].isEqual(_this21.originalOptions.show, _this21.options.show)) {\n _this21.options.show = _objectSpread({}, _this21.originalOptions.show || {});\n }\n }\n _this21.originalComponents.push(_lodash[\"default\"].clone(item));\n });\n if (!Object.keys(pageKeys).length) {\n var newPage = {\n type: 'panel',\n title: 'Page 1',\n label: 'Page 1',\n key: 'page1',\n components: this.component.components\n };\n this.component.components = [newPage];\n this.originalComponents.push(_lodash[\"default\"].clone(newPage));\n }\n }\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n if (!form) {\n return;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"setForm\", this).call(this, form, flags);\n }\n }, {\n key: \"onSetForm\",\n value: function onSetForm(clonedForm, initialForm) {\n this.component.components = (this._parentPath ? initialForm.components : clonedForm.components) || [];\n this.setComponentSchema();\n }\n }, {\n key: \"setEditMode\",\n value: function setEditMode(submission) {\n if (!this.editMode && submission._id && !this.options.readOnly) {\n this.editMode = true;\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this22 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ignoreEstablishment = arguments.length > 2 ? arguments[2] : undefined;\n var changed = this.getPages({\n all: true\n }).reduce(function (changed, page) {\n return _this22.setNestedValue(page, submission.data, flags, changed) || changed;\n }, false);\n this.mergeData(this.data, submission.data);\n if (changed) {\n this.pageFieldLogic(this.page);\n }\n submission.data = this.data;\n this._submission = submission;\n if (!ignoreEstablishment) {\n this.establishPages(submission.data);\n }\n this.setEditMode(submission);\n return changed;\n }\n }, {\n key: \"isClickable\",\n value: function isClickable(page, index) {\n return this.page !== index && (0, _utils.firstNonNil)([_lodash[\"default\"].get(page, 'breadcrumbClickable'), this.options.breadcrumbSettings.clickable]);\n }\n }, {\n key: \"hasButton\",\n value: function hasButton(name) {\n var nextPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getNextPage();\n // get page options with global options as default values\n var _$get = _lodash[\"default\"].get(this.currentPage, 'component.buttonSettings', {}),\n _$get$previous = _$get.previous,\n previous = _$get$previous === void 0 ? this.options.buttonSettings.showPrevious : _$get$previous,\n _$get$cancel = _$get.cancel,\n cancel = _$get$cancel === void 0 ? this.options.buttonSettings.showCancel : _$get$cancel,\n _$get$submit = _$get.submit,\n submit = _$get$submit === void 0 ? this.options.buttonSettings.showSubmit : _$get$submit,\n _$get$next = _$get.next,\n next = _$get$next === void 0 ? this.options.buttonSettings.showNext : _$get$next;\n switch (name) {\n case 'previous':\n return previous && this.getPreviousPage() > -1;\n case 'next':\n return next && nextPage !== null && nextPage !== -1;\n case 'cancel':\n return cancel && !this.options.readOnly;\n case 'submit':\n return submit && !this.options.readOnly && (nextPage === null || this.page === this.pages.length - 1);\n default:\n return true;\n }\n }\n }, {\n key: \"pageId\",\n value: function pageId(page) {\n if (page.key) {\n // Some panels have the same key....\n return \"\".concat(page.key, \"-\").concat(page.title);\n } else if (page.components && page.components.length > 0) {\n return this.pageId(page.components[0]);\n } else {\n return page.title;\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n var _this23 = this;\n _get(_getPrototypeOf(Wizard.prototype), \"onChange\", this).call(this, flags, changed, modified, changes);\n if (this.alert && !this.submitted) {\n this.checkValidity(this.localData, false, this.localData, true);\n this.showErrors([], true, true);\n }\n\n // If the pages change, need to redraw the header.\n var currentPanels;\n var panels;\n var currentNextPage = this.currentNextPage;\n if (this.hasExtraPages) {\n currentPanels = this.pages.map(function (page) {\n return page.component.key;\n });\n this.establishPages();\n panels = this.pages.map(function (page) {\n return page.component.key;\n });\n } else {\n var _this$currentPanel, _this$currentPanels;\n currentPanels = this.currentPanels || this.pages.map(function (page) {\n return page.component.key;\n });\n panels = this.establishPages().map(function (panel) {\n return panel.key;\n });\n this.currentPanels = panels;\n if ((_this$currentPanel = this.currentPanel) !== null && _this$currentPanel !== void 0 && _this$currentPanel.key && (_this$currentPanels = this.currentPanels) !== null && _this$currentPanels !== void 0 && _this$currentPanels.length) {\n this.setPage(this.currentPanels.findIndex(function (panel) {\n return panel === _this23.currentPanel.key;\n }));\n }\n }\n if (!_lodash[\"default\"].isEqual(panels, currentPanels) || flags && flags.fromSubmission) {\n this.redrawHeader();\n }\n\n // If the next page changes, then make sure to redraw navigation.\n if (currentNextPage !== this.getNextPage()) {\n this.redrawNavigation();\n }\n if (this.options.readOnly && (this.prefixComps.length || this.suffixComps.length)) {\n this.redraw();\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this$parent, _this$parent$componen;\n if ((_this$parent = this.parent) !== null && _this$parent !== void 0 && (_this$parent$componen = _this$parent.component) !== null && _this$parent$componen !== void 0 && _this$parent$componen.modalEdit) {\n return this.parent.redraw();\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n var _this24 = this;\n var currentPage = this.page;\n var setCurrentPage = function setCurrentPage() {\n return _this24.setPage(currentPage);\n };\n return _get(_getPrototypeOf(Wizard.prototype), \"rebuild\", this).call(this).then(setCurrentPage);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, currentPageOnly) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var components = !currentPageOnly || this.isLastPage() ? this.getComponents() : this.currentPage.components;\n return components.reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row) && check;\n }, true);\n }\n }, {\n key: \"errors\",\n get: function get() {\n if (!this.isLastPage()) {\n return this.currentPage.errors;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"errors\", this);\n }\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n var _this25 = this;\n var pageIndex = 0;\n var _this$pages$filter = this.pages.filter(function (page, index) {\n var hasComponent = false;\n page.getComponent(key, function (comp) {\n if (comp.path === key) {\n pageIndex = index;\n hasComponent = true;\n }\n });\n return hasComponent;\n }),\n _this$pages$filter2 = _slicedToArray(_this$pages$filter, 1),\n page = _this$pages$filter2[0];\n if (page && page !== this.currentPage) {\n return this.setPage(pageIndex).then(function () {\n _this25.checkValidity(_this25.submission.data, true, _this25.submission.data);\n _this25.showErrors();\n _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", _this25).call(_this25, key);\n });\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", this).call(this, key);\n }\n }]);\n return Wizard;\n}(_Webform2[\"default\"]);\nexports[\"default\"] = Wizard;\nWizard.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWizard.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWizard.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Wizard.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Webform2 = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Wizard = /*#__PURE__*/function (_Webform) {\n _inherits(Wizard, _Webform);\n var _super = _createSuper(Wizard);\n /**\n * Constructor for wizard based forms\n * @param element Dom element to place this wizard.\n * @param {Object} options Options object, supported options are:\n * - breadcrumbSettings.clickable: true (default) determines if the breadcrumb bar is clickable or not\n * - buttonSettings.show*(Previous, Next, Cancel): true (default) determines if the button is shown or not\n * - allowPrevious: false (default) determines if the breadcrumb bar is clickable or not for visited tabs\n */\n function Wizard() {\n var _this;\n _classCallCheck(this, Wizard);\n var element, options;\n if (arguments[0] instanceof HTMLElement || arguments[1]) {\n element = arguments[0];\n options = arguments[1] || {};\n } else {\n options = arguments[0] || {};\n }\n options.display = 'wizard';\n _this = _super.call(this, element, options);\n _this.pages = [];\n _this.prefixComps = [];\n _this.suffixComps = [];\n _this.components = [];\n _this.originalComponents = [];\n _this.page = 0;\n _this.currentPanel = null;\n _this.currentPanels = null;\n _this.currentNextPage = 0;\n _this._seenPages = [0];\n _this.subWizards = [];\n _this.allPages = [];\n _this.lastPromise = _nativePromiseOnly[\"default\"].resolve();\n _this.enabledIndex = 0;\n _this.editMode = false;\n _this.originalOptions = _lodash[\"default\"].cloneDeep(_this.options);\n return _this;\n }\n _createClass(Wizard, [{\n key: \"isLastPage\",\n value: function isLastPage() {\n var next = this.getNextPage();\n if (_lodash[\"default\"].isNumber(next)) {\n return next === -1;\n }\n return _lodash[\"default\"].isNull(next);\n }\n }, {\n key: \"getPages\",\n value: function getPages() {\n var _this2 = this;\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _args$all = args.all,\n all = _args$all === void 0 ? false : _args$all;\n var pages = this.hasExtraPages ? this.components : this.pages;\n var filteredPages = pages.filter(all ? _lodash[\"default\"].identity : function (p, index) {\n return _this2._seenPages.includes(index);\n });\n return filteredPages;\n }\n }, {\n key: \"hasExtraPages\",\n get: function get() {\n return !_lodash[\"default\"].isEmpty(this.subWizards);\n }\n }, {\n key: \"data\",\n get: function get() {\n return _get(_getPrototypeOf(Wizard.prototype), \"data\", this);\n },\n set: function set(value) {\n var _this3 = this;\n this._data = value;\n _lodash[\"default\"].each(this.getPages({\n all: true\n }), function (component) {\n component.data = _this3.componentContext(component);\n });\n }\n }, {\n key: \"localData\",\n get: function get() {\n var _this$pages$this$page, _this$pages$this$page2;\n return ((_this$pages$this$page = this.pages[this.page]) === null || _this$pages$this$page === void 0 ? void 0 : (_this$pages$this$page2 = _this$pages$this$page.root) === null || _this$pages$this$page2 === void 0 ? void 0 : _this$pages$this$page2.submission.data) || this.submission.data;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var visible = _get(_getPrototypeOf(Wizard.prototype), \"checkConditions\", this).call(this, data, flags, row);\n this.establishPages(data);\n return visible;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.submitting ? this.getPages({\n all: this.isLastPage()\n }) : _get(_getPrototypeOf(Wizard.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.getPages({\n all: true\n }).forEach(function (page) {\n return page.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$pages,\n _this4 = this;\n // Check for and initlize button settings object\n this.options.buttonSettings = _lodash[\"default\"].defaults(this.options.buttonSettings, {\n showPrevious: true,\n showNext: true,\n showSubmit: true,\n showCancel: !this.options.readOnly\n });\n if (!this.isSecondInit) {\n var _this$options, _this$options$breadcr;\n this.isClickableDefined = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : (_this$options$breadcr = _this$options.breadcrumbSettings) === null || _this$options$breadcr === void 0 ? void 0 : _this$options$breadcr.hasOwnProperty('clickable');\n this.isSecondInit = true;\n }\n this.options.breadcrumbSettings = _lodash[\"default\"].defaults(this.options.breadcrumbSettings, {\n clickable: true\n });\n this.options.allowPrevious = this.options.allowPrevious || false;\n this.page = 0;\n var onReady = _get(_getPrototypeOf(Wizard.prototype), \"init\", this).call(this);\n this.setComponentSchema();\n if ((_this$pages = this.pages) !== null && _this$pages !== void 0 && _this$pages[this.page]) {\n this.component = this.pages[this.page].component;\n }\n this.on('subWizardsUpdated', function (subForm) {\n var subWizard = _this4.subWizards.find(function (subWizard) {\n var _subWizard$subForm;\n return (subForm === null || subForm === void 0 ? void 0 : subForm.id) && ((_subWizard$subForm = subWizard.subForm) === null || _subWizard$subForm === void 0 ? void 0 : _subWizard$subForm.id) === (subForm === null || subForm === void 0 ? void 0 : subForm.id);\n });\n if (_this4.subWizards.length && subWizard) {\n subWizard.subForm.setValue(subForm._submission, {}, true);\n _this4.establishPages();\n _this4.redraw();\n }\n });\n return onReady;\n }\n }, {\n key: \"wizardKey\",\n get: function get() {\n return \"wizard-\".concat(this.id);\n }\n }, {\n key: \"wizard\",\n get: function get() {\n return this.form;\n },\n set: function set(form) {\n this.setForm(form);\n }\n }, {\n key: \"buttons\",\n get: function get() {\n var _this5 = this;\n var buttons = {};\n [{\n name: 'cancel',\n method: 'cancel'\n }, {\n name: 'previous',\n method: 'prevPage'\n }, {\n name: 'next',\n method: 'nextPage'\n }, {\n name: 'submit',\n method: 'submit'\n }].forEach(function (button) {\n if (_this5.hasButton(button.name)) {\n buttons[button.name] = button;\n }\n });\n return buttons;\n }\n }, {\n key: \"buttonOrder\",\n get: function get() {\n var _this$options$propert, _this$options$propert2, _this$options$propert3;\n var defaultButtonOrder = ['cancel', 'previous', 'next', 'submit'];\n return (_this$options$propert = (_this$options$propert2 = this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : (_this$options$propert3 = _this$options$propert2.wizardButtonOrder) === null || _this$options$propert3 === void 0 ? void 0 : _this$options$propert3.toLowerCase().split(', ')) !== null && _this$options$propert !== void 0 ? _this$options$propert : defaultButtonOrder;\n }\n }, {\n key: \"renderContext\",\n get: function get() {\n var _this$root, _this$root$component;\n return {\n disableWizardSubmit: this.form.disableWizardSubmit,\n wizardKey: this.wizardKey,\n isBreadcrumbClickable: this.isBreadcrumbClickable(),\n isSubForm: !!this.parent && !((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$component = _this$root.component) !== null && _this$root$component !== void 0 && _this$root$component.type) === 'wizard',\n panels: this.allPages.length ? this.allPages.map(function (page) {\n return page.component;\n }) : this.pages.map(function (page) {\n return page.component;\n }),\n buttons: this.buttons,\n currentPage: this.page,\n buttonOrder: this.buttonOrder\n };\n }\n }, {\n key: \"prepareNavigationSettings\",\n value: function prepareNavigationSettings(ctx) {\n var currentPanel = this.currentPanel;\n if (currentPanel && currentPanel.buttonSettings) {\n Object.keys(currentPanel.buttonSettings).forEach(function () {\n Object.keys(ctx.buttons).forEach(function (key) {\n if (typeof currentPanel.buttonSettings[key] !== 'undefined' && !currentPanel.buttonSettings[key] || ctx.isSubForm) {\n ctx.buttons[key] = null;\n }\n });\n });\n }\n return this.renderTemplate('wizardNav', ctx);\n }\n }, {\n key: \"prepareHeaderSettings\",\n value: function prepareHeaderSettings(ctx, headerType) {\n if (this.currentPanel && this.currentPanel.breadcrumb === 'none' || ctx.isSubForm) {\n return null;\n }\n return this.renderTemplate(headerType, ctx);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this6 = this;\n var ctx = this.renderContext;\n if (this.component.key) {\n ctx.panels.map(function (panel) {\n if (panel.key === _this6.component.key) {\n _this6.currentPanel = panel;\n ctx.wizardPageTooltip = _this6.getFormattedTooltip(panel.tooltip);\n }\n });\n }\n var wizardNav = this.prepareNavigationSettings(ctx);\n var wizardHeaderType = \"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', ''));\n var wizardHeaderLocation = _lodash[\"default\"].get(this.form, 'settings.wizardHeaderLocation', 'left');\n var wizardHeader = this.prepareHeaderSettings(ctx, wizardHeaderType);\n return this.renderTemplate('wizard', _objectSpread(_objectSpread({}, ctx), {}, {\n className: _get(_getPrototypeOf(Wizard.prototype), \"getClassName\", this).call(this),\n wizardHeader: wizardHeader,\n wizardHeaderType: wizardHeaderType,\n wizardHeaderLocation: wizardHeaderLocation,\n wizardNav: wizardNav,\n components: this.renderComponents([].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)))\n }), this.builderMode ? 'builder' : 'form');\n }\n }, {\n key: \"redrawNavigation\",\n value: function redrawNavigation() {\n if (this.element) {\n var navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n if (navElement) {\n var _this$loadRefs;\n this.detachNav();\n navElement.outerHTML = this.renderTemplate('wizardNav', this.renderContext);\n navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n this.loadRefs(navElement, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _this$loadRefs));\n this.attachNav();\n }\n }\n }\n }, {\n key: \"redrawHeader\",\n value: function redrawHeader() {\n if (this.element) {\n var headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n if (headerElement) {\n var _this$loadRefs2;\n this.detachHeader();\n headerElement.outerHTML = this.renderTemplate(\"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', '')), this.renderContext);\n headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n this.loadRefs(headerElement, (_this$loadRefs2 = {}, _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs2));\n this.attachHeader();\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs3,\n _this7 = this;\n this.element = element;\n this.loadRefs(element, (_this$loadRefs3 = {}, _defineProperty(_this$loadRefs3, this.wizardKey, 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-header\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs3));\n if ((this.options.readOnly || this.editMode) && !this.enabledIndex) {\n var _this$pages2;\n this.enabledIndex = ((_this$pages2 = this.pages) === null || _this$pages2 === void 0 ? void 0 : _this$pages2.length) - 1;\n }\n this.hook('attachWebform', element, this);\n var promises = this.attachComponents(this.refs[this.wizardKey], [].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)));\n this.attachNav();\n this.attachHeader();\n return promises.then(function () {\n _this7.emit('render', {\n component: _this7.currentPage,\n page: _this7.page\n });\n if (_this7.component.scrollToTop) {\n _this7.scrollPageToTop();\n }\n });\n }\n }, {\n key: \"scrollPageToTop\",\n value: function scrollPageToTop() {\n var _this$refs;\n var pageTop = (_this$refs = this.refs[\"\".concat(this.wizardKey, \"-header\")]) !== null && _this$refs !== void 0 ? _this$refs : this.refs[this.wizardKey];\n if (!pageTop) {\n return;\n }\n if ('scrollIntoView' in pageTop) {\n pageTop.scrollIntoView(true);\n } else {\n this.scrollIntoView(pageTop);\n }\n }\n }, {\n key: \"isBreadcrumbClickable\",\n value: function isBreadcrumbClickable() {\n var _this8 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this8.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return this.isClickableDefined ? this.options.breadcrumbSettings.clickable : _lodash[\"default\"].get(currentPage, 'component.breadcrumbClickable', true);\n }\n }, {\n key: \"isAllowPrevious\",\n value: function isAllowPrevious() {\n var _this9 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this9.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return _lodash[\"default\"].get(currentPage.component, 'allowPrevious', this.options.allowPrevious);\n }\n }, {\n key: \"handleNaviageteOnEnter\",\n value: function handleNaviageteOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.next.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"handleSaveOnEnter\",\n value: function handleSaveOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.submit.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"attachNav\",\n value: function attachNav() {\n var _this10 = this;\n if (this.component.navigateOnEnter) {\n this.addEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.addEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n var buttonElement = _this10.refs[\"\".concat(_this10.wizardKey, \"-\").concat(button.name)];\n _this10.addEventListener(buttonElement, 'click', function (event) {\n event.preventDefault();\n\n // Disable the button until done.\n buttonElement.setAttribute('disabled', 'disabled');\n _this10.setLoading(buttonElement, true);\n\n // Call the button method, then re-enable the button.\n _this10[button.method]().then(function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n })[\"catch\"](function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n });\n });\n });\n }\n }, {\n key: \"emitWizardPageSelected\",\n value: function emitWizardPageSelected(index) {\n this.emit('wizardPageSelected', this.pages[index], index);\n }\n }, {\n key: \"attachHeader\",\n value: function attachHeader() {\n var _this11 = this;\n var isAllowPrevious = this.isAllowPrevious();\n this.attachTooltips(this.refs[\"\".concat(this.wizardKey, \"-tooltip\")], this.currentPanel.tooltip);\n if (this.isBreadcrumbClickable() || isAllowPrevious) {\n var _this$refs2;\n (_this$refs2 = this.refs[\"\".concat(this.wizardKey, \"-link\")]) === null || _this$refs2 === void 0 ? void 0 : _this$refs2.forEach(function (link, index) {\n if (!isAllowPrevious || index <= _this11.enabledIndex) {\n _this11.addEventListener(link, 'click', function (event) {\n _this11.emit('wizardNavigationClicked', _this11.pages[index]);\n event.preventDefault();\n return _this11.setPage(index).then(function () {\n _this11.emitWizardPageSelected(index);\n });\n });\n }\n });\n }\n }\n }, {\n key: \"detachNav\",\n value: function detachNav() {\n var _this12 = this;\n if (this.component.navigateOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n _this12.removeEventListener(_this12.refs[\"\".concat(_this12.wizardKey, \"-\").concat(button.name)], 'click');\n });\n }\n }, {\n key: \"detachHeader\",\n value: function detachHeader() {\n var _this13 = this;\n if (this.refs[\"\".concat(this.wizardKey, \"-link\")]) {\n this.refs[\"\".concat(this.wizardKey, \"-link\")].forEach(function (link) {\n _this13.removeEventListener(link, 'click');\n });\n }\n }\n }, {\n key: \"transformPages\",\n value: function transformPages() {\n var _this14 = this;\n var allComponents = [];\n var components = this.getSortedComponents(this);\n var defferedComponents = [];\n this.allPages = [];\n\n // Get all components including all nested components and line up in the correct order\n var getAllComponents = function getAllComponents(nestedComp, compsArr) {\n var pushAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var nestedPages = [];\n var dataArrayComponents = ['datagrid', 'editgrid', 'dynamicWizard'];\n var currentComponents = nestedComp !== null && nestedComp !== void 0 && nestedComp.subForm ? _this14.getSortedComponents(nestedComp.subForm) : (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.components) || [];\n var visibleComponents = currentComponents.filter(function (comp) {\n return comp._visible;\n });\n var filteredComponents = visibleComponents.filter(function (comp) {\n return !dataArrayComponents.includes(comp.component.type) && (comp.type !== 'form' || comp.isNestedWizard);\n });\n var additionalComponents = currentComponents.filter(function (comp) {\n var _comp$subForm;\n return ((_comp$subForm = comp.subForm) === null || _comp$subForm === void 0 ? void 0 : _comp$subForm._form.display) !== 'wizard';\n });\n var hasNested = false;\n (0, _utils.eachComponent)(filteredComponents, function (comp) {\n if (comp && comp.component) {\n if (comp.component.type === 'panel' && comp !== null && comp !== void 0 && comp.parent.wizard && !getAllComponents(comp, compsArr, false)) {\n if (pushAllowed) {\n _this14.setRootPanelId(comp);\n nestedPages.push(comp);\n }\n hasNested = true;\n }\n if (comp.isNestedWizard && comp.subForm) {\n var hasNestedForm = getAllComponents(comp, nestedPages, pushAllowed);\n if (!hasNested) {\n hasNested = hasNestedForm;\n }\n }\n }\n }, true);\n if (nestedComp.component.type === 'panel') {\n if (!hasNested && pushAllowed) {\n _this14.setRootPanelId(nestedComp);\n compsArr.push(nestedComp);\n }\n if (hasNested && additionalComponents.length) {\n var newComp = _lodash[\"default\"].clone(nestedComp);\n newComp.components = additionalComponents;\n _this14.setRootPanelId(newComp);\n defferedComponents.push(newComp);\n }\n }\n if (pushAllowed) {\n compsArr.push.apply(compsArr, _toConsumableArray(defferedComponents).concat(nestedPages));\n defferedComponents = [];\n }\n return hasNested;\n };\n components.forEach(function (component) {\n if (component.visible) {\n getAllComponents(component, allComponents);\n }\n }, []);\n\n // recalculate pages only for root wizards, including the situation when the wizard is in a wrapper\n if (this.localRoot && this.id === this.localRoot.id) {\n allComponents.forEach(function (comp, index) {\n comp.eachComponent(function (component) {\n component.page = index;\n });\n });\n }\n this.allPages = allComponents;\n }\n }, {\n key: \"getSortedComponents\",\n value: function getSortedComponents(_ref) {\n var components = _ref.components,\n originalComponents = _ref.originalComponents;\n // sorts components if they were shuffled after the conditional logic\n var currentComponents = [];\n var currentPages = [];\n if (components && components.length) {\n components.map(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n originalComponents === null || originalComponents === void 0 ? void 0 : originalComponents.forEach(function (item) {\n if (!item.key) {\n item.key = item.title;\n }\n if (currentPages[item.key]) {\n currentComponents.push(currentPages[item.key]);\n }\n });\n return currentComponents;\n }\n }, {\n key: \"findRootPanel\",\n value: function findRootPanel(component) {\n var _component$parent;\n return (_component$parent = component.parent) !== null && _component$parent !== void 0 && _component$parent.parent ? this.findRootPanel(component.parent) : component;\n }\n }, {\n key: \"setRootPanelId\",\n value: function setRootPanelId(component) {\n var _component$parent2;\n if (component.rootPanelId && component.rootPanelId !== component.id) {\n return;\n }\n var parent = (_component$parent2 = component.parent) !== null && _component$parent2 !== void 0 && _component$parent2.parent ? this.findRootPanel(component.parent) : component;\n component.rootPanelId = parent.id;\n }\n }, {\n key: \"establishPages\",\n value: function establishPages() {\n var _this15 = this;\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.data;\n this.pages = [];\n this.prefixComps = [];\n this.suffixComps = [];\n var visible = [];\n var currentPages = {};\n var pageOptions = _objectSpread(_objectSpread({}, _lodash[\"default\"].clone(this.options)), this.parent ? {\n root: this\n } : {});\n if (this.components && this.components.length) {\n this.components.forEach(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n if (this.originalComponents) {\n this.originalComponents.forEach(function (item) {\n if (item.type === 'panel') {\n if (!item.key) {\n item.key = item.title;\n }\n var page = currentPages[item.key];\n var forceShow = _this15.shouldForceShow(item);\n var forceHide = _this15.shouldForceHide(item);\n var isVisible = !page ? (0, _utils.checkCondition)(item, data, data, _this15.component, _this15) && !item.hidden : page.visible;\n if (forceShow) {\n isVisible = true;\n } else if (forceHide) {\n isVisible = false;\n }\n if (isVisible) {\n visible.push(item);\n if (page) {\n _this15.pages.push(page);\n }\n }\n if (!page && isVisible) {\n page = _this15.createComponent(item, pageOptions);\n page.visible = isVisible;\n _this15.pages.push(page);\n page.eachComponent(function (component) {\n component.page = _this15.pages.length - 1;\n });\n }\n } else if (item.type !== 'button') {\n if (!_this15.pages.length) {\n _this15.prefixComps.push(_this15.createComponent(item, pageOptions));\n } else {\n _this15.suffixComps.push(_this15.createComponent(item, pageOptions));\n }\n }\n });\n }\n if (this.pages.length) {\n this.emit('pagesChanged');\n }\n this.transformPages();\n if (this.allPages && this.allPages.length) {\n this.updatePages();\n }\n return visible;\n }\n }, {\n key: \"updatePages\",\n value: function updatePages() {\n this.pages = this.allPages;\n }\n }, {\n key: \"addComponents\",\n value: function addComponents() {\n this.establishPages();\n }\n }, {\n key: \"setPage\",\n value: function setPage(num) {\n var _this16 = this;\n if (num === this.page) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (num >= 0 && num < this.pages.length) {\n this.page = num;\n this.pageFieldLogic(num);\n this.getNextPage();\n var parentNum = num;\n if (this.hasExtraPages) {\n var pageFromPages = this.pages[num];\n var pageFromComponents = this.components[num];\n if (!pageFromComponents || (pageFromPages === null || pageFromPages === void 0 ? void 0 : pageFromPages.id) !== pageFromComponents.id) {\n parentNum = this.components.findIndex(function (comp) {\n var _this16$pages, _this16$pages$parentN;\n return comp.id === ((_this16$pages = _this16.pages) === null || _this16$pages === void 0 ? void 0 : (_this16$pages$parentN = _this16$pages[parentNum]) === null || _this16$pages$parentN === void 0 ? void 0 : _this16$pages$parentN.rootPanelId);\n });\n }\n }\n if (!this._seenPages.includes(parentNum)) {\n this._seenPages = this._seenPages.concat(parentNum);\n }\n this.redraw().then(function () {\n _this16.checkData(_this16.submission.data);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n } else if (!this.pages.length) {\n this.redraw();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return _nativePromiseOnly[\"default\"].reject('Page not found');\n }\n }, {\n key: \"pageFieldLogic\",\n value: function pageFieldLogic(page) {\n var _this$pages3;\n if ((_this$pages3 = this.pages) !== null && _this$pages3 !== void 0 && _this$pages3[page]) {\n // Handle field logic on pages.\n this.component = this.pages[page].component;\n this.originalComponent = (0, _utils.fastCloneDeep)(this.component);\n this.fieldLogic(this.data);\n // If disabled changed, be sure to distribute the setting.\n this.disabled = this.shouldDisabled;\n }\n }\n }, {\n key: \"currentPage\",\n get: function get() {\n return this.pages && this.pages.length >= this.page ? this.pages[this.page] : {\n components: []\n };\n }\n }, {\n key: \"getNextPage\",\n value: function getNextPage() {\n var _this$pages4;\n if ((_this$pages4 = this.pages) !== null && _this$pages4 !== void 0 && _this$pages4[this.page]) {\n var data = this.submission.data;\n var form = this.pages[this.page].component;\n // Check conditional nextPage\n if (form) {\n var page = this.pages.length > this.page + 1 && !this.showAllErrors ? this.page + 1 : -1;\n if (form.nextPage) {\n var next = this.evaluate(form.nextPage, {\n next: page,\n data: data,\n page: page,\n form: form\n }, 'next');\n if (next === null) {\n this.currentNextPage = null;\n return null;\n }\n var pageNum = parseInt(next, 10);\n if (!isNaN(parseInt(pageNum, 10)) && isFinite(pageNum)) {\n this.currentNextPage = pageNum;\n return pageNum;\n }\n this.currentNextPage = this.getPageIndexByKey(next);\n return this.currentNextPage;\n }\n this.currentNextPage = page;\n return page;\n }\n this.currentNextPage = null;\n }\n return null;\n }\n }, {\n key: \"getPreviousPage\",\n value: function getPreviousPage() {\n return this.page - 1;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var pages = this.getPages();\n return _nativePromiseOnly[\"default\"].all(pages.map(function (page) {\n page.options.beforeSubmit = true;\n return page.beforeSubmit();\n }));\n }\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this17 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this17.hook(next ? 'beforeNext' : 'beforePrev', _this17.currentPage, _this17.submission, function (err) {\n if (err) {\n _this17.showErrors(err, true);\n reject(err);\n }\n var form = _this17.currentPage;\n if (form) {\n form.beforePage(next).then(resolve)[\"catch\"](reject);\n } else {\n resolve();\n }\n });\n });\n }\n }, {\n key: \"emitNextPage\",\n value: function emitNextPage() {\n this.emit('nextPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"nextPage\",\n value: function nextPage() {\n var _this18 = this;\n // Read-only forms should not worry about validation before going to next page, nor should they submit.\n if (this.options.readOnly) {\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n _this18.emitNextPage();\n });\n });\n }\n\n // Validate the form, before go to the next page\n if (this.checkValidity(this.localData, true, this.localData, true)) {\n this.checkData(this.submission.data);\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n if (!(_this18.options.readOnly || _this18.editMode) && _this18.enabledIndex < _this18.page) {\n _this18.enabledIndex = _this18.page;\n _this18.redraw();\n }\n _this18.emitNextPage();\n });\n });\n } else {\n this.currentPage.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n this.scrollIntoView(this.element, true);\n return _nativePromiseOnly[\"default\"].reject(this.showErrors([], true));\n }\n }\n }, {\n key: \"emitPrevPage\",\n value: function emitPrevPage() {\n this.emit('prevPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"prevPage\",\n value: function prevPage() {\n var _this19 = this;\n return this.beforePage().then(function () {\n return _this19.setPage(_this19.getPreviousPage()).then(function () {\n _this19.emitPrevPage();\n });\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var _this20 = this;\n if (this.options.readOnly) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (_get(_getPrototypeOf(Wizard.prototype), \"cancel\", this).call(this, noconfirm)) {\n this.setPristine(true);\n return this.setPage(0).then(function () {\n if (_this20.enabledIndex) {\n _this20.enabledIndex = 0;\n }\n _this20.onChange({\n resetValue: true\n });\n _this20.redraw();\n return _this20.page;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"getPageIndexByKey\",\n value: function getPageIndexByKey(key) {\n var pageIndex = this.page;\n this.pages.forEach(function (page, index) {\n if (page.component.key === key) {\n pageIndex = index;\n return false;\n }\n });\n return pageIndex;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.wizard;\n }\n }, {\n key: \"setComponentSchema\",\n value: function setComponentSchema() {\n var _this21 = this;\n var pageKeys = {};\n this.originalComponents = [];\n this.component.components.map(function (item) {\n if (item.type === 'panel') {\n item.key = (0, _utils.uniqueKey)(pageKeys, item.key || 'panel');\n pageKeys[item.key] = true;\n if (_this21.wizard.full) {\n _this21.options.show = _this21.options.show || {};\n _this21.options.show[item.key] = true;\n } else if (_this21.wizard.hasOwnProperty('full') && !_lodash[\"default\"].isEqual(_this21.originalOptions.show, _this21.options.show)) {\n _this21.options.show = _objectSpread({}, _this21.originalOptions.show || {});\n }\n }\n _this21.originalComponents.push(_lodash[\"default\"].clone(item));\n });\n if (!Object.keys(pageKeys).length) {\n var newPage = {\n type: 'panel',\n title: 'Page 1',\n label: 'Page 1',\n key: 'page1',\n components: this.component.components\n };\n this.component.components = [newPage];\n this.originalComponents.push(_lodash[\"default\"].clone(newPage));\n }\n }\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n if (!form) {\n return;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"setForm\", this).call(this, form, flags);\n }\n }, {\n key: \"onSetForm\",\n value: function onSetForm(clonedForm, initialForm) {\n this.component.components = (this._parentPath ? initialForm.components : clonedForm.components) || [];\n this.setComponentSchema();\n }\n }, {\n key: \"setEditMode\",\n value: function setEditMode(submission) {\n if (!this.editMode && submission._id && !this.options.readOnly) {\n this.editMode = true;\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this22 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ignoreEstablishment = arguments.length > 2 ? arguments[2] : undefined;\n var changed = this.getPages({\n all: true\n }).reduce(function (changed, page) {\n return _this22.setNestedValue(page, submission.data, flags, changed) || changed;\n }, false);\n this.mergeData(this.data, submission.data);\n if (changed) {\n this.pageFieldLogic(this.page);\n }\n submission.data = this.data;\n this._submission = submission;\n if (!ignoreEstablishment) {\n this.establishPages(submission.data);\n }\n this.setEditMode(submission);\n return changed;\n }\n }, {\n key: \"isClickable\",\n value: function isClickable(page, index) {\n return this.page !== index && (0, _utils.firstNonNil)([_lodash[\"default\"].get(page, 'breadcrumbClickable'), this.options.breadcrumbSettings.clickable]);\n }\n }, {\n key: \"hasButton\",\n value: function hasButton(name) {\n var nextPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getNextPage();\n // get page options with global options as default values\n var _$get = _lodash[\"default\"].get(this.currentPage, 'component.buttonSettings', {}),\n _$get$previous = _$get.previous,\n previous = _$get$previous === void 0 ? this.options.buttonSettings.showPrevious : _$get$previous,\n _$get$cancel = _$get.cancel,\n cancel = _$get$cancel === void 0 ? this.options.buttonSettings.showCancel : _$get$cancel,\n _$get$submit = _$get.submit,\n submit = _$get$submit === void 0 ? this.options.buttonSettings.showSubmit : _$get$submit,\n _$get$next = _$get.next,\n next = _$get$next === void 0 ? this.options.buttonSettings.showNext : _$get$next;\n switch (name) {\n case 'previous':\n return previous && this.getPreviousPage() > -1;\n case 'next':\n return next && nextPage !== null && nextPage !== -1;\n case 'cancel':\n return cancel && !this.options.readOnly;\n case 'submit':\n return submit && !this.options.readOnly && (nextPage === null || this.page === this.pages.length - 1);\n default:\n return true;\n }\n }\n }, {\n key: \"pageId\",\n value: function pageId(page) {\n if (page.key) {\n // Some panels have the same key....\n return \"\".concat(page.key, \"-\").concat(page.title);\n } else if (page.components && page.components.length > 0) {\n return this.pageId(page.components[0]);\n } else {\n return page.title;\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n var _this23 = this;\n _get(_getPrototypeOf(Wizard.prototype), \"onChange\", this).call(this, flags, changed, modified, changes);\n if (this.alert && !this.submitted) {\n this.checkValidity(this.localData, false, this.localData, true);\n this.showErrors([], true, true);\n }\n\n // If the pages change, need to redraw the header.\n var currentPanels;\n var panels;\n var currentNextPage = this.currentNextPage;\n if (this.hasExtraPages) {\n currentPanels = this.pages.map(function (page) {\n return page.component.key;\n });\n this.establishPages();\n panels = this.pages.map(function (page) {\n return page.component.key;\n });\n } else {\n var _this$currentPanel, _this$currentPanels;\n currentPanels = this.currentPanels || this.pages.map(function (page) {\n return page.component.key;\n });\n panels = this.establishPages().map(function (panel) {\n return panel.key;\n });\n this.currentPanels = panels;\n if ((_this$currentPanel = this.currentPanel) !== null && _this$currentPanel !== void 0 && _this$currentPanel.key && (_this$currentPanels = this.currentPanels) !== null && _this$currentPanels !== void 0 && _this$currentPanels.length) {\n this.setPage(this.currentPanels.findIndex(function (panel) {\n return panel === _this23.currentPanel.key;\n }));\n }\n }\n if (!_lodash[\"default\"].isEqual(panels, currentPanels) || flags && flags.fromSubmission) {\n this.redrawHeader();\n }\n\n // If the next page changes, then make sure to redraw navigation.\n if (currentNextPage !== this.getNextPage()) {\n this.redrawNavigation();\n }\n if (this.options.readOnly && (this.prefixComps.length || this.suffixComps.length)) {\n this.redraw();\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this$parent, _this$parent$componen;\n if ((_this$parent = this.parent) !== null && _this$parent !== void 0 && (_this$parent$componen = _this$parent.component) !== null && _this$parent$componen !== void 0 && _this$parent$componen.modalEdit) {\n return this.parent.redraw();\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n var _this24 = this;\n var currentPage = this.page;\n var setCurrentPage = function setCurrentPage() {\n return _this24.setPage(currentPage);\n };\n return _get(_getPrototypeOf(Wizard.prototype), \"rebuild\", this).call(this).then(setCurrentPage);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, currentPageOnly) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var components = !currentPageOnly || this.isLastPage() ? this.getComponents() : this.currentPage.components;\n return components.reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row) && check;\n }, true);\n }\n }, {\n key: \"errors\",\n get: function get() {\n if (!this.isLastPage()) {\n return this.currentPage.errors;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"errors\", this);\n }\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n var _this25 = this;\n var pageIndex = 0;\n var _this$pages$filter = this.pages.filter(function (page, index) {\n var hasComponent = false;\n page.getComponent(key, function (comp) {\n if (comp.path === key) {\n pageIndex = index;\n hasComponent = true;\n }\n });\n return hasComponent;\n }),\n _this$pages$filter2 = _slicedToArray(_this$pages$filter, 1),\n page = _this$pages$filter2[0];\n if (page && page !== this.currentPage) {\n return this.setPage(pageIndex).then(function () {\n _this25.checkValidity(_this25.submission.data, true, _this25.submission.data);\n _this25.showErrors();\n _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", _this25).call(_this25, key);\n });\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", this).call(this, key);\n }\n }]);\n return Wizard;\n}(_Webform2[\"default\"]);\nexports[\"default\"] = Wizard;\nWizard.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWizard.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWizard.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Wizard.js?"); /***/ }), @@ -246,7 +246,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ismobilejs = _interopRequireDefault(__webpack_require__(/*! ismobilejs */ \"./node_modules/ismobilejs/esm/index.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\"));\nvar _Validator = _interopRequireDefault(__webpack_require__(/*! ../../../validator/Validator */ \"./lib/validator/Validator.js\"));\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ../../../Element */ \"./lib/Element.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _widgets = _interopRequireDefault(__webpack_require__(/*! ../../../widgets */ \"./lib/widgets/index.js\"));\nvar _addons = _interopRequireDefault(__webpack_require__(/*! ../../../addons */ \"./lib/addons/index.js\"));\nvar _uploadAdapter = __webpack_require__(/*! ../../../providers/storage/uploadAdapter */ \"./lib/providers/storage/uploadAdapter.js\");\nvar _en = _interopRequireDefault(__webpack_require__(/*! ../../../translations/en */ \"./lib/translations/en.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar isIEBrowser = FormioUtils.getBrowserInfo().ie;\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ../../../templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\n\n/**\n * This is the Component class\n which all elements within the FormioForm derive from.\n */\nvar Component = /*#__PURE__*/function (_Element) {\n _inherits(Component, _Element);\n var _super = _createSuper(Component);\n /* eslint-enable no-unused-vars */\n\n /**\n * Initialize a new Component.\n *\n * @param {Object} component - The component JSON you wish to initialize.\n * @param {Object} options - The options for this component.\n * @param {Object} data - The global data submission object this component will belong.\n */\n /* eslint-disable max-statements */\n function Component(component, options, data) {\n var _this;\n _classCallCheck(this, Component);\n _this = _super.call(this, Object.assign({\n renderMode: 'form',\n attachMode: 'full',\n noDefaults: false\n }, options || {}));\n\n // Restore the component id.\n if (component && component.id) {\n _this.id = component.id;\n }\n\n /**\n * Determines if this component has a condition assigned to it.\n * @type {null}\n * @private\n */\n _this._hasCondition = null;\n\n /**\n * References to dom elements\n */\n _this.refs = {};\n\n // Allow global override for any component JSON.\n if (component && _this.options.components && _this.options.components[component.type]) {\n _lodash[\"default\"].merge(component, _this.options.components[component.type]);\n }\n\n /**\n * Set the validator instance.\n */\n _this.validator = _Validator[\"default\"];\n\n /**\n * The data path to this specific component instance.\n *\n * @type {string}\n */\n _this.path = '';\n\n /**\n * The Form.io component JSON schema.\n * @type {*}\n */\n _this.component = _this.mergeSchema(component || {});\n\n // Add the id to the component.\n _this.component.id = _this.id;\n _this.afterComponentAssign();\n\n // Save off the original component to be used in logic.\n _this.originalComponent = (0, FormioUtils.fastCloneDeep)(_this.component);\n\n /**\n * If the component has been attached\n */\n _this.attached = false;\n\n /**\n * If the component has been rendered\n */\n _this.rendered = false;\n\n /**\n * The data object in which this component resides.\n * @type {*}\n */\n _this._data = data || {};\n\n /**\n * The existing error that this component has.\n * @type {string}\n */\n _this.error = '';\n\n /**\n * Tool tip text after processing\n * @type {string}\n */\n _this.tooltip = '';\n\n /**\n * The row path of this component.\n * @type {number}\n */\n _this.row = _this.options.row;\n\n /**\n * Determines if this component is disabled, or not.\n *\n * @type {boolean}\n */\n _this._disabled = (0, FormioUtils.boolValue)(_this.component.disabled) ? _this.component.disabled : false;\n\n /**\n * Points to the root component, usually the FormComponent.\n *\n * @type {Component}\n */\n _this.root = _this.options.root;\n _this.localRoot = _this.options.localRoot;\n\n /**\n * If this input has been input and provided value.\n *\n * @type {boolean}\n */\n _this.pristine = true;\n\n /**\n * Points to the parent component.\n *\n * @type {Component}\n */\n _this.parent = _this.options.parent;\n _this.options.name = _this.options.name || 'data';\n\n /**\n * The validators that are assigned to this component.\n * @type {[string]}\n */\n _this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];\n _this._path = '';\n // Nested forms don't have parents so we need to pass their path in.\n _this._parentPath = _this.options.parentPath || '';\n\n // Needs for Nextgen Rules Engine\n _this.resetCaches();\n\n /**\n * Determines if this component is visible, or not.\n */\n _this._parentVisible = _this.options.hasOwnProperty('parentVisible') ? _this.options.parentVisible : true;\n _this._visible = _this._parentVisible && _this.conditionallyVisible(null, data);\n _this._parentDisabled = false;\n\n /**\n * Used to trigger a new change in this component.\n * @type {function} - Call to trigger a change in this component.\n */\n var changes = [];\n var lastChanged = null;\n var triggerArgs = [];\n var _triggerChange = _lodash[\"default\"].debounce(function () {\n var _this2;\n if (_this.root) {\n _this.root.changing = false;\n }\n triggerArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!args[1] && lastChanged) {\n // Set the changed component if one isn't provided.\n args[1] = lastChanged;\n }\n if (_lodash[\"default\"].isEmpty(args[0]) && lastChanged) {\n // Set the flags if it is empty and lastChanged exists.\n args[0] = lastChanged.flags;\n }\n lastChanged = null;\n args[3] = changes;\n var retVal = (_this2 = _this).onChange.apply(_this2, args);\n changes = [];\n return retVal;\n }, 100);\n _this.triggerChange = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args[1]) {\n // Make sure that during the debounce that we always track lastChanged component, even if they\n // don't provide one later.\n lastChanged = args[1];\n changes.push(lastChanged);\n }\n if (_this.root) {\n _this.root.changing = true;\n }\n if (args.length) {\n triggerArgs = args;\n }\n return _triggerChange.apply(void 0, _toConsumableArray(triggerArgs));\n };\n\n /**\n * Used to trigger a redraw event within this component.\n *\n * @type {Function}\n */\n _this.triggerRedraw = _lodash[\"default\"].debounce(_this.redraw.bind(_assertThisInitialized(_this)), 100);\n\n /**\n * list of attached tooltips\n * @type {Array}\n */\n _this.tooltips = [];\n\n /**\n * List of attached addons\n * @type {Array}\n */\n _this.addons = [];\n\n // To force this component to be invalid.\n _this.invalid = false;\n if (_this.component) {\n _this.type = _this.component.type;\n if (_this.allowData && _this.key) {\n _this.options.name += \"[\".concat(_this.key, \"]\");\n // If component is visible or not set to clear on hide, set the default value.\n if (_this.visible || !_this.component.clearOnHide) {\n if (!_this.hasValue()) {\n if (_this.shouldAddDefaultValue) {\n _this.dataValue = _this.defaultValue;\n }\n } else {\n // Ensure the dataValue is set.\n /* eslint-disable no-self-assign */\n _this.dataValue = _this.dataValue;\n /* eslint-enable no-self-assign */\n }\n }\n }\n\n /**\n * The element information for creating the input element.\n * @type {*}\n */\n _this.info = _this.elementInfo();\n }\n\n // Allow anyone to hook into the component creation.\n _this.hook('component');\n if (!_this.options.skipInit) {\n _this.init();\n }\n return _this;\n }\n /* eslint-enable max-statements */\n _createClass(Component, [{\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n }\n }, {\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _lodash[\"default\"].defaultsDeep(component, this.defaultSchema);\n }\n\n // Allow componets to notify when ready.\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve(this);\n }\n }, {\n key: \"isPDFReadOnlyMode\",\n get: function get() {\n return this.parent && this.parent.form && this.parent.form.display === 'pdf' && this.options.readOnly;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n var label = {};\n label.hidden = this.labelIsHidden();\n label.className = '';\n label.labelPosition = this.component.labelPosition;\n label.tooltipClass = \"\".concat(this.iconClass('question-sign'), \" text-muted\");\n var isPDFReadOnlyMode = this.isPDFReadOnlyMode;\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {\n label.className += ' field-required';\n }\n if (label.hidden) {\n label.className += ' control-label--hidden';\n }\n if (this.info.attr.id) {\n label[\"for\"] = this.info.attr.id;\n }\n return label;\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$component$addon,\n _this3 = this;\n this.disabled = this.shouldDisabled;\n this._visible = this.conditionallyVisible(null, null);\n if ((_this$component$addon = this.component.addons) !== null && _this$component$addon !== void 0 && _this$component$addon.length) {\n this.component.addons.forEach(function (addon) {\n return _this3.createAddon(addon);\n });\n }\n }\n }, {\n key: \"afterComponentAssign\",\n value: function afterComponentAssign() {\n //implement in extended classes\n }\n }, {\n key: \"createAddon\",\n value: function createAddon(addonConfiguration) {\n var _addonConfiguration$s;\n var name = addonConfiguration.name;\n if (!name) {\n return;\n }\n var settings = ((_addonConfiguration$s = addonConfiguration.settings) === null || _addonConfiguration$s === void 0 ? void 0 : _addonConfiguration$s.data) || {};\n var Addon = _addons[\"default\"][name.value];\n var addon = null;\n if (Addon) {\n var supportedComponents = Addon.info.supportedComponents;\n var supportsThisComponentType = !(supportedComponents !== null && supportedComponents !== void 0 && supportedComponents.length) || supportedComponents.indexOf(this.component.type) !== -1;\n if (supportsThisComponentType) {\n addon = new Addon(settings, this);\n this.addons.push(addon);\n } else {\n console.warn(\"Addon \".concat(name.label, \" does not support component of type \").concat(this.component.type, \".\"));\n }\n }\n return addon;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Component.prototype), \"destroy\", this).call(this);\n this.detach();\n this.addons.forEach(function (addon) {\n return addon.destroy();\n });\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return this.options.readOnly || this.component.disabled || this.options.hasOwnProperty('disabled') && this.options.disabled[this.key];\n }\n }, {\n key: \"isInputComponent\",\n get: function get() {\n return !this.component.hasOwnProperty('input') || this.component.input;\n }\n }, {\n key: \"allowData\",\n get: function get() {\n return this.hasInput;\n }\n }, {\n key: \"hasInput\",\n get: function get() {\n return this.isInputComponent || this.refs.input && this.refs.input.length;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return Component.schema();\n }\n }, {\n key: \"key\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'key', '');\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return this._parentVisible;\n },\n set: function set(value) {\n this._parentVisible = value;\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return this._parentDisabled;\n },\n set: function set(value) {\n this._parentDisabled = value;\n }\n }, {\n key: \"shouldForceVisibility\",\n value: function shouldForceVisibility(component, visibility) {\n if (!this.options[visibility]) {\n return false;\n }\n if (!component) {\n component = this.component;\n }\n if (_lodash[\"default\"].isArray(this.options[visibility])) {\n return this.options[visibility].includes(component.key);\n }\n return this.options[visibility][component.key];\n }\n }, {\n key: \"shouldForceHide\",\n value: function shouldForceHide(component) {\n return this.shouldForceVisibility(component, 'hide');\n }\n }, {\n key: \"shouldForceShow\",\n value: function shouldForceShow(component) {\n return this.shouldForceVisibility(component, 'show');\n }\n\n /**\n *\n * @param value {boolean}\n */\n }, {\n key: \"visible\",\n get:\n /**\n *\n * @returns {boolean}\n */\n function get() {\n // Show only if visibility changes or if we are in builder mode or if hidden fields should be shown.\n if (this.builderMode || this.previewMode || this.options.showHiddenFields) {\n return true;\n }\n if (this.shouldForceHide()) {\n return false;\n }\n if (this.shouldForceShow()) {\n return true;\n }\n return this._visible && this._parentVisible;\n },\n set: function set(value) {\n if (this._visible !== value) {\n // Skip if this component is set to visible and is supposed to be hidden.\n if (value && this.shouldForceHide()) {\n return;\n }\n // Skip if this component is set to hidden and is supposed to be shown.\n if (!value && this.shouldForceShow()) {\n return;\n }\n this._visible = value;\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n this._currentForm = instance;\n }\n }, {\n key: \"fullMode\",\n get: function get() {\n return this.options.attachMode === 'full';\n }\n }, {\n key: \"builderMode\",\n get: function get() {\n return this.options.attachMode === 'builder';\n }\n }, {\n key: \"calculatedPath\",\n get: function get() {\n console.error('component.calculatedPath was deprecated, use component.path instead.');\n return this.path;\n }\n }, {\n key: \"labelPosition\",\n get: function get() {\n return this.component.labelPosition;\n }\n }, {\n key: \"labelWidth\",\n get: function get() {\n var width = this.component.labelWidth;\n return width >= 0 ? width : 30;\n }\n }, {\n key: \"labelMargin\",\n get: function get() {\n var margin = this.component.labelMargin;\n return margin >= 0 ? margin : 3;\n }\n }, {\n key: \"isAdvancedLabel\",\n get: function get() {\n return ['left-left', 'left-right', 'right-left', 'right-right'].includes(this.labelPosition);\n }\n }, {\n key: \"labelPositions\",\n get: function get() {\n return this.labelPosition.split('-');\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return false;\n }\n }, {\n key: \"rightDirection\",\n value: function rightDirection(direction) {\n if (this.options.condensedMode) {\n return false;\n }\n return direction === 'right';\n }\n }, {\n key: \"getLabelInfo\",\n value: function getLabelInfo() {\n var isCondensed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var isRightPosition = this.rightDirection(this.labelPositions[0]);\n var isLeftPosition = this.labelPositions[0] === 'left' || isCondensed;\n var isRightAlign = this.rightDirection(this.labelPositions[1]);\n var contentMargin = '';\n if (this.component.hideLabel) {\n var margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;\n contentMargin = isRightPosition ? \"margin-right: \".concat(margin, \"%\") : '';\n contentMargin = isLeftPosition ? \"margin-left: \".concat(margin, \"%\") : '';\n }\n var labelStyles = \"\\n flex: \".concat(this.labelWidth, \";\\n \").concat(isRightPosition ? 'margin-left' : 'margin-right', \": \").concat(this.labelMargin, \"%;\\n \");\n var contentStyles = \"\\n flex: \".concat(100 - this.labelWidth - this.labelMargin, \";\\n \").concat(contentMargin, \";\\n \").concat(this.component.hideLabel ? \"max-width: \".concat(100 - this.labelWidth - this.labelMargin) : '', \";\\n \");\n return {\n isRightPosition: isRightPosition,\n isRightAlign: isRightAlign,\n labelStyles: labelStyles,\n contentStyles: contentStyles\n };\n }\n\n /**\n * Returns only the schema that is different from the default.\n *\n * @param schema\n * @param defaultSchema\n */\n }, {\n key: \"getModifiedSchema\",\n value: function getModifiedSchema(schema, defaultSchema, recursion) {\n var _this4 = this;\n var modified = {};\n if (!defaultSchema) {\n return schema;\n }\n _lodash[\"default\"].each(schema, function (val, key) {\n if (!_lodash[\"default\"].isArray(val) && _lodash[\"default\"].isObject(val) && defaultSchema.hasOwnProperty(key)) {\n var subModified = _this4.getModifiedSchema(val, defaultSchema[key], true);\n if (!_lodash[\"default\"].isEmpty(subModified)) {\n modified[key] = subModified;\n }\n } else if (_lodash[\"default\"].isArray(val)) {\n if (val.length !== 0 && !_lodash[\"default\"].isEqual(val, defaultSchema[key])) {\n modified[key] = val;\n }\n } else if (!recursion && key === 'type' || !recursion && key === 'key' || !recursion && key === 'label' || !recursion && key === 'input' || !recursion && key === 'tableView' || val !== '' && !defaultSchema.hasOwnProperty(key) || val !== '' && val !== defaultSchema[key] || defaultSchema[key] && val !== defaultSchema[key]) {\n modified[key] = val;\n }\n });\n return modified;\n }\n\n /**\n * Returns the JSON schema for this component.\n */\n }, {\n key: \"schema\",\n get: function get() {\n return (0, FormioUtils.fastCloneDeep)(this.getModifiedSchema(_lodash[\"default\"].omit(this.component, 'id'), this.defaultSchema));\n }\n\n /**\n * Returns true if component is inside DataGrid\n */\n }, {\n key: \"isInDataGrid\",\n get: function get() {\n return this.inDataGrid;\n }\n\n /**\n * Translate a text using the i18n system.\n *\n * @param {string} text - The i18n identifier.\n * @param {Object} params - The i18n parameters to use for translation.\n */\n }, {\n key: \"t\",\n value: function t(text) {\n var _get2;\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) {\n return '';\n }\n // Use _userInput: true to ignore translations from defaults\n if (text in _en[\"default\"] && params._userInput) {\n return text;\n }\n params.data = this.rootValue;\n params.row = this.data;\n params.component = this.component;\n for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n return (_get2 = _get(_getPrototypeOf(Component.prototype), \"t\", this)).call.apply(_get2, [this, text, params].concat(args));\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return !this.component.label || (!this.isInDataGrid && this.component.hideLabel || this.isInDataGrid && !this.component.dataGridLabel || this.options.inputsOnly) && !this.builderMode;\n }\n }, {\n key: \"transform\",\n value: function transform(type, value) {\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n return frameworkTemplates.hasOwnProperty('transform') ? frameworkTemplates.transform(type, value) : function (type, value) {\n return value;\n };\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(names, modes) {\n modes = Array.isArray(modes) ? modes : [modes];\n names = Array.isArray(names) ? names : [names];\n if (!modes.includes('form')) {\n modes.push('form');\n }\n var result = null;\n if (this.options.templates) {\n result = this.checkTemplate(this.options.templates, names, modes);\n if (result) {\n return result;\n }\n }\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n result = this.checkTemplate(frameworkTemplates, names, modes);\n if (result) {\n return result;\n }\n\n // Default back to bootstrap if not defined.\n var name = names[names.length - 1];\n var templatesByName = Templates.defaultTemplates[name];\n if (!templatesByName) {\n return \"Unknown template: \".concat(name);\n }\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n return templatesByName.form;\n }\n }, {\n key: \"checkTemplate\",\n value: function checkTemplate(templates, names, modes) {\n var _iterator = _createForOfIteratorHelper(names),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var name = _step.value;\n var templatesByName = templates[name];\n if (templatesByName) {\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"checkTemplateMode\",\n value: function checkTemplateMode(templatesByName, modes) {\n var _iterator2 = _createForOfIteratorHelper(modes),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mode = _step2.value;\n var templateByMode = templatesByName[mode];\n if (templateByMode) {\n return templateByMode;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n return null;\n }\n }, {\n key: \"getFormattedAttribute\",\n value: function getFormattedAttribute(attr) {\n return attr ? this.t(attr, {\n _userInput: true\n }).replace(/\"/g, '"') : '';\n }\n }, {\n key: \"getFormattedTooltip\",\n value: function getFormattedTooltip(tooltipValue) {\n var tooltip = this.interpolate(tooltipValue || '').replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n return this.getFormattedAttribute(tooltip);\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return this.options.renderMode === 'html';\n }\n }, {\n key: \"renderTemplate\",\n value: function renderTemplate(name) {\n var _this5 = this;\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var modeOption = arguments.length > 2 ? arguments[2] : undefined;\n // Need to make this fall back to form if renderMode is not found similar to how we search templates.\n var mode = modeOption || this.options.renderMode || 'form';\n data.component = this.component;\n data.self = this;\n data.options = this.options;\n data.readOnly = this.options.readOnly;\n data.iconClass = this.iconClass.bind(this);\n data.size = this.size.bind(this);\n data.t = this.t.bind(this);\n data.transform = this.transform.bind(this);\n data.id = data.id || this.id;\n data.key = data.key || this.key;\n data.value = data.value || this.dataValue;\n data.disabled = this.disabled;\n data.builder = this.builderMode;\n data.render = function () {\n console.warn(\"Form.io 'render' template function is deprecated.\\n If you need to render template (template A) inside of another template (template B),\\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B\");\n return _this5.renderTemplate.apply(_this5, arguments);\n };\n data.label = data.labelInfo || this.labelInfo;\n data.tooltip = this.getFormattedTooltip(this.component.tooltip);\n\n // Allow more specific template names\n var names = [\"\".concat(name, \"-\").concat(this.component.type, \"-\").concat(this.key), \"\".concat(name, \"-\").concat(this.component.type), \"\".concat(name, \"-\").concat(this.key), \"\".concat(name)];\n\n // Allow template alters.\n return this.hook(\"render\".concat(name.charAt(0).toUpperCase() + name.substring(1, name.length)), this.interpolate(this.getTemplate(names, mode), data), data, mode);\n }\n\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n }, {\n key: \"sanitize\",\n value: function sanitize(dirty, forceSanitize, options) {\n var _this$options;\n if (!this.shouldSanitizeValue && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, {\n sanitizeConfig: _lodash[\"default\"].merge(((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.sanitizeConfig) || {}, options || {})\n });\n }\n\n /**\n * Render a template string into html.\n *\n * @param template\n * @param data\n * @param actions\n *\n * @return {HTMLElement|String} - The created element or an empty string if template is not specified.\n */\n }, {\n key: \"renderString\",\n value: function renderString(template, data) {\n if (!template) {\n return '';\n }\n // Interpolate the template and populate\n return this.interpolate(template, data);\n }\n }, {\n key: \"performInputMapping\",\n value: function performInputMapping(input) {\n return input;\n }\n }, {\n key: \"widget\",\n get: function get() {\n var _this$root;\n var settings = this.component.widget;\n if (settings && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.shadowRoot) {\n settings.shadowRoot = this.root.shadowRoot;\n }\n var widget = settings && _widgets[\"default\"][settings.type] ? new _widgets[\"default\"][settings.type](settings, this.component, this) : null;\n return widget;\n }\n }, {\n key: \"getBrowserLanguage\",\n value: function getBrowserLanguage() {\n var nav = window.navigator;\n var browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];\n var language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (Array.isArray(nav.languages)) {\n for (var i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n }\n\n // support for other well known properties in browsers\n for (var _i = 0; _i < browserLanguagePropertyKeys.length; _i++) {\n language = nav[browserLanguagePropertyKeys[_i]];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n return null;\n }\n\n /**\n * Called before a next and previous page is triggered allowing the components\n * to perform special functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n }, {\n key: \"beforeNext\",\n value: function beforeNext() {\n return this.beforePage(true);\n }\n\n /**\n * Called before a submission is triggered allowing the components\n * to perform special async functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n\n /**\n * Return the submission timezone.\n *\n * @return {*}\n */\n }, {\n key: \"submissionTimezone\",\n get: function get() {\n this.options.submissionTimezone = this.options.submissionTimezone || _lodash[\"default\"].get(this.root, 'options.submissionTimezone');\n return this.options.submissionTimezone;\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.getTimezone(this.component);\n }\n }, {\n key: \"getTimezone\",\n value: function getTimezone(settings) {\n if (settings.timezone) {\n return settings.timezone;\n }\n if (settings.displayInTimezone === 'utc') {\n return 'UTC';\n }\n var submissionTimezone = this.submissionTimezone;\n if (submissionTimezone && (settings.displayInTimezone === 'submission' || (this.options.pdf || this.options.server) && settings.displayInTimezone === 'viewer')) {\n return submissionTimezone;\n }\n\n // Return current timezone if none are provided.\n return (0, FormioUtils.currentTimezone)();\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n for (var ref in refs) {\n var refType = refs[ref];\n var isString = typeof refType === 'string';\n var selector = isString && refType.includes('scope') ? \":scope > [ref=\\\"\".concat(ref, \"\\\"]\") : \"[ref=\\\"\".concat(ref, \"\\\"]\");\n if (isString && refType.startsWith('single')) {\n this.refs[ref] = element.querySelector(selector);\n } else {\n this.refs[ref] = element.querySelectorAll(selector);\n }\n }\n }\n }, {\n key: \"setOpenModalElement\",\n value: function setOpenModalElement(template) {\n this.componentModal.setOpenModalElement(template || this.getModalPreviewTemplate());\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n var _this$component$valid;\n var dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;\n var message = this.error ? {\n level: 'error',\n message: this.error.message\n } : '';\n var modalLabel;\n if (this.hasInput && (_this$component$valid = this.component.validate) !== null && _this$component$valid !== void 0 && _this$component$valid.required && !this.isPDFReadOnlyMode) {\n modalLabel = {\n className: 'field-required'\n };\n }\n return this.renderTemplate('modalPreview', {\n previewText: this.getValueAsString(dataValue, {\n modalPreview: true\n }) || this.t('Click to set value'),\n messages: message && this.renderTemplate('message', message),\n labelInfo: modalLabel\n });\n }\n }, {\n key: \"build\",\n value: function build(element) {\n element = element || this.element;\n this.empty(element);\n this.setContent(element, this.render());\n return this.attach(element);\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"Unknown component: \".concat(this.component.type);\n var topLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isVisible = this.visible;\n this.rendered = true;\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n return _ComponentModal[\"default\"].render(this, {\n visible: isVisible,\n showSaveButton: this.hasModalSaveButton,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n } else {\n return this.renderTemplate('component', {\n visible: isVisible,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n }\n }\n }, {\n key: \"attachTooltips\",\n value: function attachTooltips(toolTipsRefs) {\n var _this6 = this;\n toolTipsRefs === null || toolTipsRefs === void 0 ? void 0 : toolTipsRefs.forEach(function (tooltip, index) {\n if (tooltip) {\n var tooltipAttribute = tooltip.getAttribute('data-tooltip');\n var tooltipDataTitle = tooltip.getAttribute('data-title');\n var tooltipText = _this6.interpolate(tooltipDataTitle || tooltipAttribute).replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n _this6.tooltips[index] = (0, _tippy[\"default\"])(tooltip, {\n allowHTML: true,\n trigger: 'mouseenter click focus',\n placement: 'right',\n zIndex: 10000,\n interactive: true,\n content: _this6.t(_this6.sanitize(tooltipText), {\n _userInput: true\n })\n });\n }\n });\n }\n }, {\n key: \"createComponentModal\",\n value: function createComponentModal(element, modalShouldBeOpened, currentValue) {\n return new _ComponentModal[\"default\"](this, element, modalShouldBeOpened, currentValue);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n var modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;\n var openModalTemplate = this.componentModal && modalShouldBeOpened ? this.componentModal.openModalTemplate : null;\n this.componentModal = this.createComponentModal(element, modalShouldBeOpened, currentValue);\n this.setOpenModalElement(openModalTemplate);\n }\n this.attached = true;\n this.element = element;\n element.component = this;\n\n // If this already has an id, get it from the dom. If SSR, it could be different from the initiated id.\n if (this.element.id) {\n this.id = this.element.id;\n this.component.id = this.id;\n }\n this.loadRefs(element, {\n messageContainer: 'single',\n tooltip: 'multiple'\n });\n this.attachTooltips(this.refs.tooltip);\n\n // Attach logic.\n this.attachLogic();\n this.autofocus();\n\n // Allow global attach.\n this.hook('attachComponent', element, this);\n // Allow attach per component type.\n var type = this.component.type;\n if (type) {\n this.hook(\"attach\".concat(type.charAt(0).toUpperCase() + type.substring(1, type.length)), element, this);\n }\n this.restoreFocus();\n this.addons.forEach(function (addon) {\n return addon.attach(element);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"restoreFocus\",\n value: function restoreFocus() {\n var _this$root2, _this$root2$focusedCo;\n var isFocused = ((_this$root2 = this.root) === null || _this$root2 === void 0 ? void 0 : (_this$root2$focusedCo = _this$root2.focusedComponent) === null || _this$root2$focusedCo === void 0 ? void 0 : _this$root2$focusedCo.path) === this.path;\n if (isFocused) {\n var _this$root$currentSel;\n this.loadRefs(this.element, {\n input: 'multiple'\n });\n this.focus((_this$root$currentSel = this.root.currentSelection) === null || _this$root$currentSel === void 0 ? void 0 : _this$root$currentSel.index);\n this.restoreCaretPosition();\n }\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || !this.root || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.addShortcut(element, shortcut);\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.removeShortcut(element, shortcut);\n }\n\n /**\n * Remove all event handlers.\n */\n }, {\n key: \"detach\",\n value: function detach() {\n this.refs = {};\n this.removeEventListeners();\n this.detachLogic();\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n }\n }, {\n key: \"checkRefresh\",\n value: function checkRefresh(refreshData, changed, flags) {\n var changePath = _lodash[\"default\"].get(changed, 'instance.path', false);\n // Don't let components change themselves.\n if (changePath && this.path === changePath) {\n return;\n }\n if (refreshData === 'data') {\n this.refresh(this.data, changed, flags);\n } else if (changePath && (0, FormioUtils.getComponentPath)(changed.instance) === refreshData && changed && changed.instance &&\n // Make sure the changed component is not in a different \"context\". Solves issues where refreshOn being set\n // in fields inside EditGrids could alter their state from other rows (which is bad).\n this.inContext(changed.instance)) {\n this.refresh(changed.value, changed, flags);\n }\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changes) {\n var _this7 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n changes = changes || [];\n if (flags.noRefresh) {\n return;\n }\n if (!changes.length && flags.changed) {\n changes = [flags.changed];\n }\n var refreshOn = flags.fromBlur ? this.component.refreshOnBlur : this.component.refreshOn || this.component.redrawOn;\n // If they wish to refresh on a value, then add that here.\n if (refreshOn) {\n if (Array.isArray(refreshOn)) {\n refreshOn.forEach(function (refreshData) {\n return changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshData, changed, flags);\n });\n });\n } else {\n changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshOn, changed, flags);\n });\n }\n }\n }\n\n /**\n * Refreshes the component with a new value.\n *\n * @param value\n */\n }, {\n key: \"refresh\",\n value: function refresh(value) {\n if (this.hasOwnProperty('refreshOnValue')) {\n this.refreshOnChanged = !_lodash[\"default\"].isEqual(value, this.refreshOnValue);\n } else {\n this.refreshOnChanged = true;\n }\n this.refreshOnValue = (0, FormioUtils.fastCloneDeep)(value);\n if (this.refreshOnChanged) {\n if (this.component.clearOnRefresh) {\n this.setValue(null);\n }\n this.triggerRedraw();\n }\n }\n\n /**\n * Checks to see if a separate component is in the \"context\" of this component. This is determined by first checking\n * if they share the same \"data\" object. It will then walk up the parent tree and compare its parents data objects\n * with the components data and returns true if they are in the same context.\n *\n * Different rows of the same EditGrid, for example, are in different contexts.\n *\n * @param component\n */\n }, {\n key: \"inContext\",\n value: function inContext(component) {\n if (component.data === this.data) {\n return true;\n }\n var parent = this.parent;\n while (parent) {\n if (parent.data === component.data) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n }\n }, {\n key: \"viewOnly\",\n get: function get() {\n return this.options.readOnly && this.options.viewAsHtml;\n }\n }, {\n key: \"createViewOnlyElement\",\n value: function createViewOnlyElement() {\n this.element = this.ce('dl', {\n id: this.id\n });\n if (this.element) {\n // Ensure you can get the component info from the element.\n this.element.component = this;\n }\n return this.element;\n }\n }, {\n key: \"defaultViewOnlyValue\",\n get: function get() {\n return '-';\n }\n\n /**\n * Uses the widget to determine the output string.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getWidgetValueAsString\",\n value: function getWidgetValueAsString(value, options) {\n var _this8 = this;\n var noInputWidget = !this.refs.input || !this.refs.input[0] || !this.refs.input[0].widget;\n if (!value || noInputWidget) {\n if (!this.widget || !value) {\n return value;\n } else {\n return this.widget.getValueAsString(value);\n }\n }\n if (Array.isArray(value)) {\n var values = [];\n value.forEach(function (val, index) {\n var widget = _this8.refs.input[index] && _this8.refs.input[index].widget;\n if (widget) {\n values.push(widget.getValueAsString(val, options));\n }\n });\n return values;\n }\n var widget = this.refs.input[0].widget;\n return widget.getValueAsString(value, options);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.join(', ');\n }\n if (_lodash[\"default\"].isPlainObject(value)) {\n return JSON.stringify(value);\n }\n if (value === null || value === undefined) {\n return '';\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue);\n }\n }, {\n key: \"getView\",\n value: function getView(value, options) {\n if (this.component[\"protected\"]) {\n return '--- PROTECTED ---';\n }\n return this.getValueAsString(value, options);\n }\n }, {\n key: \"updateItems\",\n value: function updateItems() {\n this.restoreValue();\n this.onChange.apply(this, arguments);\n }\n\n /**\n * @param {*} data\n * @param {boolean} [forceUseValue=false] - if true, return 'value' property of the data\n * @return {*}\n */\n }, {\n key: \"itemValue\",\n value: function itemValue(data) {\n var forceUseValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (_lodash[\"default\"].isObject(data) && !_lodash[\"default\"].isArray(data)) {\n if (this.valueProperty) {\n return _lodash[\"default\"].get(data, this.valueProperty);\n }\n if (forceUseValue) {\n return data.value;\n }\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this9 = this;\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this9.itemValueForHTMLMode(item) : _this9.itemValue(item);\n });\n return values.join(', ');\n }\n return this.itemValue(value);\n }\n }, {\n key: \"createModal\",\n value: function createModal(element, attr, confirm) {\n var _this10 = this;\n var dialog = this.ce('div', attr || {});\n this.setContent(dialog, this.renderTemplate('dialog'));\n\n // Add refs to dialog, not \"this\".\n dialog.refs = {};\n this.loadRefs.call(dialog, dialog, {\n dialogOverlay: 'single',\n dialogContents: 'single',\n dialogClose: 'single'\n });\n dialog.refs.dialogContents.appendChild(element);\n document.body.appendChild(dialog);\n document.body.classList.add('modal-open');\n dialog.close = function () {\n document.body.classList.remove('modal-open');\n dialog.dispatchEvent(new CustomEvent('close'));\n };\n this.addEventListener(dialog, 'close', function () {\n return _this10.removeChildFrom(dialog, document.body);\n });\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var handleCloseClick = function handleCloseClick(e) {\n if (confirm) {\n confirm().then(function () {\n return close(e);\n })[\"catch\"](function () {});\n } else {\n close(e);\n }\n };\n this.addEventListener(dialog.refs.dialogOverlay, 'click', handleCloseClick);\n this.addEventListener(dialog.refs.dialogClose, 'click', handleCloseClick);\n return dialog;\n }\n }, {\n key: \"optimizeRedraw\",\n get: function get() {\n if (this.options.optimizeRedraw && this.element && !this.visible) {\n this.addClass(this.element, 'formio-removed');\n return true;\n }\n return false;\n }\n\n /**\n * Retrieves the CSS class name of this component.\n * @returns {string} - The class name of this component.\n */\n }, {\n key: \"className\",\n get: function get() {\n var className = this.hasInput ? \"\".concat(this.transform('class', 'form-group'), \" has-feedback \") : '';\n className += \"formio-component formio-component-\".concat(this.component.type, \" \");\n // TODO: find proper way to avoid overriding of default type-based component styles\n if (this.key && this.key !== 'form') {\n className += \"formio-component-\".concat(this.key, \" \");\n }\n if (this.component.multiple) {\n className += 'formio-component-multiple ';\n }\n if (this.component.customClass) {\n className += this.component.customClass;\n }\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required)) {\n className += ' required';\n }\n if (this.labelIsHidden()) {\n className += ' formio-component-label-hidden';\n }\n if (!this.visible) {\n className += ' formio-hidden';\n }\n return className;\n }\n\n /**\n * Build the custom style from the layout values\n * @return {string} - The custom style\n */\n }, {\n key: \"customStyle\",\n get: function get() {\n var customCSS = '';\n _lodash[\"default\"].each(this.component.style, function (value, key) {\n if (value !== '') {\n customCSS += \"\".concat(key, \":\").concat(value, \";\");\n }\n });\n return customCSS;\n }\n }, {\n key: \"isMobile\",\n get: function get() {\n return (0, _ismobilejs[\"default\"])();\n }\n\n /**\n * Returns the outside wrapping element of this component.\n * @returns {HTMLElement}\n */\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n\n /**\n * Create an evaluation context for all script executions and interpolations.\n *\n * @param additional\n * @return {*}\n */\n }, {\n key: \"evalContext\",\n value: function evalContext(additional) {\n return _get(_getPrototypeOf(Component.prototype), \"evalContext\", this).call(this, Object.assign({\n component: this.component,\n row: this.data,\n rowIndex: this.rowIndex,\n data: this.rootValue,\n iconClass: this.iconClass.bind(this),\n // Bind the translate function to the data context of any interpolated string.\n // It is useful to translate strings in different scenarions (eg: custom edit grid templates, custom error messages etc.)\n // and desirable to be publicly available rather than calling the internal {instance.t} function in the template string.\n t: this.t.bind(this),\n submission: this.root ? this.root._submission : {\n data: this.rootValue\n },\n form: this.root ? this.root._form : {},\n options: this.options\n }, additional));\n }\n\n /**\n * Sets the pristine flag for this component.\n *\n * @param pristine {boolean} - TRUE to make pristine, FALSE not pristine.\n */\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n this.pristine = pristine;\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine;\n }\n }, {\n key: \"setDirty\",\n value: function setDirty(dirty) {\n this.dirty = dirty;\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty;\n }\n\n /**\n * Removes a value out of the data array and rebuild the rows.\n * @param {number} index - The index of the data element to remove.\n */\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.splice(index);\n this.redraw();\n this.restoreValue();\n this.triggerRootChange();\n }\n }, {\n key: \"iconClass\",\n value: function iconClass(name, spinning) {\n var iconset = this.options.iconset || Templates.current.defaultIconset || 'fa';\n return Templates.current.hasOwnProperty('iconClass') ? Templates.current.iconClass(iconset, name, spinning) : this.options.iconset === 'fa' ? Templates.defaultTemplates.iconClass(iconset, name, spinning) : name;\n }\n }, {\n key: \"size\",\n value: function size(_size) {\n return Templates.current.hasOwnProperty('size') ? Templates.current.size(_size) : _size;\n }\n\n /**\n * The readible name for this component.\n * @returns {string} - The name of the component.\n */\n }, {\n key: \"name\",\n get: function get() {\n return this.t(this.component.label || this.component.placeholder || this.key, {\n _userInput: true\n });\n }\n\n /**\n * Returns the error label for this component.\n * @return {*}\n */\n }, {\n key: \"errorLabel\",\n get: function get() {\n return this.t(this.component.errorLabel || this.component.label || this.component.placeholder || this.key);\n }\n\n /**\n * Get the error message provided a certain type of error.\n * @param type\n * @return {*}\n */\n }, {\n key: \"errorMessage\",\n value: function errorMessage(type) {\n return this.component.errors && this.component.errors[type] ? this.component.errors[type] : type;\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize, sanitizeOptions) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize, sanitizeOptions);\n return true;\n }\n return false;\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root3;\n if ((_this$root3 = this.root) !== null && _this$root3 !== void 0 && _this$root3.currentSelection) {\n var _this$refs$input;\n if ((_this$refs$input = this.refs.input) !== null && _this$refs$input !== void 0 && _this$refs$input.length) {\n var _this$root$currentSel2 = this.root.currentSelection,\n selection = _this$root$currentSel2.selection,\n index = _this$root$currentSel2.index;\n var input = this.refs.input[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (input) {\n if (isInputRangeSelectable(input)) {\n var _input;\n (_input = input).setSelectionRange.apply(_input, _toConsumableArray(selection));\n }\n } else {\n var _input$value;\n input = this.refs.input[this.refs.input.length];\n var lastCharacter = ((_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length) || 0;\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange(lastCharacter, lastCharacter);\n }\n }\n }\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element || !this.element.parentNode || this.optimizeRedraw) {\n // Return a non-resolving promise.\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.detach();\n this.emit('redraw');\n // Since we are going to replace the element, we need to know it's position so we can find it in the parent's children.\n var parent = this.element.parentNode;\n var index = Array.prototype.indexOf.call(parent.children, this.element);\n this.element.outerHTML = this.sanitize(this.render());\n this.element = parent.children[index];\n return this.attach(this.element);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n this.destroy();\n this.init();\n this.visible = this.conditionallyVisible(null, null);\n return this.redraw();\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n _get(_getPrototypeOf(Component.prototype), \"removeEventListeners\", this).call(this);\n this.tooltips.forEach(function (tooltip) {\n return tooltip.destroy();\n });\n this.tooltips = [];\n }\n }, {\n key: \"hasClass\",\n value: function hasClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"hasClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"addClass\",\n value: function addClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"addClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"removeClass\", this).call(this, element, this.transform('class', className));\n }\n\n /**\n * Determines if this component has a condition defined.\n *\n * @return {null}\n */\n }, {\n key: \"hasCondition\",\n value: function hasCondition() {\n if (this._hasCondition !== null) {\n return this._hasCondition;\n }\n this._hasCondition = FormioUtils.hasCondition(this.component);\n return this._hasCondition;\n }\n\n /**\n * Check if this component is conditionally visible.\n *\n * @param data\n * @return {boolean}\n */\n }, {\n key: \"conditionallyVisible\",\n value: function conditionallyVisible(data, row) {\n data = data || this.rootValue;\n row = row || this.data;\n if (this.builderMode || this.previewMode || !this.hasCondition()) {\n return !this.component.hidden;\n }\n data = data || (this.root ? this.root.data : {});\n return this.checkCondition(row, data);\n }\n\n /**\n * Checks the condition of this component.\n *\n * TODO: Switch row and data parameters to be consistent with other methods.\n *\n * @param row - The row contextual data.\n * @param data - The global data object.\n * @return {boolean} - True if the condition applies to this component.\n */\n }, {\n key: \"checkCondition\",\n value: function checkCondition(row, data) {\n return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);\n }\n\n /**\n * Check for conditionals and hide/show the element based on those conditions.\n */\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n if (!this.builderMode & !this.previewMode && this.fieldLogic(data, row)) {\n this.redraw();\n }\n\n // Check advanced conditions\n var visible = this.conditionallyVisible(data, row);\n if (this.visible !== visible) {\n this.visible = visible;\n }\n return visible;\n }\n\n /**\n * Checks conditions for this component and any sub components.\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.checkComponentConditions(data, flags, row);\n }\n }, {\n key: \"logic\",\n get: function get() {\n return this.component.logic || [];\n }\n\n /**\n * Check all triggers and apply necessary actions.\n *\n * @param data\n */\n }, {\n key: \"fieldLogic\",\n value: function fieldLogic(data, row) {\n var _this11 = this;\n data = data || this.rootValue;\n row = row || this.data;\n var logics = this.logic;\n\n // If there aren't logic, don't go further.\n if (logics.length === 0) {\n return;\n }\n var newComponent = (0, FormioUtils.fastCloneDeep)(this.originalComponent);\n var changed = logics.reduce(function (changed, logic) {\n var result = FormioUtils.checkTrigger(newComponent, logic.trigger, row, data, _this11.root ? _this11.root._form : {}, _this11);\n return (result ? _this11.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;\n }, false);\n\n // If component definition changed, replace and mark as changed.\n if (!_lodash[\"default\"].isEqual(this.component, newComponent)) {\n this.component = newComponent;\n changed = true;\n var disabled = this.shouldDisabled;\n // Change disabled state if it has changed\n if (this.disabled !== disabled) {\n this.disabled = disabled;\n }\n }\n return changed;\n }\n }, {\n key: \"isIE\",\n value: function isIE() {\n if (typeof window === 'undefined') {\n return false;\n }\n var userAgent = window.navigator.userAgent;\n var msie = userAgent.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(userAgent.substring(msie + 5, userAgent.indexOf('.', msie)), 10);\n }\n var trident = userAgent.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = userAgent.indexOf('rv:');\n return parseInt(userAgent.substring(rv + 3, userAgent.indexOf('.', rv)), 10);\n }\n var edge = userAgent.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(userAgent.substring(edge + 5, userAgent.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }\n }, {\n key: \"defineActionValue\",\n value: function defineActionValue(action, argsObject) {\n return this.evaluate(action.value, argsObject, 'value');\n }\n }, {\n key: \"applyActions\",\n value: function applyActions(newComponent, actions, result, row, data) {\n var _this12 = this;\n data = data || this.rootValue;\n row = row || this.data;\n return actions.reduce(function (changed, action) {\n switch (action.type) {\n case 'property':\n {\n FormioUtils.setActionProperty(newComponent, action, result, row, data, _this12);\n var property = action.property.value;\n if (!_lodash[\"default\"].isEqual(_lodash[\"default\"].get(_this12.component, property), _lodash[\"default\"].get(newComponent, property))) {\n changed = true;\n }\n break;\n }\n case 'value':\n {\n var oldValue = _this12.getValue();\n var newValue = _this12.defineActionValue(action, {\n value: _lodash[\"default\"].clone(oldValue),\n data: data,\n row: row,\n component: newComponent,\n result: result\n });\n if (!_lodash[\"default\"].isEqual(oldValue, newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = newValue;\n }\n changed = true;\n }\n break;\n }\n case 'mergeComponentSchema':\n {\n var schema = _this12.evaluate(action.schemaDefinition, {\n value: _lodash[\"default\"].clone(_this12.getValue()),\n data: data,\n row: row,\n component: newComponent,\n result: result\n }, 'schema');\n _lodash[\"default\"].assign(newComponent, schema);\n if (!_lodash[\"default\"].isEqual(_this12.component, newComponent)) {\n changed = true;\n }\n break;\n }\n case 'customAction':\n {\n var _oldValue = _this12.getValue();\n var _newValue = _this12.evaluate(action.customAction, {\n value: _lodash[\"default\"].clone(_oldValue),\n data: data,\n row: row,\n input: _oldValue,\n component: newComponent,\n result: result\n }, 'value');\n if (!_lodash[\"default\"].isEqual(_oldValue, _newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(_newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = _newValue;\n }\n changed = true;\n }\n break;\n }\n }\n return changed;\n }, false);\n }\n\n // Deprecated\n }, {\n key: \"addInputError\",\n value: function addInputError(message, dirty, elements) {\n this.addMessages(message);\n this.setErrorClasses(elements, dirty, !!message);\n }\n\n // Deprecated\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n this.setErrorClasses(elements, true, false);\n }\n\n /**\n * Add a new input error to this element.\n *\n * @param message\n * @param dirty\n */\n }, {\n key: \"addMessages\",\n value: function addMessages(messages) {\n var _this13 = this;\n if (!messages) {\n return;\n }\n\n // Standardize on array of objects for message.\n if (typeof messages === 'string') {\n messages = {\n messages: messages,\n level: 'error'\n };\n }\n if (!Array.isArray(messages)) {\n messages = [messages];\n }\n messages = _lodash[\"default\"].uniqBy(messages, function (message) {\n return message.message;\n });\n if (this.refs.messageContainer) {\n this.setContent(this.refs.messageContainer, messages.map(function (message) {\n if (message.message && typeof message.message === 'string') {\n message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _this13.renderTemplate('message', message);\n }).join(''));\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this14 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n this.clearErrorClasses();\n elements.forEach(function (element) {\n _this14.setElementInvalid(_this14.performInputMapping(element), false);\n });\n this.setInputWidgetErrorClasses(elements, hasErrors);\n // do not set error classes for hidden components\n if (!this.visible) {\n return;\n }\n if (hasErrors) {\n // Add error classes\n elements.forEach(function (input) {\n _this14.setElementInvalid(_this14.performInputMapping(input), true);\n });\n if (dirty && this.options.highlightErrors) {\n this.addClass(element, this.options.componentErrorClass);\n } else {\n this.addClass(element, 'has-error');\n }\n }\n if (hasMessages) {\n this.addClass(element, 'has-message');\n }\n }\n }, {\n key: \"setElementInvalid\",\n value: function setElementInvalid(element, invalid) {\n if (!element) return;\n if (invalid) {\n this.addClass(element, 'is-invalid');\n } else {\n this.removeClass(element, 'is-invalid');\n }\n element.setAttribute('aria-invalid', invalid ? 'true' : 'false');\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide() {\n // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.\n if (\n // if change happens inside EditGrid's row, it doesn't trigger change on the root level, so rootPristine will be true\n (!this.rootPristine || this.options.server || (0, FormioUtils.isInsideScopingComponent)(this)) && this.component.clearOnHide !== false && !this.options.readOnly && !this.options.showHiddenFields) {\n if (!this.visible) {\n this.deleteValue();\n } else if (!this.hasValue() && this.shouldAddDefaultValue) {\n // If shown, ensure the default is set.\n this.setValue(this.defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n }\n }, {\n key: \"triggerRootChange\",\n value: function triggerRootChange() {\n if (this.options.onChange) {\n var _this$options2;\n (_this$options2 = this.options).onChange.apply(_this$options2, arguments);\n } else if (this.root) {\n var _this$root4;\n (_this$root4 = this.root).triggerChange.apply(_this$root4, arguments);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, fromRoot) {\n flags = flags || {};\n if (flags.modified) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n this.addClass(this.getElement(), 'formio-modified');\n }\n\n // If we are supposed to validate on blur, then don't trigger validation yet.\n if (this.component.validateOn === 'blur' && !this.errors.length) {\n flags.noValidate = true;\n }\n if (this.component.onChange) {\n this.evaluate(this.component.onChange, {\n flags: flags\n });\n }\n\n // Set the changed variable.\n var changed = {\n instance: this,\n component: this.component,\n value: this.dataValue,\n flags: flags\n };\n\n // Emit the change.\n this.emit('componentChange', changed);\n\n // Do not propogate the modified flag.\n var modified = false;\n if (flags.modified) {\n modified = true;\n delete flags.modified;\n }\n\n // Bubble this change up to the top.\n if (!fromRoot) {\n this.triggerRootChange(flags, changed, modified);\n }\n return changed;\n }\n }, {\n key: \"wysiwygDefault\",\n get: function get() {\n return {\n quill: {\n theme: 'snow',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n }),\n modules: {\n toolbar: [[{\n 'size': ['small', false, 'large', 'huge']\n }],\n // custom dropdown\n [{\n 'header': [1, 2, 3, 4, 5, 6, false]\n }], [{\n 'font': []\n }], ['bold', 'italic', 'underline', 'strike', {\n 'script': 'sub'\n }, {\n 'script': 'super'\n }, 'clean'], [{\n 'color': []\n }, {\n 'background': []\n }], [{\n 'list': 'ordered'\n }, {\n 'list': 'bullet'\n }, {\n 'indent': '-1'\n }, {\n 'indent': '+1'\n }, {\n 'align': []\n }], ['blockquote', 'code-block'], ['link', 'image', 'video', 'formula', 'source']]\n }\n },\n ace: {\n theme: 'ace/theme/xcode',\n maxLines: 12,\n minLines: 12,\n tabSize: 2,\n mode: 'ace/mode/javascript',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n })\n },\n ckeditor: {\n image: {\n toolbar: ['imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight'],\n styles: ['full', 'alignLeft', 'alignCenter', 'alignRight']\n },\n extraPlugins: []\n },\n \"default\": {}\n };\n }\n }, {\n key: \"addCKE\",\n value: function addCKE(element, settings, onChange) {\n settings = _lodash[\"default\"].isEmpty(settings) ? {} : settings;\n settings.base64Upload = this.component.isUploadEnabled ? false : true;\n settings.mediaEmbed = {\n previewsInData: true\n };\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ckeditor, _lodash[\"default\"].get(this.options, 'editors.ckeditor.settings', {}), settings);\n if (this.component.isUploadEnabled) {\n settings.extraPlugins.push((0, _uploadAdapter.getFormioUploadAdapterPlugin)(this.fileService, this));\n }\n return _Formio.GlobalFormio.requireLibrary('ckeditor', isIEBrowser ? 'CKEDITOR' : 'ClassicEditor', _lodash[\"default\"].get(this.options, 'editors.ckeditor.src', \"\".concat(_Formio.GlobalFormio.cdn.ckeditor, \"/ckeditor.js\")), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n if (isIEBrowser) {\n var editor = CKEDITOR.replace(element);\n editor.on('change', function () {\n return onChange(editor.getData());\n });\n return _nativePromiseOnly[\"default\"].resolve(editor);\n } else {\n return ClassicEditor.create(element, settings).then(function (editor) {\n editor.model.document.on('change', function () {\n return onChange(editor.data.get());\n });\n return editor;\n });\n }\n });\n }\n }, {\n key: \"addQuill\",\n value: function addQuill(element, settings, onChange) {\n var _this15 = this;\n settings = _lodash[\"default\"].isEmpty(settings) ? this.wysiwygDefault.quill : settings;\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.quill, _lodash[\"default\"].get(this.options, 'editors.quill.settings', {}), settings);\n settings = _objectSpread(_objectSpread({}, settings), {}, {\n modules: _objectSpread({\n table: true\n }, settings.modules)\n });\n // Lazy load the quill css.\n _Formio.GlobalFormio.requireLibrary(\"quill-css-\".concat(settings.theme), 'Quill', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.\").concat(settings.theme, \".css\")\n }], true);\n\n // Lazy load the quill library.\n return _Formio.GlobalFormio.requireLibrary('quill', 'Quill', _lodash[\"default\"].get(this.options, 'editors.quill.src', \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.min.js\")), true).then(function () {\n return _Formio.GlobalFormio.requireLibrary('quill-table', 'Quill', \"\".concat(_Formio.GlobalFormio.cdn.baseUrl, \"/quill/quill-table.js\"), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n _this15.quill = new Quill(element, isIEBrowser ? _objectSpread(_objectSpread({}, settings), {}, {\n modules: {}\n }) : settings);\n\n /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/\n var txtArea = document.createElement('textarea');\n txtArea.setAttribute('class', 'quill-source-code');\n _this15.quill.addContainer('ql-custom').appendChild(txtArea);\n var qlSource = element.parentNode.querySelector('.ql-source');\n if (qlSource) {\n _this15.addEventListener(qlSource, 'click', function (event) {\n event.preventDefault();\n if (txtArea.style.display === 'inherit') {\n _this15.quill.setContents(_this15.quill.clipboard.convert({\n html: txtArea.value\n }));\n }\n txtArea.style.display = txtArea.style.display === 'none' ? 'inherit' : 'none';\n });\n }\n /** END CODEBLOCK **/\n\n // Make sure to select cursor when they click on the element.\n _this15.addEventListener(element, 'click', function () {\n return _this15.quill.focus();\n });\n\n // Allows users to skip toolbar items when tabbing though form\n var elm = document.querySelectorAll('.ql-formats > button');\n for (var i = 0; i < elm.length; i++) {\n elm[i].setAttribute('tabindex', '-1');\n }\n _this15.quill.on('text-change', function () {\n txtArea.value = _this15.quill.root.innerHTML;\n onChange(txtArea);\n });\n return _this15.quill;\n });\n });\n }\n }, {\n key: \"shouldSanitizeValue\",\n get: function get() {\n var _this$options3;\n // Sanitize value if sanitizing for thw whole content is turned off\n return ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.sanitize) !== false;\n }\n }, {\n key: \"addAce\",\n value: function addAce(element, settings, onChange) {\n if (!settings || settings.theme === 'snow') {\n var mode = settings ? settings.mode : '';\n settings = {};\n if (mode) {\n settings.mode = mode;\n }\n }\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ace, _lodash[\"default\"].get(this.options, 'editors.ace.settings', {}), settings || {});\n return _Formio.GlobalFormio.requireLibrary('ace', 'ace', _lodash[\"default\"].get(this.options, 'editors.ace.src', \"\".concat(_Formio.GlobalFormio.cdn.ace, \"/ace.js\")), true).then(function (editor) {\n editor = editor.edit(element);\n editor.removeAllListeners('change');\n editor.setOptions(settings);\n editor.getSession().setMode(settings.mode);\n editor.on('change', function () {\n return onChange(editor.getValue());\n });\n if (settings.isUseWorkerDisabled) {\n editor.session.setUseWorker(false);\n }\n return editor;\n });\n }\n }, {\n key: \"tree\",\n get: function get() {\n return this.component.tree || false;\n }\n\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n\n /**\n * Returns if this component has a value set.\n *\n */\n }, {\n key: \"hasValue\",\n value: function hasValue(data) {\n return !_lodash[\"default\"].isUndefined(_lodash[\"default\"].get(data || this.data, this.key));\n }\n\n /**\n * Get the data value at the root level.\n *\n * @return {*}\n */\n }, {\n key: \"rootValue\",\n get: function get() {\n return this.root ? this.root.data : this.data;\n }\n }, {\n key: \"rootPristine\",\n get: function get() {\n return _lodash[\"default\"].get(this, 'root.pristine', false);\n }\n\n /**\n * Get the static value of this component.\n * @return {*}\n */\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n var empty = this.component.multiple ? [] : this.emptyValue;\n if (!this.rootPristine) {\n this.dataValue = empty;\n }\n return empty;\n }\n return _lodash[\"default\"].get(this._data, this.key);\n }\n\n /**\n * Sets the static value of this component.\n *\n * @param value\n */,\n set: function set(value) {\n if (!this.allowData || !this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return;\n }\n if (value !== null && value !== undefined) {\n value = this.hook('setDataValue', value, this.key, this._data);\n }\n if (value === null || value === undefined) {\n this.unset();\n return;\n }\n _lodash[\"default\"].set(this._data, this.key, value);\n return;\n }\n\n /**\n * Splice a value from the dataValue.\n *\n * @param index\n */\n }, {\n key: \"splice\",\n value: function splice(index) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.hasValue()) {\n var dataValue = this.dataValue || [];\n if (_lodash[\"default\"].isArray(dataValue) && dataValue.hasOwnProperty(index)) {\n dataValue.splice(index, 1);\n this.dataValue = dataValue;\n this.triggerChange(flags);\n }\n }\n }\n }, {\n key: \"unset\",\n value: function unset() {\n _lodash[\"default\"].unset(this._data, this.key);\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue(null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }, {\n key: \"getCustomDefaultValue\",\n value: function getCustomDefaultValue(defaultValue) {\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n }, {\n key: \"shouldAddDefaultValue\",\n get: function get() {\n return !this.options.noDefaults || this.component.defaultValue && !this.isEmpty(this.component.defaultValue) || this.component.customDefaultValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this16 = this;\n var defaultValue = this.emptyValue;\n if (this.component.defaultValue) {\n defaultValue = this.component.defaultValue;\n }\n defaultValue = this.getCustomDefaultValue(defaultValue);\n var checkMask = function checkMask(value) {\n if (typeof value === 'string') {\n if (_this16.component.type !== 'textfield') {\n var placeholderChar = _this16.placeholderChar;\n value = (0, _vanillaTextMask.conformToMask)(value, _this16.defaultMask, {\n placeholderChar: placeholderChar\n }).conformedValue;\n if (!FormioUtils.matchInputMask(value, _this16.defaultMask)) {\n value = '';\n }\n }\n } else {\n value = '';\n }\n return value;\n };\n if (this.defaultMask) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue.map(checkMask);\n } else {\n defaultValue = checkMask(defaultValue);\n }\n }\n\n // Clone so that it creates a new instance.\n return _lodash[\"default\"].cloneDeep(defaultValue);\n }\n\n /**\n * Get the input value of this component.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this.hasInput || this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var values = [];\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n if (!this.component.multiple) {\n return this.getValueAt(i);\n }\n values.push(this.getValueAt(i));\n }\n }\n if (values.length === 0 && !this.component.multiple) {\n return '';\n }\n return values;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var input = this.performInputMapping(this.refs.input[index]);\n return input ? input.value : undefined;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n *\n * @return {boolean} - If the value changed.\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (!this.hasInput) {\n return changed;\n }\n var isArray = Array.isArray(value);\n var valueInput = this.refs.fileLink || this.refs.input;\n if (isArray && Array.isArray(this.defaultValue) && this.refs.hasOwnProperty('input') && valueInput && valueInput.length !== value.length && this.visible) {\n this.redraw();\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.redraw();\n return changed;\n }\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n this.setValueAt(i, isArray ? value[i] : value, flags);\n }\n }\n return changed;\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!flags.noDefault && (value === null || value === undefined) && !this.component.multiple) {\n value = this.defaultValue;\n }\n var input = this.performInputMapping(this.refs.input[index]);\n var valueMaskInput = this.refs.valueMaskInput;\n if (valueMaskInput !== null && valueMaskInput !== void 0 && valueMaskInput.mask && valueMaskInput.mask.textMaskInputElement) {\n valueMaskInput.mask.textMaskInputElement.update(value);\n }\n if (input.mask && input.mask.textMaskInputElement) {\n input.mask.textMaskInputElement.update(value);\n } else if (input.widget && input.widget.setValue) {\n input.widget.setValue(value);\n } else {\n input.value = value;\n }\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue() && !this.isEmpty(this.dataValue);\n }\n }, {\n key: \"setDefaultValue\",\n value: function setDefaultValue() {\n if (this.defaultValue && this.shouldAddDefaultValue) {\n var defaultValue = this.component.multiple && !this.dataValue.length ? [] : this.defaultValue;\n this.setValue(defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n\n /**\n * Restore the value of a control.\n */\n }, {\n key: \"restoreValue\",\n value: function restoreValue() {\n if (this.hasSetValue) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else {\n this.setDefaultValue();\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.multiple && !Array.isArray(value)) {\n value = value ? [value] : [];\n }\n return value;\n }\n\n /**\n * Update a value of this component.\n *\n * @param flags\n */\n }, {\n key: \"updateComponentValue\",\n value: function updateComponentValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newValue = !flags.resetValue && (value === undefined || value === null) ? this.getValue() : value;\n newValue = this.normalizeValue(newValue, flags);\n var oldValue = this.dataValue;\n var changed = newValue !== undefined ? this.hasChanged(newValue, oldValue) : false;\n if (changed) {\n this.dataValue = newValue;\n changed = this.dataValue !== oldValue;\n this.updateOnChange(flags, changed);\n }\n if (this.componentModal && flags && flags.fromSubmission) {\n this.componentModal.setValue(value);\n }\n return changed;\n }\n\n /**\n * Updates the value of this component plus all sub-components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"updateValue\",\n value: function updateValue() {\n return this.updateComponentValue.apply(this, arguments);\n }\n }, {\n key: \"getIcon\",\n value: function getIcon(name, content, styles) {\n var ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'icon';\n return this.renderTemplate('icon', {\n className: this.iconClass(name),\n ref: ref,\n styles: styles,\n content: content\n });\n }\n\n /**\n * Resets the value of this component.\n */\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n\n /**\n * Determine if the value of this component has changed.\n *\n * @param newValue\n * @param oldValue\n * @return {boolean}\n */\n }, {\n key: \"hasChanged\",\n value: function hasChanged(newValue, oldValue) {\n if ((newValue === undefined || newValue === null) && (oldValue === undefined || oldValue === null || this.isEmpty(oldValue))) {\n return false;\n }\n // If we do not have a value and are getting set to anything other than undefined or null, then we changed.\n if (newValue !== undefined && newValue !== null && this.allowData && !this.hasValue()) {\n return true;\n }\n return !_lodash[\"default\"].isEqual(newValue, oldValue);\n }\n\n /**\n * Update the value on change.\n *\n * @param flags\n */\n }, {\n key: \"updateOnChange\",\n value: function updateOnChange() {\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!flags.noUpdateEvent && changed) {\n this.triggerChange(flags);\n return true;\n }\n return false;\n }\n\n /**\n * Perform a calculated value operation.\n *\n * @param data - The global data object.\n *\n * @return {boolean} - If the value changed during calculation.\n */\n }, {\n key: \"convertNumberOrBoolToString\",\n value: function convertNumberOrBoolToString(value) {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return value;\n }\n }, {\n key: \"doValueCalculation\",\n value: function doValueCalculation(dataValue, data, row) {\n var _this$root5;\n return this.evaluate(this.component.calculateValue, {\n value: dataValue,\n data: data,\n row: row || this.data,\n submission: ((_this$root5 = this.root) === null || _this$root5 === void 0 ? void 0 : _this$root5._submission) || {\n data: this.rootValue\n }\n }, 'value');\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"calculateComponentValue\",\n value: function calculateComponentValue(data, flags, row) {\n // Skip value calculation for the component if we don't have entire form data set or in builder mode\n if (this.builderMode || _lodash[\"default\"].isUndefined(_lodash[\"default\"].get(this, 'root.data'))) {\n return false;\n }\n // If no calculated value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n var clearOnHide = this.component.clearOnHide;\n var shouldBeCleared = !this.visible && clearOnHide;\n var allowOverride = _lodash[\"default\"].get(this.component, 'allowCalculateOverride', false);\n if (shouldBeCleared) {\n // remove calculated value so that the value is recalculated once component becomes visible\n if (this.hasOwnProperty('calculatedValue') && allowOverride) {\n _lodash[\"default\"].unset(this, 'calculatedValue');\n }\n return false;\n }\n\n // Handle all cases when calculated values should not fire.\n if (this.options.readOnly && !this.options.pdf && !this.component.calculateValue || !(this.component.calculateValue || this.component.calculateValueVariable) || this.options.server && !this.component.calculateServer || flags.dataSourceInitialLoading && allowOverride) {\n return false;\n }\n var dataValue = this.dataValue;\n // Calculate the new value.\n var calculatedValue = this.doValueCalculation(dataValue, data, row, flags);\n if (this.options.readOnly && dataValue && !calculatedValue) {\n return false;\n }\n if (_lodash[\"default\"].isNil(calculatedValue)) {\n calculatedValue = this.emptyValue;\n }\n var changed = !_lodash[\"default\"].isEqual(dataValue, calculatedValue);\n\n // Do not override calculations on server if they have calculateServer set.\n if (allowOverride) {\n // The value is considered locked if it is not empty and comes from a submission value.\n var fromSubmission = flags.fromSubmission && this.component.persistent === true;\n if (this.isEmpty(dataValue)) {\n // Reset the calculation lock if ever the data is cleared.\n this.calculationLocked = false;\n } else if (this.calculationLocked || fromSubmission) {\n this.calculationLocked = true;\n return false;\n }\n var firstPass = this.calculatedValue === undefined || flags.resetValue;\n if (firstPass) {\n this.calculatedValue = null;\n }\n var newCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(calculatedValue));\n var previousCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue));\n var normalizedDataValue = this.normalizeValue(this.convertNumberOrBoolToString(dataValue));\n var calculationChanged = !_lodash[\"default\"].isEqual(previousCalculatedValue, newCalculatedValue);\n var previousChanged = !_lodash[\"default\"].isEqual(normalizedDataValue, previousCalculatedValue);\n if (calculationChanged && previousChanged && !firstPass) {\n return false;\n }\n\n // Check to ensure that the calculated value is different than the previously calculated value.\n if (previousCalculatedValue && previousChanged && !calculationChanged) {\n this.calculatedValue = null;\n return false;\n }\n if (flags.isReordered || !calculationChanged) {\n return false;\n }\n if (fromSubmission) {\n // If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n return false;\n }\n\n // If this is the firstPass, and the dataValue is different than to the calculatedValue.\n if (firstPass && !this.isEmpty(dataValue) && changed && calculationChanged) {\n // Return that we have a change so it will perform another pass.\n return true;\n }\n }\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n if (changed) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n flags.triggeredComponentId = this.id;\n return this.setValue(calculatedValue, flags);\n }\n return false;\n }\n /* eslint-enable max-statements */\n\n /**\n * Performs calculations in this component plus any child components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.calculateComponentValue(data, flags, row);\n }\n\n /**\n * Get this component's label text.\n *\n */\n }, {\n key: \"label\",\n get: function get() {\n return this.component.label;\n }\n\n /**\n * Set this component's label text and render it.\n *\n * @param value - The new label text.\n */,\n set: function set(value) {\n this.component.label = value;\n if (this.labelElement) {\n this.labelElement.innerText = value;\n }\n }\n\n /**\n * Get FormioForm element at the root of this component tree.\n *\n */\n }, {\n key: \"getRoot\",\n value: function getRoot() {\n return this.root;\n }\n\n /**\n * Returns the invalid message, or empty string if the component is valid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"invalidMessage\",\n value: function invalidMessage(data, dirty, ignoreCondition, row) {\n if (!ignoreCondition && !this.checkCondition(row, data)) {\n return '';\n }\n\n // See if this is forced invalid.\n if (this.invalid) {\n return this.invalid;\n }\n\n // No need to check for errors if there is no input or if it is pristine.\n if (!this.hasInput || !dirty && this.pristine) {\n return '';\n }\n return _lodash[\"default\"].map(_Validator[\"default\"].checkComponent(this, data), 'message').join('\\n\\n');\n }\n\n /**\n * Returns if the component is valid or not.\n *\n * @param data\n * @param dirty\n * @return {boolean}\n */\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return !this.invalidMessage(data, dirty);\n }\n }, {\n key: \"setComponentValidity\",\n value: function setComponentValidity(messages, dirty, silentCheck) {\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error' && !message.fromServer;\n }).length;\n if (messages.length && (!silentCheck || this.error) && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {\n this.setCustomValidity(messages, dirty);\n } else if (!silentCheck) {\n this.setCustomValidity('');\n }\n return !hasErrors;\n }\n\n /**\n * Checks the validity of this component and sets the error message if it is invalid.\n *\n * @param data\n * @param dirty\n * @param row\n * @return {boolean}\n */\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this$serverErrors,\n _this17 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async,\n _options$silentCheck = options.silentCheck,\n silentCheck = _options$silentCheck === void 0 ? false : _options$silentCheck;\n if (this.shouldSkipValidation(data, dirty, row)) {\n this.setCustomValidity('');\n return async ? _nativePromiseOnly[\"default\"].resolve(true) : true;\n }\n var check = _Validator[\"default\"].checkComponent(this, data, row, true, async);\n var validations = check;\n if ((_this$serverErrors = this.serverErrors) !== null && _this$serverErrors !== void 0 && _this$serverErrors.length) {\n validations = check.concat(this.serverErrors);\n }\n return async ? validations.then(function (messages) {\n return _this17.setComponentValidity(messages, dirty, silentCheck);\n }) : this.setComponentValidity(validations, dirty, silentCheck);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n var isValid = this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n return _nativePromiseOnly[\"default\"].resolve(this.checkComponentValidity(data, dirty, row, {\n async: true,\n silentCheck: silentCheck\n }));\n }\n\n /**\n * Check the conditions, calculations, and validity of a single component and triggers an update if\n * something changed.\n *\n * @param data - The root data of the change event.\n * @param flags - The flags from this change event.\n *\n * @return boolean - If component is valid or not.\n */\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n\n // Needs for Nextgen Rules Engine\n this.resetCaches();\n\n // Do not trigger refresh if change was triggered on blur event since components with Refresh on Blur have their own listeners\n if (!flags.fromBlur) {\n this.checkRefreshOn(flags.changes, flags);\n }\n if (flags.noCheck) {\n return true;\n }\n this.checkComponentConditions(data, flags, row);\n if (this.id !== flags.triggeredComponentId) {\n this.calculateComponentValue(data, flags, row);\n }\n if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {\n if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {\n this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);\n }\n return true;\n }\n var isDirty = false;\n\n // We need to set dirty if they explicitly set noValidate to false.\n if (this.options.alwaysDirty || flags.dirty) {\n isDirty = true;\n }\n\n // See if they explicitely set the values with setSubmission.\n if (flags.fromSubmission && this.hasValue(data)) {\n isDirty = true;\n }\n this.setDirty(isDirty);\n if (this.component.validateOn === 'blur' && flags.fromSubmission) {\n return true;\n }\n var isValid = this.checkComponentValidity(data, isDirty, row, flags);\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkModal\",\n value: function checkModal() {\n var isValid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var dirty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!this.component.modalEdit || !this.componentModal) {\n return;\n }\n if (dirty && !isValid) {\n this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!this.errors.length, this.refs.openModalWrapper);\n } else {\n this.clearErrorClasses(this.refs.openModalWrapper);\n }\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmptyArray = _lodash[\"default\"].isArray(value) && value.length === 1 ? _lodash[\"default\"].isEqual(value[0], this.emptyValue) : false;\n return value == null || value.length === 0 || _lodash[\"default\"].isEqual(value, this.emptyValue) || isEmptyArray;\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(valueA) {\n var valueB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dataValue;\n return this.isEmpty(valueA) && this.isEmpty(valueB) || _lodash[\"default\"].isEqual(valueA, valueB);\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return true;\n }\n }, {\n key: \"errors\",\n get: function get() {\n return this.error ? [this.error] : [];\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n this.removeClass(element, this.options.componentErrorClass);\n this.removeClass(element, 'alert alert-danger');\n this.removeClass(element, 'has-error');\n this.removeClass(element, 'has-message');\n }\n }, {\n key: \"setInputWidgetErrorClasses\",\n value: function setInputWidgetErrorClasses(inputRefs, hasErrors) {\n if (!this.isInputComponent || !this.component.widget || !(inputRefs !== null && inputRefs !== void 0 && inputRefs.length)) {\n return;\n }\n inputRefs.forEach(function (input) {\n if (input !== null && input !== void 0 && input.widget && input.widget.setErrorClasses) {\n input.widget.setErrorClasses(hasErrors);\n }\n });\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this18 = this;\n this.addEventListener(element, 'focus', function () {\n if (_this18.root.focusedComponent !== _this18) {\n if (_this18.root.pendingBlur) {\n _this18.root.pendingBlur();\n }\n _this18.root.focusedComponent = _this18;\n _this18.emit('focus', _this18);\n } else if (_this18.root.focusedComponent === _this18 && _this18.root.pendingBlur) {\n _this18.root.pendingBlur.cancel();\n _this18.root.pendingBlur = null;\n }\n });\n this.addEventListener(element, 'blur', function () {\n _this18.root.pendingBlur = FormioUtils.delay(function () {\n _this18.emit('blur', _this18);\n if (_this18.component.validateOn === 'blur') {\n _this18.root.triggerChange({\n fromBlur: true\n }, {\n instance: _this18,\n component: _this18.component,\n value: _this18.dataValue,\n flags: {\n fromBlur: true\n }\n });\n }\n _this18.root.focusedComponent = null;\n _this18.root.pendingBlur = null;\n });\n });\n }\n }, {\n key: \"setCustomValidity\",\n value: function setCustomValidity(messages, dirty, external) {\n var _this19 = this;\n var inputRefs = this.isInputComponent ? this.refs.input || [] : null;\n if (typeof messages === 'string' && messages) {\n messages = {\n level: 'error',\n message: messages\n };\n }\n if (!Array.isArray(messages)) {\n if (messages) {\n messages = [messages];\n } else {\n messages = [];\n }\n }\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error';\n }).length;\n var invalidInputRefs = inputRefs;\n if (this.component.multiple) {\n var inputRefsArray = Array.from(inputRefs);\n inputRefsArray.forEach(function (input) {\n _this19.setElementInvalid(_this19.performInputMapping(input), false);\n });\n this.setInputWidgetErrorClasses(inputRefsArray, false);\n invalidInputRefs = inputRefsArray.filter(function (ref) {\n var _messages$some, _messages;\n return (_messages$some = (_messages = messages).some) === null || _messages$some === void 0 ? void 0 : _messages$some.call(_messages, function (msg) {\n var _msg$context;\n return (msg === null || msg === void 0 ? void 0 : (_msg$context = msg.context) === null || _msg$context === void 0 ? void 0 : _msg$context.input) === ref;\n });\n });\n }\n if (messages.length) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n this.error = {\n component: this.component,\n message: messages[0].message,\n messages: messages,\n external: !!external\n };\n this.emit('componentError', this.error);\n this.addMessages(messages, dirty, invalidInputRefs);\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n } else if (!this.error || this.error && this.error.external === !!external) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n if (this.refs.modalMessageContainer) {\n this.empty(this.refs.modalMessageContainer);\n }\n this.error = null;\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n this.clearErrorClasses();\n }\n\n // if (!this.refs.input) {\n // return;\n // }\n // this.refs.input.forEach(input => {\n // input = this.performInputMapping(input);\n // if (typeof input.setCustomValidity === 'function') {\n // input.setCustomValidity(message, dirty);\n // }\n // });\n }\n\n /**\n * Determines if the value of this component is hidden from the user as if it is coming from the server, but is\n * protected.\n *\n * @return {boolean|*}\n */\n }, {\n key: \"isValueHidden\",\n value: function isValueHidden() {\n if (this.component[\"protected\"] && this.root.editing) {\n return false;\n }\n if (!this.root || !this.root.hasOwnProperty('editing')) {\n return false;\n }\n if (!this.root || !this.root.editing) {\n return false;\n }\n return this.component[\"protected\"] || !this.component.persistent || this.component.persistent === 'client-only';\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n var _this20 = this;\n var _ref = this.component || {},\n _ref$validateWhenHidd = _ref.validateWhenHidden,\n validateWhenHidden = _ref$validateWhenHidd === void 0 ? false : _ref$validateWhenHidd;\n var rules = [\n // Force valid if component is read-only\n function () {\n return _this20.options.readOnly;\n },\n // Do not check validations if component is not an input component.\n function () {\n return !_this20.hasInput;\n },\n // Check to see if we are editing and if so, check component persistence.\n function () {\n return _this20.isValueHidden();\n },\n // Force valid if component is hidden.\n function () {\n return !_this20.visible && !validateWhenHidden;\n },\n // Force valid if component is conditionally hidden.\n function () {\n return !_this20.checkCondition(row, data) && !validateWhenHidden;\n }];\n return rules.some(function (pred) {\n return pred();\n });\n }\n\n // Maintain reverse compatibility.\n }, {\n key: \"whenReady\",\n value: function whenReady() {\n console.warn('The whenReady() method has been deprecated. Please use the dataReady property instead.');\n return this.dataReady;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n /**\n * Prints out the value of this component as a string value.\n */\n }, {\n key: \"asString\",\n value: function asString(value) {\n value = value || this.getValue();\n return (Array.isArray(value) ? value : [value]).map(_lodash[\"default\"].toString).join(', ');\n }\n\n /**\n * Return if the component is disabled.\n * @return {boolean}\n */\n }, {\n key: \"disabled\",\n get: function get() {\n return this._disabled || this.parentDisabled;\n }\n\n /**\n * Disable this component.\n *\n * @param {boolean} disabled\n */,\n set: function set(disabled) {\n this._disabled = disabled;\n }\n }, {\n key: \"setDisabled\",\n value: function setDisabled(element, disabled) {\n if (!element) {\n return;\n }\n element.disabled = disabled;\n if (disabled) {\n element.setAttribute('disabled', 'disabled');\n } else {\n element.removeAttribute('disabled');\n }\n }\n }, {\n key: \"setLoading\",\n value: function setLoading(element, loading) {\n if (!element || element.loading === loading) {\n return;\n }\n element.loading = loading;\n if (!element.loader && loading) {\n element.loader = this.ce('i', {\n \"class\": \"\".concat(this.iconClass('refresh', true), \" button-icon-right\")\n });\n }\n if (element.loader) {\n if (loading) {\n this.appendTo(element.loader, element);\n } else {\n this.removeChildFrom(element.loader, element);\n }\n }\n }\n }, {\n key: \"selectOptions\",\n value: function selectOptions(select, tag, options, defaultValue) {\n var _this21 = this;\n _lodash[\"default\"].each(options, function (option) {\n var attrs = {\n value: option.value\n };\n if (defaultValue !== undefined && option.value === defaultValue) {\n attrs.selected = 'selected';\n }\n var optionElement = _this21.ce('option', attrs);\n optionElement.appendChild(_this21.text(option.label));\n select.appendChild(optionElement);\n });\n }\n }, {\n key: \"setSelectValue\",\n value: function setSelectValue(select, value) {\n var options = select.querySelectorAll('option');\n _lodash[\"default\"].each(options, function (option) {\n if (option.value === value) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n if (select.onchange) {\n select.onchange();\n }\n if (select.onselect) {\n select.onselect();\n }\n }\n }, {\n key: \"getRelativePath\",\n value: function getRelativePath(path) {\n var keyPart = \".\".concat(this.key);\n var thisPath = this.isInputComponent ? this.path : this.path.slice(0).replace(keyPart, '');\n return path.replace(thisPath, '');\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.detach();\n this.empty(this.getElement());\n }\n }, {\n key: \"append\",\n value: function append(element) {\n this.appendTo(element, this.element);\n }\n }, {\n key: \"prepend\",\n value: function prepend(element) {\n this.prependTo(element, this.element);\n }\n }, {\n key: \"removeChild\",\n value: function removeChild(element) {\n this.removeChildFrom(element, this.element);\n }\n }, {\n key: \"detachLogic\",\n value: function detachLogic() {\n var _this22 = this;\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this22.interpolate(logic.trigger.event);\n _this22.off(event); // only applies to callbacks on this component\n }\n });\n }\n }, {\n key: \"attachLogic\",\n value: function attachLogic() {\n var _this23 = this;\n // Do not attach logic during builder mode.\n if (this.builderMode) {\n return;\n }\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this23.interpolate(logic.trigger.event);\n _this23.on(event, function () {\n var newComponent = (0, FormioUtils.fastCloneDeep)(_this23.originalComponent);\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n if (_this23.applyActions(newComponent, logic.actions, args)) {\n // If component definition changed, replace it.\n if (!_lodash[\"default\"].isEqual(_this23.component, newComponent)) {\n _this23.component = newComponent;\n var visible = _this23.conditionallyVisible(null, null);\n var disabled = _this23.shouldDisabled;\n\n // Change states which won't be recalculated during redrawing\n if (_this23.visible !== visible) {\n _this23.visible = visible;\n }\n if (_this23.disabled !== disabled) {\n _this23.disabled = disabled;\n }\n _this23.redraw();\n }\n }\n }, true);\n }\n });\n }\n\n /**\n * Get the element information.\n */\n }, {\n key: \"elementInfo\",\n value: function elementInfo() {\n var attributes = {\n name: this.options.name,\n type: this.component.inputType || 'text',\n \"class\": 'form-control',\n lang: this.options.language\n };\n if (this.component.placeholder) {\n attributes.placeholder = this.t(this.component.placeholder, {\n _userInput: true\n });\n }\n if (this.component.tabindex) {\n attributes.tabindex = this.component.tabindex;\n }\n if (this.disabled) {\n attributes.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attributes, this.component.attributes);\n return {\n type: 'input',\n component: this.component,\n changeEvent: 'change',\n attr: attributes\n };\n }\n }, {\n key: \"autofocus\",\n value: function autofocus() {\n var _this24 = this;\n var hasAutofocus = this.component.autofocus && !this.builderMode && !this.options.preview;\n if (hasAutofocus) {\n this.on('render', function () {\n return _this24.focus();\n }, true);\n }\n }\n }, {\n key: \"scrollIntoView\",\n value: function scrollIntoView() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n if (!element) {\n return;\n }\n var _element$getBoundingC = element.getBoundingClientRect(),\n left = _element$getBoundingC.left,\n top = _element$getBoundingC.top;\n window.scrollTo(left + window.scrollX, top + window.scrollY);\n }\n }, {\n key: \"focus\",\n value: function focus(index) {\n var _this$refs$input2;\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if ((_this$refs$input2 = this.refs.input) !== null && _this$refs$input2 !== void 0 && _this$refs$input2.length) {\n var _this$component$widge;\n var focusingInput = typeof index === 'number' && this.refs.input[index] ? this.refs.input[index] : this.refs.input[this.refs.input.length - 1];\n if (((_this$component$widge = this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.type) === 'calendar') {\n var sibling = focusingInput.nextSibling;\n if (sibling) {\n sibling.focus();\n }\n } else {\n focusingInput.focus();\n }\n }\n if (this.refs.openModal) {\n this.refs.openModal.focus();\n }\n if (this.parent.refs.openModal) {\n this.parent.refs.openModal.focus();\n }\n }\n\n /**\n * Get `Formio` instance for working with files\n */\n }, {\n key: \"fileService\",\n get: function get() {\n if (this.options.fileService) {\n return this.options.fileService;\n }\n if (this.options.formio) {\n return this.options.formio;\n }\n if (this.root && this.root.formio) {\n return this.root.formio;\n }\n var formio = new _Formio.GlobalFormio();\n // If a form is loaded, then make sure to set the correct formUrl.\n if (this.root && this.root._form && this.root._form._id) {\n formio.formUrl = \"\".concat(formio.projectUrl, \"/form/\").concat(this.root._form._id);\n }\n return formio;\n }\n }, {\n key: \"resetCaches\",\n value: function resetCaches() {}\n }, {\n key: \"previewMode\",\n get: function get() {\n return false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len5 = arguments.length, sources = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n sources[_key5] = arguments[_key5];\n }\n return _lodash[\"default\"].merge.apply(_lodash[\"default\"], [{\n /**\n * Determines if this component provides an input.\n */\n input: true,\n /**\n * The data key for this component (how the data is stored in the database).\n */\n key: '',\n /**\n * The input placeholder for this component.\n */\n placeholder: '',\n /**\n * The input prefix\n */\n prefix: '',\n /**\n * The custom CSS class to provide to this component.\n */\n customClass: '',\n /**\n * The input suffix.\n */\n suffix: '',\n /**\n * If this component should allow an array of values to be captured.\n */\n multiple: false,\n /**\n * The default value of this component.\n */\n defaultValue: null,\n /**\n * If the data of this component should be protected (no GET api requests can see the data)\n */\n \"protected\": false,\n /**\n * Validate if the value of this component should be unique within the form.\n */\n unique: false,\n /**\n * If the value of this component should be persisted within the backend api database.\n */\n persistent: true,\n /**\n * Determines if the component should be within the form, but not visible.\n */\n hidden: false,\n /**\n * If the component should be cleared when hidden.\n */\n clearOnHide: true,\n /**\n * This will refresh this component options when this field changes.\n */\n refreshOn: '',\n /**\n * This will redraw the component when this field changes.\n */\n redrawOn: '',\n /**\n * If this component should be included as a column within a submission table.\n */\n tableView: false,\n /**\n * If this component should be rendering in modal.\n */\n modalEdit: false,\n /**\n * The input label provided to this component.\n */\n label: '',\n dataGridLabel: false,\n labelPosition: 'top',\n description: '',\n errorLabel: '',\n tooltip: '',\n hideLabel: false,\n tabindex: '',\n disabled: false,\n autofocus: false,\n dbIndex: false,\n customDefaultValue: '',\n calculateValue: '',\n calculateServer: false,\n widget: null,\n /**\n * Attributes that will be assigned to the input elements of this component.\n */\n attributes: {},\n /**\n * This will perform the validation on either \"change\" or \"blur\" of the input element.\n */\n validateOn: 'change',\n /**\n * The validation criteria for this component.\n */\n validate: {\n /**\n * If this component is required.\n */\n required: false,\n /**\n * Custom JavaScript validation.\n */\n custom: '',\n /**\n * If the custom validation should remain private (only the backend will see it and execute it).\n */\n customPrivate: false,\n /**\n * If this component should implement a strict date validation if the Calendar widget is implemented.\n */\n strictDateValidation: false,\n multiple: false,\n unique: false\n },\n /**\n * The simple conditional settings for a component.\n */\n conditional: {\n show: null,\n when: null,\n eq: ''\n },\n overlay: {\n style: '',\n left: '',\n top: '',\n width: '',\n height: ''\n },\n allowCalculateOverride: false,\n encrypted: false,\n showCharCount: false,\n showWordCount: false,\n properties: {},\n allowMultipleMasks: false,\n addons: []\n }].concat(sources));\n }\n\n /**\n * Return the validator as part of the component.\n *\n * @return {ValidationChecker}\n * @constructor\n */\n }, {\n key: \"Validator\",\n get: function get() {\n return _Validator[\"default\"];\n }\n /**\n * Return the simple condition settings as part of the component.\n *\n * @return {Object}\n *\n */\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],\n valueComponent: function valueComponent() {\n return {\n type: 'textfield',\n widget: {\n type: 'input'\n }\n };\n }\n };\n }\n /**\n * Return the array of possible types of component value absed on its schema.\n *\n * @param schema\n * @return {Array}\n *\n */\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];\n }\n /**\n * Provides a table view for this component. Override if you wish to do something different than using getView\n * method of your instance.\n *\n * @param value\n * @param options\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"tableView\",\n value: function tableView(value, options) {}\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return Component.conditionOperatorsSettings;\n }\n }]);\n return Component;\n}(_Element2[\"default\"]);\nexports[\"default\"] = Component;\nComponent.externalLibraries = {};\nComponent.requireLibrary = function (name, property, src, polling) {\n if (!Component.externalLibraries.hasOwnProperty(name)) {\n Component.externalLibraries[name] = {};\n Component.externalLibraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Component.externalLibraries[name].resolve = resolve;\n Component.externalLibraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n this.resolve();\n }.bind(Component.externalLibraries[name]);\n }\n // See if the plugin already exists.\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n src = Array.isArray(src) ? src : [src];\n src.forEach(function (lib) {\n var attrs = {};\n var elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top page.\n var script = document.createElement(elementType);\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n setTimeout(function checkLibrary() {\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n // check again after 200 ms.\n setTimeout(checkLibrary, 200);\n }\n }, 200);\n }\n }\n }\n return Component.externalLibraries[name].ready;\n};\nComponent.libraryReady = function (name) {\n if (Component.externalLibraries.hasOwnProperty(name) && Component.externalLibraries[name].ready) {\n return Component.externalLibraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n};\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/component/Component.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ismobilejs = _interopRequireDefault(__webpack_require__(/*! ismobilejs */ \"./node_modules/ismobilejs/esm/index.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\"));\nvar _Validator = _interopRequireDefault(__webpack_require__(/*! ../../../validator/Validator */ \"./lib/validator/Validator.js\"));\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ../../../Element */ \"./lib/Element.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _widgets = _interopRequireDefault(__webpack_require__(/*! ../../../widgets */ \"./lib/widgets/index.js\"));\nvar _addons = _interopRequireDefault(__webpack_require__(/*! ../../../addons */ \"./lib/addons/index.js\"));\nvar _uploadAdapter = __webpack_require__(/*! ../../../providers/storage/uploadAdapter */ \"./lib/providers/storage/uploadAdapter.js\");\nvar _en = _interopRequireDefault(__webpack_require__(/*! ../../../translations/en */ \"./lib/translations/en.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar isIEBrowser = FormioUtils.getBrowserInfo().ie;\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ../../../templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\n\n/**\n * This is the Component class\n which all elements within the FormioForm derive from.\n */\nvar Component = /*#__PURE__*/function (_Element) {\n _inherits(Component, _Element);\n var _super = _createSuper(Component);\n /* eslint-enable no-unused-vars */\n\n /**\n * Initialize a new Component.\n *\n * @param {Object} component - The component JSON you wish to initialize.\n * @param {Object} options - The options for this component.\n * @param {Object} data - The global data submission object this component will belong.\n */\n /* eslint-disable max-statements */\n function Component(component, options, data) {\n var _this;\n _classCallCheck(this, Component);\n _this = _super.call(this, Object.assign({\n renderMode: 'form',\n attachMode: 'full',\n noDefaults: false\n }, options || {}));\n\n // Restore the component id.\n if (component && component.id) {\n _this.id = component.id;\n }\n\n /**\n * Determines if this component has a condition assigned to it.\n * @type {null}\n * @private\n */\n _this._hasCondition = null;\n\n /**\n * References to dom elements\n */\n _this.refs = {};\n\n // Allow global override for any component JSON.\n if (component && _this.options.components && _this.options.components[component.type]) {\n _lodash[\"default\"].merge(component, _this.options.components[component.type]);\n }\n\n /**\n * Set the validator instance.\n */\n _this.validator = _Validator[\"default\"];\n\n /**\n * The data path to this specific component instance.\n *\n * @type {string}\n */\n _this.path = '';\n\n /**\n * The Form.io component JSON schema.\n * @type {*}\n */\n _this.component = _this.mergeSchema(component || {});\n\n // Add the id to the component.\n _this.component.id = _this.id;\n _this.afterComponentAssign();\n\n // Save off the original component to be used in logic.\n _this.originalComponent = (0, FormioUtils.fastCloneDeep)(_this.component);\n\n /**\n * If the component has been attached\n */\n _this.attached = false;\n\n /**\n * If the component has been rendered\n */\n _this.rendered = false;\n\n /**\n * The data object in which this component resides.\n * @type {*}\n */\n _this._data = data || {};\n\n /**\n * The existing error that this component has.\n * @type {string}\n */\n _this.error = '';\n\n /**\n * Tool tip text after processing\n * @type {string}\n */\n _this.tooltip = '';\n\n /**\n * The row path of this component.\n * @type {number}\n */\n _this.row = _this.options.row;\n\n /**\n * Determines if this component is disabled, or not.\n *\n * @type {boolean}\n */\n _this._disabled = (0, FormioUtils.boolValue)(_this.component.disabled) ? _this.component.disabled : false;\n\n /**\n * Points to the root component, usually the FormComponent.\n *\n * @type {Component}\n */\n _this.root = _this.options.root;\n _this.localRoot = _this.options.localRoot;\n\n /**\n * If this input has been input and provided value.\n *\n * @type {boolean}\n */\n _this.pristine = true;\n\n /**\n * Points to the parent component.\n *\n * @type {Component}\n */\n _this.parent = _this.options.parent;\n _this.options.name = _this.options.name || 'data';\n\n /**\n * The validators that are assigned to this component.\n * @type {[string]}\n */\n _this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];\n _this._path = '';\n // Nested forms don't have parents so we need to pass their path in.\n _this._parentPath = _this.options.parentPath || '';\n\n // Needs for Nextgen Rules Engine\n _this.resetCaches();\n\n /**\n * Determines if this component is visible, or not.\n */\n _this._parentVisible = _this.options.hasOwnProperty('parentVisible') ? _this.options.parentVisible : true;\n _this._visible = _this._parentVisible && _this.conditionallyVisible(null, data);\n _this._parentDisabled = false;\n\n /**\n * Used to trigger a new change in this component.\n * @type {function} - Call to trigger a change in this component.\n */\n var changes = [];\n var lastChanged = null;\n var triggerArgs = [];\n var _triggerChange = _lodash[\"default\"].debounce(function () {\n var _this2;\n if (_this.root) {\n _this.root.changing = false;\n }\n triggerArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!args[1] && lastChanged) {\n // Set the changed component if one isn't provided.\n args[1] = lastChanged;\n }\n if (_lodash[\"default\"].isEmpty(args[0]) && lastChanged) {\n // Set the flags if it is empty and lastChanged exists.\n args[0] = lastChanged.flags;\n }\n lastChanged = null;\n args[3] = changes;\n var retVal = (_this2 = _this).onChange.apply(_this2, args);\n changes = [];\n return retVal;\n }, 100);\n _this.triggerChange = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args[1]) {\n // Make sure that during the debounce that we always track lastChanged component, even if they\n // don't provide one later.\n lastChanged = args[1];\n changes.push(lastChanged);\n }\n if (_this.root) {\n _this.root.changing = true;\n }\n if (args.length) {\n triggerArgs = args;\n }\n return _triggerChange.apply(void 0, _toConsumableArray(triggerArgs));\n };\n\n /**\n * Used to trigger a redraw event within this component.\n *\n * @type {Function}\n */\n _this.triggerRedraw = _lodash[\"default\"].debounce(_this.redraw.bind(_assertThisInitialized(_this)), 100);\n\n /**\n * list of attached tooltips\n * @type {Array}\n */\n _this.tooltips = [];\n\n /**\n * List of attached addons\n * @type {Array}\n */\n _this.addons = [];\n\n // To force this component to be invalid.\n _this.invalid = false;\n if (_this.component) {\n _this.type = _this.component.type;\n if (_this.allowData && _this.key) {\n _this.options.name += \"[\".concat(_this.key, \"]\");\n // If component is visible or not set to clear on hide, set the default value.\n if (_this.visible || !_this.component.clearOnHide) {\n if (!_this.hasValue()) {\n if (_this.shouldAddDefaultValue) {\n _this.dataValue = _this.defaultValue;\n }\n } else {\n // Ensure the dataValue is set.\n /* eslint-disable no-self-assign */\n _this.dataValue = _this.dataValue;\n /* eslint-enable no-self-assign */\n }\n }\n }\n\n /**\n * The element information for creating the input element.\n * @type {*}\n */\n _this.info = _this.elementInfo();\n }\n\n // Allow anyone to hook into the component creation.\n _this.hook('component');\n if (!_this.options.skipInit) {\n _this.init();\n }\n return _this;\n }\n /* eslint-enable max-statements */\n _createClass(Component, [{\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n }\n }, {\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _lodash[\"default\"].defaultsDeep(component, this.defaultSchema);\n }\n\n // Allow componets to notify when ready.\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve(this);\n }\n }, {\n key: \"isPDFReadOnlyMode\",\n get: function get() {\n return this.parent && this.parent.form && this.parent.form.display === 'pdf' && this.options.readOnly;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n var label = {};\n label.hidden = this.labelIsHidden();\n label.className = '';\n label.labelPosition = this.component.labelPosition;\n label.tooltipClass = \"\".concat(this.iconClass('question-sign'), \" text-muted\");\n var isPDFReadOnlyMode = this.isPDFReadOnlyMode;\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {\n label.className += ' field-required';\n }\n if (label.hidden) {\n label.className += ' control-label--hidden';\n }\n if (this.info.attr.id) {\n label[\"for\"] = this.info.attr.id;\n }\n return label;\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$component$addon,\n _this3 = this;\n this.disabled = this.shouldDisabled;\n this._visible = this.conditionallyVisible(null, null);\n if ((_this$component$addon = this.component.addons) !== null && _this$component$addon !== void 0 && _this$component$addon.length) {\n this.component.addons.forEach(function (addon) {\n return _this3.createAddon(addon);\n });\n }\n }\n }, {\n key: \"afterComponentAssign\",\n value: function afterComponentAssign() {\n //implement in extended classes\n }\n }, {\n key: \"createAddon\",\n value: function createAddon(addonConfiguration) {\n var _addonConfiguration$s;\n var name = addonConfiguration.name;\n if (!name) {\n return;\n }\n var settings = ((_addonConfiguration$s = addonConfiguration.settings) === null || _addonConfiguration$s === void 0 ? void 0 : _addonConfiguration$s.data) || {};\n var Addon = _addons[\"default\"][name.value];\n var addon = null;\n if (Addon) {\n var supportedComponents = Addon.info.supportedComponents;\n var supportsThisComponentType = !(supportedComponents !== null && supportedComponents !== void 0 && supportedComponents.length) || supportedComponents.indexOf(this.component.type) !== -1;\n if (supportsThisComponentType) {\n addon = new Addon(settings, this);\n this.addons.push(addon);\n } else {\n console.warn(\"Addon \".concat(name.label, \" does not support component of type \").concat(this.component.type, \".\"));\n }\n }\n return addon;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Component.prototype), \"destroy\", this).call(this);\n this.detach();\n this.addons.forEach(function (addon) {\n return addon.destroy();\n });\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return this.options.readOnly || this.component.disabled || this.options.hasOwnProperty('disabled') && this.options.disabled[this.key];\n }\n }, {\n key: \"isInputComponent\",\n get: function get() {\n return !this.component.hasOwnProperty('input') || this.component.input;\n }\n }, {\n key: \"allowData\",\n get: function get() {\n return this.hasInput;\n }\n }, {\n key: \"hasInput\",\n get: function get() {\n return this.isInputComponent || this.refs.input && this.refs.input.length;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return Component.schema();\n }\n }, {\n key: \"key\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'key', '');\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return this._parentVisible;\n },\n set: function set(value) {\n this._parentVisible = value;\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return this._parentDisabled;\n },\n set: function set(value) {\n this._parentDisabled = value;\n }\n }, {\n key: \"shouldForceVisibility\",\n value: function shouldForceVisibility(component, visibility) {\n if (!this.options[visibility]) {\n return false;\n }\n if (!component) {\n component = this.component;\n }\n if (_lodash[\"default\"].isArray(this.options[visibility])) {\n return this.options[visibility].includes(component.key);\n }\n return this.options[visibility][component.key];\n }\n }, {\n key: \"shouldForceHide\",\n value: function shouldForceHide(component) {\n return this.shouldForceVisibility(component, 'hide');\n }\n }, {\n key: \"shouldForceShow\",\n value: function shouldForceShow(component) {\n return this.shouldForceVisibility(component, 'show');\n }\n\n /**\n *\n * @param value {boolean}\n */\n }, {\n key: \"visible\",\n get:\n /**\n *\n * @returns {boolean}\n */\n function get() {\n // Show only if visibility changes or if we are in builder mode or if hidden fields should be shown.\n if (this.builderMode || this.previewMode || this.options.showHiddenFields) {\n return true;\n }\n if (this.shouldForceHide()) {\n return false;\n }\n if (this.shouldForceShow()) {\n return true;\n }\n return this._visible && this._parentVisible;\n },\n set: function set(value) {\n if (this._visible !== value) {\n // Skip if this component is set to visible and is supposed to be hidden.\n if (value && this.shouldForceHide()) {\n return;\n }\n // Skip if this component is set to hidden and is supposed to be shown.\n if (!value && this.shouldForceShow()) {\n return;\n }\n this._visible = value;\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n this._currentForm = instance;\n }\n }, {\n key: \"fullMode\",\n get: function get() {\n return this.options.attachMode === 'full';\n }\n }, {\n key: \"builderMode\",\n get: function get() {\n return this.options.attachMode === 'builder';\n }\n }, {\n key: \"calculatedPath\",\n get: function get() {\n console.error('component.calculatedPath was deprecated, use component.path instead.');\n return this.path;\n }\n }, {\n key: \"labelPosition\",\n get: function get() {\n return this.component.labelPosition;\n }\n }, {\n key: \"labelWidth\",\n get: function get() {\n var width = this.component.labelWidth;\n return width >= 0 ? width : 30;\n }\n }, {\n key: \"labelMargin\",\n get: function get() {\n var margin = this.component.labelMargin;\n return margin >= 0 ? margin : 3;\n }\n }, {\n key: \"isAdvancedLabel\",\n get: function get() {\n return ['left-left', 'left-right', 'right-left', 'right-right'].includes(this.labelPosition);\n }\n }, {\n key: \"labelPositions\",\n get: function get() {\n return this.labelPosition.split('-');\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return false;\n }\n }, {\n key: \"rightDirection\",\n value: function rightDirection(direction) {\n if (this.options.condensedMode) {\n return false;\n }\n return direction === 'right';\n }\n }, {\n key: \"getLabelInfo\",\n value: function getLabelInfo() {\n var isCondensed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var isRightPosition = this.rightDirection(this.labelPositions[0]);\n var isLeftPosition = this.labelPositions[0] === 'left' || isCondensed;\n var isRightAlign = this.rightDirection(this.labelPositions[1]);\n var contentMargin = '';\n if (this.component.hideLabel) {\n var margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;\n contentMargin = isRightPosition ? \"margin-right: \".concat(margin, \"%\") : '';\n contentMargin = isLeftPosition ? \"margin-left: \".concat(margin, \"%\") : '';\n }\n var labelStyles = \"\\n flex: \".concat(this.labelWidth, \";\\n \").concat(isRightPosition ? 'margin-left' : 'margin-right', \": \").concat(this.labelMargin, \"%;\\n \");\n var contentStyles = \"\\n flex: \".concat(100 - this.labelWidth - this.labelMargin, \";\\n \").concat(contentMargin, \";\\n \").concat(this.component.hideLabel ? \"max-width: \".concat(100 - this.labelWidth - this.labelMargin) : '', \";\\n \");\n return {\n isRightPosition: isRightPosition,\n isRightAlign: isRightAlign,\n labelStyles: labelStyles,\n contentStyles: contentStyles\n };\n }\n\n /**\n * Returns only the schema that is different from the default.\n *\n * @param schema\n * @param defaultSchema\n */\n }, {\n key: \"getModifiedSchema\",\n value: function getModifiedSchema(schema, defaultSchema, recursion) {\n var _this4 = this;\n var modified = {};\n if (!defaultSchema) {\n return schema;\n }\n _lodash[\"default\"].each(schema, function (val, key) {\n if (!_lodash[\"default\"].isArray(val) && _lodash[\"default\"].isObject(val) && defaultSchema.hasOwnProperty(key)) {\n var subModified = _this4.getModifiedSchema(val, defaultSchema[key], true);\n if (!_lodash[\"default\"].isEmpty(subModified)) {\n modified[key] = subModified;\n }\n } else if (_lodash[\"default\"].isArray(val)) {\n if (val.length !== 0 && !_lodash[\"default\"].isEqual(val, defaultSchema[key])) {\n modified[key] = val;\n }\n } else if (!recursion && key === 'type' || !recursion && key === 'key' || !recursion && key === 'label' || !recursion && key === 'input' || !recursion && key === 'tableView' || val !== '' && !defaultSchema.hasOwnProperty(key) || val !== '' && val !== defaultSchema[key] || defaultSchema[key] && val !== defaultSchema[key]) {\n modified[key] = val;\n }\n });\n return modified;\n }\n\n /**\n * Returns the JSON schema for this component.\n */\n }, {\n key: \"schema\",\n get: function get() {\n return (0, FormioUtils.fastCloneDeep)(this.getModifiedSchema(_lodash[\"default\"].omit(this.component, 'id'), this.defaultSchema));\n }\n\n /**\n * Returns true if component is inside DataGrid\n */\n }, {\n key: \"isInDataGrid\",\n get: function get() {\n return this.inDataGrid;\n }\n\n /**\n * Translate a text using the i18n system.\n *\n * @param {string} text - The i18n identifier.\n * @param {Object} params - The i18n parameters to use for translation.\n */\n }, {\n key: \"t\",\n value: function t(text) {\n var _get2;\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) {\n return '';\n }\n // Use _userInput: true to ignore translations from defaults\n if (text in _en[\"default\"] && params._userInput) {\n return text;\n }\n params.data = this.rootValue;\n params.row = this.data;\n params.component = this.component;\n for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n return (_get2 = _get(_getPrototypeOf(Component.prototype), \"t\", this)).call.apply(_get2, [this, text, params].concat(args));\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return !this.component.label || (!this.isInDataGrid && this.component.hideLabel || this.isInDataGrid && !this.component.dataGridLabel || this.options.inputsOnly) && !this.builderMode;\n }\n }, {\n key: \"transform\",\n value: function transform(type, value) {\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n return frameworkTemplates.hasOwnProperty('transform') ? frameworkTemplates.transform(type, value) : function (type, value) {\n return value;\n };\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(names, modes) {\n modes = Array.isArray(modes) ? modes : [modes];\n names = Array.isArray(names) ? names : [names];\n if (!modes.includes('form')) {\n modes.push('form');\n }\n var result = null;\n if (this.options.templates) {\n result = this.checkTemplate(this.options.templates, names, modes);\n if (result) {\n return result;\n }\n }\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n result = this.checkTemplate(frameworkTemplates, names, modes);\n if (result) {\n return result;\n }\n\n // Default back to bootstrap if not defined.\n var name = names[names.length - 1];\n var templatesByName = Templates.defaultTemplates[name];\n if (!templatesByName) {\n return \"Unknown template: \".concat(name);\n }\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n return templatesByName.form;\n }\n }, {\n key: \"checkTemplate\",\n value: function checkTemplate(templates, names, modes) {\n var _iterator = _createForOfIteratorHelper(names),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var name = _step.value;\n var templatesByName = templates[name];\n if (templatesByName) {\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"checkTemplateMode\",\n value: function checkTemplateMode(templatesByName, modes) {\n var _iterator2 = _createForOfIteratorHelper(modes),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mode = _step2.value;\n var templateByMode = templatesByName[mode];\n if (templateByMode) {\n return templateByMode;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n return null;\n }\n }, {\n key: \"getFormattedAttribute\",\n value: function getFormattedAttribute(attr) {\n return attr ? this.t(attr, {\n _userInput: true\n }).replace(/\"/g, '"') : '';\n }\n }, {\n key: \"getFormattedTooltip\",\n value: function getFormattedTooltip(tooltipValue) {\n var tooltip = this.interpolate(tooltipValue || '').replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n return this.getFormattedAttribute(tooltip);\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return this.options.renderMode === 'html';\n }\n }, {\n key: \"renderTemplate\",\n value: function renderTemplate(name) {\n var _this5 = this;\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var modeOption = arguments.length > 2 ? arguments[2] : undefined;\n // Need to make this fall back to form if renderMode is not found similar to how we search templates.\n var mode = modeOption || this.options.renderMode || 'form';\n data.component = this.component;\n data.self = this;\n data.options = this.options;\n data.readOnly = this.options.readOnly;\n data.iconClass = this.iconClass.bind(this);\n data.size = this.size.bind(this);\n data.t = this.t.bind(this);\n data.transform = this.transform.bind(this);\n data.id = data.id || this.id;\n data.key = data.key || this.key;\n data.value = data.value || this.dataValue;\n data.disabled = this.disabled;\n data.builder = this.builderMode;\n data.render = function () {\n console.warn(\"Form.io 'render' template function is deprecated.\\n If you need to render template (template A) inside of another template (template B),\\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B\");\n return _this5.renderTemplate.apply(_this5, arguments);\n };\n data.label = data.labelInfo || this.labelInfo;\n data.tooltip = this.getFormattedTooltip(this.component.tooltip);\n\n // Allow more specific template names\n var names = [\"\".concat(name, \"-\").concat(this.component.type, \"-\").concat(this.key), \"\".concat(name, \"-\").concat(this.component.type), \"\".concat(name, \"-\").concat(this.key), \"\".concat(name)];\n\n // Allow template alters.\n return this.hook(\"render\".concat(name.charAt(0).toUpperCase() + name.substring(1, name.length)), this.interpolate(this.getTemplate(names, mode), data), data, mode);\n }\n\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n }, {\n key: \"sanitize\",\n value: function sanitize(dirty, forceSanitize, options) {\n var _this$options;\n if (!this.shouldSanitizeValue && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, {\n sanitizeConfig: _lodash[\"default\"].merge(((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.sanitizeConfig) || {}, options || {})\n });\n }\n\n /**\n * Render a template string into html.\n *\n * @param template\n * @param data\n * @param actions\n *\n * @return {HTMLElement|String} - The created element or an empty string if template is not specified.\n */\n }, {\n key: \"renderString\",\n value: function renderString(template, data) {\n if (!template) {\n return '';\n }\n // Interpolate the template and populate\n return this.interpolate(template, data);\n }\n }, {\n key: \"performInputMapping\",\n value: function performInputMapping(input) {\n return input;\n }\n }, {\n key: \"widget\",\n get: function get() {\n var _this$root;\n var settings = this.component.widget;\n if (settings && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.shadowRoot) {\n settings.shadowRoot = this.root.shadowRoot;\n }\n var widget = settings && _widgets[\"default\"][settings.type] ? new _widgets[\"default\"][settings.type](settings, this.component, this) : null;\n return widget;\n }\n }, {\n key: \"getBrowserLanguage\",\n value: function getBrowserLanguage() {\n var nav = window.navigator;\n var browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];\n var language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (Array.isArray(nav.languages)) {\n for (var i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n }\n\n // support for other well known properties in browsers\n for (var _i = 0; _i < browserLanguagePropertyKeys.length; _i++) {\n language = nav[browserLanguagePropertyKeys[_i]];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n return null;\n }\n\n /**\n * Called before a next and previous page is triggered allowing the components\n * to perform special functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n }, {\n key: \"beforeNext\",\n value: function beforeNext() {\n return this.beforePage(true);\n }\n\n /**\n * Called before a submission is triggered allowing the components\n * to perform special async functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n\n /**\n * Return the submission timezone.\n *\n * @return {*}\n */\n }, {\n key: \"submissionTimezone\",\n get: function get() {\n this.options.submissionTimezone = this.options.submissionTimezone || _lodash[\"default\"].get(this.root, 'options.submissionTimezone');\n return this.options.submissionTimezone;\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.getTimezone(this.component);\n }\n }, {\n key: \"getTimezone\",\n value: function getTimezone(settings) {\n if (settings.timezone) {\n return settings.timezone;\n }\n if (settings.displayInTimezone === 'utc') {\n return 'UTC';\n }\n var submissionTimezone = this.submissionTimezone;\n if (submissionTimezone && (settings.displayInTimezone === 'submission' || (this.options.pdf || this.options.server) && settings.displayInTimezone === 'viewer')) {\n return submissionTimezone;\n }\n\n // Return current timezone if none are provided.\n return (0, FormioUtils.currentTimezone)();\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n for (var ref in refs) {\n var refType = refs[ref];\n var isString = typeof refType === 'string';\n var selector = isString && refType.includes('scope') ? \":scope > [ref=\\\"\".concat(ref, \"\\\"]\") : \"[ref=\\\"\".concat(ref, \"\\\"]\");\n if (isString && refType.startsWith('single')) {\n this.refs[ref] = element.querySelector(selector);\n } else {\n this.refs[ref] = element.querySelectorAll(selector);\n }\n }\n }\n }, {\n key: \"setOpenModalElement\",\n value: function setOpenModalElement(template) {\n this.componentModal.setOpenModalElement(template || this.getModalPreviewTemplate());\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n var _this$component$valid;\n var dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;\n var message = this.error ? {\n level: 'error',\n message: this.error.message\n } : '';\n var modalLabel;\n if (this.hasInput && (_this$component$valid = this.component.validate) !== null && _this$component$valid !== void 0 && _this$component$valid.required && !this.isPDFReadOnlyMode) {\n modalLabel = {\n className: 'field-required'\n };\n }\n return this.renderTemplate('modalPreview', {\n previewText: this.getValueAsString(dataValue, {\n modalPreview: true\n }) || this.t('Click to set value'),\n messages: message && this.renderTemplate('message', message),\n labelInfo: modalLabel\n });\n }\n }, {\n key: \"build\",\n value: function build(element) {\n element = element || this.element;\n this.empty(element);\n this.setContent(element, this.render());\n return this.attach(element);\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"Unknown component: \".concat(this.component.type);\n var topLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isVisible = this.visible;\n this.rendered = true;\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n return _ComponentModal[\"default\"].render(this, {\n visible: isVisible,\n showSaveButton: this.hasModalSaveButton,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n } else {\n return this.renderTemplate('component', {\n visible: isVisible,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n }\n }\n }, {\n key: \"attachTooltips\",\n value: function attachTooltips(toolTipsRefs) {\n var _this6 = this;\n toolTipsRefs === null || toolTipsRefs === void 0 ? void 0 : toolTipsRefs.forEach(function (tooltip, index) {\n if (tooltip) {\n var tooltipAttribute = tooltip.getAttribute('data-tooltip');\n var tooltipDataTitle = tooltip.getAttribute('data-title');\n var tooltipText = _this6.interpolate(tooltipDataTitle || tooltipAttribute).replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n _this6.tooltips[index] = (0, _tippy[\"default\"])(tooltip, {\n allowHTML: true,\n trigger: 'mouseenter click focus',\n placement: 'right',\n zIndex: 10000,\n interactive: true,\n content: _this6.t(_this6.sanitize(tooltipText), {\n _userInput: true\n })\n });\n }\n });\n }\n }, {\n key: \"createComponentModal\",\n value: function createComponentModal(element, modalShouldBeOpened, currentValue) {\n return new _ComponentModal[\"default\"](this, element, modalShouldBeOpened, currentValue);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n var modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;\n var openModalTemplate = this.componentModal && modalShouldBeOpened ? this.componentModal.openModalTemplate : null;\n this.componentModal = this.createComponentModal(element, modalShouldBeOpened, currentValue);\n this.setOpenModalElement(openModalTemplate);\n }\n this.attached = true;\n this.element = element;\n element.component = this;\n\n // If this already has an id, get it from the dom. If SSR, it could be different from the initiated id.\n if (this.element.id) {\n this.id = this.element.id;\n this.component.id = this.id;\n }\n this.loadRefs(element, {\n messageContainer: 'single',\n tooltip: 'multiple'\n });\n this.attachTooltips(this.refs.tooltip);\n\n // Attach logic.\n this.attachLogic();\n this.autofocus();\n\n // Allow global attach.\n this.hook('attachComponent', element, this);\n // Allow attach per component type.\n var type = this.component.type;\n if (type) {\n this.hook(\"attach\".concat(type.charAt(0).toUpperCase() + type.substring(1, type.length)), element, this);\n }\n this.restoreFocus();\n this.addons.forEach(function (addon) {\n return addon.attach(element);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"restoreFocus\",\n value: function restoreFocus() {\n var _this$root2, _this$root2$focusedCo;\n var isFocused = ((_this$root2 = this.root) === null || _this$root2 === void 0 ? void 0 : (_this$root2$focusedCo = _this$root2.focusedComponent) === null || _this$root2$focusedCo === void 0 ? void 0 : _this$root2$focusedCo.path) === this.path;\n if (isFocused) {\n var _this$root$currentSel;\n this.loadRefs(this.element, {\n input: 'multiple'\n });\n this.focus((_this$root$currentSel = this.root.currentSelection) === null || _this$root$currentSel === void 0 ? void 0 : _this$root$currentSel.index);\n this.restoreCaretPosition();\n }\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || !this.root || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.addShortcut(element, shortcut);\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.removeShortcut(element, shortcut);\n }\n\n /**\n * Remove all event handlers.\n */\n }, {\n key: \"detach\",\n value: function detach() {\n this.refs = {};\n this.removeEventListeners();\n this.detachLogic();\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n }\n }, {\n key: \"checkRefresh\",\n value: function checkRefresh(refreshData, changed, flags) {\n var changePath = _lodash[\"default\"].get(changed, 'instance.path', false);\n // Don't let components change themselves.\n if (changePath && this.path === changePath) {\n return;\n }\n if (refreshData === 'data') {\n this.refresh(this.data, changed, flags);\n } else if (changePath && (0, FormioUtils.getComponentPath)(changed.instance) === refreshData && changed && changed.instance &&\n // Make sure the changed component is not in a different \"context\". Solves issues where refreshOn being set\n // in fields inside EditGrids could alter their state from other rows (which is bad).\n this.inContext(changed.instance)) {\n this.refresh(changed.value, changed, flags);\n }\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changes) {\n var _this7 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n changes = changes || [];\n if (flags.noRefresh) {\n return;\n }\n if (!changes.length && flags.changed) {\n changes = [flags.changed];\n }\n var refreshOn = flags.fromBlur ? this.component.refreshOnBlur : this.component.refreshOn || this.component.redrawOn;\n // If they wish to refresh on a value, then add that here.\n if (refreshOn) {\n if (Array.isArray(refreshOn)) {\n refreshOn.forEach(function (refreshData) {\n return changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshData, changed, flags);\n });\n });\n } else {\n changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshOn, changed, flags);\n });\n }\n }\n }\n\n /**\n * Refreshes the component with a new value.\n *\n * @param value\n */\n }, {\n key: \"refresh\",\n value: function refresh(value) {\n if (this.hasOwnProperty('refreshOnValue')) {\n this.refreshOnChanged = !_lodash[\"default\"].isEqual(value, this.refreshOnValue);\n } else {\n this.refreshOnChanged = true;\n }\n this.refreshOnValue = (0, FormioUtils.fastCloneDeep)(value);\n if (this.refreshOnChanged) {\n if (this.component.clearOnRefresh) {\n this.setValue(null);\n }\n this.triggerRedraw();\n }\n }\n\n /**\n * Checks to see if a separate component is in the \"context\" of this component. This is determined by first checking\n * if they share the same \"data\" object. It will then walk up the parent tree and compare its parents data objects\n * with the components data and returns true if they are in the same context.\n *\n * Different rows of the same EditGrid, for example, are in different contexts.\n *\n * @param component\n */\n }, {\n key: \"inContext\",\n value: function inContext(component) {\n if (component.data === this.data) {\n return true;\n }\n var parent = this.parent;\n while (parent) {\n if (parent.data === component.data) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n }\n }, {\n key: \"viewOnly\",\n get: function get() {\n return this.options.readOnly && this.options.viewAsHtml;\n }\n }, {\n key: \"createViewOnlyElement\",\n value: function createViewOnlyElement() {\n this.element = this.ce('dl', {\n id: this.id\n });\n if (this.element) {\n // Ensure you can get the component info from the element.\n this.element.component = this;\n }\n return this.element;\n }\n }, {\n key: \"defaultViewOnlyValue\",\n get: function get() {\n return '-';\n }\n\n /**\n * Uses the widget to determine the output string.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getWidgetValueAsString\",\n value: function getWidgetValueAsString(value, options) {\n var _this8 = this;\n var noInputWidget = !this.refs.input || !this.refs.input[0] || !this.refs.input[0].widget;\n if (!value || noInputWidget) {\n if (!this.widget || !value) {\n return value;\n } else {\n return this.widget.getValueAsString(value);\n }\n }\n if (Array.isArray(value)) {\n var values = [];\n value.forEach(function (val, index) {\n var widget = _this8.refs.input[index] && _this8.refs.input[index].widget;\n if (widget) {\n values.push(widget.getValueAsString(val, options));\n }\n });\n return values;\n }\n var widget = this.refs.input[0].widget;\n return widget.getValueAsString(value, options);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.join(', ');\n }\n if (_lodash[\"default\"].isPlainObject(value)) {\n return JSON.stringify(value);\n }\n if (value === null || value === undefined) {\n return '';\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue);\n }\n }, {\n key: \"getView\",\n value: function getView(value, options) {\n if (this.component[\"protected\"]) {\n return '--- PROTECTED ---';\n }\n return this.getValueAsString(value, options);\n }\n }, {\n key: \"updateItems\",\n value: function updateItems() {\n this.restoreValue();\n this.onChange.apply(this, arguments);\n }\n\n /**\n * @param {*} data\n * @param {boolean} [forceUseValue=false] - if true, return 'value' property of the data\n * @return {*}\n */\n }, {\n key: \"itemValue\",\n value: function itemValue(data) {\n var forceUseValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (_lodash[\"default\"].isObject(data) && !_lodash[\"default\"].isArray(data)) {\n if (this.valueProperty) {\n return _lodash[\"default\"].get(data, this.valueProperty);\n }\n if (forceUseValue) {\n return data.value;\n }\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this9 = this;\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this9.itemValueForHTMLMode(item) : _this9.itemValue(item);\n });\n return values.join(', ');\n }\n return this.itemValue(value);\n }\n }, {\n key: \"createModal\",\n value: function createModal(element, attr, confirm) {\n var _this10 = this;\n var dialog = this.ce('div', attr || {});\n this.setContent(dialog, this.renderTemplate('dialog'));\n\n // Add refs to dialog, not \"this\".\n dialog.refs = {};\n this.loadRefs.call(dialog, dialog, {\n dialogOverlay: 'single',\n dialogContents: 'single',\n dialogClose: 'single'\n });\n dialog.refs.dialogContents.appendChild(element);\n document.body.appendChild(dialog);\n document.body.classList.add('modal-open');\n dialog.close = function () {\n document.body.classList.remove('modal-open');\n dialog.dispatchEvent(new CustomEvent('close'));\n };\n this.addEventListener(dialog, 'close', function () {\n return _this10.removeChildFrom(dialog, document.body);\n });\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var handleCloseClick = function handleCloseClick(e) {\n if (confirm) {\n confirm().then(function () {\n return close(e);\n })[\"catch\"](function () {});\n } else {\n close(e);\n }\n };\n this.addEventListener(dialog.refs.dialogOverlay, 'click', handleCloseClick);\n this.addEventListener(dialog.refs.dialogClose, 'click', handleCloseClick);\n return dialog;\n }\n }, {\n key: \"optimizeRedraw\",\n get: function get() {\n if (this.options.optimizeRedraw && this.element && !this.visible) {\n this.addClass(this.element, 'formio-removed');\n return true;\n }\n return false;\n }\n\n /**\n * Retrieves the CSS class name of this component.\n * @returns {string} - The class name of this component.\n */\n }, {\n key: \"className\",\n get: function get() {\n var className = this.hasInput ? \"\".concat(this.transform('class', 'form-group'), \" has-feedback \") : '';\n className += \"formio-component formio-component-\".concat(this.component.type, \" \");\n // TODO: find proper way to avoid overriding of default type-based component styles\n if (this.key && this.key !== 'form') {\n className += \"formio-component-\".concat(this.key, \" \");\n }\n if (this.component.multiple) {\n className += 'formio-component-multiple ';\n }\n if (this.component.customClass) {\n className += this.component.customClass;\n }\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required)) {\n className += ' required';\n }\n if (this.labelIsHidden()) {\n className += ' formio-component-label-hidden';\n }\n if (!this.visible) {\n className += ' formio-hidden';\n }\n return className;\n }\n\n /**\n * Build the custom style from the layout values\n * @return {string} - The custom style\n */\n }, {\n key: \"customStyle\",\n get: function get() {\n var customCSS = '';\n _lodash[\"default\"].each(this.component.style, function (value, key) {\n if (value !== '') {\n customCSS += \"\".concat(key, \":\").concat(value, \";\");\n }\n });\n return customCSS;\n }\n }, {\n key: \"isMobile\",\n get: function get() {\n return (0, _ismobilejs[\"default\"])();\n }\n\n /**\n * Returns the outside wrapping element of this component.\n * @returns {HTMLElement}\n */\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n\n /**\n * Create an evaluation context for all script executions and interpolations.\n *\n * @param additional\n * @return {*}\n */\n }, {\n key: \"evalContext\",\n value: function evalContext(additional) {\n return _get(_getPrototypeOf(Component.prototype), \"evalContext\", this).call(this, Object.assign({\n component: this.component,\n row: this.data,\n rowIndex: this.rowIndex,\n data: this.rootValue,\n iconClass: this.iconClass.bind(this),\n // Bind the translate function to the data context of any interpolated string.\n // It is useful to translate strings in different scenarions (eg: custom edit grid templates, custom error messages etc.)\n // and desirable to be publicly available rather than calling the internal {instance.t} function in the template string.\n t: this.t.bind(this),\n submission: this.root ? this.root._submission : {\n data: this.rootValue\n },\n form: this.root ? this.root._form : {},\n options: this.options\n }, additional));\n }\n\n /**\n * Sets the pristine flag for this component.\n *\n * @param pristine {boolean} - TRUE to make pristine, FALSE not pristine.\n */\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n this.pristine = pristine;\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine;\n }\n }, {\n key: \"setDirty\",\n value: function setDirty(dirty) {\n this.dirty = dirty;\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty;\n }\n\n /**\n * Removes a value out of the data array and rebuild the rows.\n * @param {number} index - The index of the data element to remove.\n */\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.splice(index);\n this.redraw();\n this.restoreValue();\n this.triggerRootChange();\n }\n }, {\n key: \"iconClass\",\n value: function iconClass(name, spinning) {\n var iconset = this.options.iconset || Templates.current.defaultIconset || 'fa';\n return Templates.current.hasOwnProperty('iconClass') ? Templates.current.iconClass(iconset, name, spinning) : this.options.iconset === 'fa' ? Templates.defaultTemplates.iconClass(iconset, name, spinning) : name;\n }\n }, {\n key: \"size\",\n value: function size(_size) {\n return Templates.current.hasOwnProperty('size') ? Templates.current.size(_size) : _size;\n }\n\n /**\n * The readible name for this component.\n * @returns {string} - The name of the component.\n */\n }, {\n key: \"name\",\n get: function get() {\n return this.t(this.component.label || this.component.placeholder || this.key, {\n _userInput: true\n });\n }\n\n /**\n * Returns the error label for this component.\n * @return {*}\n */\n }, {\n key: \"errorLabel\",\n get: function get() {\n return this.t(this.component.errorLabel || this.component.label || this.component.placeholder || this.key);\n }\n\n /**\n * Get the error message provided a certain type of error.\n * @param type\n * @return {*}\n */\n }, {\n key: \"errorMessage\",\n value: function errorMessage(type) {\n return this.component.errors && this.component.errors[type] ? this.component.errors[type] : type;\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize, sanitizeOptions) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize, sanitizeOptions);\n return true;\n }\n return false;\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root3;\n if ((_this$root3 = this.root) !== null && _this$root3 !== void 0 && _this$root3.currentSelection) {\n var _this$refs$input;\n if ((_this$refs$input = this.refs.input) !== null && _this$refs$input !== void 0 && _this$refs$input.length) {\n var _this$root$currentSel2 = this.root.currentSelection,\n selection = _this$root$currentSel2.selection,\n index = _this$root$currentSel2.index;\n var input = this.refs.input[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (input) {\n if (isInputRangeSelectable(input)) {\n var _input;\n (_input = input).setSelectionRange.apply(_input, _toConsumableArray(selection));\n }\n } else {\n var _input$value;\n input = this.refs.input[this.refs.input.length];\n var lastCharacter = ((_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length) || 0;\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange(lastCharacter, lastCharacter);\n }\n }\n }\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element || !this.element.parentNode || this.optimizeRedraw) {\n // Return a non-resolving promise.\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.detach();\n this.emit('redraw');\n // Since we are going to replace the element, we need to know it's position so we can find it in the parent's children.\n var parent = this.element.parentNode;\n var index = Array.prototype.indexOf.call(parent.children, this.element);\n this.element.outerHTML = this.sanitize(this.render());\n this.element = parent.children[index];\n return this.attach(this.element);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n this.destroy();\n this.init();\n this.visible = this.conditionallyVisible(null, null);\n return this.redraw();\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n _get(_getPrototypeOf(Component.prototype), \"removeEventListeners\", this).call(this);\n this.tooltips.forEach(function (tooltip) {\n return tooltip.destroy();\n });\n this.tooltips = [];\n }\n }, {\n key: \"hasClass\",\n value: function hasClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"hasClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"addClass\",\n value: function addClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"addClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"removeClass\", this).call(this, element, this.transform('class', className));\n }\n\n /**\n * Determines if this component has a condition defined.\n *\n * @return {null}\n */\n }, {\n key: \"hasCondition\",\n value: function hasCondition() {\n if (this._hasCondition !== null) {\n return this._hasCondition;\n }\n this._hasCondition = FormioUtils.hasCondition(this.component);\n return this._hasCondition;\n }\n\n /**\n * Check if this component is conditionally visible.\n *\n * @param data\n * @return {boolean}\n */\n }, {\n key: \"conditionallyVisible\",\n value: function conditionallyVisible(data, row) {\n data = data || this.rootValue;\n row = row || this.data;\n if (this.builderMode || this.previewMode || !this.hasCondition()) {\n return !this.component.hidden;\n }\n data = data || (this.root ? this.root.data : {});\n return this.checkCondition(row, data);\n }\n\n /**\n * Checks the condition of this component.\n *\n * TODO: Switch row and data parameters to be consistent with other methods.\n *\n * @param row - The row contextual data.\n * @param data - The global data object.\n * @return {boolean} - True if the condition applies to this component.\n */\n }, {\n key: \"checkCondition\",\n value: function checkCondition(row, data) {\n return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);\n }\n\n /**\n * Check for conditionals and hide/show the element based on those conditions.\n */\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n if (!this.builderMode & !this.previewMode && this.fieldLogic(data, row)) {\n this.redraw();\n }\n\n // Check advanced conditions\n var visible = this.conditionallyVisible(data, row);\n if (this.visible !== visible) {\n this.visible = visible;\n }\n return visible;\n }\n\n /**\n * Checks conditions for this component and any sub components.\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.checkComponentConditions(data, flags, row);\n }\n }, {\n key: \"logic\",\n get: function get() {\n return this.component.logic || [];\n }\n\n /**\n * Check all triggers and apply necessary actions.\n *\n * @param data\n */\n }, {\n key: \"fieldLogic\",\n value: function fieldLogic(data, row) {\n var _this11 = this;\n data = data || this.rootValue;\n row = row || this.data;\n var logics = this.logic;\n\n // If there aren't logic, don't go further.\n if (logics.length === 0) {\n return;\n }\n var newComponent = (0, FormioUtils.fastCloneDeep)(this.originalComponent);\n var changed = logics.reduce(function (changed, logic) {\n var result = FormioUtils.checkTrigger(newComponent, logic.trigger, row, data, _this11.root ? _this11.root._form : {}, _this11);\n return (result ? _this11.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;\n }, false);\n\n // If component definition changed, replace and mark as changed.\n if (!_lodash[\"default\"].isEqual(this.component, newComponent)) {\n this.component = newComponent;\n changed = true;\n var disabled = this.shouldDisabled;\n // Change disabled state if it has changed\n if (this.disabled !== disabled) {\n this.disabled = disabled;\n }\n }\n return changed;\n }\n }, {\n key: \"isIE\",\n value: function isIE() {\n if (typeof window === 'undefined') {\n return false;\n }\n var userAgent = window.navigator.userAgent;\n var msie = userAgent.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(userAgent.substring(msie + 5, userAgent.indexOf('.', msie)), 10);\n }\n var trident = userAgent.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = userAgent.indexOf('rv:');\n return parseInt(userAgent.substring(rv + 3, userAgent.indexOf('.', rv)), 10);\n }\n var edge = userAgent.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(userAgent.substring(edge + 5, userAgent.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }\n }, {\n key: \"defineActionValue\",\n value: function defineActionValue(action, argsObject) {\n return this.evaluate(action.value, argsObject, 'value');\n }\n }, {\n key: \"applyActions\",\n value: function applyActions(newComponent, actions, result, row, data) {\n var _this12 = this;\n data = data || this.rootValue;\n row = row || this.data;\n return actions.reduce(function (changed, action) {\n switch (action.type) {\n case 'property':\n {\n FormioUtils.setActionProperty(newComponent, action, result, row, data, _this12);\n var property = action.property.value;\n if (!_lodash[\"default\"].isEqual(_lodash[\"default\"].get(_this12.component, property), _lodash[\"default\"].get(newComponent, property))) {\n changed = true;\n }\n break;\n }\n case 'value':\n {\n var oldValue = _this12.getValue();\n var newValue = _this12.defineActionValue(action, {\n value: _lodash[\"default\"].clone(oldValue),\n data: data,\n row: row,\n component: newComponent,\n result: result\n });\n if (!_lodash[\"default\"].isEqual(oldValue, newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = newValue;\n }\n changed = true;\n }\n break;\n }\n case 'mergeComponentSchema':\n {\n var schema = _this12.evaluate(action.schemaDefinition, {\n value: _lodash[\"default\"].clone(_this12.getValue()),\n data: data,\n row: row,\n component: newComponent,\n result: result\n }, 'schema');\n _lodash[\"default\"].assign(newComponent, schema);\n if (!_lodash[\"default\"].isEqual(_this12.component, newComponent)) {\n changed = true;\n }\n break;\n }\n case 'customAction':\n {\n var _oldValue = _this12.getValue();\n var _newValue = _this12.evaluate(action.customAction, {\n value: _lodash[\"default\"].clone(_oldValue),\n data: data,\n row: row,\n input: _oldValue,\n component: newComponent,\n result: result\n }, 'value');\n if (!_lodash[\"default\"].isEqual(_oldValue, _newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(_newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = _newValue;\n }\n changed = true;\n }\n break;\n }\n }\n return changed;\n }, false);\n }\n\n // Deprecated\n }, {\n key: \"addInputError\",\n value: function addInputError(message, dirty, elements) {\n this.addMessages(message);\n this.setErrorClasses(elements, dirty, !!message);\n }\n\n // Deprecated\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n this.setErrorClasses(elements, true, false);\n }\n\n /**\n * Add a new input error to this element.\n *\n * @param message\n * @param dirty\n */\n }, {\n key: \"addMessages\",\n value: function addMessages(messages) {\n var _this13 = this;\n if (!messages) {\n return;\n }\n\n // Standardize on array of objects for message.\n if (typeof messages === 'string') {\n messages = {\n messages: messages,\n level: 'error'\n };\n }\n if (!Array.isArray(messages)) {\n messages = [messages];\n }\n messages = _lodash[\"default\"].uniqBy(messages, function (message) {\n return message.message;\n });\n if (this.refs.messageContainer) {\n this.setContent(this.refs.messageContainer, messages.map(function (message) {\n if (message.message && typeof message.message === 'string') {\n message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _this13.renderTemplate('message', message);\n }).join(''));\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this14 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n this.clearErrorClasses();\n elements.forEach(function (element) {\n _this14.setElementInvalid(_this14.performInputMapping(element), false);\n });\n this.setInputWidgetErrorClasses(elements, hasErrors);\n // do not set error classes for hidden components\n if (!this.visible) {\n return;\n }\n if (hasErrors) {\n // Add error classes\n elements.forEach(function (input) {\n _this14.setElementInvalid(_this14.performInputMapping(input), true);\n });\n if (dirty && this.options.highlightErrors) {\n this.addClass(element, this.options.componentErrorClass);\n } else {\n this.addClass(element, 'has-error');\n }\n }\n if (hasMessages) {\n this.addClass(element, 'has-message');\n }\n }\n }, {\n key: \"setElementInvalid\",\n value: function setElementInvalid(element, invalid) {\n if (!element) return;\n if (invalid) {\n this.addClass(element, 'is-invalid');\n } else {\n this.removeClass(element, 'is-invalid');\n }\n element.setAttribute('aria-invalid', invalid ? 'true' : 'false');\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide() {\n // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.\n if (\n // if change happens inside EditGrid's row, it doesn't trigger change on the root level, so rootPristine will be true\n (!this.rootPristine || this.options.server || (0, FormioUtils.isInsideScopingComponent)(this)) && this.component.clearOnHide !== false && !this.options.readOnly && !this.options.showHiddenFields) {\n if (!this.visible) {\n this.deleteValue();\n } else if (!this.hasValue() && this.shouldAddDefaultValue) {\n // If shown, ensure the default is set.\n this.setValue(this.defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n }\n }, {\n key: \"triggerRootChange\",\n value: function triggerRootChange() {\n if (this.options.onChange) {\n var _this$options2;\n (_this$options2 = this.options).onChange.apply(_this$options2, arguments);\n } else if (this.root) {\n var _this$root4;\n (_this$root4 = this.root).triggerChange.apply(_this$root4, arguments);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, fromRoot) {\n flags = flags || {};\n if (flags.modified) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n this.addClass(this.getElement(), 'formio-modified');\n }\n\n // If we are supposed to validate on blur, then don't trigger validation yet.\n if (this.component.validateOn === 'blur' && !this.errors.length) {\n flags.noValidate = true;\n }\n if (this.component.onChange) {\n this.evaluate(this.component.onChange, {\n flags: flags\n });\n }\n\n // Set the changed variable.\n var changed = {\n instance: this,\n component: this.component,\n value: this.dataValue,\n flags: flags\n };\n\n // Emit the change.\n this.emit('componentChange', changed);\n\n // Do not propogate the modified flag.\n var modified = false;\n if (flags.modified) {\n modified = true;\n delete flags.modified;\n }\n\n // Bubble this change up to the top.\n if (!fromRoot) {\n this.triggerRootChange(flags, changed, modified);\n }\n return changed;\n }\n }, {\n key: \"wysiwygDefault\",\n get: function get() {\n return {\n quill: {\n theme: 'snow',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n }),\n modules: {\n toolbar: [[{\n 'size': ['small', false, 'large', 'huge']\n }],\n // custom dropdown\n [{\n 'header': [1, 2, 3, 4, 5, 6, false]\n }], [{\n 'font': []\n }], ['bold', 'italic', 'underline', 'strike', {\n 'script': 'sub'\n }, {\n 'script': 'super'\n }, 'clean'], [{\n 'color': []\n }, {\n 'background': []\n }], [{\n 'list': 'ordered'\n }, {\n 'list': 'bullet'\n }, {\n 'indent': '-1'\n }, {\n 'indent': '+1'\n }, {\n 'align': []\n }], ['blockquote', 'code-block'], ['link', 'image', 'video', 'formula', 'source']]\n }\n },\n ace: {\n theme: 'ace/theme/xcode',\n maxLines: 12,\n minLines: 12,\n tabSize: 2,\n mode: 'ace/mode/javascript',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n })\n },\n ckeditor: {\n image: {\n toolbar: ['imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight'],\n styles: ['full', 'alignLeft', 'alignCenter', 'alignRight']\n },\n extraPlugins: []\n },\n \"default\": {}\n };\n }\n }, {\n key: \"addCKE\",\n value: function addCKE(element, settings, onChange) {\n settings = _lodash[\"default\"].isEmpty(settings) ? {} : settings;\n settings.base64Upload = this.component.isUploadEnabled ? false : true;\n settings.mediaEmbed = {\n previewsInData: true\n };\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ckeditor, _lodash[\"default\"].get(this.options, 'editors.ckeditor.settings', {}), settings);\n if (this.component.isUploadEnabled) {\n settings.extraPlugins.push((0, _uploadAdapter.getFormioUploadAdapterPlugin)(this.fileService, this));\n }\n return _Formio.GlobalFormio.requireLibrary('ckeditor', isIEBrowser ? 'CKEDITOR' : 'ClassicEditor', _lodash[\"default\"].get(this.options, 'editors.ckeditor.src', \"\".concat(_Formio.GlobalFormio.cdn.ckeditor, \"/ckeditor.js\")), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n if (isIEBrowser) {\n var editor = CKEDITOR.replace(element);\n editor.on('change', function () {\n return onChange(editor.getData());\n });\n return _nativePromiseOnly[\"default\"].resolve(editor);\n } else {\n return ClassicEditor.create(element, settings).then(function (editor) {\n editor.model.document.on('change', function () {\n return onChange(editor.data.get());\n });\n return editor;\n });\n }\n });\n }\n }, {\n key: \"addQuill\",\n value: function addQuill(element, settings, onChange) {\n var _this15 = this;\n settings = _lodash[\"default\"].isEmpty(settings) ? this.wysiwygDefault.quill : settings;\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.quill, _lodash[\"default\"].get(this.options, 'editors.quill.settings', {}), settings);\n settings = _objectSpread(_objectSpread({}, settings), {}, {\n modules: _objectSpread({\n table: true\n }, settings.modules)\n });\n // Lazy load the quill css.\n _Formio.GlobalFormio.requireLibrary(\"quill-css-\".concat(settings.theme), 'Quill', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.\").concat(settings.theme, \".css\")\n }], true);\n\n // Lazy load the quill library.\n return _Formio.GlobalFormio.requireLibrary('quill', 'Quill', _lodash[\"default\"].get(this.options, 'editors.quill.src', \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.min.js\")), true).then(function () {\n return _Formio.GlobalFormio.requireLibrary('quill-table', 'Quill', \"\".concat(_Formio.GlobalFormio.cdn.baseUrl, \"/quill/quill-table.js\"), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n _this15.quill = new Quill(element, isIEBrowser ? _objectSpread(_objectSpread({}, settings), {}, {\n modules: {}\n }) : settings);\n\n /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/\n var txtArea = document.createElement('textarea');\n txtArea.setAttribute('class', 'quill-source-code');\n _this15.quill.addContainer('ql-custom').appendChild(txtArea);\n var qlSource = element.parentNode.querySelector('.ql-source');\n if (qlSource) {\n _this15.addEventListener(qlSource, 'click', function (event) {\n event.preventDefault();\n if (txtArea.style.display === 'inherit') {\n _this15.quill.setContents(_this15.quill.clipboard.convert({\n html: txtArea.value\n }));\n }\n txtArea.style.display = txtArea.style.display === 'none' ? 'inherit' : 'none';\n });\n }\n /** END CODEBLOCK **/\n\n // Make sure to select cursor when they click on the element.\n _this15.addEventListener(element, 'click', function () {\n return _this15.quill.focus();\n });\n\n // Allows users to skip toolbar items when tabbing though form\n var elm = document.querySelectorAll('.ql-formats > button');\n for (var i = 0; i < elm.length; i++) {\n elm[i].setAttribute('tabindex', '-1');\n }\n _this15.quill.on('text-change', function () {\n txtArea.value = _this15.quill.root.innerHTML;\n onChange(txtArea);\n });\n return _this15.quill;\n });\n });\n }\n }, {\n key: \"shouldSanitizeValue\",\n get: function get() {\n var _this$options3;\n // Sanitize value if sanitizing for thw whole content is turned off\n return ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.sanitize) !== false;\n }\n }, {\n key: \"addAce\",\n value: function addAce(element, settings, onChange) {\n if (!settings || settings.theme === 'snow') {\n var mode = settings ? settings.mode : '';\n settings = {};\n if (mode) {\n settings.mode = mode;\n }\n }\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ace, _lodash[\"default\"].get(this.options, 'editors.ace.settings', {}), settings || {});\n return _Formio.GlobalFormio.requireLibrary('ace', 'ace', _lodash[\"default\"].get(this.options, 'editors.ace.src', \"\".concat(_Formio.GlobalFormio.cdn.ace, \"/ace.js\")), true).then(function (editor) {\n editor = editor.edit(element);\n editor.removeAllListeners('change');\n editor.setOptions(settings);\n editor.getSession().setMode(settings.mode);\n editor.on('change', function () {\n return onChange(editor.getValue());\n });\n if (settings.isUseWorkerDisabled) {\n editor.session.setUseWorker(false);\n }\n return editor;\n });\n }\n }, {\n key: \"tree\",\n get: function get() {\n return this.component.tree || false;\n }\n\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n\n /**\n * Returns if this component has a value set.\n *\n */\n }, {\n key: \"hasValue\",\n value: function hasValue(data) {\n return !_lodash[\"default\"].isUndefined(_lodash[\"default\"].get(data || this.data, this.key));\n }\n\n /**\n * Get the data value at the root level.\n *\n * @return {*}\n */\n }, {\n key: \"rootValue\",\n get: function get() {\n return this.root ? this.root.data : this.data;\n }\n }, {\n key: \"rootPristine\",\n get: function get() {\n return _lodash[\"default\"].get(this, 'root.pristine', false);\n }\n\n /**\n * Get the static value of this component.\n * @return {*}\n */\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n var empty = this.component.multiple ? [] : this.emptyValue;\n if (!this.rootPristine) {\n this.dataValue = empty;\n }\n return empty;\n }\n return _lodash[\"default\"].get(this._data, this.key);\n }\n\n /**\n * Sets the static value of this component.\n *\n * @param value\n */,\n set: function set(value) {\n if (!this.allowData || !this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return;\n }\n if (value !== null && value !== undefined) {\n value = this.hook('setDataValue', value, this.key, this._data);\n }\n if (value === null || value === undefined) {\n this.unset();\n return;\n }\n _lodash[\"default\"].set(this._data, this.key, value);\n return;\n }\n\n /**\n * Splice a value from the dataValue.\n *\n * @param index\n */\n }, {\n key: \"splice\",\n value: function splice(index) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.hasValue()) {\n var dataValue = this.dataValue || [];\n if (_lodash[\"default\"].isArray(dataValue) && dataValue.hasOwnProperty(index)) {\n dataValue.splice(index, 1);\n this.dataValue = dataValue;\n this.triggerChange(flags);\n }\n }\n }\n }, {\n key: \"unset\",\n value: function unset() {\n _lodash[\"default\"].unset(this._data, this.key);\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue(null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }, {\n key: \"getCustomDefaultValue\",\n value: function getCustomDefaultValue(defaultValue) {\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n }, {\n key: \"shouldAddDefaultValue\",\n get: function get() {\n return !this.options.noDefaults || this.component.defaultValue && !this.isEmpty(this.component.defaultValue) || this.component.customDefaultValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this16 = this;\n var defaultValue = this.emptyValue;\n if (this.component.defaultValue) {\n defaultValue = this.component.defaultValue;\n }\n defaultValue = this.getCustomDefaultValue(defaultValue);\n var checkMask = function checkMask(value) {\n if (typeof value === 'string') {\n if (_this16.component.type !== 'textfield') {\n var placeholderChar = _this16.placeholderChar;\n value = (0, _vanillaTextMask.conformToMask)(value, _this16.defaultMask, {\n placeholderChar: placeholderChar\n }).conformedValue;\n if (!FormioUtils.matchInputMask(value, _this16.defaultMask)) {\n value = '';\n }\n }\n } else {\n value = '';\n }\n return value;\n };\n if (this.defaultMask) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue.map(checkMask);\n } else {\n defaultValue = checkMask(defaultValue);\n }\n }\n\n // Clone so that it creates a new instance.\n return _lodash[\"default\"].cloneDeep(defaultValue);\n }\n\n /**\n * Get the input value of this component.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this.hasInput || this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var values = [];\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n if (!this.component.multiple) {\n return this.getValueAt(i);\n }\n values.push(this.getValueAt(i));\n }\n }\n if (values.length === 0 && !this.component.multiple) {\n return '';\n }\n return values;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var input = this.performInputMapping(this.refs.input[index]);\n return input ? input.value : undefined;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n *\n * @return {boolean} - If the value changed.\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (!this.hasInput) {\n return changed;\n }\n var isArray = Array.isArray(value);\n var valueInput = this.refs.fileLink || this.refs.input;\n if (isArray && Array.isArray(this.defaultValue) && this.refs.hasOwnProperty('input') && valueInput && valueInput.length !== value.length && this.visible) {\n this.redraw();\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.redraw();\n return changed;\n }\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n this.setValueAt(i, isArray ? value[i] : value, flags);\n }\n }\n return changed;\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!flags.noDefault && (value === null || value === undefined) && !this.component.multiple) {\n value = this.defaultValue;\n }\n var input = this.performInputMapping(this.refs.input[index]);\n var valueMaskInput = this.refs.valueMaskInput;\n if (valueMaskInput !== null && valueMaskInput !== void 0 && valueMaskInput.mask && valueMaskInput.mask.textMaskInputElement) {\n valueMaskInput.mask.textMaskInputElement.update(value);\n }\n if (input.mask && input.mask.textMaskInputElement) {\n input.mask.textMaskInputElement.update(value);\n } else if (input.widget && input.widget.setValue) {\n input.widget.setValue(value);\n } else {\n input.value = value;\n }\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue() && !this.isEmpty(this.dataValue);\n }\n }, {\n key: \"setDefaultValue\",\n value: function setDefaultValue() {\n if (this.defaultValue && this.shouldAddDefaultValue) {\n var defaultValue = this.component.multiple && !this.dataValue.length ? [] : this.defaultValue;\n this.setValue(defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n\n /**\n * Restore the value of a control.\n */\n }, {\n key: \"restoreValue\",\n value: function restoreValue() {\n if (this.hasSetValue) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else {\n this.setDefaultValue();\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.multiple && !Array.isArray(value)) {\n value = value ? [value] : [];\n }\n return value;\n }\n\n /**\n * Update a value of this component.\n *\n * @param flags\n */\n }, {\n key: \"updateComponentValue\",\n value: function updateComponentValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newValue = !flags.resetValue && (value === undefined || value === null) ? this.getValue() : value;\n newValue = this.normalizeValue(newValue, flags);\n var oldValue = this.dataValue;\n var changed = newValue !== undefined ? this.hasChanged(newValue, oldValue) : false;\n if (changed) {\n this.dataValue = newValue;\n changed = this.dataValue !== oldValue;\n this.updateOnChange(flags, changed);\n }\n if (this.componentModal && flags && flags.fromSubmission) {\n this.componentModal.setValue(value);\n }\n return changed;\n }\n\n /**\n * Updates the value of this component plus all sub-components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"updateValue\",\n value: function updateValue() {\n return this.updateComponentValue.apply(this, arguments);\n }\n }, {\n key: \"getIcon\",\n value: function getIcon(name, content, styles) {\n var ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'icon';\n return this.renderTemplate('icon', {\n className: this.iconClass(name),\n ref: ref,\n styles: styles,\n content: content\n });\n }\n\n /**\n * Resets the value of this component.\n */\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n\n /**\n * Determine if the value of this component has changed.\n *\n * @param newValue\n * @param oldValue\n * @return {boolean}\n */\n }, {\n key: \"hasChanged\",\n value: function hasChanged(newValue, oldValue) {\n if ((newValue === undefined || newValue === null) && (oldValue === undefined || oldValue === null || this.isEmpty(oldValue))) {\n return false;\n }\n // If we do not have a value and are getting set to anything other than undefined or null, then we changed.\n if (newValue !== undefined && newValue !== null && this.allowData && !this.hasValue()) {\n return true;\n }\n return !_lodash[\"default\"].isEqual(newValue, oldValue);\n }\n\n /**\n * Update the value on change.\n *\n * @param flags\n */\n }, {\n key: \"updateOnChange\",\n value: function updateOnChange() {\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!flags.noUpdateEvent && changed) {\n this.triggerChange(flags);\n return true;\n }\n return false;\n }\n\n /**\n * Perform a calculated value operation.\n *\n * @param data - The global data object.\n *\n * @return {boolean} - If the value changed during calculation.\n */\n }, {\n key: \"convertNumberOrBoolToString\",\n value: function convertNumberOrBoolToString(value) {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return value;\n }\n }, {\n key: \"doValueCalculation\",\n value: function doValueCalculation(dataValue, data, row) {\n var _this$root5;\n return this.evaluate(this.component.calculateValue, {\n value: dataValue,\n data: data,\n row: row || this.data,\n submission: ((_this$root5 = this.root) === null || _this$root5 === void 0 ? void 0 : _this$root5._submission) || {\n data: this.rootValue\n }\n }, 'value');\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"calculateComponentValue\",\n value: function calculateComponentValue(data, flags, row) {\n // Skip value calculation for the component if we don't have entire form data set or in builder mode\n if (this.builderMode || _lodash[\"default\"].isUndefined(_lodash[\"default\"].get(this, 'root.data'))) {\n return false;\n }\n // If no calculated value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n var clearOnHide = this.component.clearOnHide;\n var shouldBeCleared = !this.visible && clearOnHide;\n var allowOverride = _lodash[\"default\"].get(this.component, 'allowCalculateOverride', false);\n if (shouldBeCleared) {\n // remove calculated value so that the value is recalculated once component becomes visible\n if (this.hasOwnProperty('calculatedValue') && allowOverride) {\n _lodash[\"default\"].unset(this, 'calculatedValue');\n }\n return false;\n }\n\n // Handle all cases when calculated values should not fire.\n if (this.options.readOnly && !this.options.pdf && !this.component.calculateValue || !(this.component.calculateValue || this.component.calculateValueVariable) || this.options.server && !this.component.calculateServer || flags.dataSourceInitialLoading && allowOverride) {\n return false;\n }\n var dataValue = this.dataValue;\n // Calculate the new value.\n var calculatedValue = this.doValueCalculation(dataValue, data, row, flags);\n if (this.options.readOnly && dataValue && !calculatedValue) {\n return false;\n }\n if (_lodash[\"default\"].isNil(calculatedValue)) {\n calculatedValue = this.emptyValue;\n }\n var changed = !_lodash[\"default\"].isEqual(dataValue, calculatedValue);\n\n // Do not override calculations on server if they have calculateServer set.\n if (allowOverride) {\n // The value is considered locked if it is not empty and comes from a submission value.\n var fromSubmission = flags.fromSubmission && this.component.persistent === true;\n if (this.isEmpty(dataValue)) {\n // Reset the calculation lock if ever the data is cleared.\n this.calculationLocked = false;\n } else if (this.calculationLocked || fromSubmission) {\n this.calculationLocked = true;\n return false;\n }\n var firstPass = this.calculatedValue === undefined || flags.resetValue;\n if (firstPass) {\n this.calculatedValue = null;\n }\n var newCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(calculatedValue));\n var previousCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue));\n var normalizedDataValue = this.normalizeValue(this.convertNumberOrBoolToString(dataValue));\n var calculationChanged = !_lodash[\"default\"].isEqual(previousCalculatedValue, newCalculatedValue);\n var previousChanged = !_lodash[\"default\"].isEqual(normalizedDataValue, previousCalculatedValue);\n if (calculationChanged && previousChanged && !firstPass) {\n return false;\n }\n\n // Check to ensure that the calculated value is different than the previously calculated value.\n if (previousCalculatedValue && previousChanged && !calculationChanged) {\n this.calculatedValue = null;\n return false;\n }\n if (flags.isReordered || !calculationChanged) {\n return false;\n }\n if (fromSubmission) {\n // If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n return false;\n }\n\n // If this is the firstPass, and the dataValue is different than to the calculatedValue.\n if (firstPass && !this.isEmpty(dataValue) && changed && calculationChanged) {\n // Return that we have a change so it will perform another pass.\n return true;\n }\n }\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n if (changed) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n flags.triggeredComponentId = this.id;\n return this.setValue(calculatedValue, flags);\n }\n return false;\n }\n /* eslint-enable max-statements */\n\n /**\n * Performs calculations in this component plus any child components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.calculateComponentValue(data, flags, row);\n }\n\n /**\n * Get this component's label text.\n *\n */\n }, {\n key: \"label\",\n get: function get() {\n return this.component.label;\n }\n\n /**\n * Set this component's label text and render it.\n *\n * @param value - The new label text.\n */,\n set: function set(value) {\n this.component.label = value;\n if (this.labelElement) {\n this.labelElement.innerText = value;\n }\n }\n\n /**\n * Get FormioForm element at the root of this component tree.\n *\n */\n }, {\n key: \"getRoot\",\n value: function getRoot() {\n return this.root;\n }\n\n /**\n * Returns the invalid message, or empty string if the component is valid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"invalidMessage\",\n value: function invalidMessage(data, dirty, ignoreCondition, row) {\n if (!ignoreCondition && !this.checkCondition(row, data)) {\n return '';\n }\n\n // See if this is forced invalid.\n if (this.invalid) {\n return this.invalid;\n }\n\n // No need to check for errors if there is no input or if it is pristine.\n if (!this.hasInput || !dirty && this.pristine) {\n return '';\n }\n return _lodash[\"default\"].map(_Validator[\"default\"].checkComponent(this, data), 'message').join('\\n\\n');\n }\n\n /**\n * Returns if the component is valid or not.\n *\n * @param data\n * @param dirty\n * @return {boolean}\n */\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return !this.invalidMessage(data, dirty);\n }\n }, {\n key: \"setComponentValidity\",\n value: function setComponentValidity(messages, dirty, silentCheck) {\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error' && !message.fromServer;\n }).length;\n if (messages.length && (!silentCheck || this.error) && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {\n this.setCustomValidity(messages, dirty);\n } else if (!silentCheck) {\n this.setCustomValidity('');\n }\n return !hasErrors;\n }\n\n /**\n * Checks the validity of this component and sets the error message if it is invalid.\n *\n * @param data\n * @param dirty\n * @param row\n * @return {boolean}\n */\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this$serverErrors,\n _this17 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async,\n _options$silentCheck = options.silentCheck,\n silentCheck = _options$silentCheck === void 0 ? false : _options$silentCheck;\n if (this.shouldSkipValidation(data, dirty, row)) {\n this.setCustomValidity('');\n return async ? _nativePromiseOnly[\"default\"].resolve(true) : true;\n }\n var check = _Validator[\"default\"].checkComponent(this, data, row, true, async);\n var validations = check;\n if ((_this$serverErrors = this.serverErrors) !== null && _this$serverErrors !== void 0 && _this$serverErrors.length) {\n validations = check.concat(this.serverErrors);\n }\n return async ? validations.then(function (messages) {\n return _this17.setComponentValidity(messages, dirty, silentCheck);\n }) : this.setComponentValidity(validations, dirty, silentCheck);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n var isValid = this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n return _nativePromiseOnly[\"default\"].resolve(this.checkComponentValidity(data, dirty, row, {\n async: true,\n silentCheck: silentCheck\n }));\n }\n\n /**\n * Check the conditions, calculations, and validity of a single component and triggers an update if\n * something changed.\n *\n * @param data - The root data of the change event.\n * @param flags - The flags from this change event.\n *\n * @return boolean - If component is valid or not.\n */\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n\n // Needs for Nextgen Rules Engine\n this.resetCaches();\n\n // Do not trigger refresh if change was triggered on blur event since components with Refresh on Blur have their own listeners\n if (!flags.fromBlur) {\n this.checkRefreshOn(flags.changes, flags);\n }\n if (flags.noCheck) {\n return true;\n }\n this.checkComponentConditions(data, flags, row);\n if (this.id !== flags.triggeredComponentId) {\n this.calculateComponentValue(data, flags, row);\n }\n if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {\n if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {\n this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);\n }\n return true;\n }\n var isDirty = false;\n\n // We need to set dirty if they explicitly set noValidate to false.\n if (this.options.alwaysDirty || flags.dirty) {\n isDirty = true;\n }\n\n // See if they explicitely set the values with setSubmission.\n if (flags.fromSubmission && this.hasValue(data)) {\n isDirty = true;\n }\n this.setDirty(isDirty);\n if (this.component.validateOn === 'blur' && flags.fromSubmission) {\n return true;\n }\n var isValid = this.checkComponentValidity(data, isDirty, row, flags);\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkModal\",\n value: function checkModal() {\n var isValid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var dirty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!this.component.modalEdit || !this.componentModal) {\n return;\n }\n if (dirty && !isValid) {\n this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!this.errors.length, this.refs.openModalWrapper);\n } else {\n this.clearErrorClasses(this.refs.openModalWrapper);\n }\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmptyArray = _lodash[\"default\"].isArray(value) && value.length === 1 ? _lodash[\"default\"].isEqual(value[0], this.emptyValue) : false;\n return value == null || value.length === 0 || _lodash[\"default\"].isEqual(value, this.emptyValue) || isEmptyArray;\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(valueA) {\n var valueB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dataValue;\n return this.isEmpty(valueA) && this.isEmpty(valueB) || _lodash[\"default\"].isEqual(valueA, valueB);\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return true;\n }\n }, {\n key: \"errors\",\n get: function get() {\n return this.error ? [this.error] : [];\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n this.removeClass(element, this.options.componentErrorClass);\n this.removeClass(element, 'alert alert-danger');\n this.removeClass(element, 'has-error');\n this.removeClass(element, 'has-message');\n }\n }, {\n key: \"setInputWidgetErrorClasses\",\n value: function setInputWidgetErrorClasses(inputRefs, hasErrors) {\n if (!this.isInputComponent || !this.component.widget || !(inputRefs !== null && inputRefs !== void 0 && inputRefs.length)) {\n return;\n }\n inputRefs.forEach(function (input) {\n if (input !== null && input !== void 0 && input.widget && input.widget.setErrorClasses) {\n input.widget.setErrorClasses(hasErrors);\n }\n });\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this18 = this;\n this.addEventListener(element, 'focus', function () {\n if (_this18.root.focusedComponent !== _this18) {\n if (_this18.root.pendingBlur) {\n _this18.root.pendingBlur();\n }\n _this18.root.focusedComponent = _this18;\n _this18.emit('focus', _this18);\n } else if (_this18.root.focusedComponent === _this18 && _this18.root.pendingBlur) {\n _this18.root.pendingBlur.cancel();\n _this18.root.pendingBlur = null;\n }\n });\n this.addEventListener(element, 'blur', function () {\n _this18.root.pendingBlur = FormioUtils.delay(function () {\n _this18.emit('blur', _this18);\n if (_this18.component.validateOn === 'blur') {\n _this18.root.triggerChange({\n fromBlur: true\n }, {\n instance: _this18,\n component: _this18.component,\n value: _this18.dataValue,\n flags: {\n fromBlur: true\n }\n });\n }\n _this18.root.focusedComponent = null;\n _this18.root.pendingBlur = null;\n });\n });\n }\n }, {\n key: \"setCustomValidity\",\n value: function setCustomValidity(messages, dirty, external) {\n var _this19 = this;\n var inputRefs = this.isInputComponent ? this.refs.input || [] : null;\n if (typeof messages === 'string' && messages) {\n messages = {\n level: 'error',\n message: messages\n };\n }\n if (!Array.isArray(messages)) {\n if (messages) {\n messages = [messages];\n } else {\n messages = [];\n }\n }\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error';\n }).length;\n var invalidInputRefs = inputRefs;\n if (this.component.multiple) {\n var inputRefsArray = Array.from(inputRefs);\n inputRefsArray.forEach(function (input) {\n _this19.setElementInvalid(_this19.performInputMapping(input), false);\n });\n this.setInputWidgetErrorClasses(inputRefsArray, false);\n invalidInputRefs = inputRefsArray.filter(function (ref) {\n var _messages$some, _messages;\n return (_messages$some = (_messages = messages).some) === null || _messages$some === void 0 ? void 0 : _messages$some.call(_messages, function (msg) {\n var _msg$context;\n return (msg === null || msg === void 0 ? void 0 : (_msg$context = msg.context) === null || _msg$context === void 0 ? void 0 : _msg$context.input) === ref;\n });\n });\n }\n if (messages.length) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n this.error = {\n component: this.component,\n message: messages[0].message,\n messages: messages,\n external: !!external\n };\n this.emit('componentError', this.error);\n this.addMessages(messages, dirty, invalidInputRefs);\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n } else if (!this.error || this.error && this.error.external === !!external) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n if (this.refs.modalMessageContainer) {\n this.empty(this.refs.modalMessageContainer);\n }\n this.error = null;\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n this.clearErrorClasses();\n }\n\n // if (!this.refs.input) {\n // return;\n // }\n // this.refs.input.forEach(input => {\n // input = this.performInputMapping(input);\n // if (typeof input.setCustomValidity === 'function') {\n // input.setCustomValidity(message, dirty);\n // }\n // });\n }\n\n /**\n * Determines if the value of this component is hidden from the user as if it is coming from the server, but is\n * protected.\n *\n * @return {boolean|*}\n */\n }, {\n key: \"isValueHidden\",\n value: function isValueHidden() {\n if (this.component[\"protected\"] && this.root.editing) {\n return false;\n }\n if (!this.root || !this.root.hasOwnProperty('editing')) {\n return false;\n }\n if (!this.root || !this.root.editing) {\n return false;\n }\n return this.component[\"protected\"] || !this.component.persistent || this.component.persistent === 'client-only';\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n var _this20 = this;\n var _ref = this.component || {},\n _ref$validateWhenHidd = _ref.validateWhenHidden,\n validateWhenHidden = _ref$validateWhenHidd === void 0 ? false : _ref$validateWhenHidd;\n var rules = [\n // Force valid if component is read-only\n function () {\n return _this20.options.readOnly;\n },\n // Do not check validations if component is not an input component.\n function () {\n return !_this20.hasInput;\n },\n // Check to see if we are editing and if so, check component persistence.\n function () {\n return _this20.isValueHidden();\n },\n // Force valid if component is hidden.\n function () {\n return !_this20.visible && !validateWhenHidden;\n },\n // Force valid if component is conditionally hidden.\n function () {\n return !_this20.checkCondition(row, data) && !validateWhenHidden;\n }];\n return rules.some(function (pred) {\n return pred();\n });\n }\n\n // Maintain reverse compatibility.\n }, {\n key: \"whenReady\",\n value: function whenReady() {\n console.warn('The whenReady() method has been deprecated. Please use the dataReady property instead.');\n return this.dataReady;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n /**\n * Prints out the value of this component as a string value.\n */\n }, {\n key: \"asString\",\n value: function asString(value) {\n value = value || this.getValue();\n return (Array.isArray(value) ? value : [value]).map(_lodash[\"default\"].toString).join(', ');\n }\n\n /**\n * Return if the component is disabled.\n * @return {boolean}\n */\n }, {\n key: \"disabled\",\n get: function get() {\n return this._disabled || this.parentDisabled;\n }\n\n /**\n * Disable this component.\n *\n * @param {boolean} disabled\n */,\n set: function set(disabled) {\n this._disabled = disabled;\n }\n }, {\n key: \"setDisabled\",\n value: function setDisabled(element, disabled) {\n if (!element) {\n return;\n }\n element.disabled = disabled;\n if (disabled) {\n element.setAttribute('disabled', 'disabled');\n } else {\n element.removeAttribute('disabled');\n }\n }\n }, {\n key: \"setLoading\",\n value: function setLoading(element, loading) {\n if (!element || element.loading === loading) {\n return;\n }\n element.loading = loading;\n if (!element.loader && loading) {\n element.loader = this.ce('i', {\n \"class\": \"\".concat(this.iconClass('refresh', true), \" button-icon-right\")\n });\n }\n if (element.loader) {\n if (loading) {\n this.appendTo(element.loader, element);\n } else {\n this.removeChildFrom(element.loader, element);\n }\n }\n }\n }, {\n key: \"selectOptions\",\n value: function selectOptions(select, tag, options, defaultValue) {\n var _this21 = this;\n _lodash[\"default\"].each(options, function (option) {\n var attrs = {\n value: option.value\n };\n if (defaultValue !== undefined && option.value === defaultValue) {\n attrs.selected = 'selected';\n }\n var optionElement = _this21.ce('option', attrs);\n optionElement.appendChild(_this21.text(option.label));\n select.appendChild(optionElement);\n });\n }\n }, {\n key: \"setSelectValue\",\n value: function setSelectValue(select, value) {\n var options = select.querySelectorAll('option');\n _lodash[\"default\"].each(options, function (option) {\n if (option.value === value) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n if (select.onchange) {\n select.onchange();\n }\n if (select.onselect) {\n select.onselect();\n }\n }\n }, {\n key: \"getRelativePath\",\n value: function getRelativePath(path) {\n var keyPart = \".\".concat(this.key);\n var thisPath = this.isInputComponent ? this.path : this.path.slice(0).replace(keyPart, '');\n return path.replace(thisPath, '');\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.detach();\n this.empty(this.getElement());\n }\n }, {\n key: \"append\",\n value: function append(element) {\n this.appendTo(element, this.element);\n }\n }, {\n key: \"prepend\",\n value: function prepend(element) {\n this.prependTo(element, this.element);\n }\n }, {\n key: \"removeChild\",\n value: function removeChild(element) {\n this.removeChildFrom(element, this.element);\n }\n }, {\n key: \"detachLogic\",\n value: function detachLogic() {\n var _this22 = this;\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this22.interpolate(logic.trigger.event);\n _this22.off(event); // only applies to callbacks on this component\n }\n });\n }\n }, {\n key: \"attachLogic\",\n value: function attachLogic() {\n var _this23 = this;\n // Do not attach logic during builder mode.\n if (this.builderMode) {\n return;\n }\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this23.interpolate(logic.trigger.event);\n _this23.on(event, function () {\n var newComponent = (0, FormioUtils.fastCloneDeep)(_this23.originalComponent);\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n if (_this23.applyActions(newComponent, logic.actions, args)) {\n // If component definition changed, replace it.\n if (!_lodash[\"default\"].isEqual(_this23.component, newComponent)) {\n _this23.component = newComponent;\n var visible = _this23.conditionallyVisible(null, null);\n var disabled = _this23.shouldDisabled;\n\n // Change states which won't be recalculated during redrawing\n if (_this23.visible !== visible) {\n _this23.visible = visible;\n }\n if (_this23.disabled !== disabled) {\n _this23.disabled = disabled;\n }\n _this23.redraw();\n }\n }\n }, true);\n }\n });\n }\n\n /**\n * Get the element information.\n */\n }, {\n key: \"elementInfo\",\n value: function elementInfo() {\n var attributes = {\n name: this.options.name,\n type: this.component.inputType || 'text',\n \"class\": 'form-control',\n lang: this.options.language\n };\n if (this.component.placeholder) {\n attributes.placeholder = this.t(this.component.placeholder, {\n _userInput: true\n });\n }\n if (this.component.tabindex) {\n attributes.tabindex = this.component.tabindex;\n }\n if (this.disabled) {\n attributes.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attributes, this.component.attributes);\n return {\n type: 'input',\n component: this.component,\n changeEvent: 'change',\n attr: attributes\n };\n }\n }, {\n key: \"autofocus\",\n value: function autofocus() {\n var _this24 = this;\n var hasAutofocus = this.component.autofocus && !this.builderMode && !this.options.preview;\n if (hasAutofocus) {\n this.on('render', function () {\n return _this24.focus();\n }, true);\n }\n }\n }, {\n key: \"scrollIntoView\",\n value: function scrollIntoView() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n var verticalOnly = arguments.length > 1 ? arguments[1] : undefined;\n if (!element) {\n return;\n }\n var _element$getBoundingC = element.getBoundingClientRect(),\n left = _element$getBoundingC.left,\n top = _element$getBoundingC.top;\n window.scrollTo(verticalOnly ? window.scrollX : left + window.scrollX, top + window.scrollY);\n }\n }, {\n key: \"focus\",\n value: function focus(index) {\n var _this$refs$input2;\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if ((_this$refs$input2 = this.refs.input) !== null && _this$refs$input2 !== void 0 && _this$refs$input2.length) {\n var _this$component$widge;\n var focusingInput = typeof index === 'number' && this.refs.input[index] ? this.refs.input[index] : this.refs.input[this.refs.input.length - 1];\n if (((_this$component$widge = this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.type) === 'calendar') {\n var sibling = focusingInput.nextSibling;\n if (sibling) {\n sibling.focus();\n }\n } else {\n focusingInput.focus();\n }\n }\n if (this.refs.openModal) {\n this.refs.openModal.focus();\n }\n if (this.parent.refs.openModal) {\n this.parent.refs.openModal.focus();\n }\n }\n\n /**\n * Get `Formio` instance for working with files\n */\n }, {\n key: \"fileService\",\n get: function get() {\n if (this.options.fileService) {\n return this.options.fileService;\n }\n if (this.options.formio) {\n return this.options.formio;\n }\n if (this.root && this.root.formio) {\n return this.root.formio;\n }\n var formio = new _Formio.GlobalFormio();\n // If a form is loaded, then make sure to set the correct formUrl.\n if (this.root && this.root._form && this.root._form._id) {\n formio.formUrl = \"\".concat(formio.projectUrl, \"/form/\").concat(this.root._form._id);\n }\n return formio;\n }\n }, {\n key: \"resetCaches\",\n value: function resetCaches() {}\n }, {\n key: \"previewMode\",\n get: function get() {\n return false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len5 = arguments.length, sources = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n sources[_key5] = arguments[_key5];\n }\n return _lodash[\"default\"].merge.apply(_lodash[\"default\"], [{\n /**\n * Determines if this component provides an input.\n */\n input: true,\n /**\n * The data key for this component (how the data is stored in the database).\n */\n key: '',\n /**\n * The input placeholder for this component.\n */\n placeholder: '',\n /**\n * The input prefix\n */\n prefix: '',\n /**\n * The custom CSS class to provide to this component.\n */\n customClass: '',\n /**\n * The input suffix.\n */\n suffix: '',\n /**\n * If this component should allow an array of values to be captured.\n */\n multiple: false,\n /**\n * The default value of this component.\n */\n defaultValue: null,\n /**\n * If the data of this component should be protected (no GET api requests can see the data)\n */\n \"protected\": false,\n /**\n * Validate if the value of this component should be unique within the form.\n */\n unique: false,\n /**\n * If the value of this component should be persisted within the backend api database.\n */\n persistent: true,\n /**\n * Determines if the component should be within the form, but not visible.\n */\n hidden: false,\n /**\n * If the component should be cleared when hidden.\n */\n clearOnHide: true,\n /**\n * This will refresh this component options when this field changes.\n */\n refreshOn: '',\n /**\n * This will redraw the component when this field changes.\n */\n redrawOn: '',\n /**\n * If this component should be included as a column within a submission table.\n */\n tableView: false,\n /**\n * If this component should be rendering in modal.\n */\n modalEdit: false,\n /**\n * The input label provided to this component.\n */\n label: '',\n dataGridLabel: false,\n labelPosition: 'top',\n description: '',\n errorLabel: '',\n tooltip: '',\n hideLabel: false,\n tabindex: '',\n disabled: false,\n autofocus: false,\n dbIndex: false,\n customDefaultValue: '',\n calculateValue: '',\n calculateServer: false,\n widget: null,\n /**\n * Attributes that will be assigned to the input elements of this component.\n */\n attributes: {},\n /**\n * This will perform the validation on either \"change\" or \"blur\" of the input element.\n */\n validateOn: 'change',\n /**\n * The validation criteria for this component.\n */\n validate: {\n /**\n * If this component is required.\n */\n required: false,\n /**\n * Custom JavaScript validation.\n */\n custom: '',\n /**\n * If the custom validation should remain private (only the backend will see it and execute it).\n */\n customPrivate: false,\n /**\n * If this component should implement a strict date validation if the Calendar widget is implemented.\n */\n strictDateValidation: false,\n multiple: false,\n unique: false\n },\n /**\n * The simple conditional settings for a component.\n */\n conditional: {\n show: null,\n when: null,\n eq: ''\n },\n overlay: {\n style: '',\n left: '',\n top: '',\n width: '',\n height: ''\n },\n allowCalculateOverride: false,\n encrypted: false,\n showCharCount: false,\n showWordCount: false,\n properties: {},\n allowMultipleMasks: false,\n addons: []\n }].concat(sources));\n }\n\n /**\n * Return the validator as part of the component.\n *\n * @return {ValidationChecker}\n * @constructor\n */\n }, {\n key: \"Validator\",\n get: function get() {\n return _Validator[\"default\"];\n }\n /**\n * Return the simple condition settings as part of the component.\n *\n * @return {Object}\n *\n */\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],\n valueComponent: function valueComponent() {\n return {\n type: 'textfield',\n widget: {\n type: 'input'\n }\n };\n }\n };\n }\n /**\n * Return the array of possible types of component value absed on its schema.\n *\n * @param schema\n * @return {Array}\n *\n */\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];\n }\n /**\n * Provides a table view for this component. Override if you wish to do something different than using getView\n * method of your instance.\n *\n * @param value\n * @param options\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"tableView\",\n value: function tableView(value, options) {}\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return Component.conditionOperatorsSettings;\n }\n }]);\n return Component;\n}(_Element2[\"default\"]);\nexports[\"default\"] = Component;\nComponent.externalLibraries = {};\nComponent.requireLibrary = function (name, property, src, polling) {\n if (!Component.externalLibraries.hasOwnProperty(name)) {\n Component.externalLibraries[name] = {};\n Component.externalLibraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Component.externalLibraries[name].resolve = resolve;\n Component.externalLibraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n this.resolve();\n }.bind(Component.externalLibraries[name]);\n }\n // See if the plugin already exists.\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n src = Array.isArray(src) ? src : [src];\n src.forEach(function (lib) {\n var attrs = {};\n var elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top page.\n var script = document.createElement(elementType);\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n setTimeout(function checkLibrary() {\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n // check again after 200 ms.\n setTimeout(checkLibrary, 200);\n }\n }, 200);\n }\n }\n }\n return Component.externalLibraries[name].ready;\n};\nComponent.libraryReady = function (name) {\n if (Component.externalLibraries.hasOwnProperty(name) && Component.externalLibraries[name].ready) {\n return Component.externalLibraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n};\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/component/Component.js?"); /***/ }), @@ -433,7 +433,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../../Components */ \"./lib/components/Components.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedComponent = /*#__PURE__*/function (_Field) {\n _inherits(NestedComponent, _Field);\n var _super = _createSuper(NestedComponent);\n function NestedComponent(component, options, data) {\n var _this;\n _classCallCheck(this, NestedComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'components';\n _this._collapsed = !!_this.component.collapsed;\n return _this;\n }\n _createClass(NestedComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return NestedComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(NestedComponent.prototype), \"schema\", this);\n var components = _lodash[\"default\"].uniqBy(this.getComponents(), 'component.key');\n schema.components = _lodash[\"default\"].map(components, 'schema');\n return schema;\n }\n }, {\n key: \"collapsed\",\n get: function get() {\n return this._collapsed;\n },\n set: function set(value) {\n this._collapsed = value;\n this.collapse(value);\n }\n }, {\n key: \"collapse\",\n value: function collapse(value) {\n var promise = this.redraw();\n if (!value) {\n this.checkValidity(this.data, !this.pristine, null, this.pristine);\n }\n return promise;\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n // DO NOT CALL super here. There is an issue where clearOnHide was getting triggered with\n // subcomponents because the \"parentVisible\" flag was set to false when it should really be\n // set to true.\n var visibilityChanged = this._visible !== value;\n this._visible = value;\n var isVisible = this.visible;\n var forceShow = this.shouldForceShow();\n var forceHide = this.shouldForceHide();\n this.components.forEach(function (component) {\n // Set the parent visibility first since we may have nested components within nested components\n // and they need to be able to determine their visibility based on the parent visibility.\n component.parentVisible = isVisible;\n var conditionallyVisible = component.conditionallyVisible();\n if (forceShow || conditionallyVisible) {\n component.visible = true;\n } else if (forceHide || !isVisible || !conditionallyVisible) {\n component.visible = false;\n }\n // If hiding a nested component, clear all errors below.\n if (!component.visible) {\n component.error = '';\n }\n });\n if (visibilityChanged) {\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this2 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", value, this, true);\n this.components.forEach(function (component) {\n return component.parentVisible = _this2.visible;\n });\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"disabled\", disabled, this, true);\n this.components.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", this);\n },\n set: function set(value) {\n var _this3 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", value, this, true);\n this.components.forEach(function (component) {\n component.parentDisabled = _this3.disabled;\n });\n }\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.ready;\n }));\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", this);\n },\n set: function set(instance) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", instance, this, true);\n this.getComponents().forEach(function (component) {\n component.currentForm = instance;\n });\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return this._rowIndex;\n },\n set: function set(value) {\n this._rowIndex = value;\n this.eachComponent(function (component) {\n component.rowIndex = value;\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n var _this4 = this;\n this._data = value;\n this.eachComponent(function (component) {\n component.data = _this4.componentContext(component);\n });\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.components || [];\n }\n\n /**\n * Perform a deep iteration over every component, including those\n * within other container based components.\n *\n * @param {function} fn - Called for every component.\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, options) {\n var components = this.getComponents();\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"hasComponent\",\n value: function hasComponent(component) {\n var result = false;\n this.everyComponent(function (comp) {\n if (comp === component) {\n result = true;\n return false;\n }\n });\n return result;\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents() {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n });\n return result;\n }\n\n /**\n * Perform an iteration over each component within this container component.\n *\n * @param {function} fn - Called for each component\n */\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn) {\n _lodash[\"default\"].each(this.getComponents(), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n\n /**\n * Returns a component provided a key. This performs a deep search within the\n * component tree.\n *\n * @param {string} key - The key of the component to retrieve.\n * @param {function} fn - Called with the component once found.\n * @return {Object} - The component that is located.\n */\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n originalPath = originalPath || (0, _utils.getStringFromComponentPath)(path);\n path = (0, _utils.getArrayFromComponentPath)(path);\n var pathStr = originalPath;\n var newPath = _lodash[\"default\"].clone(path);\n var key = newPath.shift();\n var remainingPath = newPath;\n var comp = null;\n var possibleComp = null;\n if (_lodash[\"default\"].isNumber(key)) {\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return comp;\n }\n this.everyComponent(function (component, components) {\n var matchPath = component.hasInput && component.path ? pathStr.includes(component.path) : true;\n if (component.component.key === key) {\n possibleComp = component;\n if (matchPath) {\n comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n return false;\n }\n }\n });\n if (!comp) {\n comp = possibleComp;\n }\n return comp;\n }\n\n /**\n * Return a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component.\n * @param {function} fn - Called with the component once it is retrieved.\n * @return {Object} - The component retrieved.\n */\n }, {\n key: \"getComponentById\",\n value: function getComponentById(id, fn) {\n var comp = null;\n this.everyComponent(function (component, components) {\n if (component.id === id) {\n comp = component;\n if (fn) {\n fn(component, components);\n }\n return false;\n }\n });\n return comp;\n }\n\n /**\n * Return a path of component's value.\n *\n * @param {Object} component - The component instance.\n * @return {string} - The component's value path.\n */\n }, {\n key: \"calculateComponentPath\",\n value: function calculateComponentPath(component) {\n var path = '';\n if (component.component.key) {\n var thisPath = this;\n while (thisPath && !thisPath.allowData && thisPath.parent) {\n thisPath = thisPath.parent;\n }\n var rowIndex = component.row ? \"[\".concat(Number.parseInt(component.row), \"]\") : '';\n path = thisPath.path ? \"\".concat(thisPath.path).concat(rowIndex, \".\") : '';\n path += component._parentPath && component.component.shouldIncludeSubFormPath ? component._parentPath : '';\n path += component.component.key;\n return path;\n }\n }\n\n /**\n * Create a new component and add it to the components array.\n *\n * @param component\n * @param data\n */\n }, {\n key: \"createComponent\",\n value: function createComponent(component, options, data, before, replacedComp) {\n var _options;\n if (!component) {\n return;\n }\n options = options || this.options;\n data = data || this.data;\n options.parent = this;\n options.parentVisible = this.visible;\n options.root = ((_options = options) === null || _options === void 0 ? void 0 : _options.root) || this.root || this;\n options.localRoot = this.localRoot;\n options.skipInit = true;\n if (!(options.display === 'pdf' && this.builderMode)) {\n component.id = (0, _utils.getRandomComponentId)();\n }\n if (!this.isInputComponent && this.component.shouldIncludeSubFormPath) {\n component.shouldIncludeSubFormPath = true;\n }\n var comp = _Components[\"default\"].create(component, options, data, true);\n var path = this.calculateComponentPath(comp);\n if (path) {\n comp.path = path;\n }\n comp.init();\n if (component.internal) {\n return comp;\n }\n if (before) {\n var index = _lodash[\"default\"].findIndex(this.components, {\n id: before.id\n });\n if (index !== -1) {\n this.components.splice(index, 0, comp);\n } else {\n this.components.push(comp);\n }\n } else if (replacedComp) {\n var _index = _lodash[\"default\"].findIndex(this.components, {\n id: replacedComp.id\n });\n if (_index !== -1) {\n this.components[_index] = comp;\n } else {\n this.components.push(comp);\n }\n } else {\n this.components.push(comp);\n }\n return comp;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.element;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.component.components || [];\n }\n }, {\n key: \"nestedKey\",\n get: function get() {\n return \"nested-\".concat(this.key);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n this.addComponents();\n return _get(_getPrototypeOf(NestedComponent.prototype), \"init\", this).call(this);\n }\n\n /**\n *\n * @param element\n * @param data\n */\n }, {\n key: \"addComponents\",\n value: function addComponents(data, options) {\n var _this5 = this;\n data = data || this.data;\n options = options || this.options;\n if (options.components) {\n this.components = options.components;\n } else {\n var components = this.hook('addComponents', this.componentComponents, this) || [];\n components.forEach(function (component) {\n return _this5.addComponent(component, data);\n });\n }\n }\n\n /**\n * Add a new component to the components array.\n *\n * @param {Object} component - The component JSON schema to add.\n * @param {Object} data - The submission data object to house the data for this component.\n * @param {HTMLElement} before - A DOM element to insert this element before.\n * @return {Component} - The created component instance.\n */\n }, {\n key: \"addComponent\",\n value: function addComponent(component, data, before, noAdd) {\n data = data || this.data;\n if (this.options.parentPath) {\n component.shouldIncludeSubFormPath = true;\n }\n component = this.hook('addComponent', component, data, before, noAdd);\n var comp = this.createComponent(component, this.options, data, before ? before : null);\n if (noAdd) {\n return comp;\n }\n return comp;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus() {\n if (this.parent && 'beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n }\n }, {\n key: \"render\",\n value: function render(children) {\n // If already rendering, don't re-render.\n return _get(_getPrototypeOf(NestedComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(this.templateName, {\n children: !this.visible ? '' : this.renderComponents(),\n nestedKey: this.nestedKey,\n collapsed: this.options.pdf ? false : this.collapsed\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n return this.renderTemplate('components', {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n var superPromise = _get(_getPrototypeOf(NestedComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, _defineProperty({\n header: 'single',\n collapsed: this.collapsed\n }, this.nestedKey, 'single'));\n var childPromise = _nativePromiseOnly[\"default\"].resolve();\n if (this.refs[this.nestedKey]) {\n childPromise = this.attachComponents(this.refs[this.nestedKey]);\n }\n if (!this.visible) {\n this.attachComponentsLogic();\n }\n if (this.component.collapsible && this.refs.header) {\n this.addEventListener(this.refs.header, 'click', function () {\n _this6.collapsed = !_this6.collapsed;\n });\n this.addEventListener(this.refs.header, 'keydown', function (e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n e.preventDefault();\n _this6.collapsed = !_this6.collapsed;\n }\n });\n }\n return _nativePromiseOnly[\"default\"].all([superPromise, childPromise]);\n }\n }, {\n key: \"attachComponentsLogic\",\n value: function attachComponentsLogic(components) {\n components = components || this.components;\n _lodash[\"default\"].each(components, function (comp) {\n comp.attachLogic();\n if (_lodash[\"default\"].isFunction(comp.attachComponentsLogic)) {\n comp.attachComponentsLogic();\n }\n });\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(element, components, container) {\n components = components || this.components;\n container = container || this.component.components;\n element = this.hook('attachComponents', element, components, container, this);\n if (!element) {\n // Return a non-resolving promise.\n return new _nativePromiseOnly[\"default\"](function () {});\n }\n var index = 0;\n var promises = [];\n Array.prototype.slice.call(element.children).forEach(function (child) {\n if (!child.getAttribute('data-noattach') && components[index]) {\n promises.push(components[index].attach(child));\n index++;\n }\n });\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n\n /**\n * Remove a component from the components array.\n *\n * @param {Component} component - The component to remove from the components.\n * @param {Array} components - An array of components to remove this component from.\n */\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, components) {\n components = components || this.components;\n component.destroy();\n _lodash[\"default\"].remove(components, {\n id: component.id\n });\n }\n\n /**\n * Removes a component provided the API key of that component.\n *\n * @param {string} key - The API key of the component to remove.\n * @param {function} fn - Called once the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentByKey\",\n value: function removeComponentByKey(key, fn) {\n var _this7 = this;\n var comp = this.getComponent(key, function (component, components) {\n _this7.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n\n /**\n * Removes a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component to remove.\n * @param {function} fn - Called when the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentById\",\n value: function removeComponentById(id, fn) {\n var _this8 = this;\n var comp = this.getComponentById(id, function (component, components) {\n _this8.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.components.reduce(function (changed, comp) {\n return comp.updateValue(null, flags) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"updateValue\", this).call(this, value, flags));\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n // Nested components with no input should not be validated.\n if (!this.component.input) {\n return true;\n } else {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"shouldSkipValidation\", this).call(this, data, dirty, row);\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n if (this.builderMode) {\n return true;\n }\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n var isValid = components.reduce(function (valid, comp) {\n return comp.checkData(data, _objectSpread({}, flags), row) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"checkData\", this).call(this, data, _objectSpread({}, flags), row));\n this.checkModal(isValid, this.isDirty);\n return isValid;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _get(_getPrototypeOf(NestedComponent.prototype), \"checkConditions\", this).call(this, data, flags, row);\n //row data of parent component not always corresponds to row of nested components, use comp.data as row data for children instead\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, comp.data);\n });\n return check;\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide(show) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"clearOnHide\", this).call(this, show);\n if (this.component.clearOnHide) {\n if (this.allowData && !this.hasValue() && !(this.options.server && !this.visible)) {\n this.dataValue = this.defaultValue;\n }\n if (this.hasValue()) {\n this.restoreComponentsContext();\n }\n }\n this.getComponents().forEach(function (component) {\n return component.clearOnHide(show);\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n return component.data = _this9.dataValue;\n });\n }\n\n /**\n * Allow components to hook into the next page trigger to perform their own logic.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforePage(next);\n }));\n }\n\n /**\n * Allow components to hook into the submission to provide their own async data.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforeSubmit();\n }));\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n // Do not iterate into children and calculateValues if this nested component is conditionally hidden.\n if (!this.conditionallyVisible()) {\n return false;\n }\n return this.getComponents().reduce(function (changed, comp) {\n return comp.calculateValue(data, flags, row) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"calculateValue\", this).call(this, data, flags, row));\n }\n }, {\n key: \"isLastPage\",\n value: function isLastPage() {\n return this.pages.length - 1 === this.page;\n }\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return this.getComponents().reduce(function (valid, comp) {\n return comp.isValid(data, dirty) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"isValid\", this).call(this, data, dirty));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return this.getComponents().reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row, silentCheck) && check;\n }, isParentValid);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var isValid = this.checkChildComponentsValidity(data, dirty, row, silentCheck, _get(_getPrototypeOf(NestedComponent.prototype), \"checkValidity\", this).call(this, data, dirty, row, silentCheck));\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n var _this10 = this;\n return this.ready.then(function () {\n var promises = [_get(_getPrototypeOf(NestedComponent.prototype), \"checkAsyncValidity\", _this10).call(_this10, data, dirty, row, silentCheck)];\n _this10.eachComponent(function (component) {\n return promises.push(component.checkAsyncValidity(data, dirty, row, silentCheck));\n });\n return _nativePromiseOnly[\"default\"].all(promises).then(function (results) {\n return results.reduce(function (valid, result) {\n return valid && result;\n }, true);\n });\n });\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"setPristine\", this).call(this, pristine);\n this.getComponents().forEach(function (comp) {\n return comp.setPristine(pristine);\n });\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine && this.getComponents().every(function (c) {\n return c.isPristine;\n });\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty && this.getComponents().every(function (c) {\n return c.isDirty;\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.components.forEach(function (component) {\n component.detach();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.components.forEach(function (component) {\n component.clear();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"clear\", this).call(this);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyComponents();\n _get(_getPrototypeOf(NestedComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this11 = this;\n var components = this.getComponents().slice();\n components.forEach(function (comp) {\n return _this11.removeComponent(comp, _this11.components);\n });\n this.components = [];\n }\n }, {\n key: \"errors\",\n get: function get() {\n var thisErrors = this.error ? [this.error] : [];\n return this.getComponents().reduce(function (errors, comp) {\n return errors.concat(comp.errors || []);\n }, thisErrors).filter(function (err) {\n return err.level !== 'hidden';\n });\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.data;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(NestedComponent.prototype), \"resetValue\", this).call(this);\n this.getComponents().forEach(function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.dataReady;\n }));\n }\n }, {\n key: \"setNestedValue\",\n value: function setNestedValue(component, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n component._data = this.componentContext(component);\n if (component.type === 'button') {\n return false;\n }\n if (component.type === 'components') {\n if (component.tree && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n }\n return component.setValue(value, flags);\n } else if (value && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n } else if ((!this.rootPristine || component.visible) && component.shouldAddDefaultValue) {\n flags.noValidate = !flags.dirty;\n flags.resetValue = true;\n return component.setValue(component.defaultValue, flags);\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n if (value.submitAsDraft && !value.submit) {\n flags.noValidate = true;\n }\n return this.getComponents().reduce(function (changed, component) {\n return _this12.setNestedValue(component, value, flags, changed) || changed;\n }, false);\n }\n }, {\n key: \"lazyLoad\",\n get: function get() {\n var _this$component$lazyL;\n return (_this$component$lazyL = this.component.lazyLoad) !== null && _this$component$lazyL !== void 0 ? _this$component$lazyL : false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n tree: false,\n lazyLoad: false\n }].concat(extend));\n }\n }]);\n return NestedComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = NestedComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nested/NestedComponent.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../../Components */ \"./lib/components/Components.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedComponent = /*#__PURE__*/function (_Field) {\n _inherits(NestedComponent, _Field);\n var _super = _createSuper(NestedComponent);\n function NestedComponent(component, options, data) {\n var _this;\n _classCallCheck(this, NestedComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'components';\n _this._collapsed = !!_this.component.collapsed;\n return _this;\n }\n _createClass(NestedComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return NestedComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(NestedComponent.prototype), \"schema\", this);\n var components = _lodash[\"default\"].uniqBy(this.getComponents(), 'component.key');\n schema.components = _lodash[\"default\"].map(components, 'schema');\n return schema;\n }\n }, {\n key: \"collapsed\",\n get: function get() {\n return this._collapsed;\n },\n set: function set(value) {\n this._collapsed = value;\n this.collapse(value);\n }\n }, {\n key: \"collapse\",\n value: function collapse(value) {\n var promise = this.redraw();\n if (!value) {\n this.checkValidity(this.data, !this.pristine, null, this.pristine);\n }\n return promise;\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n // DO NOT CALL super here. There is an issue where clearOnHide was getting triggered with\n // subcomponents because the \"parentVisible\" flag was set to false when it should really be\n // set to true.\n var visibilityChanged = this._visible !== value;\n this._visible = value;\n var isVisible = this.visible;\n var forceShow = this.shouldForceShow();\n var forceHide = this.shouldForceHide();\n this.components.forEach(function (component) {\n // Set the parent visibility first since we may have nested components within nested components\n // and they need to be able to determine their visibility based on the parent visibility.\n component.parentVisible = isVisible;\n var conditionallyVisible = component.conditionallyVisible();\n if (forceShow || conditionallyVisible) {\n component.visible = true;\n } else if (forceHide || !isVisible || !conditionallyVisible) {\n component.visible = false;\n }\n // If hiding a nested component, clear all errors below.\n if (!component.visible) {\n component.error = '';\n }\n });\n if (visibilityChanged) {\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this2 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", value, this, true);\n this.components.forEach(function (component) {\n return component.parentVisible = _this2.visible;\n });\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"disabled\", disabled, this, true);\n this.components.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", this);\n },\n set: function set(value) {\n var _this3 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", value, this, true);\n this.components.forEach(function (component) {\n component.parentDisabled = _this3.disabled;\n });\n }\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.ready;\n }));\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", this);\n },\n set: function set(instance) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", instance, this, true);\n this.getComponents().forEach(function (component) {\n component.currentForm = instance;\n });\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return this._rowIndex;\n },\n set: function set(value) {\n this._rowIndex = value;\n this.eachComponent(function (component) {\n component.rowIndex = value;\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n var _this4 = this;\n this._data = value;\n this.eachComponent(function (component) {\n component.data = _this4.componentContext(component);\n });\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.components || [];\n }\n\n /**\n * Perform a deep iteration over every component, including those\n * within other container based components.\n *\n * @param {function} fn - Called for every component.\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, options) {\n var components = this.getComponents();\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"hasComponent\",\n value: function hasComponent(component) {\n var result = false;\n this.everyComponent(function (comp) {\n if (comp === component) {\n result = true;\n return false;\n }\n });\n return result;\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents() {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n });\n return result;\n }\n\n /**\n * Perform an iteration over each component within this container component.\n *\n * @param {function} fn - Called for each component\n */\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn) {\n _lodash[\"default\"].each(this.getComponents(), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n\n /**\n * Returns a component provided a key. This performs a deep search within the\n * component tree.\n *\n * @param {string} key - The key of the component to retrieve.\n * @param {function} fn - Called with the component once found.\n * @return {Object} - The component that is located.\n */\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n originalPath = originalPath || (0, _utils.getStringFromComponentPath)(path);\n path = (0, _utils.getArrayFromComponentPath)(path);\n var pathStr = originalPath;\n var newPath = _lodash[\"default\"].clone(path);\n var key = newPath.shift();\n var remainingPath = newPath;\n var comp = null;\n var possibleComp = null;\n if (_lodash[\"default\"].isNumber(key)) {\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return comp;\n }\n this.everyComponent(function (component, components) {\n var matchPath = component.hasInput && component.path ? pathStr.includes(component.path) : true;\n if (component.component.key === key) {\n possibleComp = component;\n if (matchPath) {\n comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n return false;\n }\n }\n });\n if (!comp) {\n comp = possibleComp;\n }\n return comp;\n }\n\n /**\n * Return a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component.\n * @param {function} fn - Called with the component once it is retrieved.\n * @return {Object} - The component retrieved.\n */\n }, {\n key: \"getComponentById\",\n value: function getComponentById(id, fn) {\n var comp = null;\n this.everyComponent(function (component, components) {\n if (component.id === id) {\n comp = component;\n if (fn) {\n fn(component, components);\n }\n return false;\n }\n });\n return comp;\n }\n\n /**\n * Return a path of component's value.\n *\n * @param {Object} component - The component instance.\n * @return {string} - The component's value path.\n */\n }, {\n key: \"calculateComponentPath\",\n value: function calculateComponentPath(component) {\n var path = '';\n if (component.component.key) {\n var thisPath = this;\n while (thisPath && !thisPath.allowData && thisPath.parent) {\n thisPath = thisPath.parent;\n }\n // any component that is nested in e.g. a Data Grid or an Edit Grid is going to receive a row prop; the problem\n // is that options.row is passed to each further nested component, which results in erroneous paths like\n // `editGrid[0].container[0].textField` rather than `editGrid[0].container.textField`. This should be adapted for other\n // components with a tree-like data model\n var rowIndex = component.row && !['container'].includes(thisPath.component.type) ? \"[\".concat(Number.parseInt(component.row), \"]\") : '';\n path = thisPath.path ? \"\".concat(thisPath.path).concat(rowIndex, \".\") : '';\n path += component._parentPath && component.component.shouldIncludeSubFormPath ? component._parentPath : '';\n path += component.component.key;\n return path;\n }\n }\n\n /**\n * Create a new component and add it to the components array.\n *\n * @param component\n * @param data\n */\n }, {\n key: \"createComponent\",\n value: function createComponent(component, options, data, before, replacedComp) {\n var _options;\n if (!component) {\n return;\n }\n options = options || this.options;\n data = data || this.data;\n options.parent = this;\n options.parentVisible = this.visible;\n options.root = ((_options = options) === null || _options === void 0 ? void 0 : _options.root) || this.root || this;\n options.localRoot = this.localRoot;\n options.skipInit = true;\n if (!(options.display === 'pdf' && this.builderMode)) {\n component.id = (0, _utils.getRandomComponentId)();\n }\n if (!this.isInputComponent && this.component.shouldIncludeSubFormPath) {\n component.shouldIncludeSubFormPath = true;\n }\n var comp = _Components[\"default\"].create(component, options, data, true);\n var path = this.calculateComponentPath(comp);\n if (path) {\n comp.path = path;\n }\n comp.init();\n if (component.internal) {\n return comp;\n }\n if (before) {\n var index = _lodash[\"default\"].findIndex(this.components, {\n id: before.id\n });\n if (index !== -1) {\n this.components.splice(index, 0, comp);\n } else {\n this.components.push(comp);\n }\n } else if (replacedComp) {\n var _index = _lodash[\"default\"].findIndex(this.components, {\n id: replacedComp.id\n });\n if (_index !== -1) {\n this.components[_index] = comp;\n } else {\n this.components.push(comp);\n }\n } else {\n this.components.push(comp);\n }\n return comp;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.element;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.component.components || [];\n }\n }, {\n key: \"nestedKey\",\n get: function get() {\n return \"nested-\".concat(this.key);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n this.addComponents();\n return _get(_getPrototypeOf(NestedComponent.prototype), \"init\", this).call(this);\n }\n\n /**\n *\n * @param element\n * @param data\n */\n }, {\n key: \"addComponents\",\n value: function addComponents(data, options) {\n var _this5 = this;\n data = data || this.data;\n options = options || this.options;\n if (options.components) {\n this.components = options.components;\n } else {\n var components = this.hook('addComponents', this.componentComponents, this) || [];\n components.forEach(function (component) {\n return _this5.addComponent(component, data);\n });\n }\n }\n\n /**\n * Add a new component to the components array.\n *\n * @param {Object} component - The component JSON schema to add.\n * @param {Object} data - The submission data object to house the data for this component.\n * @param {HTMLElement} before - A DOM element to insert this element before.\n * @return {Component} - The created component instance.\n */\n }, {\n key: \"addComponent\",\n value: function addComponent(component, data, before, noAdd) {\n data = data || this.data;\n if (this.options.parentPath) {\n component.shouldIncludeSubFormPath = true;\n }\n component = this.hook('addComponent', component, data, before, noAdd);\n var comp = this.createComponent(component, this.options, data, before ? before : null);\n if (noAdd) {\n return comp;\n }\n return comp;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus() {\n if (this.parent && 'beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n }\n }, {\n key: \"render\",\n value: function render(children) {\n // If already rendering, don't re-render.\n return _get(_getPrototypeOf(NestedComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(this.templateName, {\n children: !this.visible ? '' : this.renderComponents(),\n nestedKey: this.nestedKey,\n collapsed: this.options.pdf ? false : this.collapsed\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n return this.renderTemplate('components', {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n var superPromise = _get(_getPrototypeOf(NestedComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, _defineProperty({\n header: 'single',\n collapsed: this.collapsed\n }, this.nestedKey, 'single'));\n var childPromise = _nativePromiseOnly[\"default\"].resolve();\n if (this.refs[this.nestedKey]) {\n childPromise = this.attachComponents(this.refs[this.nestedKey]);\n }\n if (!this.visible) {\n this.attachComponentsLogic();\n }\n if (this.component.collapsible && this.refs.header) {\n this.addEventListener(this.refs.header, 'click', function () {\n _this6.collapsed = !_this6.collapsed;\n });\n this.addEventListener(this.refs.header, 'keydown', function (e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n e.preventDefault();\n _this6.collapsed = !_this6.collapsed;\n }\n });\n }\n return _nativePromiseOnly[\"default\"].all([superPromise, childPromise]);\n }\n }, {\n key: \"attachComponentsLogic\",\n value: function attachComponentsLogic(components) {\n components = components || this.components;\n _lodash[\"default\"].each(components, function (comp) {\n comp.attachLogic();\n if (_lodash[\"default\"].isFunction(comp.attachComponentsLogic)) {\n comp.attachComponentsLogic();\n }\n });\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(element, components, container) {\n components = components || this.components;\n container = container || this.component.components;\n element = this.hook('attachComponents', element, components, container, this);\n if (!element) {\n // Return a non-resolving promise.\n return new _nativePromiseOnly[\"default\"](function () {});\n }\n var index = 0;\n var promises = [];\n Array.prototype.slice.call(element.children).forEach(function (child) {\n if (!child.getAttribute('data-noattach') && components[index]) {\n promises.push(components[index].attach(child));\n index++;\n }\n });\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n\n /**\n * Remove a component from the components array.\n *\n * @param {Component} component - The component to remove from the components.\n * @param {Array} components - An array of components to remove this component from.\n */\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, components) {\n components = components || this.components;\n component.destroy();\n _lodash[\"default\"].remove(components, {\n id: component.id\n });\n }\n\n /**\n * Removes a component provided the API key of that component.\n *\n * @param {string} key - The API key of the component to remove.\n * @param {function} fn - Called once the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentByKey\",\n value: function removeComponentByKey(key, fn) {\n var _this7 = this;\n var comp = this.getComponent(key, function (component, components) {\n _this7.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n\n /**\n * Removes a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component to remove.\n * @param {function} fn - Called when the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentById\",\n value: function removeComponentById(id, fn) {\n var _this8 = this;\n var comp = this.getComponentById(id, function (component, components) {\n _this8.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.components.reduce(function (changed, comp) {\n return comp.updateValue(null, flags) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"updateValue\", this).call(this, value, flags));\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n // Nested components with no input should not be validated.\n if (!this.component.input) {\n return true;\n } else {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"shouldSkipValidation\", this).call(this, data, dirty, row);\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n if (this.builderMode) {\n return true;\n }\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n var isValid = components.reduce(function (valid, comp) {\n return comp.checkData(data, _objectSpread({}, flags), row) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"checkData\", this).call(this, data, _objectSpread({}, flags), row));\n this.checkModal(isValid, this.isDirty);\n return isValid;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _get(_getPrototypeOf(NestedComponent.prototype), \"checkConditions\", this).call(this, data, flags, row);\n //row data of parent component not always corresponds to row of nested components, use comp.data as row data for children instead\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, comp.data);\n });\n return check;\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide(show) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"clearOnHide\", this).call(this, show);\n if (this.component.clearOnHide) {\n if (this.allowData && !this.hasValue() && !(this.options.server && !this.visible)) {\n this.dataValue = this.defaultValue;\n }\n if (this.hasValue()) {\n this.restoreComponentsContext();\n }\n }\n this.getComponents().forEach(function (component) {\n return component.clearOnHide(show);\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n return component.data = _this9.dataValue;\n });\n }\n\n /**\n * Allow components to hook into the next page trigger to perform their own logic.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforePage(next);\n }));\n }\n\n /**\n * Allow components to hook into the submission to provide their own async data.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforeSubmit();\n }));\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n // Do not iterate into children and calculateValues if this nested component is conditionally hidden.\n if (!this.conditionallyVisible()) {\n return false;\n }\n return this.getComponents().reduce(function (changed, comp) {\n return comp.calculateValue(data, flags, row) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"calculateValue\", this).call(this, data, flags, row));\n }\n }, {\n key: \"isLastPage\",\n value: function isLastPage() {\n return this.pages.length - 1 === this.page;\n }\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return this.getComponents().reduce(function (valid, comp) {\n return comp.isValid(data, dirty) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"isValid\", this).call(this, data, dirty));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return this.getComponents().reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row, silentCheck) && check;\n }, isParentValid);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var isValid = this.checkChildComponentsValidity(data, dirty, row, silentCheck, _get(_getPrototypeOf(NestedComponent.prototype), \"checkValidity\", this).call(this, data, dirty, row, silentCheck));\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n var _this10 = this;\n return this.ready.then(function () {\n var promises = [_get(_getPrototypeOf(NestedComponent.prototype), \"checkAsyncValidity\", _this10).call(_this10, data, dirty, row, silentCheck)];\n _this10.eachComponent(function (component) {\n return promises.push(component.checkAsyncValidity(data, dirty, row, silentCheck));\n });\n return _nativePromiseOnly[\"default\"].all(promises).then(function (results) {\n return results.reduce(function (valid, result) {\n return valid && result;\n }, true);\n });\n });\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"setPristine\", this).call(this, pristine);\n this.getComponents().forEach(function (comp) {\n return comp.setPristine(pristine);\n });\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine && this.getComponents().every(function (c) {\n return c.isPristine;\n });\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty && this.getComponents().every(function (c) {\n return c.isDirty;\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.components.forEach(function (component) {\n component.detach();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.components.forEach(function (component) {\n component.clear();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"clear\", this).call(this);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyComponents();\n _get(_getPrototypeOf(NestedComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this11 = this;\n var components = this.getComponents().slice();\n components.forEach(function (comp) {\n return _this11.removeComponent(comp, _this11.components);\n });\n this.components = [];\n }\n }, {\n key: \"errors\",\n get: function get() {\n var thisErrors = this.error ? [this.error] : [];\n return this.getComponents().reduce(function (errors, comp) {\n return errors.concat(comp.errors || []);\n }, thisErrors).filter(function (err) {\n return err.level !== 'hidden';\n });\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.data;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(NestedComponent.prototype), \"resetValue\", this).call(this);\n this.getComponents().forEach(function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.dataReady;\n }));\n }\n }, {\n key: \"setNestedValue\",\n value: function setNestedValue(component, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n component._data = this.componentContext(component);\n if (component.type === 'button') {\n return false;\n }\n if (component.type === 'components') {\n if (component.tree && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n }\n return component.setValue(value, flags);\n } else if (value && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n } else if ((!this.rootPristine || component.visible) && component.shouldAddDefaultValue) {\n flags.noValidate = !flags.dirty;\n flags.resetValue = true;\n return component.setValue(component.defaultValue, flags);\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n if (value.submitAsDraft && !value.submit) {\n flags.noValidate = true;\n }\n return this.getComponents().reduce(function (changed, component) {\n return _this12.setNestedValue(component, value, flags, changed) || changed;\n }, false);\n }\n }, {\n key: \"lazyLoad\",\n get: function get() {\n var _this$component$lazyL;\n return (_this$component$lazyL = this.component.lazyLoad) !== null && _this$component$lazyL !== void 0 ? _this$component$lazyL : false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n tree: false,\n lazyLoad: false\n }].concat(extend));\n }\n }]);\n return NestedComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = NestedComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nested/NestedComponent.js?"); /***/ }), @@ -444,7 +444,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedArrayComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(NestedArrayComponent, _NestedDataComponent);\n var _super = _createSuper(NestedArrayComponent);\n function NestedArrayComponent() {\n _classCallCheck(this, NestedArrayComponent);\n return _super.apply(this, arguments);\n }\n _createClass(NestedArrayComponent, [{\n key: \"componentContext\",\n value: function componentContext(component) {\n return this.iteratableRows[component.rowIndex].data;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n throw new Error('Getter #iteratableRows() is not implemented');\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"rowIndex\", this);\n },\n set: function set(value) {\n this._rowIndex = value;\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(NestedArrayComponent.prototype), \"init\", this).call(this);\n this.prevHasAddButton = this.hasAddButton();\n }\n }, {\n key: \"checkAddButtonChanged\",\n value: function checkAddButtonChanged() {\n var isAddButton = this.hasAddButton();\n if (isAddButton !== this.prevHasAddButton) {\n this.prevHasAddButton = isAddButton;\n this.redraw();\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n this.checkAddButtonChanged();\n return this.checkRows('checkData', data, flags, _Component[\"default\"].prototype.checkData.call(this, data, flags, row));\n }\n }, {\n key: \"checkRows\",\n value: function checkRows(method, data, opts, defaultValue, silentCheck) {\n var _this = this;\n return this.iteratableRows.reduce(function (valid, row, rowIndex) {\n if (!(opts !== null && opts !== void 0 && opts.rowIndex) || (opts === null || opts === void 0 ? void 0 : opts.rowIndex) === rowIndex) {\n return _this.checkRow(method, data, opts, row.data, row.components, silentCheck) && valid;\n } else {\n return valid;\n }\n }, defaultValue);\n }\n }, {\n key: \"checkRow\",\n value: function checkRow(method, data, opts, row, components, silentCheck) {\n if (opts !== null && opts !== void 0 && opts.isolateRow) {\n silentCheck = true;\n opts.noRefresh = true;\n }\n var valid = _lodash[\"default\"].reduce(components, function (valid, component) {\n return component[method](data, opts, row, silentCheck) && valid;\n }, true);\n if (opts !== null && opts !== void 0 && opts.noRefresh) {\n delete opts.noRefresh;\n }\n return valid;\n }\n }, {\n key: \"hasAddButton\",\n value: function hasAddButton() {\n var maxLength = _lodash[\"default\"].get(this.component, 'validate.maxLength');\n var conditionalAddButton = _lodash[\"default\"].get(this.component, 'conditionalAddButton');\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && !this.options.preview && (!maxLength || this.iteratableRows.length < maxLength) && (!conditionalAddButton || this.evaluate(conditionalAddButton, {\n value: this.dataValue\n }, 'show'));\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n path = Array.isArray(path) ? path : [path];\n var key = path.shift();\n var remainingPath = path;\n var result = [];\n var possibleComp = null;\n var comp = null;\n var rowIndex = null;\n if (_lodash[\"default\"].isNumber(key)) {\n rowIndex = key;\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n possibleComp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n result = rowIndex !== null ? comp : result.concat(comp || possibleComp);\n }\n }, rowIndex);\n if ((!result || result.length === 0) && possibleComp) {\n result = rowIndex !== null ? possibleComp : [possibleComp];\n }\n return result;\n }\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, rowIndex, options) {\n var _options;\n if (_lodash[\"default\"].isObject(rowIndex)) {\n options = rowIndex;\n rowIndex = null;\n }\n if ((_options = options) !== null && _options !== void 0 && _options.email) {\n return;\n }\n var components = this.getComponents(rowIndex);\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (options !== null && options !== void 0 && options.email) {\n var _this$component$compo;\n var result = \"\\n \\n \\n \\n \";\n (_this$component$compo = this.component.components) === null || _this$component$compo === void 0 ? void 0 : _this$component$compo.forEach(function (component) {\n var label = component.label || component.key;\n result += \"\");\n });\n result += \"\\n \\n \\n \\n \";\n this.iteratableRows.forEach(function (_ref) {\n var components = _ref.components;\n result += '';\n _lodash[\"default\"].each(components, function (component) {\n result += '';\n });\n result += '';\n });\n result += \"\\n \\n
\".concat(label, \"
';\n if (component.isInputComponent && component.visible && !component.skipInEmail) {\n result += component.getView(component.dataValue, options);\n }\n result += '
\\n \";\n return result;\n }\n if (!value || !value.length) {\n return '';\n }\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"getValueAsString\", this).call(this, value, options);\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n if (rowIndex !== undefined) {\n if (!this.iteratableRows[rowIndex]) {\n return [];\n }\n return this.iteratableRows[rowIndex].components;\n }\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"getComponents\", this).call(this);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n disableAddingRemovingRows: false\n }].concat(extend));\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [_utils.componentValueTypes.array];\n }\n }]);\n return NestedArrayComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = NestedArrayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nestedarray/NestedArrayComponent.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedArrayComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(NestedArrayComponent, _NestedDataComponent);\n var _super = _createSuper(NestedArrayComponent);\n function NestedArrayComponent() {\n _classCallCheck(this, NestedArrayComponent);\n return _super.apply(this, arguments);\n }\n _createClass(NestedArrayComponent, [{\n key: \"componentContext\",\n value: function componentContext(component) {\n return this.iteratableRows[component.rowIndex].data;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n throw new Error('Getter #iteratableRows() is not implemented');\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"rowIndex\", this);\n },\n set: function set(value) {\n this._rowIndex = value;\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(NestedArrayComponent.prototype), \"init\", this).call(this);\n this.prevHasAddButton = this.hasAddButton();\n }\n }, {\n key: \"checkAddButtonChanged\",\n value: function checkAddButtonChanged() {\n var isAddButton = this.hasAddButton();\n if (isAddButton !== this.prevHasAddButton) {\n this.prevHasAddButton = isAddButton;\n this.redraw();\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n this.checkAddButtonChanged();\n return this.checkRows('checkData', data, flags, _Component[\"default\"].prototype.checkData.call(this, data, flags, row));\n }\n }, {\n key: \"checkRows\",\n value: function checkRows(method, data, opts, defaultValue, silentCheck) {\n var _this = this;\n return this.iteratableRows.reduce(function (valid, row, rowIndex) {\n if (!(opts !== null && opts !== void 0 && opts.rowIndex) || (opts === null || opts === void 0 ? void 0 : opts.rowIndex) === rowIndex) {\n return _this.checkRow(method, data, opts, row.data, row.components, silentCheck) && valid;\n } else {\n return valid;\n }\n }, defaultValue);\n }\n }, {\n key: \"checkRow\",\n value: function checkRow(method, data, opts, row, components, silentCheck) {\n if (opts !== null && opts !== void 0 && opts.isolateRow) {\n silentCheck = true;\n opts.noRefresh = true;\n }\n var valid = _lodash[\"default\"].reduce(components, function (valid, component) {\n return component[method](data, opts, row, silentCheck) && valid;\n }, true);\n if (opts !== null && opts !== void 0 && opts.noRefresh) {\n delete opts.noRefresh;\n }\n return valid;\n }\n }, {\n key: \"hasAddButton\",\n value: function hasAddButton() {\n var maxLength = _lodash[\"default\"].get(this.component, 'validate.maxLength');\n var conditionalAddButton = _lodash[\"default\"].get(this.component, 'conditionalAddButton');\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && !this.options.preview && (!maxLength || this.iteratableRows.length < maxLength) && (!conditionalAddButton || this.evaluate(conditionalAddButton, {\n value: this.dataValue\n }, 'show'));\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n path = Array.isArray(path) ? path : [path];\n var key = path.shift();\n var remainingPath = path;\n var result = [];\n var possibleComp = null;\n var comp = null;\n var rowIndex = null;\n if (_lodash[\"default\"].isNumber(key)) {\n rowIndex = key;\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n possibleComp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n result = rowIndex !== null ? comp : result.concat(comp || possibleComp);\n }\n }, rowIndex);\n if ((!result || result.length === 0) && possibleComp) {\n result = rowIndex !== null ? possibleComp : [possibleComp];\n }\n return result;\n }\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, rowIndex, options) {\n var _options;\n if (_lodash[\"default\"].isObject(rowIndex)) {\n options = rowIndex;\n rowIndex = null;\n }\n if ((_options = options) !== null && _options !== void 0 && _options.email) {\n return;\n }\n var components = this.getComponents(rowIndex);\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (options !== null && options !== void 0 && options.email) {\n var _this$component$compo;\n var result = \"\\n \\n \\n \\n \";\n (_this$component$compo = this.component.components) === null || _this$component$compo === void 0 ? void 0 : _this$component$compo.forEach(function (component) {\n var label = component.label || component.key;\n result += \"\");\n });\n result += \"\\n \\n \\n \\n \";\n this.iteratableRows.forEach(function (_ref) {\n var components = _ref.components;\n result += '';\n _lodash[\"default\"].each(components, function (component) {\n result += '';\n });\n result += '';\n });\n result += \"\\n \\n
\".concat(label, \"
';\n if (component.isInputComponent && component.visible && !component.skipInEmail) {\n result += component.getView(component.dataValue, options);\n }\n result += '
\\n \";\n return result;\n }\n if (!value || !value.length) {\n return '';\n }\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"getValueAsString\", this).call(this, value, options);\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n if (rowIndex !== undefined) {\n if (!this.iteratableRows[rowIndex]) {\n return [];\n }\n return this.iteratableRows[rowIndex].components;\n }\n return _get(_getPrototypeOf(NestedArrayComponent.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"removeSubmissionMetadataRow\",\n value: function removeSubmissionMetadataRow(index) {\n var componentMetadata = _lodash[\"default\"].get(this.root, \"submission.metadata.selectData.\".concat(this.path), null);\n if (_lodash[\"default\"].isArray(componentMetadata)) {\n componentMetadata.splice(index, 1);\n }\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n disableAddingRemovingRows: false\n }].concat(extend));\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [_utils.componentValueTypes.array];\n }\n }]);\n return NestedArrayComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = NestedArrayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nestedarray/NestedArrayComponent.js?"); /***/ }), @@ -477,7 +477,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.AddressComponentMode = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _autocompleter = _interopRequireDefault(__webpack_require__(/*! autocompleter */ \"./node_modules/autocompleter/autocomplete.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _GoogleAddressProvider = __webpack_require__(/*! ../../providers/address/GoogleAddressProvider */ \"./lib/providers/address/GoogleAddressProvider.js\");\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _NestedComponent = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nvar _Container = _interopRequireDefault(__webpack_require__(/*! ../container/Container */ \"./lib/components/container/Container.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar AddressComponentMode = {\n Autocomplete: 'autocomplete',\n Manual: 'manual'\n};\nexports.AddressComponentMode = AddressComponentMode;\nvar RemoveValueIconHiddenClass = 'address-autocomplete-remove-value-icon--hidden';\nvar ChildConditional = 'show = _.get(instance, \\'parent.manualMode\\', false);';\nvar AddressComponent = /*#__PURE__*/function (_ContainerComponent) {\n _inherits(AddressComponent, _ContainerComponent);\n var _super = _createSuper(AddressComponent);\n function AddressComponent() {\n _classCallCheck(this, AddressComponent);\n return _super.apply(this, arguments);\n }\n _createClass(AddressComponent, [{\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaultSchema = this.defaultSchema;\n if (component.components) {\n defaultSchema = _lodash[\"default\"].omit(defaultSchema, 'components');\n }\n return _lodash[\"default\"].defaultsDeep(component, defaultSchema);\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n if (this.builderMode || this.manualModeEnabled) {\n _NestedComponent[\"default\"].prototype.addComponents.call(this, this.manualMode ? this.address : {});\n }\n _Field[\"default\"].prototype.init.call(this);\n if (!this.builderMode) {\n if (this.component.provider) {\n var _this$component = this.component,\n provider = _this$component.provider,\n providerOptions = _this$component.providerOptions;\n this.provider = this.initializeProvider(provider, providerOptions);\n } else if (this.component.map) {\n // Fallback to legacy version where Google Maps was the only provider.\n this.component.provider = _GoogleAddressProvider.GoogleAddressProvider.name;\n this.component.providerOptions = this.component.providerOptions || {};\n var _this$component2 = this.component,\n map = _this$component2.map,\n _provider = _this$component2.provider,\n _providerOptions = _this$component2.providerOptions;\n var key = map.key,\n region = map.region;\n if (key) {\n _lodash[\"default\"].set(_providerOptions, 'params.key', key);\n }\n if (region) {\n _lodash[\"default\"].set(_providerOptions, 'params.region', region);\n }\n this.provider = this.initializeProvider(_provider, _providerOptions);\n }\n }\n }\n }, {\n key: \"initializeProvider\",\n value: function initializeProvider(provider) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var url = this.interpolate(options.url);\n var Provider = _Formio.GlobalFormio.Providers.getProvider('address', provider);\n return new Provider(_objectSpread(_objectSpread({}, options), {}, {\n url: url\n }));\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.manualModeEnabled ? {\n mode: AddressComponentMode.Autocomplete,\n address: {}\n } : {};\n }\n }, {\n key: \"mode\",\n get: function get() {\n var _this$dataValue$mode, _this$dataValue;\n if (!this.manualModeEnabled) {\n return AddressComponentMode.Autocomplete;\n }\n return (_this$dataValue$mode = (_this$dataValue = this.dataValue) === null || _this$dataValue === void 0 ? void 0 : _this$dataValue.mode) !== null && _this$dataValue$mode !== void 0 ? _this$dataValue$mode : AddressComponentMode.Autocomplete;\n },\n set: function set(value) {\n if (this.manualModeEnabled) {\n this.dataValue.mode = value;\n }\n }\n }, {\n key: \"autocompleteMode\",\n get: function get() {\n return this.mode === AddressComponentMode.Autocomplete;\n }\n }, {\n key: \"manualMode\",\n get: function get() {\n return this.mode === AddressComponentMode.Manual;\n }\n }, {\n key: \"manualModeEnabled\",\n get: function get() {\n return !this.isMultiple && Boolean(this.component.enableManualMode);\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this = this;\n this.getComponents().forEach(function (component) {\n component.data = _this.address;\n component.setValue(component.dataValue, {\n noUpdateEvent: true\n });\n });\n }\n }, {\n key: \"isMultiple\",\n get: function get() {\n return Boolean(this.component.multiple);\n }\n }, {\n key: \"address\",\n get: function get() {\n if (this.isMultiple) {\n return _lodash[\"default\"].isArray(this.dataValue) ? this.dataValue : [this.dataValue];\n }\n // Manual mode is not implementing for multiple value\n return this.manualModeEnabled && this.dataValue ? this.dataValue.address : this.dataValue;\n },\n set: function set(value) {\n if (this.manualModeEnabled && !this.isMultiple) {\n this.dataValue.address = value;\n } else {\n this.dataValue = value;\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(AddressComponent.prototype), \"defaultValue\", this);\n if (this.isMultiple) {\n defaultValue = _lodash[\"default\"].isArray(defaultValue) ? defaultValue : [defaultValue];\n }\n return defaultValue;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return AddressComponent.schema();\n }\n }, {\n key: \"isValueInLegacyFormat\",\n value: function isValueInLegacyFormat(value) {\n return value && !value.mode;\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n return this.manualModeEnabled && this.isValueInLegacyFormat(value) ? {\n mode: AddressComponentMode.Autocomplete,\n address: value\n } : value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _Field[\"default\"].prototype.setValue.call(this, value, flags);\n if (this.manualMode) {\n this.restoreComponentsContext();\n }\n if (changed || !_lodash[\"default\"].isEmpty(value) && flags.fromSubmission) {\n this.redraw();\n }\n return changed;\n }\n }, {\n key: \"modeSwitcher\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.modeSwitcherRef] || null : null;\n }\n }, {\n key: \"removeValueIcon\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.removeValueIconRef] || null : null;\n }\n }, {\n key: \"searchInput\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.searchInputRef] || null : null;\n }\n }, {\n key: \"addRowButton\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.addRowButtonRef] || null : null;\n }\n }, {\n key: \"removeRowButton\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.removeRowButtonRef] || null : null;\n }\n }, {\n key: \"searchInputAttributes\",\n get: function get() {\n var attr = {\n name: this.options.name,\n type: 'text',\n \"class\": 'form-control',\n lang: this.options.language,\n tabindex: this.component.tabindex || 0\n };\n if (this.component.placeholder) {\n attr.placeholder = this.t(this.component.placeholder), {\n _userInput: true\n };\n }\n if (this.disabled) {\n attr.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attr, this.component.attributes);\n return attr;\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'address';\n }\n }, {\n key: \"gridTemplateName\",\n get: function get() {\n return 'multiValueTable';\n }\n }, {\n key: \"rowTemplateName\",\n get: function get() {\n return 'multiValueRow';\n }\n }, {\n key: \"hasChildren\",\n get: function get() {\n return !this.isMultiple && (this.builderMode || this.manualModeEnabled);\n }\n }, {\n key: \"addAnother\",\n get: function get() {\n return this.t(this.component.addAnother || 'Add Another');\n }\n }, {\n key: \"renderElement\",\n value: function renderElement(value) {\n return this.renderTemplate(this.templateName, {\n children: this.hasChildren ? this.renderComponents() : '',\n nestedKey: this.nestedKey,\n inputAttributes: this.searchInputAttributes,\n ref: {\n modeSwitcher: AddressComponent.modeSwitcherRef,\n removeValueIcon: AddressComponent.removeValueIconRef,\n searchInput: AddressComponent.searchInputRef\n },\n displayValue: this.getDisplayValue(value),\n mode: {\n autocomplete: this.autocompleteMode,\n manual: this.manualMode\n }\n });\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(value, index) {\n return this.renderTemplate(this.rowTemplateName, {\n index: index,\n disabled: this.disabled,\n element: \"\".concat(this.renderElement(value, index))\n });\n }\n }, {\n key: \"renderGrid\",\n value: function renderGrid() {\n return this.renderTemplate(this.gridTemplateName, {\n rows: this.address.map(this.renderRow.bind(this)).join(''),\n disabled: this.disabled,\n addAnother: this.addAnother\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isMultiple) {\n return _get(_getPrototypeOf(AddressComponent.prototype), \"render\", this).call(this, this.renderGrid());\n }\n return _get(_getPrototypeOf(AddressComponent.prototype), \"render\", this).call(this, this.renderElement());\n }\n }, {\n key: \"onSelectAddress\",\n value: function onSelectAddress(address, element, index) {\n if (this.isMultiple) {\n this.address[index] = address;\n this.address = _toConsumableArray(this.address);\n } else {\n this.address = address;\n }\n this.triggerChange({\n modified: true\n });\n if (element) {\n element.value = this.getDisplayValue(this.isMultiple ? this.address[index] : this.address);\n }\n this.updateRemoveIcon(index);\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n this.address = this.address.concat(this.emptyValue);\n _get(_getPrototypeOf(AddressComponent.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this2 = this;\n var result = (this.builderMode || this.manualMode ? _get(_getPrototypeOf(AddressComponent.prototype), \"attach\", this) : _Field[\"default\"].prototype.attach).call(this, element);\n if (!this.builderMode) {\n if (!this.provider && this.component.provider) {\n var _this$component3 = this.component,\n provider = _this$component3.provider,\n providerOptions = _this$component3.providerOptions;\n this.provider = this.initializeProvider(provider, providerOptions);\n }\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, AddressComponent.addRowButtonRef, 'single'), _defineProperty(_this$loadRefs, AddressComponent.modeSwitcherRef, 'single'), _defineProperty(_this$loadRefs, AddressComponent.removeRowButtonRef, 'multiple'), _defineProperty(_this$loadRefs, AddressComponent.removeValueIconRef, 'multiple'), _defineProperty(_this$loadRefs, AddressComponent.searchInputRef, 'multiple'), _this$loadRefs));\n this.searchInput.forEach(function (element, index) {\n if (!_this2.builderMode && element && _this2.provider) {\n if (_this2.component.provider === 'google') {\n _this2.provider.attachAutocomplete(element, index, _this2.onSelectAddress.bind(_this2));\n } else {\n (0, _autocompleter[\"default\"])({\n input: element,\n debounceWaitMs: 300,\n fetch: function fetch(text, update) {\n var query = text;\n _this2.provider.search(query).then(update);\n },\n render: function render(address) {\n var div = _this2.ce('div');\n div.textContent = _this2.getDisplayValue(address);\n return div;\n },\n onSelect: function onSelect(address) {\n _this2.onSelectAddress(address, element, index);\n }\n });\n }\n _this2.addEventListener(element, 'blur', function () {\n if (!element) {\n return;\n }\n if (element.value) {\n element.value = _this2.getDisplayValue(_this2.isMultiple ? _this2.address[index] : _this2.address);\n }\n });\n _this2.addEventListener(element, 'keyup', function () {\n if (!element) {\n return;\n }\n if (!element.value) {\n _this2.clearAddress(element, index);\n }\n });\n }\n });\n if (this.addRowButton) {\n this.addEventListener(this.addRowButton, 'click', function (event) {\n event.preventDefault();\n _this2.addRow();\n });\n }\n this.removeRowButton.forEach(function (removeRowButton, index) {\n _this2.addEventListener(removeRowButton, 'click', function (event) {\n event.preventDefault();\n _this2.removeValue(index);\n });\n });\n if (this.modeSwitcher) {\n this.addEventListener(this.modeSwitcher, 'change', function () {\n if (!_this2.modeSwitcher) {\n return;\n }\n _this2.dataValue = _this2.emptyValue;\n _this2.mode = _this2.modeSwitcher.checked ? AddressComponentMode.Manual : AddressComponentMode.Autocomplete;\n if (!_this2.builderMode) {\n if (_this2.manualMode) {\n _this2.restoreComponentsContext();\n }\n _this2.triggerChange({\n modified: true\n });\n }\n _this2.redraw();\n });\n }\n if (!this.builderMode) {\n this.removeValueIcon.forEach(function (removeValueIcon, index) {\n _this2.updateRemoveIcon(index);\n var removeValueHandler = function removeValueHandler() {\n var _this2$searchInput;\n var searchInput = (_this2$searchInput = _this2.searchInput) === null || _this2$searchInput === void 0 ? void 0 : _this2$searchInput[index];\n _this2.clearAddress(searchInput, index);\n if (searchInput) {\n searchInput.focus();\n }\n };\n _this2.addEventListener(removeValueIcon, 'click', removeValueHandler);\n _this2.addEventListener(removeValueIcon, 'keydown', function (_ref) {\n var key = _ref.key;\n if (key === 'Enter') {\n removeValueHandler();\n }\n });\n });\n _lodash[\"default\"].each(this.refs.searchInput || [], function (el) {\n return _this2.addFocusBlurEvents(el);\n });\n }\n return result;\n }\n }, {\n key: \"addChildComponent\",\n value: function addChildComponent(component) {\n component.customConditional = ChildConditional;\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this3 = this;\n var modeSwitcherInFocus = this.modeSwitcher && document.activeElement === this.modeSwitcher;\n return _get(_getPrototypeOf(AddressComponent.prototype), \"redraw\", this).call(this).then(function (result) {\n if (modeSwitcherInFocus && _this3.modeSwitcher) {\n _this3.modeSwitcher.focus();\n }\n return result;\n });\n }\n }, {\n key: \"clearAddress\",\n value: function clearAddress(element, index) {\n var _this$address;\n if (!this.isEmpty()) {\n this.triggerChange();\n }\n if ((_this$address = this.address) !== null && _this$address !== void 0 && _this$address[index]) {\n this.address[index] = this.emptyValue;\n } else {\n this.address = this.emptyValue;\n }\n if (element) {\n element.value = '';\n }\n this.updateRemoveIcon(index);\n }\n }, {\n key: \"getDisplayValue\",\n value: function getDisplayValue() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.address;\n return this.provider && !this.manualMode ? this.provider.getDisplayValue(value) : '';\n }\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return this.isMultiple;\n }\n }, {\n key: \"updateRemoveIcon\",\n value: function updateRemoveIcon(index) {\n var _this$removeValueIcon;\n var removeValueIcon = (_this$removeValueIcon = this.removeValueIcon) === null || _this$removeValueIcon === void 0 ? void 0 : _this$removeValueIcon[index];\n if (removeValueIcon) {\n var value = this.isMultiple ? this.address[index] : this.address;\n if (this.isEmpty(value) || this.disabled) {\n this.addClass(removeValueIcon, RemoveValueIconHiddenClass);\n } else {\n this.removeClass(removeValueIcon, RemoveValueIconHiddenClass);\n }\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n var normalizedValue = this.normalizeValue(value);\n var _ref2 = this.manualModeEnabled ? normalizedValue : {\n address: normalizedValue,\n mode: AddressComponentMode.Autocomplete\n },\n address = _ref2.address,\n mode = _ref2.mode;\n var valueInManualMode = mode === AddressComponentMode.Manual;\n if (this.provider && !valueInManualMode) {\n return this.getDisplayValue(address);\n }\n if (valueInManualMode) {\n if (this.component.manualModeViewString) {\n return this.interpolate(this.component.manualModeViewString, {\n address: address,\n data: this.data,\n component: this.component\n });\n }\n return this.getComponents().filter(function (component) {\n return component.hasValue(address);\n }).map(function (component) {\n return [component, _lodash[\"default\"].get(address, component.key)];\n }).filter(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n component = _ref4[0],\n componentValue = _ref4[1];\n return !component.isEmpty(componentValue);\n }).map(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n component = _ref6[0],\n componentValue = _ref6[1];\n return component.getValueAsString(componentValue, options);\n }).join(', ');\n }\n return _get(_getPrototypeOf(AddressComponent.prototype), \"getValueAsString\", this).call(this, address, options);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.searchInput && this.searchInput[0]) {\n this.searchInput[0].focus();\n }\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Container[\"default\"].schema.apply(_Container[\"default\"], [{\n type: 'address',\n label: 'Address',\n key: 'address',\n switchToManualModeLabel: 'Can\\'t find address? Switch to manual mode.',\n provider: '',\n providerOptions: {},\n manualModeViewString: '',\n hideLabel: false,\n disableClearIcon: false,\n enableManualMode: false,\n components: [{\n label: 'Address 1',\n tableView: false,\n key: 'address1',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Address 2',\n tableView: false,\n key: 'address2',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'City',\n tableView: false,\n key: 'city',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'State',\n tableView: false,\n key: 'state',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Country',\n tableView: false,\n key: 'country',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Zip Code',\n tableView: false,\n key: 'zip',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }]\n }].concat(extend));\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.object];\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Address',\n group: 'advanced',\n icon: 'home',\n documentation: '/userguide/form-building/advanced-components#address',\n weight: 35,\n schema: AddressComponent.schema()\n };\n }\n }, {\n key: \"modeSwitcherRef\",\n get: function get() {\n return 'modeSwitcher';\n }\n }, {\n key: \"removeValueIconRef\",\n get: function get() {\n return 'removeValueIcon';\n }\n }, {\n key: \"searchInputRef\",\n get: function get() {\n return 'searchInput';\n }\n }, {\n key: \"addRowButtonRef\",\n get: function get() {\n return 'addButton';\n }\n }, {\n key: \"removeRowButtonRef\",\n get: function get() {\n return 'removeRow';\n }\n }]);\n return AddressComponent;\n}(_Container[\"default\"]);\nexports[\"default\"] = AddressComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/address/Address.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.AddressComponentMode = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _autocompleter = _interopRequireDefault(__webpack_require__(/*! autocompleter */ \"./node_modules/autocompleter/autocomplete.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _GoogleAddressProvider = __webpack_require__(/*! ../../providers/address/GoogleAddressProvider */ \"./lib/providers/address/GoogleAddressProvider.js\");\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _NestedComponent = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nvar _Container = _interopRequireDefault(__webpack_require__(/*! ../container/Container */ \"./lib/components/container/Container.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar AddressComponentMode = {\n Autocomplete: 'autocomplete',\n Manual: 'manual'\n};\nexports.AddressComponentMode = AddressComponentMode;\nvar RemoveValueIconHiddenClass = 'address-autocomplete-remove-value-icon--hidden';\nvar ChildConditional = 'show = _.get(instance, \\'parent.manualMode\\', false);';\nvar AddressComponent = /*#__PURE__*/function (_ContainerComponent) {\n _inherits(AddressComponent, _ContainerComponent);\n var _super = _createSuper(AddressComponent);\n function AddressComponent() {\n _classCallCheck(this, AddressComponent);\n return _super.apply(this, arguments);\n }\n _createClass(AddressComponent, [{\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaultSchema = this.defaultSchema;\n if (component.components) {\n defaultSchema = _lodash[\"default\"].omit(defaultSchema, 'components');\n }\n return _lodash[\"default\"].defaultsDeep(component, defaultSchema);\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n if (this.builderMode || this.manualModeEnabled) {\n _NestedComponent[\"default\"].prototype.addComponents.call(this, this.manualMode ? this.address : {});\n }\n _Field[\"default\"].prototype.init.call(this);\n if (!this.builderMode) {\n if (this.component.provider) {\n var _this$component = this.component,\n provider = _this$component.provider,\n providerOptions = _this$component.providerOptions;\n this.provider = this.initializeProvider(provider, providerOptions);\n } else if (this.component.map) {\n // Fallback to legacy version where Google Maps was the only provider.\n this.component.provider = _GoogleAddressProvider.GoogleAddressProvider.name;\n this.component.providerOptions = this.component.providerOptions || {};\n var _this$component2 = this.component,\n map = _this$component2.map,\n _provider = _this$component2.provider,\n _providerOptions = _this$component2.providerOptions;\n var key = map.key,\n region = map.region;\n if (key) {\n _lodash[\"default\"].set(_providerOptions, 'params.key', key);\n }\n if (region) {\n _lodash[\"default\"].set(_providerOptions, 'params.region', region);\n }\n this.provider = this.initializeProvider(_provider, _providerOptions);\n }\n }\n }\n }, {\n key: \"initializeProvider\",\n value: function initializeProvider(provider) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var url = this.interpolate(options.url);\n var Provider = _Formio.GlobalFormio.Providers.getProvider('address', provider);\n return new Provider(_objectSpread(_objectSpread({}, options), {}, {\n url: url\n }));\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.manualModeEnabled ? {\n mode: AddressComponentMode.Autocomplete,\n address: {}\n } : {};\n }\n }, {\n key: \"mode\",\n get: function get() {\n var _this$dataValue$mode, _this$dataValue;\n if (!this.manualModeEnabled) {\n return AddressComponentMode.Autocomplete;\n }\n return (_this$dataValue$mode = (_this$dataValue = this.dataValue) === null || _this$dataValue === void 0 ? void 0 : _this$dataValue.mode) !== null && _this$dataValue$mode !== void 0 ? _this$dataValue$mode : AddressComponentMode.Autocomplete;\n },\n set: function set(value) {\n if (this.manualModeEnabled) {\n this.dataValue.mode = value;\n }\n }\n }, {\n key: \"autocompleteMode\",\n get: function get() {\n return this.mode === AddressComponentMode.Autocomplete;\n }\n }, {\n key: \"manualMode\",\n get: function get() {\n return this.mode === AddressComponentMode.Manual;\n }\n }, {\n key: \"manualModeEnabled\",\n get: function get() {\n return !this.isMultiple && Boolean(this.component.enableManualMode);\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this = this;\n this.getComponents().forEach(function (component) {\n component.data = _this.address;\n component.setValue(component.dataValue, {\n noUpdateEvent: true\n });\n });\n }\n }, {\n key: \"isMultiple\",\n get: function get() {\n return Boolean(this.component.multiple);\n }\n }, {\n key: \"address\",\n get: function get() {\n if (this.isMultiple) {\n return _lodash[\"default\"].isArray(this.dataValue) ? this.dataValue : [this.dataValue];\n }\n // Manual mode is not implementing for multiple value\n return this.manualModeEnabled && this.dataValue ? this.dataValue.address : this.dataValue;\n },\n set: function set(value) {\n if (this.manualModeEnabled && !this.isMultiple && !_lodash[\"default\"].isEqual(value, this.emptyValue)) {\n this.dataValue.address = value;\n } else {\n this.dataValue = value;\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(AddressComponent.prototype), \"defaultValue\", this);\n if (this.isMultiple) {\n defaultValue = _lodash[\"default\"].isArray(defaultValue) ? defaultValue : [defaultValue];\n }\n return defaultValue;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return AddressComponent.schema();\n }\n }, {\n key: \"isValueInLegacyFormat\",\n value: function isValueInLegacyFormat(value) {\n return value && !value.mode;\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n return this.manualModeEnabled && this.isValueInLegacyFormat(value) ? {\n mode: AddressComponentMode.Autocomplete,\n address: value\n } : value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _Field[\"default\"].prototype.setValue.call(this, value, flags);\n if (this.manualMode) {\n this.restoreComponentsContext();\n }\n if (changed || !_lodash[\"default\"].isEmpty(value) && flags.fromSubmission) {\n this.redraw();\n }\n return changed;\n }\n }, {\n key: \"modeSwitcher\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.modeSwitcherRef] || null : null;\n }\n }, {\n key: \"removeValueIcon\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.removeValueIconRef] || null : null;\n }\n }, {\n key: \"searchInput\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.searchInputRef] || null : null;\n }\n }, {\n key: \"addRowButton\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.addRowButtonRef] || null : null;\n }\n }, {\n key: \"removeRowButton\",\n get: function get() {\n return this.refs ? this.refs[AddressComponent.removeRowButtonRef] || null : null;\n }\n }, {\n key: \"searchInputAttributes\",\n get: function get() {\n var attr = {\n name: this.options.name,\n type: 'text',\n \"class\": 'form-control',\n lang: this.options.language,\n tabindex: this.component.tabindex || 0\n };\n if (this.component.placeholder) {\n attr.placeholder = this.t(this.component.placeholder), {\n _userInput: true\n };\n }\n if (this.disabled) {\n attr.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attr, this.component.attributes);\n return attr;\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'address';\n }\n }, {\n key: \"gridTemplateName\",\n get: function get() {\n return 'multiValueTable';\n }\n }, {\n key: \"rowTemplateName\",\n get: function get() {\n return 'multiValueRow';\n }\n }, {\n key: \"hasChildren\",\n get: function get() {\n return !this.isMultiple && (this.builderMode || this.manualModeEnabled);\n }\n }, {\n key: \"addAnother\",\n get: function get() {\n return this.t(this.component.addAnother || 'Add Another');\n }\n }, {\n key: \"renderElement\",\n value: function renderElement(value) {\n return this.renderTemplate(this.templateName, {\n children: this.hasChildren ? this.renderComponents() : '',\n nestedKey: this.nestedKey,\n inputAttributes: this.searchInputAttributes,\n ref: {\n modeSwitcher: AddressComponent.modeSwitcherRef,\n removeValueIcon: AddressComponent.removeValueIconRef,\n searchInput: AddressComponent.searchInputRef\n },\n displayValue: this.getDisplayValue(value),\n mode: {\n autocomplete: this.autocompleteMode,\n manual: this.manualMode\n }\n });\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(value, index) {\n return this.renderTemplate(this.rowTemplateName, {\n index: index,\n disabled: this.disabled,\n element: \"\".concat(this.renderElement(value, index))\n });\n }\n }, {\n key: \"renderGrid\",\n value: function renderGrid() {\n return this.renderTemplate(this.gridTemplateName, {\n rows: this.address.map(this.renderRow.bind(this)).join(''),\n disabled: this.disabled,\n addAnother: this.addAnother\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isMultiple) {\n return _get(_getPrototypeOf(AddressComponent.prototype), \"render\", this).call(this, this.renderGrid());\n }\n return _get(_getPrototypeOf(AddressComponent.prototype), \"render\", this).call(this, this.renderElement());\n }\n }, {\n key: \"onSelectAddress\",\n value: function onSelectAddress(address, element, index) {\n if (this.isMultiple) {\n this.address[index] = address;\n this.address = _toConsumableArray(this.address);\n } else {\n this.address = address;\n }\n this.triggerChange({\n modified: true\n });\n if (element) {\n element.value = this.getDisplayValue(this.isMultiple ? this.address[index] : this.address);\n }\n this.updateRemoveIcon(index);\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n this.address = this.address.concat(this.emptyValue);\n _get(_getPrototypeOf(AddressComponent.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this2 = this;\n var result = (this.builderMode || this.manualMode ? _get(_getPrototypeOf(AddressComponent.prototype), \"attach\", this) : _Field[\"default\"].prototype.attach).call(this, element);\n if (!this.builderMode) {\n if (!this.provider && this.component.provider) {\n var _this$component3 = this.component,\n provider = _this$component3.provider,\n providerOptions = _this$component3.providerOptions;\n this.provider = this.initializeProvider(provider, providerOptions);\n }\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, AddressComponent.addRowButtonRef, 'single'), _defineProperty(_this$loadRefs, AddressComponent.modeSwitcherRef, 'single'), _defineProperty(_this$loadRefs, AddressComponent.removeRowButtonRef, 'multiple'), _defineProperty(_this$loadRefs, AddressComponent.removeValueIconRef, 'multiple'), _defineProperty(_this$loadRefs, AddressComponent.searchInputRef, 'multiple'), _this$loadRefs));\n this.searchInput.forEach(function (element, index) {\n if (!_this2.builderMode && element && _this2.provider) {\n if (_this2.component.provider === 'google') {\n _this2.provider.attachAutocomplete(element, index, _this2.onSelectAddress.bind(_this2));\n } else {\n (0, _autocompleter[\"default\"])({\n input: element,\n debounceWaitMs: 300,\n fetch: function fetch(text, update) {\n var query = text;\n _this2.provider.search(query).then(update);\n },\n render: function render(address) {\n var div = _this2.ce('div');\n div.textContent = _this2.getDisplayValue(address);\n return div;\n },\n onSelect: function onSelect(address) {\n _this2.onSelectAddress(address, element, index);\n }\n });\n }\n _this2.addEventListener(element, 'blur', function () {\n if (!element) {\n return;\n }\n if (element.value) {\n element.value = _this2.getDisplayValue(_this2.isMultiple ? _this2.address[index] : _this2.address);\n }\n });\n _this2.addEventListener(element, 'keyup', function () {\n if (!element) {\n return;\n }\n if (!element.value) {\n _this2.clearAddress(element, index);\n }\n });\n }\n });\n if (this.addRowButton) {\n this.addEventListener(this.addRowButton, 'click', function (event) {\n event.preventDefault();\n _this2.addRow();\n });\n }\n this.removeRowButton.forEach(function (removeRowButton, index) {\n _this2.addEventListener(removeRowButton, 'click', function (event) {\n event.preventDefault();\n _this2.removeValue(index);\n });\n });\n if (this.modeSwitcher) {\n this.addEventListener(this.modeSwitcher, 'change', function () {\n if (!_this2.modeSwitcher) {\n return;\n }\n _this2.dataValue = _this2.emptyValue;\n _this2.mode = _this2.modeSwitcher.checked ? AddressComponentMode.Manual : AddressComponentMode.Autocomplete;\n if (!_this2.builderMode) {\n if (_this2.manualMode) {\n _this2.restoreComponentsContext();\n }\n _this2.triggerChange({\n modified: true\n });\n }\n _this2.redraw();\n });\n }\n if (!this.builderMode) {\n this.removeValueIcon.forEach(function (removeValueIcon, index) {\n _this2.updateRemoveIcon(index);\n var removeValueHandler = function removeValueHandler() {\n var _this2$searchInput;\n var searchInput = (_this2$searchInput = _this2.searchInput) === null || _this2$searchInput === void 0 ? void 0 : _this2$searchInput[index];\n _this2.clearAddress(searchInput, index);\n if (searchInput) {\n searchInput.focus();\n }\n };\n _this2.addEventListener(removeValueIcon, 'click', removeValueHandler);\n _this2.addEventListener(removeValueIcon, 'keydown', function (_ref) {\n var key = _ref.key;\n if (key === 'Enter') {\n removeValueHandler();\n }\n });\n });\n _lodash[\"default\"].each(this.refs.searchInput || [], function (el) {\n return _this2.addFocusBlurEvents(el);\n });\n }\n return result;\n }\n }, {\n key: \"addChildComponent\",\n value: function addChildComponent(component) {\n component.customConditional = ChildConditional;\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this3 = this;\n var modeSwitcherInFocus = this.modeSwitcher && document.activeElement === this.modeSwitcher;\n return _get(_getPrototypeOf(AddressComponent.prototype), \"redraw\", this).call(this).then(function (result) {\n if (modeSwitcherInFocus && _this3.modeSwitcher) {\n _this3.modeSwitcher.focus();\n }\n return result;\n });\n }\n }, {\n key: \"clearAddress\",\n value: function clearAddress(element, index) {\n var _this$address;\n if (!this.isEmpty()) {\n this.triggerChange();\n }\n if ((_this$address = this.address) !== null && _this$address !== void 0 && _this$address[index]) {\n this.address[index] = this.emptyValue;\n } else {\n this.address = this.emptyValue;\n }\n if (element) {\n element.value = '';\n }\n this.updateRemoveIcon(index);\n }\n }, {\n key: \"getDisplayValue\",\n value: function getDisplayValue() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.address;\n return this.provider && !this.manualMode ? this.provider.getDisplayValue(value) : '';\n }\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return this.isMultiple;\n }\n }, {\n key: \"updateRemoveIcon\",\n value: function updateRemoveIcon(index) {\n var _this$removeValueIcon;\n var removeValueIcon = (_this$removeValueIcon = this.removeValueIcon) === null || _this$removeValueIcon === void 0 ? void 0 : _this$removeValueIcon[index];\n if (removeValueIcon) {\n var value = this.isMultiple ? this.address[index] : this.address;\n if (this.isEmpty(value) || this.disabled) {\n this.addClass(removeValueIcon, RemoveValueIconHiddenClass);\n } else {\n this.removeClass(removeValueIcon, RemoveValueIconHiddenClass);\n }\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n var normalizedValue = this.normalizeValue(value);\n var _ref2 = this.manualModeEnabled ? normalizedValue : {\n address: normalizedValue,\n mode: AddressComponentMode.Autocomplete\n },\n address = _ref2.address,\n mode = _ref2.mode;\n var valueInManualMode = mode === AddressComponentMode.Manual;\n if (this.provider && !valueInManualMode) {\n return this.getDisplayValue(address);\n }\n if (valueInManualMode) {\n if (this.component.manualModeViewString) {\n return this.interpolate(this.component.manualModeViewString, {\n address: address,\n data: this.data,\n component: this.component\n });\n }\n return this.getComponents().filter(function (component) {\n return component.hasValue(address);\n }).map(function (component) {\n return [component, _lodash[\"default\"].get(address, component.key)];\n }).filter(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n component = _ref4[0],\n componentValue = _ref4[1];\n return !component.isEmpty(componentValue);\n }).map(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n component = _ref6[0],\n componentValue = _ref6[1];\n return component.getValueAsString(componentValue, options);\n }).join(', ');\n }\n return _get(_getPrototypeOf(AddressComponent.prototype), \"getValueAsString\", this).call(this, address, options);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.searchInput && this.searchInput[0]) {\n this.searchInput[0].focus();\n }\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Container[\"default\"].schema.apply(_Container[\"default\"], [{\n type: 'address',\n label: 'Address',\n key: 'address',\n switchToManualModeLabel: 'Can\\'t find address? Switch to manual mode.',\n provider: '',\n providerOptions: {},\n manualModeViewString: '',\n hideLabel: false,\n disableClearIcon: false,\n enableManualMode: false,\n components: [{\n label: 'Address 1',\n tableView: false,\n key: 'address1',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Address 2',\n tableView: false,\n key: 'address2',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'City',\n tableView: false,\n key: 'city',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'State',\n tableView: false,\n key: 'state',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Country',\n tableView: false,\n key: 'country',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }, {\n label: 'Zip Code',\n tableView: false,\n key: 'zip',\n type: 'textfield',\n input: true,\n customConditional: ChildConditional\n }]\n }].concat(extend));\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.object];\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Address',\n group: 'advanced',\n icon: 'home',\n documentation: '/userguide/form-building/advanced-components#address',\n weight: 35,\n schema: AddressComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return AddressComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(AddressComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isEmpty', 'isNotEmpty']\n });\n }\n }, {\n key: \"modeSwitcherRef\",\n get: function get() {\n return 'modeSwitcher';\n }\n }, {\n key: \"removeValueIconRef\",\n get: function get() {\n return 'removeValueIcon';\n }\n }, {\n key: \"searchInputRef\",\n get: function get() {\n return 'searchInput';\n }\n }, {\n key: \"addRowButtonRef\",\n get: function get() {\n return 'addButton';\n }\n }, {\n key: \"removeRowButtonRef\",\n get: function get() {\n return 'removeRow';\n }\n }]);\n return AddressComponent;\n}(_Container[\"default\"]);\nexports[\"default\"] = AddressComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/address/Address.js?"); /***/ }), @@ -807,7 +807,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.values.js */ \"./node_modules/core-js/modules/es.object.values.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.entries.js */ \"./node_modules/core-js/modules/es.object.entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar dragula;\nif (typeof window !== 'undefined') {\n // Import from \"dist\" because it would require and \"global\" would not be defined in Angular apps.\n dragula = __webpack_require__(/*! dragula/dist/dragula */ \"./node_modules/dragula/dist/dragula.js\");\n}\nvar DataGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(DataGridComponent, _NestedArrayComponent);\n var _super = _createSuper(DataGridComponent);\n function DataGridComponent() {\n var _this;\n _classCallCheck(this, DataGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'datagrid';\n _this.tabIndex = 0;\n return _this;\n }\n _createClass(DataGridComponent, [{\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n\n // Add new values based on minLength.\n this.rows = [];\n this.columns = _toConsumableArray(this.component.components);\n if (this.initRows || !_lodash[\"default\"].isEqual(this.dataValue, this.emptyValue)) {\n this.createRows(true);\n }\n this.visibleColumns = {};\n this.prevHasAddButton = this.hasAddButton();\n this.checkColumns();\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n var dataValue = _get(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", this);\n if (!dataValue || !Array.isArray(dataValue)) {\n return this.emptyValue;\n }\n return dataValue;\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataGridComponent.schema();\n }\n }, {\n key: \"initEmpty\",\n get: function get() {\n return this.component.initEmpty || this.component.noFirstRow;\n }\n }, {\n key: \"initRows\",\n get: function get() {\n return this.builderMode || this.path === 'defaultValue' || !this.initEmpty;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.initEmpty ? [] : [{}];\n }\n }, {\n key: \"addAnotherPosition\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'addAnotherPosition', 'bottom');\n }\n }, {\n key: \"minLength\",\n get: function get() {\n if (this.hasRowGroups()) {\n return _lodash[\"default\"].sum(this.getGroupSizes());\n } else {\n return _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var isBuilderMode = this.builderMode;\n var isEmptyInit = this.initEmpty;\n // Ensure we have one and only one row in builder mode.\n if (isBuilderMode || isEmptyInit && !this.dataValue.length) {\n return isEmptyInit && !isBuilderMode ? [] : [{}];\n }\n var value = _get(_getPrototypeOf(DataGridComponent.prototype), \"defaultValue\", this);\n var defaultValue;\n if (Array.isArray(value)) {\n defaultValue = value;\n } else if (value && _typeof(value) === 'object') {\n defaultValue = [value];\n } else {\n defaultValue = this.emptyValue;\n }\n for (var dIndex = defaultValue.length; dIndex < this.minLength; dIndex++) {\n defaultValue.push({});\n }\n return defaultValue;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-addRow\")], function (button) {\n button.disabled = disabled;\n });\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-removeRow\")], function (button) {\n button.disabled = disabled;\n });\n }\n }, {\n key: \"datagridKey\",\n get: function get() {\n return \"datagrid-\".concat(this.key);\n }\n }, {\n key: \"allowReorder\",\n get: function get() {\n return !this.options.readOnly && _lodash[\"default\"].get(this.component, 'reorder', false);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n var _this2 = this;\n return this.rows.map(function (row, index) {\n return {\n components: row,\n data: _this2.dataValue[index]\n };\n });\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var _this$components;\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmpty = _get(_getPrototypeOf(DataGridComponent.prototype), \"isEmpty\", this).call(this, value);\n if ((_this$components = this.components) !== null && _this$components !== void 0 && _this$components.length) {\n return this.components.reduce(function (isEmpty, component) {\n return isEmpty && component.isEmpty();\n }, true);\n }\n return isEmpty;\n }\n\n /**\n * Split rows into chunks.\n * @param {Number[]} groups - array of numbers where each item is size of group\n * @param {Array} rows - rows collection\n * @return {Array}\n */\n }, {\n key: \"getRowChunks\",\n value: function getRowChunks(groups, rows) {\n var _groups$reduce = groups.reduce(function (_ref, size) {\n var _ref2 = _slicedToArray(_ref, 2),\n startIndex = _ref2[0],\n acc = _ref2[1];\n var endIndex = startIndex + size;\n return [endIndex, [].concat(_toConsumableArray(acc), [[startIndex, endIndex]])];\n }, [0, []]),\n _groups$reduce2 = _slicedToArray(_groups$reduce, 2),\n chunks = _groups$reduce2[1];\n return chunks.map(function (range) {\n return _lodash[\"default\"].slice.apply(_lodash[\"default\"], [rows].concat(_toConsumableArray(range)));\n });\n }\n\n /**\n * Create groups object.\n * Each key in object represents index of first row in group.\n * @return {Object}\n */\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n var groups = _lodash[\"default\"].get(this.component, 'rowGroups', []);\n var sizes = _lodash[\"default\"].map(groups, 'numberOfRows').slice(0, -1);\n var indexes = sizes.reduce(function (groupIndexes, size) {\n var last = groupIndexes[groupIndexes.length - 1];\n return groupIndexes.concat(last + size);\n }, [0]);\n return groups.reduce(function (gidxs, group, idx) {\n return _objectSpread(_objectSpread({}, gidxs), {}, _defineProperty({}, indexes[idx], group));\n }, {});\n }\n\n /**\n * Retrun group sizes.\n * @return {Number[]}\n */\n }, {\n key: \"getGroupSizes\",\n value: function getGroupSizes() {\n return _lodash[\"default\"].map(_lodash[\"default\"].get(this.component, 'rowGroups', []), 'numberOfRows');\n }\n }, {\n key: \"hasRowGroups\",\n value: function hasRowGroups() {\n return _lodash[\"default\"].get(this, 'component.enableRowGroups', false) && !this.builderMode;\n }\n }, {\n key: \"totalRowsNumber\",\n value: function totalRowsNumber(groups) {\n return _lodash[\"default\"].sum(_lodash[\"default\"].map(groups, 'numberOfRows'));\n }\n }, {\n key: \"setStaticValue\",\n value: function setStaticValue(n) {\n this.dataValue = _lodash[\"default\"].range(n).map(function () {\n return {};\n });\n }\n }, {\n key: \"hasExtraColumn\",\n value: function hasExtraColumn() {\n return this.hasRemoveButtons() || this.canAddColumn;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.builderMode && !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"hasTopSubmit\",\n value: function hasTopSubmit() {\n return this.hasAddButton() && ['top', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"hasBottomSubmit\",\n value: function hasBottomSubmit() {\n return this.hasAddButton() && ['bottom', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return this.builderMode && !this.options.design;\n }\n }, {\n key: \"render\",\n value: function render() {\n var columns = this.getColumns();\n var columnExtra = 0;\n var hasRemoveButtons = this.hasRemoveButtons();\n if (this.component.reorder) {\n columnExtra++;\n }\n if (hasRemoveButtons) {\n columnExtra++;\n }\n if (this.canAddColumn) {\n columnExtra++;\n }\n var colWidth = Math.floor(12 / (columns.length + columnExtra));\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"render\", this).call(this, this.renderTemplate('datagrid', {\n rows: this.getRows(),\n columns: columns,\n groups: this.hasRowGroups() ? this.getGroups() : [],\n visibleColumns: this.visibleColumns,\n hasToggle: _lodash[\"default\"].get(this, 'component.groupToggle', false),\n hasHeader: this.hasHeader(),\n hasExtraColumn: this.hasExtraColumn(),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: hasRemoveButtons,\n hasTopSubmit: this.hasTopSubmit(),\n hasBottomSubmit: this.hasBottomSubmit(),\n hasGroups: this.hasRowGroups(),\n numColumns: columns.length + (this.hasExtraColumn() ? 1 : 0),\n datagridKey: this.datagridKey,\n allowReorder: this.allowReorder,\n builder: this.builderMode,\n canAddColumn: this.canAddColumn,\n tabIndex: this.tabIndex,\n placeholder: this.renderTemplate('builderPlaceholder', {\n position: this.componentComponents.length\n }),\n colWidth: colWidth.toString()\n }));\n }\n }, {\n key: \"getRows\",\n value: function getRows() {\n return this.rows.map(function (row) {\n var components = {};\n _lodash[\"default\"].each(row, function (col, key) {\n components[key] = col.render();\n });\n return components;\n });\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var _this3 = this;\n return this.columns.filter(function (comp) {\n return !_this3.visibleColumns.hasOwnProperty(comp.key) || _this3.visibleColumns[comp.key];\n });\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return this.component.components.reduce(function (hasHeader, col) {\n // If any of the components has a title and it isn't hidden, display the header.\n return hasHeader || (col.label || col.title) && !col.hideLabel;\n }, false);\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n _get(_getPrototypeOf(DataGridComponent.prototype), \"loadRefs\", this).call(this, element, refs);\n if (refs['messageContainer'] === 'single') {\n var container = _lodash[\"default\"].last(element.querySelectorAll('[ref=messageContainer]'));\n this.refs['messageContainer'] = container || this.refs['messageContainer'];\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this4 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-row\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-tbody\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-addRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-removeRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-group-header\"), 'multiple'), _defineProperty(_this$loadRefs, this.datagridKey, 'multiple'), _defineProperty(_this$loadRefs, 'messageContainer', 'single'), _this$loadRefs));\n if (this.allowReorder) {\n this.refs[\"\".concat(this.datagridKey, \"-row\")].forEach(function (row, index) {\n row.dragInfo = {\n index: index\n };\n });\n if (dragula) {\n this.dragula = dragula([this.refs[\"\".concat(this.datagridKey, \"-tbody\")]], {\n moves: function moves(_draggedElement, _oldParent, clickedElement) {\n var clickedElementKey = clickedElement.getAttribute('data-key');\n var oldParentKey = _oldParent.getAttribute('data-key');\n\n //Check if the clicked button belongs to that container, if false, it belongs to the nested container\n if (oldParentKey === clickedElementKey) {\n return clickedElement.classList.contains('formio-drag-button');\n }\n }\n }).on('drop', this.onReorder.bind(this));\n this.dragula.on('cloned', function (el, original) {\n if (el && el.children && original && original.children) {\n _lodash[\"default\"].each(original.children, function (child, index) {\n var styles = getComputedStyle(child, null);\n if (styles.cssText !== '') {\n el.children[index].style.cssText = styles.cssText;\n } else {\n var cssText = Object.values(styles).reduce(function (css, propertyName) {\n return \"\".concat(css).concat(propertyName, \":\").concat(styles.getPropertyValue(propertyName), \";\");\n }, '');\n el.children[index].style.cssText = cssText;\n }\n });\n }\n });\n }\n }\n this.refs[\"\".concat(this.datagridKey, \"-addRow\")].forEach(function (addButton) {\n _this4.addEventListener(addButton, 'click', _this4.addRow.bind(_this4));\n });\n this.refs[\"\".concat(this.datagridKey, \"-removeRow\")].forEach(function (removeButton, index) {\n _this4.addEventListener(removeButton, 'click', _this4.removeRow.bind(_this4, index));\n });\n if (this.hasRowGroups()) {\n this.refs.chunks = this.getRowChunks(this.getGroupSizes(), this.refs[\"\".concat(this.datagridKey, \"-row\")]);\n this.refs[\"\".concat(this.datagridKey, \"-group-header\")].forEach(function (header, index) {\n _this4.addEventListener(header, 'click', function () {\n return _this4.toggleGroup(header, index);\n });\n });\n }\n var columns = this.getColumns();\n var rowLength = columns.length;\n this.rows.forEach(function (row, rowIndex) {\n var columnIndex = 0;\n columns.forEach(function (col) {\n _this4.attachComponents(_this4.refs[_this4.datagridKey][rowIndex * rowLength + columnIndex], [_this4.rows[rowIndex][col.key]], _this4.getComponentsContainer());\n columnIndex++;\n });\n });\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n return this.component.components;\n }\n }, {\n key: \"onReorder\",\n value: function onReorder(element, _target, _source, sibling) {\n if (!element.dragInfo || sibling && !sibling.dragInfo) {\n console.warn('There is no Drag Info available for either dragged or sibling element');\n return;\n }\n var oldPosition = element.dragInfo.index;\n //should drop at next sibling position; no next sibling means drop to last position\n var newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;\n var movedBelow = newPosition > oldPosition;\n var dataValue = (0, _utils.fastCloneDeep)(this.dataValue);\n var draggedRowData = dataValue[oldPosition];\n\n //insert element at new position\n dataValue.splice(newPosition, 0, draggedRowData);\n //remove element from old position (if was moved above, after insertion it's at +1 index)\n dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);\n\n //need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)\n this.setValue(dataValue, {\n isReordered: true\n });\n this.rebuild();\n }\n }, {\n key: \"focusOnNewRowElement\",\n value: function focusOnNewRowElement(row) {\n Object.keys(row).find(function (key) {\n var element = row[key].element;\n if (element) {\n var focusableElements = (0, _utils.getFocusableElements)(element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n return true;\n }\n }\n return false;\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var _this5 = this;\n var index = this.rows.length;\n\n // Handle length mismatch between rows and dataValue\n if (this.dataValue.length === index) {\n this.dataValue.push({});\n }\n var row;\n var dataValue = this.dataValue;\n var defaultValue = this.defaultValue;\n if (this.initEmpty && defaultValue[index]) {\n row = defaultValue[index];\n dataValue[index] = row;\n } else {\n row = dataValue[index];\n }\n this.rows[index] = this.createRowComponents(row, index);\n this.emit('dataGridAddRow', {\n component: this.component,\n row: row\n });\n this.checkConditions();\n this.triggerChange();\n this.redraw().then(function () {\n _this5.focusOnNewRowElement(_this5.rows[index]);\n });\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n var _this6 = this;\n components.forEach(function (component, colIndex) {\n var _component$options;\n if ((_component$options = component.options) !== null && _component$options !== void 0 && _component$options.name) {\n var newName = \"[\".concat(_this6.key, \"][\").concat(rowIndex, \"]\");\n component.options.name = component.options.name.replace(\"[\".concat(_this6.key, \"][\").concat(component.rowIndex, \"]\"), newName);\n }\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n component.path = _this6.calculateComponentPath(component);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this7 = this;\n this.rows.slice(rowIndex).forEach(function (row, index) {\n _this7.updateComponentsRowIndex(Object.values(row), rowIndex + index);\n });\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var makeEmpty = index === 0 && this.rows.length === 1;\n var flags = {\n isReordered: !makeEmpty,\n resetValue: makeEmpty\n };\n this.splice(index, flags);\n this.emit('dataGridDeleteRow', {\n index: index\n });\n var _this$rows$splice = this.rows.splice(index, 1),\n _this$rows$splice2 = _slicedToArray(_this$rows$splice, 1),\n row = _this$rows$splice2[0];\n this.removeRowComponents(row);\n this.updateRowsComponents(index);\n this.setValue(this.dataValue, flags);\n this.redraw();\n }\n }, {\n key: \"removeRowComponents\",\n value: function removeRowComponents(row) {\n var _this8 = this;\n _lodash[\"default\"].each(row, function (component) {\n return _this8.removeComponent(component);\n });\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n return this.dataValue;\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n component.data = rowData;\n });\n }\n }, {\n key: \"createRows\",\n value: function createRows(init, rebuild) {\n var _this9 = this;\n var added = false;\n var rowValues = this.getRowValues();\n // Create any missing rows.\n rowValues.forEach(function (row, index) {\n if (!rebuild && _this9.rows[index]) {\n _this9.setRowComponentsData(index, row);\n } else {\n if (_this9.rows[index]) {\n _this9.removeRowComponents(_this9.rows[index]);\n }\n _this9.rows[index] = _this9.createRowComponents(row, index);\n added = true;\n }\n });\n // Delete any extra rows.\n var removedRows = this.rows.splice(rowValues.length);\n var removed = !!removedRows.length;\n // Delete components of extra rows (to make sure that this.components contain only components of exisiting rows)\n if (removed) {\n removedRows.forEach(function (row) {\n return _this9.removeRowComponents(row);\n });\n }\n if (!init && (added || removed)) {\n this.redraw();\n }\n return added;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this10 = this;\n var components = {};\n this.tabIndex = 0;\n this.component.components.map(function (col, colIndex) {\n var options = _lodash[\"default\"].clone(_this10.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n var columnComponent;\n if (_this10.builderMode) {\n col.id = col.id + rowIndex;\n columnComponent = col;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, col), {}, {\n id: col.id + rowIndex\n });\n }\n var component = _this10.createComponent(columnComponent, options, row);\n component.parentDisabled = !!_this10.disabled;\n component.rowIndex = rowIndex;\n component.inDataGrid = true;\n if (columnComponent.tabindex && parseInt(columnComponent.tabindex) > _this10.tabIndex) {\n _this10.tabIndex = parseInt(columnComponent.tabindex);\n }\n components[col.key] = component;\n });\n return components;\n }\n\n /**\n * Checks the validity of this datagrid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n if (!this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n })) {\n return false;\n }\n var isValid = this.checkRows('checkValidity', data, dirty, true, silentCheck);\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns(data) {\n var _this11 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data = data || this.rootValue;\n var show = false;\n if (!this.rows || !this.rows.length) {\n return {\n rebuild: false,\n show: false\n };\n }\n if (this.builderMode) {\n return {\n rebuild: false,\n show: true\n };\n }\n var visibility = {};\n var logicRebuild = false;\n var dataValue = this.dataValue;\n this.rows.forEach(function (row, rowIndex) {\n _lodash[\"default\"].each(row, function (col, key) {\n if (col && typeof col.checkConditions === 'function') {\n var firstRowCheck = visibility[key] === undefined;\n visibility[key] = !!visibility[key] || col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden';\n if (col.component.logic && firstRowCheck) {\n var compIndex = _lodash[\"default\"].findIndex(_this11.columns, ['key', key]);\n if (!_lodash[\"default\"].isEqual(_this11.columns[compIndex], col.component)) {\n logicRebuild = true;\n _this11.columns[compIndex] = col.component;\n }\n }\n }\n });\n });\n var rebuild = !_lodash[\"default\"].isEqual(visibility, this.visibleColumns) || logicRebuild;\n _lodash[\"default\"].each(visibility, function (col) {\n show |= col;\n });\n this.visibleColumns = visibility;\n return {\n rebuild: rebuild,\n show: show\n };\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var isVisible = this.visible;\n // If table isn't visible, don't bother calculating columns.\n if (!_get(_getPrototypeOf(DataGridComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row)) {\n return false;\n }\n var _this$checkColumns = this.checkColumns(data, flags),\n rebuild = _this$checkColumns.rebuild,\n show = _this$checkColumns.show;\n // Check if a rebuild is needed or the visibility changes.\n if (rebuild || !isVisible) {\n this.createRows(false, rebuild);\n }\n\n // Return if this table should show.\n return show;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n this.dataValue = this.defaultValue;\n this.createRows();\n return false;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n this.createRows();\n value = [{}];\n }\n }\n\n // Make sure we always have at least one row.\n // NOTE: Removing this will break \"Public Configurations\" in portal. ;)\n if (value && !value.length && !this.initEmpty) {\n value.push({});\n }\n var isSettingSubmission = flags.fromSubmission && !_lodash[\"default\"].isEqual(value, this.emptyValue);\n var changed = this.hasChanged(value, this.dataValue);\n this.dataValue = value;\n if (this.initRows || isSettingSubmission || Array.isArray(this.dataValue) && this.dataValue.length !== this.rows.length) {\n if (!this.createRows() && changed) {\n this.redraw();\n }\n }\n if (this.componentModal && isSettingSubmission) {\n this.componentModal.setValue(value);\n }\n this.rows.forEach(function (row, rowIndex) {\n if (value.length <= rowIndex) {\n return;\n }\n _lodash[\"default\"].each(row, function (col) {\n col.rowIndex = rowIndex;\n _this12.setNestedValue(col, value[rowIndex], flags);\n });\n });\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this13 = this;\n this.rows.forEach(function (row, index) {\n return _lodash[\"default\"].forIn(row, function (component) {\n return component.data = _this13.dataValue[index];\n });\n });\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = Array.isArray(path) ? path : [path];\n var _path = path,\n _path2 = _toArray(_path),\n key = _path2[0],\n remainingPath = _path2.slice(1);\n var result = [];\n if (_lodash[\"default\"].isNumber(key) && remainingPath.length) {\n var compKey = remainingPath.pop();\n result = this.rows[key][compKey];\n // If the component is inside a Layout Component, try to find it among all the row's components\n if (!result) {\n Object.entries(this.rows[key]).forEach(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n comp = _ref4[1];\n if ('getComponent' in comp) {\n var possibleResult = comp.getComponent([compKey], fn);\n if (possibleResult) {\n result = possibleResult;\n }\n }\n });\n }\n if (result && _lodash[\"default\"].isFunction(fn)) {\n fn(result, this.getComponents());\n }\n if (remainingPath.length && 'getComponent' in result) {\n return result.getComponent(remainingPath, fn);\n }\n return result;\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n var comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn);\n } else if (fn) {\n fn(component, components);\n }\n result = result.concat(comp);\n }\n });\n return result.length > 0 ? result : null;\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(element, index) {\n element.classList.toggle('collapsed');\n _lodash[\"default\"].each(this.refs.chunks[index], function (row) {\n row.classList.toggle('hidden');\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n label: 'Data Grid',\n key: 'dataGrid',\n type: 'datagrid',\n clearOnHide: true,\n input: true,\n tree: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Grid',\n icon: 'th',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-grid',\n showPreview: false,\n weight: 30,\n schema: DataGridComponent.schema()\n };\n }\n }]);\n return DataGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = DataGridComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datagrid/DataGrid.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.values.js */ \"./node_modules/core-js/modules/es.object.values.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.entries.js */ \"./node_modules/core-js/modules/es.object.entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar dragula;\nif (typeof window !== 'undefined') {\n // Import from \"dist\" because it would require and \"global\" would not be defined in Angular apps.\n dragula = __webpack_require__(/*! dragula/dist/dragula */ \"./node_modules/dragula/dist/dragula.js\");\n}\nvar DataGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(DataGridComponent, _NestedArrayComponent);\n var _super = _createSuper(DataGridComponent);\n function DataGridComponent() {\n var _this;\n _classCallCheck(this, DataGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'datagrid';\n _this.tabIndex = 0;\n return _this;\n }\n _createClass(DataGridComponent, [{\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n\n // Add new values based on minLength.\n this.rows = [];\n this.columns = _toConsumableArray(this.component.components);\n if (this.initRows || !_lodash[\"default\"].isEqual(this.dataValue, this.emptyValue)) {\n this.createRows(true);\n }\n this.visibleColumns = {};\n this.prevHasAddButton = this.hasAddButton();\n this.checkColumns();\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n var dataValue = _get(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", this);\n if (!dataValue || !Array.isArray(dataValue)) {\n return this.emptyValue;\n }\n return dataValue;\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataGridComponent.schema();\n }\n }, {\n key: \"initEmpty\",\n get: function get() {\n return this.component.initEmpty || this.component.noFirstRow;\n }\n }, {\n key: \"initRows\",\n get: function get() {\n return this.builderMode || this.path === 'defaultValue' || !this.initEmpty;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.initEmpty ? [] : [{}];\n }\n }, {\n key: \"addAnotherPosition\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'addAnotherPosition', 'bottom');\n }\n }, {\n key: \"minLength\",\n get: function get() {\n if (this.hasRowGroups()) {\n return _lodash[\"default\"].sum(this.getGroupSizes());\n } else {\n return _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var isBuilderMode = this.builderMode;\n var isEmptyInit = this.initEmpty;\n // Ensure we have one and only one row in builder mode.\n if (isBuilderMode || isEmptyInit && !this.dataValue.length) {\n return isEmptyInit && !isBuilderMode ? [] : [{}];\n }\n var value = _get(_getPrototypeOf(DataGridComponent.prototype), \"defaultValue\", this);\n var defaultValue;\n if (Array.isArray(value)) {\n defaultValue = value;\n } else if (value && _typeof(value) === 'object') {\n defaultValue = [value];\n } else {\n defaultValue = this.emptyValue;\n }\n for (var dIndex = defaultValue.length; dIndex < this.minLength; dIndex++) {\n defaultValue.push({});\n }\n return defaultValue;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-addRow\")], function (button) {\n button.disabled = disabled;\n });\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-removeRow\")], function (button) {\n button.disabled = disabled;\n });\n }\n }, {\n key: \"datagridKey\",\n get: function get() {\n return \"datagrid-\".concat(this.key);\n }\n }, {\n key: \"allowReorder\",\n get: function get() {\n return !this.options.readOnly && _lodash[\"default\"].get(this.component, 'reorder', false);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n var _this2 = this;\n return this.rows.map(function (row, index) {\n return {\n components: row,\n data: _this2.dataValue[index]\n };\n });\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var _this$components;\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmpty = _get(_getPrototypeOf(DataGridComponent.prototype), \"isEmpty\", this).call(this, value);\n if ((_this$components = this.components) !== null && _this$components !== void 0 && _this$components.length) {\n return this.components.reduce(function (isEmpty, component) {\n return isEmpty && component.isEmpty();\n }, true);\n }\n return isEmpty;\n }\n\n /**\n * Split rows into chunks.\n * @param {Number[]} groups - array of numbers where each item is size of group\n * @param {Array} rows - rows collection\n * @return {Array}\n */\n }, {\n key: \"getRowChunks\",\n value: function getRowChunks(groups, rows) {\n var _groups$reduce = groups.reduce(function (_ref, size) {\n var _ref2 = _slicedToArray(_ref, 2),\n startIndex = _ref2[0],\n acc = _ref2[1];\n var endIndex = startIndex + size;\n return [endIndex, [].concat(_toConsumableArray(acc), [[startIndex, endIndex]])];\n }, [0, []]),\n _groups$reduce2 = _slicedToArray(_groups$reduce, 2),\n chunks = _groups$reduce2[1];\n return chunks.map(function (range) {\n return _lodash[\"default\"].slice.apply(_lodash[\"default\"], [rows].concat(_toConsumableArray(range)));\n });\n }\n\n /**\n * Create groups object.\n * Each key in object represents index of first row in group.\n * @return {Object}\n */\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n var groups = _lodash[\"default\"].get(this.component, 'rowGroups', []);\n var sizes = _lodash[\"default\"].map(groups, 'numberOfRows').slice(0, -1);\n var indexes = sizes.reduce(function (groupIndexes, size) {\n var last = groupIndexes[groupIndexes.length - 1];\n return groupIndexes.concat(last + size);\n }, [0]);\n return groups.reduce(function (gidxs, group, idx) {\n return _objectSpread(_objectSpread({}, gidxs), {}, _defineProperty({}, indexes[idx], group));\n }, {});\n }\n\n /**\n * Retrun group sizes.\n * @return {Number[]}\n */\n }, {\n key: \"getGroupSizes\",\n value: function getGroupSizes() {\n return _lodash[\"default\"].map(_lodash[\"default\"].get(this.component, 'rowGroups', []), 'numberOfRows');\n }\n }, {\n key: \"hasRowGroups\",\n value: function hasRowGroups() {\n return _lodash[\"default\"].get(this, 'component.enableRowGroups', false) && !this.builderMode;\n }\n }, {\n key: \"totalRowsNumber\",\n value: function totalRowsNumber(groups) {\n return _lodash[\"default\"].sum(_lodash[\"default\"].map(groups, 'numberOfRows'));\n }\n }, {\n key: \"setStaticValue\",\n value: function setStaticValue(n) {\n this.dataValue = _lodash[\"default\"].range(n).map(function () {\n return {};\n });\n }\n }, {\n key: \"hasExtraColumn\",\n value: function hasExtraColumn() {\n return this.hasRemoveButtons() || this.canAddColumn;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.builderMode && !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"hasTopSubmit\",\n value: function hasTopSubmit() {\n return this.hasAddButton() && ['top', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"hasBottomSubmit\",\n value: function hasBottomSubmit() {\n return this.hasAddButton() && ['bottom', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return this.builderMode && !this.options.design;\n }\n }, {\n key: \"render\",\n value: function render() {\n var columns = this.getColumns();\n var columnExtra = 0;\n var hasRemoveButtons = this.hasRemoveButtons();\n if (this.component.reorder) {\n columnExtra++;\n }\n if (hasRemoveButtons) {\n columnExtra++;\n }\n if (this.canAddColumn) {\n columnExtra++;\n }\n var colWidth = Math.floor(12 / (columns.length + columnExtra));\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"render\", this).call(this, this.renderTemplate('datagrid', {\n rows: this.getRows(),\n columns: columns,\n groups: this.hasRowGroups() ? this.getGroups() : [],\n visibleColumns: this.visibleColumns,\n hasToggle: _lodash[\"default\"].get(this, 'component.groupToggle', false),\n hasHeader: this.hasHeader(),\n hasExtraColumn: this.hasExtraColumn(),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: hasRemoveButtons,\n hasTopSubmit: this.hasTopSubmit(),\n hasBottomSubmit: this.hasBottomSubmit(),\n hasGroups: this.hasRowGroups(),\n numColumns: columns.length + (this.hasExtraColumn() ? 1 : 0),\n datagridKey: this.datagridKey,\n allowReorder: this.allowReorder,\n builder: this.builderMode,\n canAddColumn: this.canAddColumn,\n tabIndex: this.tabIndex,\n placeholder: this.renderTemplate('builderPlaceholder', {\n position: this.componentComponents.length\n }),\n colWidth: colWidth.toString()\n }));\n }\n }, {\n key: \"getRows\",\n value: function getRows() {\n return this.rows.map(function (row) {\n var components = {};\n _lodash[\"default\"].each(row, function (col, key) {\n components[key] = col.render();\n });\n return components;\n });\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var _this3 = this;\n return this.columns.filter(function (comp) {\n return !_this3.visibleColumns.hasOwnProperty(comp.key) || _this3.visibleColumns[comp.key];\n });\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return this.component.components.reduce(function (hasHeader, col) {\n // If any of the components has a title and it isn't hidden, display the header.\n return hasHeader || (col.label || col.title) && !col.hideLabel;\n }, false);\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n _get(_getPrototypeOf(DataGridComponent.prototype), \"loadRefs\", this).call(this, element, refs);\n if (refs['messageContainer'] === 'single') {\n var container = _lodash[\"default\"].last(element.querySelectorAll('[ref=messageContainer]'));\n this.refs['messageContainer'] = container || this.refs['messageContainer'];\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this4 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-row\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-tbody\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-addRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-removeRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-group-header\"), 'multiple'), _defineProperty(_this$loadRefs, this.datagridKey, 'multiple'), _defineProperty(_this$loadRefs, 'messageContainer', 'single'), _this$loadRefs));\n if (this.allowReorder) {\n this.refs[\"\".concat(this.datagridKey, \"-row\")].forEach(function (row, index) {\n row.dragInfo = {\n index: index\n };\n });\n if (dragula) {\n this.dragula = dragula([this.refs[\"\".concat(this.datagridKey, \"-tbody\")]], {\n moves: function moves(_draggedElement, _oldParent, clickedElement) {\n var clickedElementKey = clickedElement.getAttribute('data-key');\n var oldParentKey = _oldParent.getAttribute('data-key');\n\n //Check if the clicked button belongs to that container, if false, it belongs to the nested container\n if (oldParentKey === clickedElementKey) {\n return clickedElement.classList.contains('formio-drag-button');\n }\n }\n }).on('drop', this.onReorder.bind(this));\n this.dragula.on('cloned', function (el, original) {\n if (el && el.children && original && original.children) {\n _lodash[\"default\"].each(original.children, function (child, index) {\n var styles = getComputedStyle(child, null);\n if (styles.cssText !== '') {\n el.children[index].style.cssText = styles.cssText;\n } else {\n var cssText = Object.values(styles).reduce(function (css, propertyName) {\n return \"\".concat(css).concat(propertyName, \":\").concat(styles.getPropertyValue(propertyName), \";\");\n }, '');\n el.children[index].style.cssText = cssText;\n }\n });\n }\n });\n }\n }\n this.refs[\"\".concat(this.datagridKey, \"-addRow\")].forEach(function (addButton) {\n _this4.addEventListener(addButton, 'click', _this4.addRow.bind(_this4));\n });\n this.refs[\"\".concat(this.datagridKey, \"-removeRow\")].forEach(function (removeButton, index) {\n _this4.addEventListener(removeButton, 'click', _this4.removeRow.bind(_this4, index));\n });\n if (this.hasRowGroups()) {\n this.refs.chunks = this.getRowChunks(this.getGroupSizes(), this.refs[\"\".concat(this.datagridKey, \"-row\")]);\n this.refs[\"\".concat(this.datagridKey, \"-group-header\")].forEach(function (header, index) {\n _this4.addEventListener(header, 'click', function () {\n return _this4.toggleGroup(header, index);\n });\n });\n }\n var columns = this.getColumns();\n var rowLength = columns.length;\n this.rows.forEach(function (row, rowIndex) {\n var columnIndex = 0;\n columns.forEach(function (col) {\n _this4.attachComponents(_this4.refs[_this4.datagridKey][rowIndex * rowLength + columnIndex], [_this4.rows[rowIndex][col.key]], _this4.getComponentsContainer());\n columnIndex++;\n });\n });\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n return this.component.components;\n }\n }, {\n key: \"onReorder\",\n value: function onReorder(element, _target, _source, sibling) {\n if (!element.dragInfo || sibling && !sibling.dragInfo) {\n console.warn('There is no Drag Info available for either dragged or sibling element');\n return;\n }\n var oldPosition = element.dragInfo.index;\n //should drop at next sibling position; no next sibling means drop to last position\n var newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;\n var movedBelow = newPosition > oldPosition;\n var dataValue = (0, _utils.fastCloneDeep)(this.dataValue);\n var draggedRowData = dataValue[oldPosition];\n\n //insert element at new position\n dataValue.splice(newPosition, 0, draggedRowData);\n //remove element from old position (if was moved above, after insertion it's at +1 index)\n dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);\n\n //need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)\n this.setValue(dataValue, {\n isReordered: true\n });\n this.rebuild();\n }\n }, {\n key: \"focusOnNewRowElement\",\n value: function focusOnNewRowElement(row) {\n Object.keys(row).find(function (key) {\n var element = row[key].element;\n if (element) {\n var focusableElements = (0, _utils.getFocusableElements)(element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n return true;\n }\n }\n return false;\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var _this5 = this;\n var index = this.rows.length;\n\n // Handle length mismatch between rows and dataValue\n if (this.dataValue.length === index) {\n this.dataValue.push({});\n }\n var row;\n var dataValue = this.dataValue;\n var defaultValue = this.defaultValue;\n if (this.initEmpty && defaultValue[index]) {\n row = defaultValue[index];\n dataValue[index] = row;\n } else {\n row = dataValue[index];\n }\n this.rows[index] = this.createRowComponents(row, index);\n this.emit('dataGridAddRow', {\n component: this.component,\n row: row\n });\n this.checkConditions();\n this.triggerChange();\n this.redraw().then(function () {\n _this5.focusOnNewRowElement(_this5.rows[index]);\n });\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n var _this6 = this;\n components.forEach(function (component, colIndex) {\n var _component$options;\n if ((_component$options = component.options) !== null && _component$options !== void 0 && _component$options.name) {\n var newName = \"[\".concat(_this6.key, \"][\").concat(rowIndex, \"]\");\n component.options.name = component.options.name.replace(\"[\".concat(_this6.key, \"][\").concat(component.rowIndex, \"]\"), newName);\n }\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n component.path = _this6.calculateComponentPath(component);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this7 = this;\n this.rows.slice(rowIndex).forEach(function (row, index) {\n _this7.updateComponentsRowIndex(Object.values(row), rowIndex + index);\n });\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var makeEmpty = index === 0 && this.rows.length === 1;\n var flags = {\n isReordered: !makeEmpty,\n resetValue: makeEmpty\n };\n this.splice(index, flags);\n this.emit('dataGridDeleteRow', {\n index: index\n });\n var _this$rows$splice = this.rows.splice(index, 1),\n _this$rows$splice2 = _slicedToArray(_this$rows$splice, 1),\n row = _this$rows$splice2[0];\n this.removeSubmissionMetadataRow(index);\n this.removeRowComponents(row);\n this.updateRowsComponents(index);\n this.setValue(this.dataValue, flags);\n this.redraw();\n }\n }, {\n key: \"removeRowComponents\",\n value: function removeRowComponents(row) {\n var _this8 = this;\n _lodash[\"default\"].each(row, function (component) {\n return _this8.removeComponent(component);\n });\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n return this.dataValue;\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n component.data = rowData;\n });\n }\n }, {\n key: \"createRows\",\n value: function createRows(init, rebuild) {\n var _this9 = this;\n var added = false;\n var rowValues = this.getRowValues();\n // Create any missing rows.\n rowValues.forEach(function (row, index) {\n if (!rebuild && _this9.rows[index]) {\n _this9.setRowComponentsData(index, row);\n } else {\n if (_this9.rows[index]) {\n _this9.removeRowComponents(_this9.rows[index]);\n }\n _this9.rows[index] = _this9.createRowComponents(row, index);\n added = true;\n }\n });\n // Delete any extra rows.\n var removedRows = this.rows.splice(rowValues.length);\n var removed = !!removedRows.length;\n // Delete components of extra rows (to make sure that this.components contain only components of exisiting rows)\n if (removed) {\n removedRows.forEach(function (row) {\n return _this9.removeRowComponents(row);\n });\n }\n if (!init && (added || removed)) {\n this.redraw();\n }\n return added;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this10 = this;\n var components = {};\n this.tabIndex = 0;\n this.component.components.map(function (col, colIndex) {\n var options = _lodash[\"default\"].clone(_this10.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n var columnComponent;\n if (_this10.builderMode) {\n col.id = col.id + rowIndex;\n columnComponent = col;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, col), {}, {\n id: col.id + rowIndex\n });\n }\n var component = _this10.createComponent(columnComponent, options, row);\n component.parentDisabled = !!_this10.disabled;\n component.rowIndex = rowIndex;\n component.inDataGrid = true;\n if (columnComponent.tabindex && parseInt(columnComponent.tabindex) > _this10.tabIndex) {\n _this10.tabIndex = parseInt(columnComponent.tabindex);\n }\n components[col.key] = component;\n });\n return components;\n }\n\n /**\n * Checks the validity of this datagrid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n if (!this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n })) {\n return false;\n }\n var isValid = this.checkRows('checkValidity', data, dirty, true, silentCheck);\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns(data) {\n var _this11 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data = data || this.rootValue;\n var show = false;\n if (!this.rows || !this.rows.length) {\n return {\n rebuild: false,\n show: false\n };\n }\n if (this.builderMode) {\n return {\n rebuild: false,\n show: true\n };\n }\n var visibility = {};\n var logicRebuild = false;\n var dataValue = this.dataValue;\n this.rows.forEach(function (row, rowIndex) {\n _lodash[\"default\"].each(row, function (col, key) {\n if (col && typeof col.checkConditions === 'function') {\n var firstRowCheck = visibility[key] === undefined;\n visibility[key] = !!visibility[key] || col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden';\n if (col.component.logic && firstRowCheck) {\n var compIndex = _lodash[\"default\"].findIndex(_this11.columns, ['key', key]);\n if (!_lodash[\"default\"].isEqual(_this11.columns[compIndex], col.component)) {\n logicRebuild = true;\n _this11.columns[compIndex] = col.component;\n }\n }\n }\n });\n });\n var rebuild = !_lodash[\"default\"].isEqual(visibility, this.visibleColumns) || logicRebuild;\n _lodash[\"default\"].each(visibility, function (col) {\n show |= col;\n });\n this.visibleColumns = visibility;\n return {\n rebuild: rebuild,\n show: show\n };\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var isVisible = this.visible;\n // If table isn't visible, don't bother calculating columns.\n if (!_get(_getPrototypeOf(DataGridComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row)) {\n return false;\n }\n var _this$checkColumns = this.checkColumns(data, flags),\n rebuild = _this$checkColumns.rebuild,\n show = _this$checkColumns.show;\n // Check if a rebuild is needed or the visibility changes.\n if (rebuild || !isVisible) {\n this.createRows(false, rebuild);\n }\n\n // Return if this table should show.\n return show;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n this.dataValue = this.defaultValue;\n this.createRows();\n return false;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n this.createRows();\n value = [{}];\n }\n }\n\n // Make sure we always have at least one row.\n // NOTE: Removing this will break \"Public Configurations\" in portal. ;)\n if (value && !value.length && !this.initEmpty) {\n value.push({});\n }\n var isSettingSubmission = flags.fromSubmission && !_lodash[\"default\"].isEqual(value, this.emptyValue);\n var changed = this.hasChanged(value, this.dataValue);\n this.dataValue = value;\n if (this.initRows || isSettingSubmission || Array.isArray(this.dataValue) && this.dataValue.length !== this.rows.length) {\n if (!this.createRows() && changed) {\n this.redraw();\n }\n }\n if (this.componentModal && isSettingSubmission) {\n this.componentModal.setValue(value);\n }\n this.rows.forEach(function (row, rowIndex) {\n if (value.length <= rowIndex) {\n return;\n }\n _lodash[\"default\"].each(row, function (col) {\n col.rowIndex = rowIndex;\n _this12.setNestedValue(col, value[rowIndex], flags);\n });\n });\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this13 = this;\n this.rows.forEach(function (row, index) {\n return _lodash[\"default\"].forIn(row, function (component) {\n return component.data = _this13.dataValue[index];\n });\n });\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = Array.isArray(path) ? path : [path];\n var _path = path,\n _path2 = _toArray(_path),\n key = _path2[0],\n remainingPath = _path2.slice(1);\n var result = [];\n if (_lodash[\"default\"].isNumber(key) && remainingPath.length) {\n var compKey = remainingPath.pop();\n result = this.rows[key][compKey];\n // If the component is inside a Layout Component, try to find it among all the row's components\n if (!result) {\n Object.entries(this.rows[key]).forEach(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n comp = _ref4[1];\n if ('getComponent' in comp) {\n var possibleResult = comp.getComponent([compKey], fn);\n if (possibleResult) {\n result = possibleResult;\n }\n }\n });\n }\n if (result && _lodash[\"default\"].isFunction(fn)) {\n fn(result, this.getComponents());\n }\n if (remainingPath.length && 'getComponent' in result) {\n return result.getComponent(remainingPath, fn);\n }\n return result;\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n var comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn);\n } else if (fn) {\n fn(component, components);\n }\n result = result.concat(comp);\n }\n });\n return result.length > 0 ? result : null;\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(element, index) {\n element.classList.toggle('collapsed');\n _lodash[\"default\"].each(this.refs.chunks[index], function (row) {\n row.classList.toggle('hidden');\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n label: 'Data Grid',\n key: 'dataGrid',\n type: 'datagrid',\n clearOnHide: true,\n input: true,\n tree: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Grid',\n icon: 'th',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-grid',\n showPreview: false,\n weight: 30,\n schema: DataGridComponent.schema()\n };\n }\n }]);\n return DataGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = DataGridComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datagrid/DataGrid.js?"); /***/ }), @@ -983,7 +983,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-iso-string.js */ \"./node_modules/core-js/modules/es.date.to-iso-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.string.pad-start.js */ \"./node_modules/core-js/modules/es.string.pad-start.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar DayComponent = /*#__PURE__*/function (_Field) {\n _inherits(DayComponent, _Field);\n var _super = _createSuper(DayComponent);\n function DayComponent(component, options, data) {\n _classCallCheck(this, DayComponent);\n if (component.maxDate && component.maxDate.indexOf('moment(') === -1) {\n component.maxDate = (0, _moment[\"default\"])(component.maxDate, 'YYYY-MM-DD').toISOString();\n }\n if (component.minDate && component.minDate.indexOf('moment(') === -1) {\n component.minDate = (0, _moment[\"default\"])(component.minDate, 'YYYY-MM-DD').toISOString();\n }\n return _super.call(this, component, options, data);\n }\n _createClass(DayComponent, [{\n key: \"emptyValue\",\n get:\n /**\n * The empty value for day component.\n *\n * @return {'00/00/0000'}\n */\n function get() {\n return '00/00/0000';\n }\n }, {\n key: \"valueMask\",\n get: function get() {\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n }\n }, {\n key: \"dayRequired\",\n get: function get() {\n return this.showDay && _lodash[\"default\"].get(this.component, 'fields.day.required', false);\n }\n }, {\n key: \"showDay\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.day.hide', false);\n }\n }, {\n key: \"monthRequired\",\n get: function get() {\n return this.showMonth && _lodash[\"default\"].get(this.component, 'fields.month.required', false);\n }\n }, {\n key: \"showMonth\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.month.hide', false);\n }\n }, {\n key: \"yearRequired\",\n get: function get() {\n return this.showYear && _lodash[\"default\"].get(this.component, 'fields.year.required', false);\n }\n }, {\n key: \"showYear\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.year.hide', false);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DayComponent.schema();\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(DayComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(DayComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"inputDefinition\",\n value: function inputDefinition(name) {\n var min, max;\n if (name === 'day') {\n min = 1;\n max = 31;\n }\n if (name === 'month') {\n min = 1;\n max = 12;\n }\n if (name === 'year') {\n min = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n max = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 1900;\n }\n return {\n type: 'input',\n ref: name,\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": \"form-control \".concat(this.transform('class', \"formio-day-component-\".concat(name))),\n type: this.component.fields[name].type === 'select' ? 'select' : 'number',\n placeholder: this.component.fields[name].placeholder,\n step: 1,\n min: min,\n max: max\n }\n };\n }\n }, {\n key: \"selectDefinition\",\n value: function selectDefinition(name) {\n return {\n multiple: false,\n ref: name,\n widget: 'html5',\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": 'form-control',\n name: name,\n lang: this.options.language\n }\n };\n }\n }, {\n key: \"days\",\n get: function get() {\n if (this._days) {\n return this._days;\n }\n this._days = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.day.placeholder', '')\n }];\n for (var x = 1; x <= 31; x++) {\n this._days.push({\n value: x,\n label: x.toString()\n });\n }\n return this._days;\n }\n }, {\n key: \"months\",\n get: function get() {\n if (this._months) {\n return this._months;\n }\n this._months = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.month.placeholder') || (this.hideInputLabels ? this.t('Month') : '')\n }, {\n value: 1,\n label: 'January'\n }, {\n value: 2,\n label: 'February'\n }, {\n value: 3,\n label: 'March'\n }, {\n value: 4,\n label: 'April'\n }, {\n value: 5,\n label: 'May'\n }, {\n value: 6,\n label: 'June'\n }, {\n value: 7,\n label: 'July'\n }, {\n value: 8,\n label: 'August'\n }, {\n value: 9,\n label: 'September'\n }, {\n value: 10,\n label: 'October'\n }, {\n value: 11,\n label: 'November'\n }, {\n value: 12,\n label: 'December'\n }];\n return this._months;\n }\n }, {\n key: \"years\",\n get: function get() {\n if (this._years) {\n return this._years;\n }\n this._years = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.year.placeholder', '')\n }];\n var minYears = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n var maxYears = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 2030;\n for (var x = minYears; x <= maxYears; x++) {\n this._years.push({\n value: x,\n label: x.toString()\n });\n }\n return this._years;\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError) {\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError);\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.day, this.refs.month, this.refs.year], dirty, hasError);\n }\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, [this.refs.day, this.refs.month, this.refs.year]);\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, elements);\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(DayComponent.prototype), \"init\", this).call(this);\n this.validators = this.validators.concat(['day', 'maxDate', 'minDate', 'minYear', 'maxYear']);\n var minYear = this.component.fields.year.minYear;\n var maxYear = this.component.fields.year.maxYear;\n this.component.maxYear = maxYear;\n this.component.minYear = minYear;\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.options.language);\n this.dayFirst = this.component.useLocaleSettings ? dateFormatInfo.dayFirst : this.component.dayFirst;\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('input'));\n }\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('day', {\n dayFirst: this.dayFirst,\n showDay: this.showDay,\n showMonth: this.showMonth,\n showYear: this.showYear,\n day: this.renderField('day'),\n month: this.renderField('month'),\n year: this.renderField('year')\n }));\n }\n }, {\n key: \"renderField\",\n value: function renderField(name) {\n var _this = this;\n if (this.component.fields[name].type === 'select') {\n return this.renderTemplate('select', {\n input: this.selectDefinition(name),\n selectOptions: this[\"\".concat(name, \"s\")].reduce(function (html, option) {\n return html + _this.renderTemplate('selectOption', {\n option: option,\n selected: false,\n attrs: {}\n });\n }, '')\n });\n } else {\n return this.renderTemplate('input', {\n prefix: this.prefix,\n suffix: this.suffix,\n input: this.inputDefinition(name)\n });\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this2 = this;\n this.loadRefs(element, {\n day: 'single',\n month: 'single',\n year: 'single',\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(DayComponent.prototype), \"attach\", this).call(this, element);\n var updateValueAndSaveFocus = function updateValueAndSaveFocus(element, name) {\n return function () {\n try {\n _this2.saveCaretPosition(element, name);\n } catch (err) {\n console.warn('An error occurred while trying to save caret position', err);\n }\n _this2.updateValue(null, {\n modified: true\n });\n };\n };\n if (this.shouldDisabled) {\n this.setDisabled(this.refs.day, true);\n this.setDisabled(this.refs.month, true);\n this.setDisabled(this.refs.year, true);\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n return _this2.setDisabled(input, true);\n });\n }\n } else {\n this.addEventListener(this.refs.day, 'input', updateValueAndSaveFocus(this.refs.day, 'day'));\n // TODO: Need to rework this to work with day select as well.\n // Change day max input when month changes.\n this.addEventListener(this.refs.month, 'input', function () {\n var maxDay = _this2.refs.year ? parseInt(new Date(_this2.refs.year.value, _this2.refs.month.value, 0).getDate(), 10) : '';\n var day = _this2.getFieldValue('day');\n if (!_this2.component.fields.day.hide && maxDay) {\n _this2.refs.day.max = maxDay;\n }\n if (maxDay && day > maxDay) {\n _this2.refs.day.value = _this2.refs.day.max;\n }\n updateValueAndSaveFocus(_this2.refs.month, 'month')();\n });\n this.addEventListener(this.refs.year, 'input', updateValueAndSaveFocus(this.refs.year, 'year'));\n this.addEventListener(this.refs.input, this.info.changeEvent, function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n [this.refs.day, this.refs.month, this.refs.year].filter(function (element) {\n return !!element;\n }).forEach(function (element) {\n _get(_getPrototypeOf(DayComponent.prototype), \"addFocusBlurEvents\", _this2).call(_this2, element);\n });\n }\n this.setValue(this.dataValue);\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n return superAttach;\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n var _this$parts = this.parts,\n day = _this$parts.day,\n month = _this$parts.month,\n year = _this$parts.year;\n if (this.dayRequired && !day) {\n return false;\n }\n if (this.monthRequired && !month) {\n return false;\n }\n if (this.yearRequired && !year) {\n return false;\n }\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return !this.isEmpty(value);\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(DayComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.refs.year || !this.refs.month || !this.refs.day) {\n return;\n }\n if (disabled) {\n this.refs.year.setAttribute('disabled', 'disabled');\n this.refs.month.setAttribute('disabled', 'disabled');\n this.refs.day.setAttribute('disabled', 'disabled');\n } else {\n this.refs.year.removeAttribute('disabled');\n this.refs.month.removeAttribute('disabled');\n this.refs.day.removeAttribute('disabled');\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (!value || this.valueMask.test(value)) {\n return value;\n }\n var dateParts = [];\n var valueParts = value.split('/');\n var _ref = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref2 = _slicedToArray(_ref, 3),\n DAY = _ref2[0],\n MONTH = _ref2[1],\n YEAR = _ref2[2];\n var defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';\n var getNextPart = function getNextPart(shouldTake, defaultValue) {\n return dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n };\n if (this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n // temporary solution to avoid input reset\n // on invalid date.\n if (!value || value === 'Invalid date') {\n return null;\n }\n var parts = value.split('/');\n var day;\n if (this.component.dayFirst) {\n day = parts.shift();\n }\n var month = parts.shift();\n if (!this.component.dayFirst) {\n day = parts.shift();\n }\n var year = parts.shift();\n if (this.refs.day && this.showDay) {\n this.refs.day.value = day === '00' ? '' : parseInt(day, 10);\n }\n if (this.refs.month && this.showMonth) {\n this.refs.month.value = month === '00' ? '' : parseInt(month, 10);\n }\n if (this.refs.year && this.showYear) {\n this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);\n }\n }\n }, {\n key: \"getFieldValue\",\n value: function getFieldValue(name) {\n var parts = this.dataValue ? this.dataValue.split('/') : [];\n var val = 0;\n switch (name) {\n case 'month':\n val = parts[this.dayFirst ? 1 : 0];\n break;\n case 'day':\n val = parts[this.dayFirst ? 0 : 1];\n break;\n case 'year':\n val = parts[2];\n break;\n }\n val = parseInt(val, 10);\n return !_lodash[\"default\"].isNaN(val) && _lodash[\"default\"].isNumber(val) ? val : 0;\n }\n }, {\n key: \"parts\",\n get: function get() {\n return {\n day: this.getFieldValue('day'),\n month: this.getFieldValue('month'),\n year: this.getFieldValue('year')\n };\n }\n\n /**\n * Get the format for the value string.\n * @returns {string}\n */\n }, {\n key: \"format\",\n get: function get() {\n var format = '';\n if (this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showMonth) {\n format += 'M/';\n }\n if (!this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showYear) {\n format += 'YYYY';\n return format;\n } else {\n // Trim off the \"/\" from the end of the format string.\n return format.length ? format.substring(0, format.length - 1) : format;\n }\n }\n\n /**\n * Return the date for this component.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getDate\",\n value: function getDate(value) {\n var defaults = [],\n day,\n month,\n year;\n // Map positions to identifiers to get default values for each part of day\n var _ref3 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref4 = _slicedToArray(_ref3, 3),\n DAY = _ref4[0],\n MONTH = _ref4[1],\n YEAR = _ref4[2];\n var defaultValue = value || this.component.defaultValue;\n if (defaultValue) {\n defaults = defaultValue.split('/').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (this.showDay && this.refs.day) {\n day = parseInt(this.refs.day.value, 10);\n }\n if (day === undefined || _lodash[\"default\"].isNaN(day)) {\n day = defaults[DAY] && !_lodash[\"default\"].isNaN(defaults[DAY]) ? defaults[DAY] : 0;\n }\n if (this.showMonth && this.refs.month) {\n // Months are 0 indexed.\n month = parseInt(this.refs.month.value, 10);\n }\n if (month === undefined || _lodash[\"default\"].isNaN(month)) {\n month = defaults[MONTH] && !_lodash[\"default\"].isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;\n }\n if (this.showYear && this.refs.year) {\n year = parseInt(this.refs.year.value);\n }\n if (year === undefined || _lodash[\"default\"].isNaN(year)) {\n year = defaults[YEAR] && !_lodash[\"default\"].isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;\n }\n var result;\n if (!day && !month && !year) {\n return null;\n }\n\n // add trailing zeros if the data is showed\n day = this.showDay ? day.toString().padStart(2, 0) : '';\n month = this.showMonth ? month.toString().padStart(2, 0) : '';\n year = this.showYear ? year.toString().padStart(4, 0) : '';\n if (this.component.dayFirst) {\n result = \"\".concat(day).concat(this.showDay && this.showMonth || this.showDay && this.showYear ? '/' : '').concat(month).concat(this.showMonth && this.showYear ? '/' : '').concat(year);\n } else {\n result = \"\".concat(month).concat(this.showDay && this.showMonth || this.showMonth && this.showYear ? '/' : '').concat(day).concat(this.showDay && this.showYear ? '/' : '').concat(year);\n }\n return result;\n }\n\n /**\n * Return the date object for this component.\n * @returns {Date}\n */\n }, {\n key: \"date\",\n get: function get() {\n return this.getDate();\n }\n\n /**\n * Return the raw value.\n *\n * @returns {Date}\n */\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var result = _get(_getPrototypeOf(DayComponent.prototype), \"getValue\", this).call(this);\n return !result ? this.dataValue : result;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var date = this.date || this.emptyValue;\n if (date) {\n this.refs.input[index].value = date;\n return this.refs.input[index].value;\n } else {\n this.refs.input[index].value = '';\n return null;\n }\n }\n\n /**\n * Get the input value of the date.\n *\n * @param value\n * @return {null}\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return this.getDate(value) || '';\n }\n }, {\n key: \"focus\",\n value: function focus(field) {\n if (field && typeof field === 'string' && this.refs[field]) {\n this.refs[field].focus();\n } else if (this.dayFirst && this.showDay || !this.dayFirst && !this.showMonth && this.showDay) {\n var _this$refs$day;\n (_this$refs$day = this.refs.day) === null || _this$refs$day === void 0 ? void 0 : _this$refs$day.focus();\n } else if (this.dayFirst && !this.showDay && this.showMonth || !this.dayFirst && this.showMonth) {\n var _this$refs$month;\n (_this$refs$month = this.refs.month) === null || _this$refs$month === void 0 ? void 0 : _this$refs$month.focus();\n } else if (!this.showDay && !this.showDay && this.showYear) {\n var _this$refs$year;\n (_this$refs$year = this.refs.year) === null || _this$refs$year === void 0 ? void 0 : _this$refs$year.focus();\n }\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && _this$root.currentSelection) {\n var _this$root$currentSel = this.root.currentSelection,\n selection = _this$root$currentSel.selection,\n index = _this$root$currentSel.index;\n if (this.refs[index]) {\n var input = this.refs[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange.apply(input, _toConsumableArray(selection));\n }\n }\n }\n }\n }, {\n key: \"isPartialDay\",\n value: function isPartialDay(value) {\n if (!value) {\n return false;\n }\n var _ref5 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref6 = _slicedToArray(_ref5, 3),\n DAY = _ref6[0],\n MONTH = _ref6[1],\n YEAR = _ref6[2];\n var values = value.split('/');\n return values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000';\n }\n }, {\n key: \"getValidationFormat\",\n value: function getValidationFormat() {\n return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n type: 'day',\n label: 'Day',\n key: 'day',\n fields: {\n day: {\n type: 'number',\n placeholder: '',\n required: false\n },\n month: {\n type: 'select',\n placeholder: '',\n required: false\n },\n year: {\n type: 'number',\n placeholder: '',\n required: false\n }\n },\n dayFirst: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Day',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#day',\n weight: 50,\n schema: DayComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DayComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual']\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.string];\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return DayComponent.conditionOperatorsSettings;\n }\n }]);\n return DayComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = DayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/day/Day.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-iso-string.js */ \"./node_modules/core-js/modules/es.date.to-iso-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.string.pad-start.js */ \"./node_modules/core-js/modules/es.string.pad-start.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar DayComponent = /*#__PURE__*/function (_Field) {\n _inherits(DayComponent, _Field);\n var _super = _createSuper(DayComponent);\n function DayComponent(component, options, data) {\n _classCallCheck(this, DayComponent);\n if (component.maxDate && component.maxDate.indexOf('moment(') === -1) {\n component.maxDate = (0, _moment[\"default\"])(component.maxDate, 'YYYY-MM-DD').toISOString();\n }\n if (component.minDate && component.minDate.indexOf('moment(') === -1) {\n component.minDate = (0, _moment[\"default\"])(component.minDate, 'YYYY-MM-DD').toISOString();\n }\n return _super.call(this, component, options, data);\n }\n _createClass(DayComponent, [{\n key: \"emptyValue\",\n get:\n /**\n * The empty value for day component.\n *\n * @return {'00/00/0000'}\n */\n function get() {\n return '00/00/0000';\n }\n }, {\n key: \"valueMask\",\n get: function get() {\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n }\n }, {\n key: \"dayRequired\",\n get: function get() {\n return this.showDay && _lodash[\"default\"].get(this.component, 'fields.day.required', false);\n }\n }, {\n key: \"showDay\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.day.hide', false);\n }\n }, {\n key: \"monthRequired\",\n get: function get() {\n return this.showMonth && _lodash[\"default\"].get(this.component, 'fields.month.required', false);\n }\n }, {\n key: \"showMonth\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.month.hide', false);\n }\n }, {\n key: \"yearRequired\",\n get: function get() {\n return this.showYear && _lodash[\"default\"].get(this.component, 'fields.year.required', false);\n }\n }, {\n key: \"showYear\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.year.hide', false);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DayComponent.schema();\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(DayComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(DayComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"inputDefinition\",\n value: function inputDefinition(name) {\n var min, max;\n if (name === 'day') {\n min = 1;\n max = 31;\n }\n if (name === 'month') {\n min = 1;\n max = 12;\n }\n if (name === 'year') {\n min = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n max = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 1900;\n }\n return {\n type: 'input',\n ref: name,\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": \"form-control \".concat(this.transform('class', \"formio-day-component-\".concat(name))),\n type: this.component.fields[name].type === 'select' ? 'select' : 'number',\n placeholder: this.component.fields[name].placeholder,\n step: 1,\n min: min,\n max: max\n }\n };\n }\n }, {\n key: \"selectDefinition\",\n value: function selectDefinition(name) {\n return {\n multiple: false,\n ref: name,\n widget: 'html5',\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": 'form-control',\n name: name,\n lang: this.options.language\n }\n };\n }\n }, {\n key: \"days\",\n get: function get() {\n if (this._days) {\n return this._days;\n }\n this._days = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.day.placeholder', '')\n }];\n for (var x = 1; x <= 31; x++) {\n this._days.push({\n value: x,\n label: x.toString()\n });\n }\n return this._days;\n }\n }, {\n key: \"months\",\n get: function get() {\n if (this._months) {\n return this._months;\n }\n this._months = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.month.placeholder') || (this.hideInputLabels ? this.t('Month') : '')\n }, {\n value: 1,\n label: 'January'\n }, {\n value: 2,\n label: 'February'\n }, {\n value: 3,\n label: 'March'\n }, {\n value: 4,\n label: 'April'\n }, {\n value: 5,\n label: 'May'\n }, {\n value: 6,\n label: 'June'\n }, {\n value: 7,\n label: 'July'\n }, {\n value: 8,\n label: 'August'\n }, {\n value: 9,\n label: 'September'\n }, {\n value: 10,\n label: 'October'\n }, {\n value: 11,\n label: 'November'\n }, {\n value: 12,\n label: 'December'\n }];\n return this._months;\n }\n }, {\n key: \"years\",\n get: function get() {\n if (this._years) {\n return this._years;\n }\n this._years = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.year.placeholder', '')\n }];\n var minYears = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n var maxYears = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 2030;\n for (var x = minYears; x <= maxYears; x++) {\n this._years.push({\n value: x,\n label: x.toString()\n });\n }\n return this._years;\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError) {\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError);\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.day, this.refs.month, this.refs.year], dirty, hasError);\n }\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, [this.refs.day, this.refs.month, this.refs.year]);\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, elements);\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(DayComponent.prototype), \"init\", this).call(this);\n this.validators = this.validators.concat(['day', 'maxDate', 'minDate', 'minYear', 'maxYear']);\n var minYear = this.component.fields.year.minYear;\n var maxYear = this.component.fields.year.maxYear;\n this.component.maxYear = maxYear;\n this.component.minYear = minYear;\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.options.language);\n this.dayFirst = this.component.useLocaleSettings ? dateFormatInfo.dayFirst : this.component.dayFirst;\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('input'));\n }\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('day', {\n dayFirst: this.dayFirst,\n showDay: this.showDay,\n showMonth: this.showMonth,\n showYear: this.showYear,\n day: this.renderField('day'),\n month: this.renderField('month'),\n year: this.renderField('year')\n }));\n }\n }, {\n key: \"renderField\",\n value: function renderField(name) {\n var _this = this;\n if (this.component.fields[name].type === 'select') {\n return this.renderTemplate('select', {\n input: this.selectDefinition(name),\n selectOptions: this[\"\".concat(name, \"s\")].reduce(function (html, option) {\n return html + _this.renderTemplate('selectOption', {\n option: option,\n selected: false,\n attrs: {}\n });\n }, '')\n });\n } else {\n return this.renderTemplate('input', {\n prefix: this.prefix,\n suffix: this.suffix,\n input: this.inputDefinition(name)\n });\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this2 = this;\n this.loadRefs(element, {\n day: 'single',\n month: 'single',\n year: 'single',\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(DayComponent.prototype), \"attach\", this).call(this, element);\n var updateValueAndSaveFocus = function updateValueAndSaveFocus(element, name) {\n return function () {\n try {\n _this2.saveCaretPosition(element, name);\n } catch (err) {\n console.warn('An error occurred while trying to save caret position', err);\n }\n _this2.updateValue(null, {\n modified: true\n });\n };\n };\n if (this.shouldDisabled) {\n this.setDisabled(this.refs.day, true);\n this.setDisabled(this.refs.month, true);\n this.setDisabled(this.refs.year, true);\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n return _this2.setDisabled(input, true);\n });\n }\n } else {\n this.addEventListener(this.refs.day, 'input', updateValueAndSaveFocus(this.refs.day, 'day'));\n // TODO: Need to rework this to work with day select as well.\n // Change day max input when month changes.\n this.addEventListener(this.refs.month, 'input', function () {\n var maxDay = _this2.refs.year ? parseInt(new Date(_this2.refs.year.value, _this2.refs.month.value, 0).getDate(), 10) : '';\n var day = _this2.getFieldValue('day');\n if (!_this2.component.fields.day.hide && maxDay) {\n _this2.refs.day.max = maxDay;\n }\n if (maxDay && day > maxDay) {\n _this2.refs.day.value = _this2.refs.day.max;\n }\n updateValueAndSaveFocus(_this2.refs.month, 'month')();\n });\n this.addEventListener(this.refs.year, 'input', updateValueAndSaveFocus(this.refs.year, 'year'));\n this.addEventListener(this.refs.input, this.info.changeEvent, function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n [this.refs.day, this.refs.month, this.refs.year].filter(function (element) {\n return !!element;\n }).forEach(function (element) {\n _get(_getPrototypeOf(DayComponent.prototype), \"addFocusBlurEvents\", _this2).call(_this2, element);\n });\n }\n this.setValue(this.dataValue);\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n return superAttach;\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n var _this$parts = this.parts,\n day = _this$parts.day,\n month = _this$parts.month,\n year = _this$parts.year;\n if (this.dayRequired && !day) {\n return false;\n }\n if (this.monthRequired && !month) {\n return false;\n }\n if (this.yearRequired && !year) {\n return false;\n }\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return !this.isEmpty(value);\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(DayComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.refs.year || !this.refs.month || !this.refs.day) {\n return;\n }\n if (disabled) {\n this.refs.year.setAttribute('disabled', 'disabled');\n this.refs.month.setAttribute('disabled', 'disabled');\n this.refs.day.setAttribute('disabled', 'disabled');\n } else {\n this.refs.year.removeAttribute('disabled');\n this.refs.month.removeAttribute('disabled');\n this.refs.day.removeAttribute('disabled');\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (!value || this.valueMask.test(value)) {\n return value;\n }\n var dateParts = [];\n var valueParts = value.split('/');\n var _ref = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref2 = _slicedToArray(_ref, 3),\n DAY = _ref2[0],\n MONTH = _ref2[1],\n YEAR = _ref2[2];\n var defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';\n var getNextPart = function getNextPart(shouldTake, defaultValue) {\n return dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n };\n if (this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n if (value === '') {\n value = this.emptyValue;\n }\n // temporary solution to avoid input reset\n // on invalid date.\n if (!value || value === 'Invalid date') {\n return null;\n }\n var parts = value.split('/');\n var day;\n if (this.component.dayFirst) {\n day = parts.shift();\n }\n var month = parts.shift();\n if (!this.component.dayFirst) {\n day = parts.shift();\n }\n var year = parts.shift();\n if (this.refs.day && this.showDay) {\n this.refs.day.value = day === '00' ? '' : parseInt(day, 10);\n }\n if (this.refs.month && this.showMonth) {\n this.refs.month.value = month === '00' ? '' : parseInt(month, 10);\n }\n if (this.refs.year && this.showYear) {\n this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);\n }\n }\n }, {\n key: \"getFieldValue\",\n value: function getFieldValue(name) {\n var parts = this.dataValue ? this.dataValue.split('/') : [];\n var val = 0;\n switch (name) {\n case 'month':\n val = parts[this.dayFirst ? 1 : 0];\n break;\n case 'day':\n val = parts[this.dayFirst ? 0 : 1];\n break;\n case 'year':\n val = parts[2];\n break;\n }\n val = parseInt(val, 10);\n return !_lodash[\"default\"].isNaN(val) && _lodash[\"default\"].isNumber(val) ? val : 0;\n }\n }, {\n key: \"parts\",\n get: function get() {\n return {\n day: this.getFieldValue('day'),\n month: this.getFieldValue('month'),\n year: this.getFieldValue('year')\n };\n }\n\n /**\n * Get the format for the value string.\n * @returns {string}\n */\n }, {\n key: \"format\",\n get: function get() {\n var format = '';\n if (this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showMonth) {\n format += 'M/';\n }\n if (!this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showYear) {\n format += 'YYYY';\n return format;\n } else {\n // Trim off the \"/\" from the end of the format string.\n return format.length ? format.substring(0, format.length - 1) : format;\n }\n }\n\n /**\n * Return the date for this component.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getDate\",\n value: function getDate(value) {\n var defaults = [],\n day,\n month,\n year;\n // Map positions to identifiers to get default values for each part of day\n var _ref3 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref4 = _slicedToArray(_ref3, 3),\n DAY = _ref4[0],\n MONTH = _ref4[1],\n YEAR = _ref4[2];\n var defaultValue = value || this.component.defaultValue;\n if (defaultValue) {\n defaults = defaultValue.split('/').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (this.showDay && this.refs.day) {\n day = parseInt(this.refs.day.value, 10);\n }\n if (day === undefined || _lodash[\"default\"].isNaN(day)) {\n day = defaults[DAY] && !_lodash[\"default\"].isNaN(defaults[DAY]) ? defaults[DAY] : 0;\n }\n if (this.showMonth && this.refs.month) {\n // Months are 0 indexed.\n month = parseInt(this.refs.month.value, 10);\n }\n if (month === undefined || _lodash[\"default\"].isNaN(month)) {\n month = defaults[MONTH] && !_lodash[\"default\"].isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;\n }\n if (this.showYear && this.refs.year) {\n year = parseInt(this.refs.year.value);\n }\n if (year === undefined || _lodash[\"default\"].isNaN(year)) {\n year = defaults[YEAR] && !_lodash[\"default\"].isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;\n }\n var result;\n if (!day && !month && !year) {\n return null;\n }\n\n // add trailing zeros if the data is showed\n day = this.showDay ? day.toString().padStart(2, 0) : '';\n month = this.showMonth ? month.toString().padStart(2, 0) : '';\n year = this.showYear ? year.toString().padStart(4, 0) : '';\n if (this.component.dayFirst) {\n result = \"\".concat(day).concat(this.showDay && this.showMonth || this.showDay && this.showYear ? '/' : '').concat(month).concat(this.showMonth && this.showYear ? '/' : '').concat(year);\n } else {\n result = \"\".concat(month).concat(this.showDay && this.showMonth || this.showMonth && this.showYear ? '/' : '').concat(day).concat(this.showDay && this.showYear ? '/' : '').concat(year);\n }\n return result;\n }\n\n /**\n * Return the date object for this component.\n * @returns {Date}\n */\n }, {\n key: \"date\",\n get: function get() {\n return this.getDate();\n }\n\n /**\n * Return the raw value.\n *\n * @returns {Date}\n */\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var result = _get(_getPrototypeOf(DayComponent.prototype), \"getValue\", this).call(this);\n return !result ? this.dataValue : result;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var date = this.date || this.emptyValue;\n if (date) {\n this.refs.input[index].value = date;\n return this.refs.input[index].value;\n } else {\n this.refs.input[index].value = '';\n return null;\n }\n }\n\n /**\n * Get the input value of the date.\n *\n * @param value\n * @return {null}\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return this.getDate(value) || '';\n }\n }, {\n key: \"focus\",\n value: function focus(field) {\n if (field && typeof field === 'string' && this.refs[field]) {\n this.refs[field].focus();\n } else if (this.dayFirst && this.showDay || !this.dayFirst && !this.showMonth && this.showDay) {\n var _this$refs$day;\n (_this$refs$day = this.refs.day) === null || _this$refs$day === void 0 ? void 0 : _this$refs$day.focus();\n } else if (this.dayFirst && !this.showDay && this.showMonth || !this.dayFirst && this.showMonth) {\n var _this$refs$month;\n (_this$refs$month = this.refs.month) === null || _this$refs$month === void 0 ? void 0 : _this$refs$month.focus();\n } else if (!this.showDay && !this.showDay && this.showYear) {\n var _this$refs$year;\n (_this$refs$year = this.refs.year) === null || _this$refs$year === void 0 ? void 0 : _this$refs$year.focus();\n }\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && _this$root.currentSelection) {\n var _this$root$currentSel = this.root.currentSelection,\n selection = _this$root$currentSel.selection,\n index = _this$root$currentSel.index;\n if (this.refs[index]) {\n var input = this.refs[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange.apply(input, _toConsumableArray(selection));\n }\n }\n }\n }\n }, {\n key: \"isPartialDay\",\n value: function isPartialDay(value) {\n if (!value) {\n return false;\n }\n var _ref5 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref6 = _slicedToArray(_ref5, 3),\n DAY = _ref6[0],\n MONTH = _ref6[1],\n YEAR = _ref6[2];\n var values = value.split('/');\n return values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000';\n }\n }, {\n key: \"getValidationFormat\",\n value: function getValidationFormat() {\n return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n type: 'day',\n label: 'Day',\n key: 'day',\n fields: {\n day: {\n type: 'number',\n placeholder: '',\n required: false\n },\n month: {\n type: 'select',\n placeholder: '',\n required: false\n },\n year: {\n type: 'number',\n placeholder: '',\n required: false\n }\n },\n dayFirst: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Day',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#day',\n weight: 50,\n schema: DayComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DayComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual']\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.string];\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return DayComponent.conditionOperatorsSettings;\n }\n }]);\n return DayComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = DayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/day/Day.js?"); /***/ }), @@ -1071,7 +1071,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.promise.js */ \"./node_modules/core-js/modules/es.promise.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Alert = _interopRequireDefault(__webpack_require__(/*! ../alert/Alert */ \"./lib/components/alert/Alert.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/components/editgrid/templates/index.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar EditRowState = {\n New: 'new',\n Editing: 'editing',\n Saved: 'saved',\n Viewing: 'viewing',\n Removed: 'removed',\n Draft: 'draft'\n};\nvar EditGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(EditGridComponent, _NestedArrayComponent);\n var _super = _createSuper(EditGridComponent);\n function EditGridComponent() {\n var _this;\n _classCallCheck(this, EditGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'editgrid';\n return _this;\n }\n _createClass(EditGridComponent, [{\n key: \"defaultDialogTemplate\",\n get: function get() {\n return \"\\n

\".concat(this.t('Do you want to clear data?'), \"

\\n
\\n \\n \\n
\\n \");\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableRowTemplate : EditGridComponent.defaultRowTemplate;\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableHeaderTemplate : EditGridComponent.defaultHeaderTemplate;\n }\n }, {\n key: \"rowTemplate\",\n get: function get() {\n var rowTemplate;\n if (_utils.Evaluator.noeval) {\n rowTemplate = this.displayAsTable ? _templates[\"default\"].tableRow : _templates[\"default\"].row;\n } else {\n rowTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableRow', this.defaultRowTemplate) : _lodash[\"default\"].get(this.component, 'templates.row', this.defaultRowTemplate);\n }\n return rowTemplate;\n }\n }, {\n key: \"headerTemplate\",\n get: function get() {\n var headerTemplate;\n if (_utils.Evaluator.noeval) {\n headerTemplate = this.displayAsTable ? _templates[\"default\"].tableHeader : _templates[\"default\"].header;\n } else {\n headerTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate) : _lodash[\"default\"].get(this.component, 'templates.header', this.defaultHeaderTemplate);\n }\n return headerTemplate;\n }\n\n /**\n * Returns true if the component has nested components which don't trigger changes on the root level\n */\n }, {\n key: \"hasScopedChildren\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return EditGridComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"editgridKey\",\n get: function get() {\n return \"editgrid-\".concat(this.key);\n }\n }, {\n key: \"rowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-row\");\n }\n }, {\n key: \"rowElements\",\n get: function get() {\n return this.refs[this.rowRef];\n }\n }, {\n key: \"rowRefs\",\n get: function get() {\n return this.refs[\"editgrid-\".concat(this.component.key, \"-row\")];\n }\n }, {\n key: \"addRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-addRow\");\n }\n }, {\n key: \"addRowElements\",\n get: function get() {\n return this.refs[this.addRowRef];\n }\n }, {\n key: \"saveRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-saveRow\");\n }\n }, {\n key: \"saveRowElements\",\n get: function get() {\n return this.refs[this.saveRowRef];\n }\n }, {\n key: \"cancelRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-cancelRow\");\n }\n }, {\n key: \"cancelRowElements\",\n get: function get() {\n return this.refs[this.cancelRowRef];\n }\n }, {\n key: \"inlineEditMode\",\n get: function get() {\n return this.component.inlineEdit;\n }\n }, {\n key: \"saveEditMode\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"minLength\",\n get: function get() {\n return this.builderMode ? 0 : _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n var data = this.dataValue;\n (this.editRows || []).forEach(function (row, index) {\n if (!data[index] && row.state !== EditRowState.New) {\n data[index] = {};\n }\n var rowData = data[index] || {};\n row.data = rowData;\n row.components.forEach(function (component) {\n component.data = rowData;\n });\n });\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", this) || [];\n },\n set: function set(value) {\n _set(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"displayAsTable\",\n get: function get() {\n return this.component.displayAsTable;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.editRows;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(EditGridComponent.prototype), \"defaultValue\", this);\n var defaultValue = Array.isArray(value) ? value : [];\n _lodash[\"default\"].times(this.minLength - defaultValue.length, function () {\n return defaultValue.push({});\n });\n return defaultValue;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n if (this.builderMode) {\n this.editRows = [];\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"init\", this).call(this);\n }\n this.components = this.components || [];\n var dataValue = this.dataValue;\n var openWhenEmpty = !dataValue.length && this.component.openWhenEmpty;\n if (openWhenEmpty) {\n var dataObj = {};\n this.editRows = [];\n this.createRow(dataObj, 0);\n } else {\n this.editRows = dataValue.map(function (row, rowIndex) {\n return {\n components: _this2.lazyLoad ? [] : _this2.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n });\n }\n this.prevHasAddButton = this.hasAddButton();\n this.checkData();\n this.setVariableTypeComponents();\n if (this.variableTypeComponentsIndexes.length) {\n _lodash[\"default\"].each(this.editRows || [], function (editRow, rowIndex) {\n return _this2.checkRowVariableTypeComponents(editRow, rowIndex);\n });\n }\n }\n }, {\n key: \"checkRowVariableTypeComponents\",\n value: function checkRowVariableTypeComponents(editRow, rowIndex) {\n var rowComponents = editRow.components;\n if (_lodash[\"default\"].some(this.variableTypeComponentsIndexes, function (compIndex) {\n var variableTypeComp = rowComponents[compIndex];\n return variableTypeComp.type !== variableTypeComp.component.type;\n })) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex, true);\n }\n }\n }, {\n key: \"setVariableTypeComponents\",\n value: function setVariableTypeComponents() {\n var _this3 = this;\n //set components which type is changing within a row (e.g.,by mergeComponentSchema action)\n this.variableTypeComponentsIndexes = [];\n _lodash[\"default\"].each(this.component.components, function (comp, index) {\n if (comp.typeChangeEnabled) {\n _this3.variableTypeComponentsIndexes.push(index);\n }\n });\n }\n }, {\n key: \"isOpen\",\n value: function isOpen(editRow) {\n return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);\n }\n }, {\n key: \"isComponentVisibleInSomeRow\",\n value: function isComponentVisibleInSomeRow(component) {\n var _this4 = this;\n var rows = this.editRows;\n var savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];\n var savedRows = rows.filter(function (row) {\n return _lodash[\"default\"].includes(savedStates, row.state);\n });\n this.visibleInHeader = this.visibleInHeader || [];\n var changeVisibleInHeader = function changeVisibleInHeader(component, isVisible) {\n if (!isVisible) {\n _lodash[\"default\"].remove(_this4.visibleInHeader, function (key) {\n return key === component.key;\n });\n }\n if (isVisible && !_lodash[\"default\"].includes(_this4.visibleInHeader, component.key)) {\n _this4.visibleInHeader.push(component.key);\n }\n };\n if (_lodash[\"default\"].isEmpty(rows)) {\n var rowComponents = this.createRowComponents({}, 0);\n var checkComponent;\n (0, _utils.eachComponent)(rowComponents, function (comp) {\n if (comp.component.key === component.key) {\n checkComponent = comp;\n }\n comp.checkConditions();\n });\n var isVisible = checkComponent ? checkComponent.visible : true;\n _toConsumableArray(this.components).forEach(function (comp) {\n return _this4.removeComponent(comp, _this4.components);\n });\n changeVisibleInHeader(component, isVisible);\n return isVisible;\n }\n var isOpenRowWhenEmpty = _lodash[\"default\"].get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;\n if (!_lodash[\"default\"].isEmpty(rows) && _lodash[\"default\"].isEmpty(savedRows) && !isOpenRowWhenEmpty) {\n return _lodash[\"default\"].includes(this.visibleInHeader, component.key);\n }\n return _lodash[\"default\"].some(isOpenRowWhenEmpty ? rows : savedRows, function (row, index) {\n var editingRow = row.state === EditRowState.Editing;\n var isVisible;\n if (!editingRow) {\n var flattenedComponents = _this4.flattenComponents(index);\n var instance = flattenedComponents[component.key];\n isVisible = instance ? instance.visible : true;\n changeVisibleInHeader(component, isVisible);\n } else {\n isVisible = _lodash[\"default\"].includes(_this4.visibleInHeader, component.key);\n }\n return isVisible;\n });\n }\n }, {\n key: \"render\",\n value: function render(children) {\n var _this5 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this);\n }\n var dataValue = this.dataValue;\n var headerTemplate = this.headerTemplate;\n var t = this.t.bind(this);\n var templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(templateName, {\n ref: {\n row: this.rowRef,\n addRow: this.addRowRef,\n saveRow: this.saveRowRef,\n cancelRow: this.cancelRowRef\n },\n header: this.renderString(headerTemplate, {\n displayValue: function displayValue(component) {\n return _this5.displayComponentValue(component, true);\n },\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n footer: this.renderString(_lodash[\"default\"].get(this.component, 'templates.footer'), {\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n rows: this.editRows.map(this.renderRow.bind(this)),\n openRows: this.editRows.map(function (row) {\n return _this5.isOpen(row);\n }),\n errors: this.editRows.map(function (row) {\n return row.error;\n }),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: this.hasRemoveButtons()\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n var templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';\n return this.renderTemplate(templateName, {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this6 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.addRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.saveRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.cancelRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.rowRef, 'multiple'), _this$loadRefs));\n this.addRowElements.forEach(function (addButton) {\n _this6.addEventListener(addButton, 'click', function () {\n return _this6.addRow();\n });\n });\n var openRowCount = 0;\n this.rowElements.forEach(function (row, rowIndex) {\n var editRow = _this6.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.isRowSelected) {\n row.classList.add('selected');\n }\n if (_this6.isOpen(editRow)) {\n _this6.attachComponents(row, editRow.components);\n _this6.addEventListener(_this6.saveRowElements[openRowCount], 'click', function () {\n return _this6.saveRow(rowIndex, true);\n });\n _this6.addEventListener(_this6.cancelRowElements[openRowCount], 'click', function () {\n return _this6.cancelRow(rowIndex);\n });\n openRowCount++;\n } else {\n // Attach edit and remove button events.\n [{\n className: 'removeRow',\n event: 'click',\n action: function action() {\n return _this6.removeRow(rowIndex, true);\n }\n }, {\n className: 'editRow',\n event: 'click',\n action: function action() {\n _this6.editRow(rowIndex).then(function () {\n if (_this6.component.rowDrafts) {\n var _this6$root;\n _this6.validateRow(editRow, false);\n var hasErrors = editRow.errors && !!editRow.errors.length;\n var shouldShowRowErrorsAlert = _this6.component.modal && hasErrors && ((_this6$root = _this6.root) === null || _this6$root === void 0 ? void 0 : _this6$root.submitted);\n if (shouldShowRowErrorsAlert) {\n _this6.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n });\n }\n }, {\n className: 'row',\n event: 'click',\n action: function action() {\n row.classList.toggle('selected');\n var eventName = 'editGridSelectRow';\n if (Array.from(row.classList).includes('selected')) {\n editRow.isRowSelected = true;\n } else {\n delete editRow.isRowSelected;\n eventName = 'editGridUnSelectRow';\n }\n _this6.emit(eventName, {\n component: _this6.component,\n data: _this6.dataValue[rowIndex]\n });\n }\n }].forEach(function (_ref) {\n var className = _ref.className,\n event = _ref.event,\n action = _ref.action;\n var elements = row.getElementsByClassName(className);\n Array.prototype.forEach.call(elements, function (element) {\n if (_this6.options.pdf && _lodash[\"default\"].intersection(element.classList, ['editRow', 'removeRow']).length) {\n element.style.display = 'none';\n } else {\n _this6.addEventListener(element, event, action);\n }\n });\n });\n }\n });\n\n // Add open class to the element if any edit grid row is open\n if (openRowCount) {\n this.addClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n } else {\n this.removeClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n }\n var superAttach = _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n messageContainer: 'single-scope'\n });\n return superAttach;\n }\n }, {\n key: \"flattenRowDataValue\",\n value: function flattenRowDataValue(dataValue) {\n var _this7 = this;\n var flattened = {};\n Object.keys(dataValue).forEach(function (key) {\n if (_lodash[\"default\"].isObject(dataValue[key]) && !_lodash[\"default\"].isNil(dataValue[key])) {\n Object.assign(flattened, _this7.flattenRowDataValue(dataValue[key]));\n } else {\n flattened[key] = dataValue[key];\n }\n });\n return flattened;\n }\n }, {\n key: \"isComponentVisibleInRow\",\n value: function isComponentVisibleInRow(component, flattenedComponents) {\n var instance = flattenedComponents[component.key];\n return instance ? instance.visible : true;\n }\n }, {\n key: \"displayComponentValue\",\n value: function displayComponentValue(component, header) {\n return !!((!component.hasOwnProperty('tableView') || component.tableView) && header ? this.isComponentVisibleInSomeRow(component) : _lodash[\"default\"].includes(this.visibleInHeader, component.key));\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(row, rowIndex) {\n var _this8 = this;\n var dataValue = this.dataValue;\n if (this.isOpen(row)) {\n return this.renderComponents(row.components);\n } else {\n var flattenedComponents = this.flattenComponents(rowIndex);\n var rowTemplate = this.rowTemplate;\n return this.renderString(rowTemplate, {\n row: dataValue[rowIndex] || {},\n data: this.data,\n rowIndex: rowIndex,\n components: this.component.components,\n flattenedComponents: flattenedComponents,\n displayValue: function displayValue(component) {\n return _this8.displayComponentValue(component);\n },\n isVisibleInRow: function isVisibleInRow(component) {\n return _this8.isComponentVisibleInRow(component, flattenedComponents);\n },\n getView: function getView(component, data) {\n var _instance$component, _instance$component2;\n var instance = flattenedComponents[component.key];\n var view = instance ? instance.getView(data || instance.dataValue) : '';\n\n // If there is an html tag in view, don't allow it to be injected in template\n var htmlTagRegExp = new RegExp('<(.*?)>');\n return typeof view === 'string' && view.length && !((_instance$component = instance.component) !== null && _instance$component !== void 0 && _instance$component.template) && htmlTagRegExp.test(view) && ((_instance$component2 = instance.component) === null || _instance$component2 === void 0 ? void 0 : _instance$component2.inputFormat) !== 'html' ? \"\") : view;\n },\n state: this.editRows[rowIndex].state,\n t: this.t.bind(this)\n });\n }\n }\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn, rowIndex) {\n _lodash[\"default\"].each(this.getComponents(rowIndex), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n var _this9$editRows$compo;\n var rowData = _this9.dataValue[component.rowIndex];\n var editRowData = (_this9$editRows$compo = _this9.editRows[component.rowIndex]) === null || _this9$editRows$compo === void 0 ? void 0 : _this9$editRows$compo.data;\n component.data = rowData || editRowData;\n });\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents(rowIndex) {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n }, rowIndex);\n return result;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n var _this$editRows$rowInd;\n // Ensure editrows is set.\n this.editRows = this.editRows || [];\n return this.builderMode ? _get(_getPrototypeOf(EditGridComponent.prototype), \"getComponents\", this).call(this) : _lodash[\"default\"].isNumber(rowIndex) ? ((_this$editRows$rowInd = this.editRows[rowIndex]) === null || _this$editRows$rowInd === void 0 ? void 0 : _this$editRows$rowInd.components) || [] : this.editRows.reduce(function (result, row) {\n return result.concat(row.components || []);\n }, []);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var all = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.calculatedValue = undefined;\n _get(_getPrototypeOf(EditGridComponent.prototype), \"destroy\", this).call(this, all);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this10 = this;\n var rowIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"destroyComponents\", this).call(this);\n }\n var components = this.getComponents(rowIndex).slice();\n components.forEach(function (comp) {\n return _this10.removeComponent(comp, _this10.components);\n });\n }\n }, {\n key: \"createRow\",\n value: function createRow(dataObj, rowIndex) {\n var editRow = {\n components: this.createRowComponents(dataObj, rowIndex),\n data: dataObj,\n state: EditRowState.New,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n this.editRows.push(editRow);\n if (this.inlineEditMode) {\n this.dataValue.push(dataObj);\n }\n return editRow;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n if (this.options.readOnly) {\n return;\n }\n var dataObj = {};\n var rowIndex = this.editRows.length;\n var editRow = this.createRow(dataObj, rowIndex);\n if (editRow.state === EditRowState.New) {\n this.emptyRow = (0, _utils.fastCloneDeep)(editRow.data);\n }\n if (this.inlineEditMode) {\n this.triggerChange();\n }\n this.emit('editGridAddRow', {\n component: this.component,\n row: editRow\n });\n this.checkRow('checkData', null, {}, editRow.data, editRow.components);\n if (this.component.modal) {\n this.addRowModal(rowIndex);\n } else {\n this.redraw();\n }\n return editRow;\n }\n }, {\n key: \"addRowModal\",\n value: function addRowModal(rowIndex) {\n var _this11 = this;\n var modalContent = this.ce('div');\n var editRow = this.editRows[rowIndex];\n editRow.willBeSaved = false;\n var components = editRow.components;\n modalContent.innerHTML = this.renderComponents(components);\n var dialog = this.component.modal ? this.createModal(modalContent, {}, function () {\n return _this11.showDialog(rowIndex);\n }) : undefined;\n dialog.classList.add(\"editgrid-row-modal-\".concat(this.id));\n editRow.dialog = dialog;\n if (this.alert) {\n this.alert.clear();\n this.alert = null;\n }\n this.alert = new _Alert[\"default\"](dialog.refs.dialogContents, this);\n this.addEventListener(dialog, 'close', function () {\n if (!editRow.willBeSaved) {\n if (_this11.editRows[rowIndex] && _this11.editRows[rowIndex].state !== EditRowState.New) {\n _this11.editRows[rowIndex].components.forEach(function (comp) {\n comp.setPristine(true);\n });\n }\n _this11.cancelRow(rowIndex);\n }\n if (_this11.alert) {\n _this11.alert.clear();\n _this11.alert = null;\n }\n\n // Remove references to dialog elements to prevent possible in some cases memory leaks\n delete editRow.confirmationDialog;\n delete editRow.dialog;\n });\n dialog.refs.dialogContents.appendChild(this.ce('button', {\n \"class\": 'btn btn-primary',\n onClick: function onClick() {\n // After an attempt to save, all the components inside the row should become not pristine\n if (!_this11.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n if (_this11.validateRow(editRow, true) || _this11.component.rowDrafts) {\n editRow.willBeSaved = true;\n dialog.close();\n _this11.saveRow(rowIndex, true);\n } else {\n _this11.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n }, this.component.saveRow || 'Save'));\n return this.attachComponents(modalContent, components);\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow.state === EditRowState.New ? _lodash[\"default\"].isEqual(this.emptyRow, editRow.data) : _lodash[\"default\"].isEqual(editRow.backup, editRow.data)) {\n return Promise.resolve();\n }\n var wrapper = this.ce('div', {\n ref: 'confirmationDialog'\n });\n var dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;\n wrapper.innerHTML = dialogContent;\n wrapper.refs = {};\n this.loadRefs.call(wrapper, wrapper, {\n dialogHeader: 'single',\n dialogCancelButton: 'single',\n dialogYesButton: 'single'\n });\n var dialog = this.createModal(wrapper);\n dialog.classList.add(\"editgrid-row-modal-confirmation-\".concat(this.id));\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var dialogResult;\n var promise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n dialogResult = {\n resolve: resolve,\n reject: reject\n };\n });\n this.addEventListener(wrapper.refs.dialogYesButton, 'click', function (event) {\n close(event);\n dialogResult.resolve();\n });\n this.addEventListener(wrapper.refs.dialogCancelButton, 'click', function (event) {\n close(event);\n dialogResult.reject();\n });\n editRow.confirmationDialog = dialog;\n return promise;\n }\n }, {\n key: \"editRow\",\n value: function editRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n var isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;\n if (!editRow || isAlreadyEditing) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n editRow.prevState = editRow.state;\n editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;\n if (this.lazyLoad && editRow.components.length === 0) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex);\n }\n var dataSnapshot = (0, _utils.fastCloneDeep)(editRow.data);\n if (this.inlineEditMode) {\n editRow.backup = dataSnapshot;\n } else {\n editRow.backup = (0, _utils.fastCloneDeep)(editRow.data);\n editRow.data = dataSnapshot;\n this.restoreRowContext(editRow);\n }\n if (this.component.modal) {\n return this.addRowModal(rowIndex);\n }\n return this.redraw();\n }\n }, {\n key: \"clearErrors\",\n value: function clearErrors(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow && Array.isArray(editRow.components)) {\n editRow.components.forEach(function (comp) {\n comp.setPristine(true);\n comp.setCustomValidity('');\n });\n }\n }\n }, {\n key: \"cancelRow\",\n value: function cancelRow(rowIndex) {\n if (this.options.readOnly) {\n return;\n }\n var editRow = this.editRows[rowIndex];\n switch (editRow.state) {\n case EditRowState.New:\n {\n editRow.state = EditRowState.Removed;\n this.clearErrors(rowIndex);\n this.destroyComponents(rowIndex);\n if (this.inlineEditMode) {\n this.splice(rowIndex);\n }\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n break;\n }\n case EditRowState.Editing:\n {\n editRow.state = editRow.prevState;\n if (this.inlineEditMode) {\n this.dataValue[rowIndex] = editRow.backup;\n }\n editRow.data = editRow.backup;\n editRow.backup = null;\n this.restoreRowContext(editRow);\n this.clearErrors(rowIndex);\n break;\n }\n }\n this.emit('editGridCancelRow', {\n instance: this,\n component: this.component,\n editRow: editRow\n });\n this.checkValidity(null, true);\n this.redraw();\n if (this.component.rowDrafts) {\n this.checkValidity(this.data, false);\n }\n }\n }, {\n key: \"saveRow\",\n value: function saveRow(rowIndex, modified) {\n var _this12 = this;\n var editRow = this.editRows[rowIndex];\n if (this.options.readOnly) {\n return;\n }\n\n // After an attempt to save, all the components inside the row should become not pristine\n if (!this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n var isRowValid = this.validateRow(editRow, true);\n if (!this.component.rowDrafts) {\n if (!isRowValid) {\n return false;\n }\n }\n if (this.saveEditMode) {\n var _this$root, _this$root$focusedCom;\n var dataValue = this.dataValue;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$focusedCom = _this$root.focusedComponent) !== null && _this$root$focusedCom !== void 0 && _this$root$focusedCom.component.typeChangeEnabled) {\n this.root.focusedComponent = null;\n }\n switch (editRow.state) {\n case EditRowState.New:\n {\n var newIndex = dataValue.length;\n dataValue.push(editRow.data);\n editRow.components.forEach(function (component) {\n return component.rowIndex = newIndex;\n });\n if (rowIndex !== newIndex) {\n this.editRows.splice(rowIndex, 1);\n this.editRows.splice(newIndex, 0, editRow);\n }\n break;\n }\n case EditRowState.Editing:\n {\n dataValue[rowIndex] = editRow.data;\n break;\n }\n }\n }\n editRow.state = this.component.rowDrafts && !isRowValid ? EditRowState.Draft : EditRowState.Saved;\n editRow.backup = null;\n this.updateValue();\n this.emit('editGridSaveRow', {\n component: this.component,\n row: editRow.data,\n instance: this\n });\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n if (this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(_this12.pristine);\n });\n }\n this.checkValidity(null, true);\n this.redraw();\n if (editRow.alerts) {\n editRow.alerts = false;\n }\n return true;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var relativePath = this.getRelativePath(component.path);\n var arrayPath = (0, _utils.getArrayFromComponentPath)(relativePath);\n var rowIndex = arrayPath[0];\n var rowToEditIndex = arrayPath[0];\n this.editRows.forEach(function (row, indexInArray) {\n if (row.rowIndex === rowIndex) {\n rowToEditIndex = indexInArray;\n }\n });\n if (_lodash[\"default\"].isNumber(rowToEditIndex)) {\n this.editRow(rowToEditIndex);\n }\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n components.forEach(function (component, colIndex) {\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this13 = this;\n this.editRows.slice(rowIndex).forEach(function (row, index) {\n _this13.updateComponentsRowIndex(row.components, rowIndex + index);\n });\n }\n }, {\n key: \"baseRemoveRow\",\n value: function baseRemoveRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n editRow.state = EditRowState.Removed;\n this.destroyComponents(rowIndex);\n return editRow;\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(rowIndex, modified) {\n if (this.options.readOnly) {\n return;\n }\n this.clearErrors(rowIndex);\n this.baseRemoveRow(rowIndex);\n this.splice(rowIndex);\n this.emit('editGridDeleteRow', {\n index: rowIndex\n });\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n this.updateRowsComponents(rowIndex);\n this.updateValue();\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n this.checkValidity(null, true);\n this.checkData();\n this.redraw();\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex, recreatePartially) {\n var _this14 = this;\n // Iterate through existing components and destroy the ones with the same rowIndex.\n if (this.components) {\n for (var i = 0; i < this.components.length; i++) {\n if (this.components[i].rowIndex === rowIndex) {\n this.components[i].destroy();\n this.components.splice(i, 1);\n }\n }\n }\n var currentRowComponents = _lodash[\"default\"].get(this.editRows, \"[\".concat(rowIndex, \"].components\"), null);\n return this.component.components.map(function (col, colIndex) {\n if (recreatePartially && currentRowComponents && _this14.variableTypeComponentsIndexes.length) {\n var _currentComp$componen;\n var currentComp = currentRowComponents[colIndex];\n var shouldRecreate = _lodash[\"default\"].includes(_this14.variableTypeComponentsIndexes, colIndex) && (currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== (currentComp === null || currentComp === void 0 ? void 0 : (_currentComp$componen = currentComp.component) === null || _currentComp$componen === void 0 ? void 0 : _currentComp$componen.type);\n if (!shouldRecreate) {\n return currentComp;\n }\n col = currentComp.component;\n }\n var column = _lodash[\"default\"].clone(col);\n var options = _lodash[\"default\"].clone(_this14.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n options.onChange = function () {\n var _changed$instance$roo, _this14$root;\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 ? arguments[1] : undefined;\n var modified = arguments.length > 2 ? arguments[2] : undefined;\n if ((_changed$instance$roo = changed.instance.root) !== null && _changed$instance$roo !== void 0 && _changed$instance$roo.id && ((_this14$root = _this14.root) === null || _this14$root === void 0 ? void 0 : _this14$root.id) !== changed.instance.root.id) {\n changed.instance.root.triggerChange(flags, changed, modified);\n } else if (!_this14.component.modal) {\n _this14.triggerRootChange(flags, changed, modified);\n }\n if (_this14.inlineEditMode) {\n return;\n }\n var editRow = _this14.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.alerts) {\n _this14.checkData(null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n rowIndex: rowIndex\n }), _this14.data);\n } else if (editRow) {\n // If drafts allowed, perform validation silently if there was no attempt to submit a form\n var silentCheck = _this14.component.rowDrafts && !_this14.shouldValidateDraft(editRow);\n _this14.checkRow('checkData', null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n silentCheck: silentCheck\n }), editRow.data, editRow.components, silentCheck);\n }\n if (_this14.variableTypeComponentsIndexes.length) {\n _this14.checkRowVariableTypeComponents(editRow, rowIndex);\n _this14.redraw();\n }\n };\n var comp = _this14.createComponent(_lodash[\"default\"].assign({}, column, {\n row: options.row\n }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);\n comp.rowIndex = rowIndex;\n comp.inEditGrid = true;\n return comp;\n });\n }\n }, {\n key: \"hasOpenRows\",\n value: function hasOpenRows() {\n var _this15 = this;\n return this.editRows.some(function (row) {\n return _this15.isOpen(row);\n });\n }\n }, {\n key: \"shouldValidateDraft\",\n value: function shouldValidateDraft(editRow) {\n var _this$root2, _this$root3;\n // Draft rows should be validated only when there was an attempt to submit a form\n return editRow.state === EditRowState.Draft && !this.pristine && !((_this$root2 = this.root) !== null && _this$root2 !== void 0 && _this$root2.pristine) && !this.hasOpenRows() || ((_this$root3 = this.root) === null || _this$root3 === void 0 ? void 0 : _this$root3.submitted);\n }\n }, {\n key: \"shouldValidateRow\",\n value: function shouldValidateRow(editRow, dirty) {\n return this.shouldValidateDraft(editRow) || editRow.state === EditRowState.Editing || editRow.alerts || dirty;\n }\n }, {\n key: \"validateRow\",\n value: function validateRow(editRow, dirty, forceSilentCheck) {\n var _this16 = this,\n _this$root4;\n var valid = true;\n var errorsSnapshot = _toConsumableArray(this.errors);\n if (this.shouldValidateRow(editRow, dirty)) {\n editRow.components.forEach(function (comp) {\n var silentCheck = _this16.component.rowDrafts && !_this16.shouldValidateDraft(editRow) || forceSilentCheck;\n valid &= comp.checkValidity(null, dirty, null, silentCheck);\n });\n }\n if (this.component.validate && this.component.validate.row) {\n valid = this.evaluate(this.component.validate.row, {\n valid: valid,\n row: editRow.data\n }, 'valid', true);\n if (valid.toString() !== 'true') {\n editRow.error = valid;\n valid = false;\n } else {\n editRow.error = null;\n }\n if (valid === null) {\n valid = \"Invalid row validation for \".concat(this.key);\n }\n }\n editRow.errors = !valid ? this.errors.filter(function (err) {\n return !errorsSnapshot.includes(err);\n }) : null;\n if (!this.component.rowDrafts || (_this$root4 = this.root) !== null && _this$root4 !== void 0 && _this$root4.submitted) {\n this.showRowErrorAlerts(editRow, !!valid);\n }\n return !!valid;\n }\n }, {\n key: \"showRowErrorAlerts\",\n value: function showRowErrorAlerts(editRow, valid) {\n if (editRow.alerts) {\n if (this.alert) {\n var _editRow$errors;\n if ((_editRow$errors = editRow.errors) !== null && _editRow$errors !== void 0 && _editRow$errors.length && !valid) {\n this.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n } else {\n this.alert.clear();\n }\n }\n }\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n return this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this17 = this,\n _this$errors,\n _this$root6;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var silentCheck = options.silentCheck;\n var errorsLength = this.errors.length;\n var superValid = _get(_getPrototypeOf(EditGridComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n\n // If super tells us that component invalid and there is no need to update alerts, just return false\n if (!superValid && !this.alert && !this.hasOpenRows()) {\n return false;\n }\n if (this.shouldSkipValidation(data, dirty, row)) {\n return true;\n }\n var rowsValid = true;\n var rowsEditing = false;\n this.editRows.forEach(function (editRow, index) {\n // Trigger all errors on the row.\n var rowValid = _this17.validateRow(editRow, dirty, silentCheck);\n rowsValid &= rowValid;\n if (_this17.rowRefs) {\n var rowContainer = _this17.rowRefs[index];\n if (rowContainer) {\n var errorContainer = rowContainer.querySelector('.editgrid-row-error');\n if (!rowValid && errorContainer && (!_this17.component.rowDrafts || _this17.shouldValidateDraft(editRow))) {\n _this17.addClass(errorContainer, 'help-block');\n errorContainer.textContent = _this17.t(_this17.errorMessage('invalidRowError'));\n } else if (errorContainer) {\n errorContainer.textContent = '';\n }\n }\n }\n // If this is a dirty check, and any rows are still editing, we need to throw validation error.\n rowsEditing |= dirty && _this17.isOpen(editRow);\n });\n if (!rowsValid) {\n var _this$root5;\n if (!silentCheck && (!this.component.rowDrafts || (_this$root5 = this.root) !== null && _this$root5 !== void 0 && _this$root5.submitted)) {\n this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);\n // Delete this class, because otherwise all the components inside EditGrid will has red border even if they are valid\n this.removeClass(this.element, 'has-error');\n }\n return false;\n } else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {\n this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);\n return false;\n }\n var message = this.invalid || this.invalidMessage(data, dirty);\n if (((_this$errors = this.errors) === null || _this$errors === void 0 ? void 0 : _this$errors.length) !== errorsLength && (_this$root6 = this.root) !== null && _this$root6 !== void 0 && _this$root6.submitted && !message) {\n this.setCustomValidity(message, dirty);\n this.root.showErrors();\n } else {\n this.setCustomValidity(message, dirty);\n }\n return superValid;\n }\n }, {\n key: \"changeState\",\n value: function changeState(changed, flags) {\n if (this.visible && (changed || flags.resetValue && this.component.modalEdit)) {\n this.rebuild();\n } else {\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this18 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n value = this.defaultValue;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n return false;\n }\n }\n var changed = this.hasChanged(value, this.dataValue);\n flags.noValidate = !changed;\n if (this.parent && !(this.options.server && !this.parent.parentVisible)) {\n this.parent.checkComponentConditions();\n }\n this.dataValue = value;\n // Refresh editRow data when data changes.\n this.dataValue.forEach(function (row, rowIndex) {\n var editRow = _this18.editRows[rowIndex];\n if (editRow) {\n editRow.data = row;\n _this18.restoreRowContext(editRow, flags);\n editRow.state = EditRowState.Saved;\n editRow.backup = null;\n editRow.error = null;\n } else {\n _this18.editRows[rowIndex] = {\n components: _this18.lazyLoad ? [] : _this18.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null\n };\n }\n });\n var dataLength = this.dataValue.length;\n\n // If the last row is a new row, then do not remove it.\n if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {\n dataLength = dataLength + 1;\n }\n this.editRows.slice(dataLength).forEach(function (editRow, index) {\n return _this18.baseRemoveRow(dataLength + index);\n });\n this.editRows = this.editRows.slice(0, dataLength);\n this.openWhenEmpty();\n this.updateOnChange(flags, changed);\n // do not call checkData with server option, it is called when change is triggered in updateOnChange\n if (!this.options.server) {\n this.checkData();\n }\n this.changeState(changed, flags);\n return changed;\n }\n }, {\n key: \"openWhenEmpty\",\n value: function openWhenEmpty() {\n var shouldBeOpened = !this.dataValue.length && this.component.openWhenEmpty;\n var hasNoRows = !this.editRows.length;\n if (hasNoRows && shouldBeOpened && !this.builderMode) {\n var dataObj = {};\n this.createRow(dataObj, 0);\n }\n }\n }, {\n key: \"restoreRowContext\",\n value: function restoreRowContext(editRow) {\n var _this19 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n editRow.components.forEach(function (component) {\n component.data = editRow.data;\n _this19.setNestedValue(component, editRow.data, flags);\n });\n }\n }, {\n key: \"emptyRows\",\n value: function emptyRows() {\n var _this20 = this;\n this.editRows.forEach(function (editRow, index) {\n return _this20.destroyComponents(index);\n });\n this.editRows = [];\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(EditGridComponent.prototype), \"resetValue\", this).call(this);\n this.emptyRows();\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n type: 'editgrid',\n label: 'Edit Grid',\n key: 'editGrid',\n clearOnHide: true,\n input: true,\n tree: true,\n removeRow: 'Cancel',\n defaultOpen: false,\n openWhenEmpty: false,\n modal: false,\n components: [],\n inlineEdit: false,\n templates: {\n header: EditGridComponent.defaultHeaderTemplate,\n row: EditGridComponent.defaultRowTemplate,\n tableHeader: EditGridComponent.defaultTableHeaderTemplate,\n tableRow: EditGridComponent.defaultTableRowTemplate,\n footer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Edit Grid',\n icon: 'tasks',\n group: 'data',\n documentation: '/userguide/form-building/data-components#edit-grid',\n showPreview: false,\n weight: 30,\n schema: EditGridComponent.schema()\n };\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
{{ t(component.label) }}
\\n {% } %}\\n {% }) %}\\n
\";\n }\n }, {\n key: \"defaultTableHeaderTemplate\",\n get: function get() {\n return \"\\n \\n {% util.eachComponent(components, function(component) { %}\\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\\n {{ component.label }}\\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n Actions\\n {% } %}\\n \\n \";\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
\\n {{ isVisibleInRow(component) ? getView(component, row[component.key]) : ''}}\\n
\\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n
\\n
\\n \\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\\n \\n {% } %}\\n
\\n
\\n {% } %}\\n
\";\n }\n }, {\n key: \"defaultTableRowTemplate\",\n get: function get() {\n return \"\\n {% util.eachComponent(components, function(component) { %}\\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\\n \\n {{ getView(component, row[component.key]) }}\\n \\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n \\n
\\n \\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\\n \\n {% } %}\\n
\\n \\n {% } %}\\n \";\n }\n }]);\n return EditGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = EditGridComponent;\nEditGridComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/editgrid/EditGrid.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.promise.js */ \"./node_modules/core-js/modules/es.promise.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Alert = _interopRequireDefault(__webpack_require__(/*! ../alert/Alert */ \"./lib/components/alert/Alert.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/components/editgrid/templates/index.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar EditRowState = {\n New: 'new',\n Editing: 'editing',\n Saved: 'saved',\n Viewing: 'viewing',\n Removed: 'removed',\n Draft: 'draft'\n};\nvar EditGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(EditGridComponent, _NestedArrayComponent);\n var _super = _createSuper(EditGridComponent);\n function EditGridComponent() {\n var _this;\n _classCallCheck(this, EditGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'editgrid';\n return _this;\n }\n _createClass(EditGridComponent, [{\n key: \"defaultDialogTemplate\",\n get: function get() {\n return \"\\n

\".concat(this.t('Do you want to clear data?'), \"

\\n
\\n \\n \\n
\\n \");\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableRowTemplate : EditGridComponent.defaultRowTemplate;\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableHeaderTemplate : EditGridComponent.defaultHeaderTemplate;\n }\n }, {\n key: \"rowTemplate\",\n get: function get() {\n var rowTemplate;\n if (_utils.Evaluator.noeval) {\n rowTemplate = this.displayAsTable ? _templates[\"default\"].tableRow : _templates[\"default\"].row;\n } else {\n rowTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableRow', this.defaultRowTemplate) : _lodash[\"default\"].get(this.component, 'templates.row', this.defaultRowTemplate);\n }\n return rowTemplate;\n }\n }, {\n key: \"headerTemplate\",\n get: function get() {\n var headerTemplate;\n if (_utils.Evaluator.noeval) {\n headerTemplate = this.displayAsTable ? _templates[\"default\"].tableHeader : _templates[\"default\"].header;\n } else {\n headerTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate) : _lodash[\"default\"].get(this.component, 'templates.header', this.defaultHeaderTemplate);\n }\n return headerTemplate;\n }\n\n /**\n * Returns true if the component has nested components which don't trigger changes on the root level\n */\n }, {\n key: \"hasScopedChildren\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return EditGridComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"editgridKey\",\n get: function get() {\n return \"editgrid-\".concat(this.key);\n }\n }, {\n key: \"rowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-row\");\n }\n }, {\n key: \"rowElements\",\n get: function get() {\n return this.refs[this.rowRef];\n }\n }, {\n key: \"rowRefs\",\n get: function get() {\n return this.refs[\"editgrid-\".concat(this.component.key, \"-row\")];\n }\n }, {\n key: \"addRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-addRow\");\n }\n }, {\n key: \"addRowElements\",\n get: function get() {\n return this.refs[this.addRowRef];\n }\n }, {\n key: \"saveRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-saveRow\");\n }\n }, {\n key: \"saveRowElements\",\n get: function get() {\n return this.refs[this.saveRowRef];\n }\n }, {\n key: \"cancelRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-cancelRow\");\n }\n }, {\n key: \"cancelRowElements\",\n get: function get() {\n return this.refs[this.cancelRowRef];\n }\n }, {\n key: \"inlineEditMode\",\n get: function get() {\n return this.component.inlineEdit;\n }\n }, {\n key: \"saveEditMode\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"minLength\",\n get: function get() {\n return this.builderMode ? 0 : _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n var data = this.dataValue;\n (this.editRows || []).forEach(function (row, index) {\n if (!data[index] && row.state !== EditRowState.New) {\n data[index] = {};\n }\n var rowData = data[index] || {};\n row.data = rowData;\n row.components.forEach(function (component) {\n component.data = rowData;\n });\n });\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", this) || [];\n },\n set: function set(value) {\n _set(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"displayAsTable\",\n get: function get() {\n return this.component.displayAsTable;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.editRows;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(EditGridComponent.prototype), \"defaultValue\", this);\n var defaultValue = Array.isArray(value) ? value : [];\n _lodash[\"default\"].times(this.minLength - defaultValue.length, function () {\n return defaultValue.push({});\n });\n return defaultValue;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n if (this.builderMode) {\n this.editRows = [];\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"init\", this).call(this);\n }\n this.components = this.components || [];\n var dataValue = this.dataValue;\n var openWhenEmpty = !dataValue.length && this.component.openWhenEmpty;\n if (openWhenEmpty) {\n var dataObj = {};\n this.editRows = [];\n this.createRow(dataObj, 0);\n } else {\n this.editRows = dataValue.map(function (row, rowIndex) {\n return {\n components: _this2.lazyLoad ? [] : _this2.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n });\n }\n this.prevHasAddButton = this.hasAddButton();\n this.checkData();\n this.setVariableTypeComponents();\n if (this.variableTypeComponentsIndexes.length) {\n _lodash[\"default\"].each(this.editRows || [], function (editRow, rowIndex) {\n return _this2.checkRowVariableTypeComponents(editRow, rowIndex);\n });\n }\n }\n }, {\n key: \"checkRowVariableTypeComponents\",\n value: function checkRowVariableTypeComponents(editRow, rowIndex) {\n var rowComponents = editRow.components;\n if (_lodash[\"default\"].some(this.variableTypeComponentsIndexes, function (compIndex) {\n var variableTypeComp = rowComponents[compIndex];\n return variableTypeComp.type !== variableTypeComp.component.type;\n })) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex, true);\n }\n }\n }, {\n key: \"setVariableTypeComponents\",\n value: function setVariableTypeComponents() {\n var _this3 = this;\n //set components which type is changing within a row (e.g.,by mergeComponentSchema action)\n this.variableTypeComponentsIndexes = [];\n _lodash[\"default\"].each(this.component.components, function (comp, index) {\n if (comp.typeChangeEnabled) {\n _this3.variableTypeComponentsIndexes.push(index);\n }\n });\n }\n }, {\n key: \"isOpen\",\n value: function isOpen(editRow) {\n return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);\n }\n }, {\n key: \"isComponentVisibleInSomeRow\",\n value: function isComponentVisibleInSomeRow(component) {\n var _this4 = this;\n var rows = this.editRows;\n var savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];\n var savedRows = rows.filter(function (row) {\n return _lodash[\"default\"].includes(savedStates, row.state);\n });\n this.visibleInHeader = this.visibleInHeader || [];\n var changeVisibleInHeader = function changeVisibleInHeader(component, isVisible) {\n if (!isVisible) {\n _lodash[\"default\"].remove(_this4.visibleInHeader, function (key) {\n return key === component.key;\n });\n }\n if (isVisible && !_lodash[\"default\"].includes(_this4.visibleInHeader, component.key)) {\n _this4.visibleInHeader.push(component.key);\n }\n };\n if (_lodash[\"default\"].isEmpty(rows)) {\n var rowComponents = this.createRowComponents({}, 0);\n var checkComponent;\n (0, _utils.eachComponent)(rowComponents, function (comp) {\n if (comp.component.key === component.key) {\n checkComponent = comp;\n }\n comp.checkConditions();\n });\n var isVisible = checkComponent ? checkComponent.visible : true;\n _toConsumableArray(this.components).forEach(function (comp) {\n return _this4.removeComponent(comp, _this4.components);\n });\n changeVisibleInHeader(component, isVisible);\n return isVisible;\n }\n var isOpenRowWhenEmpty = _lodash[\"default\"].get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;\n if (!_lodash[\"default\"].isEmpty(rows) && _lodash[\"default\"].isEmpty(savedRows) && !isOpenRowWhenEmpty) {\n return _lodash[\"default\"].includes(this.visibleInHeader, component.key);\n }\n return _lodash[\"default\"].some(isOpenRowWhenEmpty ? rows : savedRows, function (row, index) {\n var editingRow = row.state === EditRowState.Editing;\n var isVisible;\n if (!editingRow) {\n var flattenedComponents = _this4.flattenComponents(index);\n var instance = flattenedComponents[component.key];\n isVisible = instance ? instance.visible : true;\n changeVisibleInHeader(component, isVisible);\n } else {\n isVisible = _lodash[\"default\"].includes(_this4.visibleInHeader, component.key);\n }\n return isVisible;\n });\n }\n }, {\n key: \"render\",\n value: function render(children) {\n var _this5 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this);\n }\n var dataValue = this.dataValue;\n var headerTemplate = this.headerTemplate;\n var t = this.t.bind(this);\n var templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(templateName, {\n ref: {\n row: this.rowRef,\n addRow: this.addRowRef,\n saveRow: this.saveRowRef,\n cancelRow: this.cancelRowRef\n },\n header: this.renderString(headerTemplate, {\n displayValue: function displayValue(component) {\n return _this5.displayComponentValue(component, true);\n },\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n footer: this.renderString(_lodash[\"default\"].get(this.component, 'templates.footer'), {\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n rows: this.editRows.map(this.renderRow.bind(this)),\n openRows: this.editRows.map(function (row) {\n return _this5.isOpen(row);\n }),\n errors: this.editRows.map(function (row) {\n return row.error;\n }),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: this.hasRemoveButtons()\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n var templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';\n return this.renderTemplate(templateName, {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this6 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.addRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.saveRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.cancelRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.rowRef, 'multiple'), _this$loadRefs));\n this.addRowElements.forEach(function (addButton) {\n _this6.addEventListener(addButton, 'click', function () {\n return _this6.addRow();\n });\n });\n var openRowCount = 0;\n this.rowElements.forEach(function (row, rowIndex) {\n var editRow = _this6.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.isRowSelected) {\n row.classList.add('selected');\n }\n if (_this6.isOpen(editRow)) {\n _this6.attachComponents(row, editRow.components);\n _this6.addEventListener(_this6.saveRowElements[openRowCount], 'click', function () {\n return _this6.saveRow(rowIndex, true);\n });\n _this6.addEventListener(_this6.cancelRowElements[openRowCount], 'click', function () {\n return _this6.cancelRow(rowIndex);\n });\n openRowCount++;\n } else {\n // Attach edit and remove button events.\n [{\n className: 'removeRow',\n event: 'click',\n action: function action() {\n return _this6.removeRow(rowIndex, true);\n }\n }, {\n className: 'editRow',\n event: 'click',\n action: function action() {\n _this6.editRow(rowIndex).then(function () {\n if (_this6.component.rowDrafts) {\n var _this6$root;\n _this6.validateRow(editRow, false);\n var hasErrors = editRow.errors && !!editRow.errors.length;\n var shouldShowRowErrorsAlert = _this6.component.modal && hasErrors && ((_this6$root = _this6.root) === null || _this6$root === void 0 ? void 0 : _this6$root.submitted);\n if (shouldShowRowErrorsAlert) {\n _this6.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n });\n }\n }, {\n className: 'row',\n event: 'click',\n action: function action() {\n row.classList.toggle('selected');\n var eventName = 'editGridSelectRow';\n if (Array.from(row.classList).includes('selected')) {\n editRow.isRowSelected = true;\n } else {\n delete editRow.isRowSelected;\n eventName = 'editGridUnSelectRow';\n }\n _this6.emit(eventName, {\n component: _this6.component,\n data: _this6.dataValue[rowIndex]\n });\n }\n }].forEach(function (_ref) {\n var className = _ref.className,\n event = _ref.event,\n action = _ref.action;\n var elements = row.getElementsByClassName(className);\n Array.prototype.forEach.call(elements, function (element) {\n if (_this6.options.pdf && _lodash[\"default\"].intersection(element.classList, ['editRow', 'removeRow']).length) {\n element.style.display = 'none';\n } else {\n _this6.addEventListener(element, event, action);\n }\n });\n });\n }\n });\n\n // Add open class to the element if any edit grid row is open\n if (openRowCount) {\n this.addClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n } else {\n this.removeClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n }\n var superAttach = _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n messageContainer: 'single-scope'\n });\n return superAttach;\n }\n }, {\n key: \"flattenRowDataValue\",\n value: function flattenRowDataValue(dataValue) {\n var _this7 = this;\n var flattened = {};\n Object.keys(dataValue).forEach(function (key) {\n if (_lodash[\"default\"].isObject(dataValue[key]) && !_lodash[\"default\"].isNil(dataValue[key])) {\n Object.assign(flattened, _this7.flattenRowDataValue(dataValue[key]));\n } else {\n flattened[key] = dataValue[key];\n }\n });\n return flattened;\n }\n }, {\n key: \"isComponentVisibleInRow\",\n value: function isComponentVisibleInRow(component, flattenedComponents) {\n var instance = flattenedComponents[component.key];\n return instance ? instance.visible : true;\n }\n }, {\n key: \"displayComponentValue\",\n value: function displayComponentValue(component, header) {\n return !!((!component.hasOwnProperty('tableView') || component.tableView) && header ? this.isComponentVisibleInSomeRow(component) : _lodash[\"default\"].includes(this.visibleInHeader, component.key));\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(row, rowIndex) {\n var _this8 = this;\n var dataValue = this.dataValue;\n if (this.isOpen(row)) {\n return this.renderComponents(row.components);\n } else {\n var flattenedComponents = this.flattenComponents(rowIndex);\n var rowTemplate = this.rowTemplate;\n return this.renderString(rowTemplate, {\n row: dataValue[rowIndex] || {},\n data: this.data,\n rowIndex: rowIndex,\n components: this.component.components,\n flattenedComponents: flattenedComponents,\n displayValue: function displayValue(component) {\n return _this8.displayComponentValue(component);\n },\n isVisibleInRow: function isVisibleInRow(component) {\n return _this8.isComponentVisibleInRow(component, flattenedComponents);\n },\n getView: function getView(component, data) {\n var _instance$component, _instance$component2;\n var instance = flattenedComponents[component.key];\n var view = instance ? instance.getView(data || instance.dataValue) : '';\n\n // If there is an html tag in view, don't allow it to be injected in template\n var htmlTagRegExp = new RegExp('<(.*?)>');\n return typeof view === 'string' && view.length && !((_instance$component = instance.component) !== null && _instance$component !== void 0 && _instance$component.template) && htmlTagRegExp.test(view) && ((_instance$component2 = instance.component) === null || _instance$component2 === void 0 ? void 0 : _instance$component2.inputFormat) !== 'html' ? \"\") : view;\n },\n state: this.editRows[rowIndex].state,\n t: this.t.bind(this)\n });\n }\n }\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn, rowIndex) {\n _lodash[\"default\"].each(this.getComponents(rowIndex), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n var _this9$editRows$compo;\n var rowData = _this9.dataValue[component.rowIndex];\n var editRowData = (_this9$editRows$compo = _this9.editRows[component.rowIndex]) === null || _this9$editRows$compo === void 0 ? void 0 : _this9$editRows$compo.data;\n component.data = rowData || editRowData;\n });\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents(rowIndex) {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n }, rowIndex);\n return result;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n var _this$editRows$rowInd;\n // Ensure editrows is set.\n this.editRows = this.editRows || [];\n return this.builderMode ? _get(_getPrototypeOf(EditGridComponent.prototype), \"getComponents\", this).call(this) : _lodash[\"default\"].isNumber(rowIndex) ? ((_this$editRows$rowInd = this.editRows[rowIndex]) === null || _this$editRows$rowInd === void 0 ? void 0 : _this$editRows$rowInd.components) || [] : this.editRows.reduce(function (result, row) {\n return result.concat(row.components || []);\n }, []);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var all = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.calculatedValue = undefined;\n _get(_getPrototypeOf(EditGridComponent.prototype), \"destroy\", this).call(this, all);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this10 = this;\n var rowIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"destroyComponents\", this).call(this);\n }\n var components = this.getComponents(rowIndex).slice();\n components.forEach(function (comp) {\n return _this10.removeComponent(comp, _this10.components);\n });\n }\n }, {\n key: \"createRow\",\n value: function createRow(dataObj, rowIndex) {\n var editRow = {\n components: this.createRowComponents(dataObj, rowIndex),\n data: dataObj,\n state: EditRowState.New,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n this.editRows.push(editRow);\n if (this.inlineEditMode) {\n this.dataValue.push(dataObj);\n }\n return editRow;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n if (this.options.readOnly) {\n return;\n }\n var dataObj = {};\n var rowIndex = this.editRows.length;\n var editRow = this.createRow(dataObj, rowIndex);\n if (editRow.state === EditRowState.New) {\n this.emptyRow = (0, _utils.fastCloneDeep)(editRow.data);\n }\n if (this.inlineEditMode) {\n this.triggerChange();\n }\n this.emit('editGridAddRow', {\n component: this.component,\n row: editRow\n });\n this.checkRow('checkData', null, {}, editRow.data, editRow.components);\n if (this.component.modal) {\n this.addRowModal(rowIndex);\n } else {\n this.redraw();\n }\n return editRow;\n }\n }, {\n key: \"addRowModal\",\n value: function addRowModal(rowIndex) {\n var _this11 = this;\n var modalContent = this.ce('div');\n var editRow = this.editRows[rowIndex];\n editRow.willBeSaved = false;\n var components = editRow.components;\n modalContent.innerHTML = this.renderComponents(components);\n var dialog = this.component.modal ? this.createModal(modalContent, {}, function () {\n return _this11.showDialog(rowIndex);\n }) : undefined;\n dialog.classList.add(\"editgrid-row-modal-\".concat(this.id));\n editRow.dialog = dialog;\n if (this.alert) {\n this.alert.clear();\n this.alert = null;\n }\n this.alert = new _Alert[\"default\"](dialog.refs.dialogContents, this);\n this.addEventListener(dialog, 'close', function () {\n if (!editRow.willBeSaved) {\n if (_this11.editRows[rowIndex] && _this11.editRows[rowIndex].state !== EditRowState.New) {\n _this11.editRows[rowIndex].components.forEach(function (comp) {\n comp.setPristine(true);\n });\n }\n _this11.cancelRow(rowIndex);\n }\n if (_this11.alert) {\n _this11.alert.clear();\n _this11.alert = null;\n }\n\n // Remove references to dialog elements to prevent possible in some cases memory leaks\n delete editRow.confirmationDialog;\n delete editRow.dialog;\n });\n dialog.refs.dialogContents.appendChild(this.ce('button', {\n \"class\": 'btn btn-primary',\n onClick: function onClick() {\n // After an attempt to save, all the components inside the row should become not pristine\n if (!_this11.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n if (_this11.validateRow(editRow, true) || _this11.component.rowDrafts) {\n editRow.willBeSaved = true;\n dialog.close();\n _this11.saveRow(rowIndex, true);\n } else {\n _this11.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n }, this.component.saveRow || 'Save'));\n return this.attachComponents(modalContent, components);\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow.state === EditRowState.New ? _lodash[\"default\"].isEqual(this.emptyRow, editRow.data) : _lodash[\"default\"].isEqual(editRow.backup, editRow.data)) {\n return Promise.resolve();\n }\n var wrapper = this.ce('div', {\n ref: 'confirmationDialog'\n });\n var dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;\n wrapper.innerHTML = dialogContent;\n wrapper.refs = {};\n this.loadRefs.call(wrapper, wrapper, {\n dialogHeader: 'single',\n dialogCancelButton: 'single',\n dialogYesButton: 'single'\n });\n var dialog = this.createModal(wrapper);\n dialog.classList.add(\"editgrid-row-modal-confirmation-\".concat(this.id));\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var dialogResult;\n var promise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n dialogResult = {\n resolve: resolve,\n reject: reject\n };\n });\n this.addEventListener(wrapper.refs.dialogYesButton, 'click', function (event) {\n close(event);\n dialogResult.resolve();\n });\n this.addEventListener(wrapper.refs.dialogCancelButton, 'click', function (event) {\n close(event);\n dialogResult.reject();\n });\n editRow.confirmationDialog = dialog;\n return promise;\n }\n }, {\n key: \"editRow\",\n value: function editRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n var isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;\n if (!editRow || isAlreadyEditing) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n editRow.prevState = editRow.state;\n editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;\n if (this.lazyLoad && editRow.components.length === 0) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex);\n }\n var dataSnapshot = (0, _utils.fastCloneDeep)(editRow.data);\n if (this.inlineEditMode) {\n editRow.backup = dataSnapshot;\n } else {\n editRow.backup = (0, _utils.fastCloneDeep)(editRow.data);\n editRow.data = dataSnapshot;\n this.restoreRowContext(editRow);\n }\n if (this.component.modal) {\n return this.addRowModal(rowIndex);\n }\n return this.redraw();\n }\n }, {\n key: \"clearErrors\",\n value: function clearErrors(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow && Array.isArray(editRow.components)) {\n editRow.components.forEach(function (comp) {\n comp.setPristine(true);\n comp.setCustomValidity('');\n });\n }\n }\n }, {\n key: \"cancelRow\",\n value: function cancelRow(rowIndex) {\n if (this.options.readOnly) {\n return;\n }\n var editRow = this.editRows[rowIndex];\n switch (editRow.state) {\n case EditRowState.New:\n {\n editRow.state = EditRowState.Removed;\n this.clearErrors(rowIndex);\n this.destroyComponents(rowIndex);\n if (this.inlineEditMode) {\n this.splice(rowIndex);\n }\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n break;\n }\n case EditRowState.Editing:\n {\n editRow.state = editRow.prevState;\n if (this.inlineEditMode) {\n this.dataValue[rowIndex] = editRow.backup;\n }\n editRow.data = editRow.backup;\n editRow.backup = null;\n this.restoreRowContext(editRow);\n this.clearErrors(rowIndex);\n break;\n }\n }\n this.emit('editGridCancelRow', {\n instance: this,\n component: this.component,\n editRow: editRow\n });\n this.checkValidity(null, true);\n this.redraw();\n if (this.component.rowDrafts) {\n this.checkValidity(this.data, false);\n }\n }\n }, {\n key: \"saveRow\",\n value: function saveRow(rowIndex, modified) {\n var _this12 = this;\n var editRow = this.editRows[rowIndex];\n if (this.options.readOnly) {\n return;\n }\n\n // After an attempt to save, all the components inside the row should become not pristine\n if (!this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n var isRowValid = this.validateRow(editRow, true);\n if (!this.component.rowDrafts) {\n if (!isRowValid) {\n return false;\n }\n }\n if (this.saveEditMode) {\n var _this$root, _this$root$focusedCom;\n var dataValue = this.dataValue;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$focusedCom = _this$root.focusedComponent) !== null && _this$root$focusedCom !== void 0 && _this$root$focusedCom.component.typeChangeEnabled) {\n this.root.focusedComponent = null;\n }\n switch (editRow.state) {\n case EditRowState.New:\n {\n var newIndex = dataValue.length;\n dataValue.push(editRow.data);\n editRow.components.forEach(function (component) {\n return component.rowIndex = newIndex;\n });\n if (rowIndex !== newIndex) {\n this.editRows.splice(rowIndex, 1);\n this.editRows.splice(newIndex, 0, editRow);\n }\n break;\n }\n case EditRowState.Editing:\n {\n dataValue[rowIndex] = editRow.data;\n break;\n }\n }\n }\n editRow.state = this.component.rowDrafts && !isRowValid ? EditRowState.Draft : EditRowState.Saved;\n editRow.backup = null;\n this.updateValue();\n this.emit('editGridSaveRow', {\n component: this.component,\n row: editRow.data,\n instance: this\n });\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n if (this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(_this12.pristine);\n });\n }\n this.checkValidity(null, true);\n this.redraw();\n if (editRow.alerts) {\n editRow.alerts = false;\n }\n return true;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var relativePath = this.getRelativePath(component.path);\n var arrayPath = (0, _utils.getArrayFromComponentPath)(relativePath);\n var rowIndex = arrayPath[0];\n var rowToEditIndex = arrayPath[0];\n this.editRows.forEach(function (row, indexInArray) {\n if (row.rowIndex === rowIndex) {\n rowToEditIndex = indexInArray;\n }\n });\n if (_lodash[\"default\"].isNumber(rowToEditIndex)) {\n this.editRow(rowToEditIndex);\n }\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n components.forEach(function (component, colIndex) {\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this13 = this;\n this.editRows.slice(rowIndex).forEach(function (row, index) {\n _this13.updateComponentsRowIndex(row.components, rowIndex + index);\n });\n }\n }, {\n key: \"baseRemoveRow\",\n value: function baseRemoveRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n editRow.state = EditRowState.Removed;\n this.destroyComponents(rowIndex);\n return editRow;\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(rowIndex, modified) {\n if (this.options.readOnly) {\n return;\n }\n this.clearErrors(rowIndex);\n this.baseRemoveRow(rowIndex);\n this.removeSubmissionMetadataRow(rowIndex);\n this.splice(rowIndex);\n this.emit('editGridDeleteRow', {\n index: rowIndex\n });\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n this.updateRowsComponents(rowIndex);\n this.updateValue();\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n this.checkValidity(null, true);\n this.checkData();\n this.redraw();\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex, recreatePartially) {\n var _this14 = this;\n // Iterate through existing components and destroy the ones with the same rowIndex.\n if (this.components) {\n for (var i = 0; i < this.components.length; i++) {\n if (this.components[i].rowIndex === rowIndex) {\n this.components[i].destroy();\n this.components.splice(i, 1);\n }\n }\n }\n var currentRowComponents = _lodash[\"default\"].get(this.editRows, \"[\".concat(rowIndex, \"].components\"), null);\n return this.component.components.map(function (col, colIndex) {\n if (recreatePartially && currentRowComponents && _this14.variableTypeComponentsIndexes.length) {\n var _currentComp$componen;\n var currentComp = currentRowComponents[colIndex];\n var shouldRecreate = _lodash[\"default\"].includes(_this14.variableTypeComponentsIndexes, colIndex) && (currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== (currentComp === null || currentComp === void 0 ? void 0 : (_currentComp$componen = currentComp.component) === null || _currentComp$componen === void 0 ? void 0 : _currentComp$componen.type);\n if (!shouldRecreate) {\n return currentComp;\n }\n col = currentComp.component;\n }\n var column = _lodash[\"default\"].clone(col);\n var options = _lodash[\"default\"].clone(_this14.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n options.onChange = function () {\n var _changed$instance$roo, _this14$root;\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 ? arguments[1] : undefined;\n var modified = arguments.length > 2 ? arguments[2] : undefined;\n if ((_changed$instance$roo = changed.instance.root) !== null && _changed$instance$roo !== void 0 && _changed$instance$roo.id && ((_this14$root = _this14.root) === null || _this14$root === void 0 ? void 0 : _this14$root.id) !== changed.instance.root.id) {\n changed.instance.root.triggerChange(flags, changed, modified);\n } else if (!_this14.component.modal) {\n _this14.triggerRootChange(flags, changed, modified);\n }\n if (_this14.inlineEditMode) {\n return;\n }\n var editRow = _this14.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.alerts) {\n _this14.checkData(null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n rowIndex: rowIndex\n }), _this14.data);\n } else if (editRow) {\n // If drafts allowed, perform validation silently if there was no attempt to submit a form\n var silentCheck = _this14.component.rowDrafts && !_this14.shouldValidateDraft(editRow);\n _this14.checkRow('checkData', null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n silentCheck: silentCheck\n }), editRow.data, editRow.components, silentCheck);\n }\n if (_this14.variableTypeComponentsIndexes.length) {\n _this14.checkRowVariableTypeComponents(editRow, rowIndex);\n _this14.redraw();\n }\n };\n var comp = _this14.createComponent(_lodash[\"default\"].assign({}, column, {\n row: options.row\n }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);\n comp.rowIndex = rowIndex;\n comp.inEditGrid = true;\n return comp;\n });\n }\n }, {\n key: \"hasOpenRows\",\n value: function hasOpenRows() {\n var _this15 = this;\n return this.editRows.some(function (row) {\n return _this15.isOpen(row);\n });\n }\n }, {\n key: \"shouldValidateDraft\",\n value: function shouldValidateDraft(editRow) {\n var _this$root2, _this$root3;\n // Draft rows should be validated only when there was an attempt to submit a form\n return editRow.state === EditRowState.Draft && !this.pristine && !((_this$root2 = this.root) !== null && _this$root2 !== void 0 && _this$root2.pristine) && !this.hasOpenRows() || ((_this$root3 = this.root) === null || _this$root3 === void 0 ? void 0 : _this$root3.submitted);\n }\n }, {\n key: \"shouldValidateRow\",\n value: function shouldValidateRow(editRow, dirty) {\n return this.shouldValidateDraft(editRow) || editRow.state === EditRowState.Editing || editRow.alerts || dirty;\n }\n }, {\n key: \"validateRow\",\n value: function validateRow(editRow, dirty, forceSilentCheck) {\n var _this16 = this,\n _this$root4;\n var valid = true;\n var errorsSnapshot = _toConsumableArray(this.errors);\n if (this.shouldValidateRow(editRow, dirty)) {\n editRow.components.forEach(function (comp) {\n var silentCheck = _this16.component.rowDrafts && !_this16.shouldValidateDraft(editRow) || forceSilentCheck;\n valid &= comp.checkValidity(null, dirty, null, silentCheck);\n });\n }\n if (this.component.validate && this.component.validate.row) {\n valid = this.evaluate(this.component.validate.row, {\n valid: valid,\n row: editRow.data\n }, 'valid', true);\n if (valid.toString() !== 'true') {\n editRow.error = valid;\n valid = false;\n } else {\n editRow.error = null;\n }\n if (valid === null) {\n valid = \"Invalid row validation for \".concat(this.key);\n }\n }\n editRow.errors = !valid ? this.errors.filter(function (err) {\n return !errorsSnapshot.includes(err);\n }) : null;\n if (!this.component.rowDrafts || (_this$root4 = this.root) !== null && _this$root4 !== void 0 && _this$root4.submitted) {\n this.showRowErrorAlerts(editRow, !!valid);\n }\n return !!valid;\n }\n }, {\n key: \"showRowErrorAlerts\",\n value: function showRowErrorAlerts(editRow, valid) {\n if (editRow.alerts) {\n if (this.alert) {\n var _editRow$errors;\n if ((_editRow$errors = editRow.errors) !== null && _editRow$errors !== void 0 && _editRow$errors.length && !valid) {\n this.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n } else {\n this.alert.clear();\n }\n }\n }\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n return this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this17 = this,\n _this$errors,\n _this$root6;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var silentCheck = options.silentCheck;\n var errorsLength = this.errors.length;\n var superValid = _get(_getPrototypeOf(EditGridComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n\n // If super tells us that component invalid and there is no need to update alerts, just return false\n if (!superValid && !this.alert && !this.hasOpenRows()) {\n return false;\n }\n if (this.shouldSkipValidation(data, dirty, row)) {\n return true;\n }\n var rowsValid = true;\n var rowsEditing = false;\n this.editRows.forEach(function (editRow, index) {\n // Trigger all errors on the row.\n var rowValid = _this17.validateRow(editRow, dirty, silentCheck);\n rowsValid &= rowValid;\n if (_this17.rowRefs) {\n var rowContainer = _this17.rowRefs[index];\n if (rowContainer) {\n var errorContainer = rowContainer.querySelector('.editgrid-row-error');\n if (!rowValid && errorContainer && (!_this17.component.rowDrafts || _this17.shouldValidateDraft(editRow))) {\n _this17.addClass(errorContainer, 'help-block');\n errorContainer.textContent = _this17.t(_this17.errorMessage('invalidRowError'));\n } else if (errorContainer) {\n errorContainer.textContent = '';\n }\n }\n }\n // If this is a dirty check, and any rows are still editing, we need to throw validation error.\n rowsEditing |= dirty && _this17.isOpen(editRow);\n });\n if (!rowsValid) {\n var _this$root5;\n if (!silentCheck && (!this.component.rowDrafts || (_this$root5 = this.root) !== null && _this$root5 !== void 0 && _this$root5.submitted)) {\n this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);\n // Delete this class, because otherwise all the components inside EditGrid will has red border even if they are valid\n this.removeClass(this.element, 'has-error');\n }\n return false;\n } else if (rowsEditing && this.saveEditMode && !this.component.openWhenEmpty) {\n this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);\n return false;\n }\n var message = this.invalid || this.invalidMessage(data, dirty);\n if (((_this$errors = this.errors) === null || _this$errors === void 0 ? void 0 : _this$errors.length) !== errorsLength && (_this$root6 = this.root) !== null && _this$root6 !== void 0 && _this$root6.submitted && !message) {\n this.setCustomValidity(message, dirty);\n this.root.showErrors();\n } else {\n this.setCustomValidity(message, dirty);\n }\n return superValid;\n }\n }, {\n key: \"changeState\",\n value: function changeState(changed, flags) {\n if (this.visible && (changed || flags.resetValue && this.component.modalEdit)) {\n this.rebuild();\n } else {\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this18 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n value = this.defaultValue;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n return false;\n }\n }\n var changed = this.hasChanged(value, this.dataValue);\n flags.noValidate = !changed;\n if (this.parent && !(this.options.server && !this.parent.parentVisible)) {\n this.parent.checkComponentConditions();\n }\n this.dataValue = value;\n // Refresh editRow data when data changes.\n this.dataValue.forEach(function (row, rowIndex) {\n var editRow = _this18.editRows[rowIndex];\n if (editRow) {\n editRow.data = row;\n _this18.restoreRowContext(editRow, flags);\n editRow.state = EditRowState.Saved;\n editRow.backup = null;\n editRow.error = null;\n } else {\n _this18.editRows[rowIndex] = {\n components: _this18.lazyLoad ? [] : _this18.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null\n };\n }\n });\n var dataLength = this.dataValue.length;\n\n // If the last row is a new row, then do not remove it.\n if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {\n dataLength = dataLength + 1;\n }\n this.editRows.slice(dataLength).forEach(function (editRow, index) {\n return _this18.baseRemoveRow(dataLength + index);\n });\n this.editRows = this.editRows.slice(0, dataLength);\n this.openWhenEmpty();\n this.updateOnChange(flags, changed);\n // do not call checkData with server option, it is called when change is triggered in updateOnChange\n if (!this.options.server) {\n this.checkData();\n }\n this.changeState(changed, flags);\n return changed;\n }\n }, {\n key: \"openWhenEmpty\",\n value: function openWhenEmpty() {\n var shouldBeOpened = !this.dataValue.length && this.component.openWhenEmpty;\n var hasNoRows = !this.editRows.length;\n if (hasNoRows && shouldBeOpened && !this.builderMode) {\n var dataObj = {};\n this.createRow(dataObj, 0);\n }\n }\n }, {\n key: \"restoreRowContext\",\n value: function restoreRowContext(editRow) {\n var _this19 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n editRow.components.forEach(function (component) {\n component.data = editRow.data;\n _this19.setNestedValue(component, editRow.data, flags);\n });\n }\n }, {\n key: \"emptyRows\",\n value: function emptyRows() {\n var _this20 = this;\n this.editRows.forEach(function (editRow, index) {\n return _this20.destroyComponents(index);\n });\n this.editRows = [];\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(EditGridComponent.prototype), \"resetValue\", this).call(this);\n this.emptyRows();\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n type: 'editgrid',\n label: 'Edit Grid',\n key: 'editGrid',\n clearOnHide: true,\n input: true,\n tree: true,\n removeRow: 'Cancel',\n defaultOpen: false,\n openWhenEmpty: false,\n modal: false,\n components: [],\n inlineEdit: false,\n templates: {\n header: EditGridComponent.defaultHeaderTemplate,\n row: EditGridComponent.defaultRowTemplate,\n tableHeader: EditGridComponent.defaultTableHeaderTemplate,\n tableRow: EditGridComponent.defaultTableRowTemplate,\n footer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Edit Grid',\n icon: 'tasks',\n group: 'data',\n documentation: '/userguide/form-building/data-components#edit-grid',\n showPreview: false,\n weight: 30,\n schema: EditGridComponent.schema()\n };\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
{{ t(component.label) }}
\\n {% } %}\\n {% }) %}\\n
\";\n }\n }, {\n key: \"defaultTableHeaderTemplate\",\n get: function get() {\n return \"\\n \\n {% util.eachComponent(components, function(component) { %}\\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\\n {{ component.label }}\\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n Actions\\n {% } %}\\n \\n \";\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
\\n {{ isVisibleInRow(component) ? getView(component, row[component.key]) : ''}}\\n
\\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n
\\n
\\n \\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\\n \\n {% } %}\\n
\\n
\\n {% } %}\\n
\";\n }\n }, {\n key: \"defaultTableRowTemplate\",\n get: function get() {\n return \"\\n {% util.eachComponent(components, function(component) { %}\\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\\n \\n {{ getView(component, row[component.key]) }}\\n \\n {% } %}\\n {% }) %}\\n {% if (!instance.options.readOnly && !instance.disabled) { %}\\n \\n
\\n \\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\\n \\n {% } %}\\n
\\n \\n {% } %}\\n \";\n }\n }]);\n return EditGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = EditGridComponent;\nEditGridComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/editgrid/EditGrid.js?"); /***/ }), @@ -1520,7 +1520,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../form/Form */ \"./lib/components/form/Form.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar PanelComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(PanelComponent, _NestedComponent);\n var _super = _createSuper(PanelComponent);\n function PanelComponent() {\n var _this;\n _classCallCheck(this, PanelComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.noField = true;\n _this.on('componentError', function () {\n //change collapsed value only when the panel is collapsed to avoid additional redrawing that prevents validation messages\n if ((0, _utils.hasInvalidComponent)(_assertThisInitialized(_this)) && _this.collapsed) {\n _this.collapsed = false;\n }\n });\n return _this;\n }\n _createClass(PanelComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return PanelComponent.schema();\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'panel';\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n var _this$root;\n if (((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.parent) instanceof _Form[\"default\"]) {\n path = path.replace(this._parentPath, '');\n }\n return _get(_getPrototypeOf(PanelComponent.prototype), \"getComponent\", this).call(this, path, fn, originalPath);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Panel',\n type: 'panel',\n key: 'panel',\n title: 'Panel',\n theme: 'default',\n breadcrumb: 'default',\n components: [],\n clearOnHide: false,\n input: false,\n tableView: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Panel',\n icon: 'list-alt',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#panel',\n weight: 30,\n schema: PanelComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }]);\n return PanelComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = PanelComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/panel/Panel.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../form/Form */ \"./lib/components/form/Form.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar PanelComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(PanelComponent, _NestedComponent);\n var _super = _createSuper(PanelComponent);\n function PanelComponent() {\n var _this;\n _classCallCheck(this, PanelComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.noField = true;\n _this.on('componentError', function () {\n //change collapsed value only when the panel is collapsed to avoid additional redrawing that prevents validation messages\n if ((0, _utils.hasInvalidComponent)(_assertThisInitialized(_this)) && _this.collapsed) {\n _this.collapsed = false;\n }\n });\n return _this;\n }\n _createClass(PanelComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return PanelComponent.schema();\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'panel';\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n var _this$root;\n if (((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.parent) instanceof _Form[\"default\"]) {\n if (_lodash[\"default\"].isUndefined(originalPath)) {\n originalPath = path;\n }\n path = path.replace(this._parentPath, '');\n }\n return _get(_getPrototypeOf(PanelComponent.prototype), \"getComponent\", this).call(this, path, fn, originalPath);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Panel',\n type: 'panel',\n key: 'panel',\n title: 'Panel',\n theme: 'default',\n breadcrumb: 'default',\n components: [],\n clearOnHide: false,\n input: false,\n tableView: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Panel',\n icon: 'list-alt',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#panel',\n weight: 30,\n schema: PanelComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }]);\n return PanelComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = PanelComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/panel/Panel.js?"); /***/ }), @@ -1652,7 +1652,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar RadioComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(RadioComponent, _ListComponent);\n var _super = _createSuper(RadioComponent);\n function RadioComponent(component, options, data) {\n var _this;\n _classCallCheck(this, RadioComponent);\n _this = _super.call(this, component, options, data);\n _this.previousValue = _this.dataValue || null;\n return _this;\n }\n _createClass(RadioComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return RadioComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(RadioComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var _this$root;\n var info = _get(_getPrototypeOf(RadioComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr[\"class\"] = 'form-check-input';\n info.attr.name = info.attr.name += \"[\".concat((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.id, \"-\").concat(this.id, \"]\");\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"isRadio\",\n get: function get() {\n return this.component.inputType === 'radio';\n }\n }, {\n key: \"optionSelectedClass\",\n get: function get() {\n return 'radio-selected';\n }\n }, {\n key: \"listData\",\n get: function get() {\n var listData = _lodash[\"default\"].get(this.root, 'submission.metadata.listData', {});\n return _lodash[\"default\"].get(listData, this.path);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n _get(_getPrototypeOf(RadioComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems', 'availableValueProperty']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this2.updateItems.apply(_this2, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this2.itemsLoadedResolve === 'function') {\n _this2.itemsLoadedResolve();\n }\n _this2.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = false;\n this.loadedOptions = [];\n\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(RadioComponent.prototype), \"render\", this).call(this, this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n this.loadRefs(element, {\n input: 'multiple',\n wrapper: 'multiple'\n });\n this.refs.input.forEach(function (input, index) {\n _this3.addEventListener(input, _this3.inputInfo.changeEvent, function () {\n _this3.updateValue(null, {\n modified: true\n });\n });\n if (_this3.component.values[index]) {\n _this3.addShortcut(input, _this3.component.values[index].shortcut);\n }\n if (_this3.isRadio) {\n var dataValue = _this3.dataValue;\n if (!_lodash[\"default\"].isString(_this3.dataValue)) {\n dataValue = _lodash[\"default\"].toString(_this3.dataValue);\n }\n if (_this3.isSelectURL && _lodash[\"default\"].isObject(_this3.loadedOptions[index].value)) {\n var optionValue = _this3.component.dataType === 'string' ? JSON.stringify(_this3.loadedOptions[index].value) : _this3.loadedOptions[index].value;\n input.checked = _lodash[\"default\"].isEqual(optionValue, _this3.dataValue);\n } else {\n input.checked = dataValue === input.value && (input.value || _this3.component.dataSrc !== 'url');\n }\n _this3.addEventListener(input, 'keyup', function (event) {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n _this3.updateValue(null, {\n modified: true\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return _get(_getPrototypeOf(RadioComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n var _this4 = this;\n if (element && this.refs.input) {\n this.refs.input.forEach(function (input, index) {\n if (_this4.component.values[index]) {\n _this4.removeShortcut(input, _this4.component.values[index].shortcut);\n }\n });\n }\n _get(_getPrototypeOf(RadioComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this5 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = this.dataValue;\n this.refs.input.forEach(function (input, index) {\n if (input.checked) {\n value = _this5.isSelectURL && _lodash[\"default\"].isObject(_this5.loadedOptions[index].value) ? _this5.loadedOptions[index].value : input.value;\n }\n });\n return value;\n }\n }, {\n key: \"validateValueProperty\",\n value: function validateValueProperty() {\n var _this6 = this;\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !_lodash[\"default\"].some(this.refs.wrapper, function (wrapper, index) {\n return _this6.refs.input[index].checked && _this6.loadedOptions[index].invalid;\n });\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this7 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n if (values) {\n return values.findIndex(function (_ref) {\n var optionValue = _ref.value;\n return _this7.normalizeValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isObject(value)) {\n value = JSON.stringify(value);\n } else if (!_lodash[\"default\"].isString(value)) {\n value = _lodash[\"default\"].toString(value);\n }\n if (this.component.dataSrc !== 'values') {\n return value;\n }\n var option = _lodash[\"default\"].find(this.component.values, function (v) {\n return v.value === value;\n });\n if (!value) {\n return _lodash[\"default\"].get(option, 'label', '');\n }\n return _lodash[\"default\"].get(option, 'label', '');\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n var inputValue = this.refs.input[index].value;\n this.refs.input[index].checked = inputValue === value.toString();\n }\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this8 = this;\n if (this.optionsLoaded) {\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n return;\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this8.loading = false;\n _this8.error = null;\n _this8.setItems(response);\n _this8.optionsLoaded = true;\n _this8.redraw();\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n }\n }, {\n key: \"loadItemsFromMetadata\",\n value: function loadItemsFromMetadata() {\n var _this9 = this;\n this.listData.forEach(function (item, i) {\n _this9.loadedOptions[i] = {\n label: _this9.itemTemplate(item)\n };\n if (_lodash[\"default\"].isEqual(item, _this9.selectData || _lodash[\"default\"].pick(_this9.dataValue, _lodash[\"default\"].keys(item)))) {\n _this9.loadedOptions[i].value = _this9.dataValue;\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n }, {\n key: \"setItems\",\n value: function setItems(items) {\n var _this10 = this;\n var listData = [];\n items === null || items === void 0 ? void 0 : items.forEach(function (item, i) {\n _this10.loadedOptions[i] = {\n value: _this10.component.valueProperty ? item[_this10.component.valueProperty] : item,\n label: _this10.component.valueProperty ? _this10.itemTemplate(item, item[_this10.component.valueProperty]) : _this10.itemTemplate(item, item, i)\n };\n listData.push(_this10.templateData[_this10.component.valueProperty ? item[_this10.component.valueProperty] : i]);\n if ((_this10.component.valueProperty || !_this10.isRadio) && (_lodash[\"default\"].isUndefined(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isObject(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isBoolean(item[_this10.component.valueProperty]))) {\n _this10.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n _lodash[\"default\"].set(submission.metadata.listData, this.path, listData);\n }\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this11 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n this.refs.wrapper.forEach(function (wrapper, index) {\n var input = _this11.refs.input[index];\n var checked = input.type === 'checkbox' ? value[input.value] : input.value.toString() === value.toString();\n if (checked) {\n //add class to container when selected\n _this11.addClass(wrapper, _this11.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else {\n _this11.removeClass(wrapper, _this11.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n var changed = _get(_getPrototypeOf(RadioComponent.prototype), \"updateValue\", this).call(this, value, flags);\n if (changed) {\n this.setSelectedClasses();\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n var shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var dataType = this.component.dataType || 'auto';\n if (value === this.emptyValue) {\n return value;\n }\n switch (dataType) {\n case 'auto':\n if (!isNaN(parseFloat(value)) && isFinite(value) && _lodash[\"default\"].toString(value) === Number(value).toString()) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n break;\n case 'number':\n value = +value;\n break;\n case 'string':\n if (_typeof(value) === 'object') {\n value = JSON.stringify(value);\n } else {\n value = String(value);\n }\n break;\n case 'boolean':\n value = !(!value || value.toString() === 'false');\n break;\n }\n if (this.isSelectURL && this.templateData && this.templateData[value]) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, this.templateData[value]);\n }\n return _get(_getPrototypeOf(RadioComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{\n label: '',\n value: ''\n }],\n data: {\n url: ''\n },\n fieldSet: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(RadioComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: function custom() {\n return classComp.values;\n }\n }\n };\n }\n });\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(RadioComponent), \"serverConditionSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: \"values = \".concat(classComp && classComp.values ? JSON.stringify(classComp.values) : [])\n }\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar RadioComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(RadioComponent, _ListComponent);\n var _super = _createSuper(RadioComponent);\n function RadioComponent(component, options, data) {\n var _this;\n _classCallCheck(this, RadioComponent);\n _this = _super.call(this, component, options, data);\n _this.previousValue = _this.dataValue || null;\n return _this;\n }\n _createClass(RadioComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return RadioComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(RadioComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var _this$root;\n var info = _get(_getPrototypeOf(RadioComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr[\"class\"] = 'form-check-input';\n info.attr.name = info.attr.name += \"[\".concat((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.id, \"-\").concat(this.id, \"]\");\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"isRadio\",\n get: function get() {\n return this.component.inputType === 'radio';\n }\n }, {\n key: \"optionSelectedClass\",\n get: function get() {\n return 'radio-selected';\n }\n }, {\n key: \"listData\",\n get: function get() {\n var listData = _lodash[\"default\"].get(this.root, 'submission.metadata.listData', {});\n return _lodash[\"default\"].get(listData, this.path);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n _get(_getPrototypeOf(RadioComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems', 'availableValueProperty']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this2.updateItems.apply(_this2, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this2.itemsLoadedResolve === 'function') {\n _this2.itemsLoadedResolve();\n }\n _this2.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = false;\n this.loadedOptions = [];\n\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(RadioComponent.prototype), \"render\", this).call(this, this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n this.loadRefs(element, {\n input: 'multiple',\n wrapper: 'multiple'\n });\n this.refs.input.forEach(function (input, index) {\n _this3.addEventListener(input, _this3.inputInfo.changeEvent, function () {\n _this3.updateValue(null, {\n modified: true\n });\n });\n if (_this3.component.values[index]) {\n _this3.addShortcut(input, _this3.component.values[index].shortcut);\n }\n if (_this3.isRadio) {\n var dataValue = _this3.dataValue;\n if (!_lodash[\"default\"].isString(_this3.dataValue)) {\n dataValue = _lodash[\"default\"].toString(_this3.dataValue);\n }\n if (_this3.isSelectURL && _lodash[\"default\"].isObject(_this3.loadedOptions[index].value)) {\n var optionValue = _this3.component.dataType === 'string' ? JSON.stringify(_this3.loadedOptions[index].value) : _this3.loadedOptions[index].value;\n input.checked = _lodash[\"default\"].isEqual(optionValue, _this3.dataValue);\n } else {\n input.checked = dataValue === input.value && (input.value || _this3.component.dataSrc !== 'url');\n }\n _this3.addEventListener(input, 'keyup', function (event) {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n _this3.updateValue(null, {\n modified: true\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return _get(_getPrototypeOf(RadioComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n var _this4 = this;\n if (element && this.refs.input) {\n this.refs.input.forEach(function (input, index) {\n if (_this4.component.values[index]) {\n _this4.removeShortcut(input, _this4.component.values[index].shortcut);\n }\n });\n }\n _get(_getPrototypeOf(RadioComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this5 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = this.dataValue;\n this.refs.input.forEach(function (input, index) {\n if (input.checked) {\n value = _this5.isSelectURL && _lodash[\"default\"].isObject(_this5.loadedOptions[index].value) ? _this5.loadedOptions[index].value : input.value;\n }\n });\n return value;\n }\n }, {\n key: \"validateValueProperty\",\n value: function validateValueProperty() {\n var _this6 = this;\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !_lodash[\"default\"].some(this.refs.wrapper, function (wrapper, index) {\n return _this6.refs.input[index].checked && _this6.loadedOptions[index].invalid;\n });\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this7 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n if (values) {\n return values.findIndex(function (_ref) {\n var optionValue = _ref.value;\n return _this7.normalizeValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isObject(value)) {\n value = JSON.stringify(value);\n } else if (!_lodash[\"default\"].isString(value)) {\n value = _lodash[\"default\"].toString(value);\n }\n if (this.component.dataSrc !== 'values') {\n return value;\n }\n var option = _lodash[\"default\"].find(this.component.values, function (v) {\n return v.value === value;\n });\n if (!value) {\n return _lodash[\"default\"].get(option, 'label', '');\n }\n return _lodash[\"default\"].get(option, 'label', '');\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n var inputValue = this.refs.input[index].value;\n this.refs.input[index].checked = inputValue === value.toString();\n }\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this8 = this;\n if (this.optionsLoaded) {\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n return;\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this8.loading = false;\n _this8.error = null;\n _this8.setItems(response);\n _this8.optionsLoaded = true;\n _this8.redraw();\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n }\n }, {\n key: \"loadItemsFromMetadata\",\n value: function loadItemsFromMetadata() {\n var _this9 = this;\n this.listData.forEach(function (item, i) {\n _this9.loadedOptions[i] = {\n label: _this9.itemTemplate(item)\n };\n if (_lodash[\"default\"].isEqual(item, _this9.selectData || _lodash[\"default\"].pick(_this9.dataValue, _lodash[\"default\"].keys(item)))) {\n _this9.loadedOptions[i].value = _this9.dataValue;\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n }, {\n key: \"setItems\",\n value: function setItems(items) {\n var _this10 = this;\n var listData = [];\n items === null || items === void 0 ? void 0 : items.forEach(function (item, i) {\n var valueAtProperty = _lodash[\"default\"].get(item, _this10.component.valueProperty);\n _this10.loadedOptions[i] = {\n value: _this10.component.valueProperty ? valueAtProperty : item,\n label: _this10.component.valueProperty ? _this10.itemTemplate(item, valueAtProperty) : _this10.itemTemplate(item, item, i)\n };\n listData.push(_this10.templateData[_this10.component.valueProperty ? valueAtProperty : i]);\n if ((_this10.component.valueProperty || !_this10.isRadio) && (_lodash[\"default\"].isUndefined(valueAtProperty) || !_this10.isRadio && _lodash[\"default\"].isObject(valueAtProperty) || !_this10.isRadio && _lodash[\"default\"].isBoolean(valueAtProperty))) {\n _this10.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n _lodash[\"default\"].set(submission.metadata.listData, this.path, listData);\n }\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this11 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n this.refs.wrapper.forEach(function (wrapper, index) {\n var input = _this11.refs.input[index];\n var checked = input.type === 'checkbox' ? value[input.value] : input.value.toString() === value.toString();\n if (checked) {\n //add class to container when selected\n _this11.addClass(wrapper, _this11.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else {\n _this11.removeClass(wrapper, _this11.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n var changed = _get(_getPrototypeOf(RadioComponent.prototype), \"updateValue\", this).call(this, value, flags);\n if (changed) {\n this.setSelectedClasses();\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n var shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var dataType = this.component.dataType || 'auto';\n if (value === this.emptyValue) {\n return value;\n }\n switch (dataType) {\n case 'auto':\n if (!isNaN(parseFloat(value)) && isFinite(value) && _lodash[\"default\"].toString(value) === Number(value).toString()) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n break;\n case 'number':\n value = +value;\n break;\n case 'string':\n if (_typeof(value) === 'object') {\n value = JSON.stringify(value);\n } else {\n value = String(value);\n }\n break;\n case 'boolean':\n value = !(!value || value.toString() === 'false');\n break;\n }\n if (this.isSelectURL && this.templateData && this.templateData[value]) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, this.templateData[value]);\n }\n return _get(_getPrototypeOf(RadioComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{\n label: '',\n value: ''\n }],\n data: {\n url: ''\n },\n fieldSet: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(RadioComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n var isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';\n return isValuesSrc ? {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: \"values = \".concat(classComp && classComp.values ? JSON.stringify(classComp.values) : [])\n }\n } : _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'select'\n });\n }\n });\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return RadioComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.js?"); /***/ }), @@ -1707,7 +1707,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _get3 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _debounce2 = _interopRequireDefault(__webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get2() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get2 = Reflect.get.bind(); } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get2.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar ReCaptchaComponent = /*#__PURE__*/function (_Component) {\n _inherits(ReCaptchaComponent, _Component);\n var _super = _createSuper(ReCaptchaComponent);\n function ReCaptchaComponent() {\n _classCallCheck(this, ReCaptchaComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ReCaptchaComponent, [{\n key: \"render\",\n value: function render() {\n this.recaptchaResult = null;\n if (this.builderMode) {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"render\", this).call(this, 'reCAPTCHA');\n } else {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"render\", this).call(this, '', true);\n }\n }\n }, {\n key: \"createInput\",\n value: function createInput() {\n if (this.builderMode) {\n // We need to see it in builder mode.\n this.append(this.text(this.name));\n } else {\n var siteKey = (0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey');\n if (siteKey) {\n var recaptchaApiScriptUrl = \"https://www.google.com/recaptcha/api.js?render=\".concat(siteKey);\n this.recaptchaApiReady = _Formio.GlobalFormio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);\n } else {\n console.warn('There is no Site Key specified in settings in form JSON');\n }\n }\n }\n }, {\n key: \"createLabel\",\n value: function createLabel() {\n return;\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return true;\n }\n }, {\n key: \"verify\",\n value: function verify(actionName) {\n var _this = this;\n var siteKey = (0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey');\n if (!siteKey) {\n console.warn('There is no Site Key specified in settings in form JSON');\n return;\n }\n if (!this.recaptchaApiReady) {\n var recaptchaApiScriptUrl = \"https://www.google.com/recaptcha/api.js?render=\".concat((0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey'));\n this.recaptchaApiReady = _Formio.GlobalFormio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);\n }\n if (this.recaptchaApiReady) {\n this.recaptchaVerifiedPromise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this.recaptchaApiReady.then(function () {\n if (!_this.isLoading) {\n _this.isLoading = true;\n grecaptcha.ready((0, _debounce2[\"default\"])(function () {\n grecaptcha.execute(siteKey, {\n action: actionName\n }).then(function (token) {\n return _this.sendVerificationRequest(token).then(function (_ref) {\n var verificationResult = _ref.verificationResult,\n token = _ref.token;\n _this.recaptchaResult = _objectSpread(_objectSpread({}, verificationResult), {}, {\n token: token\n });\n _this.updateValue(_this.recaptchaResult);\n return resolve(verificationResult);\n });\n })[\"catch\"](function () {\n _this.isLoading = false;\n });\n }, 1000));\n }\n })[\"catch\"](function () {\n return reject();\n });\n }).then(function () {\n _this.isLoading = false;\n });\n }\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this2 = this;\n if (this.recaptchaVerifiedPromise) {\n return this.recaptchaVerifiedPromise.then(function () {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"beforeSubmit\", _this2).call(_this2);\n });\n }\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"beforeSubmit\", this).call(this);\n }\n }, {\n key: \"sendVerificationRequest\",\n value: function sendVerificationRequest(token) {\n return _Formio.GlobalFormio.makeStaticRequest(\"\".concat(_Formio.GlobalFormio.projectUrl, \"/recaptcha?recaptchaToken=\").concat(token)).then(function (verificationResult) {\n return {\n verificationResult: verificationResult,\n token: token\n };\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this3 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async;\n\n // Verification could be async only\n if (!async) {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n }\n var componentData = row[this.component.key];\n if (!componentData || !componentData.token) {\n this.setCustomValidity(this.t('reCaptchaTokenNotSpecifiedError'));\n return _nativePromiseOnly[\"default\"].resolve(false);\n }\n if (!componentData.success) {\n this.setCustomValidity(this.t('reCaptchaTokenValidationError'));\n return _nativePromiseOnly[\"default\"].resolve(false);\n }\n return this.hook('validateReCaptcha', componentData.token, function () {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }).then(function (success) {\n return success;\n })[\"catch\"](function (err) {\n _this3.setCustomValidity(_this3.t(err.message || err));\n return false;\n });\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(newValue) {\n // If a recaptcha result has already been established, then do not allow it to be reset.\n return this.recaptchaResult ? this.recaptchaResult : newValue;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n type: 'recaptcha',\n key: 'recaptcha',\n label: 'reCAPTCHA'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {};\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }]);\n return ReCaptchaComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = ReCaptchaComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/recaptcha/ReCaptcha.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _get3 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _debounce2 = _interopRequireDefault(__webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get2() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get2 = Reflect.get.bind(); } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get2.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar ReCaptchaComponent = /*#__PURE__*/function (_Component) {\n _inherits(ReCaptchaComponent, _Component);\n var _super = _createSuper(ReCaptchaComponent);\n function ReCaptchaComponent() {\n _classCallCheck(this, ReCaptchaComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ReCaptchaComponent, [{\n key: \"render\",\n value: function render() {\n this.recaptchaResult = null;\n if (this.builderMode) {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"render\", this).call(this, 'reCAPTCHA');\n } else {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"render\", this).call(this, '', true);\n }\n }\n }, {\n key: \"createInput\",\n value: function createInput() {\n if (this.builderMode) {\n // We need to see it in builder mode.\n this.append(this.text(this.name));\n } else {\n var siteKey = (0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey');\n if (siteKey) {\n var recaptchaApiScriptUrl = \"https://www.google.com/recaptcha/api.js?render=\".concat(siteKey);\n this.recaptchaApiReady = _Formio.GlobalFormio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);\n } else {\n console.warn('There is no Site Key specified in settings in form JSON');\n }\n }\n }\n }, {\n key: \"createLabel\",\n value: function createLabel() {\n return;\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return true;\n }\n }, {\n key: \"verify\",\n value: function verify(actionName) {\n var _this = this;\n var siteKey = (0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey');\n if (!siteKey) {\n console.warn('There is no Site Key specified in settings in form JSON');\n return;\n }\n if (!this.recaptchaApiReady) {\n var recaptchaApiScriptUrl = \"https://www.google.com/recaptcha/api.js?render=\".concat((0, _get3[\"default\"])(this.root.form, 'settings.recaptcha.siteKey'));\n this.recaptchaApiReady = _Formio.GlobalFormio.requireLibrary('googleRecaptcha', 'grecaptcha', recaptchaApiScriptUrl, true);\n }\n if (this.recaptchaApiReady) {\n this.recaptchaVerifiedPromise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this.recaptchaApiReady.then(function () {\n if (!_this.isLoading) {\n _this.isLoading = true;\n grecaptcha.ready((0, _debounce2[\"default\"])(function () {\n grecaptcha.execute(siteKey, {\n action: actionName\n }).then(function (token) {\n return _this.sendVerificationRequest(token).then(function (_ref) {\n var verificationResult = _ref.verificationResult,\n token = _ref.token;\n _this.recaptchaResult = _objectSpread(_objectSpread({}, verificationResult), {}, {\n token: token\n });\n _this.updateValue(_this.recaptchaResult);\n return resolve(verificationResult);\n });\n })[\"catch\"](function () {\n _this.isLoading = false;\n });\n }, 1000));\n }\n })[\"catch\"](function () {\n return reject();\n });\n }).then(function () {\n _this.isLoading = false;\n });\n }\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this2 = this;\n if (this.recaptchaVerifiedPromise) {\n return this.recaptchaVerifiedPromise.then(function () {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"beforeSubmit\", _this2).call(_this2);\n });\n }\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"beforeSubmit\", this).call(this);\n }\n }, {\n key: \"sendVerificationRequest\",\n value: function sendVerificationRequest(token) {\n return _Formio.GlobalFormio.makeStaticRequest(\"\".concat(_Formio.GlobalFormio.projectUrl, \"/recaptcha?recaptchaToken=\").concat(token)).then(function (verificationResult) {\n return {\n verificationResult: verificationResult,\n token: token\n };\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this3 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async;\n\n // Verification could be async only\n if (!async) {\n return _get2(_getPrototypeOf(ReCaptchaComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n }\n var componentData = row[this.component.key];\n if (!componentData || !componentData.token) {\n this.setCustomValidity(this.t('reCaptchaTokenNotSpecifiedError'));\n return _nativePromiseOnly[\"default\"].resolve(false);\n }\n if (!componentData.success) {\n this.setCustomValidity(this.t('reCaptchaTokenValidationError'));\n return _nativePromiseOnly[\"default\"].resolve(false);\n }\n return this.hook('validateReCaptcha', componentData.token, function () {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }).then(function (success) {\n return success;\n })[\"catch\"](function (err) {\n _this3.setCustomValidity(_this3.t(err.message || err));\n return false;\n });\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(newValue) {\n // If a recaptcha result has already been established, then do not allow it to be reset.\n return this.recaptchaResult ? this.recaptchaResult : newValue;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n type: 'recaptcha',\n key: 'recaptcha',\n label: 'reCAPTCHA'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {};\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get2(_getPrototypeOf(ReCaptchaComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isEmpty', 'isNotEmpty']\n });\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return ReCaptchaComponent.conditionOperatorsSettings;\n }\n }]);\n return ReCaptchaComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = ReCaptchaComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/recaptcha/ReCaptcha.js?"); /***/ }), @@ -1828,7 +1828,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ../radio/Radio */ \"./lib/components/radio/Radio.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar SelectBoxesComponent = /*#__PURE__*/function (_RadioComponent) {\n _inherits(SelectBoxesComponent, _RadioComponent);\n var _super = _createSuper(SelectBoxesComponent);\n function SelectBoxesComponent() {\n var _this;\n _classCallCheck(this, SelectBoxesComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.validators = _this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');\n return _this;\n }\n _createClass(SelectBoxesComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"init\", this).call(this);\n this.component.inputType = 'checkbox';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectBoxesComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"elementInfo\", this).call(this);\n info.attr.name += '[]';\n info.attr.type = 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.values.reduce(function (prev, value) {\n if (value.value) {\n prev[value.value] = false;\n }\n return prev;\n }, {});\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = this.emptyValue;\n if (!_lodash[\"default\"].isEmpty(this.component.defaultValue)) {\n defaultValue = this.component.defaultValue;\n }\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n\n /**\n * Only empty if the values are all false.\n *\n * @param value\n * @return {boolean}\n */\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var empty = true;\n for (var key in value) {\n if (value.hasOwnProperty(key) && value[key]) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.refs.input, function (input) {\n value[input.value] = !!input.checked;\n });\n return value;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this2 = this;\n value = value || {};\n if (_typeof(value) !== 'object') {\n if (typeof value === 'string') {\n value = _defineProperty({}, value, true);\n } else {\n value = {};\n }\n }\n if (Array.isArray(value)) {\n _lodash[\"default\"].each(value, function (val) {\n value[val] = true;\n });\n }\n var checkedValues = _lodash[\"default\"].keys(_lodash[\"default\"].pickBy(value, function (val) {\n return val;\n }));\n if (this.isSelectURL && this.templateData && _lodash[\"default\"].every(checkedValues, function (val) {\n return _this2.templateData[val];\n })) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n var selectData = [];\n checkedValues.forEach(function (value) {\n return selectData.push(_this2.templateData[value]);\n });\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, selectData);\n }\n return value;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (this.isHtmlRenderMode()) {\n if (changed) {\n this.redraw();\n }\n } else {\n _lodash[\"default\"].each(this.refs.input, function (input) {\n if (_lodash[\"default\"].isUndefined(value[input.value])) {\n value[input.value] = false;\n }\n input.checked = !!value[input.value];\n });\n }\n return changed;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n if (this.isSelectURL) {\n return (0, _lodash[\"default\"])(value).pickBy(function (val) {\n return val;\n }).keys().join(', ');\n }\n return (0, _lodash[\"default\"])(this.component.values || []).filter(function (v) {\n return value[v.value];\n }).map('label').join(', ');\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this3 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n var valuesKeys = Object.keys(value);\n this.refs.wrapper.forEach(function (wrapper, index) {\n var key = valuesKeys[index];\n var input = _this3.refs.input[index];\n if ((input === null || input === void 0 ? void 0 : input.value.toString()) !== key) {\n key = valuesKeys.find(function (k) {\n return (input === null || input === void 0 ? void 0 : input.value.toString()) === k;\n });\n }\n var isChecked = value[key];\n if (isChecked && key || _this3.isSelectURL && !_this3.shouldLoad && _this3.listData && _lodash[\"default\"].findIndex(_this3.selectData, _this3.listData[index]) !== -1) {\n //add class to container when selected\n _this3.addClass(wrapper, _this3.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else if (!isChecked && key) {\n _this3.removeClass(wrapper, _this3.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"setInputsDisabled\",\n value: function setInputsDisabled(value, onlyUnchecked) {\n if (this.refs.input) {\n this.refs.input.forEach(function (item) {\n if (onlyUnchecked && !item.checked || !onlyUnchecked) {\n item.disabled = value;\n }\n });\n }\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, rowData, options) {\n var _this4 = this;\n var minCount = this.component.validate.minSelectedCount;\n var maxCount = this.component.validate.maxSelectedCount;\n var isValid = this.isValid(data, dirty);\n if ((maxCount || minCount) && !this.shouldSkipValidation(data, dirty, rowData)) {\n var count = Object.keys(this.validationValue).reduce(function (total, key) {\n if (_this4.validationValue[key]) {\n total++;\n }\n return total;\n }, 0);\n\n // Disable the rest of inputs if the max amount is already checked\n if (maxCount && count >= maxCount) {\n this.setInputsDisabled(true, true);\n } else if (maxCount && !this.shouldDisabled) {\n this.setInputsDisabled(false);\n }\n if (!isValid && maxCount && count > maxCount) {\n var message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', {\n maxCount: maxCount\n });\n this.setCustomValidity(message, dirty);\n return false;\n } else if (!isValid && minCount && count < minCount) {\n this.setInputsDisabled(false);\n var _message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', {\n minCount: minCount\n });\n this.setCustomValidity(_message, dirty);\n return false;\n }\n }\n return _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, rowData, options);\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n var availableValueKeys = (values || []).map(function (_ref) {\n var optionValue = _ref.value;\n return optionValue;\n });\n var valueKeys = Object.keys(value);\n return valueKeys.every(function (key) {\n return availableValueKeys.includes(key);\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _Radio[\"default\"].schema.apply(_Radio[\"default\"], [{\n type: 'selectboxes',\n label: 'Select Boxes',\n key: 'selectBoxes',\n inline: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select Boxes',\n group: 'basic',\n icon: 'plus-square',\n weight: 60,\n documentation: '/userguide/form-building/form-components#select-box',\n schema: SelectBoxesComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return SelectBoxesComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectBoxesComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n valueType: 'string',\n data: {\n custom: \"values = \".concat(classComp && classComp.values ? JSON.stringify(classComp.values) : [])\n }\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.object];\n }\n }]);\n return SelectBoxesComponent;\n}(_Radio[\"default\"]);\nexports[\"default\"] = SelectBoxesComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/selectboxes/SelectBoxes.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ../radio/Radio */ \"./lib/components/radio/Radio.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar SelectBoxesComponent = /*#__PURE__*/function (_RadioComponent) {\n _inherits(SelectBoxesComponent, _RadioComponent);\n var _super = _createSuper(SelectBoxesComponent);\n function SelectBoxesComponent() {\n var _this;\n _classCallCheck(this, SelectBoxesComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.validators = _this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');\n return _this;\n }\n _createClass(SelectBoxesComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"init\", this).call(this);\n this.component.inputType = 'checkbox';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectBoxesComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"elementInfo\", this).call(this);\n info.attr.name += '[]';\n info.attr.type = 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.values.reduce(function (prev, value) {\n if (value.value) {\n prev[value.value] = false;\n }\n return prev;\n }, {});\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = this.emptyValue;\n if (!_lodash[\"default\"].isEmpty(this.component.defaultValue)) {\n defaultValue = this.component.defaultValue;\n }\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n\n /**\n * Only empty if the values are all false.\n *\n * @param value\n * @return {boolean}\n */\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var empty = true;\n for (var key in value) {\n if (value.hasOwnProperty(key) && value[key]) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.refs.input, function (input) {\n value[input.value] = !!input.checked;\n });\n return value;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this2 = this;\n value = value || {};\n if (_typeof(value) !== 'object') {\n if (typeof value === 'string') {\n value = _defineProperty({}, value, true);\n } else {\n value = {};\n }\n }\n if (Array.isArray(value)) {\n _lodash[\"default\"].each(value, function (val) {\n value[val] = true;\n });\n }\n var checkedValues = _lodash[\"default\"].keys(_lodash[\"default\"].pickBy(value, function (val) {\n return val;\n }));\n if (this.isSelectURL && this.templateData && _lodash[\"default\"].every(checkedValues, function (val) {\n return _this2.templateData[val];\n })) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n var selectData = [];\n checkedValues.forEach(function (value) {\n return selectData.push(_this2.templateData[value]);\n });\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, selectData);\n }\n return value;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (this.isHtmlRenderMode()) {\n if (changed) {\n this.redraw();\n }\n } else {\n _lodash[\"default\"].each(this.refs.input, function (input) {\n if (_lodash[\"default\"].isUndefined(value[input.value])) {\n value[input.value] = false;\n }\n input.checked = !!value[input.value];\n });\n }\n return changed;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n if (this.isSelectURL) {\n return (0, _lodash[\"default\"])(value).pickBy(function (val) {\n return val;\n }).keys().join(', ');\n }\n return (0, _lodash[\"default\"])(this.component.values || []).filter(function (v) {\n return value[v.value];\n }).map('label').join(', ');\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this3 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n var valuesKeys = Object.keys(value);\n this.refs.wrapper.forEach(function (wrapper, index) {\n var key = valuesKeys[index];\n var input = _this3.refs.input[index];\n if ((input === null || input === void 0 ? void 0 : input.value.toString()) !== key) {\n key = valuesKeys.find(function (k) {\n return (input === null || input === void 0 ? void 0 : input.value.toString()) === k;\n });\n }\n var isChecked = value[key];\n if (isChecked && key || _this3.isSelectURL && !_this3.shouldLoad && _this3.listData && _lodash[\"default\"].findIndex(_this3.selectData, _this3.listData[index]) !== -1) {\n //add class to container when selected\n _this3.addClass(wrapper, _this3.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else if (!isChecked && key) {\n _this3.removeClass(wrapper, _this3.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"setInputsDisabled\",\n value: function setInputsDisabled(value, onlyUnchecked) {\n if (this.refs.input) {\n this.refs.input.forEach(function (item) {\n if (onlyUnchecked && !item.checked || !onlyUnchecked) {\n item.disabled = value;\n }\n });\n }\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, rowData, options) {\n var _this4 = this;\n var minCount = this.component.validate.minSelectedCount;\n var maxCount = this.component.validate.maxSelectedCount;\n var isValid = this.isValid(data, dirty);\n if ((maxCount || minCount) && !this.shouldSkipValidation(data, dirty, rowData)) {\n var count = Object.keys(this.validationValue).reduce(function (total, key) {\n if (_this4.validationValue[key]) {\n total++;\n }\n return total;\n }, 0);\n\n // Disable the rest of inputs if the max amount is already checked\n if (maxCount && count >= maxCount) {\n this.setInputsDisabled(true, true);\n } else if (maxCount && !this.shouldDisabled) {\n this.setInputsDisabled(false);\n }\n if (!isValid && maxCount && count > maxCount) {\n var message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', {\n maxCount: maxCount\n });\n this.setCustomValidity(message, dirty);\n return false;\n } else if (!isValid && minCount && count < minCount) {\n this.setInputsDisabled(false);\n var _message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', {\n minCount: minCount\n });\n this.setCustomValidity(_message, dirty);\n return false;\n }\n }\n return _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, rowData, options);\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n var availableValueKeys = (values || []).map(function (_ref) {\n var optionValue = _ref.value;\n return optionValue;\n });\n var valueKeys = Object.keys(value);\n return valueKeys.every(function (key) {\n return availableValueKeys.includes(key);\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _Radio[\"default\"].schema.apply(_Radio[\"default\"], [{\n type: 'selectboxes',\n label: 'Select Boxes',\n key: 'selectBoxes',\n inline: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select Boxes',\n group: 'basic',\n icon: 'plus-square',\n weight: 60,\n documentation: '/userguide/form-building/form-components#select-box',\n schema: SelectBoxesComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return SelectBoxesComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectBoxesComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n var isValuesSrc = !classComp.dataSrc || classComp.dataSrc === 'values';\n return isValuesSrc ? {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: 'string',\n data: {\n custom: \"values = \".concat(classComp && classComp.values ? JSON.stringify(classComp.values) : [])\n }\n } : _objectSpread(_objectSpread({}, classComp), {}, {\n dataType: 'string',\n type: 'select'\n });\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n return (0, _utils.getComponentSavedTypes)(schema) || [_utils.componentValueTypes.object];\n }\n }]);\n return SelectBoxesComponent;\n}(_Radio[\"default\"]);\nexports[\"default\"] = SelectBoxesComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/selectboxes/SelectBoxes.js?"); /***/ }), @@ -2158,7 +2158,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _default;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component.form */ \"./lib/components/_classes/component/Component.form.js\"));\nvar _TimeEdit = _interopRequireDefault(__webpack_require__(/*! ./editForm/Time.edit.data */ \"./lib/components/time/editForm/Time.edit.data.js\"));\nvar _TimeEdit2 = _interopRequireDefault(__webpack_require__(/*! ./editForm/Time.edit.display */ \"./lib/components/time/editForm/Time.edit.display.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _default() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component[\"default\"].apply(void 0, [[{\n key: 'data',\n components: _TimeEdit[\"default\"]\n }, {\n key: 'display',\n components: _TimeEdit2[\"default\"]\n }]].concat(extend));\n}\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.form.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _default;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../Components */ \"./lib/components/Components.js\"));\nvar _TimeEdit = _interopRequireDefault(__webpack_require__(/*! ./editForm/Time.edit.data */ \"./lib/components/time/editForm/Time.edit.data.js\"));\nvar _TimeEdit2 = _interopRequireDefault(__webpack_require__(/*! ./editForm/Time.edit.display */ \"./lib/components/time/editForm/Time.edit.display.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _default() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Components[\"default\"].baseEditForm.apply(_Components[\"default\"], [[{\n key: 'data',\n components: _TimeEdit[\"default\"]\n }, {\n key: 'display',\n components: _TimeEdit2[\"default\"]\n }]].concat(extend));\n}\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.form.js?"); /***/ }), @@ -2169,7 +2169,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar defaultDataFormat = 'HH:mm:ss';\nvar TimeComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(TimeComponent, _TextFieldComponent);\n var _super = _createSuper(TimeComponent);\n function TimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, TimeComponent);\n _this = _super.call(this, component, options, data);\n var _getBrowserInfo = (0, _utils.getBrowserInfo)(),\n isEdgeBrowser = _getBrowserInfo.edge,\n edgeVersion = _getBrowserInfo.version;\n _this.component.inputMask = _this.getInputMaskFromFormat(_this.component.format);\n _this.component.inputType = isEdgeBrowser && edgeVersion <= 18 ? 'text' : _this.component.inputType || 'time';\n _this.rawData = _this.component.multiple ? [] : _this.emptyValue;\n return _this;\n }\n _createClass(TimeComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TimeComponent.prototype), \"init\", this).call(this);\n if (this.component.inputType === 'text') {\n this.validators.push('time');\n }\n }\n }, {\n key: \"dataFormat\",\n get: function get() {\n return this.component.dataFormat || defaultDataFormat;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this2 = this;\n var value = _get(_getPrototypeOf(TimeComponent.prototype), \"defaultValue\", this);\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (item) {\n return item ? _this2.getStringAsValue(item) : item;\n });\n } else {\n if (value) {\n value = this.getStringAsValue(value);\n }\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {\n return this.dataValue;\n }\n return this.rawData;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TimeComponent.prototype), \"inputInfo\", this);\n info.attr.type = this.component.inputType;\n return info;\n }\n }, {\n key: \"skipMaskValidation\",\n get: function get() {\n return true;\n }\n }, {\n key: \"isNotCompleteInput\",\n value: function isNotCompleteInput(value) {\n return value.includes('_');\n }\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.rawData = Array.isArray(this.rawData) ? [].concat(_toConsumableArray(this.rawData.slice(0, index)), _toConsumableArray(this.rawData.slice(index + 1))) : this.emptyValue;\n _get(_getPrototypeOf(TimeComponent.prototype), \"removeValue\", this).call(this, index);\n }\n }, {\n key: \"resetRawData\",\n value: function resetRawData(index) {\n if (index) {\n this.setRawValue(this.emptyValue, index);\n } else {\n this.rawData = [];\n }\n }\n }, {\n key: \"setRawValue\",\n value: function setRawValue(value, index) {\n if (Array.isArray(this.rawData)) {\n this.rawData[index] = value;\n } else {\n this.rawData = value;\n }\n }\n }, {\n key: \"getRawValue\",\n value: function getRawValue(index) {\n if (index && Array.isArray(this.rawData)) {\n return this.rawData[index] || this.emptyValue;\n } else {\n return this.rawData;\n }\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return this.emptyValue;\n }\n var value = this.refs.input[index].value;\n if (!value) {\n this.resetRawData(index);\n return this.emptyValue;\n }\n this.setRawValue(value, index);\n return this.getStringAsValue(value);\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n this.setRawValue(value ? this.getValueAsString(value) : value, index);\n this.refs.input[index].value = this.getRawValue(index);\n }\n }, {\n key: \"getStringAsValue\",\n value: function getStringAsValue(view) {\n return view ? (0, _moment[\"default\"])(view, this.component.format).format(this.component.dataFormat) : view;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var _this3 = this;\n if (Array.isArray(value) && this.component.multiple) {\n return value.map(function (item) {\n return (0, _moment[\"default\"])(item, _this3.component.dataFormat).format(_this3.component.format);\n }).join(', ');\n }\n return (value ? (0, _moment[\"default\"])(value, this.component.dataFormat).format(this.component.format) : value) || '';\n }\n }, {\n key: \"getInputMaskFromFormat\",\n value: function getInputMaskFromFormat(format) {\n if (format === 'LT') {\n return '99:99 AA';\n }\n if (format === 'LTS') {\n return '99:99:99 AA';\n }\n return format.replace(/[hHmMsSk]/g, '9').replace(/[aA]/, 'AA');\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this4 = this;\n _get(_getPrototypeOf(TimeComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this4.getValueAsString(element.value);\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'time',\n label: 'Time',\n key: 'time',\n inputType: 'time',\n format: 'HH:mm',\n dataFormat: defaultDataFormat\n }].concat(extend));\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(TimeComponent), \"serverConditionSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'time'\n });\n }\n });\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Time',\n icon: 'clock-o',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#time-1',\n weight: 55,\n schema: TimeComponent.schema()\n };\n }\n }]);\n return TimeComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = TimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar defaultDataFormat = 'HH:mm:ss';\nvar TimeComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(TimeComponent, _TextFieldComponent);\n var _super = _createSuper(TimeComponent);\n function TimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, TimeComponent);\n _this = _super.call(this, component, options, data);\n var _getBrowserInfo = (0, _utils.getBrowserInfo)(),\n isEdgeBrowser = _getBrowserInfo.edge,\n edgeVersion = _getBrowserInfo.version;\n _this.component.inputMask = _this.getInputMaskFromFormat(_this.component.format);\n _this.component.inputType = isEdgeBrowser && edgeVersion <= 18 ? 'text' : _this.component.inputType || 'time';\n _this.rawData = _this.component.multiple ? [] : _this.emptyValue;\n return _this;\n }\n _createClass(TimeComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TimeComponent.prototype), \"init\", this).call(this);\n if (this.component.inputType === 'text') {\n this.validators.push('time');\n }\n }\n }, {\n key: \"dataFormat\",\n get: function get() {\n return this.component.dataFormat || defaultDataFormat;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this2 = this;\n var value = _get(_getPrototypeOf(TimeComponent.prototype), \"defaultValue\", this);\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (item) {\n return item ? _this2.getStringAsValue(item) : item;\n });\n } else {\n if (value) {\n value = this.getStringAsValue(value);\n }\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {\n return this.dataValue;\n }\n return this.rawData;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TimeComponent.prototype), \"inputInfo\", this);\n info.attr.type = this.component.inputType;\n return info;\n }\n }, {\n key: \"skipMaskValidation\",\n get: function get() {\n return true;\n }\n }, {\n key: \"isNotCompleteInput\",\n value: function isNotCompleteInput(value) {\n return value.includes('_');\n }\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.rawData = Array.isArray(this.rawData) ? [].concat(_toConsumableArray(this.rawData.slice(0, index)), _toConsumableArray(this.rawData.slice(index + 1))) : this.emptyValue;\n _get(_getPrototypeOf(TimeComponent.prototype), \"removeValue\", this).call(this, index);\n }\n }, {\n key: \"resetRawData\",\n value: function resetRawData(index) {\n if (index) {\n this.setRawValue(this.emptyValue, index);\n } else {\n this.rawData = [];\n }\n }\n }, {\n key: \"setRawValue\",\n value: function setRawValue(value, index) {\n if (Array.isArray(this.rawData)) {\n this.rawData[index] = value;\n } else {\n this.rawData = value;\n }\n }\n }, {\n key: \"getRawValue\",\n value: function getRawValue(index) {\n if (index && Array.isArray(this.rawData)) {\n return this.rawData[index] || this.emptyValue;\n } else {\n return this.rawData;\n }\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return this.emptyValue;\n }\n var value = this.refs.input[index].value;\n if (!value) {\n this.resetRawData(index);\n return this.emptyValue;\n }\n this.setRawValue(value, index);\n return this.getStringAsValue(value);\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n this.setRawValue(value ? this.getValueAsString(value) : value, index);\n this.refs.input[index].value = this.getRawValue(index);\n }\n }, {\n key: \"getStringAsValue\",\n value: function getStringAsValue(view) {\n return view ? (0, _moment[\"default\"])(view, this.component.format).format(this.component.dataFormat) : view;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var _this3 = this;\n if (Array.isArray(value) && this.component.multiple) {\n return value.map(function (item) {\n return (0, _moment[\"default\"])(item, _this3.component.dataFormat).format(_this3.component.format);\n }).join(', ');\n }\n return (value ? (0, _moment[\"default\"])(value, this.component.dataFormat).format(this.component.format) : value) || '';\n }\n }, {\n key: \"getInputMaskFromFormat\",\n value: function getInputMaskFromFormat(format) {\n if (format === 'LT') {\n return '99:99 AA';\n }\n if (format === 'LTS') {\n return '99:99:99 AA';\n }\n return format.replace(/[hHmMsSk]/g, '9').replace(/[aA]/, 'AA');\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this4 = this;\n _get(_getPrototypeOf(TimeComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this4.getValueAsString(element.value);\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'time',\n label: 'Time',\n key: 'time',\n inputType: 'time',\n format: 'HH:mm',\n dataFormat: defaultDataFormat\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Time',\n icon: 'clock-o',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#time-1',\n weight: 55,\n schema: TimeComponent.schema()\n };\n }\n }]);\n return TimeComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = TimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.js?"); /***/ }), @@ -11605,7 +11605,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\n \***********************************************/ /***/ (function(module) { -eval("/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return apply(func, thisArg, args);\n };\n }\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return construct(func, args);\n };\n }\n /* Add properties to a lookup table */\n\n function addToSet(set, array, transformCaseFunc) {\n var _transformCaseFunc;\n\n transformCaseFunc = (_transformCaseFunc = transformCaseFunc) !== null && _transformCaseFunc !== void 0 ? _transformCaseFunc : stringToLowerCase;\n\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n let l = array.length;\n\n while (l--) {\n let element = array[l];\n\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }\n /* Shallow clone an object */\n\n function clone(object) {\n const newObject = create(null);\n\n for (const [property, value] of entries(object)) {\n newObject[property] = value;\n }\n\n return newObject;\n }\n /* This method automatically checks if the prop is function\n * or getter and behaves accordingly. */\n\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG\n\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n const DOCTYPE_NAME = seal(/^html$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME\n });\n\n const getGlobal = () => typeof window === 'undefined' ? null : window;\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n\n\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n } // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n\n\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n const DOMPurify = root => createDOMPurify(root);\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n\n\n DOMPurify.version = '3.0.5';\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n\n const originalDocument = window.document;\n const currentScript = originalDocument.currentScript;\n let {\n document\n } = window;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n\n let CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n\n let SAFE_FOR_TEMPLATES = false;\n /* Decide if document with ... should be returned */\n\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n /* Parsing of strict XHTML documents */\n\n let PARSER_MEDIA_TYPE;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc;\n /* Keep a reference to config to pass to hooks */\n\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n\n\n const _parseConfig = function _parseConfig(cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n\n\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n\n\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n\n\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [...text]);\n ALLOWED_ATTR = [];\n\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n\n\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n\n\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n\n\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n\n\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n } // Overwrite existing TrustedTypes policy.\n\n\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; // Sign local variables required by `sanitize`.\n\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n } // If creating the internal policy succeeded sign internal variables.\n\n\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n } // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n\n\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n\n const ALL_SVG_TAGS = addToSet({}, svg$1);\n addToSet(ALL_SVG_TAGS, svgFilters);\n addToSet(ALL_SVG_TAGS, svgDisallowed);\n const ALL_MATHML_TAGS = addToSet({}, mathMl$1);\n addToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n } // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n\n\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n } // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n\n\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n } // The only way to switch from SVG to MathML is via\n // and HTML integration points\n\n\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n } // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n\n\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n } // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n\n\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n } // For XHTML and XML documents that support custom namespaces\n\n\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n } // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n\n\n return false;\n };\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n\n\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n\n\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n\n node.removeAttribute(name); // We void attribute values for unremovable \"is\"\" attributes\n\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n\n\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc;\n let leadingWhitespace;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n\n\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {// Syntax error if dirtyPayload is invalid xml\n }\n }\n\n const body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n\n\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n\n\n const _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);\n };\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n\n\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n\n\n const _isNode = function _isNode(object) {\n return typeof Node === 'object' ? object instanceof Node : object && typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n };\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n\n\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n\n\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content;\n /* Execute a hook if present */\n\n _executeHook('beforeSanitizeElements', currentNode, null);\n /* Check if element is clobbered or can clobber */\n\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Now let's check the element's type and name */\n\n\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n\n\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Remove element if anything forbids its presence */\n\n\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;\n }\n /* Keep content except for bad-listed elements */\n\n\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n\n for (let i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n\n return true;\n }\n /* Check whether element has a valid namespace */\n\n\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n\n\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Sanitize element content to be template-safe */\n\n\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = stringReplace(content, MUSTACHE_EXPR, ' ');\n content = stringReplace(content, ERB_EXPR, ' ');\n content = stringReplace(content, TMPLIT_EXPR, ' ');\n\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n\n\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n\n\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n\n\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n\n return true;\n };\n /**\n * _basicCustomElementCheck\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n * @param {string} tagName name of the tag of the node to sanitize\n */\n\n\n const _basicCustomElementTest = function _basicCustomElementTest(tagName) {\n return tagName.indexOf('-') > 0;\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n\n\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n let attr;\n let value;\n let lcName;\n let l;\n /* Execute a hook if present */\n\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n\n while (l--) {\n attr = attributes[l];\n const {\n name,\n namespaceURI\n } = attr;\n value = name === 'value' ? attr.value : stringTrim(attr.value);\n lcName = transformCaseFunc(name);\n /* Execute a hook if present */\n\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Remove attribute */\n\n\n _removeAttribute(name, currentNode);\n /* Did the hooks approve of the attribute? */\n\n\n if (!hookEvent.keepAttr) {\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n\n\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n\n\n if (SAFE_FOR_TEMPLATES) {\n value = stringReplace(value, MUSTACHE_EXPR, ' ');\n value = stringReplace(value, ERB_EXPR, ' ');\n value = stringReplace(value, TMPLIT_EXPR, ' ');\n }\n /* Is `value` valid for this attribute? */\n\n\n const lcTag = transformCaseFunc(currentNode.nodeName);\n\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n\n\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode); // Prefix the value and later re-create the attribute with the sanitized value\n\n\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Handle attributes that require Trusted Types */\n\n\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n\n\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n /* Execute a hook if present */\n\n\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n\n\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode;\n\n const shadowIterator = _createIterator(fragment);\n /* Execute a hook if present */\n\n\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n /* Sanitize tags and elements */\n\n\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n /* Deep shadow DOM detected */\n\n\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n /* Check attributes, sanitize if necessary */\n\n\n _sanitizeAttributes(shadowNode);\n }\n /* Execute a hook if present */\n\n\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n\n\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body;\n let importedNode;\n let currentNode;\n let returnNode;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n\n IS_EMPTY_INPUT = !dirty;\n\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n /* Stringify, in case dirty is an object */\n\n\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n\n\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n\n\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n\n\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n\n\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n\n\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n\n\n const nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n\n\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n /* Shadow DOM detected, sanitize it */\n\n\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n /* Check attributes, sanitize if necessary */\n\n\n _sanitizeAttributes(currentNode);\n }\n /* If we sanitized `dirty` in-place, return it. */\n\n\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n\n\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n\n\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');\n serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n\n\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n\n SET_CONFIG = true;\n };\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n\n\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n\n\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n\n\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n\n\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n\n\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n\n\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n }\n\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/dompurify/dist/purify.js?"); +eval("/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n const DOCTYPE_NAME = seal(/^html$/i);\n const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n const NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n };\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.7';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/dompurify/dist/purify.js?"); /***/ }), @@ -11667,7 +11667,7 @@ eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \**************************************************/ /***/ (function(module) { -eval("/*!\n * dist/inputmask\n * https://github.com/RobinHerbots/Inputmask\n * Copyright (c) 2010 - 2023 Robin Herbots\n * Licensed under the MIT license\n * Version: 5.0.8\n */\n!function(e, t) {\n if (true) module.exports = t(); else { var n, i; }\n}(\"undefined\" != typeof self ? self : this, (function() {\n return function() {\n \"use strict\";\n var e = {\n 8741: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var i = !(\"undefined\" == typeof window || !window.document || !window.document.createElement);\n t.default = i;\n },\n 3976: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = i(2839), a = {\n _maxTestPos: 500,\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: function() {},\n onincomplete: function() {},\n oncleared: function() {},\n repeat: 0,\n greedy: !1,\n autoUnmask: !1,\n removeMaskOnSubmit: !1,\n clearMaskOnLostFocus: !0,\n insertMode: !0,\n insertModeVisual: !0,\n clearIncomplete: !1,\n alias: null,\n onKeyDown: function() {},\n onBeforeMask: null,\n onBeforePaste: function(e, t) {\n return \"function\" == typeof t.onBeforeMask ? t.onBeforeMask.call(this, e, t) : e;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: !0,\n showMaskOnHover: !0,\n onKeyValidation: function() {},\n skipOptionalPartCharacter: \" \",\n numericInput: !1,\n rightAlign: !1,\n undoOnEscape: !0,\n radixPoint: \"\",\n _radixDance: !1,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: !0,\n tabThrough: !1,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n ignorables: [ n.keys.Backspace, n.keys.Tab, n.keys.Pause, n.keys.Escape, n.keys.PageUp, n.keys.PageDown, n.keys.End, n.keys.Home, n.keys.ArrowLeft, n.keys.ArrowUp, n.keys.ArrowRight, n.keys.ArrowDown, n.keys.Insert, n.keys.Delete, n.keys.ContextMenu, n.keys.F1, n.keys.F2, n.keys.F3, n.keys.F4, n.keys.F5, n.keys.F6, n.keys.F7, n.keys.F8, n.keys.F9, n.keys.F10, n.keys.F11, n.keys.F12, n.keys.Process, n.keys.Unidentified, n.keys.Shift, n.keys.Control, n.keys.Alt, n.keys.Tab, n.keys.AltGraph, n.keys.CapsLock ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: void 0,\n jitMasking: !1,\n nullable: !0,\n inputEventOnly: !1,\n noValuePatching: !1,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"text\",\n importDataAttributes: !0,\n shiftPositions: !0,\n usePrototypeDefinitions: !0,\n validationEventTimeOut: 3e3,\n substitutes: {}\n };\n t.default = a;\n },\n 7392: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n t.default = {\n 9: {\n validator: \"[0-9\\uff10-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff10-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n };\n },\n 253: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, i) {\n if (void 0 === i) return e.__data ? e.__data[t] : null;\n e.__data = e.__data || {}, e.__data[t] = i;\n };\n },\n 3776: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.Event = void 0, t.off = function(e, t) {\n var i, n;\n f(this[0]) && e && (i = this[0].eventRegistry, n = this[0], e.split(\" \").forEach((function(e) {\n var a = l(e.split(\".\"), 2);\n (function(e, n) {\n var a, r, o = [];\n if (e.length > 0) if (void 0 === t) for (a = 0, r = i[e][n].length; a < r; a++) o.push({\n ev: e,\n namespace: n && n.length > 0 ? n : \"global\",\n handler: i[e][n][a]\n }); else o.push({\n ev: e,\n namespace: n && n.length > 0 ? n : \"global\",\n handler: t\n }); else if (n.length > 0) for (var s in i) for (var l in i[s]) if (l === n) if (void 0 === t) for (a = 0, \n r = i[s][l].length; a < r; a++) o.push({\n ev: s,\n namespace: l,\n handler: i[s][l][a]\n }); else o.push({\n ev: s,\n namespace: l,\n handler: t\n });\n return o;\n })(a[0], a[1]).forEach((function(e) {\n var t = e.ev, a = e.handler;\n !function(e, t, a) {\n if (e in i == 1) if (n.removeEventListener ? n.removeEventListener(e, a, !1) : n.detachEvent && n.detachEvent(\"on\".concat(e), a), \n \"global\" === t) for (var r in i[e]) i[e][r].splice(i[e][r].indexOf(a), 1); else i[e][t].splice(i[e][t].indexOf(a), 1);\n }(t, e.namespace, a);\n }));\n })));\n return this;\n }, t.on = function(e, t) {\n if (f(this[0])) {\n var i = this[0].eventRegistry, n = this[0];\n e.split(\" \").forEach((function(e) {\n var a = l(e.split(\".\"), 2), r = a[0], o = a[1];\n !function(e, a) {\n n.addEventListener ? n.addEventListener(e, t, !1) : n.attachEvent && n.attachEvent(\"on\".concat(e), t), \n i[e] = i[e] || {}, i[e][a] = i[e][a] || [], i[e][a].push(t);\n }(r, void 0 === o ? \"global\" : o);\n }));\n }\n return this;\n }, t.trigger = function(e) {\n var t = arguments;\n if (f(this[0])) for (var i = this[0].eventRegistry, n = this[0], r = \"string\" == typeof e ? e.split(\" \") : [ e.type ], s = 0; s < r.length; s++) {\n var l = r[s].split(\".\"), c = l[0], u = l[1] || \"global\";\n if (void 0 !== document && \"global\" === u) {\n var d, p = {\n bubbles: !0,\n cancelable: !0,\n composed: !0,\n detail: arguments[1]\n };\n if (document.createEvent) {\n try {\n if (\"input\" === c) p.inputType = \"insertText\", d = new InputEvent(c, p); else d = new CustomEvent(c, p);\n } catch (e) {\n (d = document.createEvent(\"CustomEvent\")).initCustomEvent(c, p.bubbles, p.cancelable, p.detail);\n }\n e.type && (0, a.default)(d, e), n.dispatchEvent(d);\n } else (d = document.createEventObject()).eventType = c, d.detail = arguments[1], \n e.type && (0, a.default)(d, e), n.fireEvent(\"on\" + d.eventType, d);\n } else if (void 0 !== i[c]) {\n arguments[0] = arguments[0].type ? arguments[0] : o.default.Event(arguments[0]), \n arguments[0].detail = arguments.slice(1);\n var h = i[c];\n (\"global\" === u ? Object.values(h).flat() : h[u]).forEach((function(e) {\n return e.apply(n, t);\n }));\n }\n }\n return this;\n };\n var n, a = u(i(600)), r = u(i(9380)), o = u(i(4963)), s = u(i(8741));\n function l(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return c(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return c(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function c(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function u(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n function f(e) {\n return e instanceof Element;\n }\n t.Event = n, \"function\" == typeof r.default.CustomEvent ? t.Event = n = r.default.CustomEvent : s.default && (t.Event = n = function(e, t) {\n t = t || {\n bubbles: !1,\n cancelable: !1,\n composed: !0,\n detail: void 0\n };\n var i = document.createEvent(\"CustomEvent\");\n return i.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), i;\n }, n.prototype = r.default.Event.prototype);\n },\n 600: function(e, t) {\n function i(e) {\n return i = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, i(e);\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function e() {\n var t, n, a, r, o, s, l = arguments[0] || {}, c = 1, u = arguments.length, f = !1;\n \"boolean\" == typeof l && (f = l, l = arguments[c] || {}, c++);\n \"object\" !== i(l) && \"function\" != typeof l && (l = {});\n for (;c < u; c++) if (null != (t = arguments[c])) for (n in t) a = l[n], l !== (r = t[n]) && (f && r && (\"[object Object]\" === Object.prototype.toString.call(r) || (o = Array.isArray(r))) ? (o ? (o = !1, \n s = a && Array.isArray(a) ? a : []) : s = a && \"[object Object]\" === Object.prototype.toString.call(a) ? a : {}, \n l[n] = e(f, s, r)) : void 0 !== r && (l[n] = r));\n return l;\n };\n },\n 4963: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = s(i(600)), a = s(i(9380)), r = s(i(253)), o = i(3776);\n function s(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var l = a.default.document;\n function c(e) {\n return e instanceof c ? e : this instanceof c ? void (null != e && e !== a.default && (this[0] = e.nodeName ? e : void 0 !== e[0] && e[0].nodeName ? e[0] : l.querySelector(e), \n void 0 !== this[0] && null !== this[0] && (this[0].eventRegistry = this[0].eventRegistry || {}))) : new c(e);\n }\n c.prototype = {\n on: o.on,\n off: o.off,\n trigger: o.trigger\n }, c.extend = n.default, c.data = r.default, c.Event = o.Event;\n var u = c;\n t.default = u;\n },\n 9845: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mobile = t.iphone = t.ie = void 0;\n var n, a = (n = i(9380)) && n.__esModule ? n : {\n default: n\n };\n var r = a.default.navigator && a.default.navigator.userAgent || \"\", o = r.indexOf(\"MSIE \") > 0 || r.indexOf(\"Trident/\") > 0, s = navigator.userAgentData && navigator.userAgentData.mobile || a.default.navigator && a.default.navigator.maxTouchPoints || \"ontouchstart\" in a.default, l = /iphone/i.test(r);\n t.iphone = l, t.mobile = s, t.ie = o;\n },\n 7184: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e) {\n return e.replace(i, \"\\\\$1\");\n };\n var i = new RegExp(\"(\\\\\" + [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ].join(\"|\\\\\") + \")\", \"gim\");\n },\n 6030: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventHandlers = void 0;\n var n = i(8711), a = i(2839), r = i(9845), o = i(7215), s = i(7760), l = i(4713);\n function c(e, t) {\n var i = \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (!i) {\n if (Array.isArray(e) || (i = function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return u(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return u(e, t);\n }(e)) || t && e && \"number\" == typeof e.length) {\n i && (e = i);\n var n = 0, a = function() {};\n return {\n s: a,\n n: function() {\n return n >= e.length ? {\n done: !0\n } : {\n done: !1,\n value: e[n++]\n };\n },\n e: function(e) {\n throw e;\n },\n f: a\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var r, o = !0, s = !1;\n return {\n s: function() {\n i = i.call(e);\n },\n n: function() {\n var e = i.next();\n return o = e.done, e;\n },\n e: function(e) {\n s = !0, r = e;\n },\n f: function() {\n try {\n o || null == i.return || i.return();\n } finally {\n if (s) throw r;\n }\n }\n };\n }\n function u(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n var f = {\n keyEvent: function(e, t, i, c, u) {\n var d = this.inputmask, p = d.opts, h = d.dependencyLib, v = d.maskset, m = this, g = h(m), y = e.key, k = n.caret.call(d, m), b = p.onKeyDown.call(this, e, n.getBuffer.call(d), k, p);\n if (void 0 !== b) return b;\n if (y === a.keys.Backspace || y === a.keys.Delete || r.iphone && y === a.keys.BACKSPACE_SAFARI || e.ctrlKey && y === a.keys.x && !(\"oncut\" in m)) e.preventDefault(), \n o.handleRemove.call(d, m, y, k), (0, s.writeBuffer)(m, n.getBuffer.call(d, !0), v.p, e, m.inputmask._valueGet() !== n.getBuffer.call(d).join(\"\")); else if (y === a.keys.End || y === a.keys.PageDown) {\n e.preventDefault();\n var x = n.seekNext.call(d, n.getLastValidPosition.call(d));\n n.caret.call(d, m, e.shiftKey ? k.begin : x, x, !0);\n } else y === a.keys.Home && !e.shiftKey || y === a.keys.PageUp ? (e.preventDefault(), \n n.caret.call(d, m, 0, e.shiftKey ? k.begin : 0, !0)) : p.undoOnEscape && y === a.keys.Escape && !0 !== e.altKey ? ((0, \n s.checkVal)(m, !0, !1, d.undoValue.split(\"\")), g.trigger(\"click\")) : y !== a.keys.Insert || e.shiftKey || e.ctrlKey || void 0 !== d.userOptions.insertMode ? !0 === p.tabThrough && y === a.keys.Tab ? !0 === e.shiftKey ? (k.end = n.seekPrevious.call(d, k.end, !0), \n !0 === l.getTest.call(d, k.end - 1).match.static && k.end--, k.begin = n.seekPrevious.call(d, k.end, !0), \n k.begin >= 0 && k.end > 0 && (e.preventDefault(), n.caret.call(d, m, k.begin, k.end))) : (k.begin = n.seekNext.call(d, k.begin, !0), \n k.end = n.seekNext.call(d, k.begin, !0), k.end < v.maskLength && k.end--, k.begin <= v.maskLength && (e.preventDefault(), \n n.caret.call(d, m, k.begin, k.end))) : e.shiftKey || p.insertModeVisual && !1 === p.insertMode && (y === a.keys.ArrowRight ? setTimeout((function() {\n var e = n.caret.call(d, m);\n n.caret.call(d, m, e.begin);\n }), 0) : y === a.keys.ArrowLeft && setTimeout((function() {\n var e = n.translatePosition.call(d, m.inputmask.caretPos.begin);\n n.translatePosition.call(d, m.inputmask.caretPos.end);\n d.isRTL ? n.caret.call(d, m, e + (e === v.maskLength ? 0 : 1)) : n.caret.call(d, m, e - (0 === e ? 0 : 1));\n }), 0)) : o.isSelection.call(d, k) ? p.insertMode = !p.insertMode : (p.insertMode = !p.insertMode, \n n.caret.call(d, m, k.begin, k.begin));\n return d.isComposing = y == a.keys.Process || y == a.keys.Unidentified, d.ignorable = p.ignorables.includes(y), \n f.keypressEvent.call(this, e, t, i, c, u);\n },\n keypressEvent: function(e, t, i, r, l) {\n var c = this.inputmask || this, u = c.opts, f = c.dependencyLib, d = c.maskset, p = c.el, h = f(p), v = e.key;\n if (!0 === t || e.ctrlKey && e.altKey || !(e.ctrlKey || e.metaKey || c.ignorable)) {\n if (v) {\n var m, g = t ? {\n begin: l,\n end: l\n } : n.caret.call(c, p);\n v = u.substitutes[v] || v, d.writeOutBuffer = !0;\n var y = o.isValid.call(c, g, v, r, void 0, void 0, void 0, t);\n if (!1 !== y && (n.resetMaskSet.call(c, !0), m = void 0 !== y.caret ? y.caret : n.seekNext.call(c, y.pos.begin ? y.pos.begin : y.pos), \n d.p = m), m = u.numericInput && void 0 === y.caret ? n.seekPrevious.call(c, m) : m, \n !1 !== i && (setTimeout((function() {\n u.onKeyValidation.call(p, v, y);\n }), 0), d.writeOutBuffer && !1 !== y)) {\n var k = n.getBuffer.call(c);\n (0, s.writeBuffer)(p, k, m, e, !0 !== t);\n }\n if (e.preventDefault(), t) return !1 !== y && (y.forwardPosition = m), y;\n }\n } else v === a.keys.Enter && c.undoValue !== c._valueGet(!0) && (c.undoValue = c._valueGet(!0), \n setTimeout((function() {\n h.trigger(\"change\");\n }), 0));\n },\n pasteEvent: function(e) {\n var t, i = this.inputmask, a = i.opts, r = i._valueGet(!0), o = n.caret.call(i, this);\n i.isRTL && (t = o.end, o.end = n.translatePosition.call(i, o.begin), o.begin = n.translatePosition.call(i, t));\n var l = r.substr(0, o.begin), u = r.substr(o.end, r.length);\n if (l == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(0, o.begin).join(\"\") && (l = \"\"), \n u == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(o.end).join(\"\") && (u = \"\"), \n window.clipboardData && window.clipboardData.getData) r = l + window.clipboardData.getData(\"Text\") + u; else {\n if (!e.clipboardData || !e.clipboardData.getData) return !0;\n r = l + e.clipboardData.getData(\"text/plain\") + u;\n }\n var f = r;\n if (i.isRTL) {\n f = f.split(\"\");\n var d, p = c(n.getBufferTemplate.call(i));\n try {\n for (p.s(); !(d = p.n()).done; ) {\n var h = d.value;\n f[0] === h && f.shift();\n }\n } catch (e) {\n p.e(e);\n } finally {\n p.f();\n }\n f = f.join(\"\");\n }\n if (\"function\" == typeof a.onBeforePaste) {\n if (!1 === (f = a.onBeforePaste.call(i, f, a))) return !1;\n f || (f = r);\n }\n (0, s.checkVal)(this, !0, !1, f.toString().split(\"\"), e), e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n var t = this.inputmask, i = t.opts, o = t.dependencyLib;\n var c, u = this, d = u.inputmask._valueGet(!0), p = (t.isRTL ? n.getBuffer.call(t).slice().reverse() : n.getBuffer.call(t)).join(\"\"), h = n.caret.call(t, u, void 0, void 0, !0);\n if (p !== d) {\n if (c = function(e, a, r) {\n for (var o, s, c, u = e.substr(0, r.begin).split(\"\"), f = e.substr(r.begin).split(\"\"), d = a.substr(0, r.begin).split(\"\"), p = a.substr(r.begin).split(\"\"), h = u.length >= d.length ? u.length : d.length, v = f.length >= p.length ? f.length : p.length, m = \"\", g = [], y = \"~\"; u.length < h; ) u.push(y);\n for (;d.length < h; ) d.push(y);\n for (;f.length < v; ) f.unshift(y);\n for (;p.length < v; ) p.unshift(y);\n var k = u.concat(f), b = d.concat(p);\n for (s = 0, o = k.length; s < o; s++) switch (c = l.getPlaceholder.call(t, n.translatePosition.call(t, s)), \n m) {\n case \"insertText\":\n b[s - 1] === k[s] && r.begin == k.length - 1 && g.push(k[s]), s = o;\n break;\n\n case \"insertReplacementText\":\n case \"deleteContentBackward\":\n k[s] === y ? r.end++ : s = o;\n break;\n\n default:\n k[s] !== b[s] && (k[s + 1] !== y && k[s + 1] !== c && void 0 !== k[s + 1] || (b[s] !== c || b[s + 1] !== y) && b[s] !== y ? b[s + 1] === y && b[s] === k[s + 1] ? (m = \"insertText\", \n g.push(k[s]), r.begin--, r.end--) : k[s] !== c && k[s] !== y && (k[s + 1] === y || b[s] !== k[s] && b[s + 1] === k[s + 1]) ? (m = \"insertReplacementText\", \n g.push(k[s]), r.begin--) : k[s] === y ? (m = \"deleteContentBackward\", (n.isMask.call(t, n.translatePosition.call(t, s), !0) || b[s] === i.radixPoint) && r.end++) : s = o : (m = \"insertText\", \n g.push(k[s]), r.begin--, r.end--));\n }\n return {\n action: m,\n data: g,\n caret: r\n };\n }(d, p, h), (u.inputmask.shadowRoot || u.ownerDocument).activeElement !== u && u.focus(), \n (0, s.writeBuffer)(u, n.getBuffer.call(t)), n.caret.call(t, u, h.begin, h.end, !0), \n !r.mobile && t.skipNextInsert && \"insertText\" === e.inputType && \"insertText\" === c.action && t.isComposing) return !1;\n switch (\"insertCompositionText\" === e.inputType && \"insertText\" === c.action && t.isComposing ? t.skipNextInsert = !0 : t.skipNextInsert = !1, \n c.action) {\n case \"insertText\":\n case \"insertReplacementText\":\n c.data.forEach((function(e, i) {\n var n = new o.Event(\"keypress\");\n n.key = e, t.ignorable = !1, f.keypressEvent.call(u, n);\n })), setTimeout((function() {\n t.$el.trigger(\"keyup\");\n }), 0);\n break;\n\n case \"deleteContentBackward\":\n var v = new o.Event(\"keydown\");\n v.key = a.keys.Backspace, f.keyEvent.call(u, v);\n break;\n\n default:\n (0, s.applyInputValue)(u, d), n.caret.call(t, u, h.begin, h.end, !0);\n }\n e.preventDefault();\n }\n },\n setValueEvent: function(e) {\n var t = this.inputmask, i = this, a = e && e.detail ? e.detail[0] : arguments[1];\n void 0 === a && (a = i.inputmask._valueGet(!0)), (0, s.applyInputValue)(i, a), (e.detail && void 0 !== e.detail[1] || void 0 !== arguments[2]) && n.caret.call(t, i, e.detail ? e.detail[1] : arguments[2]);\n },\n focusEvent: function(e) {\n var t = this.inputmask, i = t.opts, a = null == t ? void 0 : t._valueGet();\n i.showMaskOnFocus && a !== n.getBuffer.call(t).join(\"\") && (0, s.writeBuffer)(this, n.getBuffer.call(t), n.seekNext.call(t, n.getLastValidPosition.call(t))), \n !0 !== i.positionCaretOnTab || !1 !== t.mouseEnter || o.isComplete.call(t, n.getBuffer.call(t)) && -1 !== n.getLastValidPosition.call(t) || f.clickEvent.apply(this, [ e, !0 ]), \n t.undoValue = null == t ? void 0 : t._valueGet(!0);\n },\n invalidEvent: function(e) {\n this.inputmask.validationEvent = !0;\n },\n mouseleaveEvent: function() {\n var e = this.inputmask, t = e.opts, i = this;\n e.mouseEnter = !1, t.clearMaskOnLostFocus && (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i && (0, \n s.HandleNativePlaceholder)(i, e.originalPlaceholder);\n },\n clickEvent: function(e, t) {\n var i = this.inputmask;\n i.clicked++;\n var a = this;\n if ((a.inputmask.shadowRoot || a.ownerDocument).activeElement === a) {\n var r = n.determineNewCaretPosition.call(i, n.caret.call(i, a), t);\n void 0 !== r && n.caret.call(i, a, r);\n }\n },\n cutEvent: function(e) {\n var t = this.inputmask, i = t.maskset, r = this, l = n.caret.call(t, r), c = t.isRTL ? n.getBuffer.call(t).slice(l.end, l.begin) : n.getBuffer.call(t).slice(l.begin, l.end), u = t.isRTL ? c.reverse().join(\"\") : c.join(\"\");\n window.navigator.clipboard ? window.navigator.clipboard.writeText(u) : window.clipboardData && window.clipboardData.getData && window.clipboardData.setData(\"Text\", u), \n o.handleRemove.call(t, r, a.keys.Delete, l), (0, s.writeBuffer)(r, n.getBuffer.call(t), i.p, e, t.undoValue !== t._valueGet(!0));\n },\n blurEvent: function(e) {\n var t = this.inputmask, i = t.opts, a = t.dependencyLib;\n t.clicked = 0;\n var r = a(this), l = this;\n if (l.inputmask) {\n (0, s.HandleNativePlaceholder)(l, t.originalPlaceholder);\n var c = l.inputmask._valueGet(), u = n.getBuffer.call(t).slice();\n \"\" !== c && (i.clearMaskOnLostFocus && (-1 === n.getLastValidPosition.call(t) && c === n.getBufferTemplate.call(t).join(\"\") ? u = [] : s.clearOptionalTail.call(t, u)), \n !1 === o.isComplete.call(t, u) && (setTimeout((function() {\n r.trigger(\"incomplete\");\n }), 0), i.clearIncomplete && (n.resetMaskSet.call(t), u = i.clearMaskOnLostFocus ? [] : n.getBufferTemplate.call(t).slice())), \n (0, s.writeBuffer)(l, u, void 0, e)), t.undoValue !== t._valueGet(!0) && (t.undoValue = t._valueGet(!0), \n r.trigger(\"change\"));\n }\n },\n mouseenterEvent: function() {\n var e = this.inputmask, t = e.opts.showMaskOnHover, i = this;\n if (e.mouseEnter = !0, (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i) {\n var a = (e.isRTL ? n.getBufferTemplate.call(e).slice().reverse() : n.getBufferTemplate.call(e)).join(\"\");\n t && (0, s.HandleNativePlaceholder)(i, a);\n }\n },\n submitEvent: function() {\n var e = this.inputmask, t = e.opts;\n e.undoValue !== e._valueGet(!0) && e.$el.trigger(\"change\"), -1 === n.getLastValidPosition.call(e) && e._valueGet && e._valueGet() === n.getBufferTemplate.call(e).join(\"\") && e._valueSet(\"\"), \n t.clearIncomplete && !1 === o.isComplete.call(e, n.getBuffer.call(e)) && e._valueSet(\"\"), \n t.removeMaskOnSubmit && (e._valueSet(e.unmaskedvalue(), !0), setTimeout((function() {\n (0, s.writeBuffer)(e.el, n.getBuffer.call(e));\n }), 0));\n },\n resetEvent: function() {\n var e = this.inputmask;\n e.refreshValue = !0, setTimeout((function() {\n (0, s.applyInputValue)(e.el, e._valueGet(!0));\n }), 0);\n }\n };\n t.EventHandlers = f;\n },\n 9716: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventRuler = void 0;\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n }, r = i(2839), o = i(8711), s = i(7760);\n var l = {\n on: function(e, t, i) {\n var n = e.inputmask.dependencyLib, l = function(t) {\n t.originalEvent && (t = t.originalEvent || t, arguments[0] = t);\n var l, c = this, u = c.inputmask, f = u ? u.opts : void 0;\n if (void 0 === u && \"FORM\" !== this.nodeName) {\n var d = n.data(c, \"_inputmask_opts\");\n n(c).off(), d && new a.default(d).mask(c);\n } else {\n if ([ \"submit\", \"reset\", \"setvalue\" ].includes(t.type) || \"FORM\" === this.nodeName || !(c.disabled || c.readOnly && !(\"keydown\" === t.type && t.ctrlKey && t.key === r.keys.c || !1 === f.tabThrough && t.key === r.keys.Tab))) {\n switch (t.type) {\n case \"input\":\n if (!0 === u.skipInputEvent) return u.skipInputEvent = !1, t.preventDefault();\n break;\n\n case \"click\":\n case \"focus\":\n return u.validationEvent ? (u.validationEvent = !1, e.blur(), (0, s.HandleNativePlaceholder)(e, (u.isRTL ? o.getBufferTemplate.call(u).slice().reverse() : o.getBufferTemplate.call(u)).join(\"\")), \n setTimeout((function() {\n e.focus();\n }), f.validationEventTimeOut), !1) : (l = arguments, void setTimeout((function() {\n e.inputmask && i.apply(c, l);\n }), 0));\n }\n var p = i.apply(c, arguments);\n return !1 === p && (t.preventDefault(), t.stopPropagation()), p;\n }\n t.preventDefault();\n }\n };\n [ \"submit\", \"reset\" ].includes(t) ? (l = l.bind(e), null !== e.form && n(e.form).on(t, l)) : n(e).on(t, l), \n e.inputmask.events[t] = e.inputmask.events[t] || [], e.inputmask.events[t].push(l);\n },\n off: function(e, t) {\n if (e.inputmask && e.inputmask.events) {\n var i = e.inputmask.dependencyLib, n = e.inputmask.events;\n for (var a in t && ((n = [])[t] = e.inputmask.events[t]), n) {\n for (var r = n[a]; r.length > 0; ) {\n var o = r.pop();\n [ \"submit\", \"reset\" ].includes(a) ? null !== e.form && i(e.form).off(a, o) : i(e).off(a, o);\n }\n delete e.inputmask.events[a];\n }\n }\n }\n };\n t.EventRuler = l;\n },\n 219: function(e, t, i) {\n var n = d(i(2394)), a = i(2839), r = d(i(7184)), o = i(8711), s = i(4713);\n function l(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return c(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return c(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function c(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function u(e) {\n return u = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, u(e);\n }\n function f(e, t) {\n for (var i = 0; i < t.length; i++) {\n var n = t[i];\n n.enumerable = n.enumerable || !1, n.configurable = !0, \"value\" in n && (n.writable = !0), \n Object.defineProperty(e, (a = n.key, r = void 0, r = function(e, t) {\n if (\"object\" !== u(e) || null === e) return e;\n var i = e[Symbol.toPrimitive];\n if (void 0 !== i) {\n var n = i.call(e, t || \"default\");\n if (\"object\" !== u(n)) return n;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(a, \"string\"), \"symbol\" === u(r) ? r : String(r)), n);\n }\n var a, r;\n }\n function d(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var p = n.default.dependencyLib, h = function() {\n function e(t, i, n) {\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, e), this.mask = t, this.format = i, this.opts = n, this._date = new Date(1, 0, 1), \n this.initDateObject(t, this.opts);\n }\n var t, i, n;\n return t = e, (i = [ {\n key: \"date\",\n get: function() {\n return void 0 === this._date && (this._date = new Date(1, 0, 1), this.initDateObject(void 0, this.opts)), \n this._date;\n }\n }, {\n key: \"initDateObject\",\n value: function(e, t) {\n var i;\n for (P(t).lastIndex = 0; i = P(t).exec(this.format); ) {\n var n = new RegExp(\"\\\\d+$\").exec(i[0]), a = n ? i[0][0] + \"x\" : i[0], r = void 0;\n if (void 0 !== e) {\n if (n) {\n var o = P(t).lastIndex, s = E(i.index, t);\n P(t).lastIndex = o, r = e.slice(0, e.indexOf(s.nextMatch[0]));\n } else r = e.slice(0, g[a] && g[a][4] || a.length);\n e = e.slice(r.length);\n }\n Object.prototype.hasOwnProperty.call(g, a) && this.setValue(this, r, a, g[a][2], g[a][1]);\n }\n }\n }, {\n key: \"setValue\",\n value: function(e, t, i, n, a) {\n if (void 0 !== t && (e[n] = \"ampm\" === n ? t : t.replace(/[^0-9]/g, \"0\"), e[\"raw\" + n] = t.replace(/\\s/g, \"_\")), \n void 0 !== a) {\n var r = e[n];\n (\"day\" === n && 29 === parseInt(r) || \"month\" === n && 2 === parseInt(r)) && (29 !== parseInt(e.day) || 2 !== parseInt(e.month) || \"\" !== e.year && void 0 !== e.year || e._date.setFullYear(2012, 1, 29)), \n \"day\" === n && (m = !0, 0 === parseInt(r) && (r = 1)), \"month\" === n && (m = !0), \n \"year\" === n && (m = !0, r.length < 4 && (r = M(r, 4, !0))), \"\" === r || isNaN(r) || a.call(e._date, r), \n \"ampm\" === n && a.call(e._date, r);\n }\n }\n }, {\n key: \"reset\",\n value: function() {\n this._date = new Date(1, 0, 1);\n }\n }, {\n key: \"reInit\",\n value: function() {\n this._date = void 0, this.date;\n }\n } ]) && f(t.prototype, i), n && f(t, n), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e;\n }(), v = (new Date).getFullYear(), m = !1, g = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return M(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return M(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ \"\" ],\n mmmm: [ \"\" ],\n yy: [ \"[0-9]{2}\", Date.prototype.setFullYear, \"year\", function() {\n return M(Date.prototype.getFullYear.call(this), 2);\n } ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return M(Date.prototype.getFullYear.call(this), 4);\n } ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return M(Date.prototype.getHours.call(this), 2);\n } ],\n hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return Date.prototype.getHours;\n } ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return M(Date.prototype.getHours.call(this), 2);\n } ],\n Hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return function() {\n return M(Date.prototype.getHours.call(this), e);\n };\n } ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return M(Date.prototype.getMinutes.call(this), 2);\n } ],\n s: [ \"[1-5]?[0-9]\", Date.prototype.setSeconds, \"seconds\", Date.prototype.getSeconds ],\n ss: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return M(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return M(Date.prototype.getMilliseconds.call(this), 3);\n }, 3 ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return M(Date.prototype.getMilliseconds.call(this), 2);\n }, 2 ],\n t: [ \"[ap]\", k, \"ampm\", b, 1 ],\n tt: [ \"[ap]m\", k, \"ampm\", b, 2 ],\n T: [ \"[AP]\", k, \"ampm\", b, 1 ],\n TT: [ \"[AP]M\", k, \"ampm\", b, 2 ],\n Z: [ \".*\", void 0, \"Z\", function() {\n var e = this.toString().match(/\\((.+)\\)/)[1];\n e.includes(\" \") && (e = (e = e.replace(\"-\", \" \").toUpperCase()).split(\" \").map((function(e) {\n return l(e, 1)[0];\n })).join(\"\"));\n return e;\n } ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, y = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function k(e) {\n var t = this.getHours();\n e.toLowerCase().includes(\"p\") ? this.setHours(t + 12) : e.toLowerCase().includes(\"a\") && t >= 12 && this.setHours(t - 12);\n }\n function b() {\n var e = this.getHours();\n return (e = e || 12) >= 12 ? \"PM\" : \"AM\";\n }\n function x(e) {\n var t = new RegExp(\"\\\\d+$\").exec(e[0]);\n if (t && void 0 !== t[0]) {\n var i = g[e[0][0] + \"x\"].slice(\"\");\n return i[0] = i[0](t[0]), i[3] = i[3](t[0]), i;\n }\n if (g[e[0]]) return g[e[0]];\n }\n function P(e) {\n if (!e.tokenizer) {\n var t = [], i = [];\n for (var n in g) if (/\\.*x$/.test(n)) {\n var a = n[0] + \"\\\\d+\";\n -1 === i.indexOf(a) && i.push(a);\n } else -1 === t.indexOf(n[0]) && t.push(n[0]);\n e.tokenizer = \"(\" + (i.length > 0 ? i.join(\"|\") + \"|\" : \"\") + t.join(\"+|\") + \")+?|.\", \n e.tokenizer = new RegExp(e.tokenizer, \"g\");\n }\n return e.tokenizer;\n }\n function w(e, t, i) {\n if (!m) return !0;\n if (void 0 === e.rawday || !isFinite(e.rawday) && new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day || \"29\" == e.day && (!isFinite(e.rawyear) || void 0 === e.rawyear || \"\" === e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) return t;\n if (\"29\" == e.day) {\n var n = E(t.pos, i);\n if (\"yyyy\" === n.targetMatch[0] && t.pos - n.targetMatchIndex == 2) return t.remove = t.pos + 1, \n t;\n } else if (\"02\" == e.month && \"30\" == e.day && void 0 !== t.c) return e.day = \"03\", \n e.date.setDate(3), e.date.setMonth(1), t.insert = [ {\n pos: t.pos,\n c: \"0\"\n }, {\n pos: t.pos + 1,\n c: t.c\n } ], t.caret = o.seekNext.call(this, t.pos + 1), t;\n return !1;\n }\n function S(e, t, i, n) {\n var a, o, s = \"\";\n for (P(i).lastIndex = 0; a = P(i).exec(e); ) {\n if (void 0 === t) if (o = x(a)) s += \"(\" + o[0] + \")\"; else switch (a[0]) {\n case \"[\":\n s += \"(\";\n break;\n\n case \"]\":\n s += \")?\";\n break;\n\n default:\n s += (0, r.default)(a[0]);\n } else if (o = x(a)) if (!0 !== n && o[3]) s += o[3].call(t.date); else o[2] ? s += t[\"raw\" + o[2]] : s += a[0]; else s += a[0];\n }\n return s;\n }\n function M(e, t, i) {\n for (e = String(e), t = t || 2; e.length < t; ) e = i ? e + \"0\" : \"0\" + e;\n return e;\n }\n function _(e, t, i) {\n return \"string\" == typeof e ? new h(e, t, i) : e && \"object\" === u(e) && Object.prototype.hasOwnProperty.call(e, \"date\") ? e : void 0;\n }\n function O(e, t) {\n return S(t.inputFormat, {\n date: e\n }, t);\n }\n function E(e, t) {\n var i, n, a = 0, r = 0;\n for (P(t).lastIndex = 0; n = P(t).exec(t.inputFormat); ) {\n var o = new RegExp(\"\\\\d+$\").exec(n[0]);\n if ((a += r = o ? parseInt(o[0]) : n[0].length) >= e + 1) {\n i = n, n = P(t).exec(t.inputFormat);\n break;\n }\n }\n return {\n targetMatchIndex: a - r,\n nextMatch: n,\n targetMatch: i\n };\n }\n n.default.extendAliases({\n datetime: {\n mask: function(e) {\n return e.numericInput = !1, g.S = e.i18n.ordinalSuffix.join(\"|\"), e.inputFormat = y[e.inputFormat] || e.inputFormat, \n e.displayFormat = y[e.displayFormat] || e.displayFormat || e.inputFormat, e.outputFormat = y[e.outputFormat] || e.outputFormat || e.inputFormat, \n e.placeholder = \"\" !== e.placeholder ? e.placeholder : e.inputFormat.replace(/[[\\]]/, \"\"), \n e.regex = S(e.inputFormat, void 0, e), e.min = _(e.min, e.inputFormat, e), e.max = _(e.max, e.inputFormat, e), \n null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: null,\n outputFormat: null,\n min: null,\n max: null,\n skipOptionalPartCharacter: \"\",\n i18n: {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n },\n preValidation: function(e, t, i, n, a, r, o, s) {\n if (s) return !0;\n if (isNaN(i) && e[t] !== i) {\n var l = E(t, a);\n if (l.nextMatch && l.nextMatch[0] === i && l.targetMatch[0].length > 1) {\n var c = g[l.targetMatch[0]][0];\n if (new RegExp(c).test(\"0\" + e[t - 1])) return e[t] = e[t - 1], e[t - 1] = \"0\", \n {\n fuzzy: !0,\n buffer: e,\n refreshFromBuffer: {\n start: t - 1,\n end: t + 1\n },\n pos: t + 1\n };\n }\n }\n return !0;\n },\n postValidation: function(e, t, i, n, a, r, o, l) {\n var c, u;\n if (o) return !0;\n if (!1 === n && (((c = E(t + 1, a)).targetMatch && c.targetMatchIndex === t && c.targetMatch[0].length > 1 && void 0 !== g[c.targetMatch[0]] || (c = E(t + 2, a)).targetMatch && c.targetMatchIndex === t + 1 && c.targetMatch[0].length > 1 && void 0 !== g[c.targetMatch[0]]) && (u = g[c.targetMatch[0]][0]), \n void 0 !== u && (void 0 !== r.validPositions[t + 1] && new RegExp(u).test(i + \"0\") ? (e[t] = i, \n e[t + 1] = \"0\", n = {\n pos: t + 2,\n caret: t\n }) : new RegExp(u).test(\"0\" + i) && (e[t] = \"0\", e[t + 1] = i, n = {\n pos: t + 2\n })), !1 === n)) return n;\n if (n.fuzzy && (e = n.buffer, t = n.pos), (c = E(t, a)).targetMatch && c.targetMatch[0] && void 0 !== g[c.targetMatch[0]]) {\n var f = g[c.targetMatch[0]];\n u = f[0];\n var d = e.slice(c.targetMatchIndex, c.targetMatchIndex + c.targetMatch[0].length);\n if (!1 === new RegExp(u).test(d.join(\"\")) && 2 === c.targetMatch[0].length && r.validPositions[c.targetMatchIndex] && r.validPositions[c.targetMatchIndex + 1] && (r.validPositions[c.targetMatchIndex + 1].input = \"0\"), \n \"year\" == f[2]) for (var p = s.getMaskTemplate.call(this, !1, 1, void 0, !0), h = t + 1; h < e.length; h++) e[h] = p[h], \n delete r.validPositions[h];\n }\n var m = n, y = _(e.join(\"\"), a.inputFormat, a);\n return m && !isNaN(y.date.getTime()) && (a.prefillYear && (m = function(e, t, i) {\n if (e.year !== e.rawyear) {\n var n = v.toString(), a = e.rawyear.replace(/[^0-9]/g, \"\"), r = n.slice(0, a.length), o = n.slice(a.length);\n if (2 === a.length && a === r) {\n var s = new Date(v, e.month - 1, e.day);\n e.day == s.getDate() && (!i.max || i.max.date.getTime() >= s.getTime()) && (e.date.setFullYear(v), \n e.year = n, t.insert = [ {\n pos: t.pos + 1,\n c: o[0]\n }, {\n pos: t.pos + 2,\n c: o[1]\n } ]);\n }\n }\n return t;\n }(y, m, a)), m = function(e, t, i, n, a) {\n if (!t) return t;\n if (t && i.min && !isNaN(i.min.date.getTime())) {\n var r;\n for (e.reset(), P(i).lastIndex = 0; r = P(i).exec(i.inputFormat); ) {\n var o;\n if ((o = x(r)) && o[3]) {\n for (var s = o[1], l = e[o[2]], c = i.min[o[2]], u = i.max ? i.max[o[2]] : c, f = [], d = !1, p = 0; p < c.length; p++) void 0 !== n.validPositions[p + r.index] || d ? (f[p] = l[p], \n d = d || l[p] > c[p]) : (f[p] = c[p], \"year\" === o[2] && l.length - 1 == p && c != u && (f = (parseInt(f.join(\"\")) + 1).toString().split(\"\")), \n \"ampm\" === o[2] && c != u && i.min.date.getTime() > e.date.getTime() && (f[p] = u[p]));\n s.call(e._date, f.join(\"\"));\n }\n }\n t = i.min.date.getTime() <= e.date.getTime(), e.reInit();\n }\n return t && i.max && (isNaN(i.max.date.getTime()) || (t = i.max.date.getTime() >= e.date.getTime())), \n t;\n }(y, m = w.call(this, y, m, a), a, r)), void 0 !== t && m && n.pos !== t ? {\n buffer: S(a.inputFormat, y, a).split(\"\"),\n refreshFromBuffer: {\n start: t,\n end: n.pos\n },\n pos: n.caret || n.pos\n } : m;\n },\n onKeyDown: function(e, t, i, n) {\n e.ctrlKey && e.key === a.keys.ArrowRight && (this.inputmask._valueSet(O(new Date, n)), \n p(this).trigger(\"setvalue\"));\n },\n onUnMask: function(e, t, i) {\n return t ? S(i.outputFormat, _(e, i.inputFormat, i), i, !0) : t;\n },\n casing: function(e, t, i, n) {\n return 0 == t.nativeDef.indexOf(\"[ap]\") ? e.toLowerCase() : 0 == t.nativeDef.indexOf(\"[AP]\") ? e.toUpperCase() : e;\n },\n onBeforeMask: function(e, t) {\n return \"[object Date]\" === Object.prototype.toString.call(e) && (e = O(e, t)), e;\n },\n insertMode: !1,\n insertModeVisual: !1,\n shiftPositions: !1,\n keepStatic: !1,\n inputmode: \"numeric\",\n prefillYear: !0\n }\n });\n },\n 3851: function(e, t, i) {\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n }, r = i(8711), o = i(4713);\n a.default.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n var s = new RegExp(\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\");\n function l(e, t, i, n, a) {\n return i - 1 > -1 && \".\" !== t.buffer[i - 1] ? (e = t.buffer[i - 1] + e, e = i - 2 > -1 && \".\" !== t.buffer[i - 2] ? t.buffer[i - 2] + e : \"0\" + e) : e = \"00\" + e, \n s.test(e);\n }\n a.default.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)://.*\",\n autoUnmask: !1,\n keepStatic: !1,\n tabThrough: !0\n },\n ip: {\n mask: \"i{1,3}.j{1,3}.k{1,3}.l{1,3}\",\n definitions: {\n i: {\n validator: l\n },\n j: {\n validator: l\n },\n k: {\n validator: l\n },\n l: {\n validator: l\n }\n },\n onUnMask: function(e, t, i) {\n return e;\n },\n inputmode: \"decimal\",\n substitutes: {\n \",\": \".\"\n }\n },\n email: {\n mask: function(e) {\n var t = e.separator, i = e.quantifier, n = \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\", a = n;\n if (t) for (var r = 0; r < i; r++) a += \"[\".concat(t).concat(n, \"]\");\n return a;\n },\n greedy: !1,\n casing: \"lower\",\n separator: null,\n quantifier: 5,\n skipOptionalPartCharacter: \"\",\n onBeforePaste: function(e, t) {\n return (e = e.toLowerCase()).replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(e, t, i) {\n return e;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: !0,\n autoUnmask: !0\n },\n ssn: {\n mask: \"999-99-9999\",\n postValidation: function(e, t, i, n, a, s, l) {\n var c = o.getMaskTemplate.call(this, !0, r.getLastValidPosition.call(this), !0, !0);\n return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(c.join(\"\"));\n }\n }\n });\n },\n 207: function(e, t, i) {\n var n = s(i(2394)), a = s(i(7184)), r = i(8711), o = i(2839);\n function s(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var l = n.default.dependencyLib;\n function c(e, t) {\n for (var i = \"\", a = 0; a < e.length; a++) n.default.prototype.definitions[e.charAt(a)] || t.definitions[e.charAt(a)] || t.optionalmarker[0] === e.charAt(a) || t.optionalmarker[1] === e.charAt(a) || t.quantifiermarker[0] === e.charAt(a) || t.quantifiermarker[1] === e.charAt(a) || t.groupmarker[0] === e.charAt(a) || t.groupmarker[1] === e.charAt(a) || t.alternatormarker === e.charAt(a) ? i += \"\\\\\" + e.charAt(a) : i += e.charAt(a);\n return i;\n }\n function u(e, t, i, n) {\n if (e.length > 0 && t > 0 && (!i.digitsOptional || n)) {\n var a = e.indexOf(i.radixPoint), r = !1;\n i.negationSymbol.back === e[e.length - 1] && (r = !0, e.length--), -1 === a && (e.push(i.radixPoint), \n a = e.length - 1);\n for (var o = 1; o <= t; o++) isFinite(e[a + o]) || (e[a + o] = \"0\");\n }\n return r && e.push(i.negationSymbol.back), e;\n }\n function f(e, t) {\n var i = 0;\n for (var n in \"+\" === e && (i = r.seekNext.call(this, t.validPositions.length - 1)), \n t.tests) if ((n = parseInt(n)) >= i) for (var a = 0, o = t.tests[n].length; a < o; a++) if ((void 0 === t.validPositions[n] || \"-\" === e) && t.tests[n][a].match.def === e) return n + (void 0 !== t.validPositions[n] && \"-\" !== e ? 1 : 0);\n return i;\n }\n function d(e, t) {\n for (var i = -1, n = 0, a = t.validPositions.length; n < a; n++) {\n var r = t.validPositions[n];\n if (r && r.match.def === e) {\n i = n;\n break;\n }\n }\n return i;\n }\n function p(e, t, i, n, a) {\n var r = t.buffer ? t.buffer.indexOf(a.radixPoint) : -1, o = (-1 !== r || n && a.jitMasking) && new RegExp(a.definitions[9].validator).test(e);\n return a._radixDance && -1 !== r && o && null == t.validPositions[r] ? {\n insert: {\n pos: r === i ? r + 1 : r,\n c: a.radixPoint\n },\n pos: i\n } : o;\n }\n n.default.extendAliases({\n numeric: {\n mask: function(e) {\n e.repeat = 0, e.groupSeparator === e.radixPoint && e.digits && \"0\" !== e.digits && (\".\" === e.radixPoint ? e.groupSeparator = \",\" : \",\" === e.radixPoint ? e.groupSeparator = \".\" : e.groupSeparator = \"\"), \n \" \" === e.groupSeparator && (e.skipOptionalPartCharacter = void 0), e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), \n \"radixFocus\" === e.positionCaretOnClick && \"\" === e.placeholder && (e.positionCaretOnClick = \"lvp\");\n var t = \"0\", i = e.radixPoint;\n !0 === e.numericInput && void 0 === e.__financeInput ? (t = \"1\", e.positionCaretOnClick = \"radixFocus\" === e.positionCaretOnClick ? \"lvp\" : e.positionCaretOnClick, \n e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e._radixDance = !1, i = \",\" === e.radixPoint ? \"?\" : \"!\", \n \"\" !== e.radixPoint && void 0 === e.definitions[i] && (e.definitions[i] = {}, e.definitions[i].validator = \"[\" + e.radixPoint + \"]\", \n e.definitions[i].placeholder = e.radixPoint, e.definitions[i].static = !0, e.definitions[i].generated = !0)) : (e.__financeInput = !1, \n e.numericInput = !0);\n var n, r = \"[+]\";\n if (r += c(e.prefix, e), \"\" !== e.groupSeparator ? (void 0 === e.definitions[e.groupSeparator] && (e.definitions[e.groupSeparator] = {}, \n e.definitions[e.groupSeparator].validator = \"[\" + e.groupSeparator + \"]\", e.definitions[e.groupSeparator].placeholder = e.groupSeparator, \n e.definitions[e.groupSeparator].static = !0, e.definitions[e.groupSeparator].generated = !0), \n r += e._mask(e)) : r += \"9{+}\", void 0 !== e.digits && 0 !== e.digits) {\n var o = e.digits.toString().split(\",\");\n isFinite(o[0]) && o[1] && isFinite(o[1]) ? r += i + t + \"{\" + e.digits + \"}\" : (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.digitsOptional || e.jitMasking ? (n = r + i + t + \"{0,\" + e.digits + \"}\", \n e.keepStatic = !0) : r += i + t + \"{\" + e.digits + \"}\");\n } else e.inputmode = \"numeric\";\n return r += c(e.suffix, e), r += \"[-]\", n && (r = [ n + c(e.suffix, e) + \"[-]\", r ]), \n e.greedy = !1, function(e) {\n void 0 === e.parseMinMaxOptions && (null !== e.min && (e.min = e.min.toString().replace(new RegExp((0, \n a.default)(e.groupSeparator), \"g\"), \"\"), \",\" === e.radixPoint && (e.min = e.min.replace(e.radixPoint, \".\")), \n e.min = isFinite(e.min) ? parseFloat(e.min) : NaN, isNaN(e.min) && (e.min = Number.MIN_VALUE)), \n null !== e.max && (e.max = e.max.toString().replace(new RegExp((0, a.default)(e.groupSeparator), \"g\"), \"\"), \n \",\" === e.radixPoint && (e.max = e.max.replace(e.radixPoint, \".\")), e.max = isFinite(e.max) ? parseFloat(e.max) : NaN, \n isNaN(e.max) && (e.max = Number.MAX_VALUE)), e.parseMinMaxOptions = \"done\");\n }(e), \"\" !== e.radixPoint && e.substituteRadixPoint && (e.substitutes[\".\" == e.radixPoint ? \",\" : \".\"] = e.radixPoint), \n r;\n },\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"999){+|1}\";\n },\n digits: \"*\",\n digitsOptional: !0,\n enforceDigitsOnBlur: !1,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n _radixDance: !0,\n groupSeparator: \"\",\n allowMinus: !0,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n prefix: \"\",\n suffix: \"\",\n min: null,\n max: null,\n SetMaxOnOverflow: !1,\n step: 1,\n inputType: \"text\",\n unmaskAsNumber: !1,\n roundingFN: Math.round,\n inputmode: \"decimal\",\n shortcuts: {\n k: \"1000\",\n m: \"1000000\"\n },\n placeholder: \"0\",\n greedy: !1,\n rightAlign: !0,\n insertMode: !0,\n autoUnmask: !1,\n skipOptionalPartCharacter: \"\",\n usePrototypeDefinitions: !1,\n stripLeadingZeroes: !0,\n substituteRadixPoint: !0,\n definitions: {\n 0: {\n validator: p\n },\n 1: {\n validator: p,\n definitionSymbol: \"9\"\n },\n 9: {\n validator: \"[0-9\\uff10-\\uff19\\u0660-\\u0669\\u06f0-\\u06f9]\",\n definitionSymbol: \"*\"\n },\n \"+\": {\n validator: function(e, t, i, n, a) {\n return a.allowMinus && (\"-\" === e || e === a.negationSymbol.front);\n }\n },\n \"-\": {\n validator: function(e, t, i, n, a) {\n return a.allowMinus && e === a.negationSymbol.back;\n }\n }\n },\n preValidation: function(e, t, i, n, a, r, o, s) {\n if (!1 !== a.__financeInput && i === a.radixPoint) return !1;\n var l = e.indexOf(a.radixPoint), c = t;\n if (t = function(e, t, i, n, a) {\n return a._radixDance && a.numericInput && t !== a.negationSymbol.back && e <= i && (i > 0 || t == a.radixPoint) && (void 0 === n.validPositions[e - 1] || n.validPositions[e - 1].input !== a.negationSymbol.back) && (e -= 1), \n e;\n }(t, i, l, r, a), \"-\" === i || i === a.negationSymbol.front) {\n if (!0 !== a.allowMinus) return !1;\n var u = !1, p = d(\"+\", r), h = d(\"-\", r);\n return -1 !== p && (u = [ p, h ]), !1 !== u ? {\n remove: u,\n caret: c - a.negationSymbol.back.length\n } : {\n insert: [ {\n pos: f.call(this, \"+\", r),\n c: a.negationSymbol.front,\n fromIsValid: !0\n }, {\n pos: f.call(this, \"-\", r),\n c: a.negationSymbol.back,\n fromIsValid: void 0\n } ],\n caret: c + a.negationSymbol.back.length\n };\n }\n if (i === a.groupSeparator) return {\n caret: c\n };\n if (s) return !0;\n if (-1 !== l && !0 === a._radixDance && !1 === n && i === a.radixPoint && void 0 !== a.digits && (isNaN(a.digits) || parseInt(a.digits) > 0) && l !== t) return {\n caret: a._radixDance && t === l - 1 ? l + 1 : l\n };\n if (!1 === a.__financeInput) if (n) {\n if (a.digitsOptional) return {\n rewritePosition: o.end\n };\n if (!a.digitsOptional) {\n if (o.begin > l && o.end <= l) return i === a.radixPoint ? {\n insert: {\n pos: l + 1,\n c: \"0\",\n fromIsValid: !0\n },\n rewritePosition: l\n } : {\n rewritePosition: l + 1\n };\n if (o.begin < l) return {\n rewritePosition: o.begin - 1\n };\n }\n } else if (!a.showMaskOnHover && !a.showMaskOnFocus && !a.digitsOptional && a.digits > 0 && \"\" === this.__valueGet.call(this.el)) return {\n rewritePosition: l\n };\n return {\n rewritePosition: t\n };\n },\n postValidation: function(e, t, i, n, a, r, o) {\n if (!1 === n) return n;\n if (o) return !0;\n if (null !== a.min || null !== a.max) {\n var s = a.onUnMask(e.slice().reverse().join(\"\"), void 0, l.extend({}, a, {\n unmaskAsNumber: !0\n }));\n if (null !== a.min && s < a.min && (s.toString().length > a.min.toString().length || s < 0)) return !1;\n if (null !== a.max && s > a.max) return !!a.SetMaxOnOverflow && {\n refreshFromBuffer: !0,\n buffer: u(a.max.toString().replace(\".\", a.radixPoint).split(\"\"), a.digits, a).reverse()\n };\n }\n return n;\n },\n onUnMask: function(e, t, i) {\n if (\"\" === t && !0 === i.nullable) return t;\n var n = e.replace(i.prefix, \"\");\n return n = (n = n.replace(i.suffix, \"\")).replace(new RegExp((0, a.default)(i.groupSeparator), \"g\"), \"\"), \n \"\" !== i.placeholder.charAt(0) && (n = n.replace(new RegExp(i.placeholder.charAt(0), \"g\"), \"0\")), \n i.unmaskAsNumber ? (\"\" !== i.radixPoint && -1 !== n.indexOf(i.radixPoint) && (n = n.replace(a.default.call(this, i.radixPoint), \".\")), \n n = (n = n.replace(new RegExp(\"^\" + (0, a.default)(i.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n a.default)(i.negationSymbol.back) + \"$\"), \"\"), Number(n)) : n;\n },\n isComplete: function(e, t) {\n var i = (t.numericInput ? e.slice().reverse() : e).join(\"\");\n return i = (i = (i = (i = (i = i.replace(new RegExp(\"^\" + (0, a.default)(t.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n a.default)(t.negationSymbol.back) + \"$\"), \"\")).replace(t.prefix, \"\")).replace(t.suffix, \"\")).replace(new RegExp((0, \n a.default)(t.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\"), \",\" === t.radixPoint && (i = i.replace((0, \n a.default)(t.radixPoint), \".\")), isFinite(i);\n },\n onBeforeMask: function(e, t) {\n var i = t.radixPoint || \",\";\n isFinite(t.digits) && (t.digits = parseInt(t.digits)), \"number\" != typeof e && \"number\" !== t.inputType || \"\" === i || (e = e.toString().replace(\".\", i));\n var n = \"-\" === e.charAt(0) || e.charAt(0) === t.negationSymbol.front, r = e.split(i), o = r[0].replace(/[^\\-0-9]/g, \"\"), s = r.length > 1 ? r[1].replace(/[^0-9]/g, \"\") : \"\", l = r.length > 1;\n e = o + (\"\" !== s ? i + s : s);\n var c = 0;\n if (\"\" !== i && (c = t.digitsOptional ? t.digits < s.length ? t.digits : s.length : t.digits, \n \"\" !== s || !t.digitsOptional)) {\n var f = Math.pow(10, c || 1);\n e = e.replace((0, a.default)(i), \".\"), isNaN(parseFloat(e)) || (e = (t.roundingFN(parseFloat(e) * f) / f).toFixed(c)), \n e = e.toString().replace(\".\", i);\n }\n if (0 === t.digits && -1 !== e.indexOf(i) && (e = e.substring(0, e.indexOf(i))), \n null !== t.min || null !== t.max) {\n var d = e.toString().replace(i, \".\");\n null !== t.min && d < t.min ? e = t.min.toString().replace(\".\", i) : null !== t.max && d > t.max && (e = t.max.toString().replace(\".\", i));\n }\n return n && \"-\" !== e.charAt(0) && (e = \"-\" + e), u(e.toString().split(\"\"), c, t, l).join(\"\");\n },\n onBeforeWrite: function(e, t, i, n) {\n function r(e, t) {\n if (!1 !== n.__financeInput || t) {\n var i = e.indexOf(n.radixPoint);\n -1 !== i && e.splice(i, 1);\n }\n if (\"\" !== n.groupSeparator) for (;-1 !== (i = e.indexOf(n.groupSeparator)); ) e.splice(i, 1);\n return e;\n }\n var o, s;\n if (n.stripLeadingZeroes && (s = function(e, t) {\n var i = new RegExp(\"(^\" + (\"\" !== t.negationSymbol.front ? (0, a.default)(t.negationSymbol.front) + \"?\" : \"\") + (0, \n a.default)(t.prefix) + \")(.*)(\" + (0, a.default)(t.suffix) + (\"\" != t.negationSymbol.back ? (0, \n a.default)(t.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(e.slice().reverse().join(\"\")), n = i ? i[2] : \"\", r = !1;\n return n && (n = n.split(t.radixPoint.charAt(0))[0], r = new RegExp(\"^[0\" + t.groupSeparator + \"]*\").exec(n)), \n !(!r || !(r[0].length > 1 || r[0].length > 0 && r[0].length < n.length)) && r;\n }(t, n))) for (var c = t.join(\"\").lastIndexOf(s[0].split(\"\").reverse().join(\"\")) - (s[0] == s.input ? 0 : 1), f = s[0] == s.input ? 1 : 0, d = s[0].length - f; d > 0; d--) delete this.maskset.validPositions[c + d], \n delete t[c + d];\n if (e) switch (e.type) {\n case \"blur\":\n case \"checkval\":\n if (null !== n.min) {\n var p = n.onUnMask(t.slice().reverse().join(\"\"), void 0, l.extend({}, n, {\n unmaskAsNumber: !0\n }));\n if (null !== n.min && p < n.min) return {\n refreshFromBuffer: !0,\n buffer: u(n.min.toString().replace(\".\", n.radixPoint).split(\"\"), n.digits, n).reverse()\n };\n }\n if (t[t.length - 1] === n.negationSymbol.front) {\n var h = new RegExp(\"(^\" + (\"\" != n.negationSymbol.front ? (0, a.default)(n.negationSymbol.front) + \"?\" : \"\") + (0, \n a.default)(n.prefix) + \")(.*)(\" + (0, a.default)(n.suffix) + (\"\" != n.negationSymbol.back ? (0, \n a.default)(n.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(r(t.slice(), !0).reverse().join(\"\"));\n 0 == (h ? h[2] : \"\") && (o = {\n refreshFromBuffer: !0,\n buffer: [ 0 ]\n });\n } else if (\"\" !== n.radixPoint) {\n t.indexOf(n.radixPoint) === n.suffix.length && (o && o.buffer ? o.buffer.splice(0, 1 + n.suffix.length) : (t.splice(0, 1 + n.suffix.length), \n o = {\n refreshFromBuffer: !0,\n buffer: r(t)\n }));\n }\n if (n.enforceDigitsOnBlur) {\n var v = (o = o || {}) && o.buffer || t.slice().reverse();\n o.refreshFromBuffer = !0, o.buffer = u(v, n.digits, n, !0).reverse();\n }\n }\n return o;\n },\n onKeyDown: function(e, t, i, n) {\n var a, r = l(this);\n if (3 != e.location) {\n var s, c = e.key;\n if ((s = n.shortcuts && n.shortcuts[c]) && s.length > 1) return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) * parseInt(s)), \n r.trigger(\"setvalue\"), !1;\n }\n if (e.ctrlKey) switch (e.key) {\n case o.keys.ArrowUp:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(n.step)), \n r.trigger(\"setvalue\"), !1;\n\n case o.keys.ArrowDown:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(n.step)), \n r.trigger(\"setvalue\"), !1;\n }\n if (!e.shiftKey && (e.key === o.keys.Delete || e.key === o.keys.Backspace || e.key === o.keys.BACKSPACE_SAFARI) && i.begin !== t.length) {\n if (t[e.key === o.keys.Delete ? i.begin - 1 : i.end] === n.negationSymbol.front) return a = t.slice().reverse(), \n \"\" !== n.negationSymbol.front && a.shift(), \"\" !== n.negationSymbol.back && a.pop(), \n r.trigger(\"setvalue\", [ a.join(\"\"), i.begin ]), !1;\n if (!0 === n._radixDance) {\n var f = t.indexOf(n.radixPoint);\n if (n.digitsOptional) {\n if (0 === f) return (a = t.slice().reverse()).pop(), r.trigger(\"setvalue\", [ a.join(\"\"), i.begin >= a.length ? a.length : i.begin ]), \n !1;\n } else if (-1 !== f && (i.begin < f || i.end < f || e.key === o.keys.Delete && (i.begin === f || i.begin - 1 === f))) {\n var d = void 0;\n return i.begin === i.end && (e.key === o.keys.Backspace || e.key === o.keys.BACKSPACE_SAFARI ? i.begin++ : e.key === o.keys.Delete && i.begin - 1 === f && (d = l.extend({}, i), \n i.begin--, i.end--)), (a = t.slice().reverse()).splice(a.length - i.begin, i.begin - i.end + 1), \n a = u(a, n.digits, n).join(\"\"), d && (i = d), r.trigger(\"setvalue\", [ a, i.begin >= a.length ? f + 1 : i.begin ]), \n !1;\n }\n }\n }\n }\n },\n currency: {\n prefix: \"\",\n groupSeparator: \",\",\n alias: \"numeric\",\n digits: 2,\n digitsOptional: !1\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n inputmode: \"numeric\",\n digits: 0\n },\n percentage: {\n alias: \"numeric\",\n min: 0,\n max: 100,\n suffix: \" %\",\n digits: 0,\n allowMinus: !1\n },\n indianns: {\n alias: \"numeric\",\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"99){*|1}(\" + e.groupSeparator + \"999){1|1}\";\n },\n groupSeparator: \",\",\n radixPoint: \".\",\n placeholder: \"0\",\n digits: 2,\n digitsOptional: !1\n }\n });\n },\n 9380: function(e, t, i) {\n var n;\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var a = ((n = i(8741)) && n.__esModule ? n : {\n default: n\n }).default ? window : {};\n t.default = a;\n },\n 7760: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.HandleNativePlaceholder = function(e, t) {\n var i = e ? e.inputmask : this;\n if (s.ie) {\n if (e.inputmask._valueGet() !== t && (e.placeholder !== t || \"\" === e.placeholder)) {\n var n = r.getBuffer.call(i).slice(), a = e.inputmask._valueGet();\n if (a !== t) {\n var o = r.getLastValidPosition.call(i);\n -1 === o && a === r.getBufferTemplate.call(i).join(\"\") ? n = [] : -1 !== o && u.call(i, n), \n d(e, n);\n }\n }\n } else e.placeholder !== t && (e.placeholder = t, \"\" === e.placeholder && e.removeAttribute(\"placeholder\"));\n }, t.applyInputValue = c, t.checkVal = f, t.clearOptionalTail = u, t.unmaskedvalue = function(e) {\n var t = e ? e.inputmask : this, i = t.opts, n = t.maskset;\n if (e) {\n if (void 0 === e.inputmask) return e.value;\n e.inputmask && e.inputmask.refreshValue && c(e, e.inputmask._valueGet(!0));\n }\n for (var a = [], o = n.validPositions, s = 0, l = o.length; s < l; s++) o[s] && o[s].match && (1 != o[s].match.static || Array.isArray(n.metadata) && !0 !== o[s].generatedInput) && a.push(o[s].input);\n var u = 0 === a.length ? \"\" : (t.isRTL ? a.reverse() : a).join(\"\");\n if (\"function\" == typeof i.onUnMask) {\n var f = (t.isRTL ? r.getBuffer.call(t).slice().reverse() : r.getBuffer.call(t)).join(\"\");\n u = i.onUnMask.call(t, f, u, i);\n }\n return u;\n }, t.writeBuffer = d;\n var n = i(2839), a = i(4713), r = i(8711), o = i(7215), s = i(9845), l = i(6030);\n function c(e, t) {\n var i = e ? e.inputmask : this, n = i.opts;\n e.inputmask.refreshValue = !1, \"function\" == typeof n.onBeforeMask && (t = n.onBeforeMask.call(i, t, n) || t), \n f(e, !0, !1, t = (t || \"\").toString().split(\"\")), i.undoValue = i._valueGet(!0), \n (n.clearMaskOnLostFocus || n.clearIncomplete) && e.inputmask._valueGet() === r.getBufferTemplate.call(i).join(\"\") && -1 === r.getLastValidPosition.call(i) && e.inputmask._valueSet(\"\");\n }\n function u(e) {\n e.length = 0;\n for (var t, i = a.getMaskTemplate.call(this, !0, 0, !0, void 0, !0); void 0 !== (t = i.shift()); ) e.push(t);\n return e;\n }\n function f(e, t, i, n, s) {\n var c = e ? e.inputmask : this, u = c.maskset, f = c.opts, p = c.dependencyLib, h = n.slice(), v = \"\", m = -1, g = void 0, y = f.skipOptionalPartCharacter;\n f.skipOptionalPartCharacter = \"\", r.resetMaskSet.call(c), u.tests = {}, m = f.radixPoint ? r.determineNewCaretPosition.call(c, {\n begin: 0,\n end: 0\n }, !1, !1 === f.__financeInput ? \"radixFocus\" : void 0).begin : 0, u.p = m, c.caretPos = {\n begin: m\n };\n var k = [], b = c.caretPos;\n if (h.forEach((function(e, t) {\n if (void 0 !== e) {\n var n = new p.Event(\"_checkval\");\n n.key = e, v += e;\n var o = r.getLastValidPosition.call(c, void 0, !0);\n !function(e, t) {\n for (var i = a.getMaskTemplate.call(c, !0, 0).slice(e, r.seekNext.call(c, e, !1, !1)).join(\"\").replace(/'/g, \"\"), n = i.indexOf(t); n > 0 && \" \" === i[n - 1]; ) n--;\n var o = 0 === n && !r.isMask.call(c, e) && (a.getTest.call(c, e).match.nativeDef === t.charAt(0) || !0 === a.getTest.call(c, e).match.static && a.getTest.call(c, e).match.nativeDef === \"'\" + t.charAt(0) || \" \" === a.getTest.call(c, e).match.nativeDef && (a.getTest.call(c, e + 1).match.nativeDef === t.charAt(0) || !0 === a.getTest.call(c, e + 1).match.static && a.getTest.call(c, e + 1).match.nativeDef === \"'\" + t.charAt(0)));\n if (!o && n > 0 && !r.isMask.call(c, e, !1, !0)) {\n var s = r.seekNext.call(c, e);\n c.caretPos.begin < s && (c.caretPos = {\n begin: s\n });\n }\n return o;\n }(m, v) ? (g = l.EventHandlers.keypressEvent.call(c, n, !0, !1, i, c.caretPos.begin)) && (m = c.caretPos.begin + 1, \n v = \"\") : g = l.EventHandlers.keypressEvent.call(c, n, !0, !1, i, o + 1), g ? (void 0 !== g.pos && u.validPositions[g.pos] && !0 === u.validPositions[g.pos].match.static && void 0 === u.validPositions[g.pos].alternation && (k.push(g.pos), \n c.isRTL || (g.forwardPosition = g.pos + 1)), d.call(c, void 0, r.getBuffer.call(c), g.forwardPosition, n, !1), \n c.caretPos = {\n begin: g.forwardPosition,\n end: g.forwardPosition\n }, b = c.caretPos) : void 0 === u.validPositions[t] && h[t] === a.getPlaceholder.call(c, t) && r.isMask.call(c, t, !0) ? c.caretPos.begin++ : c.caretPos = b;\n }\n })), k.length > 0) {\n var x, P, w = r.seekNext.call(c, -1, void 0, !1);\n if (!o.isComplete.call(c, r.getBuffer.call(c)) && k.length <= w || o.isComplete.call(c, r.getBuffer.call(c)) && k.length > 0 && k.length !== w && 0 === k[0]) for (var S = w; void 0 !== (x = k.shift()); ) {\n var M = new p.Event(\"_checkval\");\n if ((P = u.validPositions[x]).generatedInput = !0, M.key = P.input, (g = l.EventHandlers.keypressEvent.call(c, M, !0, !1, i, S)) && void 0 !== g.pos && g.pos !== x && u.validPositions[g.pos] && !0 === u.validPositions[g.pos].match.static) k.push(g.pos); else if (!g) break;\n S++;\n }\n }\n t && d.call(c, e, r.getBuffer.call(c), g ? g.forwardPosition : c.caretPos.begin, s || new p.Event(\"checkval\"), s && (\"input\" === s.type && c.undoValue !== r.getBuffer.call(c).join(\"\") || \"paste\" === s.type)), \n f.skipOptionalPartCharacter = y;\n }\n function d(e, t, i, a, s) {\n var l = e ? e.inputmask : this, c = l.opts, u = l.dependencyLib;\n if (a && \"function\" == typeof c.onBeforeWrite) {\n var f = c.onBeforeWrite.call(l, a, t, i, c);\n if (f) {\n if (f.refreshFromBuffer) {\n var d = f.refreshFromBuffer;\n o.refreshFromBuffer.call(l, !0 === d ? d : d.start, d.end, f.buffer || t), t = r.getBuffer.call(l, !0);\n }\n void 0 !== i && (i = void 0 !== f.caret ? f.caret : i);\n }\n }\n if (void 0 !== e && (e.inputmask._valueSet(t.join(\"\")), void 0 === i || void 0 !== a && \"blur\" === a.type || r.caret.call(l, e, i, void 0, void 0, void 0 !== a && \"keydown\" === a.type && (a.key === n.keys.Delete || a.key === n.keys.Backspace)), \n !0 === s)) {\n var p = u(e), h = e.inputmask._valueGet();\n e.inputmask.skipInputEvent = !0, p.trigger(\"input\"), setTimeout((function() {\n h === r.getBufferTemplate.call(l).join(\"\") ? p.trigger(\"cleared\") : !0 === o.isComplete.call(l, t) && p.trigger(\"complete\");\n }), 0);\n }\n }\n },\n 2394: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = i(157), a = m(i(4963)), r = m(i(9380)), o = i(2391), s = i(4713), l = i(8711), c = i(7215), u = i(7760), f = i(9716), d = m(i(7392)), p = m(i(3976)), h = m(i(8741));\n function v(e) {\n return v = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, v(e);\n }\n function m(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var g = r.default.document, y = \"_inputmask_opts\";\n function k(e, t, i) {\n if (h.default) {\n if (!(this instanceof k)) return new k(e, t, i);\n this.dependencyLib = a.default, this.el = void 0, this.events = {}, this.maskset = void 0, \n !0 !== i && (\"[object Object]\" === Object.prototype.toString.call(e) ? t = e : (t = t || {}, \n e && (t.alias = e)), this.opts = a.default.extend(!0, {}, this.defaults, t), this.noMasksCache = t && void 0 !== t.definitions, \n this.userOptions = t || {}, b(this.opts.alias, t, this.opts)), this.refreshValue = !1, \n this.undoValue = void 0, this.$el = void 0, this.skipInputEvent = !1, this.validationEvent = !1, \n this.ignorable = !1, this.maxLength, this.mouseEnter = !1, this.clicked = 0, this.originalPlaceholder = void 0, \n this.isComposing = !1, this.hasAlternator = !1;\n }\n }\n function b(e, t, i) {\n var n = k.prototype.aliases[e];\n return n ? (n.alias && b(n.alias, void 0, i), a.default.extend(!0, i, n), a.default.extend(!0, i, t), \n !0) : (null === i.mask && (i.mask = e), !1);\n }\n k.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: p.default,\n definitions: d.default,\n aliases: {},\n masksCache: {},\n get isRTL() {\n return this.opts.isRTL || this.opts.numericInput;\n },\n mask: function(e) {\n var t = this;\n return \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), \n (e = e.nodeName ? [ e ] : Array.isArray(e) ? e : [].slice.call(e)).forEach((function(e, i) {\n var s = a.default.extend(!0, {}, t.opts);\n if (function(e, t, i, n) {\n function o(t, a) {\n var o = \"\" === n ? t : n + \"-\" + t;\n null !== (a = void 0 !== a ? a : e.getAttribute(o)) && (\"string\" == typeof a && (0 === t.indexOf(\"on\") ? a = r.default[a] : \"false\" === a ? a = !1 : \"true\" === a && (a = !0)), \n i[t] = a);\n }\n if (!0 === t.importDataAttributes) {\n var s, l, c, u, f = e.getAttribute(n);\n if (f && \"\" !== f && (f = f.replace(/'/g, '\"'), l = JSON.parse(\"{\" + f + \"}\")), \n l) for (u in c = void 0, l) if (\"alias\" === u.toLowerCase()) {\n c = l[u];\n break;\n }\n for (s in o(\"alias\", c), i.alias && b(i.alias, i, t), t) {\n if (l) for (u in c = void 0, l) if (u.toLowerCase() === s.toLowerCase()) {\n c = l[u];\n break;\n }\n o(s, c);\n }\n }\n a.default.extend(!0, t, i), (\"rtl\" === e.dir || t.rightAlign) && (e.style.textAlign = \"right\");\n (\"rtl\" === e.dir || t.numericInput) && (e.dir = \"ltr\", e.removeAttribute(\"dir\"), \n t.isRTL = !0);\n return Object.keys(i).length;\n }(e, s, a.default.extend(!0, {}, t.userOptions), t.dataAttribute)) {\n var l = (0, o.generateMaskSet)(s, t.noMasksCache);\n void 0 !== l && (void 0 !== e.inputmask && (e.inputmask.opts.autoUnmask = !0, e.inputmask.remove()), \n e.inputmask = new k(void 0, void 0, !0), e.inputmask.opts = s, e.inputmask.noMasksCache = t.noMasksCache, \n e.inputmask.userOptions = a.default.extend(!0, {}, t.userOptions), e.inputmask.el = e, \n e.inputmask.$el = (0, a.default)(e), e.inputmask.maskset = l, a.default.data(e, y, t.userOptions), \n n.mask.call(e.inputmask));\n }\n })), e && e[0] && e[0].inputmask || this;\n },\n option: function(e, t) {\n return \"string\" == typeof e ? this.opts[e] : \"object\" === v(e) ? (a.default.extend(this.userOptions, e), \n this.el && !0 !== t && this.mask(this.el), this) : void 0;\n },\n unmaskedvalue: function(e) {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n void 0 === this.el || void 0 !== e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !1, !1, t), \"function\" == typeof this.opts.onBeforeWrite && this.opts.onBeforeWrite.call(this, void 0, l.getBuffer.call(this), 0, this.opts);\n }\n return u.unmaskedvalue.call(this, this.el);\n },\n remove: function() {\n if (this.el) {\n a.default.data(this.el, y, null);\n var e = this.opts.autoUnmask ? (0, u.unmaskedvalue)(this.el) : this._valueGet(this.opts.autoUnmask);\n e !== l.getBufferTemplate.call(this).join(\"\") ? this._valueSet(e, this.opts.autoUnmask) : this._valueSet(\"\"), \n f.EventRuler.off(this.el), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.el), \"value\") && this.__valueGet && Object.defineProperty(this.el, \"value\", {\n get: this.__valueGet,\n set: this.__valueSet,\n configurable: !0\n }) : g.__lookupGetter__ && this.el.__lookupGetter__(\"value\") && this.__valueGet && (this.el.__defineGetter__(\"value\", this.__valueGet), \n this.el.__defineSetter__(\"value\", this.__valueSet)), this.el.inputmask = void 0;\n }\n return this.el;\n },\n getemptymask: function() {\n return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n (this.isRTL ? l.getBufferTemplate.call(this).reverse() : l.getBufferTemplate.call(this)).join(\"\");\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n c.isComplete.call(this, l.getBuffer.call(this));\n },\n getmetadata: function() {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n Array.isArray(this.maskset.metadata)) {\n var e = s.getMaskTemplate.call(this, !0, 0, !1).join(\"\");\n return this.maskset.metadata.forEach((function(t) {\n return t.mask !== e || (e = t, !1);\n })), e;\n }\n return this.maskset.metadata;\n },\n isValid: function(e) {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !0, !1, t);\n } else e = this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\");\n for (var i = l.getBuffer.call(this), n = l.determineLastRequiredPosition.call(this), a = i.length - 1; a > n && !l.isMask.call(this, a); a--) ;\n return i.splice(n, a + 1 - n), c.isComplete.call(this, i) && e === (this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\"));\n },\n format: function(e, t) {\n this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache);\n var i = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !0, !1, i);\n var n = this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\");\n return t ? {\n value: n,\n metadata: this.getmetadata()\n } : n;\n },\n setValue: function(e) {\n this.el && (0, a.default)(this.el).trigger(\"setvalue\", [ e ]);\n },\n analyseMask: o.analyseMask\n }, k.extendDefaults = function(e) {\n a.default.extend(!0, k.prototype.defaults, e);\n }, k.extendDefinitions = function(e) {\n a.default.extend(!0, k.prototype.definitions, e);\n }, k.extendAliases = function(e) {\n a.default.extend(!0, k.prototype.aliases, e);\n }, k.format = function(e, t, i) {\n return k(t).format(e, i);\n }, k.unmask = function(e, t) {\n return k(t).unmaskedvalue(e);\n }, k.isValid = function(e, t) {\n return k(t).isValid(e);\n }, k.remove = function(e) {\n \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask && e.inputmask.remove();\n }));\n }, k.setValue = function(e, t) {\n \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask ? e.inputmask.setValue(t) : (0, a.default)(e).trigger(\"setvalue\", [ t ]);\n }));\n }, k.dependencyLib = a.default, r.default.Inputmask = k;\n var x = k;\n t.default = x;\n },\n 5296: function(e, t, i) {\n function n(e) {\n return n = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, n(e);\n }\n var a = h(i(9380)), r = h(i(2394)), o = h(i(8741));\n function s(e, t) {\n for (var i = 0; i < t.length; i++) {\n var a = t[i];\n a.enumerable = a.enumerable || !1, a.configurable = !0, \"value\" in a && (a.writable = !0), \n Object.defineProperty(e, (r = a.key, o = void 0, o = function(e, t) {\n if (\"object\" !== n(e) || null === e) return e;\n var i = e[Symbol.toPrimitive];\n if (void 0 !== i) {\n var a = i.call(e, t || \"default\");\n if (\"object\" !== n(a)) return a;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(r, \"string\"), \"symbol\" === n(o) ? o : String(o)), a);\n }\n var r, o;\n }\n function l(e) {\n var t = f();\n return function() {\n var i, a = p(e);\n if (t) {\n var r = p(this).constructor;\n i = Reflect.construct(a, arguments, r);\n } else i = a.apply(this, arguments);\n return function(e, t) {\n if (t && (\"object\" === n(t) || \"function\" == typeof t)) return t;\n if (void 0 !== t) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return function(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n }(e);\n }(this, i);\n };\n }\n function c(e) {\n var t = \"function\" == typeof Map ? new Map : void 0;\n return c = function(e) {\n if (null === e || (i = e, -1 === Function.toString.call(i).indexOf(\"[native code]\"))) return e;\n var i;\n if (\"function\" != typeof e) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== t) {\n if (t.has(e)) return t.get(e);\n t.set(e, n);\n }\n function n() {\n return u(e, arguments, p(this).constructor);\n }\n return n.prototype = Object.create(e.prototype, {\n constructor: {\n value: n,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), d(n, e);\n }, c(e);\n }\n function u(e, t, i) {\n return u = f() ? Reflect.construct.bind() : function(e, t, i) {\n var n = [ null ];\n n.push.apply(n, t);\n var a = new (Function.bind.apply(e, n));\n return i && d(a, i.prototype), a;\n }, u.apply(null, arguments);\n }\n function f() {\n if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n if (Reflect.construct.sham) return !1;\n if (\"function\" == typeof Proxy) return !0;\n try {\n return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), \n !0;\n } catch (e) {\n return !1;\n }\n }\n function d(e, t) {\n return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {\n return e.__proto__ = t, e;\n }, d(e, t);\n }\n function p(e) {\n return p = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {\n return e.__proto__ || Object.getPrototypeOf(e);\n }, p(e);\n }\n function h(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var v = a.default.document;\n if (o.default && v && v.head && v.head.attachShadow && a.default.customElements && void 0 === a.default.customElements.get(\"input-mask\")) {\n var m = function(e) {\n !function(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function\");\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), t && d(e, t);\n }(o, e);\n var t, i, n, a = l(o);\n function o() {\n var e;\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, o);\n var t = (e = a.call(this)).getAttributeNames(), i = e.attachShadow({\n mode: \"closed\"\n }), n = v.createElement(\"input\");\n for (var s in n.type = \"text\", i.appendChild(n), t) Object.prototype.hasOwnProperty.call(t, s) && n.setAttribute(t[s], e.getAttribute(t[s]));\n var l = new r.default;\n return l.dataAttribute = \"\", l.mask(n), n.inputmask.shadowRoot = i, e;\n }\n return t = o, i && s(t.prototype, i), n && s(t, n), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), t;\n }(c(HTMLElement));\n a.default.customElements.define(\"input-mask\", m);\n }\n },\n 2839: function(e, t) {\n function i(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return n(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return n(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function n(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.keys = t.keyCode = void 0, t.toKey = function(e, t) {\n return r[e] || (t ? String.fromCharCode(e) : String.fromCharCode(e).toLowerCase());\n }, t.toKeyCode = function(e) {\n return a[e];\n };\n var a = {\n AltGraph: 18,\n ArrowDown: 40,\n ArrowLeft: 37,\n ArrowRight: 39,\n ArrowUp: 38,\n Backspace: 8,\n BACKSPACE_SAFARI: 127,\n CapsLock: 20,\n Delete: 46,\n End: 35,\n Enter: 13,\n Escape: 27,\n Home: 36,\n Insert: 45,\n PageDown: 34,\n PageUp: 33,\n Space: 32,\n Tab: 9,\n c: 67,\n x: 88,\n z: 90,\n Shift: 16,\n Control: 17,\n Alt: 18,\n Pause: 19,\n Meta_LEFT: 91,\n Meta_RIGHT: 92,\n ContextMenu: 93,\n Process: 229,\n Unidentified: 229,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123\n };\n t.keyCode = a;\n var r = Object.entries(a).reduce((function(e, t) {\n var n = i(t, 2), a = n[0], r = n[1];\n return e[r] = void 0 === e[r] ? a : e[r], e;\n }), {}), o = Object.entries(a).reduce((function(e, t) {\n var n = i(t, 2), a = n[0];\n n[1];\n return e[a] = \"Space\" === a ? \" \" : a, e;\n }), {});\n t.keys = o;\n },\n 2391: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.analyseMask = function(e, t, i) {\n var n, o, s, l, c, u, f = /(?:[?*+]|\\{[0-9+*]+(?:,[0-9+*]*)?(?:\\|[0-9+*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, d = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, p = !1, h = new a.default, v = [], m = [], g = !1;\n function y(e, n, a) {\n a = void 0 !== a ? a : e.matches.length;\n var o = e.matches[a - 1];\n if (t) {\n if (0 === n.indexOf(\"[\") || p && /\\\\d|\\\\s|\\\\w|\\\\p/i.test(n) || \".\" === n) {\n var s = i.casing ? \"i\" : \"\";\n /^\\\\p\\{.*}$/i.test(n) && (s += \"u\"), e.matches.splice(a++, 0, {\n fn: new RegExp(n, s),\n static: !1,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== n,\n casing: null,\n def: n,\n placeholder: void 0,\n nativeDef: n\n });\n } else p && (n = n[n.length - 1]), n.split(\"\").forEach((function(t, n) {\n o = e.matches[a - 1], e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(i.staticDefinitionSymbol || t) ? new RegExp(\"[\" + (i.staticDefinitionSymbol || t) + \"]\", i.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== t && !0 !== o.static,\n casing: null,\n def: i.staticDefinitionSymbol || t,\n placeholder: void 0 !== i.staticDefinitionSymbol ? t : void 0,\n nativeDef: (p ? \"'\" : \"\") + t\n });\n }));\n p = !1;\n } else {\n var l = i.definitions && i.definitions[n] || i.usePrototypeDefinitions && r.default.prototype.definitions[n];\n l && !p ? e.matches.splice(a++, 0, {\n fn: l.validator ? \"string\" == typeof l.validator ? new RegExp(l.validator, i.casing ? \"i\" : \"\") : new function() {\n this.test = l.validator;\n } : new RegExp(\".\"),\n static: l.static || !1,\n optionality: l.optional || !1,\n defOptionality: l.optional || !1,\n newBlockMarker: void 0 === o || l.optional ? \"master\" : o.def !== (l.definitionSymbol || n),\n casing: l.casing,\n def: l.definitionSymbol || n,\n placeholder: l.placeholder,\n nativeDef: n,\n generated: l.generated\n }) : (e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(i.staticDefinitionSymbol || n) ? new RegExp(\"[\" + (i.staticDefinitionSymbol || n) + \"]\", i.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== n && !0 !== o.static,\n casing: null,\n def: i.staticDefinitionSymbol || n,\n placeholder: void 0 !== i.staticDefinitionSymbol ? n : void 0,\n nativeDef: (p ? \"'\" : \"\") + n\n }), p = !1);\n }\n }\n function k() {\n if (v.length > 0) {\n if (y(l = v[v.length - 1], o), l.isAlternator) {\n c = v.pop();\n for (var e = 0; e < c.matches.length; e++) c.matches[e].isGroup && (c.matches[e].isGroup = !1);\n v.length > 0 ? (l = v[v.length - 1]).matches.push(c) : h.matches.push(c);\n }\n } else y(h, o);\n }\n function b(e) {\n var t = new a.default(!0);\n return t.openGroup = !1, t.matches = e, t;\n }\n function x() {\n if ((s = v.pop()).openGroup = !1, void 0 !== s) if (v.length > 0) {\n if ((l = v[v.length - 1]).matches.push(s), l.isAlternator) {\n for (var e = (c = v.pop()).matches[0].matches ? c.matches[0].matches.length : 1, t = 0; t < c.matches.length; t++) c.matches[t].isGroup = !1, \n c.matches[t].alternatorGroup = !1, null === i.keepStatic && e < (c.matches[t].matches ? c.matches[t].matches.length : 1) && (i.keepStatic = !0), \n e = c.matches[t].matches ? c.matches[t].matches.length : 1;\n v.length > 0 ? (l = v[v.length - 1]).matches.push(c) : h.matches.push(c);\n }\n } else h.matches.push(s); else k();\n }\n function P(e) {\n var t = e.pop();\n return t.isQuantifier && (t = b([ e.pop(), t ])), t;\n }\n t && (i.optionalmarker[0] = void 0, i.optionalmarker[1] = void 0);\n for (;n = t ? d.exec(e) : f.exec(e); ) {\n if (o = n[0], t) {\n switch (o.charAt(0)) {\n case \"?\":\n o = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n o = \"{\" + o + \"}\";\n break;\n\n case \"|\":\n if (0 === v.length) {\n var w = b(h.matches);\n w.openGroup = !0, v.push(w), h.matches = [], g = !0;\n }\n }\n switch (o) {\n case \"\\\\d\":\n o = \"[0-9]\";\n break;\n\n case \"\\\\p\":\n o += d.exec(e)[0], o += d.exec(e)[0];\n }\n }\n if (p) k(); else switch (o.charAt(0)) {\n case \"$\":\n case \"^\":\n t || k();\n break;\n\n case i.escapeChar:\n p = !0, t && k();\n break;\n\n case i.optionalmarker[1]:\n case i.groupmarker[1]:\n x();\n break;\n\n case i.optionalmarker[0]:\n v.push(new a.default(!1, !0));\n break;\n\n case i.groupmarker[0]:\n v.push(new a.default(!0));\n break;\n\n case i.quantifiermarker[0]:\n var S = new a.default(!1, !1, !0), M = (o = o.replace(/[{}?]/g, \"\")).split(\"|\"), _ = M[0].split(\",\"), O = isNaN(_[0]) ? _[0] : parseInt(_[0]), E = 1 === _.length ? O : isNaN(_[1]) ? _[1] : parseInt(_[1]), T = isNaN(M[1]) ? M[1] : parseInt(M[1]);\n \"*\" !== O && \"+\" !== O || (O = \"*\" === E ? 0 : 1), S.quantifier = {\n min: O,\n max: E,\n jit: T\n };\n var j = v.length > 0 ? v[v.length - 1].matches : h.matches;\n (n = j.pop()).isGroup || (n = b([ n ])), j.push(n), j.push(S);\n break;\n\n case i.alternatormarker:\n if (v.length > 0) {\n var A = (l = v[v.length - 1]).matches[l.matches.length - 1];\n u = l.openGroup && (void 0 === A.matches || !1 === A.isGroup && !1 === A.isAlternator) ? v.pop() : P(l.matches);\n } else u = P(h.matches);\n if (u.isAlternator) v.push(u); else if (u.alternatorGroup ? (c = v.pop(), u.alternatorGroup = !1) : c = new a.default(!1, !1, !1, !0), \n c.matches.push(u), v.push(c), u.openGroup) {\n u.openGroup = !1;\n var D = new a.default(!0);\n D.alternatorGroup = !0, v.push(D);\n }\n break;\n\n default:\n k();\n }\n }\n g && x();\n for (;v.length > 0; ) s = v.pop(), h.matches.push(s);\n h.matches.length > 0 && (!function e(n) {\n n && n.matches && n.matches.forEach((function(a, r) {\n var o = n.matches[r + 1];\n (void 0 === o || void 0 === o.matches || !1 === o.isQuantifier) && a && a.isGroup && (a.isGroup = !1, \n t || (y(a, i.groupmarker[0], 0), !0 !== a.openGroup && y(a, i.groupmarker[1]))), \n e(a);\n }));\n }(h), m.push(h));\n (i.numericInput || i.isRTL) && function e(t) {\n for (var n in t.matches = t.matches.reverse(), t.matches) if (Object.prototype.hasOwnProperty.call(t.matches, n)) {\n var a = parseInt(n);\n if (t.matches[n].isQuantifier && t.matches[a + 1] && t.matches[a + 1].isGroup) {\n var r = t.matches[n];\n t.matches.splice(n, 1), t.matches.splice(a + 1, 0, r);\n }\n void 0 !== t.matches[n].matches ? t.matches[n] = e(t.matches[n]) : t.matches[n] = ((o = t.matches[n]) === i.optionalmarker[0] ? o = i.optionalmarker[1] : o === i.optionalmarker[1] ? o = i.optionalmarker[0] : o === i.groupmarker[0] ? o = i.groupmarker[1] : o === i.groupmarker[1] && (o = i.groupmarker[0]), \n o);\n }\n var o;\n return t;\n }(m[0]);\n return m;\n }, t.generateMaskSet = function(e, t) {\n var i;\n function a(e, t) {\n var i = t.repeat, n = t.groupmarker, a = t.quantifiermarker, r = t.keepStatic;\n if (i > 0 || \"*\" === i || \"+\" === i) {\n var l = \"*\" === i ? 0 : \"+\" === i ? 1 : i;\n e = n[0] + e + n[1] + a[0] + l + \",\" + i + a[1];\n }\n if (!0 === r) {\n var c = e.match(new RegExp(\"(.)\\\\[([^\\\\]]*)\\\\]\", \"g\"));\n c && c.forEach((function(t, i) {\n var n = function(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return s(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return s(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }(t.split(\"[\"), 2), a = n[0], r = n[1];\n r = r.replace(\"]\", \"\"), e = e.replace(new RegExp(\"\".concat((0, o.default)(a), \"\\\\[\").concat((0, \n o.default)(r), \"\\\\]\")), a.charAt(0) === r.charAt(0) ? \"(\".concat(a, \"|\").concat(a).concat(r, \")\") : \"\".concat(a, \"[\").concat(r, \"]\"));\n }));\n }\n return e;\n }\n function l(e, i, o) {\n var s, l, c = !1;\n return null !== e && \"\" !== e || ((c = null !== o.regex) ? e = (e = o.regex).replace(/^(\\^)(.*)(\\$)$/, \"$2\") : (c = !0, \n e = \".*\")), 1 === e.length && !1 === o.greedy && 0 !== o.repeat && (o.placeholder = \"\"), \n e = a(e, o), l = c ? \"regex_\" + o.regex : o.numericInput ? e.split(\"\").reverse().join(\"\") : e, \n null !== o.keepStatic && (l = \"ks_\" + o.keepStatic + l), void 0 === r.default.prototype.masksCache[l] || !0 === t ? (s = {\n mask: e,\n maskToken: r.default.prototype.analyseMask(e, c, o),\n validPositions: [],\n _buffer: void 0,\n buffer: void 0,\n tests: {},\n excludes: {},\n metadata: i,\n maskLength: void 0,\n jitOffset: {}\n }, !0 !== t && (r.default.prototype.masksCache[l] = s, s = n.default.extend(!0, {}, r.default.prototype.masksCache[l]))) : s = n.default.extend(!0, {}, r.default.prototype.masksCache[l]), \n s;\n }\n \"function\" == typeof e.mask && (e.mask = e.mask(e));\n if (Array.isArray(e.mask)) {\n if (e.mask.length > 1) {\n null === e.keepStatic && (e.keepStatic = !0);\n var c = e.groupmarker[0];\n return (e.isRTL ? e.mask.reverse() : e.mask).forEach((function(t) {\n c.length > 1 && (c += e.alternatormarker), void 0 !== t.mask && \"function\" != typeof t.mask ? c += t.mask : c += t;\n })), l(c += e.groupmarker[1], e.mask, e);\n }\n e.mask = e.mask.pop();\n }\n i = e.mask && void 0 !== e.mask.mask && \"function\" != typeof e.mask.mask ? l(e.mask.mask, e.mask, e) : l(e.mask, e.mask, e);\n null === e.keepStatic && (e.keepStatic = !1);\n return i;\n };\n var n = l(i(4963)), a = l(i(9695)), r = l(i(2394)), o = l(i(7184));\n function s(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function l(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n },\n 157: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mask = function() {\n var e = this, t = this.opts, i = this.el, u = this.dependencyLib;\n o.EventRuler.off(i);\n var f = function(t, i) {\n \"textarea\" !== t.tagName.toLowerCase() && i.ignorables.push(n.keys.Enter);\n var s = t.getAttribute(\"type\"), l = \"input\" === t.tagName.toLowerCase() && i.supportsInputType.includes(s) || t.isContentEditable || \"textarea\" === t.tagName.toLowerCase();\n if (!l) if (\"input\" === t.tagName.toLowerCase()) {\n var c = document.createElement(\"input\");\n c.setAttribute(\"type\", s), l = \"text\" === c.type, c = null;\n } else l = \"partial\";\n return !1 !== l ? function(t) {\n var n, s;\n function l() {\n return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== a.getLastValidPosition.call(e) || !0 !== i.nullable ? (this.inputmask.shadowRoot || this.ownerDocument).activeElement === this && i.clearMaskOnLostFocus ? (e.isRTL ? r.clearOptionalTail.call(e, a.getBuffer.call(e).slice()).reverse() : r.clearOptionalTail.call(e, a.getBuffer.call(e).slice())).join(\"\") : n.call(this) : \"\" : n.call(this);\n }\n function c(e) {\n s.call(this, e), this.inputmask && (0, r.applyInputValue)(this, e);\n }\n if (!t.inputmask.__valueGet) {\n if (!0 !== i.noValuePatching) {\n if (Object.getOwnPropertyDescriptor) {\n var f = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), \"value\") : void 0;\n f && f.get && f.set ? (n = f.get, s = f.set, Object.defineProperty(t, \"value\", {\n get: l,\n set: c,\n configurable: !0\n })) : \"input\" !== t.tagName.toLowerCase() && (n = function() {\n return this.textContent;\n }, s = function(e) {\n this.textContent = e;\n }, Object.defineProperty(t, \"value\", {\n get: l,\n set: c,\n configurable: !0\n }));\n } else document.__lookupGetter__ && t.__lookupGetter__(\"value\") && (n = t.__lookupGetter__(\"value\"), \n s = t.__lookupSetter__(\"value\"), t.__defineGetter__(\"value\", l), t.__defineSetter__(\"value\", c));\n t.inputmask.__valueGet = n, t.inputmask.__valueSet = s;\n }\n t.inputmask._valueGet = function(t) {\n return e.isRTL && !0 !== t ? n.call(this.el).split(\"\").reverse().join(\"\") : n.call(this.el);\n }, t.inputmask._valueSet = function(t, i) {\n s.call(this.el, null == t ? \"\" : !0 !== i && e.isRTL ? t.split(\"\").reverse().join(\"\") : t);\n }, void 0 === n && (n = function() {\n return this.value;\n }, s = function(e) {\n this.value = e;\n }, function(t) {\n if (u.valHooks && (void 0 === u.valHooks[t] || !0 !== u.valHooks[t].inputmaskpatch)) {\n var n = u.valHooks[t] && u.valHooks[t].get ? u.valHooks[t].get : function(e) {\n return e.value;\n }, o = u.valHooks[t] && u.valHooks[t].set ? u.valHooks[t].set : function(e, t) {\n return e.value = t, e;\n };\n u.valHooks[t] = {\n get: function(t) {\n if (t.inputmask) {\n if (t.inputmask.opts.autoUnmask) return t.inputmask.unmaskedvalue();\n var r = n(t);\n return -1 !== a.getLastValidPosition.call(e, void 0, void 0, t.inputmask.maskset.validPositions) || !0 !== i.nullable ? r : \"\";\n }\n return n(t);\n },\n set: function(e, t) {\n var i = o(e, t);\n return e.inputmask && (0, r.applyInputValue)(e, t), i;\n },\n inputmaskpatch: !0\n };\n }\n }(t.type), function(e) {\n o.EventRuler.on(e, \"mouseenter\", (function() {\n var e = this, t = e.inputmask._valueGet(!0);\n t != (e.inputmask.isRTL ? a.getBuffer.call(e.inputmask).slice().reverse() : a.getBuffer.call(e.inputmask)).join(\"\") && (0, \n r.applyInputValue)(e, t);\n }));\n }(t));\n }\n }(t) : t.inputmask = void 0, l;\n }(i, t);\n if (!1 !== f) {\n e.originalPlaceholder = i.placeholder, e.maxLength = void 0 !== i ? i.maxLength : void 0, \n -1 === e.maxLength && (e.maxLength = void 0), \"inputMode\" in i && null === i.getAttribute(\"inputmode\") && (i.inputMode = t.inputmode, \n i.setAttribute(\"inputmode\", t.inputmode)), !0 === f && (t.showMaskOnFocus = t.showMaskOnFocus && -1 === [ \"cc-number\", \"cc-exp\" ].indexOf(i.autocomplete), \n s.iphone && (t.insertModeVisual = !1, i.setAttribute(\"autocorrect\", \"off\")), o.EventRuler.on(i, \"submit\", c.EventHandlers.submitEvent), \n o.EventRuler.on(i, \"reset\", c.EventHandlers.resetEvent), o.EventRuler.on(i, \"blur\", c.EventHandlers.blurEvent), \n o.EventRuler.on(i, \"focus\", c.EventHandlers.focusEvent), o.EventRuler.on(i, \"invalid\", c.EventHandlers.invalidEvent), \n o.EventRuler.on(i, \"click\", c.EventHandlers.clickEvent), o.EventRuler.on(i, \"mouseleave\", c.EventHandlers.mouseleaveEvent), \n o.EventRuler.on(i, \"mouseenter\", c.EventHandlers.mouseenterEvent), o.EventRuler.on(i, \"paste\", c.EventHandlers.pasteEvent), \n o.EventRuler.on(i, \"cut\", c.EventHandlers.cutEvent), o.EventRuler.on(i, \"complete\", t.oncomplete), \n o.EventRuler.on(i, \"incomplete\", t.onincomplete), o.EventRuler.on(i, \"cleared\", t.oncleared), \n !0 !== t.inputEventOnly && o.EventRuler.on(i, \"keydown\", c.EventHandlers.keyEvent), \n (s.mobile || t.inputEventOnly) && i.removeAttribute(\"maxLength\"), o.EventRuler.on(i, \"input\", c.EventHandlers.inputFallBackEvent)), \n o.EventRuler.on(i, \"setvalue\", c.EventHandlers.setValueEvent), a.getBufferTemplate.call(e).join(\"\"), \n e.undoValue = e._valueGet(!0);\n var d = (i.inputmask.shadowRoot || i.ownerDocument).activeElement;\n if (\"\" !== i.inputmask._valueGet(!0) || !1 === t.clearMaskOnLostFocus || d === i) {\n (0, r.applyInputValue)(i, i.inputmask._valueGet(!0), t);\n var p = a.getBuffer.call(e).slice();\n !1 === l.isComplete.call(e, p) && t.clearIncomplete && a.resetMaskSet.call(e), t.clearMaskOnLostFocus && d !== i && (-1 === a.getLastValidPosition.call(e) ? p = [] : r.clearOptionalTail.call(e, p)), \n (!1 === t.clearMaskOnLostFocus || t.showMaskOnFocus && d === i || \"\" !== i.inputmask._valueGet(!0)) && (0, \n r.writeBuffer)(i, p), d === i && a.caret.call(e, i, a.seekNext.call(e, a.getLastValidPosition.call(e)));\n }\n }\n };\n var n = i(2839), a = i(8711), r = i(7760), o = i(9716), s = i(9845), l = i(7215), c = i(6030);\n },\n 9695: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, i, n) {\n this.matches = [], this.openGroup = e || !1, this.alternatorGroup = !1, this.isGroup = e || !1, \n this.isOptional = t || !1, this.isQuantifier = i || !1, this.isAlternator = n || !1, \n this.quantifier = {\n min: 1,\n max: 1\n };\n };\n },\n 3194: function() {\n Array.prototype.includes || Object.defineProperty(Array.prototype, \"includes\", {\n value: function(e, t) {\n if (null == this) throw new TypeError('\"this\" is null or not defined');\n var i = Object(this), n = i.length >>> 0;\n if (0 === n) return !1;\n for (var a = 0 | t, r = Math.max(a >= 0 ? a : n - Math.abs(a), 0); r < n; ) {\n if (i[r] === e) return !0;\n r++;\n }\n return !1;\n }\n });\n },\n 9302: function() {\n var e = Function.bind.call(Function.call, Array.prototype.reduce), t = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable), i = Function.bind.call(Function.call, Array.prototype.concat), n = Object.keys;\n Object.entries || (Object.entries = function(a) {\n return e(n(a), (function(e, n) {\n return i(e, \"string\" == typeof n && t(a, n) ? [ [ n, a[n] ] ] : []);\n }), []);\n });\n },\n 7149: function() {\n function e(t) {\n return e = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, e(t);\n }\n \"function\" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = \"object\" === e(\"test\".__proto__) ? function(e) {\n return e.__proto__;\n } : function(e) {\n return e.constructor.prototype;\n });\n },\n 4013: function() {\n String.prototype.includes || (String.prototype.includes = function(e, t) {\n return \"number\" != typeof t && (t = 0), !(t + e.length > this.length) && -1 !== this.indexOf(e, t);\n });\n },\n 8711: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.caret = function(e, t, i, n, a) {\n var r, o = this, s = this.opts;\n if (void 0 === t) return \"selectionStart\" in e && \"selectionEnd\" in e ? (t = e.selectionStart, \n i = e.selectionEnd) : window.getSelection ? (r = window.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode !== e && r.commonAncestorContainer !== e || (t = r.startOffset, \n i = r.endOffset) : document.selection && document.selection.createRange && (i = (t = 0 - (r = document.selection.createRange()).duplicate().moveStart(\"character\", -e.inputmask._valueGet().length)) + r.text.length), \n {\n begin: n ? t : c.call(o, t),\n end: n ? i : c.call(o, i)\n };\n if (Array.isArray(t) && (i = o.isRTL ? t[0] : t[1], t = o.isRTL ? t[1] : t[0]), \n void 0 !== t.begin && (i = o.isRTL ? t.begin : t.end, t = o.isRTL ? t.end : t.begin), \n \"number\" == typeof t) {\n t = n ? t : c.call(o, t), i = \"number\" == typeof (i = n ? i : c.call(o, i)) ? i : t;\n var l = parseInt(((e.ownerDocument.defaultView || window).getComputedStyle ? (e.ownerDocument.defaultView || window).getComputedStyle(e, null) : e.currentStyle).fontSize) * i;\n if (e.scrollLeft = l > e.scrollWidth ? l : 0, e.inputmask.caretPos = {\n begin: t,\n end: i\n }, s.insertModeVisual && !1 === s.insertMode && t === i && (a || i++), e === (e.inputmask.shadowRoot || e.ownerDocument).activeElement) if (\"setSelectionRange\" in e) e.setSelectionRange(t, i); else if (window.getSelection) {\n if (r = document.createRange(), void 0 === e.firstChild || null === e.firstChild) {\n var u = document.createTextNode(\"\");\n e.appendChild(u);\n }\n r.setStart(e.firstChild, t < e.inputmask._valueGet().length ? t : e.inputmask._valueGet().length), \n r.setEnd(e.firstChild, i < e.inputmask._valueGet().length ? i : e.inputmask._valueGet().length), \n r.collapse(!0);\n var f = window.getSelection();\n f.removeAllRanges(), f.addRange(r);\n } else e.createTextRange && ((r = e.createTextRange()).collapse(!0), r.moveEnd(\"character\", i), \n r.moveStart(\"character\", t), r.select());\n }\n }, t.determineLastRequiredPosition = function(e) {\n var t, i, r = this, s = r.maskset, l = r.dependencyLib, c = n.getMaskTemplate.call(r, !0, o.call(r), !0, !0), u = c.length, f = o.call(r), d = {}, p = s.validPositions[f], h = void 0 !== p ? p.locator.slice() : void 0;\n for (t = f + 1; t < c.length; t++) h = (i = n.getTestTemplate.call(r, t, h, t - 1)).locator.slice(), \n d[t] = l.extend(!0, {}, i);\n var v = p && void 0 !== p.alternation ? p.locator[p.alternation] : void 0;\n for (t = u - 1; t > f && (((i = d[t]).match.optionality || i.match.optionalQuantifier && i.match.newBlockMarker || v && (v !== d[t].locator[p.alternation] && 1 != i.match.static || !0 === i.match.static && i.locator[p.alternation] && a.checkAlternationMatch.call(r, i.locator[p.alternation].toString().split(\",\"), v.toString().split(\",\")) && \"\" !== n.getTests.call(r, t)[0].def)) && c[t] === n.getPlaceholder.call(r, t, i.match)); t--) u--;\n return e ? {\n l: u,\n def: d[u] ? d[u].match : void 0\n } : u;\n }, t.determineNewCaretPosition = function(e, t, i) {\n var a = this, c = a.maskset, u = a.opts;\n t && (a.isRTL ? e.end = e.begin : e.begin = e.end);\n if (e.begin === e.end) {\n switch (i = i || u.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n e = {\n begin: 0,\n end: r.call(a).length\n };\n break;\n\n case \"ignore\":\n e.end = e.begin = l.call(a, o.call(a));\n break;\n\n case \"radixFocus\":\n if (a.clicked > 1 && 0 == c.validPositions.length) break;\n if (function(e) {\n if (\"\" !== u.radixPoint && 0 !== u.digits) {\n var t = c.validPositions;\n if (void 0 === t[e] || t[e].input === n.getPlaceholder.call(a, e)) {\n if (e < l.call(a, -1)) return !0;\n var i = r.call(a).indexOf(u.radixPoint);\n if (-1 !== i) {\n for (var o = 0, s = t.length; o < s; o++) if (t[o] && i < o && t[o].input !== n.getPlaceholder.call(a, o)) return !1;\n return !0;\n }\n }\n }\n return !1;\n }(e.begin)) {\n var f = r.call(a).join(\"\").indexOf(u.radixPoint);\n e.end = e.begin = u.numericInput ? l.call(a, f) : f;\n break;\n }\n\n default:\n var d = e.begin, p = o.call(a, d, !0), h = l.call(a, -1 !== p || s.call(a, 0) ? p : -1);\n if (d <= h) e.end = e.begin = s.call(a, d, !1, !0) ? d : l.call(a, d); else {\n var v = c.validPositions[p], m = n.getTestTemplate.call(a, h, v ? v.match.locator : void 0, v), g = n.getPlaceholder.call(a, h, m.match);\n if (\"\" !== g && r.call(a)[h] !== g && !0 !== m.match.optionalQuantifier && !0 !== m.match.newBlockMarker || !s.call(a, h, u.keepStatic, !0) && m.match.def === g) {\n var y = l.call(a, h);\n (d >= y || d === h) && (h = y);\n }\n e.end = e.begin = h;\n }\n }\n return e;\n }\n }, t.getBuffer = r, t.getBufferTemplate = function() {\n var e = this.maskset;\n void 0 === e._buffer && (e._buffer = n.getMaskTemplate.call(this, !1, 1), void 0 === e.buffer && (e.buffer = e._buffer.slice()));\n return e._buffer;\n }, t.getLastValidPosition = o, t.isMask = s, t.resetMaskSet = function(e) {\n var t = this.maskset;\n t.buffer = void 0, !0 !== e && (t.validPositions = [], t.p = 0);\n }, t.seekNext = l, t.seekPrevious = function(e, t) {\n var i = this, a = e - 1;\n if (e <= 0) return 0;\n for (;a > 0 && (!0 === t && (!0 !== n.getTest.call(i, a).match.newBlockMarker || !s.call(i, a, void 0, !0)) || !0 !== t && !s.call(i, a, void 0, !0)); ) a--;\n return a;\n }, t.translatePosition = c;\n var n = i(4713), a = i(7215);\n function r(e) {\n var t = this, i = t.maskset;\n return void 0 !== i.buffer && !0 !== e || (i.buffer = n.getMaskTemplate.call(t, !0, o.call(t), !0), \n void 0 === i._buffer && (i._buffer = i.buffer.slice())), i.buffer;\n }\n function o(e, t, i) {\n var n = this.maskset, a = -1, r = -1, o = i || n.validPositions;\n void 0 === e && (e = -1);\n for (var s = 0, l = o.length; s < l; s++) o[s] && (t || !0 !== o[s].generatedInput) && (s <= e && (a = s), \n s >= e && (r = s));\n return -1 === a || a == e ? r : -1 == r || e - a < r - e ? a : r;\n }\n function s(e, t, i) {\n var a = this, r = this.maskset, o = n.getTestTemplate.call(a, e).match;\n if (\"\" === o.def && (o = n.getTest.call(a, e).match), !0 !== o.static) return o.fn;\n if (!0 === i && void 0 !== r.validPositions[e] && !0 !== r.validPositions[e].generatedInput) return !0;\n if (!0 !== t && e > -1) {\n if (i) {\n var s = n.getTests.call(a, e);\n return s.length > 1 + (\"\" === s[s.length - 1].match.def ? 1 : 0);\n }\n var l = n.determineTestTemplate.call(a, e, n.getTests.call(a, e)), c = n.getPlaceholder.call(a, e, l.match);\n return l.match.def !== c;\n }\n return !1;\n }\n function l(e, t, i) {\n var a = this;\n void 0 === i && (i = !0);\n for (var r = e + 1; \"\" !== n.getTest.call(a, r).match.def && (!0 === t && (!0 !== n.getTest.call(a, r).match.newBlockMarker || !s.call(a, r, void 0, !0)) || !0 !== t && !s.call(a, r, void 0, i)); ) r++;\n return r;\n }\n function c(e) {\n var t = this.opts, i = this.el;\n return !this.isRTL || \"number\" != typeof e || t.greedy && \"\" === t.placeholder || !i || (e = this._valueGet().length - e) < 0 && (e = 0), \n e;\n }\n },\n 4713: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.determineTestTemplate = c, t.getDecisionTaker = o, t.getMaskTemplate = function(e, t, i, n, a) {\n var r = this, o = this.opts, u = this.maskset, f = o.greedy;\n a && o.greedy && (o.greedy = !1, r.maskset.tests = {});\n t = t || 0;\n var p, h, v, m, g = [], y = 0;\n do {\n if (!0 === e && u.validPositions[y]) h = (v = a && u.validPositions[y].match.optionality && void 0 === u.validPositions[y + 1] && (!0 === u.validPositions[y].generatedInput || u.validPositions[y].input == o.skipOptionalPartCharacter && y > 0) ? c.call(r, y, d.call(r, y, p, y - 1)) : u.validPositions[y]).match, \n p = v.locator.slice(), g.push(!0 === i ? v.input : !1 === i ? h.nativeDef : s.call(r, y, h)); else {\n h = (v = l.call(r, y, p, y - 1)).match, p = v.locator.slice();\n var k = !0 !== n && (!1 !== o.jitMasking ? o.jitMasking : h.jit);\n (m = (m && h.static && h.def !== o.groupSeparator && null === h.fn || u.validPositions[y - 1] && h.static && h.def !== o.groupSeparator && null === h.fn) && u.tests[y]) || !1 === k || void 0 === k || \"number\" == typeof k && isFinite(k) && k > y ? g.push(!1 === i ? h.nativeDef : s.call(r, g.length, h)) : m = !1;\n }\n y++;\n } while (!0 !== h.static || \"\" !== h.def || t > y);\n \"\" === g[g.length - 1] && g.pop();\n !1 === i && void 0 !== u.maskLength || (u.maskLength = y - 1);\n return o.greedy = f, g;\n }, t.getPlaceholder = s, t.getTest = u, t.getTestTemplate = l, t.getTests = d, t.isSubsetOf = f;\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n };\n function r(e, t) {\n var i = (null != e.alternation ? e.mloc[o(e)] : e.locator).join(\"\");\n if (\"\" !== i) for (;i.length < t; ) i += \"0\";\n return i;\n }\n function o(e) {\n var t = e.locator[e.alternation];\n return \"string\" == typeof t && t.length > 0 && (t = t.split(\",\")[0]), void 0 !== t ? t.toString() : \"\";\n }\n function s(e, t, i) {\n var n = this.opts, a = this.maskset;\n if (void 0 !== (t = t || u.call(this, e).match).placeholder || !0 === i) return \"function\" == typeof t.placeholder ? t.placeholder(n) : t.placeholder;\n if (!0 === t.static) {\n if (e > -1 && void 0 === a.validPositions[e]) {\n var r, o = d.call(this, e), s = [];\n if (o.length > 1 + (\"\" === o[o.length - 1].match.def ? 1 : 0)) for (var l = 0; l < o.length; l++) if (\"\" !== o[l].match.def && !0 !== o[l].match.optionality && !0 !== o[l].match.optionalQuantifier && (!0 === o[l].match.static || void 0 === r || !1 !== o[l].match.fn.test(r.match.def, a, e, !0, n)) && (s.push(o[l]), \n !0 === o[l].match.static && (r = o[l]), s.length > 1 && /[0-9a-bA-Z]/.test(s[0].match.def))) return n.placeholder.charAt(e % n.placeholder.length);\n }\n return t.def;\n }\n return n.placeholder.charAt(e % n.placeholder.length);\n }\n function l(e, t, i) {\n return this.maskset.validPositions[e] || c.call(this, e, d.call(this, e, t ? t.slice() : t, i));\n }\n function c(e, t) {\n var i = this.opts, n = 0, a = function(e, t) {\n var i = 0, n = !1;\n t.forEach((function(e) {\n e.match.optionality && (0 !== i && i !== e.match.optionality && (n = !0), (0 === i || i > e.match.optionality) && (i = e.match.optionality));\n })), i && (0 == e || 1 == t.length ? i = 0 : n || (i = 0));\n return i;\n }(e, t);\n e = e > 0 ? e - 1 : 0;\n var o, s, l, c = r(u.call(this, e));\n i.greedy && t.length > 1 && \"\" === t[t.length - 1].match.def && (n = 1);\n for (var f = 0; f < t.length - n; f++) {\n var d = t[f];\n o = r(d, c.length);\n var p = Math.abs(o - c);\n (void 0 === s || \"\" !== o && p < s || l && !i.greedy && l.match.optionality && l.match.optionality - a > 0 && \"master\" === l.match.newBlockMarker && (!d.match.optionality || d.match.optionality - a < 1 || !d.match.newBlockMarker) || l && !i.greedy && l.match.optionalQuantifier && !d.match.optionalQuantifier) && (s = p, \n l = d);\n }\n return l;\n }\n function u(e, t) {\n var i = this.maskset;\n return i.validPositions[e] ? i.validPositions[e] : (t || d.call(this, e))[0];\n }\n function f(e, t, i) {\n function n(e) {\n for (var t, i = [], n = -1, a = 0, r = e.length; a < r; a++) if (\"-\" === e.charAt(a)) for (t = e.charCodeAt(a + 1); ++n < t; ) i.push(String.fromCharCode(n)); else n = e.charCodeAt(a), \n i.push(e.charAt(a));\n return i.join(\"\");\n }\n return e.match.def === t.match.nativeDef || !(!(i.regex || e.match.fn instanceof RegExp && t.match.fn instanceof RegExp) || !0 === e.match.static || !0 === t.match.static) && -1 !== n(t.match.fn.toString().replace(/[[\\]/]/g, \"\")).indexOf(n(e.match.fn.toString().replace(/[[\\]/]/g, \"\")));\n }\n function d(e, t, i) {\n var n, r, o = this, s = this.dependencyLib, l = this.maskset, u = this.opts, d = this.el, p = l.maskToken, h = t ? i : 0, v = t ? t.slice() : [ 0 ], m = [], g = !1, y = t ? t.join(\"\") : \"\";\n function k(t, i, r, s) {\n function c(r, s, p) {\n function v(e, t) {\n var i = 0 === t.matches.indexOf(e);\n return i || t.matches.every((function(n, a) {\n return !0 === n.isQuantifier ? i = v(e, t.matches[a - 1]) : Object.prototype.hasOwnProperty.call(n, \"matches\") && (i = v(e, n)), \n !i;\n })), i;\n }\n function x(e, t, i) {\n var n, a;\n if ((l.tests[e] || l.validPositions[e]) && (l.tests[e] || [ l.validPositions[e] ]).every((function(e, r) {\n if (e.mloc[t]) return n = e, !1;\n var o = void 0 !== i ? i : e.alternation, s = void 0 !== e.locator[o] ? e.locator[o].toString().indexOf(t) : -1;\n return (void 0 === a || s < a) && -1 !== s && (n = e, a = s), !0;\n })), n) {\n var r = n.locator[n.alternation];\n return (n.mloc[t] || n.mloc[r] || n.locator).slice((void 0 !== i ? i : n.alternation) + 1);\n }\n return void 0 !== i ? x(e, t) : void 0;\n }\n function P(e, t) {\n var i = e.alternation, n = void 0 === t || i === t.alternation && -1 === e.locator[i].toString().indexOf(t.locator[i]);\n if (!n && i > t.alternation) for (var a = t.alternation; a < i; a++) if (e.locator[a] !== t.locator[a]) {\n i = a, n = !0;\n break;\n }\n if (n) {\n e.mloc = e.mloc || {};\n var r = e.locator[i];\n if (void 0 !== r) {\n if (\"string\" == typeof r && (r = r.split(\",\")[0]), void 0 === e.mloc[r] && (e.mloc[r] = e.locator.slice()), \n void 0 !== t) {\n for (var o in t.mloc) \"string\" == typeof o && (o = o.split(\",\")[0]), void 0 === e.mloc[o] && (e.mloc[o] = t.mloc[o]);\n e.locator[i] = Object.keys(e.mloc).join(\",\");\n }\n return !0;\n }\n e.alternation = void 0;\n }\n return !1;\n }\n function w(e, t) {\n if (e.locator.length !== t.locator.length) return !1;\n for (var i = e.alternation + 1; i < e.locator.length; i++) if (e.locator[i] !== t.locator[i]) return !1;\n return !0;\n }\n if (h > e + u._maxTestPos) throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + l.mask;\n if (h === e && void 0 === r.matches) {\n if (m.push({\n match: r,\n locator: s.reverse(),\n cd: y,\n mloc: {}\n }), !r.optionality || void 0 !== p || !(u.definitions && u.definitions[r.nativeDef] && u.definitions[r.nativeDef].optional || a.default.prototype.definitions[r.nativeDef] && a.default.prototype.definitions[r.nativeDef].optional)) return !0;\n g = !0, h = e;\n } else if (void 0 !== r.matches) {\n if (r.isGroup && p !== r) return function() {\n if (r = c(t.matches[t.matches.indexOf(r) + 1], s, p)) return !0;\n }();\n if (r.isOptional) return function() {\n var t = r, a = m.length;\n if (r = k(r, i, s, p), m.length > 0) {\n if (m.forEach((function(e, t) {\n t >= a && (e.match.optionality = e.match.optionality ? e.match.optionality + 1 : 1);\n })), n = m[m.length - 1].match, void 0 !== p || !v(n, t)) return r;\n g = !0, h = e;\n }\n }();\n if (r.isAlternator) return function() {\n o.hasAlternator = !0;\n var n, a, v, y = r, k = [], b = m.slice(), S = s.length, M = !1, _ = i.length > 0 ? i.shift() : -1;\n if (-1 === _ || \"string\" == typeof _) {\n var O, E = h, T = i.slice(), j = [];\n if (\"string\" == typeof _) j = _.split(\",\"); else for (O = 0; O < y.matches.length; O++) j.push(O.toString());\n if (void 0 !== l.excludes[e]) {\n for (var A = j.slice(), D = 0, B = l.excludes[e].length; D < B; D++) {\n var C = l.excludes[e][D].toString().split(\":\");\n s.length == C[1] && j.splice(j.indexOf(C[0]), 1);\n }\n 0 === j.length && (delete l.excludes[e], j = A);\n }\n (!0 === u.keepStatic || isFinite(parseInt(u.keepStatic)) && E >= u.keepStatic) && (j = j.slice(0, 1));\n for (var R = 0; R < j.length; R++) {\n O = parseInt(j[R]), m = [], i = \"string\" == typeof _ && x(h, O, S) || T.slice();\n var L = y.matches[O];\n if (L && c(L, [ O ].concat(s), p)) r = !0; else if (0 === R && (M = !0), L && L.matches && L.matches.length > y.matches[0].matches.length) break;\n n = m.slice(), h = E, m = [];\n for (var F = 0; F < n.length; F++) {\n var I = n[F], N = !1;\n I.match.jit = I.match.jit || M, I.alternation = I.alternation || S, P(I);\n for (var V = 0; V < k.length; V++) {\n var G = k[V];\n if (\"string\" != typeof _ || void 0 !== I.alternation && j.includes(I.locator[I.alternation].toString())) {\n if (I.match.nativeDef === G.match.nativeDef) {\n N = !0, P(G, I);\n break;\n }\n if (f(I, G, u)) {\n P(I, G) && (N = !0, k.splice(k.indexOf(G), 0, I));\n break;\n }\n if (f(G, I, u)) {\n P(G, I);\n break;\n }\n if (v = G, !0 === (a = I).match.static && !0 !== v.match.static && v.match.fn.test(a.match.def, l, e, !1, u, !1)) {\n w(I, G) || void 0 !== d.inputmask.userOptions.keepStatic ? P(I, G) && (N = !0, k.splice(k.indexOf(G), 0, I)) : u.keepStatic = !0;\n break;\n }\n }\n }\n N || k.push(I);\n }\n }\n m = b.concat(k), h = e, g = m.length > 0, r = k.length > 0, i = T.slice();\n } else r = c(y.matches[_] || t.matches[_], [ _ ].concat(s), p);\n if (r) return !0;\n }();\n if (r.isQuantifier && p !== t.matches[t.matches.indexOf(r) - 1]) return function() {\n for (var a = r, o = !1, f = i.length > 0 ? i.shift() : 0; f < (isNaN(a.quantifier.max) ? f + 1 : a.quantifier.max) && h <= e; f++) {\n var d = t.matches[t.matches.indexOf(a) - 1];\n if (r = c(d, [ f ].concat(s), d)) {\n if (m.forEach((function(t, i) {\n (n = b(d, t.match) ? t.match : m[m.length - 1].match).optionalQuantifier = f >= a.quantifier.min, \n n.jit = (f + 1) * (d.matches.indexOf(n) + 1) > a.quantifier.jit, n.optionalQuantifier && v(n, d) && (g = !0, \n h = e, u.greedy && null == l.validPositions[e - 1] && f > a.quantifier.min && -1 != [ \"*\", \"+\" ].indexOf(a.quantifier.max) && (m.pop(), \n y = void 0), o = !0, r = !1), !o && n.jit && (l.jitOffset[e] = d.matches.length - d.matches.indexOf(n));\n })), o) break;\n return !0;\n }\n }\n }();\n if (r = k(r, i, s, p)) return !0;\n } else h++;\n }\n for (var p = i.length > 0 ? i.shift() : 0; p < t.matches.length; p++) if (!0 !== t.matches[p].isQuantifier) {\n var v = c(t.matches[p], [ p ].concat(r), s);\n if (v && h === e) return v;\n if (h > e) break;\n }\n }\n function b(e, t) {\n var i = -1 != e.matches.indexOf(t);\n return i || e.matches.forEach((function(e, n) {\n void 0 === e.matches || i || (i = b(e, t));\n })), i;\n }\n if (e > -1) {\n if (void 0 === t) {\n for (var x, P = e - 1; void 0 === (x = l.validPositions[P] || l.tests[P]) && P > -1; ) P--;\n void 0 !== x && P > -1 && (v = function(e, t) {\n var i, n = [];\n return Array.isArray(t) || (t = [ t ]), t.length > 0 && (void 0 === t[0].alternation || !0 === u.keepStatic ? 0 === (n = c.call(o, e, t.slice()).locator.slice()).length && (n = t[0].locator.slice()) : t.forEach((function(e) {\n \"\" !== e.def && (0 === n.length ? (i = e.alternation, n = e.locator.slice()) : e.locator[i] && -1 === n[i].toString().indexOf(e.locator[i]) && (n[i] += \",\" + e.locator[i]));\n }))), n;\n }(P, x), y = v.join(\"\"), h = P);\n }\n if (l.tests[e] && l.tests[e][0].cd === y) return l.tests[e];\n for (var w = v.shift(); w < p.length; w++) {\n if (k(p[w], v, [ w ]) && h === e || h > e) break;\n }\n }\n return (0 === m.length || g) && m.push({\n match: {\n fn: null,\n static: !0,\n optionality: !1,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n mloc: {},\n cd: y\n }), void 0 !== t && l.tests[e] ? r = s.extend(!0, [], m) : (l.tests[e] = s.extend(!0, [], m), \n r = l.tests[e]), m.forEach((function(e) {\n e.match.optionality = e.match.defOptionality || !1;\n })), r;\n }\n },\n 7215: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.alternate = s, t.checkAlternationMatch = function(e, t, i) {\n for (var n, a = this.opts.greedy ? t : t.slice(0, 1), r = !1, o = void 0 !== i ? i.split(\",\") : [], s = 0; s < o.length; s++) -1 !== (n = e.indexOf(o[s])) && e.splice(n, 1);\n for (var l = 0; l < e.length; l++) if (a.includes(e[l])) {\n r = !0;\n break;\n }\n return r;\n }, t.handleRemove = function(e, t, i, o, l) {\n var c = this, u = this.maskset, f = this.opts;\n if ((f.numericInput || c.isRTL) && (t === a.keys.Backspace ? t = a.keys.Delete : t === a.keys.Delete && (t = a.keys.Backspace), \n c.isRTL)) {\n var d = i.end;\n i.end = i.begin, i.begin = d;\n }\n var p, h = r.getLastValidPosition.call(c, void 0, !0);\n i.end >= r.getBuffer.call(c).length && h >= i.end && (i.end = h + 1);\n t === a.keys.Backspace ? i.end - i.begin < 1 && (i.begin = r.seekPrevious.call(c, i.begin)) : t === a.keys.Delete && i.begin === i.end && (i.end = r.isMask.call(c, i.end, !0, !0) ? i.end + 1 : r.seekNext.call(c, i.end) + 1);\n if (!1 !== (p = v.call(c, i))) {\n if (!0 !== o && !1 !== f.keepStatic || null !== f.regex && -1 !== n.getTest.call(c, i.begin).match.def.indexOf(\"|\")) {\n var m = s.call(c, !0);\n if (m) {\n var g = void 0 !== m.caret ? m.caret : m.pos ? r.seekNext.call(c, m.pos.begin ? m.pos.begin : m.pos) : r.getLastValidPosition.call(c, -1, !0);\n (t !== a.keys.Delete || i.begin > g) && i.begin;\n }\n }\n !0 !== o && (u.p = t === a.keys.Delete ? i.begin + p : i.begin, u.p = r.determineNewCaretPosition.call(c, {\n begin: u.p,\n end: u.p\n }, !1, !1 === f.insertMode && t === a.keys.Backspace ? \"none\" : void 0).begin);\n }\n }, t.isComplete = c, t.isSelection = u, t.isValid = f, t.refreshFromBuffer = p, \n t.revalidateMask = v;\n var n = i(4713), a = i(2839), r = i(8711), o = i(6030);\n function s(e, t, i, a, o, l) {\n var c, u, d, p, h, v, m, g, y, k, b, x = this, P = this.dependencyLib, w = this.opts, S = x.maskset, M = P.extend(!0, [], S.validPositions), _ = P.extend(!0, {}, S.tests), O = !1, E = !1, T = void 0 !== o ? o : r.getLastValidPosition.call(x);\n if (l && (k = l.begin, b = l.end, l.begin > l.end && (k = l.end, b = l.begin)), \n -1 === T && void 0 === o) c = 0, u = (p = n.getTest.call(x, c)).alternation; else for (;T >= 0; T--) if ((d = S.validPositions[T]) && void 0 !== d.alternation) {\n if (T <= (e || 0) && p && p.locator[d.alternation] !== d.locator[d.alternation]) break;\n c = T, u = S.validPositions[c].alternation, p = d;\n }\n if (void 0 !== u) {\n m = parseInt(c), S.excludes[m] = S.excludes[m] || [], !0 !== e && S.excludes[m].push((0, \n n.getDecisionTaker)(p) + \":\" + p.alternation);\n var j = [], A = -1;\n for (h = m; h < r.getLastValidPosition.call(x, void 0, !0) + 1; h++) -1 === A && e <= h && void 0 !== t && (j.push(t), \n A = j.length - 1), (v = S.validPositions[h]) && !0 !== v.generatedInput && (void 0 === l || h < k || h >= b) && j.push(v.input), \n delete S.validPositions[h];\n for (-1 === A && void 0 !== t && (j.push(t), A = j.length - 1); void 0 !== S.excludes[m] && S.excludes[m].length < 10; ) {\n for (S.tests = {}, r.resetMaskSet.call(x, !0), O = !0, h = 0; h < j.length && (g = O.caret || r.getLastValidPosition.call(x, void 0, !0) + 1, \n y = j[h], O = f.call(x, g, y, !1, a, !0)); h++) h === A && (E = O), 1 == e && O && (E = {\n caretPos: h\n });\n if (O) break;\n if (r.resetMaskSet.call(x), p = n.getTest.call(x, m), S.validPositions = P.extend(!0, [], M), \n S.tests = P.extend(!0, {}, _), !S.excludes[m]) {\n E = s.call(x, e, t, i, a, m - 1, l);\n break;\n }\n var D = (0, n.getDecisionTaker)(p);\n if (-1 !== S.excludes[m].indexOf(D + \":\" + p.alternation)) {\n E = s.call(x, e, t, i, a, m - 1, l);\n break;\n }\n for (S.excludes[m].push(D + \":\" + p.alternation), h = m; h < r.getLastValidPosition.call(x, void 0, !0) + 1; h++) delete S.validPositions[h];\n }\n }\n return E && !1 === w.keepStatic || delete S.excludes[m], E;\n }\n function l(e, t, i) {\n var n = this.opts, r = this.maskset;\n switch (n.casing || t.casing) {\n case \"upper\":\n e = e.toUpperCase();\n break;\n\n case \"lower\":\n e = e.toLowerCase();\n break;\n\n case \"title\":\n var o = r.validPositions[i - 1];\n e = 0 === i || o && o.input === String.fromCharCode(a.keyCode.Space) ? e.toUpperCase() : e.toLowerCase();\n break;\n\n default:\n if (\"function\" == typeof n.casing) {\n var s = Array.prototype.slice.call(arguments);\n s.push(r.validPositions), e = n.casing.apply(this, s);\n }\n }\n return e;\n }\n function c(e) {\n var t = this, i = this.opts, a = this.maskset;\n if (\"function\" == typeof i.isComplete) return i.isComplete(e, i);\n if (\"*\" !== i.repeat) {\n var o = !1, s = r.determineLastRequiredPosition.call(t, !0), l = r.seekPrevious.call(t, s.l);\n if (void 0 === s.def || s.def.newBlockMarker || s.def.optionality || s.def.optionalQuantifier) {\n o = !0;\n for (var c = 0; c <= l; c++) {\n var u = n.getTestTemplate.call(t, c).match;\n if (!0 !== u.static && void 0 === a.validPositions[c] && !0 !== u.optionality && !0 !== u.optionalQuantifier || !0 === u.static && e[c] !== n.getPlaceholder.call(t, c, u)) {\n o = !1;\n break;\n }\n }\n }\n return o;\n }\n }\n function u(e) {\n var t = this.opts.insertMode ? 0 : 1;\n return this.isRTL ? e.begin - e.end > t : e.end - e.begin > t;\n }\n function f(e, t, i, a, o, d, m) {\n var g = this, y = this.dependencyLib, k = this.opts, b = g.maskset;\n i = !0 === i;\n var x = e;\n function P(e) {\n if (void 0 !== e) {\n if (void 0 !== e.remove && (Array.isArray(e.remove) || (e.remove = [ e.remove ]), \n e.remove.sort((function(e, t) {\n return g.isRTL ? e.pos - t.pos : t.pos - e.pos;\n })).forEach((function(e) {\n v.call(g, {\n begin: e,\n end: e + 1\n });\n })), e.remove = void 0), void 0 !== e.insert && (Array.isArray(e.insert) || (e.insert = [ e.insert ]), \n e.insert.sort((function(e, t) {\n return g.isRTL ? t.pos - e.pos : e.pos - t.pos;\n })).forEach((function(e) {\n \"\" !== e.c && f.call(g, e.pos, e.c, void 0 === e.strict || e.strict, void 0 !== e.fromIsValid ? e.fromIsValid : a);\n })), e.insert = void 0), e.refreshFromBuffer && e.buffer) {\n var t = e.refreshFromBuffer;\n p.call(g, !0 === t ? t : t.start, t.end, e.buffer), e.refreshFromBuffer = void 0;\n }\n void 0 !== e.rewritePosition && (x = e.rewritePosition, e = !0);\n }\n return e;\n }\n function w(t, i, o) {\n var s = !1;\n return n.getTests.call(g, t).every((function(c, f) {\n var d = c.match;\n if (r.getBuffer.call(g, !0), !1 !== (s = (!d.jit || void 0 !== b.validPositions[r.seekPrevious.call(g, t)]) && (null != d.fn ? d.fn.test(i, b, t, o, k, u.call(g, e)) : (i === d.def || i === k.skipOptionalPartCharacter) && \"\" !== d.def && {\n c: n.getPlaceholder.call(g, t, d, !0) || d.def,\n pos: t\n }))) {\n var p = void 0 !== s.c ? s.c : i, h = t;\n return p = p === k.skipOptionalPartCharacter && !0 === d.static ? n.getPlaceholder.call(g, t, d, !0) || d.def : p, \n !0 !== (s = P(s)) && void 0 !== s.pos && s.pos !== t && (h = s.pos), !0 !== s && void 0 === s.pos && void 0 === s.c ? !1 : (!1 === v.call(g, e, y.extend({}, c, {\n input: l.call(g, p, d, h)\n }), a, h) && (s = !1), !1);\n }\n return !0;\n })), s;\n }\n void 0 !== e.begin && (x = g.isRTL ? e.end : e.begin);\n var S = !0, M = y.extend(!0, {}, b.validPositions);\n if (!1 === k.keepStatic && void 0 !== b.excludes[x] && !0 !== o && !0 !== a) for (var _ = x; _ < (g.isRTL ? e.begin : e.end); _++) void 0 !== b.excludes[_] && (b.excludes[_] = void 0, \n delete b.tests[_]);\n if (\"function\" == typeof k.preValidation && !0 !== a && !0 !== d && (S = P(S = k.preValidation.call(g, r.getBuffer.call(g), x, t, u.call(g, e), k, b, e, i || o))), \n !0 === S) {\n if (S = w(x, t, i), (!i || !0 === a) && !1 === S && !0 !== d) {\n var O = b.validPositions[x];\n if (!O || !0 !== O.match.static || O.match.def !== t && t !== k.skipOptionalPartCharacter) {\n if (k.insertMode || void 0 === b.validPositions[r.seekNext.call(g, x)] || e.end > x) {\n var E = !1;\n if (b.jitOffset[x] && void 0 === b.validPositions[r.seekNext.call(g, x)] && !1 !== (S = f.call(g, x + b.jitOffset[x], t, !0, !0)) && (!0 !== o && (S.caret = x), \n E = !0), e.end > x && (b.validPositions[x] = void 0), !E && !r.isMask.call(g, x, k.keepStatic && 0 === x)) for (var T = x + 1, j = r.seekNext.call(g, x, !1, 0 !== x); T <= j; T++) if (!1 !== (S = w(T, t, i))) {\n S = h.call(g, x, void 0 !== S.pos ? S.pos : T) || S, x = T;\n break;\n }\n }\n } else S = {\n caret: r.seekNext.call(g, x)\n };\n }\n g.hasAlternator && !0 !== o && !i && (!1 === S && k.keepStatic && (c.call(g, r.getBuffer.call(g)) || 0 === x) ? S = s.call(g, x, t, i, a, void 0, e) : (u.call(g, e) && b.tests[x] && b.tests[x].length > 1 && k.keepStatic || 1 == S && !0 !== k.numericInput && b.tests[x] && b.tests[x].length > 1 && r.getLastValidPosition.call(g, void 0, !0) > x) && (S = s.call(g, !0))), \n !0 === S && (S = {\n pos: x\n });\n }\n if (\"function\" == typeof k.postValidation && !0 !== a && !0 !== d) {\n var A = k.postValidation.call(g, r.getBuffer.call(g, !0), void 0 !== e.begin ? g.isRTL ? e.end : e.begin : e, t, S, k, b, i, m);\n void 0 !== A && (S = !0 === A ? S : A);\n }\n S && void 0 === S.pos && (S.pos = x), !1 === S || !0 === d ? (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], M)) : h.call(g, void 0, x, !0);\n var D = P(S);\n void 0 !== g.maxLength && (r.getBuffer.call(g).length > g.maxLength && !a && (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], M), D = !1));\n return D;\n }\n function d(e, t, i) {\n for (var a = this.maskset, r = !1, o = n.getTests.call(this, e), s = 0; s < o.length; s++) {\n if (o[s].match && (o[s].match.nativeDef === t.match[i.shiftPositions ? \"def\" : \"nativeDef\"] && (!i.shiftPositions || !t.match.static) || o[s].match.nativeDef === t.match.nativeDef || i.regex && !o[s].match.static && o[s].match.fn.test(t.input, a, e, !1, i))) {\n r = !0;\n break;\n }\n if (o[s].match && o[s].match.def === t.match.nativeDef) {\n r = void 0;\n break;\n }\n }\n return !1 === r && void 0 !== a.jitOffset[e] && (r = d.call(this, e + a.jitOffset[e], t, i)), \n r;\n }\n function p(e, t, i) {\n var n, a, s = this, l = this.maskset, c = this.opts, u = this.dependencyLib, f = c.skipOptionalPartCharacter, d = s.isRTL ? i.slice().reverse() : i;\n if (c.skipOptionalPartCharacter = \"\", !0 === e) r.resetMaskSet.call(s), l.tests = {}, \n e = 0, t = i.length, a = r.determineNewCaretPosition.call(s, {\n begin: 0,\n end: 0\n }, !1).begin; else {\n for (n = e; n < t; n++) delete l.validPositions[n];\n a = e;\n }\n var p = new u.Event(\"keypress\");\n for (n = e; n < t; n++) {\n p.key = d[n].toString(), s.ignorable = !1;\n var h = o.EventHandlers.keypressEvent.call(s, p, !0, !1, !1, a);\n !1 !== h && void 0 !== h && (a = h.forwardPosition);\n }\n c.skipOptionalPartCharacter = f;\n }\n function h(e, t, i) {\n var a = this, o = this.maskset, s = this.dependencyLib;\n if (void 0 === e) for (e = t - 1; e > 0 && !o.validPositions[e]; e--) ;\n for (var l = e; l < t; l++) {\n if (void 0 === o.validPositions[l] && !r.isMask.call(a, l, !1)) if (0 == l ? n.getTest.call(a, l) : o.validPositions[l - 1]) {\n var c = n.getTests.call(a, l).slice();\n \"\" === c[c.length - 1].match.def && c.pop();\n var u, d = n.determineTestTemplate.call(a, l, c);\n if (d && (!0 !== d.match.jit || \"master\" === d.match.newBlockMarker && (u = o.validPositions[l + 1]) && !0 === u.match.optionalQuantifier) && ((d = s.extend({}, d, {\n input: n.getPlaceholder.call(a, l, d.match, !0) || d.match.def\n })).generatedInput = !0, v.call(a, l, d, !0), !0 !== i)) {\n var p = o.validPositions[t].input;\n return o.validPositions[t] = void 0, f.call(a, t, p, !0, !0);\n }\n }\n }\n }\n function v(e, t, i, a) {\n var o = this, s = this.maskset, l = this.opts, c = this.dependencyLib;\n function u(e, t, i) {\n var n = t[e];\n if (void 0 !== n && !0 === n.match.static && !0 !== n.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) {\n var a = i.begin <= e - 1 ? t[e - 1] && !0 === t[e - 1].match.static && t[e - 1] : t[e - 1], r = i.end > e + 1 ? t[e + 1] && !0 === t[e + 1].match.static && t[e + 1] : t[e + 1];\n return a && r;\n }\n return !1;\n }\n var p = 0, h = void 0 !== e.begin ? e.begin : e, v = void 0 !== e.end ? e.end : e, m = !0;\n if (e.begin > e.end && (h = e.end, v = e.begin), a = void 0 !== a ? a : h, void 0 === i && (h !== v || l.insertMode && void 0 !== s.validPositions[a] || void 0 === t || t.match.optionalQuantifier || t.match.optionality)) {\n var g, y = c.extend(!0, {}, s.validPositions), k = r.getLastValidPosition.call(o, void 0, !0);\n for (s.p = h, g = k; g >= h; g--) delete s.validPositions[g], void 0 === t && delete s.tests[g + 1];\n var b, x, P = a, w = P;\n for (t && (s.validPositions[a] = c.extend(!0, {}, t), w++, P++), g = t ? v : v - 1; g <= k; g++) {\n if (void 0 !== (b = y[g]) && !0 !== b.generatedInput && (g >= v || g >= h && u(g, y, {\n begin: h,\n end: v\n }))) {\n for (;\"\" !== n.getTest.call(o, w).match.def; ) {\n if (!1 !== (x = d.call(o, w, b, l)) || \"+\" === b.match.def) {\n \"+\" === b.match.def && r.getBuffer.call(o, !0);\n var S = f.call(o, w, b.input, \"+\" !== b.match.def, !0);\n if (m = !1 !== S, P = (S.pos || w) + 1, !m && x) break;\n } else m = !1;\n if (m) {\n void 0 === t && b.match.static && g === e.begin && p++;\n break;\n }\n if (!m && r.getBuffer.call(o), w > s.maskLength) break;\n w++;\n }\n \"\" == n.getTest.call(o, w).match.def && (m = !1), w = P;\n }\n if (!m) break;\n }\n if (!m) return s.validPositions = c.extend(!0, [], y), r.resetMaskSet.call(o, !0), \n !1;\n } else t && n.getTest.call(o, a).match.cd === t.match.cd && (s.validPositions[a] = c.extend(!0, {}, t));\n return r.resetMaskSet.call(o, !0), p;\n }\n }\n }, t = {};\n function i(n) {\n var a = t[n];\n if (void 0 !== a) return a.exports;\n var r = t[n] = {\n exports: {}\n };\n return e[n](r, r.exports, i), r.exports;\n }\n var n = {};\n return function() {\n var e, t = n;\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0, i(7149), i(3194), i(9302), i(4013), i(3851), i(219), i(207), \n i(5296);\n var a = ((e = i(2394)) && e.__esModule ? e : {\n default: e\n }).default;\n t.default = a;\n }(), n;\n }();\n}));\n\n//# sourceURL=webpack://Formio/./node_modules/inputmask/dist/inputmask.js?"); +eval("/*!\n * dist/inputmask\n * https://github.com/RobinHerbots/Inputmask\n * Copyright (c) 2010 - 2024 Robin Herbots\n * Licensed under the MIT license\n * Version: 5.0.9\n */\n!function(e, t) {\n if (true) module.exports = t(); else { var i, n; }\n}(\"undefined\" != typeof self ? self : this, (function() {\n return function() {\n \"use strict\";\n var e = {\n 3976: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n t.default = {\n _maxTestPos: 500,\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: function() {},\n onincomplete: function() {},\n oncleared: function() {},\n repeat: 0,\n greedy: !1,\n autoUnmask: !1,\n removeMaskOnSubmit: !1,\n clearMaskOnLostFocus: !0,\n insertMode: !0,\n insertModeVisual: !0,\n clearIncomplete: !1,\n alias: null,\n onKeyDown: function() {},\n onBeforeMask: null,\n onBeforePaste: function(e, t) {\n return \"function\" == typeof t.onBeforeMask ? t.onBeforeMask.call(this, e, t) : e;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: !0,\n showMaskOnHover: !0,\n onKeyValidation: function() {},\n skipOptionalPartCharacter: \" \",\n numericInput: !1,\n rightAlign: !1,\n undoOnEscape: !0,\n radixPoint: \"\",\n _radixDance: !1,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: !0,\n tabThrough: !1,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: void 0,\n jitMasking: !1,\n nullable: !0,\n inputEventOnly: !1,\n noValuePatching: !1,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"text\",\n importDataAttributes: !0,\n shiftPositions: !0,\n usePrototypeDefinitions: !0,\n validationEventTimeOut: 3e3,\n substitutes: {}\n };\n },\n 7392: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n t.default = {\n 9: {\n validator: \"[0-9\\uff10-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff10-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n };\n },\n 253: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, n) {\n if (void 0 === n) return e.__data ? e.__data[t] : null;\n e.__data = e.__data || {}, e.__data[t] = n;\n };\n },\n 3776: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.Event = void 0, t.off = function(e, t) {\n var n, i;\n u(this[0]) && e && (n = this[0].eventRegistry, i = this[0], e.split(\" \").forEach((function(e) {\n var a = o(e.split(\".\"), 2);\n (function(e, i) {\n var a, r, o = [];\n if (e.length > 0) if (void 0 === t) for (a = 0, r = n[e][i].length; a < r; a++) o.push({\n ev: e,\n namespace: i && i.length > 0 ? i : \"global\",\n handler: n[e][i][a]\n }); else o.push({\n ev: e,\n namespace: i && i.length > 0 ? i : \"global\",\n handler: t\n }); else if (i.length > 0) for (var l in n) for (var s in n[l]) if (s === i) if (void 0 === t) for (a = 0, \n r = n[l][s].length; a < r; a++) o.push({\n ev: l,\n namespace: s,\n handler: n[l][s][a]\n }); else o.push({\n ev: l,\n namespace: s,\n handler: t\n });\n return o;\n })(a[0], a[1]).forEach((function(e) {\n var t = e.ev, a = e.handler;\n !function(e, t, a) {\n if (e in n == 1) if (i.removeEventListener ? i.removeEventListener(e, a, !1) : i.detachEvent && i.detachEvent(\"on\".concat(e), a), \n \"global\" === t) for (var r in n[e]) n[e][r].splice(n[e][r].indexOf(a), 1); else n[e][t].splice(n[e][t].indexOf(a), 1);\n }(t, e.namespace, a);\n }));\n })));\n return this;\n }, t.on = function(e, t) {\n if (u(this[0])) {\n var n = this[0].eventRegistry, i = this[0];\n e.split(\" \").forEach((function(e) {\n var a = o(e.split(\".\"), 2), r = a[0], l = a[1];\n !function(e, a) {\n i.addEventListener ? i.addEventListener(e, t, !1) : i.attachEvent && i.attachEvent(\"on\".concat(e), t), \n n[e] = n[e] || {}, n[e][a] = n[e][a] || [], n[e][a].push(t);\n }(r, void 0 === l ? \"global\" : l);\n }));\n }\n return this;\n }, t.trigger = function(e) {\n var t = arguments;\n if (u(this[0])) for (var n = this[0].eventRegistry, i = this[0], o = \"string\" == typeof e ? e.split(\" \") : [ e.type ], l = 0; l < o.length; l++) {\n var s = o[l].split(\".\"), f = s[0], p = s[1] || \"global\";\n if (void 0 !== c && \"global\" === p) {\n var d, h = {\n bubbles: !0,\n cancelable: !0,\n composed: !0,\n detail: arguments[1]\n };\n if (c.createEvent) {\n try {\n if (\"input\" === f) h.inputType = \"insertText\", d = new InputEvent(f, h); else d = new CustomEvent(f, h);\n } catch (e) {\n (d = c.createEvent(\"CustomEvent\")).initCustomEvent(f, h.bubbles, h.cancelable, h.detail);\n }\n e.type && (0, a.default)(d, e), i.dispatchEvent(d);\n } else (d = c.createEventObject()).eventType = f, d.detail = arguments[1], e.type && (0, \n a.default)(d, e), i.fireEvent(\"on\" + d.eventType, d);\n } else if (void 0 !== n[f]) {\n arguments[0] = arguments[0].type ? arguments[0] : r.default.Event(arguments[0]), \n arguments[0].detail = arguments.slice(1);\n var v = n[f];\n (\"global\" === p ? Object.values(v).flat() : v[p]).forEach((function(e) {\n return e.apply(i, t);\n }));\n }\n }\n return this;\n };\n var i = s(n(9380)), a = s(n(600)), r = s(n(4963));\n function o(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var n = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != n) {\n var i, a, r, o, l = [], s = !0, c = !1;\n try {\n if (r = (n = n.call(e)).next, 0 === t) {\n if (Object(n) !== n) return;\n s = !1;\n } else for (;!(s = (i = r.call(n)).done) && (l.push(i.value), l.length !== t); s = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!s && null != n.return && (o = n.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return l;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return l(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return l(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function l(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n function s(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var c = i.default.document;\n function u(e) {\n return e instanceof Element;\n }\n var f = t.Event = void 0;\n \"function\" == typeof i.default.CustomEvent ? t.Event = f = i.default.CustomEvent : i.default.Event && c && c.createEvent ? (t.Event = f = function(e, t) {\n t = t || {\n bubbles: !1,\n cancelable: !1,\n composed: !0,\n detail: void 0\n };\n var n = c.createEvent(\"CustomEvent\");\n return n.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), n;\n }, f.prototype = i.default.Event.prototype) : \"undefined\" != typeof Event && (t.Event = f = Event);\n },\n 600: function(e, t) {\n function n(e) {\n return n = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, n(e);\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function e() {\n var t, i, a, r, o, l, s = arguments[0] || {}, c = 1, u = arguments.length, f = !1;\n \"boolean\" == typeof s && (f = s, s = arguments[c] || {}, c++);\n \"object\" !== n(s) && \"function\" != typeof s && (s = {});\n for (;c < u; c++) if (null != (t = arguments[c])) for (i in t) a = s[i], s !== (r = t[i]) && (f && r && (\"[object Object]\" === Object.prototype.toString.call(r) || (o = Array.isArray(r))) ? (o ? (o = !1, \n l = a && Array.isArray(a) ? a : []) : l = a && \"[object Object]\" === Object.prototype.toString.call(a) ? a : {}, \n s[i] = e(f, l, r)) : void 0 !== r && (s[i] = r));\n return s;\n };\n },\n 4963: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var i = l(n(9380)), a = l(n(253)), r = n(3776), o = l(n(600));\n function l(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var s = i.default.document;\n function c(e) {\n return e instanceof c ? e : this instanceof c ? void (null != e && e !== i.default && (this[0] = e.nodeName ? e : void 0 !== e[0] && e[0].nodeName ? e[0] : s.querySelector(e), \n void 0 !== this[0] && null !== this[0] && (this[0].eventRegistry = this[0].eventRegistry || {}))) : new c(e);\n }\n c.prototype = {\n on: r.on,\n off: r.off,\n trigger: r.trigger\n }, c.extend = o.default, c.data = a.default, c.Event = r.Event;\n t.default = c;\n },\n 9845: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mobile = t.iphone = t.ie = void 0;\n var i, a = (i = n(9380)) && i.__esModule ? i : {\n default: i\n };\n var r = a.default.navigator && a.default.navigator.userAgent || \"\";\n t.ie = r.indexOf(\"MSIE \") > 0 || r.indexOf(\"Trident/\") > 0, t.mobile = a.default.navigator && a.default.navigator.userAgentData && a.default.navigator.userAgentData.mobile || a.default.navigator && a.default.navigator.maxTouchPoints || \"ontouchstart\" in a.default, \n t.iphone = /iphone/i.test(r);\n },\n 7184: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e) {\n return e.replace(n, \"\\\\$1\");\n };\n var n = new RegExp(\"(\\\\\" + [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ].join(\"|\\\\\") + \")\", \"gim\");\n },\n 6030: function(e, t, n) {\n function i(e) {\n return i = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, i(e);\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventHandlers = void 0;\n var a, r = n(9845), o = (a = n(9380)) && a.__esModule ? a : {\n default: a\n }, l = n(7760), s = n(2839), c = n(8711), u = n(7215), f = n(4713);\n function p() {\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ p = function() {\n return t;\n };\n var e, t = {}, n = Object.prototype, a = n.hasOwnProperty, r = Object.defineProperty || function(e, t, n) {\n e[t] = n.value;\n }, o = \"function\" == typeof Symbol ? Symbol : {}, l = o.iterator || \"@@iterator\", s = o.asyncIterator || \"@@asyncIterator\", c = o.toStringTag || \"@@toStringTag\";\n function u(e, t, n) {\n return Object.defineProperty(e, t, {\n value: n,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), e[t];\n }\n try {\n u({}, \"\");\n } catch (e) {\n u = function(e, t, n) {\n return e[t] = n;\n };\n }\n function f(e, t, n, i) {\n var a = t && t.prototype instanceof k ? t : k, o = Object.create(a.prototype), l = new D(i || []);\n return r(o, \"_invoke\", {\n value: E(e, n, l)\n }), o;\n }\n function d(e, t, n) {\n try {\n return {\n type: \"normal\",\n arg: e.call(t, n)\n };\n } catch (e) {\n return {\n type: \"throw\",\n arg: e\n };\n }\n }\n t.wrap = f;\n var h = \"suspendedStart\", v = \"suspendedYield\", m = \"executing\", g = \"completed\", y = {};\n function k() {}\n function b() {}\n function x() {}\n var w = {};\n u(w, l, (function() {\n return this;\n }));\n var P = Object.getPrototypeOf, S = P && P(P(L([])));\n S && S !== n && a.call(S, l) && (w = S);\n var O = x.prototype = k.prototype = Object.create(w);\n function _(e) {\n [ \"next\", \"throw\", \"return\" ].forEach((function(t) {\n u(e, t, (function(e) {\n return this._invoke(t, e);\n }));\n }));\n }\n function M(e, t) {\n function n(r, o, l, s) {\n var c = d(e[r], e, o);\n if (\"throw\" !== c.type) {\n var u = c.arg, f = u.value;\n return f && \"object\" == i(f) && a.call(f, \"__await\") ? t.resolve(f.__await).then((function(e) {\n n(\"next\", e, l, s);\n }), (function(e) {\n n(\"throw\", e, l, s);\n })) : t.resolve(f).then((function(e) {\n u.value = e, l(u);\n }), (function(e) {\n return n(\"throw\", e, l, s);\n }));\n }\n s(c.arg);\n }\n var o;\n r(this, \"_invoke\", {\n value: function(e, i) {\n function a() {\n return new t((function(t, a) {\n n(e, i, t, a);\n }));\n }\n return o = o ? o.then(a, a) : a();\n }\n });\n }\n function E(t, n, i) {\n var a = h;\n return function(r, o) {\n if (a === m) throw new Error(\"Generator is already running\");\n if (a === g) {\n if (\"throw\" === r) throw o;\n return {\n value: e,\n done: !0\n };\n }\n for (i.method = r, i.arg = o; ;) {\n var l = i.delegate;\n if (l) {\n var s = j(l, i);\n if (s) {\n if (s === y) continue;\n return s;\n }\n }\n if (\"next\" === i.method) i.sent = i._sent = i.arg; else if (\"throw\" === i.method) {\n if (a === h) throw a = g, i.arg;\n i.dispatchException(i.arg);\n } else \"return\" === i.method && i.abrupt(\"return\", i.arg);\n a = m;\n var c = d(t, n, i);\n if (\"normal\" === c.type) {\n if (a = i.done ? g : v, c.arg === y) continue;\n return {\n value: c.arg,\n done: i.done\n };\n }\n \"throw\" === c.type && (a = g, i.method = \"throw\", i.arg = c.arg);\n }\n };\n }\n function j(t, n) {\n var i = n.method, a = t.iterator[i];\n if (a === e) return n.delegate = null, \"throw\" === i && t.iterator.return && (n.method = \"return\", \n n.arg = e, j(t, n), \"throw\" === n.method) || \"return\" !== i && (n.method = \"throw\", \n n.arg = new TypeError(\"The iterator does not provide a '\" + i + \"' method\")), y;\n var r = d(a, t.iterator, n.arg);\n if (\"throw\" === r.type) return n.method = \"throw\", n.arg = r.arg, n.delegate = null, \n y;\n var o = r.arg;\n return o ? o.done ? (n[t.resultName] = o.value, n.next = t.nextLoc, \"return\" !== n.method && (n.method = \"next\", \n n.arg = e), n.delegate = null, y) : o : (n.method = \"throw\", n.arg = new TypeError(\"iterator result is not an object\"), \n n.delegate = null, y);\n }\n function T(e) {\n var t = {\n tryLoc: e[0]\n };\n 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), \n this.tryEntries.push(t);\n }\n function A(e) {\n var t = e.completion || {};\n t.type = \"normal\", delete t.arg, e.completion = t;\n }\n function D(e) {\n this.tryEntries = [ {\n tryLoc: \"root\"\n } ], e.forEach(T, this), this.reset(!0);\n }\n function L(t) {\n if (t || \"\" === t) {\n var n = t[l];\n if (n) return n.call(t);\n if (\"function\" == typeof t.next) return t;\n if (!isNaN(t.length)) {\n var r = -1, o = function n() {\n for (;++r < t.length; ) if (a.call(t, r)) return n.value = t[r], n.done = !1, n;\n return n.value = e, n.done = !0, n;\n };\n return o.next = o;\n }\n }\n throw new TypeError(i(t) + \" is not iterable\");\n }\n return b.prototype = x, r(O, \"constructor\", {\n value: x,\n configurable: !0\n }), r(x, \"constructor\", {\n value: b,\n configurable: !0\n }), b.displayName = u(x, c, \"GeneratorFunction\"), t.isGeneratorFunction = function(e) {\n var t = \"function\" == typeof e && e.constructor;\n return !!t && (t === b || \"GeneratorFunction\" === (t.displayName || t.name));\n }, t.mark = function(e) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(e, x) : (e.__proto__ = x, u(e, c, \"GeneratorFunction\")), \n e.prototype = Object.create(O), e;\n }, t.awrap = function(e) {\n return {\n __await: e\n };\n }, _(M.prototype), u(M.prototype, s, (function() {\n return this;\n })), t.AsyncIterator = M, t.async = function(e, n, i, a, r) {\n void 0 === r && (r = Promise);\n var o = new M(f(e, n, i, a), r);\n return t.isGeneratorFunction(n) ? o : o.next().then((function(e) {\n return e.done ? e.value : o.next();\n }));\n }, _(O), u(O, c, \"Generator\"), u(O, l, (function() {\n return this;\n })), u(O, \"toString\", (function() {\n return \"[object Generator]\";\n })), t.keys = function(e) {\n var t = Object(e), n = [];\n for (var i in t) n.push(i);\n return n.reverse(), function e() {\n for (;n.length; ) {\n var i = n.pop();\n if (i in t) return e.value = i, e.done = !1, e;\n }\n return e.done = !0, e;\n };\n }, t.values = L, D.prototype = {\n constructor: D,\n reset: function(t) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, \n this.method = \"next\", this.arg = e, this.tryEntries.forEach(A), !t) for (var n in this) \"t\" === n.charAt(0) && a.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = e);\n },\n stop: function() {\n this.done = !0;\n var e = this.tryEntries[0].completion;\n if (\"throw\" === e.type) throw e.arg;\n return this.rval;\n },\n dispatchException: function(t) {\n if (this.done) throw t;\n var n = this;\n function i(i, a) {\n return l.type = \"throw\", l.arg = t, n.next = i, a && (n.method = \"next\", n.arg = e), \n !!a;\n }\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r], l = o.completion;\n if (\"root\" === o.tryLoc) return i(\"end\");\n if (o.tryLoc <= this.prev) {\n var s = a.call(o, \"catchLoc\"), c = a.call(o, \"finallyLoc\");\n if (s && c) {\n if (this.prev < o.catchLoc) return i(o.catchLoc, !0);\n if (this.prev < o.finallyLoc) return i(o.finallyLoc);\n } else if (s) {\n if (this.prev < o.catchLoc) return i(o.catchLoc, !0);\n } else {\n if (!c) throw new Error(\"try statement without catch or finally\");\n if (this.prev < o.finallyLoc) return i(o.finallyLoc);\n }\n }\n }\n },\n abrupt: function(e, t) {\n for (var n = this.tryEntries.length - 1; n >= 0; --n) {\n var i = this.tryEntries[n];\n if (i.tryLoc <= this.prev && a.call(i, \"finallyLoc\") && this.prev < i.finallyLoc) {\n var r = i;\n break;\n }\n }\n r && (\"break\" === e || \"continue\" === e) && r.tryLoc <= t && t <= r.finallyLoc && (r = null);\n var o = r ? r.completion : {};\n return o.type = e, o.arg = t, r ? (this.method = \"next\", this.next = r.finallyLoc, \n y) : this.complete(o);\n },\n complete: function(e, t) {\n if (\"throw\" === e.type) throw e.arg;\n return \"break\" === e.type || \"continue\" === e.type ? this.next = e.arg : \"return\" === e.type ? (this.rval = this.arg = e.arg, \n this.method = \"return\", this.next = \"end\") : \"normal\" === e.type && t && (this.next = t), \n y;\n },\n finish: function(e) {\n for (var t = this.tryEntries.length - 1; t >= 0; --t) {\n var n = this.tryEntries[t];\n if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), A(n), y;\n }\n },\n catch: function(e) {\n for (var t = this.tryEntries.length - 1; t >= 0; --t) {\n var n = this.tryEntries[t];\n if (n.tryLoc === e) {\n var i = n.completion;\n if (\"throw\" === i.type) {\n var a = i.arg;\n A(n);\n }\n return a;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function(t, n, i) {\n return this.delegate = {\n iterator: L(t),\n resultName: n,\n nextLoc: i\n }, \"next\" === this.method && (this.arg = e), y;\n }\n }, t;\n }\n function d(e, t) {\n var n = \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (!n) {\n if (Array.isArray(e) || (n = function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return h(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return h(e, t);\n }(e)) || t && e && \"number\" == typeof e.length) {\n n && (e = n);\n var i = 0, a = function() {};\n return {\n s: a,\n n: function() {\n return i >= e.length ? {\n done: !0\n } : {\n done: !1,\n value: e[i++]\n };\n },\n e: function(e) {\n throw e;\n },\n f: a\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var r, o = !0, l = !1;\n return {\n s: function() {\n n = n.call(e);\n },\n n: function() {\n var e = n.next();\n return o = e.done, e;\n },\n e: function(e) {\n l = !0, r = e;\n },\n f: function() {\n try {\n o || null == n.return || n.return();\n } finally {\n if (l) throw r;\n }\n }\n };\n }\n function h(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n function v(e, t, n, i, a, r, o) {\n try {\n var l = e[r](o), s = l.value;\n } catch (e) {\n return void n(e);\n }\n l.done ? t(s) : Promise.resolve(s).then(i, a);\n }\n var m, g, y = t.EventHandlers = {\n keyEvent: function(e, t, n, i, a) {\n var o = this.inputmask, p = o.opts, d = o.dependencyLib, h = o.maskset, v = this, m = d(v), g = e.key, k = c.caret.call(o, v), b = p.onKeyDown.call(this, e, c.getBuffer.call(o), k, p);\n if (void 0 !== b) return b;\n if (g === s.keys.Backspace || g === s.keys.Delete || r.iphone && g === s.keys.BACKSPACE_SAFARI || e.ctrlKey && g === s.keys.x && !(\"oncut\" in v)) e.preventDefault(), \n u.handleRemove.call(o, v, g, k), (0, l.writeBuffer)(v, c.getBuffer.call(o, !0), h.p, e, v.inputmask._valueGet() !== c.getBuffer.call(o).join(\"\")); else if (g === s.keys.End || g === s.keys.PageDown) {\n e.preventDefault();\n var x = c.seekNext.call(o, c.getLastValidPosition.call(o));\n c.caret.call(o, v, e.shiftKey ? k.begin : x, x, !0);\n } else g === s.keys.Home && !e.shiftKey || g === s.keys.PageUp ? (e.preventDefault(), \n c.caret.call(o, v, 0, e.shiftKey ? k.begin : 0, !0)) : p.undoOnEscape && g === s.keys.Escape && !0 !== e.altKey ? ((0, \n l.checkVal)(v, !0, !1, o.undoValue.split(\"\")), m.trigger(\"click\")) : g !== s.keys.Insert || e.shiftKey || e.ctrlKey || void 0 !== o.userOptions.insertMode ? !0 === p.tabThrough && g === s.keys.Tab ? !0 === e.shiftKey ? (k.end = c.seekPrevious.call(o, k.end, !0), \n !0 === f.getTest.call(o, k.end - 1).match.static && k.end--, k.begin = c.seekPrevious.call(o, k.end, !0), \n k.begin >= 0 && k.end > 0 && (e.preventDefault(), c.caret.call(o, v, k.begin, k.end))) : (k.begin = c.seekNext.call(o, k.begin, !0), \n k.end = c.seekNext.call(o, k.begin, !0), k.end < h.maskLength && k.end--, k.begin <= h.maskLength && (e.preventDefault(), \n c.caret.call(o, v, k.begin, k.end))) : e.shiftKey || (p.insertModeVisual && !1 === p.insertMode ? g === s.keys.ArrowRight ? setTimeout((function() {\n var e = c.caret.call(o, v);\n c.caret.call(o, v, e.begin);\n }), 0) : g === s.keys.ArrowLeft && setTimeout((function() {\n var e = c.translatePosition.call(o, v.inputmask.caretPos.begin);\n c.translatePosition.call(o, v.inputmask.caretPos.end);\n o.isRTL ? c.caret.call(o, v, e + (e === h.maskLength ? 0 : 1)) : c.caret.call(o, v, e - (0 === e ? 0 : 1));\n }), 0) : void 0 === o.keyEventHook || o.keyEventHook(e)) : u.isSelection.call(o, k) ? p.insertMode = !p.insertMode : (p.insertMode = !p.insertMode, \n c.caret.call(o, v, k.begin, k.begin));\n return o.isComposing = g == s.keys.Process || g == s.keys.Unidentified, o.ignorable = g.length > 1 && !(\"textarea\" === v.tagName.toLowerCase() && g == s.keys.Enter), \n y.keypressEvent.call(this, e, t, n, i, a);\n },\n keypressEvent: function(e, t, n, i, a) {\n var r = this.inputmask || this, o = r.opts, f = r.dependencyLib, p = r.maskset, d = r.el, h = f(d), v = e.key;\n if (!0 === t || e.ctrlKey && e.altKey && !r.ignorable || !(e.ctrlKey || e.metaKey || r.ignorable)) {\n if (v) {\n var m, g = t ? {\n begin: a,\n end: a\n } : c.caret.call(r, d);\n t || (v = o.substitutes[v] || v), p.writeOutBuffer = !0;\n var y = u.isValid.call(r, g, v, i, void 0, void 0, void 0, t);\n if (!1 !== y && (c.resetMaskSet.call(r, !0), m = void 0 !== y.caret ? y.caret : c.seekNext.call(r, y.pos.begin ? y.pos.begin : y.pos), \n p.p = m), m = o.numericInput && void 0 === y.caret ? c.seekPrevious.call(r, m) : m, \n !1 !== n && (setTimeout((function() {\n o.onKeyValidation.call(d, v, y);\n }), 0), p.writeOutBuffer && !1 !== y)) {\n var k = c.getBuffer.call(r);\n (0, l.writeBuffer)(d, k, m, e, !0 !== t);\n }\n if (e.preventDefault(), t) return !1 !== y && (y.forwardPosition = m), y;\n }\n } else v === s.keys.Enter && r.undoValue !== r._valueGet(!0) && (r.undoValue = r._valueGet(!0), \n setTimeout((function() {\n h.trigger(\"change\");\n }), 0));\n },\n pasteEvent: (m = p().mark((function e(t) {\n var n, i, a, r, s, u;\n return p().wrap((function(e) {\n for (;;) switch (e.prev = e.next) {\n case 0:\n n = function(e, n, i, a, o) {\n var s = c.caret.call(e, n, void 0, void 0, !0), u = i.substr(0, s.begin), f = i.substr(s.end, i.length);\n if (u == (e.isRTL ? c.getBufferTemplate.call(e).slice().reverse() : c.getBufferTemplate.call(e)).slice(0, s.begin).join(\"\") && (u = \"\"), \n f == (e.isRTL ? c.getBufferTemplate.call(e).slice().reverse() : c.getBufferTemplate.call(e)).slice(s.end).join(\"\") && (f = \"\"), \n a = u + a + f, e.isRTL && !0 !== r.numericInput) {\n a = a.split(\"\");\n var p, h = d(c.getBufferTemplate.call(e));\n try {\n for (h.s(); !(p = h.n()).done; ) {\n var v = p.value;\n a[0] === v && a.shift();\n }\n } catch (e) {\n h.e(e);\n } finally {\n h.f();\n }\n a = a.reverse().join(\"\");\n }\n var m = a;\n if (\"function\" == typeof o) {\n if (!1 === (m = o.call(e, m, r))) return !1;\n m || (m = i);\n }\n (0, l.checkVal)(n, !0, !1, m.toString().split(\"\"), t);\n }, i = this, a = this.inputmask, r = a.opts, s = a._valueGet(!0), a.skipInputEvent = !0, \n t.clipboardData && t.clipboardData.getData ? u = t.clipboardData.getData(\"text/plain\") : o.default.clipboardData && o.default.clipboardData.getData && (u = o.default.clipboardData.getData(\"Text\")), \n n(a, i, s, u, r.onBeforePaste), t.preventDefault();\n\n case 7:\n case \"end\":\n return e.stop();\n }\n }), e, this);\n })), g = function() {\n var e = this, t = arguments;\n return new Promise((function(n, i) {\n var a = m.apply(e, t);\n function r(e) {\n v(a, n, i, r, o, \"next\", e);\n }\n function o(e) {\n v(a, n, i, r, o, \"throw\", e);\n }\n r(void 0);\n }));\n }, function(e) {\n return g.apply(this, arguments);\n }),\n inputFallBackEvent: function(e) {\n var t = this.inputmask, n = t.opts, i = t.dependencyLib;\n var a, o = this, u = o.inputmask._valueGet(!0), p = (t.isRTL ? c.getBuffer.call(t).slice().reverse() : c.getBuffer.call(t)).join(\"\"), d = c.caret.call(t, o, void 0, void 0, !0);\n if (p !== u) {\n if (a = function(e, i, a) {\n for (var r, o, l, s = e.substr(0, a.begin).split(\"\"), u = e.substr(a.begin).split(\"\"), p = i.substr(0, a.begin).split(\"\"), d = i.substr(a.begin).split(\"\"), h = s.length >= p.length ? s.length : p.length, v = u.length >= d.length ? u.length : d.length, m = \"\", g = [], y = \"~\"; s.length < h; ) s.push(y);\n for (;p.length < h; ) p.push(y);\n for (;u.length < v; ) u.unshift(y);\n for (;d.length < v; ) d.unshift(y);\n var k = s.concat(u), b = p.concat(d);\n for (o = 0, r = k.length; o < r; o++) switch (l = f.getPlaceholder.call(t, c.translatePosition.call(t, o)), \n m) {\n case \"insertText\":\n b[o - 1] === k[o] && a.begin == k.length - 1 && g.push(k[o]), o = r;\n break;\n\n case \"insertReplacementText\":\n case \"deleteContentBackward\":\n k[o] === y ? a.end++ : o = r;\n break;\n\n default:\n k[o] !== b[o] && (k[o + 1] !== y && k[o + 1] !== l && void 0 !== k[o + 1] || (b[o] !== l || b[o + 1] !== y) && b[o] !== y ? b[o + 1] === y && b[o] === k[o + 1] ? (m = \"insertText\", \n g.push(k[o]), a.begin--, a.end--) : k[o] !== l && k[o] !== y && (k[o + 1] === y || b[o] !== k[o] && b[o + 1] === k[o + 1]) ? (m = \"insertReplacementText\", \n g.push(k[o]), a.begin--) : k[o] === y ? (m = \"deleteContentBackward\", (c.isMask.call(t, c.translatePosition.call(t, o), !0) || b[o] === n.radixPoint) && a.end++) : o = r : (m = \"insertText\", \n g.push(k[o]), a.begin--, a.end--));\n }\n return {\n action: m,\n data: g,\n caret: a\n };\n }(u, p, d), (o.inputmask.shadowRoot || o.ownerDocument).activeElement !== o && o.focus(), \n (0, l.writeBuffer)(o, c.getBuffer.call(t)), c.caret.call(t, o, d.begin, d.end, !0), \n !r.mobile && t.skipNextInsert && \"insertText\" === e.inputType && \"insertText\" === a.action && t.isComposing) return !1;\n switch (\"insertCompositionText\" === e.inputType && \"insertText\" === a.action && t.isComposing ? t.skipNextInsert = !0 : t.skipNextInsert = !1, \n a.action) {\n case \"insertText\":\n case \"insertReplacementText\":\n a.data.forEach((function(e, n) {\n var a = new i.Event(\"keypress\");\n a.key = e, t.ignorable = !1, y.keypressEvent.call(o, a);\n })), setTimeout((function() {\n t.$el.trigger(\"keyup\");\n }), 0);\n break;\n\n case \"deleteContentBackward\":\n var h = new i.Event(\"keydown\");\n h.key = s.keys.Backspace, y.keyEvent.call(o, h);\n break;\n\n default:\n (0, l.applyInputValue)(o, u), c.caret.call(t, o, d.begin, d.end, !0);\n }\n e.preventDefault();\n }\n },\n setValueEvent: function(e) {\n var t = this.inputmask, n = t.dependencyLib, i = this, a = e && e.detail ? e.detail[0] : arguments[1];\n void 0 === a && (a = i.inputmask._valueGet(!0)), (0, l.applyInputValue)(i, a, new n.Event(\"input\")), \n (e.detail && void 0 !== e.detail[1] || void 0 !== arguments[2]) && c.caret.call(t, i, e.detail ? e.detail[1] : arguments[2]);\n },\n focusEvent: function(e) {\n var t = this.inputmask, n = t.opts, i = t && t._valueGet();\n n.showMaskOnFocus && i !== c.getBuffer.call(t).join(\"\") && (0, l.writeBuffer)(this, c.getBuffer.call(t), c.seekNext.call(t, c.getLastValidPosition.call(t))), \n !0 !== n.positionCaretOnTab || !1 !== t.mouseEnter || u.isComplete.call(t, c.getBuffer.call(t)) && -1 !== c.getLastValidPosition.call(t) || y.clickEvent.apply(this, [ e, !0 ]), \n t.undoValue = t && t._valueGet(!0);\n },\n invalidEvent: function(e) {\n this.inputmask.validationEvent = !0;\n },\n mouseleaveEvent: function() {\n var e = this.inputmask, t = e.opts, n = this;\n e.mouseEnter = !1, t.clearMaskOnLostFocus && (n.inputmask.shadowRoot || n.ownerDocument).activeElement !== n && (0, \n l.HandleNativePlaceholder)(n, e.originalPlaceholder);\n },\n clickEvent: function(e, t) {\n var n = this.inputmask;\n n.clicked++;\n var i = this;\n if ((i.inputmask.shadowRoot || i.ownerDocument).activeElement === i) {\n var a = c.determineNewCaretPosition.call(n, c.caret.call(n, i), t);\n void 0 !== a && c.caret.call(n, i, a);\n }\n },\n cutEvent: function(e) {\n var t = this.inputmask, n = t.maskset, i = this, a = c.caret.call(t, i), r = t.isRTL ? c.getBuffer.call(t).slice(a.end, a.begin) : c.getBuffer.call(t).slice(a.begin, a.end), f = t.isRTL ? r.reverse().join(\"\") : r.join(\"\");\n o.default.navigator && o.default.navigator.clipboard ? o.default.navigator.clipboard.writeText(f) : o.default.clipboardData && o.default.clipboardData.getData && o.default.clipboardData.setData(\"Text\", f), \n u.handleRemove.call(t, i, s.keys.Delete, a), (0, l.writeBuffer)(i, c.getBuffer.call(t), n.p, e, t.undoValue !== t._valueGet(!0));\n },\n blurEvent: function(e) {\n var t = this.inputmask, n = t.opts, i = t.dependencyLib;\n t.clicked = 0;\n var a = i(this), r = this;\n if (r.inputmask) {\n (0, l.HandleNativePlaceholder)(r, t.originalPlaceholder);\n var o = r.inputmask._valueGet(), s = c.getBuffer.call(t).slice();\n \"\" !== o && (n.clearMaskOnLostFocus && (-1 === c.getLastValidPosition.call(t) && o === c.getBufferTemplate.call(t).join(\"\") ? s = [] : l.clearOptionalTail.call(t, s)), \n !1 === u.isComplete.call(t, s) && (setTimeout((function() {\n a.trigger(\"incomplete\");\n }), 0), n.clearIncomplete && (c.resetMaskSet.call(t, !1), s = n.clearMaskOnLostFocus ? [] : c.getBufferTemplate.call(t).slice())), \n (0, l.writeBuffer)(r, s, void 0, e)), o = t._valueGet(!0), t.undoValue !== o && (\"\" != o || t.undoValue != c.getBufferTemplate.call(t).join(\"\") || t.undoValue == c.getBufferTemplate.call(t).join(\"\") && t.maskset.validPositions.length > 0) && (t.undoValue = o, \n a.trigger(\"change\"));\n }\n },\n mouseenterEvent: function() {\n var e = this.inputmask, t = e.opts.showMaskOnHover, n = this;\n if (e.mouseEnter = !0, (n.inputmask.shadowRoot || n.ownerDocument).activeElement !== n) {\n var i = (e.isRTL ? c.getBufferTemplate.call(e).slice().reverse() : c.getBufferTemplate.call(e)).join(\"\");\n t && (0, l.HandleNativePlaceholder)(n, i);\n }\n },\n submitEvent: function() {\n var e = this.inputmask, t = e.opts;\n e.undoValue !== e._valueGet(!0) && e.$el.trigger(\"change\"), -1 === c.getLastValidPosition.call(e) && e._valueGet && e._valueGet() === c.getBufferTemplate.call(e).join(\"\") && e._valueSet(\"\"), \n t.clearIncomplete && !1 === u.isComplete.call(e, c.getBuffer.call(e)) && e._valueSet(\"\"), \n t.removeMaskOnSubmit && (e._valueSet(e.unmaskedvalue(), !0), setTimeout((function() {\n (0, l.writeBuffer)(e.el, c.getBuffer.call(e));\n }), 0));\n },\n resetEvent: function() {\n var e = this.inputmask;\n e.refreshValue = !0, setTimeout((function() {\n (0, l.applyInputValue)(e.el, e._valueGet(!0));\n }), 0);\n }\n };\n },\n 9716: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventRuler = void 0;\n var i, a = n(7760), r = (i = n(2394)) && i.__esModule ? i : {\n default: i\n }, o = n(2839), l = n(8711);\n t.EventRuler = {\n on: function(e, t, n) {\n var i = e.inputmask.dependencyLib, s = function(t) {\n t.originalEvent && (t = t.originalEvent || t, arguments[0] = t);\n var s, c = this, u = c.inputmask, f = u ? u.opts : void 0;\n if (void 0 === u && \"FORM\" !== this.nodeName) {\n var p = i.data(c, \"_inputmask_opts\");\n i(c).off(), p && new r.default(p).mask(c);\n } else {\n if ([ \"submit\", \"reset\", \"setvalue\" ].includes(t.type) || \"FORM\" === this.nodeName || !(c.disabled || c.readOnly && !(\"keydown\" === t.type && t.ctrlKey && t.key === o.keys.c || !1 === f.tabThrough && t.key === o.keys.Tab))) {\n switch (t.type) {\n case \"input\":\n if (!0 === u.skipInputEvent) return u.skipInputEvent = !1, t.preventDefault();\n break;\n\n case \"click\":\n case \"focus\":\n return u.validationEvent ? (u.validationEvent = !1, e.blur(), (0, a.HandleNativePlaceholder)(e, (u.isRTL ? l.getBufferTemplate.call(u).slice().reverse() : l.getBufferTemplate.call(u)).join(\"\")), \n setTimeout((function() {\n e.focus();\n }), f.validationEventTimeOut), !1) : (s = arguments, void setTimeout((function() {\n e.inputmask && n.apply(c, s);\n }), 0));\n }\n var d = n.apply(c, arguments);\n return !1 === d && (t.preventDefault(), t.stopPropagation()), d;\n }\n t.preventDefault();\n }\n };\n [ \"submit\", \"reset\" ].includes(t) ? (s = s.bind(e), null !== e.form && i(e.form).on(t, s)) : i(e).on(t, s), \n e.inputmask.events[t] = e.inputmask.events[t] || [], e.inputmask.events[t].push(s);\n },\n off: function(e, t) {\n if (e.inputmask && e.inputmask.events) {\n var n = e.inputmask.dependencyLib, i = e.inputmask.events;\n for (var a in t && ((i = [])[t] = e.inputmask.events[t]), i) {\n for (var r = i[a]; r.length > 0; ) {\n var o = r.pop();\n [ \"submit\", \"reset\" ].includes(a) ? null !== e.form && n(e.form).off(a, o) : n(e).off(a, o);\n }\n delete e.inputmask.events[a];\n }\n }\n }\n };\n },\n 219: function(e, t, n) {\n var i = p(n(7184)), a = p(n(2394)), r = n(2839), o = n(8711), l = n(4713);\n function s(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var n = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != n) {\n var i, a, r, o, l = [], s = !0, c = !1;\n try {\n if (r = (n = n.call(e)).next, 0 === t) {\n if (Object(n) !== n) return;\n s = !1;\n } else for (;!(s = (i = r.call(n)).done) && (l.push(i.value), l.length !== t); s = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!s && null != n.return && (o = n.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return l;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return c(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return c(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function c(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n function u(e) {\n return u = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, u(e);\n }\n function f(e, t) {\n for (var n = 0; n < t.length; n++) {\n var i = t[n];\n i.enumerable = i.enumerable || !1, i.configurable = !0, \"value\" in i && (i.writable = !0), \n Object.defineProperty(e, (a = i.key, r = void 0, r = function(e, t) {\n if (\"object\" !== u(e) || null === e) return e;\n var n = e[Symbol.toPrimitive];\n if (void 0 !== n) {\n var i = n.call(e, t || \"default\");\n if (\"object\" !== u(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(a, \"string\"), \"symbol\" === u(r) ? r : String(r)), i);\n }\n var a, r;\n }\n function p(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n n(1313);\n var d = a.default.dependencyLib, h = function() {\n function e(t, n, i, a) {\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, e), this.mask = t, this.format = n, this.opts = i, this.inputmask = a, this._date = new Date(1, 0, 1), \n this.initDateObject(t, this.opts, this.inputmask);\n }\n var t, n, i;\n return t = e, (n = [ {\n key: \"date\",\n get: function() {\n return void 0 === this._date && (this._date = new Date(1, 0, 1), this.initDateObject(void 0, this.opts, this.inputmask)), \n this._date;\n }\n }, {\n key: \"initDateObject\",\n value: function(e, t, n) {\n var i;\n for (P(t).lastIndex = 0; i = P(t).exec(this.format); ) {\n var a = /\\d+$/.exec(i[0]), r = a ? i[0][0] + \"x\" : i[0], o = void 0;\n if (void 0 !== e) {\n if (a) {\n var s = P(t).lastIndex, c = j.call(n, i.index, t, n && n.maskset);\n P(t).lastIndex = s, o = e.slice(0, e.indexOf(c.nextMatch[0]));\n } else {\n for (var u = i[0][0], f = i.index; n && (t.placeholder[l.getTest.call(n, f).match.placeholder] || l.getTest.call(n, f).match.placeholder) === u; ) f++;\n var p = f - i.index;\n o = e.slice(0, p || y[r] && y[r][4] || r.length);\n }\n e = e.slice(o.length);\n }\n Object.prototype.hasOwnProperty.call(y, r) && this.setValue(this, o, r, y[r][2], y[r][1]);\n }\n }\n }, {\n key: \"setValue\",\n value: function(e, t, n, i, a) {\n if (void 0 !== t) switch (i) {\n case \"ampm\":\n e[i] = t, e[\"raw\" + i] = t.replace(/\\s/g, \"_\");\n break;\n\n case \"month\":\n if (\"mmm\" === n || \"mmmm\" === n) {\n e[i] = _(\"mmm\" === n ? m.monthNames.slice(0, 12).findIndex((function(e) {\n return t.toLowerCase() === e.toLowerCase();\n })) + 1 : m.monthNames.slice(12, 24).findIndex((function(e) {\n return t.toLowerCase() === e.toLowerCase();\n })) + 1, 2), e[i] = \"00\" === e[i] ? \"\" : e[i].toString(), e[\"raw\" + i] = e[i];\n break;\n }\n\n default:\n e[i] = t.replace(/[^0-9]/g, \"0\"), e[\"raw\" + i] = t.replace(/\\s/g, \"_\");\n }\n if (void 0 !== a) {\n var r = e[i];\n (\"day\" === i && 29 === parseInt(r) || \"month\" === i && 2 === parseInt(r)) && (29 !== parseInt(e.day) || 2 !== parseInt(e.month) || \"\" !== e.year && void 0 !== e.year || e._date.setFullYear(2012, 1, 29)), \n \"day\" === i && (g = !0, 0 === parseInt(r) && (r = 1)), \"month\" === i && (g = !0), \n \"year\" === i && (g = !0, r.length < y[n][4] && (r = _(r, y[n][4], !0))), (\"\" !== r && !isNaN(r) || \"ampm\" === i) && a.call(e._date, r);\n }\n }\n }, {\n key: \"reset\",\n value: function() {\n this._date = new Date(1, 0, 1);\n }\n }, {\n key: \"reInit\",\n value: function() {\n this._date = void 0, this.date;\n }\n } ]) && f(t.prototype, n), i && f(t, i), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e;\n }(), v = (new Date).getFullYear(), m = a.default.prototype.i18n, g = !1, y = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return _(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return _(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ m.monthNames.slice(0, 12).join(\"|\"), function(e) {\n var t = m.monthNames.slice(0, 12).findIndex((function(t) {\n return e.toLowerCase() === t.toLowerCase();\n }));\n return -1 !== t && Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return m.monthNames.slice(0, 12)[Date.prototype.getMonth.call(this)];\n } ],\n mmmm: [ m.monthNames.slice(12, 24).join(\"|\"), function(e) {\n var t = m.monthNames.slice(12, 24).findIndex((function(t) {\n return e.toLowerCase() === t.toLowerCase();\n }));\n return -1 !== t && Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return m.monthNames.slice(12, 24)[Date.prototype.getMonth.call(this)];\n } ],\n yy: [ \"[0-9]{2}\", function(e) {\n var t = (new Date).getFullYear().toString().slice(0, 2);\n Date.prototype.setFullYear.call(this, \"\".concat(t).concat(e));\n }, \"year\", function() {\n return _(Date.prototype.getFullYear.call(this), 2);\n }, 2 ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return _(Date.prototype.getFullYear.call(this), 4);\n }, 4 ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return _(Date.prototype.getHours.call(this), 2);\n } ],\n hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return Date.prototype.getHours;\n } ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return _(Date.prototype.getHours.call(this), 2);\n } ],\n Hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return function() {\n return _(Date.prototype.getHours.call(this), e);\n };\n } ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return _(Date.prototype.getMinutes.call(this), 2);\n } ],\n s: [ \"[1-5]?[0-9]\", Date.prototype.setSeconds, \"seconds\", Date.prototype.getSeconds ],\n ss: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return _(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return _(Date.prototype.getMilliseconds.call(this), 3);\n }, 3 ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return _(Date.prototype.getMilliseconds.call(this), 2);\n }, 2 ],\n t: [ \"[ap]\", b, \"ampm\", x, 1 ],\n tt: [ \"[ap]m\", b, \"ampm\", x, 2 ],\n T: [ \"[AP]\", b, \"ampm\", x, 1 ],\n TT: [ \"[AP]M\", b, \"ampm\", x, 2 ],\n Z: [ \".*\", void 0, \"Z\", function() {\n var e = this.toString().match(/\\((.+)\\)/)[1];\n e.includes(\" \") && (e = (e = e.replace(\"-\", \" \").toUpperCase()).split(\" \").map((function(e) {\n return s(e, 1)[0];\n })).join(\"\"));\n return e;\n } ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, k = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function b(e) {\n var t = this.getHours();\n e.toLowerCase().includes(\"p\") ? this.setHours(t + 12) : e.toLowerCase().includes(\"a\") && t >= 12 && this.setHours(t - 12);\n }\n function x() {\n var e = this.getHours();\n return (e = e || 12) >= 12 ? \"PM\" : \"AM\";\n }\n function w(e) {\n var t = /\\d+$/.exec(e[0]);\n if (t && void 0 !== t[0]) {\n var n = y[e[0][0] + \"x\"].slice(\"\");\n return n[0] = n[0](t[0]), n[3] = n[3](t[0]), n;\n }\n if (y[e[0]]) return y[e[0]];\n }\n function P(e) {\n if (!e.tokenizer) {\n var t = [], n = [];\n for (var i in y) if (/\\.*x$/.test(i)) {\n var a = i[0] + \"\\\\d+\";\n -1 === n.indexOf(a) && n.push(a);\n } else -1 === t.indexOf(i[0]) && t.push(i[0]);\n e.tokenizer = \"(\" + (n.length > 0 ? n.join(\"|\") + \"|\" : \"\") + t.join(\"+|\") + \")+?|.\", \n e.tokenizer = new RegExp(e.tokenizer, \"g\");\n }\n return e.tokenizer;\n }\n function S(e, t, n) {\n if (!g) return !0;\n if (void 0 === e.rawday || !isFinite(e.rawday) && new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day || \"29\" == e.day && (!isFinite(e.rawyear) || void 0 === e.rawyear || \"\" === e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) return t;\n if (\"29\" == e.day) {\n var i = j.call(this, t.pos, n, this.maskset);\n if (i.targetMatch && \"yyyy\" === i.targetMatch[0] && t.pos - i.targetMatchIndex == 2) return t.remove = t.pos + 1, \n t;\n } else if (2 == e.date.getMonth() && \"30\" == e.day && void 0 !== t.c) return e.day = \"03\", \n e.date.setDate(3), e.date.setMonth(1), t.insert = [ {\n pos: t.pos,\n c: \"0\"\n }, {\n pos: t.pos + 1,\n c: t.c\n } ], t.caret = o.seekNext.call(this, t.pos + 1), t;\n return !1;\n }\n function O(e, t, n, a) {\n var r, o, l = \"\", s = 0, c = {};\n for (P(n).lastIndex = 0; r = P(n).exec(e); ) {\n if (void 0 === t) if (o = w(r)) l += \"(\" + o[0] + \")\", n.placeholder && \"\" !== n.placeholder ? (c[s] = n.placeholder[r.index % n.placeholder.length], \n c[n.placeholder[r.index % n.placeholder.length]] = r[0].charAt(0)) : c[s] = r[0].charAt(0); else switch (r[0]) {\n case \"[\":\n l += \"(\";\n break;\n\n case \"]\":\n l += \")?\";\n break;\n\n default:\n l += (0, i.default)(r[0]), c[s] = r[0].charAt(0);\n } else if (o = w(r)) if (!0 !== a && o[3]) l += o[3].call(t.date); else o[2] ? l += t[\"raw\" + o[2]] : l += r[0]; else l += r[0];\n s++;\n }\n return void 0 === t && (n.placeholder = c), l;\n }\n function _(e, t, n) {\n for (e = String(e), t = t || 2; e.length < t; ) e = n ? e + \"0\" : \"0\" + e;\n return e;\n }\n function M(e, t, n) {\n return \"string\" == typeof e ? new h(e, t, n, this) : e && \"object\" === u(e) && Object.prototype.hasOwnProperty.call(e, \"date\") ? e : void 0;\n }\n function E(e, t) {\n return O(t.inputFormat, {\n date: e\n }, t);\n }\n function j(e, t, n) {\n var i, a, r = this, o = n && n.tests[e] ? t.placeholder[n.tests[e][0].match.placeholder] || n.tests[e][0].match.placeholder : \"\", s = 0, c = 0;\n for (P(t).lastIndex = 0; a = P(t).exec(t.inputFormat); ) {\n var u = /\\d+$/.exec(a[0]);\n if (u) c = parseInt(u[0]); else {\n for (var f = a[0][0], p = s; r && (t.placeholder[l.getTest.call(r, p).match.placeholder] || l.getTest.call(r, p).match.placeholder) === f; ) p++;\n 0 === (c = p - s) && (c = a[0].length);\n }\n if (s += c, -1 != a[0].indexOf(o) || s >= e + 1) {\n i = a, a = P(t).exec(t.inputFormat);\n break;\n }\n }\n return {\n targetMatchIndex: s - c,\n nextMatch: a,\n targetMatch: i\n };\n }\n a.default.extendAliases({\n datetime: {\n mask: function(e) {\n return e.numericInput = !1, y.S = m.ordinalSuffix.join(\"|\"), e.inputFormat = k[e.inputFormat] || e.inputFormat, \n e.displayFormat = k[e.displayFormat] || e.displayFormat || e.inputFormat, e.outputFormat = k[e.outputFormat] || e.outputFormat || e.inputFormat, \n e.regex = O(e.inputFormat, void 0, e), e.min = M(e.min, e.inputFormat, e), e.max = M(e.max, e.inputFormat, e), \n null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: null,\n outputFormat: null,\n min: null,\n max: null,\n skipOptionalPartCharacter: \"\",\n preValidation: function(e, t, n, i, a, r, o, l) {\n if (l) return !0;\n if (isNaN(n) && e[t] !== n) {\n var s = j.call(this, t, a, r);\n if (s.nextMatch && s.nextMatch[0] === n && s.targetMatch[0].length > 1) {\n var c = w(s.targetMatch)[0];\n if (new RegExp(c).test(\"0\" + e[t - 1])) return e[t] = e[t - 1], e[t - 1] = \"0\", \n {\n fuzzy: !0,\n buffer: e,\n refreshFromBuffer: {\n start: t - 1,\n end: t + 1\n },\n pos: t + 1\n };\n }\n }\n return !0;\n },\n postValidation: function(e, t, n, i, a, r, o, s) {\n var c, u, f = this;\n if (o) return !0;\n if (!1 === i && (((c = j.call(f, t + 1, a, r)).targetMatch && c.targetMatchIndex === t && c.targetMatch[0].length > 1 && void 0 !== y[c.targetMatch[0]] || (c = j.call(f, t + 2, a, r)).targetMatch && c.targetMatchIndex === t + 1 && c.targetMatch[0].length > 1 && void 0 !== y[c.targetMatch[0]]) && (u = w(c.targetMatch)[0]), \n void 0 !== u && (void 0 !== r.validPositions[t + 1] && new RegExp(u).test(n + \"0\") ? (e[t] = n, \n e[t + 1] = \"0\", i = {\n pos: t + 2,\n caret: t\n }) : new RegExp(u).test(\"0\" + n) && (e[t] = \"0\", e[t + 1] = n, i = {\n pos: t + 2\n })), !1 === i)) return i;\n if (i.fuzzy && (e = i.buffer, t = i.pos), (c = j.call(f, t, a, r)).targetMatch && c.targetMatch[0] && void 0 !== y[c.targetMatch[0]]) {\n var p = w(c.targetMatch);\n u = p[0];\n var d = e.slice(c.targetMatchIndex, c.targetMatchIndex + c.targetMatch[0].length);\n if (!1 === new RegExp(u).test(d.join(\"\")) && 2 === c.targetMatch[0].length && r.validPositions[c.targetMatchIndex] && r.validPositions[c.targetMatchIndex + 1] && (r.validPositions[c.targetMatchIndex + 1].input = \"0\"), \n \"year\" == p[2]) for (var h = l.getMaskTemplate.call(f, !1, 1, void 0, !0), m = t + 1; m < e.length; m++) e[m] = h[m], \n r.validPositions.splice(t + 1, 1);\n }\n var g = i, k = M.call(f, e.join(\"\"), a.inputFormat, a);\n return g && !isNaN(k.date.getTime()) && (a.prefillYear && (g = function(e, t, n) {\n if (e.year !== e.rawyear) {\n var i = v.toString(), a = e.rawyear.replace(/[^0-9]/g, \"\"), r = i.slice(0, a.length), o = i.slice(a.length);\n if (2 === a.length && a === r) {\n var l = new Date(v, e.month - 1, e.day);\n e.day == l.getDate() && (!n.max || n.max.date.getTime() >= l.getTime()) && (e.date.setFullYear(v), \n e.year = i, t.insert = [ {\n pos: t.pos + 1,\n c: o[0]\n }, {\n pos: t.pos + 2,\n c: o[1]\n } ]);\n }\n }\n return t;\n }(k, g, a)), g = function(e, t, n, i, a) {\n if (!t) return t;\n if (t && n.min && !isNaN(n.min.date.getTime())) {\n var r;\n for (e.reset(), P(n).lastIndex = 0; r = P(n).exec(n.inputFormat); ) {\n var o;\n if ((o = w(r)) && o[3]) {\n for (var l = o[1], s = e[o[2]], c = n.min[o[2]], u = n.max ? n.max[o[2]] : c + 1, f = [], p = !1, d = 0; d < c.length; d++) void 0 !== i.validPositions[d + r.index] || p ? (f[d] = s[d], \n p = p || s[d] > c[d]) : (d + r.index == 0 && s[d] < c[d] ? (f[d] = s[d], p = !0) : f[d] = c[d], \n \"year\" === o[2] && s.length - 1 == d && c != u && (f = (parseInt(f.join(\"\")) + 1).toString().split(\"\")), \n \"ampm\" === o[2] && c != u && n.min.date.getTime() > e.date.getTime() && (f[d] = u[d]));\n l.call(e._date, f.join(\"\"));\n }\n }\n t = n.min.date.getTime() <= e.date.getTime(), e.reInit();\n }\n return t && n.max && (isNaN(n.max.date.getTime()) || (t = n.max.date.getTime() >= e.date.getTime())), \n t;\n }(k, g = S.call(f, k, g, a), a, r)), void 0 !== t && g && i.pos !== t ? {\n buffer: O(a.inputFormat, k, a).split(\"\"),\n refreshFromBuffer: {\n start: t,\n end: i.pos\n },\n pos: i.caret || i.pos\n } : g;\n },\n onKeyDown: function(e, t, n, i) {\n e.ctrlKey && e.key === r.keys.ArrowRight && (this.inputmask._valueSet(E(new Date, i)), \n d(this).trigger(\"setvalue\"));\n },\n onUnMask: function(e, t, n) {\n return t ? O(n.outputFormat, M.call(this, e, n.inputFormat, n), n, !0) : t;\n },\n casing: function(e, t, n, i) {\n if (0 == t.nativeDef.indexOf(\"[ap]\")) return e.toLowerCase();\n if (0 == t.nativeDef.indexOf(\"[AP]\")) return e.toUpperCase();\n var a = l.getTest.call(this, [ n - 1 ]);\n return 0 == a.match.def.indexOf(\"[AP]\") || 0 === n || a && a.input === String.fromCharCode(r.keyCode.Space) || a && a.match.def === String.fromCharCode(r.keyCode.Space) ? e.toUpperCase() : e.toLowerCase();\n },\n onBeforeMask: function(e, t) {\n return \"[object Date]\" === Object.prototype.toString.call(e) && (e = E(e, t)), e;\n },\n insertMode: !1,\n insertModeVisual: !1,\n shiftPositions: !1,\n keepStatic: !1,\n inputmode: \"numeric\",\n prefillYear: !0\n }\n });\n },\n 1313: function(e, t, n) {\n var i, a = (i = n(2394)) && i.__esModule ? i : {\n default: i\n };\n a.default.dependencyLib.extend(!0, a.default.prototype.i18n, {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n });\n },\n 3851: function(e, t, n) {\n var i, a = (i = n(2394)) && i.__esModule ? i : {\n default: i\n }, r = n(8711), o = n(4713);\n function l(e) {\n return function(e) {\n if (Array.isArray(e)) return s(e);\n }(e) || function(e) {\n if (\"undefined\" != typeof Symbol && null != e[Symbol.iterator] || null != e[\"@@iterator\"]) return Array.from(e);\n }(e) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return s(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return s(e, t);\n }(e) || function() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function s(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n a.default.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n var c = /25[0-5]|2[0-4][0-9]|[01][0-9][0-9]/;\n function u(e, t, n, i, a) {\n if (n - 1 > -1 && \".\" !== t.buffer[n - 1] ? (e = t.buffer[n - 1] + e, e = n - 2 > -1 && \".\" !== t.buffer[n - 2] ? t.buffer[n - 2] + e : \"0\" + e) : e = \"00\" + e, \n a.greedy && parseInt(e) > 255 && c.test(\"00\" + e.charAt(2))) {\n var r = [].concat(l(t.buffer.slice(0, n)), [ \".\", e.charAt(2) ]);\n if (r.join(\"\").match(/\\./g).length < 4) return {\n refreshFromBuffer: !0,\n buffer: r,\n caret: n + 2\n };\n }\n return c.test(e);\n }\n a.default.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)://.*\",\n autoUnmask: !1,\n keepStatic: !1,\n tabThrough: !0\n },\n ip: {\n mask: \"i{1,3}.j{1,3}.k{1,3}.l{1,3}\",\n definitions: {\n i: {\n validator: u\n },\n j: {\n validator: u\n },\n k: {\n validator: u\n },\n l: {\n validator: u\n }\n },\n onUnMask: function(e, t, n) {\n return e;\n },\n inputmode: \"decimal\",\n substitutes: {\n \",\": \".\"\n }\n },\n email: {\n mask: function(e) {\n var t = e.separator, n = e.quantifier, i = \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\", a = i;\n if (t) for (var r = 0; r < n; r++) a += \"[\".concat(t).concat(i, \"]\");\n return a;\n },\n greedy: !1,\n casing: \"lower\",\n separator: null,\n quantifier: 5,\n skipOptionalPartCharacter: \"\",\n onBeforePaste: function(e, t) {\n return (e = e.toLowerCase()).replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(e, t, n) {\n return e;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: !0,\n autoUnmask: !0\n },\n ssn: {\n mask: \"999-99-9999\",\n postValidation: function(e, t, n, i, a, l, s) {\n var c = o.getMaskTemplate.call(this, !0, r.getLastValidPosition.call(this), !0, !0);\n return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(c.join(\"\"));\n }\n }\n });\n },\n 207: function(e, t, n) {\n var i = l(n(7184)), a = l(n(2394)), r = n(2839), o = n(8711);\n function l(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var s = a.default.dependencyLib;\n function c(e, t) {\n for (var n = \"\", i = 0; i < e.length; i++) a.default.prototype.definitions[e.charAt(i)] || t.definitions[e.charAt(i)] || t.optionalmarker[0] === e.charAt(i) || t.optionalmarker[1] === e.charAt(i) || t.quantifiermarker[0] === e.charAt(i) || t.quantifiermarker[1] === e.charAt(i) || t.groupmarker[0] === e.charAt(i) || t.groupmarker[1] === e.charAt(i) || t.alternatormarker === e.charAt(i) ? n += \"\\\\\" + e.charAt(i) : n += e.charAt(i);\n return n;\n }\n function u(e, t, n, i) {\n if (e.length > 0 && t > 0 && (!n.digitsOptional || i)) {\n var a = e.indexOf(n.radixPoint), r = !1;\n n.negationSymbol.back === e[e.length - 1] && (r = !0, e.length--), -1 === a && (e.push(n.radixPoint), \n a = e.length - 1);\n for (var o = 1; o <= t; o++) isFinite(e[a + o]) || (e[a + o] = \"0\");\n }\n return r && e.push(n.negationSymbol.back), e;\n }\n function f(e, t) {\n var n = 0;\n for (var i in \"+\" === e && (n = o.seekNext.call(this, t.validPositions.length - 1)), \n t.tests) if ((i = parseInt(i)) >= n) for (var a = 0, r = t.tests[i].length; a < r; a++) if ((void 0 === t.validPositions[i] || \"-\" === e) && t.tests[i][a].match.def === e) return i + (void 0 !== t.validPositions[i] && \"-\" !== e ? 1 : 0);\n return n;\n }\n function p(e, t) {\n for (var n = -1, i = 0, a = t.validPositions.length; i < a; i++) {\n var r = t.validPositions[i];\n if (r && r.match.def === e) {\n n = i;\n break;\n }\n }\n return n;\n }\n function d(e, t, n, i, a) {\n var r = t.buffer ? t.buffer.indexOf(a.radixPoint) : -1, o = (-1 !== r || i && a.jitMasking) && new RegExp(a.definitions[9].validator).test(e);\n return !i && a._radixDance && -1 !== r && o && null == t.validPositions[r] ? {\n insert: {\n pos: r === n ? r + 1 : r,\n c: a.radixPoint\n },\n pos: n\n } : o;\n }\n a.default.extendAliases({\n numeric: {\n mask: function(e) {\n e.repeat = 0, e.groupSeparator === e.radixPoint && e.digits && \"0\" !== e.digits && (\".\" === e.radixPoint ? e.groupSeparator = \",\" : \",\" === e.radixPoint ? e.groupSeparator = \".\" : e.groupSeparator = \"\"), \n \" \" === e.groupSeparator && (e.skipOptionalPartCharacter = void 0), e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), \n \"radixFocus\" === e.positionCaretOnClick && \"\" === e.placeholder && (e.positionCaretOnClick = \"lvp\");\n var t = \"0\", n = e.radixPoint;\n !0 === e.numericInput && void 0 === e.__financeInput ? (t = \"1\", e.positionCaretOnClick = \"radixFocus\" === e.positionCaretOnClick ? \"lvp\" : e.positionCaretOnClick, \n e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e._radixDance = !1, n = \",\" === e.radixPoint ? \"?\" : \"!\", \n \"\" !== e.radixPoint && void 0 === e.definitions[n] && (e.definitions[n] = {}, e.definitions[n].validator = \"[\" + e.radixPoint + \"]\", \n e.definitions[n].placeholder = e.radixPoint, e.definitions[n].static = !0, e.definitions[n].generated = !0)) : (e.__financeInput = !1, \n e.numericInput = !0);\n var a, r = \"[+]\";\n if (r += c(e.prefix, e), \"\" !== e.groupSeparator ? (void 0 === e.definitions[e.groupSeparator] && (e.definitions[e.groupSeparator] = {}, \n e.definitions[e.groupSeparator].validator = \"[\" + e.groupSeparator + \"]\", e.definitions[e.groupSeparator].placeholder = e.groupSeparator, \n e.definitions[e.groupSeparator].static = !0, e.definitions[e.groupSeparator].generated = !0), \n r += e._mask(e)) : r += \"9{+}\", void 0 !== e.digits && 0 !== e.digits) {\n var o = e.digits.toString().split(\",\");\n isFinite(o[0]) && o[1] && isFinite(o[1]) ? r += n + t + \"{\" + e.digits + \"}\" : (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.digitsOptional || e.jitMasking ? (a = r + n + t + \"{0,\" + e.digits + \"}\", \n e.keepStatic = !0) : r += n + t + \"{\" + e.digits + \"}\");\n } else e.inputmode = \"numeric\";\n return r += c(e.suffix, e), r += \"[-]\", a && (r = [ a + c(e.suffix, e) + \"[-]\", r ]), \n e.greedy = !1, function(e) {\n void 0 === e.parseMinMaxOptions && (null !== e.min && (e.min = e.min.toString().replace(new RegExp((0, \n i.default)(e.groupSeparator), \"g\"), \"\"), \",\" === e.radixPoint && (e.min = e.min.replace(e.radixPoint, \".\")), \n e.min = isFinite(e.min) ? parseFloat(e.min) : NaN, isNaN(e.min) && (e.min = Number.MIN_VALUE)), \n null !== e.max && (e.max = e.max.toString().replace(new RegExp((0, i.default)(e.groupSeparator), \"g\"), \"\"), \n \",\" === e.radixPoint && (e.max = e.max.replace(e.radixPoint, \".\")), e.max = isFinite(e.max) ? parseFloat(e.max) : NaN, \n isNaN(e.max) && (e.max = Number.MAX_VALUE)), e.parseMinMaxOptions = \"done\");\n }(e), \"\" !== e.radixPoint && e.substituteRadixPoint && (e.substitutes[\".\" == e.radixPoint ? \",\" : \".\"] = e.radixPoint), \n r;\n },\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"999){+|1}\";\n },\n digits: \"*\",\n digitsOptional: !0,\n enforceDigitsOnBlur: !1,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n _radixDance: !0,\n groupSeparator: \"\",\n allowMinus: !0,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n prefix: \"\",\n suffix: \"\",\n min: null,\n max: null,\n SetMaxOnOverflow: !1,\n step: 1,\n inputType: \"text\",\n unmaskAsNumber: !1,\n roundingFN: Math.round,\n inputmode: \"decimal\",\n shortcuts: {\n k: \"1000\",\n m: \"1000000\"\n },\n placeholder: \"0\",\n greedy: !1,\n rightAlign: !0,\n insertMode: !0,\n autoUnmask: !1,\n skipOptionalPartCharacter: \"\",\n usePrototypeDefinitions: !1,\n stripLeadingZeroes: !0,\n substituteRadixPoint: !0,\n definitions: {\n 0: {\n validator: d\n },\n 1: {\n validator: d,\n definitionSymbol: \"9\"\n },\n 9: {\n validator: \"[0-9\\uff10-\\uff19\\u0660-\\u0669\\u06f0-\\u06f9]\",\n definitionSymbol: \"*\"\n },\n \"+\": {\n validator: function(e, t, n, i, a) {\n return a.allowMinus && (\"-\" === e || e === a.negationSymbol.front);\n }\n },\n \"-\": {\n validator: function(e, t, n, i, a) {\n return a.allowMinus && e === a.negationSymbol.back;\n }\n }\n },\n preValidation: function(e, t, n, i, a, r, o, l) {\n var s = this;\n if (!1 !== a.__financeInput && n === a.radixPoint) return !1;\n var c = e.indexOf(a.radixPoint), u = t;\n if (t = function(e, t, n, i, a) {\n return a._radixDance && a.numericInput && t !== a.negationSymbol.back && e <= n && (n > 0 || t == a.radixPoint) && (void 0 === i.validPositions[e - 1] || i.validPositions[e - 1].input !== a.negationSymbol.back) && (e -= 1), \n e;\n }(t, n, c, r, a), \"-\" === n || n === a.negationSymbol.front) {\n if (!0 !== a.allowMinus) return !1;\n var d = !1, h = p(\"+\", r), v = p(\"-\", r);\n return -1 !== h && (d = [ h ], -1 !== v && d.push(v)), !1 !== d ? {\n remove: d,\n caret: u - a.negationSymbol.back.length\n } : {\n insert: [ {\n pos: f.call(s, \"+\", r),\n c: a.negationSymbol.front,\n fromIsValid: !0\n }, {\n pos: f.call(s, \"-\", r),\n c: a.negationSymbol.back,\n fromIsValid: void 0\n } ],\n caret: u + a.negationSymbol.back.length\n };\n }\n if (n === a.groupSeparator) return {\n caret: u\n };\n if (l) return !0;\n if (-1 !== c && !0 === a._radixDance && !1 === i && n === a.radixPoint && void 0 !== a.digits && (isNaN(a.digits) || parseInt(a.digits) > 0) && c !== t) {\n var m = f.call(s, a.radixPoint, r);\n return r.validPositions[m] && (r.validPositions[m].generatedInput = r.validPositions[m].generated || !1), \n {\n caret: a._radixDance && t === c - 1 ? c + 1 : c\n };\n }\n if (!1 === a.__financeInput) if (i) {\n if (a.digitsOptional) return {\n rewritePosition: o.end\n };\n if (!a.digitsOptional) {\n if (o.begin > c && o.end <= c) return n === a.radixPoint ? {\n insert: {\n pos: c + 1,\n c: \"0\",\n fromIsValid: !0\n },\n rewritePosition: c\n } : {\n rewritePosition: c + 1\n };\n if (o.begin < c) return {\n rewritePosition: o.begin - 1\n };\n }\n } else if (!a.showMaskOnHover && !a.showMaskOnFocus && !a.digitsOptional && a.digits > 0 && \"\" === this.__valueGet.call(this.el)) return {\n rewritePosition: c\n };\n return {\n rewritePosition: t\n };\n },\n postValidation: function(e, t, n, i, a, r, o) {\n if (!1 === i) return i;\n if (o) return !0;\n if (null !== a.min || null !== a.max) {\n var l = a.onUnMask(e.slice().reverse().join(\"\"), void 0, s.extend({}, a, {\n unmaskAsNumber: !0\n }));\n if (null !== a.min && l < a.min && (l.toString().length > a.min.toString().length || l < 0)) return !1;\n if (null !== a.max && l > a.max) return !!a.SetMaxOnOverflow && {\n refreshFromBuffer: !0,\n buffer: u(a.max.toString().replace(\".\", a.radixPoint).split(\"\"), a.digits, a).reverse()\n };\n }\n return i;\n },\n onUnMask: function(e, t, n) {\n if (\"\" === t && !0 === n.nullable) return t;\n var a = e.replace(n.prefix, \"\");\n return a = (a = a.replace(n.suffix, \"\")).replace(new RegExp((0, i.default)(n.groupSeparator), \"g\"), \"\"), \n \"\" !== n.placeholder.charAt(0) && (a = a.replace(new RegExp(n.placeholder.charAt(0), \"g\"), \"0\")), \n n.unmaskAsNumber ? (\"\" !== n.radixPoint && -1 !== a.indexOf(n.radixPoint) && (a = a.replace(i.default.call(this, n.radixPoint), \".\")), \n a = (a = a.replace(new RegExp(\"^\" + (0, i.default)(n.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n i.default)(n.negationSymbol.back) + \"$\"), \"\"), Number(a)) : a;\n },\n isComplete: function(e, t) {\n var n = (t.numericInput ? e.slice().reverse() : e).join(\"\");\n return n = (n = (n = (n = (n = n.replace(new RegExp(\"^\" + (0, i.default)(t.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n i.default)(t.negationSymbol.back) + \"$\"), \"\")).replace(t.prefix, \"\")).replace(t.suffix, \"\")).replace(new RegExp((0, \n i.default)(t.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\"), \",\" === t.radixPoint && (n = n.replace((0, \n i.default)(t.radixPoint), \".\")), isFinite(n);\n },\n onBeforeMask: function(e, t) {\n var n;\n e = null !== (n = e) && void 0 !== n ? n : \"\";\n var a = t.radixPoint || \",\";\n isFinite(t.digits) && (t.digits = parseInt(t.digits)), \"number\" != typeof e && \"number\" !== t.inputType || \"\" === a || (e = e.toString().replace(\".\", a));\n var r = \"-\" === e.charAt(0) || e.charAt(0) === t.negationSymbol.front, o = e.split(a), l = o[0].replace(/[^\\-0-9]/g, \"\"), s = o.length > 1 ? o[1].replace(/[^0-9]/g, \"\") : \"\", c = o.length > 1;\n e = l + (\"\" !== s ? a + s : s);\n var f = 0;\n if (\"\" !== a && (f = t.digitsOptional ? t.digits < s.length ? t.digits : s.length : t.digits, \n \"\" !== s || !t.digitsOptional)) {\n var p = Math.pow(10, f || 1);\n e = e.replace((0, i.default)(a), \".\"), isNaN(parseFloat(e)) || (e = (t.roundingFN(parseFloat(e) * p) / p).toFixed(f)), \n e = e.toString().replace(\".\", a);\n }\n if (0 === t.digits && -1 !== e.indexOf(a) && (e = e.substring(0, e.indexOf(a))), \n null !== t.min || null !== t.max) {\n var d = e.toString().replace(a, \".\");\n null !== t.min && d < t.min ? e = t.min.toString().replace(\".\", a) : null !== t.max && d > t.max && (e = t.max.toString().replace(\".\", a));\n }\n return r && \"-\" !== e.charAt(0) && (e = \"-\" + e), u(e.toString().split(\"\"), f, t, c).join(\"\");\n },\n onBeforeWrite: function(e, t, n, a) {\n function r(e, t) {\n if (!1 !== a.__financeInput || t) {\n var n = e.indexOf(a.radixPoint);\n -1 !== n && e.splice(n, 1);\n }\n if (\"\" !== a.groupSeparator) for (;-1 !== (n = e.indexOf(a.groupSeparator)); ) e.splice(n, 1);\n return e;\n }\n var o, l;\n if (a.stripLeadingZeroes && (l = function(e, t) {\n var n = new RegExp(\"(^\" + (\"\" !== t.negationSymbol.front ? (0, i.default)(t.negationSymbol.front) + \"?\" : \"\") + (0, \n i.default)(t.prefix) + \")(.*)(\" + (0, i.default)(t.suffix) + (\"\" != t.negationSymbol.back ? (0, \n i.default)(t.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(e.slice().reverse().join(\"\")), a = n ? n[2] : \"\", r = !1;\n return a && (a = a.split(t.radixPoint.charAt(0))[0], r = new RegExp(\"^[0\" + t.groupSeparator + \"]*\").exec(a)), \n !(!r || !(r[0].length > 1 || r[0].length > 0 && r[0].length < a.length)) && r;\n }(t, a))) for (var c = t.join(\"\").lastIndexOf(l[0].split(\"\").reverse().join(\"\")) - (l[0] == l.input ? 0 : 1), f = l[0] == l.input ? 1 : 0, p = l[0].length - f; p > 0; p--) this.maskset.validPositions.splice(c + p, 1), \n delete t[c + p];\n if (e) switch (e.type) {\n case \"blur\":\n case \"checkval\":\n if (null !== a.min) {\n var d = a.onUnMask(t.slice().reverse().join(\"\"), void 0, s.extend({}, a, {\n unmaskAsNumber: !0\n }));\n if (null !== a.min && d < a.min) return {\n refreshFromBuffer: !0,\n buffer: u(a.min.toString().replace(\".\", a.radixPoint).split(\"\"), a.digits, a).reverse()\n };\n }\n if (t[t.length - 1] === a.negationSymbol.front) {\n var h = new RegExp(\"(^\" + (\"\" != a.negationSymbol.front ? (0, i.default)(a.negationSymbol.front) + \"?\" : \"\") + (0, \n i.default)(a.prefix) + \")(.*)(\" + (0, i.default)(a.suffix) + (\"\" != a.negationSymbol.back ? (0, \n i.default)(a.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(r(t.slice(), !0).reverse().join(\"\"));\n 0 == (h ? h[2] : \"\") && (o = {\n refreshFromBuffer: !0,\n buffer: [ 0 ]\n });\n } else if (\"\" !== a.radixPoint) {\n t.indexOf(a.radixPoint) === a.suffix.length && (o && o.buffer ? o.buffer.splice(0, 1 + a.suffix.length) : (t.splice(0, 1 + a.suffix.length), \n o = {\n refreshFromBuffer: !0,\n buffer: r(t)\n }));\n }\n if (a.enforceDigitsOnBlur) {\n var v = (o = o || {}) && o.buffer || t.slice().reverse();\n o.refreshFromBuffer = !0, o.buffer = u(v, a.digits, a, !0).reverse();\n }\n }\n return o;\n },\n onKeyDown: function(e, t, n, i) {\n var a, o = s(this);\n if (3 != e.location) {\n var l, c = e.key;\n if ((l = i.shortcuts && i.shortcuts[c]) && l.length > 1) return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) * parseInt(l)), \n o.trigger(\"setvalue\"), !1;\n }\n if (e.ctrlKey) switch (e.key) {\n case r.keys.ArrowUp:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(i.step)), \n o.trigger(\"setvalue\"), !1;\n\n case r.keys.ArrowDown:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(i.step)), \n o.trigger(\"setvalue\"), !1;\n }\n if (!e.shiftKey && (e.key === r.keys.Delete || e.key === r.keys.Backspace || e.key === r.keys.BACKSPACE_SAFARI) && n.begin !== t.length) {\n if (t[e.key === r.keys.Delete ? n.begin - 1 : n.end] === i.negationSymbol.front) return a = t.slice().reverse(), \n \"\" !== i.negationSymbol.front && a.shift(), \"\" !== i.negationSymbol.back && a.pop(), \n o.trigger(\"setvalue\", [ a.join(\"\"), n.begin ]), !1;\n if (!0 === i._radixDance) {\n var f, p = t.indexOf(i.radixPoint);\n if (i.digitsOptional) {\n if (0 === p) return (a = t.slice().reverse()).pop(), o.trigger(\"setvalue\", [ a.join(\"\"), n.begin >= a.length ? a.length : n.begin ]), \n !1;\n } else if (-1 !== p && (n.begin < p || n.end < p || e.key === r.keys.Delete && (n.begin === p || n.begin - 1 === p))) return n.begin === n.end && (e.key === r.keys.Backspace || e.key === r.keys.BACKSPACE_SAFARI ? n.begin++ : e.key === r.keys.Delete && n.begin - 1 === p && (f = s.extend({}, n), \n n.begin--, n.end--)), (a = t.slice().reverse()).splice(a.length - n.begin, n.begin - n.end + 1), \n a = u(a, i.digits, i).join(\"\"), f && (n = f), o.trigger(\"setvalue\", [ a, n.begin >= a.length ? p + 1 : n.begin ]), \n !1;\n }\n }\n }\n },\n currency: {\n prefix: \"\",\n groupSeparator: \",\",\n alias: \"numeric\",\n digits: 2,\n digitsOptional: !1\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n inputmode: \"numeric\",\n digits: 0\n },\n percentage: {\n alias: \"numeric\",\n min: 0,\n max: 100,\n suffix: \" %\",\n digits: 0,\n allowMinus: !1\n },\n indianns: {\n alias: \"numeric\",\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"99){*|1}(\" + e.groupSeparator + \"999){1|1}\";\n },\n groupSeparator: \",\",\n radixPoint: \".\",\n placeholder: \"0\",\n digits: 2,\n digitsOptional: !1\n }\n });\n },\n 9380: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = !(\"undefined\" == typeof window || !window.document || !window.document.createElement);\n t.default = n ? window : {};\n },\n 7760: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.HandleNativePlaceholder = function(e, t) {\n var n = e ? e.inputmask : this;\n if (i.ie) {\n if (e.inputmask._valueGet() !== t && (e.placeholder !== t || \"\" === e.placeholder)) {\n var a = o.getBuffer.call(n).slice(), r = e.inputmask._valueGet();\n if (r !== t) {\n var l = o.getLastValidPosition.call(n);\n -1 === l && r === o.getBufferTemplate.call(n).join(\"\") ? a = [] : -1 !== l && u.call(n, a), \n p(e, a);\n }\n }\n } else e.placeholder !== t && (e.placeholder = t, \"\" === e.placeholder && e.removeAttribute(\"placeholder\"));\n }, t.applyInputValue = c, t.checkVal = f, t.clearOptionalTail = u, t.unmaskedvalue = function(e) {\n var t = e ? e.inputmask : this, n = t.opts, i = t.maskset;\n if (e) {\n if (void 0 === e.inputmask) return e.value;\n e.inputmask && e.inputmask.refreshValue && c(e, e.inputmask._valueGet(!0));\n }\n for (var a = [], r = i.validPositions, l = 0, s = r.length; l < s; l++) r[l] && r[l].match && (1 != r[l].match.static || Array.isArray(i.metadata) && !0 !== r[l].generatedInput) && a.push(r[l].input);\n var u = 0 === a.length ? \"\" : (t.isRTL ? a.reverse() : a).join(\"\");\n if (\"function\" == typeof n.onUnMask) {\n var f = (t.isRTL ? o.getBuffer.call(t).slice().reverse() : o.getBuffer.call(t)).join(\"\");\n u = n.onUnMask.call(t, f, u, n);\n }\n return u;\n }, t.writeBuffer = p;\n var i = n(9845), a = n(6030), r = n(2839), o = n(8711), l = n(7215), s = n(4713);\n function c(e, t, n) {\n var i = e ? e.inputmask : this, a = i.opts;\n e.inputmask.refreshValue = !1, \"function\" == typeof a.onBeforeMask && (t = a.onBeforeMask.call(i, t, a) || t), \n f(e, !0, !1, t = (t || \"\").toString().split(\"\"), n), i.undoValue = i._valueGet(!0), \n (a.clearMaskOnLostFocus || a.clearIncomplete) && e.inputmask._valueGet() === o.getBufferTemplate.call(i).join(\"\") && -1 === o.getLastValidPosition.call(i) && e.inputmask._valueSet(\"\");\n }\n function u(e) {\n e.length = 0;\n for (var t, n = s.getMaskTemplate.call(this, !0, 0, !0, void 0, !0); void 0 !== (t = n.shift()); ) e.push(t);\n return e;\n }\n function f(e, t, n, i, r) {\n var c, u = e ? e.inputmask : this, f = u.maskset, d = u.opts, h = u.dependencyLib, v = i.slice(), m = \"\", g = -1, y = d.skipOptionalPartCharacter;\n d.skipOptionalPartCharacter = \"\", o.resetMaskSet.call(u, !1), u.clicked = 0, g = d.radixPoint ? o.determineNewCaretPosition.call(u, {\n begin: 0,\n end: 0\n }, !1, !1 === d.__financeInput ? \"radixFocus\" : void 0).begin : 0, f.p = g, u.caretPos = {\n begin: g\n };\n var k = [], b = u.caretPos;\n if (v.forEach((function(e, t) {\n if (void 0 !== e) {\n var i = new h.Event(\"_checkval\");\n i.key = e, m += e;\n var r = o.getLastValidPosition.call(u, void 0, !0);\n !function(e, t) {\n for (var n = s.getMaskTemplate.call(u, !0, 0).slice(e, o.seekNext.call(u, e, !1, !1)).join(\"\").replace(/'/g, \"\"), i = n.indexOf(t); i > 0 && \" \" === n[i - 1]; ) i--;\n var a = 0 === i && !o.isMask.call(u, e) && (s.getTest.call(u, e).match.nativeDef === t.charAt(0) || !0 === s.getTest.call(u, e).match.static && s.getTest.call(u, e).match.nativeDef === \"'\" + t.charAt(0) || \" \" === s.getTest.call(u, e).match.nativeDef && (s.getTest.call(u, e + 1).match.nativeDef === t.charAt(0) || !0 === s.getTest.call(u, e + 1).match.static && s.getTest.call(u, e + 1).match.nativeDef === \"'\" + t.charAt(0)));\n if (!a && i > 0 && !o.isMask.call(u, e, !1, !0)) {\n var r = o.seekNext.call(u, e);\n u.caretPos.begin < r && (u.caretPos = {\n begin: r\n });\n }\n return a;\n }(g, m) ? (c = a.EventHandlers.keypressEvent.call(u, i, !0, !1, n, u.caretPos.begin)) && (g = u.caretPos.begin + 1, \n m = \"\") : c = a.EventHandlers.keypressEvent.call(u, i, !0, !1, n, r + 1), c ? (void 0 !== c.pos && f.validPositions[c.pos] && !0 === f.validPositions[c.pos].match.static && void 0 === f.validPositions[c.pos].alternation && (k.push(c.pos), \n u.isRTL || (c.forwardPosition = c.pos + 1)), p.call(u, void 0, o.getBuffer.call(u), c.forwardPosition, i, !1), \n u.caretPos = {\n begin: c.forwardPosition,\n end: c.forwardPosition\n }, b = u.caretPos) : void 0 === f.validPositions[t] && v[t] === s.getPlaceholder.call(u, t) && o.isMask.call(u, t, !0) ? u.caretPos.begin++ : u.caretPos = b;\n }\n })), k.length > 0) {\n var x, w, P = o.seekNext.call(u, -1, void 0, !1);\n if (!l.isComplete.call(u, o.getBuffer.call(u)) && k.length <= P || l.isComplete.call(u, o.getBuffer.call(u)) && k.length > 0 && k.length !== P && 0 === k[0]) for (var S = P; void 0 !== (x = k.shift()); ) if (x < S) {\n var O = new h.Event(\"_checkval\");\n if ((w = f.validPositions[x]).generatedInput = !0, O.key = w.input, (c = a.EventHandlers.keypressEvent.call(u, O, !0, !1, n, S)) && void 0 !== c.pos && c.pos !== x && f.validPositions[c.pos] && !0 === f.validPositions[c.pos].match.static) k.push(c.pos); else if (!c) break;\n S++;\n }\n }\n t && p.call(u, e, o.getBuffer.call(u), c ? c.forwardPosition : u.caretPos.begin, r || new h.Event(\"checkval\"), r && (\"input\" === r.type && u.undoValue !== o.getBuffer.call(u).join(\"\") || \"paste\" === r.type)), \n d.skipOptionalPartCharacter = y;\n }\n function p(e, t, n, i, a) {\n var s = e ? e.inputmask : this, c = s.opts, u = s.dependencyLib;\n if (i && \"function\" == typeof c.onBeforeWrite) {\n var f = c.onBeforeWrite.call(s, i, t, n, c);\n if (f) {\n if (f.refreshFromBuffer) {\n var p = f.refreshFromBuffer;\n l.refreshFromBuffer.call(s, !0 === p ? p : p.start, p.end, f.buffer || t), t = o.getBuffer.call(s, !0);\n }\n void 0 !== n && (n = void 0 !== f.caret ? f.caret : n);\n }\n }\n if (void 0 !== e && (e.inputmask._valueSet(t.join(\"\")), void 0 === n || void 0 !== i && \"blur\" === i.type || o.caret.call(s, e, n, void 0, void 0, void 0 !== i && \"keydown\" === i.type && (i.key === r.keys.Delete || i.key === r.keys.Backspace)), \n void 0 === e.inputmask.writeBufferHook || e.inputmask.writeBufferHook(n), !0 === a)) {\n var d = u(e), h = e.inputmask._valueGet();\n e.inputmask.skipInputEvent = !0, d.trigger(\"input\"), setTimeout((function() {\n h === o.getBufferTemplate.call(s).join(\"\") ? d.trigger(\"cleared\") : !0 === l.isComplete.call(s, t) && d.trigger(\"complete\");\n }), 0);\n }\n }\n },\n 2394: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var i = v(n(3976)), a = v(n(7392)), r = v(n(4963)), o = n(9716), l = v(n(9380)), s = n(7760), c = n(157), u = n(2391), f = n(8711), p = n(7215), d = n(4713);\n function h(e) {\n return h = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, h(e);\n }\n function v(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var m = l.default.document, g = \"_inputmask_opts\";\n function y(e, t, n) {\n if (!(this instanceof y)) return new y(e, t, n);\n this.dependencyLib = r.default, this.el = void 0, this.events = {}, this.maskset = void 0, \n !0 !== n && (\"[object Object]\" === Object.prototype.toString.call(e) ? t = e : (t = t || {}, \n e && (t.alias = e)), this.opts = r.default.extend(!0, {}, this.defaults, t), this.noMasksCache = t && void 0 !== t.definitions, \n this.userOptions = t || {}, k(this.opts.alias, t, this.opts)), this.refreshValue = !1, \n this.undoValue = void 0, this.$el = void 0, this.skipInputEvent = !1, this.validationEvent = !1, \n this.ignorable = !1, this.maxLength, this.mouseEnter = !1, this.clicked = 0, this.originalPlaceholder = void 0, \n this.isComposing = !1, this.hasAlternator = !1;\n }\n function k(e, t, n) {\n var i = y.prototype.aliases[e];\n return i ? (i.alias && k(i.alias, void 0, n), r.default.extend(!0, n, i), r.default.extend(!0, n, t), \n !0) : (null === n.mask && (n.mask = e), !1);\n }\n y.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: i.default,\n definitions: a.default,\n aliases: {},\n masksCache: {},\n i18n: {},\n get isRTL() {\n return this.opts.isRTL || this.opts.numericInput;\n },\n mask: function(e) {\n var t = this;\n return \"string\" == typeof e && (e = m.getElementById(e) || m.querySelectorAll(e)), \n (e = e.nodeName ? [ e ] : Array.isArray(e) ? e : [].slice.call(e)).forEach((function(e, n) {\n var i = r.default.extend(!0, {}, t.opts);\n if (function(e, t, n, i) {\n function a(t, a) {\n var r = \"\" === i ? t : i + \"-\" + t;\n null !== (a = void 0 !== a ? a : e.getAttribute(r)) && (\"string\" == typeof a && (0 === t.indexOf(\"on\") ? a = l.default[a] : \"false\" === a ? a = !1 : \"true\" === a && (a = !0)), \n n[t] = a);\n }\n if (!0 === t.importDataAttributes) {\n var o, s, c, u, f = e.getAttribute(i);\n if (f && \"\" !== f && (f = f.replace(/'/g, '\"'), s = JSON.parse(\"{\" + f + \"}\")), \n s) for (u in c = void 0, s) if (\"alias\" === u.toLowerCase()) {\n c = s[u];\n break;\n }\n for (o in a(\"alias\", c), n.alias && k(n.alias, n, t), t) {\n if (s) for (u in c = void 0, s) if (u.toLowerCase() === o.toLowerCase()) {\n c = s[u];\n break;\n }\n a(o, c);\n }\n }\n r.default.extend(!0, t, n), (\"rtl\" === e.dir || t.rightAlign) && (e.style.textAlign = \"right\");\n (\"rtl\" === e.dir || t.numericInput) && (e.dir = \"ltr\", e.removeAttribute(\"dir\"), \n t.isRTL = !0);\n return Object.keys(n).length;\n }(e, i, r.default.extend(!0, {}, t.userOptions), t.dataAttribute)) {\n var a = (0, u.generateMaskSet)(i, t.noMasksCache);\n void 0 !== a && (void 0 !== e.inputmask && (e.inputmask.opts.autoUnmask = !0, e.inputmask.remove()), \n e.inputmask = new y(void 0, void 0, !0), e.inputmask.opts = i, e.inputmask.noMasksCache = t.noMasksCache, \n e.inputmask.userOptions = r.default.extend(!0, {}, t.userOptions), e.inputmask.el = e, \n e.inputmask.$el = (0, r.default)(e), e.inputmask.maskset = a, r.default.data(e, g, t.userOptions), \n c.mask.call(e.inputmask));\n }\n })), e && e[0] && e[0].inputmask || this;\n },\n option: function(e, t) {\n return \"string\" == typeof e ? this.opts[e] : \"object\" === h(e) ? (r.default.extend(this.userOptions, e), \n this.el && !0 !== t && this.mask(this.el), this) : void 0;\n },\n unmaskedvalue: function(e) {\n if (this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache), \n void 0 === this.el || void 0 !== e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n s.checkVal.call(this, void 0, !1, !1, t), \"function\" == typeof this.opts.onBeforeWrite && this.opts.onBeforeWrite.call(this, void 0, f.getBuffer.call(this), 0, this.opts);\n }\n return s.unmaskedvalue.call(this, this.el);\n },\n remove: function() {\n if (this.el) {\n r.default.data(this.el, g, null);\n var e = this.opts.autoUnmask ? (0, s.unmaskedvalue)(this.el) : this._valueGet(this.opts.autoUnmask);\n e !== f.getBufferTemplate.call(this).join(\"\") ? this._valueSet(e, this.opts.autoUnmask) : this._valueSet(\"\"), \n o.EventRuler.off(this.el), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.el), \"value\") && this.__valueGet && Object.defineProperty(this.el, \"value\", {\n get: this.__valueGet,\n set: this.__valueSet,\n configurable: !0\n }) : m.__lookupGetter__ && this.el.__lookupGetter__(\"value\") && this.__valueGet && (this.el.__defineGetter__(\"value\", this.__valueGet), \n this.el.__defineSetter__(\"value\", this.__valueSet)), this.el.inputmask = void 0;\n }\n return this.el;\n },\n getemptymask: function() {\n return this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache), \n (this.isRTL ? f.getBufferTemplate.call(this).reverse() : f.getBufferTemplate.call(this)).join(\"\");\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n return this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache), \n p.isComplete.call(this, f.getBuffer.call(this));\n },\n getmetadata: function() {\n if (this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache), \n Array.isArray(this.maskset.metadata)) {\n var e = d.getMaskTemplate.call(this, !0, 0, !1).join(\"\");\n return this.maskset.metadata.forEach((function(t) {\n return t.mask !== e || (e = t, !1);\n })), e;\n }\n return this.maskset.metadata;\n },\n isValid: function(e) {\n if (this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache), \n e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n s.checkVal.call(this, void 0, !0, !1, t);\n } else e = this.isRTL ? f.getBuffer.call(this).slice().reverse().join(\"\") : f.getBuffer.call(this).join(\"\");\n for (var n = f.getBuffer.call(this), i = f.determineLastRequiredPosition.call(this), a = n.length - 1; a > i && !f.isMask.call(this, a); a--) ;\n return n.splice(i, a + 1 - i), p.isComplete.call(this, n) && e === (this.isRTL ? f.getBuffer.call(this).slice().reverse().join(\"\") : f.getBuffer.call(this).join(\"\"));\n },\n format: function(e, t) {\n this.maskset = this.maskset || (0, u.generateMaskSet)(this.opts, this.noMasksCache);\n var n = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n s.checkVal.call(this, void 0, !0, !1, n);\n var i = this.isRTL ? f.getBuffer.call(this).slice().reverse().join(\"\") : f.getBuffer.call(this).join(\"\");\n return t ? {\n value: i,\n metadata: this.getmetadata()\n } : i;\n },\n setValue: function(e) {\n this.el && (0, r.default)(this.el).trigger(\"setvalue\", [ e ]);\n },\n analyseMask: u.analyseMask\n }, y.extendDefaults = function(e) {\n r.default.extend(!0, y.prototype.defaults, e);\n }, y.extendDefinitions = function(e) {\n r.default.extend(!0, y.prototype.definitions, e);\n }, y.extendAliases = function(e) {\n r.default.extend(!0, y.prototype.aliases, e);\n }, y.format = function(e, t, n) {\n return y(t).format(e, n);\n }, y.unmask = function(e, t) {\n return y(t).unmaskedvalue(e);\n }, y.isValid = function(e, t) {\n return y(t).isValid(e);\n }, y.remove = function(e) {\n \"string\" == typeof e && (e = m.getElementById(e) || m.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask && e.inputmask.remove();\n }));\n }, y.setValue = function(e, t) {\n \"string\" == typeof e && (e = m.getElementById(e) || m.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask ? e.inputmask.setValue(t) : (0, r.default)(e).trigger(\"setvalue\", [ t ]);\n }));\n }, y.dependencyLib = r.default, l.default.Inputmask = y;\n t.default = y;\n },\n 5296: function(e, t, n) {\n function i(e) {\n return i = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, i(e);\n }\n var a = d(n(9380)), r = d(n(2394));\n function o(e, t) {\n for (var n = 0; n < t.length; n++) {\n var a = t[n];\n a.enumerable = a.enumerable || !1, a.configurable = !0, \"value\" in a && (a.writable = !0), \n Object.defineProperty(e, (r = a.key, o = void 0, o = function(e, t) {\n if (\"object\" !== i(e) || null === e) return e;\n var n = e[Symbol.toPrimitive];\n if (void 0 !== n) {\n var a = n.call(e, t || \"default\");\n if (\"object\" !== i(a)) return a;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(r, \"string\"), \"symbol\" === i(o) ? o : String(o)), a);\n }\n var r, o;\n }\n function l(e) {\n var t = u();\n return function() {\n var n, a = p(e);\n if (t) {\n var r = p(this).constructor;\n n = Reflect.construct(a, arguments, r);\n } else n = a.apply(this, arguments);\n return function(e, t) {\n if (t && (\"object\" === i(t) || \"function\" == typeof t)) return t;\n if (void 0 !== t) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return function(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n }(e);\n }(this, n);\n };\n }\n function s(e) {\n var t = \"function\" == typeof Map ? new Map : void 0;\n return s = function(e) {\n if (null === e || !function(e) {\n try {\n return -1 !== Function.toString.call(e).indexOf(\"[native code]\");\n } catch (t) {\n return \"function\" == typeof e;\n }\n }(e)) return e;\n if (\"function\" != typeof e) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== t) {\n if (t.has(e)) return t.get(e);\n t.set(e, n);\n }\n function n() {\n return c(e, arguments, p(this).constructor);\n }\n return n.prototype = Object.create(e.prototype, {\n constructor: {\n value: n,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), f(n, e);\n }, s(e);\n }\n function c(e, t, n) {\n return c = u() ? Reflect.construct.bind() : function(e, t, n) {\n var i = [ null ];\n i.push.apply(i, t);\n var a = new (Function.bind.apply(e, i));\n return n && f(a, n.prototype), a;\n }, c.apply(null, arguments);\n }\n function u() {\n if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n if (Reflect.construct.sham) return !1;\n if (\"function\" == typeof Proxy) return !0;\n try {\n return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), \n !0;\n } catch (e) {\n return !1;\n }\n }\n function f(e, t) {\n return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {\n return e.__proto__ = t, e;\n }, f(e, t);\n }\n function p(e) {\n return p = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {\n return e.__proto__ || Object.getPrototypeOf(e);\n }, p(e);\n }\n function d(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var h = a.default.document;\n if (h && h.head && h.head.attachShadow && a.default.customElements && void 0 === a.default.customElements.get(\"input-mask\")) {\n var v = function(e) {\n !function(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function\");\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), t && f(e, t);\n }(s, e);\n var t, n, i, a = l(s);\n function s() {\n var e;\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, s);\n var t = (e = a.call(this)).getAttributeNames(), n = e.attachShadow({\n mode: \"closed\"\n });\n for (var i in e.input = h.createElement(\"input\"), e.input.type = \"text\", n.appendChild(e.input), \n t) Object.prototype.hasOwnProperty.call(t, i) && e.input.setAttribute(t[i], e.getAttribute(t[i]));\n var o = new r.default;\n return o.dataAttribute = \"\", o.mask(e.input), e.input.inputmask.shadowRoot = n, \n e;\n }\n return t = s, (n = [ {\n key: \"attributeChangedCallback\",\n value: function(e, t, n) {\n this.input.setAttribute(e, n);\n }\n }, {\n key: \"value\",\n get: function() {\n return this.input.value;\n },\n set: function(e) {\n this.input.value = e;\n }\n } ]) && o(t.prototype, n), i && o(t, i), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), s;\n }(s(HTMLElement));\n a.default.customElements.define(\"input-mask\", v);\n }\n },\n 2839: function(e, t) {\n function n(e) {\n return n = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, n(e);\n }\n function i(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var n = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != n) {\n var i, a, r, o, l = [], s = !0, c = !1;\n try {\n if (r = (n = n.call(e)).next, 0 === t) {\n if (Object(n) !== n) return;\n s = !1;\n } else for (;!(s = (i = r.call(n)).done) && (l.push(i.value), l.length !== t); s = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!s && null != n.return && (o = n.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return l;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return a(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return a(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function a(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n function r(e, t) {\n var n = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var i = Object.getOwnPropertySymbols(e);\n t && (i = i.filter((function(t) {\n return Object.getOwnPropertyDescriptor(e, t).enumerable;\n }))), n.push.apply(n, i);\n }\n return n;\n }\n function o(e, t, i) {\n return (t = function(e) {\n var t = function(e, t) {\n if (\"object\" !== n(e) || null === e) return e;\n var i = e[Symbol.toPrimitive];\n if (void 0 !== i) {\n var a = i.call(e, t || \"default\");\n if (\"object\" !== n(a)) return a;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(e, \"string\");\n return \"symbol\" === n(t) ? t : String(t);\n }(t)) in e ? Object.defineProperty(e, t, {\n value: i,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[t] = i, e;\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.keys = t.keyCode = void 0, t.toKey = function(e, t) {\n return s[e] || (t ? String.fromCharCode(e) : String.fromCharCode(e).toLowerCase());\n }, t.toKeyCode = function(e) {\n return l[e];\n };\n var l = t.keyCode = function(e) {\n for (var t = 1; t < arguments.length; t++) {\n var n = null != arguments[t] ? arguments[t] : {};\n t % 2 ? r(Object(n), !0).forEach((function(t) {\n o(e, t, n[t]);\n })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach((function(t) {\n Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));\n }));\n }\n return e;\n }({\n c: 67,\n x: 88,\n z: 90,\n BACKSPACE_SAFARI: 127,\n Enter: 13,\n Meta_LEFT: 91,\n Meta_RIGHT: 92,\n Space: 32\n }, {\n Alt: 18,\n AltGraph: 18,\n ArrowDown: 40,\n ArrowLeft: 37,\n ArrowRight: 39,\n ArrowUp: 38,\n Backspace: 8,\n CapsLock: 20,\n Control: 17,\n ContextMenu: 93,\n Dead: 221,\n Delete: 46,\n End: 35,\n Escape: 27,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123,\n Home: 36,\n Insert: 45,\n NumLock: 144,\n PageDown: 34,\n PageUp: 33,\n Pause: 19,\n PrintScreen: 44,\n Process: 229,\n Shift: 16,\n ScrollLock: 145,\n Tab: 9,\n Unidentified: 229\n }), s = Object.entries(l).reduce((function(e, t) {\n var n = i(t, 2), a = n[0], r = n[1];\n return e[r] = void 0 === e[r] ? a : e[r], e;\n }), {});\n t.keys = Object.entries(l).reduce((function(e, t) {\n var n = i(t, 2), a = n[0];\n n[1];\n return e[a] = \"Space\" === a ? \" \" : a, e;\n }), {});\n },\n 2391: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.analyseMask = function(e, t, n) {\n var i, a, s, c, u, f, p = /(?:[?*+]|\\{[0-9+*]+(?:,[0-9+*]*)?(?:\\|[0-9+*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, d = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, h = !1, v = new o.default, m = [], g = [], y = !1;\n function k(e, i, a) {\n a = void 0 !== a ? a : e.matches.length;\n var o = e.matches[a - 1];\n if (t) {\n if (0 === i.indexOf(\"[\") || h && /\\\\d|\\\\s|\\\\w|\\\\p/i.test(i) || \".\" === i) {\n var s = n.casing ? \"i\" : \"\";\n /\\\\p\\{.*}/i.test(i) && (s += \"u\"), e.matches.splice(a++, 0, {\n fn: new RegExp(i, s),\n static: !1,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== i,\n casing: null,\n def: i,\n placeholder: \"object\" === l(n.placeholder) ? n.placeholder[v.matches.length] : void 0,\n nativeDef: i\n });\n } else h && (i = i[i.length - 1]), i.split(\"\").forEach((function(t, i) {\n o = e.matches[a - 1], e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(n.staticDefinitionSymbol || t) ? new RegExp(\"[\" + (n.staticDefinitionSymbol || t) + \"]\", n.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== t && !0 !== o.static,\n casing: null,\n def: n.staticDefinitionSymbol || t,\n placeholder: void 0 !== n.staticDefinitionSymbol ? t : \"object\" === l(n.placeholder) ? n.placeholder[v.matches.length] : void 0,\n nativeDef: (h ? \"'\" : \"\") + t\n });\n }));\n h = !1;\n } else {\n var c = n.definitions && n.definitions[i] || n.usePrototypeDefinitions && r.default.prototype.definitions[i];\n c && !h ? e.matches.splice(a++, 0, {\n fn: c.validator ? \"string\" == typeof c.validator ? new RegExp(c.validator, n.casing ? \"i\" : \"\") : new function() {\n this.test = c.validator;\n } : /./,\n static: c.static || !1,\n optionality: c.optional || !1,\n defOptionality: c.optional || !1,\n newBlockMarker: void 0 === o || c.optional ? \"master\" : o.def !== (c.definitionSymbol || i),\n casing: c.casing,\n def: c.definitionSymbol || i,\n placeholder: c.placeholder,\n nativeDef: i,\n generated: c.generated\n }) : (e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(n.staticDefinitionSymbol || i) ? new RegExp(\"[\" + (n.staticDefinitionSymbol || i) + \"]\", n.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== i && !0 !== o.static,\n casing: null,\n def: n.staticDefinitionSymbol || i,\n placeholder: void 0 !== n.staticDefinitionSymbol ? i : void 0,\n nativeDef: (h ? \"'\" : \"\") + i\n }), h = !1);\n }\n }\n function b() {\n if (m.length > 0) {\n if (k(c = m[m.length - 1], a), c.isAlternator) {\n u = m.pop();\n for (var e = 0; e < u.matches.length; e++) u.matches[e].isGroup && (u.matches[e].isGroup = !1);\n m.length > 0 ? (c = m[m.length - 1]).matches.push(u) : v.matches.push(u);\n }\n } else k(v, a);\n }\n function x(e) {\n var t = new o.default(!0);\n return t.openGroup = !1, t.matches = e, t;\n }\n function w() {\n if ((s = m.pop()).openGroup = !1, void 0 !== s) if (m.length > 0) {\n if ((c = m[m.length - 1]).matches.push(s), c.isAlternator) {\n u = m.pop();\n for (var e = 0; e < u.matches.length; e++) u.matches[e].isGroup = !1, u.matches[e].alternatorGroup = !1;\n m.length > 0 ? (c = m[m.length - 1]).matches.push(u) : v.matches.push(u);\n }\n } else v.matches.push(s); else b();\n }\n function P(e) {\n var t = e.pop();\n return t.isQuantifier && (t = x([ e.pop(), t ])), t;\n }\n t && (n.optionalmarker[0] = void 0, n.optionalmarker[1] = void 0);\n for (;i = t ? d.exec(e) : p.exec(e); ) {\n if (a = i[0], t) {\n switch (a.charAt(0)) {\n case \"?\":\n a = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n a = \"{\" + a + \"}\";\n break;\n\n case \"|\":\n if (0 === m.length) {\n var S = x(v.matches);\n S.openGroup = !0, m.push(S), v.matches = [], y = !0;\n }\n }\n switch (a) {\n case \"\\\\d\":\n a = \"[0-9]\";\n break;\n\n case \"\\\\p\":\n a += d.exec(e)[0], a += d.exec(e)[0];\n }\n }\n if (h) b(); else switch (a.charAt(0)) {\n case \"$\":\n case \"^\":\n t || b();\n break;\n\n case n.escapeChar:\n h = !0, t && b();\n break;\n\n case n.optionalmarker[1]:\n case n.groupmarker[1]:\n w();\n break;\n\n case n.optionalmarker[0]:\n m.push(new o.default(!1, !0));\n break;\n\n case n.groupmarker[0]:\n m.push(new o.default(!0));\n break;\n\n case n.quantifiermarker[0]:\n var O = new o.default(!1, !1, !0), _ = (a = a.replace(/[{}?]/g, \"\")).split(\"|\"), M = _[0].split(\",\"), E = isNaN(M[0]) ? M[0] : parseInt(M[0]), j = 1 === M.length ? E : isNaN(M[1]) ? M[1] : parseInt(M[1]), T = isNaN(_[1]) ? _[1] : parseInt(_[1]);\n \"*\" !== E && \"+\" !== E || (E = \"*\" === j ? 0 : 1), O.quantifier = {\n min: E,\n max: j,\n jit: T\n };\n var A = m.length > 0 ? m[m.length - 1].matches : v.matches;\n (i = A.pop()).isGroup || (i = x([ i ])), A.push(i), A.push(O);\n break;\n\n case n.alternatormarker:\n if (m.length > 0) {\n var D = (c = m[m.length - 1]).matches[c.matches.length - 1];\n f = c.openGroup && (void 0 === D.matches || !1 === D.isGroup && !1 === D.isAlternator) ? m.pop() : P(c.matches);\n } else f = P(v.matches);\n if (f.isAlternator) m.push(f); else if (f.alternatorGroup ? (u = m.pop(), f.alternatorGroup = !1) : u = new o.default(!1, !1, !1, !0), \n u.matches.push(f), m.push(u), f.openGroup) {\n f.openGroup = !1;\n var L = new o.default(!0);\n L.alternatorGroup = !0, m.push(L);\n }\n break;\n\n default:\n b();\n }\n }\n y && w();\n for (;m.length > 0; ) s = m.pop(), v.matches.push(s);\n v.matches.length > 0 && (!function e(i) {\n i && i.matches && i.matches.forEach((function(a, r) {\n var o = i.matches[r + 1];\n (void 0 === o || void 0 === o.matches || !1 === o.isQuantifier) && a && a.isGroup && (a.isGroup = !1, \n t || (k(a, n.groupmarker[0], 0), !0 !== a.openGroup && k(a, n.groupmarker[1]))), \n e(a);\n }));\n }(v), g.push(v));\n (n.numericInput || n.isRTL) && function e(t) {\n for (var i in t.matches = t.matches.reverse(), t.matches) if (Object.prototype.hasOwnProperty.call(t.matches, i)) {\n var a = parseInt(i);\n if (t.matches[i].isQuantifier && t.matches[a + 1] && t.matches[a + 1].isGroup) {\n var r = t.matches[i];\n t.matches.splice(i, 1), t.matches.splice(a + 1, 0, r);\n }\n void 0 !== t.matches[i].matches ? t.matches[i] = e(t.matches[i]) : t.matches[i] = ((o = t.matches[i]) === n.optionalmarker[0] ? o = n.optionalmarker[1] : o === n.optionalmarker[1] ? o = n.optionalmarker[0] : o === n.groupmarker[0] ? o = n.groupmarker[1] : o === n.groupmarker[1] && (o = n.groupmarker[0]), \n o);\n }\n var o;\n return t;\n }(g[0]);\n return g;\n }, t.generateMaskSet = function(e, t) {\n var n;\n function o(e, t) {\n var n = t.repeat, i = t.groupmarker, r = t.quantifiermarker, o = t.keepStatic;\n if (n > 0 || \"*\" === n || \"+\" === n) {\n var l = \"*\" === n ? 0 : \"+\" === n ? 1 : n;\n if (l != n) e = i[0] + e + i[1] + r[0] + l + \",\" + n + r[1]; else for (var c = e, u = 1; u < l; u++) e += c;\n }\n if (!0 === o) {\n var f = e.match(new RegExp(\"(.)\\\\[([^\\\\]]*)\\\\]\", \"g\"));\n f && f.forEach((function(t, n) {\n var i = function(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var n = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != n) {\n var i, a, r, o, l = [], s = !0, c = !1;\n try {\n if (r = (n = n.call(e)).next, 0 === t) {\n if (Object(n) !== n) return;\n s = !1;\n } else for (;!(s = (i = r.call(n)).done) && (l.push(i.value), l.length !== t); s = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!s && null != n.return && (o = n.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return l;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return s(e, t);\n var n = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === n && e.constructor && (n = e.constructor.name);\n if (\"Map\" === n || \"Set\" === n) return Array.from(e);\n if (\"Arguments\" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return s(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }(t.split(\"[\"), 2), r = i[0], o = i[1];\n o = o.replace(\"]\", \"\"), e = e.replace(new RegExp(\"\".concat((0, a.default)(r), \"\\\\[\").concat((0, \n a.default)(o), \"\\\\]\")), r.charAt(0) === o.charAt(0) ? \"(\".concat(r, \"|\").concat(r).concat(o, \")\") : \"\".concat(r, \"[\").concat(o, \"]\"));\n }));\n }\n return e;\n }\n function c(e, n, a) {\n var s, c, u = !1;\n return null !== e && \"\" !== e || ((u = null !== a.regex) ? e = (e = a.regex).replace(/^(\\^)(.*)(\\$)$/, \"$2\") : (u = !0, \n e = \".*\")), 1 === e.length && !1 === a.greedy && 0 !== a.repeat && (a.placeholder = \"\"), \n e = o(e, a), c = u ? \"regex_\" + a.regex : a.numericInput ? e.split(\"\").reverse().join(\"\") : e, \n null !== a.keepStatic && (c = \"ks_\" + a.keepStatic + c), \"object\" === l(a.placeholder) && (c = \"ph_\" + JSON.stringify(a.placeholder) + c), \n void 0 === r.default.prototype.masksCache[c] || !0 === t ? (s = {\n mask: e,\n maskToken: r.default.prototype.analyseMask(e, u, a),\n validPositions: [],\n _buffer: void 0,\n buffer: void 0,\n tests: {},\n excludes: {},\n metadata: n,\n maskLength: void 0,\n jitOffset: {}\n }, !0 !== t && (r.default.prototype.masksCache[c] = s, s = i.default.extend(!0, {}, r.default.prototype.masksCache[c]))) : s = i.default.extend(!0, {}, r.default.prototype.masksCache[c]), \n s;\n }\n \"function\" == typeof e.mask && (e.mask = e.mask(e));\n if (Array.isArray(e.mask)) {\n if (e.mask.length > 1) {\n null === e.keepStatic && (e.keepStatic = !0);\n var u = e.groupmarker[0];\n return (e.isRTL ? e.mask.reverse() : e.mask).forEach((function(t) {\n u.length > 1 && (u += e.alternatormarker), void 0 !== t.mask && \"function\" != typeof t.mask ? u += t.mask : u += t;\n })), c(u += e.groupmarker[1], e.mask, e);\n }\n e.mask = e.mask.pop();\n }\n n = e.mask && void 0 !== e.mask.mask && \"function\" != typeof e.mask.mask ? c(e.mask.mask, e.mask, e) : c(e.mask, e.mask, e);\n null === e.keepStatic && (e.keepStatic = !1);\n return n;\n };\n var i = c(n(4963)), a = c(n(7184)), r = c(n(2394)), o = c(n(9695));\n function l(e) {\n return l = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, l(e);\n }\n function s(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];\n return i;\n }\n function c(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n },\n 157: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mask = function() {\n var e = this, t = this.opts, n = this.el, c = this.dependencyLib;\n r.EventRuler.off(n);\n var u = function(t, n) {\n var i = t.getAttribute(\"type\"), a = \"input\" === t.tagName.toLowerCase() && n.supportsInputType.includes(i) || t.isContentEditable || \"textarea\" === t.tagName.toLowerCase();\n if (!a) if (\"input\" === t.tagName.toLowerCase()) {\n var s = document.createElement(\"input\");\n s.setAttribute(\"type\", i), a = \"text\" === s.type, s = null;\n } else a = \"partial\";\n return !1 !== a ? function(t) {\n var i, a;\n function s() {\n return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== l.getLastValidPosition.call(e) || !0 !== n.nullable ? (this.inputmask.shadowRoot || this.ownerDocument).activeElement === this && n.clearMaskOnLostFocus ? (e.isRTL ? o.clearOptionalTail.call(e, l.getBuffer.call(e).slice()).reverse() : o.clearOptionalTail.call(e, l.getBuffer.call(e).slice())).join(\"\") : i.call(this) : \"\" : i.call(this);\n }\n function u(e) {\n a.call(this, e), this.inputmask && (0, o.applyInputValue)(this, e);\n }\n if (!t.inputmask.__valueGet) {\n if (!0 !== n.noValuePatching) {\n if (Object.getOwnPropertyDescriptor) {\n var f = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), \"value\") : void 0;\n f && f.get && f.set ? (i = f.get, a = f.set, Object.defineProperty(t, \"value\", {\n get: s,\n set: u,\n configurable: !0\n })) : \"input\" !== t.tagName.toLowerCase() && (i = function() {\n return this.textContent;\n }, a = function(e) {\n this.textContent = e;\n }, Object.defineProperty(t, \"value\", {\n get: s,\n set: u,\n configurable: !0\n }));\n } else document.__lookupGetter__ && t.__lookupGetter__(\"value\") && (i = t.__lookupGetter__(\"value\"), \n a = t.__lookupSetter__(\"value\"), t.__defineGetter__(\"value\", s), t.__defineSetter__(\"value\", u));\n t.inputmask.__valueGet = i, t.inputmask.__valueSet = a;\n }\n t.inputmask._valueGet = function(t) {\n return e.isRTL && !0 !== t ? i.call(this.el).split(\"\").reverse().join(\"\") : i.call(this.el);\n }, t.inputmask._valueSet = function(t, n) {\n a.call(this.el, null == t ? \"\" : !0 !== n && e.isRTL ? t.split(\"\").reverse().join(\"\") : t);\n }, void 0 === i && (i = function() {\n return this.value;\n }, a = function(e) {\n this.value = e;\n }, function(t) {\n if (c.valHooks && (void 0 === c.valHooks[t] || !0 !== c.valHooks[t].inputmaskpatch)) {\n var i = c.valHooks[t] && c.valHooks[t].get ? c.valHooks[t].get : function(e) {\n return e.value;\n }, a = c.valHooks[t] && c.valHooks[t].set ? c.valHooks[t].set : function(e, t) {\n return e.value = t, e;\n };\n c.valHooks[t] = {\n get: function(t) {\n if (t.inputmask) {\n if (t.inputmask.opts.autoUnmask) return t.inputmask.unmaskedvalue();\n var a = i(t);\n return -1 !== l.getLastValidPosition.call(e, void 0, void 0, t.inputmask.maskset.validPositions) || !0 !== n.nullable ? a : \"\";\n }\n return i(t);\n },\n set: function(e, t) {\n var n = a(e, t);\n return e.inputmask && (0, o.applyInputValue)(e, t), n;\n },\n inputmaskpatch: !0\n };\n }\n }(t.type), function(e) {\n r.EventRuler.on(e, \"mouseenter\", (function() {\n var e = this, t = e.inputmask._valueGet(!0);\n t != (e.inputmask.isRTL ? l.getBuffer.call(e.inputmask).slice().reverse() : l.getBuffer.call(e.inputmask)).join(\"\") && (0, \n o.applyInputValue)(e, t);\n }));\n }(t));\n }\n }(t) : t.inputmask = void 0, a;\n }(n, t);\n if (!1 !== u) {\n e.originalPlaceholder = n.placeholder, e.maxLength = void 0 !== n ? n.maxLength : void 0, \n -1 === e.maxLength && (e.maxLength = void 0), \"inputMode\" in n && null === n.getAttribute(\"inputmode\") && (n.inputMode = t.inputmode, \n n.setAttribute(\"inputmode\", t.inputmode)), !0 === u && (t.showMaskOnFocus = t.showMaskOnFocus && -1 === [ \"cc-number\", \"cc-exp\" ].indexOf(n.autocomplete), \n i.iphone && (t.insertModeVisual = !1, n.setAttribute(\"autocorrect\", \"off\")), r.EventRuler.on(n, \"submit\", a.EventHandlers.submitEvent), \n r.EventRuler.on(n, \"reset\", a.EventHandlers.resetEvent), r.EventRuler.on(n, \"blur\", a.EventHandlers.blurEvent), \n r.EventRuler.on(n, \"focus\", a.EventHandlers.focusEvent), r.EventRuler.on(n, \"invalid\", a.EventHandlers.invalidEvent), \n r.EventRuler.on(n, \"click\", a.EventHandlers.clickEvent), r.EventRuler.on(n, \"mouseleave\", a.EventHandlers.mouseleaveEvent), \n r.EventRuler.on(n, \"mouseenter\", a.EventHandlers.mouseenterEvent), r.EventRuler.on(n, \"paste\", a.EventHandlers.pasteEvent), \n r.EventRuler.on(n, \"cut\", a.EventHandlers.cutEvent), r.EventRuler.on(n, \"complete\", t.oncomplete), \n r.EventRuler.on(n, \"incomplete\", t.onincomplete), r.EventRuler.on(n, \"cleared\", t.oncleared), \n !0 !== t.inputEventOnly && r.EventRuler.on(n, \"keydown\", a.EventHandlers.keyEvent), \n (i.mobile || t.inputEventOnly) && n.removeAttribute(\"maxLength\"), r.EventRuler.on(n, \"input\", a.EventHandlers.inputFallBackEvent)), \n r.EventRuler.on(n, \"setvalue\", a.EventHandlers.setValueEvent), void 0 === e.applyMaskHook || e.applyMaskHook(), \n l.getBufferTemplate.call(e).join(\"\"), e.undoValue = e._valueGet(!0);\n var f = (n.inputmask.shadowRoot || n.ownerDocument).activeElement;\n if (\"\" !== n.inputmask._valueGet(!0) || !1 === t.clearMaskOnLostFocus || f === n) {\n (0, o.applyInputValue)(n, n.inputmask._valueGet(!0), t);\n var p = l.getBuffer.call(e).slice();\n !1 === s.isComplete.call(e, p) && t.clearIncomplete && l.resetMaskSet.call(e, !1), \n t.clearMaskOnLostFocus && f !== n && (-1 === l.getLastValidPosition.call(e) ? p = [] : o.clearOptionalTail.call(e, p)), \n (!1 === t.clearMaskOnLostFocus || t.showMaskOnFocus && f === n || \"\" !== n.inputmask._valueGet(!0)) && (0, \n o.writeBuffer)(n, p), f === n && l.caret.call(e, n, l.seekNext.call(e, l.getLastValidPosition.call(e)));\n }\n }\n };\n var i = n(9845), a = n(6030), r = n(9716), o = n(7760), l = n(8711), s = n(7215);\n },\n 9695: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, n, i) {\n this.matches = [], this.openGroup = e || !1, this.alternatorGroup = !1, this.isGroup = e || !1, \n this.isOptional = t || !1, this.isQuantifier = n || !1, this.isAlternator = i || !1, \n this.quantifier = {\n min: 1,\n max: 1\n };\n };\n },\n 3194: function() {\n Array.prototype.includes || Object.defineProperty(Array.prototype, \"includes\", {\n value: function(e, t) {\n if (null == this) throw new TypeError('\"this\" is null or not defined');\n var n = Object(this), i = n.length >>> 0;\n if (0 === i) return !1;\n for (var a = 0 | t, r = Math.max(a >= 0 ? a : i - Math.abs(a), 0); r < i; ) {\n if (n[r] === e) return !0;\n r++;\n }\n return !1;\n }\n });\n },\n 9302: function() {\n var e = Function.bind.call(Function.call, Array.prototype.reduce), t = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable), n = Function.bind.call(Function.call, Array.prototype.concat), i = Object.keys;\n Object.entries || (Object.entries = function(a) {\n return e(i(a), (function(e, i) {\n return n(e, \"string\" == typeof i && t(a, i) ? [ [ i, a[i] ] ] : []);\n }), []);\n });\n },\n 7149: function() {\n function e(t) {\n return e = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, e(t);\n }\n \"function\" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = \"object\" === e(\"test\".__proto__) ? function(e) {\n return e.__proto__;\n } : function(e) {\n return e.constructor.prototype;\n });\n },\n 4013: function() {\n String.prototype.includes || (String.prototype.includes = function(e, t) {\n return \"number\" != typeof t && (t = 0), !(t + e.length > this.length) && -1 !== this.indexOf(e, t);\n });\n },\n 8711: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.caret = function(e, t, n, i, r) {\n var o, l = this, s = this.opts;\n if (void 0 === t) return \"selectionStart\" in e && \"selectionEnd\" in e ? (t = e.selectionStart, \n n = e.selectionEnd) : a.default.getSelection ? (o = a.default.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode !== e && o.commonAncestorContainer !== e || (t = o.startOffset, \n n = o.endOffset) : document.selection && document.selection.createRange && (n = (t = 0 - (o = document.selection.createRange()).duplicate().moveStart(\"character\", -e.inputmask._valueGet().length)) + o.text.length), \n {\n begin: i ? t : f.call(l, t),\n end: i ? n : f.call(l, n)\n };\n if (Array.isArray(t) && (n = l.isRTL ? t[0] : t[1], t = l.isRTL ? t[1] : t[0]), \n void 0 !== t.begin && (n = l.isRTL ? t.begin : t.end, t = l.isRTL ? t.end : t.begin), \n \"number\" == typeof t) {\n t = i ? t : f.call(l, t), n = \"number\" == typeof (n = i ? n : f.call(l, n)) ? n : t;\n var c = parseInt(((e.ownerDocument.defaultView || a.default).getComputedStyle ? (e.ownerDocument.defaultView || a.default).getComputedStyle(e, null) : e.currentStyle).fontSize) * n;\n if (e.scrollLeft = c > e.scrollWidth ? c : 0, e.inputmask.caretPos = {\n begin: t,\n end: n\n }, s.insertModeVisual && !1 === s.insertMode && t === n && (r || n++), e === (e.inputmask.shadowRoot || e.ownerDocument).activeElement) {\n if (\"setSelectionRange\" in e) e.setSelectionRange(t, n); else if (a.default.getSelection) {\n if (o = document.createRange(), void 0 === e.firstChild || null === e.firstChild) {\n var u = document.createTextNode(\"\");\n e.appendChild(u);\n }\n o.setStart(e.firstChild, t < e.inputmask._valueGet().length ? t : e.inputmask._valueGet().length), \n o.setEnd(e.firstChild, n < e.inputmask._valueGet().length ? n : e.inputmask._valueGet().length), \n o.collapse(!0);\n var p = a.default.getSelection();\n p.removeAllRanges(), p.addRange(o);\n } else e.createTextRange && ((o = e.createTextRange()).collapse(!0), o.moveEnd(\"character\", n), \n o.moveStart(\"character\", t), o.select());\n void 0 === e.inputmask.caretHook || e.inputmask.caretHook.call(l, {\n begin: t,\n end: n\n });\n }\n }\n }, t.determineLastRequiredPosition = function(e) {\n var t, n, i = this, a = i.maskset, l = i.dependencyLib, c = s.call(i), u = {}, f = a.validPositions[c], p = o.getMaskTemplate.call(i, !0, s.call(i), !0, !0), d = p.length, h = void 0 !== f ? f.locator.slice() : void 0;\n for (t = c + 1; t < p.length; t++) h = (n = o.getTestTemplate.call(i, t, h, t - 1)).locator.slice(), \n u[t] = l.extend(!0, {}, n);\n var v = f && void 0 !== f.alternation ? f.locator[f.alternation] : void 0;\n for (t = d - 1; t > c && (((n = u[t]).match.optionality || n.match.optionalQuantifier && n.match.newBlockMarker || v && (v !== u[t].locator[f.alternation] && !0 !== n.match.static || !0 === n.match.static && n.locator[f.alternation] && r.checkAlternationMatch.call(i, n.locator[f.alternation].toString().split(\",\"), v.toString().split(\",\")) && \"\" !== o.getTests.call(i, t)[0].def)) && p[t] === o.getPlaceholder.call(i, t, n.match)); t--) d--;\n return e ? {\n l: d,\n def: u[d] ? u[d].match : void 0\n } : d;\n }, t.determineNewCaretPosition = function(e, t, n) {\n var i, a, r, f = this, p = f.maskset, d = f.opts;\n t && (f.isRTL ? e.end = e.begin : e.begin = e.end);\n if (e.begin === e.end) {\n switch (n = n || d.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n e = {\n begin: 0,\n end: l.call(f).length\n };\n break;\n\n case \"ignore\":\n e.end = e.begin = u.call(f, s.call(f));\n break;\n\n case \"radixFocus\":\n if (f.clicked > 1 && 0 === p.validPositions.length) break;\n if (function(e) {\n if (\"\" !== d.radixPoint && 0 !== d.digits) {\n var t = p.validPositions;\n if (void 0 === t[e] || void 0 === t[e].input) {\n if (e < u.call(f, -1)) return !0;\n var n = l.call(f).indexOf(d.radixPoint);\n if (-1 !== n) {\n for (var i = 0, a = t.length; i < a; i++) if (t[i] && n < i && t[i].input !== o.getPlaceholder.call(f, i)) return !1;\n return !0;\n }\n }\n }\n return !1;\n }(e.begin)) {\n var h = l.call(f).join(\"\").indexOf(d.radixPoint);\n e.end = e.begin = d.numericInput ? u.call(f, h) : h;\n break;\n }\n\n default:\n if (i = e.begin, a = s.call(f, i, !0), i <= (r = u.call(f, -1 !== a || c.call(f, 0) ? a : -1))) e.end = e.begin = c.call(f, i, !1, !0) ? i : u.call(f, i); else {\n var v = p.validPositions[a], m = o.getTestTemplate.call(f, r, v ? v.match.locator : void 0, v), g = o.getPlaceholder.call(f, r, m.match);\n if (\"\" !== g && l.call(f)[r] !== g && !0 !== m.match.optionalQuantifier && !0 !== m.match.newBlockMarker || !c.call(f, r, d.keepStatic, !0) && m.match.def === g) {\n var y = u.call(f, r);\n (i >= y || i === r) && (r = y);\n }\n e.end = e.begin = r;\n }\n }\n return e;\n }\n }, t.getBuffer = l, t.getBufferTemplate = function() {\n var e = this.maskset;\n void 0 === e._buffer && (e._buffer = o.getMaskTemplate.call(this, !1, 1), void 0 === e.buffer && (e.buffer = e._buffer.slice()));\n return e._buffer;\n }, t.getLastValidPosition = s, t.isMask = c, t.resetMaskSet = function(e) {\n var t = this.maskset;\n t.buffer = void 0, !0 !== e && (t.validPositions = [], t.p = 0);\n !1 === e && (t.tests = {}, t.jitOffset = {});\n }, t.seekNext = u, t.seekPrevious = function(e, t) {\n var n = this, i = e - 1;\n if (e <= 0) return 0;\n for (;i > 0 && (!0 === t && (!0 !== o.getTest.call(n, i).match.newBlockMarker || !c.call(n, i, void 0, !0)) || !0 !== t && !c.call(n, i, void 0, !0)); ) i--;\n return i;\n }, t.translatePosition = f;\n var i, a = (i = n(9380)) && i.__esModule ? i : {\n default: i\n }, r = n(7215), o = n(4713);\n function l(e) {\n var t = this, n = t.maskset;\n return void 0 !== n.buffer && !0 !== e || (n.buffer = o.getMaskTemplate.call(t, !0, s.call(t), !0), \n void 0 === n._buffer && (n._buffer = n.buffer.slice())), n.buffer;\n }\n function s(e, t, n) {\n var i = this.maskset, a = -1, r = -1, o = n || i.validPositions;\n void 0 === e && (e = -1);\n for (var l = 0, s = o.length; l < s; l++) o[l] && (t || !0 !== o[l].generatedInput) && (l <= e && (a = l), \n l >= e && (r = l));\n return -1 === a || a === e ? r : -1 === r || e - a < r - e ? a : r;\n }\n function c(e, t, n) {\n var i = this, a = this.maskset, r = o.getTestTemplate.call(i, e).match;\n if (\"\" === r.def && (r = o.getTest.call(i, e).match), !0 !== r.static) return r.fn;\n if (!0 === n && void 0 !== a.validPositions[e] && !0 !== a.validPositions[e].generatedInput) return !0;\n if (!0 !== t && e > -1) {\n if (n) {\n var l = o.getTests.call(i, e);\n return l.length > 1 + (\"\" === l[l.length - 1].match.def ? 1 : 0);\n }\n var s = o.determineTestTemplate.call(i, e, o.getTests.call(i, e)), c = o.getPlaceholder.call(i, e, s.match);\n return s.match.def !== c;\n }\n return !1;\n }\n function u(e, t, n) {\n var i = this;\n void 0 === n && (n = !0);\n for (var a = e + 1; \"\" !== o.getTest.call(i, a).match.def && (!0 === t && (!0 !== o.getTest.call(i, a).match.newBlockMarker || !c.call(i, a, void 0, !0)) || !0 !== t && !c.call(i, a, void 0, n)); ) a++;\n return a;\n }\n function f(e) {\n var t = this.opts, n = this.el;\n return !this.isRTL || \"number\" != typeof e || t.greedy && \"\" === t.placeholder || !n || (e = this._valueGet().length - e) < 0 && (e = 0), \n e;\n }\n },\n 4713: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.determineTestTemplate = f, t.getDecisionTaker = s, t.getMaskTemplate = function(e, t, n, i, a) {\n var r = this, o = this.opts, l = this.maskset, s = o.greedy;\n a && o.greedy && (o.greedy = !1, r.maskset.tests = {});\n t = t || 0;\n var p, d, v, m, g = [], y = 0;\n do {\n if (!0 === e && l.validPositions[y]) d = (v = a && l.validPositions[y].match.optionality && void 0 === l.validPositions[y + 1] && (!0 === l.validPositions[y].generatedInput || l.validPositions[y].input == o.skipOptionalPartCharacter && y > 0) ? f.call(r, y, h.call(r, y, p, y - 1)) : l.validPositions[y]).match, \n p = v.locator.slice(), g.push(!0 === n ? v.input : !1 === n ? d.nativeDef : c.call(r, y, d)); else {\n d = (v = u.call(r, y, p, y - 1)).match, p = v.locator.slice();\n var k = !0 !== i && (!1 !== o.jitMasking ? o.jitMasking : d.jit);\n (m = (m || l.validPositions[y - 1]) && d.static && d.def !== o.groupSeparator && null === d.fn) || !1 === k || void 0 === k || \"number\" == typeof k && isFinite(k) && k > y ? g.push(!1 === n ? d.nativeDef : c.call(r, g.length, d)) : m = !1;\n }\n y++;\n } while (!0 !== d.static || \"\" !== d.def || t > y);\n \"\" === g[g.length - 1] && g.pop();\n !1 === n && void 0 !== l.maskLength || (l.maskLength = y - 1);\n return o.greedy = s, g;\n }, t.getPlaceholder = c, t.getTest = p, t.getTestTemplate = u, t.getTests = h, t.isSubsetOf = d;\n var i, a = (i = n(2394)) && i.__esModule ? i : {\n default: i\n }, r = n(8711);\n function o(e) {\n return o = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, o(e);\n }\n function l(e, t) {\n var n = (null != e.alternation ? e.mloc[s(e)] : e.locator).join(\"\");\n if (\"\" !== n) for (n = n.split(\":\")[0]; n.length < t; ) n += \"0\";\n return n;\n }\n function s(e) {\n var t = e.locator[e.alternation];\n return \"string\" == typeof t && t.length > 0 && (t = t.split(\",\")[0]), void 0 !== t ? t.toString() : \"\";\n }\n function c(e, t, n) {\n var i = this, a = this.opts, l = this.maskset;\n if (void 0 !== (t = t || p.call(i, e).match).placeholder || !0 === n) {\n if (\"\" !== t.placeholder && !0 === t.static && !0 !== t.generated) {\n var s = r.getLastValidPosition.call(i, e), c = r.seekNext.call(i, s);\n return (n ? e <= c : e < c) ? a.staticDefinitionSymbol && t.static ? t.nativeDef : t.def : \"function\" == typeof t.placeholder ? t.placeholder(a) : t.placeholder;\n }\n return \"function\" == typeof t.placeholder ? t.placeholder(a) : t.placeholder;\n }\n if (!0 === t.static) {\n if (e > -1 && void 0 === l.validPositions[e]) {\n var u, f = h.call(i, e), d = [];\n if (\"string\" == typeof a.placeholder && f.length > 1 + (\"\" === f[f.length - 1].match.def ? 1 : 0)) for (var v = 0; v < f.length; v++) if (\"\" !== f[v].match.def && !0 !== f[v].match.optionality && !0 !== f[v].match.optionalQuantifier && (!0 === f[v].match.static || void 0 === u || !1 !== f[v].match.fn.test(u.match.def, l, e, !0, a)) && (d.push(f[v]), \n !0 === f[v].match.static && (u = f[v]), d.length > 1 && /[0-9a-bA-Z]/.test(d[0].match.def))) return a.placeholder.charAt(e % a.placeholder.length);\n }\n return t.def;\n }\n return \"object\" === o(a.placeholder) ? t.def : a.placeholder.charAt(e % a.placeholder.length);\n }\n function u(e, t, n) {\n return this.maskset.validPositions[e] || f.call(this, e, h.call(this, e, t ? t.slice() : t, n));\n }\n function f(e, t) {\n var n = this.opts, i = 0, a = function(e, t) {\n var n = 0, i = !1;\n t.forEach((function(e) {\n e.match.optionality && (0 !== n && n !== e.match.optionality && (i = !0), (0 === n || n > e.match.optionality) && (n = e.match.optionality));\n })), n && (0 == e || 1 == t.length ? n = 0 : i || (n = 0));\n return n;\n }(e, t);\n e = e > 0 ? e - 1 : 0;\n var r, o, s, c = l(p.call(this, e));\n n.greedy && t.length > 1 && \"\" === t[t.length - 1].match.def && (i = 1);\n for (var u = 0; u < t.length - i; u++) {\n var f = t[u];\n r = l(f, c.length);\n var d = Math.abs(r - c);\n (!0 !== f.unMatchedAlternationStopped || t.filter((function(e) {\n return !0 !== e.unMatchedAlternationStopped;\n })).length <= 1) && (void 0 === o || \"\" !== r && d < o || s && !n.greedy && s.match.optionality && s.match.optionality - a > 0 && \"master\" === s.match.newBlockMarker && (!f.match.optionality || f.match.optionality - a < 1 || !f.match.newBlockMarker) || s && !n.greedy && s.match.optionalQuantifier && !f.match.optionalQuantifier) && (o = d, \n s = f);\n }\n return s;\n }\n function p(e, t) {\n var n = this.maskset;\n return n.validPositions[e] ? n.validPositions[e] : (t || h.call(this, e))[0];\n }\n function d(e, t, n) {\n function i(e) {\n for (var t, n = [], i = -1, a = 0, r = e.length; a < r; a++) if (\"-\" === e.charAt(a)) for (t = e.charCodeAt(a + 1); ++i < t; ) n.push(String.fromCharCode(i)); else i = e.charCodeAt(a), \n n.push(e.charAt(a));\n return n.join(\"\");\n }\n return e.match.def === t.match.nativeDef || !(!(n.regex || e.match.fn instanceof RegExp && t.match.fn instanceof RegExp) || !0 === e.match.static || !0 === t.match.static) && (\".\" === t.match.fn.source || -1 !== i(t.match.fn.source.replace(/[[\\]/]/g, \"\")).indexOf(i(e.match.fn.source.replace(/[[\\]/]/g, \"\"))));\n }\n function h(e, t, n) {\n var i, r, o = this, l = this.dependencyLib, s = this.maskset, c = this.opts, u = this.el, p = s.maskToken, h = t ? n : 0, v = t ? t.slice() : [ 0 ], m = [], g = !1, y = t ? t.join(\"\") : \"\", k = !1;\n function b(t, n, r, l) {\n function f(r, l, p) {\n function v(e, t) {\n var n = 0 === t.matches.indexOf(e);\n return n || t.matches.every((function(i, a) {\n return !0 === i.isQuantifier ? n = v(e, t.matches[a - 1]) : Object.prototype.hasOwnProperty.call(i, \"matches\") && (n = v(e, i)), \n !n;\n })), n;\n }\n function w(e, t, n) {\n var i, a;\n if ((s.tests[e] || s.validPositions[e]) && (s.validPositions[e] ? [ s.validPositions[e] ] : s.tests[e]).every((function(e, r) {\n if (e.mloc[t]) return i = e, !1;\n var o = void 0 !== n ? n : e.alternation, l = void 0 !== e.locator[o] ? e.locator[o].toString().indexOf(t) : -1;\n return (void 0 === a || l < a) && -1 !== l && (i = e, a = l), !0;\n })), i) {\n var r = i.locator[i.alternation], o = i.mloc[t] || i.mloc[r] || i.locator;\n if (-1 !== o[o.length - 1].toString().indexOf(\":\")) o.pop();\n return o.slice((void 0 !== n ? n : i.alternation) + 1);\n }\n return void 0 !== n ? w(e, t) : void 0;\n }\n function P(t, n) {\n return !0 === t.match.static && !0 !== n.match.static && n.match.fn.test(t.match.def, s, e, !1, c, !1);\n }\n function S(e, t) {\n var n = e.alternation, i = void 0 === t || n <= t.alternation && -1 === e.locator[n].toString().indexOf(t.locator[n]);\n if (!i && n > t.alternation) for (var a = 0; a < n; a++) if (e.locator[a] !== t.locator[a]) {\n n = a, i = !0;\n break;\n }\n return !!i && function(n) {\n e.mloc = e.mloc || {};\n var i = e.locator[n];\n if (void 0 !== i) {\n if (\"string\" == typeof i && (i = i.split(\",\")[0]), void 0 === e.mloc[i] && (e.mloc[i] = e.locator.slice(), \n e.mloc[i].push(\":\".concat(e.alternation))), void 0 !== t) {\n for (var a in t.mloc) \"string\" == typeof a && (a = parseInt(a.split(\",\")[0])), e.mloc[a + 0] = t.mloc[a];\n e.locator[n] = Object.keys(e.mloc).join(\",\");\n }\n return e.alternation > n && (e.alternation = n), !0;\n }\n return e.alternation = void 0, !1;\n }(n);\n }\n function O(e, t) {\n if (e.locator.length !== t.locator.length) return !1;\n for (var n = e.alternation + 1; n < e.locator.length; n++) if (e.locator[n] !== t.locator[n]) return !1;\n return !0;\n }\n if (h > e + c._maxTestPos) throw new Error(\"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \".concat(s.mask));\n if (h === e && void 0 === r.matches) {\n if (m.push({\n match: r,\n locator: l.reverse(),\n cd: y,\n mloc: {}\n }), !r.optionality || void 0 !== p || !(c.definitions && c.definitions[r.nativeDef] && c.definitions[r.nativeDef].optional || a.default.prototype.definitions[r.nativeDef] && a.default.prototype.definitions[r.nativeDef].optional)) return !0;\n g = !0, h = e;\n } else if (void 0 !== r.matches) {\n if (r.isGroup && p !== r) return function() {\n if (r = f(t.matches[t.matches.indexOf(r) + 1], l, p)) return !0;\n }();\n if (r.isOptional) return function() {\n var t = r, a = m.length;\n if (r = b(r, n, l, p), m.length > 0) {\n if (m.forEach((function(e, t) {\n t >= a && (e.match.optionality = e.match.optionality ? e.match.optionality + 1 : 1);\n })), i = m[m.length - 1].match, void 0 !== p || !v(i, t)) return r;\n g = !0, h = e;\n }\n }();\n if (r.isAlternator) return function() {\n function i(e) {\n for (var t, n = e.matches[0].matches ? e.matches[0].matches.length : 1, i = 0; i < e.matches.length && n === (t = e.matches[i].matches ? e.matches[i].matches.length : 1); i++) ;\n return n !== t;\n }\n o.hasAlternator = !0;\n var a, v = r, y = [], b = m.slice(), x = l.length, _ = n.length > 0 ? n.shift() : -1;\n if (-1 === _ || \"string\" == typeof _) {\n var M, E = h, j = n.slice(), T = [];\n if (\"string\" == typeof _) T = _.split(\",\"); else for (M = 0; M < v.matches.length; M++) T.push(M.toString());\n if (void 0 !== s.excludes[e]) {\n for (var A = T.slice(), D = 0, L = s.excludes[e].length; D < L; D++) {\n var C = s.excludes[e][D].toString().split(\":\");\n l.length == C[1] && T.splice(T.indexOf(C[0]), 1);\n }\n 0 === T.length && (delete s.excludes[e], T = A);\n }\n (!0 === c.keepStatic || isFinite(parseInt(c.keepStatic)) && E >= c.keepStatic) && (T = T.slice(0, 1));\n for (var B = 0; B < T.length; B++) {\n M = parseInt(T[B]), m = [], n = \"string\" == typeof _ && w(h, M, x) || j.slice();\n var I = v.matches[M];\n if (I && f(I, [ M ].concat(l), p)) r = !0; else if (0 === B && (k = i(v)), I && I.matches && I.matches.length > v.matches[0].matches.length) break;\n a = m.slice(), h = E, m = [];\n for (var R = 0; R < a.length; R++) {\n var F = a[R], N = !1;\n F.alternation = F.alternation || x, S(F);\n for (var V = 0; V < y.length; V++) {\n var G = y[V];\n if (\"string\" != typeof _ || void 0 !== F.alternation && T.includes(F.locator[F.alternation].toString())) {\n if (F.match.nativeDef === G.match.nativeDef) {\n N = !0, S(G, F);\n break;\n }\n if (d(F, G, c)) {\n S(F, G) && (N = !0, y.splice(y.indexOf(G), 0, F));\n break;\n }\n if (d(G, F, c)) {\n S(G, F);\n break;\n }\n if (P(F, G)) {\n O(F, G) || void 0 !== u.inputmask.userOptions.keepStatic ? S(F, G) && (N = !0, y.splice(y.indexOf(G), 0, F)) : c.keepStatic = !0;\n break;\n }\n if (P(G, F)) {\n S(G, F);\n break;\n }\n }\n }\n N || y.push(F);\n }\n }\n m = b.concat(y), h = e, g = m.length > 0 && k, r = y.length > 0 && !k, k && g && !r && m.forEach((function(e, t) {\n e.unMatchedAlternationStopped = !0;\n })), n = j.slice();\n } else r = f(v.matches[_] || t.matches[_], [ _ ].concat(l), p);\n if (r) return !0;\n }();\n if (r.isQuantifier && p !== t.matches[t.matches.indexOf(r) - 1]) return function() {\n for (var a = r, o = !1, u = n.length > 0 ? n.shift() : 0; u < (isNaN(a.quantifier.max) ? u + 1 : a.quantifier.max) && h <= e; u++) {\n var p = t.matches[t.matches.indexOf(a) - 1];\n if (r = f(p, [ u ].concat(l), p)) {\n if (m.forEach((function(t, n) {\n (i = x(p, t.match) ? t.match : m[m.length - 1].match).optionalQuantifier = u >= a.quantifier.min, \n i.jit = (u + 1) * (p.matches.indexOf(i) + 1) > a.quantifier.jit, i.optionalQuantifier && v(i, p) && (g = !0, \n h = e, c.greedy && null == s.validPositions[e - 1] && u > a.quantifier.min && -1 != [ \"*\", \"+\" ].indexOf(a.quantifier.max) && (m.pop(), \n y = void 0), o = !0, r = !1), !o && i.jit && (s.jitOffset[e] = p.matches.length - p.matches.indexOf(i));\n })), o) break;\n return !0;\n }\n }\n }();\n if (r = b(r, n, l, p)) return !0;\n } else h++;\n }\n for (var p = n.length > 0 ? n.shift() : 0; p < t.matches.length; p++) if (!0 !== t.matches[p].isQuantifier) {\n var v = f(t.matches[p], [ p ].concat(r), l);\n if (v && h === e) return v;\n if (h > e) break;\n }\n }\n function x(e, t) {\n var n = -1 != e.matches.indexOf(t);\n return n || e.matches.forEach((function(e, i) {\n void 0 === e.matches || n || (n = x(e, t));\n })), n;\n }\n if (e > -1) {\n if (void 0 === t) {\n for (var w, P = e - 1; void 0 === (w = s.validPositions[P] || s.tests[P]) && P > -1; ) P--;\n void 0 !== w && P > -1 && (v = function(e, t) {\n var n, i = [];\n return Array.isArray(t) || (t = [ t ]), t.length > 0 && (void 0 === t[0].alternation || !0 === c.keepStatic ? 0 === (i = f.call(o, e, t.slice()).locator.slice()).length && (i = t[0].locator.slice()) : t.forEach((function(e) {\n \"\" !== e.def && (0 === i.length ? (n = e.alternation, i = e.locator.slice()) : e.locator[n] && -1 === i[n].toString().indexOf(e.locator[n]) && (i[n] += \",\" + e.locator[n]));\n }))), i;\n }(P, w), y = v.join(\"\"), h = P);\n }\n if (s.tests[e] && s.tests[e][0].cd === y) return s.tests[e];\n for (var S = v.shift(); S < p.length; S++) {\n if (b(p[S], v, [ S ]) && h === e || h > e) break;\n }\n }\n return (0 === m.length || g) && m.push({\n match: {\n fn: null,\n static: !0,\n optionality: !1,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: k && 0 === m.filter((function(e) {\n return !0 !== e.unMatchedAlternationStopped;\n })).length ? [ 0 ] : [],\n mloc: {},\n cd: y\n }), void 0 !== t && s.tests[e] ? r = l.extend(!0, [], m) : (s.tests[e] = l.extend(!0, [], m), \n r = s.tests[e]), m.forEach((function(e) {\n e.match.optionality = e.match.defOptionality || !1;\n })), r;\n }\n },\n 7215: function(e, t, n) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.alternate = l, t.checkAlternationMatch = function(e, t, n) {\n for (var i, a = this.opts.greedy ? t : t.slice(0, 1), r = !1, o = void 0 !== n ? n.split(\",\") : [], l = 0; l < o.length; l++) -1 !== (i = e.indexOf(o[l])) && e.splice(i, 1);\n for (var s = 0; s < e.length; s++) if (a.includes(e[s])) {\n r = !0;\n break;\n }\n return r;\n }, t.handleRemove = function(e, t, n, i, s) {\n var c = this, u = this.maskset, f = this.opts;\n if ((f.numericInput || c.isRTL) && (t === a.keys.Backspace ? t = a.keys.Delete : t === a.keys.Delete && (t = a.keys.Backspace), \n c.isRTL)) {\n var p = n.end;\n n.end = n.begin, n.begin = p;\n }\n var d, h = r.getLastValidPosition.call(c, void 0, !0);\n n.end >= r.getBuffer.call(c).length && h >= n.end && (n.end = h + 1);\n t === a.keys.Backspace ? n.end - n.begin < 1 && (n.begin = r.seekPrevious.call(c, n.begin)) : t === a.keys.Delete && n.begin === n.end && (n.end = r.isMask.call(c, n.end, !0, !0) ? n.end + 1 : r.seekNext.call(c, n.end) + 1);\n !1 !== (d = v.call(c, n)) && ((!0 !== i && !1 !== f.keepStatic || null !== f.regex && -1 !== o.getTest.call(c, n.begin).match.def.indexOf(\"|\")) && l.call(c, !0), \n !0 !== i && (u.p = t === a.keys.Delete ? n.begin + d : n.begin, u.p = r.determineNewCaretPosition.call(c, {\n begin: u.p,\n end: u.p\n }, !1, !1 === f.insertMode && t === a.keys.Backspace ? \"none\" : void 0).begin));\n }, t.isComplete = c, t.isSelection = u, t.isValid = f, t.refreshFromBuffer = d, \n t.revalidateMask = v;\n var i = n(6030), a = n(2839), r = n(8711), o = n(4713);\n function l(e, t, n, i, a, s) {\n var c = this, u = this.dependencyLib, p = this.opts, d = c.maskset;\n if (!c.hasAlternator) return !1;\n var h, v, m, g, y, k, b, x, w, P, S, O = u.extend(!0, [], d.validPositions), _ = u.extend(!0, {}, d.tests), M = !1, E = !1, j = void 0 !== a ? a : r.getLastValidPosition.call(c);\n if (s && (P = s.begin, S = s.end, s.begin > s.end && (P = s.end, S = s.begin)), \n -1 === j && void 0 === a) h = 0, v = (g = o.getTest.call(c, h)).alternation; else for (;j >= 0; j--) if ((m = d.validPositions[j]) && void 0 !== m.alternation) {\n if (j <= (e || 0) && g && g.locator[m.alternation] !== m.locator[m.alternation]) break;\n h = j, v = d.validPositions[h].alternation, g = m;\n }\n if (void 0 !== v) {\n b = parseInt(h), d.excludes[b] = d.excludes[b] || [], !0 !== e && d.excludes[b].push((0, \n o.getDecisionTaker)(g) + \":\" + g.alternation);\n var T = [], A = -1;\n for (y = b; b < r.getLastValidPosition.call(c, void 0, !0) + 1; y++) -1 === A && e <= y && void 0 !== t && (T.push(t), \n A = T.length - 1), (k = d.validPositions[b]) && !0 !== k.generatedInput && (void 0 === s || y < P || y >= S) && T.push(k.input), \n d.validPositions.splice(b, 1);\n for (-1 === A && void 0 !== t && (T.push(t), A = T.length - 1); void 0 !== d.excludes[b] && d.excludes[b].length < 10; ) {\n for (d.tests = {}, r.resetMaskSet.call(c, !0), M = !0, y = 0; y < T.length && (x = M.caret || 0 == p.insertMode && null != x ? r.seekNext.call(c, x) : r.getLastValidPosition.call(c, void 0, !0) + 1, \n w = T[y], M = f.call(c, x, w, !1, i, !0)); y++) y === A && (E = M), 1 == e && M && (E = {\n caretPos: y\n });\n if (M) break;\n if (r.resetMaskSet.call(c), g = o.getTest.call(c, b), d.validPositions = u.extend(!0, [], O), \n d.tests = u.extend(!0, {}, _), !d.excludes[b]) {\n E = l.call(c, e, t, n, i, b - 1, s);\n break;\n }\n if (null != g.alternation) {\n var D = (0, o.getDecisionTaker)(g);\n if (-1 !== d.excludes[b].indexOf(D + \":\" + g.alternation)) {\n E = l.call(c, e, t, n, i, b - 1, s);\n break;\n }\n for (d.excludes[b].push(D + \":\" + g.alternation), y = b; y < r.getLastValidPosition.call(c, void 0, !0) + 1; y++) d.validPositions.splice(b);\n } else delete d.excludes[b];\n }\n }\n return E && !1 === p.keepStatic || delete d.excludes[b], E;\n }\n function s(e, t, n) {\n var i = this.opts, r = this.maskset;\n switch (i.casing || t.casing) {\n case \"upper\":\n e = e.toUpperCase();\n break;\n\n case \"lower\":\n e = e.toLowerCase();\n break;\n\n case \"title\":\n var o = r.validPositions[n - 1];\n e = 0 === n || o && o.input === String.fromCharCode(a.keyCode.Space) ? e.toUpperCase() : e.toLowerCase();\n break;\n\n default:\n if (\"function\" == typeof i.casing) {\n var l = Array.prototype.slice.call(arguments);\n l.push(r.validPositions), e = i.casing.apply(this, l);\n }\n }\n return e;\n }\n function c(e) {\n var t = this, n = this.opts, i = this.maskset;\n if (\"function\" == typeof n.isComplete) return n.isComplete(e, n);\n if (\"*\" !== n.repeat) {\n var a = !1, l = r.determineLastRequiredPosition.call(t, !0), s = l.l;\n if (void 0 === l.def || l.def.newBlockMarker || l.def.optionality || l.def.optionalQuantifier) {\n a = !0;\n for (var c = 0; c <= s; c++) {\n var u = o.getTestTemplate.call(t, c).match;\n if (!0 !== u.static && void 0 === i.validPositions[c] && (!1 === u.optionality || void 0 === u.optionality || u.optionality && 0 == u.newBlockMarker) && (!1 === u.optionalQuantifier || void 0 === u.optionalQuantifier) || !0 === u.static && \"\" != u.def && e[c] !== o.getPlaceholder.call(t, c, u)) {\n a = !1;\n break;\n }\n }\n }\n return a;\n }\n }\n function u(e) {\n var t = this.opts.insertMode ? 0 : 1;\n return this.isRTL ? e.begin - e.end > t : e.end - e.begin > t;\n }\n function f(e, t, n, i, a, p, m) {\n var g = this, y = this.dependencyLib, k = this.opts, b = g.maskset;\n n = !0 === n;\n var x = e;\n function w(e) {\n if (void 0 !== e) {\n if (void 0 !== e.remove && (Array.isArray(e.remove) || (e.remove = [ e.remove ]), \n e.remove.sort((function(e, t) {\n return g.isRTL ? e.pos - t.pos : t.pos - e.pos;\n })).forEach((function(e) {\n v.call(g, {\n begin: e,\n end: e + 1\n });\n })), e.remove = void 0), void 0 !== e.insert && (Array.isArray(e.insert) || (e.insert = [ e.insert ]), \n e.insert.sort((function(e, t) {\n return g.isRTL ? t.pos - e.pos : e.pos - t.pos;\n })).forEach((function(e) {\n \"\" !== e.c && f.call(g, e.pos, e.c, void 0 === e.strict || e.strict, void 0 !== e.fromIsValid ? e.fromIsValid : i);\n })), e.insert = void 0), e.refreshFromBuffer && e.buffer) {\n var t = e.refreshFromBuffer;\n d.call(g, !0 === t ? t : t.start, t.end, e.buffer), e.refreshFromBuffer = void 0;\n }\n void 0 !== e.rewritePosition && (x = e.rewritePosition, e = !0);\n }\n return e;\n }\n function P(t, n, a) {\n var l = !1;\n return o.getTests.call(g, t).every((function(c, f) {\n var p = c.match;\n if (r.getBuffer.call(g, !0), !1 !== (l = (!p.jit || void 0 !== b.validPositions[r.seekPrevious.call(g, t)]) && (null != p.fn ? p.fn.test(n, b, t, a, k, u.call(g, e)) : (n === p.def || n === k.skipOptionalPartCharacter) && \"\" !== p.def && {\n c: o.getPlaceholder.call(g, t, p, !0) || p.def,\n pos: t\n }))) {\n var d = void 0 !== l.c ? l.c : n, h = t;\n return d = d === k.skipOptionalPartCharacter && !0 === p.static ? o.getPlaceholder.call(g, t, p, !0) || p.def : d, \n !0 !== (l = w(l)) && void 0 !== l.pos && l.pos !== t && (h = l.pos), !0 !== l && void 0 === l.pos && void 0 === l.c ? !1 : (!1 === v.call(g, e, y.extend({}, c, {\n input: s.call(g, d, p, h)\n }), i, h) && (l = !1), !1);\n }\n return !0;\n })), l;\n }\n void 0 !== e.begin && (x = g.isRTL ? e.end : e.begin);\n var S = !0, O = y.extend(!0, [], b.validPositions);\n if (!1 === k.keepStatic && void 0 !== b.excludes[x] && !0 !== a && !0 !== i) for (var _ = x; _ < (g.isRTL ? e.begin : e.end); _++) void 0 !== b.excludes[_] && (b.excludes[_] = void 0, \n delete b.tests[_]);\n if (\"function\" == typeof k.preValidation && !0 !== i && !0 !== p && (S = w(S = k.preValidation.call(g, r.getBuffer.call(g), x, t, u.call(g, e), k, b, e, n || a))), \n !0 === S) {\n if (S = P(x, t, n), (!n || !0 === i) && !1 === S && !0 !== p) {\n var M = b.validPositions[x];\n if (!M || !0 !== M.match.static || M.match.def !== t && t !== k.skipOptionalPartCharacter) {\n if (k.insertMode || void 0 === b.validPositions[r.seekNext.call(g, x)] || e.end > x) {\n var E = !1;\n if (b.jitOffset[x] && void 0 === b.validPositions[r.seekNext.call(g, x)] && !1 !== (S = f.call(g, x + b.jitOffset[x], t, !0, !0)) && (!0 !== a && (S.caret = x), \n E = !0), e.end > x && (b.validPositions[x] = void 0), !E && !r.isMask.call(g, x, k.keepStatic && 0 === x)) for (var j = x + 1, T = r.seekNext.call(g, x, !1, 0 !== x); j <= T; j++) if (!1 !== (S = P(j, t, n))) {\n S = h.call(g, x, void 0 !== S.pos ? S.pos : j) || S, x = j;\n break;\n }\n }\n } else S = {\n caret: r.seekNext.call(g, x)\n };\n }\n g.hasAlternator && !0 !== a && !n && (a = !0, !1 === S && k.keepStatic && (c.call(g, r.getBuffer.call(g)) || 0 === x) ? S = l.call(g, x, t, n, i, void 0, e) : (u.call(g, e) && b.tests[x] && b.tests[x].length > 1 && k.keepStatic || 1 == S && !0 !== k.numericInput && b.tests[x] && b.tests[x].length > 1 && r.getLastValidPosition.call(g, void 0, !0) > x) && (S = l.call(g, !0))), \n !0 === S && (S = {\n pos: x\n });\n }\n if (\"function\" == typeof k.postValidation && !0 !== i && !0 !== p) {\n var A = k.postValidation.call(g, r.getBuffer.call(g, !0), void 0 !== e.begin ? g.isRTL ? e.end : e.begin : e, t, S, k, b, n, m);\n void 0 !== A && (S = !0 === A ? S : A);\n }\n S && void 0 === S.pos && (S.pos = x), !1 === S || !0 === p ? (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], O)) : h.call(g, void 0, x, !0);\n var D = w(S);\n void 0 !== g.maxLength && (r.getBuffer.call(g).length > g.maxLength && !i && (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], O), D = !1));\n return D;\n }\n function p(e, t, n) {\n for (var i = this.maskset, a = !1, r = o.getTests.call(this, e), l = 0; l < r.length; l++) {\n if (r[l].match && (r[l].match.nativeDef === t.match[n.shiftPositions ? \"def\" : \"nativeDef\"] && (!n.shiftPositions || !t.match.static) || r[l].match.nativeDef === t.match.nativeDef || n.regex && !r[l].match.static && r[l].match.fn.test(t.input, i, e, !1, n))) {\n a = !0;\n break;\n }\n if (r[l].match && r[l].match.def === t.match.nativeDef) {\n a = void 0;\n break;\n }\n }\n return !1 === a && void 0 !== i.jitOffset[e] && (a = p.call(this, e + i.jitOffset[e], t, n)), \n a;\n }\n function d(e, t, n) {\n var a, o, l = this, s = this.maskset, c = this.opts, u = this.dependencyLib, f = c.skipOptionalPartCharacter, p = l.isRTL ? n.slice().reverse() : n;\n if (c.skipOptionalPartCharacter = \"\", !0 === e) r.resetMaskSet.call(l, !1), e = 0, \n t = n.length, o = r.determineNewCaretPosition.call(l, {\n begin: 0,\n end: 0\n }, !1).begin; else {\n for (a = e; a < t; a++) s.validPositions.splice(e, 0);\n o = e;\n }\n var d = new u.Event(\"keypress\");\n for (a = e; a < t; a++) {\n d.key = p[a].toString(), l.ignorable = !1;\n var h = i.EventHandlers.keypressEvent.call(l, d, !0, !1, !1, o);\n !1 !== h && void 0 !== h && (o = h.forwardPosition);\n }\n c.skipOptionalPartCharacter = f;\n }\n function h(e, t, n) {\n var i = this, a = this.maskset, l = this.dependencyLib;\n if (void 0 === e) for (e = t - 1; e > 0 && !a.validPositions[e]; e--) ;\n for (var s = e; s < t; s++) {\n if (void 0 === a.validPositions[s] && !r.isMask.call(i, s, !1)) if (0 == s ? o.getTest.call(i, s) : a.validPositions[s - 1]) {\n var c = o.getTests.call(i, s).slice();\n \"\" === c[c.length - 1].match.def && c.pop();\n var u, p = o.determineTestTemplate.call(i, s, c);\n if (p && (!0 !== p.match.jit || \"master\" === p.match.newBlockMarker && (u = a.validPositions[s + 1]) && !0 === u.match.optionalQuantifier) && ((p = l.extend({}, p, {\n input: o.getPlaceholder.call(i, s, p.match, !0) || p.match.def\n })).generatedInput = !0, v.call(i, s, p, !0), !0 !== n)) {\n var d = a.validPositions[t].input;\n return a.validPositions[t] = void 0, f.call(i, t, d, !0, !0);\n }\n }\n }\n }\n function v(e, t, n, i) {\n var a = this, l = this.maskset, s = this.opts, c = this.dependencyLib;\n function d(e, t, n) {\n var i = t[e];\n if (void 0 !== i && !0 === i.match.static && !0 !== i.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) {\n var a = n.begin <= e - 1 ? t[e - 1] && !0 === t[e - 1].match.static && t[e - 1] : t[e - 1], r = n.end > e + 1 ? t[e + 1] && !0 === t[e + 1].match.static && t[e + 1] : t[e + 1];\n return a && r;\n }\n return !1;\n }\n var h = 0, v = void 0 !== e.begin ? e.begin : e, m = void 0 !== e.end ? e.end : e, g = !0;\n if (e.begin > e.end && (v = e.end, m = e.begin), i = void 0 !== i ? i : v, void 0 === n && (v !== m || s.insertMode && void 0 !== l.validPositions[i] || void 0 === t || t.match.optionalQuantifier || t.match.optionality)) {\n var y, k = c.extend(!0, [], l.validPositions), b = r.getLastValidPosition.call(a, void 0, !0);\n l.p = v;\n var x = u.call(a, e) ? v : i;\n for (y = b; y >= x; y--) l.validPositions.splice(y, 1), void 0 === t && delete l.tests[y + 1];\n var w, P, S = i, O = S;\n for (t && (l.validPositions[i] = c.extend(!0, {}, t), O++, S++), null == k[m] && l.jitOffset[m] && (m += l.jitOffset[m] + 1), \n y = t ? m : m - 1; y <= b; y++) {\n if (void 0 !== (w = k[y]) && !0 !== w.generatedInput && (y >= m || y >= v && d(y, k, {\n begin: v,\n end: m\n }))) {\n for (;\"\" !== o.getTest.call(a, O).match.def; ) {\n if (!1 !== (P = p.call(a, O, w, s)) || \"+\" === w.match.def) {\n \"+\" === w.match.def && r.getBuffer.call(a, !0);\n var _ = f.call(a, O, w.input, \"+\" !== w.match.def, !0);\n if (g = !1 !== _, S = (_.pos || O) + 1, !g && P) break;\n } else g = !1;\n if (g) {\n void 0 === t && w.match.static && y === e.begin && h++;\n break;\n }\n if (!g && r.getBuffer.call(a), O > l.maskLength) break;\n O++;\n }\n \"\" == o.getTest.call(a, O).match.def && (g = !1), O = S;\n }\n if (!g) break;\n }\n if (!g) return l.validPositions = c.extend(!0, [], k), r.resetMaskSet.call(a, !0), \n !1;\n } else t && o.getTest.call(a, i).match.cd === t.match.cd && (l.validPositions[i] = c.extend(!0, {}, t));\n return r.resetMaskSet.call(a, !0), h;\n }\n }\n }, t = {};\n function n(i) {\n var a = t[i];\n if (void 0 !== a) return a.exports;\n var r = t[i] = {\n exports: {}\n };\n return e[i](r, r.exports, n), r.exports;\n }\n var i = {};\n return function() {\n var e = i;\n Object.defineProperty(e, \"__esModule\", {\n value: !0\n }), e.default = void 0, n(7149), n(3194), n(9302), n(4013), n(3851), n(219), n(207), \n n(5296);\n var t, a = (t = n(2394)) && t.__esModule ? t : {\n default: t\n };\n e.default = a.default;\n }(), i;\n }();\n}));\n\n//# sourceURL=webpack://Formio/./node_modules/inputmask/dist/inputmask.js?"); /***/ }), diff --git a/lib/formio.full.min.js b/lib/formio.full.min.js index 6564fc25..37272bf5 100644 --- a/lib/formio.full.min.js +++ b/lib/formio.full.min.js @@ -1,2 +1,2 @@ /*! For license information please see formio.full.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Formio=t():e.Formio=t()}(self,(function(){return function(){var e={44964:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3];if(this.events){var o="".concat(this.options.namespace,".").concat(e);return t.id=this.id,t.key=this.key,t.internal=n,this.events[r?"once":"on"](o,t)}}},{key:"once",value:function(e,t,n){return this.on(e,t,n,!0)}},{key:"onAny",value:function(e){if(this.events)return this.events.onAny(e)}},{key:"offAny",value:function(e){if(this.events)return this.events.offAny(e)}},{key:"off",value:function(e,t){var n=this;if(this.events){var r="".concat(this.options.namespace,".").concat(e);this.events.listeners(r).forEach((function(e){e&&e.id===n.id&&(t&&t!==e||n.events.off(r,e))}))}}},{key:"emit",value:function(e){if(this.events){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:null,o=[];if(e)return this.eventHandlers.forEach((function(i,a){i.id!==n.id||!e.removeEventListener||i.type!==t||r&&i.func!==r||(e.removeEventListener(t,i.func),o.push(a))})),o.length&&l.default.pullAt(this.eventHandlers,o),this}},{key:"removeEventListeners",value:function(){var e=this;this.eventHandlers.forEach((function(t){e.id===t.id&&t.type&&t.obj&&t.obj.removeEventListener&&t.obj.removeEventListener(t.type,t.func)})),this.eventHandlers=[]}},{key:"removeAllEvents",value:function(e){var t=this;l.default.each(this.events._events,(function(n,r){l.default.each(n,(function(n){n&&t.id===n.id&&(e||n.internal)&&t.events.off(r,n)}))}))}},{key:"destroy",value:function(){this.removeEventListeners(),this.removeAllEvents()}},{key:"appendTo",value:function(e,t){return null==t||t.appendChild(e),this}},{key:"prependTo",value:function(e,t){if(t)if(t.firstChild)try{t.insertBefore(e,t.firstChild)}catch(n){console.warn(n),t.appendChild(e)}else t.appendChild(e);return this}},{key:"removeChildFrom",value:function(e,t){if(t&&t.contains(e))try{t.removeChild(e)}catch(e){console.warn(e)}return this}},{key:"ce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=document.createElement(e);return t&&this.attr(r,t),this.appendChild(r,n),r}},{key:"appendChild",value:function(e,t){var n=this;return Array.isArray(t)?t.forEach((function(t){return n.appendChild(e,t)})):t instanceof HTMLElement||t instanceof Text?e.appendChild(t):t&&e.appendChild(this.text(t.toString())),this}},{key:"maskPlaceholder",value:function(e){var t=this;return e.map((function(e){return e instanceof RegExp?t.placeholderChar:e})).join("")}},{key:"placeholderChar",get:function(){var e;return(null===(e=this.component)||void 0===e?void 0:e.inputMaskPlaceholderChar)||"_"}},{key:"setInputMask",value:function(e,t,n){if(e&&t){var r=i.getInputMask(t,this.placeholderChar);this.defaultMask=r;try{e.mask&&e.mask.destroy(),e.mask=(0,u.default)({inputElement:e,mask:r,placeholderChar:this.placeholderChar,shadowRoot:this.root?this.root.shadowRoot:null})}catch(e){console.warn(e)}r.numeric&&e.setAttribute("pattern","\\d*"),n&&e.setAttribute("placeholder",this.maskPlaceholder(r))}}},{key:"t",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o-1)}},{key:"addClass",value:function(e,t){if(!(e&&e instanceof HTMLElement))return this;var n=e.getAttribute("class");return null!=n&&n.includes(t)||e.setAttribute("class","".concat(n," ").concat(t)),this}},{key:"removeClass",value:function(e,t){if(!(e&&t&&e instanceof HTMLElement))return this;var n=e.getAttribute("class");return n&&(n=n.replace(new RegExp(" ".concat(t),"g"),""),e.setAttribute("class",n)),this}},{key:"empty",value:function(e){if(e)for(;e.firstChild;)e.removeChild(e.firstChild)}},{key:"evalContext",value:function(e){var t;return Object.assign({_:l.default,utils:i,util:i,user:o.GlobalFormio.getUser(),moment:s.default,instance:this,self:this,token:o.GlobalFormio.getToken({decode:!0}),config:this.root&&this.root.form&&this.root.form.config?this.root.form.config:null!==(t=this.options)&&void 0!==t&&t.formConfig?this.options.formConfig:{}},e,l.default.get(this.root,"options.evalContext",{}))}},{key:"interpolate",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"function"==typeof e||!this.component.content&&!this.component.html||i.Evaluator.templateSettings.interpolate.test(e)||(e=i.translateHTMLTemplate(String(e),(function(e){return n.t(e)}))),i.interpolate(e,this.evalContext(t),r)}},{key:"evaluate",value:function(e,t,n,r){return i.evaluate(e,this.evalContext(t),n,r)}},{key:"hook",value:function(){var e=arguments[0];if(this.options&&this.options.hooks&&this.options.hooks[e])return this.options.hooks[e].apply(this,Array.prototype.slice.call(arguments,1));var t="function"==typeof arguments[arguments.length-1]?arguments[arguments.length-1]:null;return t?t(null,arguments[1]):arguments[1]}}],n&&p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=h},85542:function(e,t,n){"use strict";n(69070),n(68304),n(24812),n(30489),n(74819),n(38880),n(12419),n(78011),n(32165),n(66992),n(78783),n(33948),n(4129),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=n(26729),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=o?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(r,l,s):r[l]=e[l]}return r.default=e,n&&n.set(e,r),r}(n(82531));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function u(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=d(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},f.apply(this,arguments)}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===a(t)?t:String(t)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(a,e);var t,n,r,i=(n=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(n);if(r){var o=p(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return u(this,e)});function a(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l(this,a);var s=r.loadLimit,u=void 0===s?1e3:s,d=r.eventsSafeInterval,m=void 0===d?300:d;h(c(n=i.call(this)),"onAny",(function(e){n.on("any",e)})),h(c(n),"offAny",(function(e){n.off("any",e)}));var y=function(){console.warn("There were more than ".concat(u," events emitted in ").concat(m," ms. It might be caused by events' infinite loop"),n.id)},v=o.observeOverload(y,{limit:u,delay:m});return n.emit=function(){for(var r,o,i=arguments.length,l=new Array(i),s=0;s'):"";i+='
'),document.write(i);var a=0,l=setInterval((function(){a++;var t=document.getElementById(r);(t||a>10)&&(n(new d(t,e.src).ready),clearInterval(l))}),10)}))}}],(o=[{key:"create",value:function(e){return this.options&&(this.options.flatten||"flat"===this.options.renderMode)&&(e="form"),this.display=e,a.default.displays[e]?new a.default.displays[e](this.element,this.options):new a.default.displays.webform(this.element,this.options)}},{key:"form",get:function(){return this._form},set:function(e){return this.setForm(e)}},{key:"errorForm",value:function(e){return{components:[{label:"HTML",tag:"div",className:"error error-message alert alert-danger ui red message",attrs:[{attr:"role",value:"alert"}],key:"errorMessage",type:"htmlelement",input:!1,content:"string"==typeof e?e:e.message}]}}},{key:"setForm",value:function(e){var t,n=this;if("string"==typeof(e=e||this.form)){var r,o=new i.GlobalFormio(e);t=this.getSubmission(o,this.options).catch((function(e){r=e})).then((function(t){return o.loadForm().catch((function(e){r=e})).then((function(o){if(r&&(o=n.errorForm(r)),n.instance=n.instance||n.create(o.display),n.instance.url=e,n.instance.nosubmit=!1,n._form=n.instance.form=o,t&&(n.instance.submission=t),r)throw r;return n.instance}))}))}else this.instance=this.instance||this.create(e.display),this._form=this.instance.form=e,t=this.instance.ready;return t.then((function(){return n.element=n.instance.element,n.instance}))}},{key:"getSubmission",value:function(e,t){return e.submissionId?e.loadSubmission(null,t):u.default.resolve()}},{key:"setDisplay",value:function(e){return this.display===e&&this.instance?u.default.resolve(this.instance):(this.form.display=e,this.instance.destroy(),this.instance=this.create(e),this.setForm(this.form))}},{key:"empty",value:function(){if(this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}},{key:"sanitize",value:function(e,t){return!1!==this.options.sanitize||t?s.sanitize(e,this.options):e}},{key:"setContent",value:function(e,t,n){return e instanceof HTMLElement&&(e.innerHTML=this.sanitize(t,n),!0)}},{key:"build",value:function(){var e=this;if(!this.instance)return u.default.reject("Form not ready. Use form.ready promise");if(!this.element)return u.default.reject("No DOM element for form.");var t=this.options&&this.options.template?this.options.template:"bootstrap",n=l.default[t].loader||l.default.bootstrap.loader;return this.setContent(this.element,n.form),this.render().then((function(t){return e.setContent(e.element,t),e.attach(e.element).then((function(){return e.instance}))})).then((function(t){return e.emit("build",t),t}))}},{key:"render",value:function(){var e=this;return this.instance?u.default.resolve(this.instance.render()).then((function(t){return e.emit("render",t),t})):u.default.reject("Form not ready. Use form.ready promise")}},{key:"attach",value:function(e){var t=this;return this.instance?(this.element=e,this.instance.attach(this.element).then((function(e){return t.emit("attach",e),e}))):u.default.reject("Form not ready. Use form.ready promise")}}])&&h(r.prototype,o),c&&h(r,c),Object.defineProperty(r,"prototype",{writable:!1}),d}(o.default);t.default=g,i.GlobalFormio.embedForm=function(e){return g.embed(e)},i.GlobalFormio.createForm=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};if(g(this,e),!(this instanceof e))return new e(t);if(this.base="",this.projectsUrl="",this.projectUrl="",this.projectId="",this.roleUrl="",this.rolesUrl="",this.roleId="",this.formUrl="",this.formsUrl="",this.formId="",this.submissionsUrl="",this.submissionUrl="",this.submissionId="",this.actionsUrl="",this.actionId="",this.actionUrl="",this.vsUrl="",this.vId="",this.vUrl="",this.query="",this.path=t,this.options=r,r.useSessionToken&&e.useSessionToken(r),r.hasOwnProperty("base")?this.base=r.base:e.baseUrl?this.base=e.baseUrl:"undefined"!=typeof window&&(this.base=window.location.href.match(/http[s]?:\/\/api./)[0]),!t)return this.projectUrl=e.projectUrl||"".concat(this.base,"/project"),this.projectsUrl="".concat(this.base,"/project"),this.projectId=!1,void(this.query="");r.hasOwnProperty("project")&&(this.projectUrl=r.project);var o=this.projectUrl||e.projectUrl,i=/(^|\/)(project)($|\/[^/]+)/,a=-1!==t.search(i);o&&this.base===o&&!a&&(this.noProject=!0,this.projectUrl=this.base),0!==t.indexOf("http")&&0!==t.indexOf("//")&&(t=this.base+t);var l=this.getUrlParts(t),s=[],u=l[1]+l[2],c=(t=l.length>3?l[3]:"").split("?");c.length>1&&(t=c[0],this.query="?".concat(c[1]));var f=function(e,r){n["".concat(e,"sUrl")]="".concat(r,"/").concat(e);var o=new RegExp("/".concat(e,"/([^/]+)"));return-1!==t.search(o)&&(s=t.match(o),n["".concat(e,"Url")]=s?r+s[0]:"",n["".concat(e,"Id")]=s.length>1?s[1]:"",r+=s[0]),r},d=function e(t,n,r){for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];if(Array.isArray(i))e(i,n,!0);else{var a=f(i,n);n=r?n:a}}};if(!this.projectUrl||this.projectUrl===this.base)if(this.projectUrl||a||"Subdirectories"!==e.pathType)this.projectUrl=u;else{var p="^".concat(u.replace(/\//g,"\\/"),".[^/]+"),h=o.match(new RegExp(p));this.projectUrl=h?h[0]:u}var m=!1;if(e.pathType&&(m="Subdomains"!==e.pathType),!this.noProject){if(a)d(["project"],u),t=t.replace(i,"");else if(u===this.base){if(l.length>3&&t.split("/").length>1){var y=t.match(/.json/),v=t.split("/");y?this.projectUrl=u:(v.shift(),this.projectId=v.shift(),t="/".concat(v.join("/")),this.projectUrl="".concat(u,"/").concat(this.projectId))}}else l.length>2&&(l[2].split(".").length>2||u.includes("localhost"))&&!m&&(this.projectUrl=u,this.projectId=l[2].split(".")[0]);this.projectsUrl=this.projectsUrl||"".concat(this.base,"/project")}if(d(["role"],this.projectUrl),/(^|\/)(form)($|\/)/.test(t))d(["form",["submission","action","v"]],this.projectUrl);else{var b=new RegExp("/(submission|action|v)($|/.*)"),w=t.match(b);this.pathType=w&&w.length>1?w[1]:"",t=(t=t.replace(b,"")).replace(/\/$/,""),this.formsUrl="".concat(this.projectUrl,"/form"),this.formUrl=t?this.projectUrl+t:"",this.formId=t.replace(/^\/+|\/+$/g,"");var k=["submission","action","v"];for(var O in k)if(k.hasOwnProperty(O)){var _=k[O];this["".concat(_,"sUrl")]="".concat(this.projectUrl+t,"/").concat(_),this.pathType===_&&w.length>2&&w[2]&&(this["".concat(_,"Id")]=w[2].replace(/^\/+|\/+$/g,""),this["".concat(_,"Url")]=this.projectUrl+t+w[0])}}e.projectUrlSet||(e.projectUrl=this.projectUrl)}var t,o,i;return t=e,o=[{key:"delete",value:function(t,n){var o="".concat(t,"Id"),i="".concat(t,"Url");return this[o]?(e.cache={},this.makeRequest(t,this[i],"delete",null,n)):r.default.reject("Nothing to delete")}},{key:"index",value:function(t,n,r){var o="".concat(t,"Url");return(n=n||"")&&x(n)&&(n="?".concat(e.serialize(n.params))),this.makeRequest(t,this[o]+n,"get",null,r)}},{key:"save",value:function(t,n,r){var o="".concat(t,"Id"),i="".concat(t,"Url"),a=this[o]||n._id?"put":"post",l=this[o]?this[i]:this["".concat(t,"sUrl")];return this[o]||!n._id||"put"!==a||l.includes(n._id)||(l+="/".concat(n._id)),e.cache={},this.makeRequest(t,l+this.query,a,n,r)}},{key:"load",value:function(t,n,o){var i="".concat(t,"Id"),a="".concat(t,"Url");if(n&&x(n)&&(n=e.serialize(n.params)),n=n?this.query?"".concat(this.query,"&").concat(n):"?".concat(n):this.query,!this[i])return r.default.reject("Missing ".concat(i));var l=this[a]+n;return"form"!==t||isNaN(parseInt(this.vId))||0===parseInt(this.vId)||(l+=l.match(/\?/)?"&":"?",l+="formRevision=".concat(this.vId)),this.makeRequest(t,l,"get",null,o)}},{key:"makeRequest",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r-1&&("read"===e.defaultPermission&&(a[i.read]=!0),"create"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0),"write"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0,a[i.update]=!0),"admin"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0,a[i.update]=!0,a[i.delete]=!0))}))}})),a}))}},{key:"canSubmit",value:function(){var t=this;return this.userPermissions().then((function(n){return!n.create&&e.getUser()?t.userPermissions(null).then((function(t){return!!t.create&&(e.setUser(null),!0)})):n.create}))}},{key:"getUrlParts",value:function(t){return e.getUrlParts(t,this)}}],i=[{key:"useSessionToken",value:function(t){var n="".concat(t.namespace||e.namespace||"formio","Token"),r=localStorage.getItem(n);r&&(localStorage.removeItem(n),sessionStorage.setItem(n,r));var o="".concat(t.namespace||e.namespace||"formio","User"),i=localStorage.getItem(o);i&&(localStorage.removeItem(o),sessionStorage.setItem(o,i)),localStorage.setItem("useSessionToken",!0)}},{key:"loadProjects",value:function(t,n){return x(t=t||"")&&(t="?".concat(e.serialize(t.params))),e.makeStaticRequest("".concat(e.baseUrl,"/project").concat(t),"GET",null,n)}},{key:"getUrlParts",value:function(t,n){var r=n&&n.base?n.base:e.baseUrl,o="^(http[s]?:\\/\\/)";return r&&0===t.indexOf(r)?o+="(".concat(r.replace(/^http[s]?:\/\//,""),")"):o+="([^/]+)",o+="($|\\/.*)",t.match(new RegExp(o))}},{key:"serialize",value:function(e,t){var n,r=[];for(var o in e)e.hasOwnProperty(o)&&r.push("".concat(encodeURIComponent(o),"=").concat(encodeURIComponent((n=e[o],t?t(n):n))));return r.join("&")}},{key:"getRequestArgs",value:function(e,t,n,r,o,i){r=(r||"GET").toUpperCase(),i&&x(i)||(i={});var a={url:n,method:r,data:o||null,opts:i};return t&&(a.type=t),e&&(a.formio=e),a}},{key:"makeStaticRequest",value:function(t,n,r,o){var i=e.getRequestArgs(null,"",t,n,r,o),a=e.pluginWait("preRequest",i).then((function(){return e.pluginGet("staticRequest",i).then((function(t){return j(t)?e.request(i.url,i.method,i.data,i.opts.header,i.opts):t}))}));return e.pluginAlter("wrapStaticRequestPromise",a,i)}},{key:"makeRequest",value:function(t,n,r,o,i,a){if(!t)return e.makeStaticRequest(r,o,i,a);var l=e.getRequestArgs(t,n,r,o,i,a);l.opts=l.opts||{},l.opts.formio=t,l.opts.headers||(l.opts.headers={}),l.opts.headers=(0,f.default)(l.opts.headers,{Accept:"application/json","Content-type":"application/json"});var s=e.pluginWait("preRequest",l).then((function(){return e.pluginGet("request",l).then((function(t){return j(t)?e.request(l.url,l.method,l.data,l.opts.header,l.opts):t}))}));return e.pluginAlter("wrapRequestPromise",s,l)}},{key:"request",value:function(t,n,o,i,a){if(!t)return r.default.reject("No url provided");var l=e;n=(n||"GET").toUpperCase(),O(a)===O(!0)&&(a={ignoreCache:a}),a&&x(a)||(a={});var s=btoa(encodeURI(t));if(!a.ignoreCache&&"GET"===n&&l.cache.hasOwnProperty(s))return r.default.resolve(E(l.cache[s]));var u=i||new P(a.headers||{Accept:"application/json","Content-type":"application/json"}),c=l.getToken(a);c&&!a.noToken&&u.append("x-jwt-token",c);var f={};u.forEach((function(e,t){f[t]=e}));var d={method:n,headers:f,mode:"cors"};o&&(d.body=JSON.stringify(o)),((d=l.pluginAlter("requestOptions",d,t)).namespace||l.namespace)&&(a.namespace=d.namespace||l.namespace);var p=d.headers["x-jwt-token"],h=l.pluginAlter("wrapFetchRequestPromise",l.fetch(t,d),{url:t,method:n,data:o,opts:a}).then((function(e){if(!(e=l.pluginAlter("requestResponse",e,l,o)).ok){if(440===e.status)l.setToken(null,a),l.events.emit("formio.sessionExpired",e.body);else if(401===e.status)l.events.emit("formio.unauthorized",e.body);else if(416===e.status)l.events.emit("formio.rangeIsNotSatisfiable",e.body);else if(504===e.status)return r.default.reject(new Error("Network request failed"));return(e.headers.get("content-type").includes("application/json")?e.json():e.text()).then((function(e){return r.default.reject(e)}))}var i=e.headers.get("x-jwt-token"),s=!1;return"GET"!==n||p||!i||a.external||t.includes("token=")||t.includes("x-jwt-token=")||(console.warn("Token was introduced in request."),s=!0),e.status>=200&&e.status<300&&i&&""!==i&&!s&&l.setToken(i,a),204===e.status?{}:(e.headers.get("content-type").includes("application/json")?e.json():e.text()).then((function(t){var n=e.headers.get("content-range");if(n&&x(t)){if("*"!==(n=n.split("/"))[0]){var r=n[0].split("-");t.skip=Number(r[0]),t.limit=r[1]-r[0]+1}t.serverCount="*"===n[1]?n[1]:Number(n[1])}if(!a.getHeaders)return t;var o={};return e.headers.forEach((function(e,t){o[t]=e})),{result:t,headers:o}}))})).then((function(e){return a.getHeaders?e:("GET"===n&&(l.cache[s]=e),E(e))})).catch((function(e){return"Bad Token"===e&&(l.setToken(null,a),l.events.emit("formio.badToken",e)),e.message&&((e=new Error("Could not connect to API server (".concat(e.message,"): ").concat(t))).networkError=!0),"GET"===n&&delete l.cache[s],r.default.reject(e)}));return h}},{key:"token",get:function(){return e.tokens||(e.tokens={}),e.tokens.formioToken||""},set:function(t){e.tokens||(e.tokens={}),e.tokens.formioToken=t||""}},{key:"setToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;t=t||"";var o="".concat((n="string"==typeof n?{namespace:n}:n||{}).namespace||e.namespace||"formio","Token");e.tokens||(e.tokens={});var i=localStorage.getItem("useSessionToken")?sessionStorage:localStorage;if(!t){n.fromUser||(n.fromToken=!0,e.setUser(null,n));try{i.removeItem(o)}catch(e){a.default.erase(o,{path:"/"})}return e.tokens[o]=t,r.default.resolve(null)}if(e.tokens[o]!==t){e.tokens[o]=t;try{i.setItem(o,t)}catch(e){a.default.set(o,t,{path:"/"})}}return this.currentUserResolved?e.currentUser(n.formio,n):r.default.resolve(null)}},{key:"getToken",value:function(t){var n="".concat((t="string"==typeof t?{namespace:t}:t||{}).namespace||e.namespace||"formio","Token"),r=t.decode?"".concat(n,"Decoded"):n;if(e.tokens||(e.tokens={}),e.tokens[r])return e.tokens[r];try{var o=localStorage.getItem("useSessionToken")?sessionStorage.getItem(n):localStorage.getItem(n);return e.tokens[n]=o||"",t.decode?(e.tokens[r]=e.tokens[n]?(0,p.default)(e.tokens[n]):{},e.tokens[r]):e.tokens[n]}catch(t){return e.tokens[n]=a.default.get(n),e.tokens[n]}}},{key:"oauthLogoutURI",value:function(t,n){var r="".concat((n="string"==typeof n?{namespace:n}:n||{}).namespace||e.namespace||"formio","LogoutAuthUrl");return e.tokens[r],localStorage.setItem(r,t),e.tokens[r]}},{key:"setUser",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="".concat(n.namespace||e.namespace||"formio","User"),o=localStorage.getItem("useSessionToken")?sessionStorage:localStorage;if(!t){n.fromToken||(n.fromUser=!0,e.setToken(null,n)),e.events.emit("formio.user",null);try{return o.removeItem(r)}catch(e){return a.default.erase(r,{path:"/"})}}try{o.setItem(r,JSON.stringify(t))}catch(e){a.default.set(r,JSON.stringify(t),{path:"/"})}e.events.emit("formio.user",t)}},{key:"getUser",value:function(t){var n="".concat((t=t||{}).namespace||e.namespace||"formio","User");try{return JSON.parse((localStorage.getItem("useSessionToken")?sessionStorage:localStorage).getItem(n)||null)}catch(e){return JSON.parse(a.default.get(n))}}},{key:"setBaseUrl",value:function(t){e.baseUrl=t,e.projectUrlSet||(e.projectUrl=t)}},{key:"getBaseUrl",value:function(){return e.baseUrl}},{key:"setApiUrl",value:function(t){return e.setBaseUrl(t)}},{key:"getApiUrl",value:function(){return e.getBaseUrl()}},{key:"setAppUrl",value:function(t){console.warn("Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead."),e.projectUrl=t,e.projectUrlSet=!0}},{key:"setProjectUrl",value:function(t){e.projectUrl=t,e.projectUrlSet=!0}},{key:"setAuthUrl",value:function(t){e.authUrl=t}},{key:"getAppUrl",value:function(){return console.warn("Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead."),e.projectUrl}},{key:"getProjectUrl",value:function(){return e.projectUrl}},{key:"clearCache",value:function(){e.cache={}}},{key:"noop",value:function(){}},{key:"identity",value:function(e){return e}},{key:"deregisterPlugin",value:function(t){var n=e.plugins.length;return e.plugins=e.plugins.filter((function(n){return n!==t&&n.__name!==t||((n.deregister||e.noop).call(t,e),!1)})),n!==e.plugins.length}},{key:"registerPlugin",value:function(t,n){var r=e;r.plugins.push(t),r.plugins.sort((function(e,t){return(t.priority||0)-(e.priority||0)})),t.__name=n,(t.init||r.noop).call(t,r)}},{key:"getPlugin",value:function(t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(e.plugins);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.__name===t)return o}}catch(e){r.e(e)}finally{r.f()}return null}},{key:"pluginWait",value:function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i2?r-2:0),i=2;i1&&(e[n[0]]=n[1]&&decodeURIComponent(n[1]))})),t.forEach((function(t){(n=t.split("=")).length>1?e[n[0]]=n[1]&&decodeURIComponent(n[1]):0===t.indexOf("/")&&(e.paths=t.substr(1).split("/"))})),e}},{key:"oAuthCurrentUser",value:function(t,n){return e.currentUser(t,{external:!0,headers:{Authorization:"Bearer ".concat(n)}})}},{key:"samlInit",value:function(t){t=t||{};var n=e.pageQuery();if(n.saml){e.setUser(null);var r=e.setToken(n.saml),o=window.location.toString();return o=o.substring(0,o.indexOf("?")),window.location.hash&&(o+=window.location.hash),window.history.replaceState({},document.title,o),r}t.relay||(t.relay=window.location.href);var i=e.authUrl||e.projectUrl;return window.location.href="".concat(i,"/saml/sso?relay=").concat(encodeURI(t.relay)),!1}},{key:"oktaInit",value:function(t){if(t=t||{},void 0!==("undefined"==typeof OktaAuth?"undefined":O(OktaAuth))&&(t.OktaAuth=OktaAuth),void 0===O(t.OktaAuth)){var n="Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.";return console.warn(n),r.default.reject(n)}return new r.default((function(n,r){var o=t.OktaAuth;delete t.OktaAuth;var i=new o(t);i.tokenManager.get("accessToken").then((function(o){o?n(e.oAuthCurrentUser(t.formio,o.accessToken)):location.hash?i.token.parseFromUrl().then((function(r){i.tokenManager.add("accessToken",r),n(e.oAuthCurrentUser(t.formio,r.accessToken))})).catch((function(e){console.warn(e),r(e)})):(i.token.getWithRedirect({responseType:"token",scopes:t.scopes}),n(!1))})).catch((function(e){r(e)}))}))}},{key:"ssoInit",value:function(t,n){switch(t){case"saml":return e.samlInit(n);case"okta":return e.oktaInit(n);default:return console.warn("Unknown SSO type"),r.default.reject("Unknown SSO type")}}},{key:"requireLibrary",value:function(t,n,o,i,a){if(!e.libraries.hasOwnProperty(t)){e.libraries[t]={},e.libraries[t].ready=new r.default((function(n,r){e.libraries[t].resolve=n,e.libraries[t].reject=r}));var l="".concat(t,"Callback");i||window[l]||(window[l]=function(){return e.libraries[t].resolve()});var s=(0,u.default)(window,n);if(s)e.libraries[t].resolve(s);else if((o=Array.isArray(o)?o:[o]).forEach((function(n){var r={},o="";switch("string"==typeof n&&(n={type:"script",src:n}),n.type){case"script":o="script",r={src:n.src,type:"text/javascript",defer:!0,async:!0,referrerpolicy:"origin"};break;case"styles":o="link",r={href:n.src,rel:"stylesheet"}}var i=document.createElement(o);if(i.setAttribute)for(var l in r)i.setAttribute(l,r[l]);a&&i.addEventListener("load",(function(){e.libraries[t].loaded=!0,a(e.libraries[t].ready)}));var s=document.head;s&&s.appendChild(i)})),i)var c=setInterval((function(){var r=(0,u.default)(window,n);r&&(clearInterval(c),e.libraries[t].resolve(r))}),200)}var f=e.libraries[t];return a&&f.loaded?a(f.ready):f.ready}},{key:"libraryReady",value:function(t){return e.libraries.hasOwnProperty(t)&&e.libraries[t].ready?e.libraries[t].ready:r.default.reject("".concat(t," library was not required."))}},{key:"addToGlobal",value:function(t){"object"!==O(t)||t.Formio||(t.Formio=e)}},{key:"setPathType",value:function(t){"string"==typeof t&&(e.pathType=t)}},{key:"getPathType",value:function(){return e.pathType}},{key:"rulesEntities",get:function(){return{ValueSources:e.ValueSources,Conjunctions:e.Conjunctions,Operators:e.Operators,Transformers:e.Transformers,QuickRules:e.QuickRules,Rules:e.Rules}}},{key:"GlobalFormio",get:function(){return void 0!==n.g&&n.g.Formio?n.g.Formio:"undefined"!=typeof window&&window.Formio?window.Formio:e}}],o&&w(t.prototype,o),i&&w(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();C=T,(A=k(A="currentUserResolved"))in C?Object.defineProperty(C,A,{value:true,enumerable:!0,configurable:!0,writable:!0}):C[A]=true,T.libraries={},T.Promise=r.default,T.fetch=S,T.Headers=P,T.baseUrl="https://api.form.io",T.projectUrl=T.baseUrl,T.authUrl="",T.projectUrlSet=!1,T.plugins=[],T.cache={},T.Providers=l.default,T.version="4.21.2",T.pathType="",T.events=new i.default,T.cdn=new h.default,(T.version||"").includes("rc")&&T.cdn.setBaseUrl("https://cdn.test-form.io"),void 0!==n.g&&T.addToGlobal(n.g),"undefined"!=typeof window&&T.addToGlobal(window);var M=T.GlobalFormio;t.GlobalFormio=M;var R=T;t.default=R},48254:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(41539),n(88674),n(69826),n(69600),n(68309),n(73210),n(68304),n(24812),n(30489);var o=s(n(91459)),i=n(19161),a=s(n(12215)),l=n(82531);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return this.postMessage({name:"getErrors"}),this.getSubmission().then((function(){return p(v(d.prototype),"submitForm",e).call(e,t)}))}},{key:"getSrc",value:function(){if(!this._form||!this._form.settings||!this._form.settings.pdf)return"";var e="".concat(this._form.settings.pdf.src,".html"),t=["id=".concat(this.id)];return(this.options.showCheckboxBackground||this._form.settings.showCheckboxBackground)&&t.push("checkboxbackground=1"),this.options.readOnly&&t.push("readonly=1"),this.options.zoom&&t.push("zoom=".concat(this.options.zoom)),this.builderMode&&t.push("builder=1"),t.length&&(e+="?".concat(t.join("&"))),e}},{key:"setForm",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p(v(d.prototype),"setForm",this).call(this,e,n).then((function(){t.formio&&(e.projectUrl=t.formio.projectUrl,e.url=t.formio.formUrl,e.base=t.formio.base,t.postMessage({name:"token",data:t.formio.getToken()})),t.postMessage({name:"form",data:t.form})}))}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(v(d.prototype),"setValue",this).call(this,e,n);return n&&n.fromIframe||this.once("iframe-ready",(function(){r&&t.postMessage({name:"submission",data:e})})),r}},{key:"postMessage",value:function(e){var t=this;this.iframeReady&&(e.type||(e.type="iframe-data"),this.iframeReady.then((function(){!t.iframeElement||!t.iframeElement.contentWindow||"form"===e.name&&t.iframeFormSetUp||(t.iframeElement.contentWindow.postMessage(JSON.stringify(e),"*"),t.iframeFormSetUp="form"===e.name)})))}},{key:"focusOnComponent",value:function(e){this.postMessage({name:"focusErroredField",data:e})}},{key:"clear",value:function(){}},{key:"showErrors",value:function(e,t){var n,r=document.getElementById("submit-error"),o=this.t("submitError"),i=(null===(n=this.refs.buttonMessage)||void 0===n?void 0:n.textContent.trim())===o;if(!r&&this.errors.length&&!i){var a=this.ce("p",{class:"help-block"});this.setContent(a,o),a.addEventListener("click",(function(){window.scrollTo(0,0)}));var l=this.ce("div",{id:"submit-error",class:"has-error"});this.appendTo(a,l),this.appendTo(l,this.element)}!this.errors.length&&r&&r.remove(),p(v(d.prototype),"showErrors",this).call(this,e,t)}},{key:"isSubmitButtonHidden",value:function(){var e=!1;return(0,l.eachComponent)(this.component.components,(function(t){"button"!==t.type||"submit"!==t.action&&t.action||(e=t.hidden||!1)})),e}}],n&&f(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(a.default);t.default=b,"undefined"!=typeof window&&window.addEventListener("message",(function(e){var t=null;try{t=JSON.parse(e.data)}catch(e){t=null}t&&t.name&&t.formId&&i.GlobalFormio.forms.hasOwnProperty(t.formId)&&i.GlobalFormio.forms[t.formId].emit("iframe-".concat(t.name),t.data)}))},6487:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(79753),n(32165),n(91038),n(47042),n(68309),n(74916),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(92222),n(66992),n(41539),n(78783),n(33948),n(60285),n(41637),n(26699),n(32023),n(24812),n(89554),n(54747),n(65743),n(68304),n(30489);var o=d(n(96486)),i=d(n(91459)),a=n(19161),l=d(n(95529)),s=n(82531),u=n(32725),c=d(n(1848)),f=d(n(48254));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n98?t.t("Converting PDF. Please wait."):"".concat(t.t("Uploading")," ").concat(n,"%")}}),"".concat(this.projectUrl,"/upload"),{},"file").then((function(e){var n,r=!1;if(null!==(n=e.data.formfields)&&void 0!==n&&n.components&&e.data.formfields.components.length){var i,a,l,s="submit"===(null===(i=t.webform.form.components[0])||void 0===i?void 0:i.key),u="page1"===(null===(a=t.webform.form.components[0])||void 0===a?void 0:a.key)&&0===(null===(l=t.webform.form.components[0])||void 0===l?void 0:l.components.length),c=0===t.webform.form.components.length;(s||u||c)&&(r=!0,t.webform.form.components=e.data.formfields.components)}t.refs.dragDropText&&(t.refs.dragDropText.style.display="inherit"),t.refs.uploadProgressWrapper&&(t.refs.uploadProgressWrapper.style.display="none"),o.default.set(t.webform.form,"settings.pdf",{id:e.data.file,src:e.data.filesServer?"".concat(e.data.filesServer).concat(e.data.path):"".concat(new URL(t.projectUrl).origin,"/pdf-proxy").concat(e.data.path),nonFillableConversionUsed:r&&e.data.formfields.nonFillableConversionUsed}),t.emit("pdfUploaded",e.data),t.redraw()})).catch((function(e){return t.setUploadError(e)}))}},{key:"setUploadError",value:function(e){this.refs.uploadError&&(this.refs.uploadError.style.display=e?"":"none",this.refs.uploadError.innerHTML=e)}},{key:"createForm",value:function(e){var t=this;return e.skipInit=!1,e.hideLoader=!0,this.webform=new f.default(this.element,e),this.webform.on("attach",(function(){t.refs.iframeDropzone&&!p(t.refs.form.children).includes(t.refs.iframeDropzone)&&t.prependTo(t.refs.iframeDropzone,t.refs.form)})),this.webform}},{key:"destroy",value:function(e){v(k(h.prototype),"destroy",this).call(this,e),this.webform.destroy(e)}},{key:"getParentContainer",value:function(e){var t=[],n=null;return(0,u.eachComponent)(this.webform._form.components,(function(r,o,i){if(r.id===e.component.id)return t=i,n=r,!0}),!0),{formioComponent:e.parent,formioContainer:t,originalComponent:n}}},{key:"initIframeEvents",value:function(){var e=this;this.webform.off("iframe-elementUpdate"),this.webform.off("iframe-componentUpdate"),this.webform.off("iframe-componentClick"),this.webform.on("iframe-elementUpdate",(function(t){var n=e.webform.getComponentById(t.id);return n&&n.component&&(n.component.overlay={page:t.page,left:t.left,top:t.top,height:t.height,width:t.width},e.options.noNewEdit||n.component.noNewEdit||e.editComponent(n.component,e.getParentContainer(n),!0),e.emit("updateComponent",n.component)),n})),this.webform.on("iframe-componentUpdate",(function(t){var n=e.webform.getComponentById(t.id);return n&&n.component&&(n.component.overlay={page:t.overlay.page,left:t.overlay.left,top:t.overlay.top,height:t.overlay.height,width:t.overlay.width},e.emit("updateComponent",n.component),e.emit("change",e.form)),n})),this.webform.on("iframe-componentClick",(function(t){var n=e.webform.getComponentById(t.id);n&&e.editComponent(n.component,e.getParentContainer(n))}),!0)}},{key:"initDropzoneEvents",value:function(){this.refs.iframeDropzone&&(this.removeEventListener(this.refs.iframeDropzone,"dragover"),this.removeEventListener(this.refs.iframeDropzone,"drop"),this.addEventListener(this.refs.iframeDropzone,"dragover",(function(e){return e.preventDefault(),!1})),this.addEventListener(this.refs.iframeDropzone,"drop",this.onDropzoneDrop.bind(this)))}},{key:"updateDragAndDrop",value:function(){this.pdfLoaded&&(this.initDropzoneEvents(),this.prepSidebarComponentsForDrag())}},{key:"prepSidebarComponentsForDrag",value:function(){var e=this;this.refs["sidebar-container"]&&this.refs["sidebar-container"].forEach((function(t){p(t.children).forEach((function(t){t.draggable=!0,t.setAttribute("draggable",!0),e.removeEventListener(t,"dragstart"),e.removeEventListener(t,"dragend"),e.addEventListener(t,"dragstart",e.onDragStart.bind(e),!0),e.addEventListener(t,"dragend",e.onDragEnd.bind(e),!0),e.addEventListener(t,"drag",(function(e){e.target.style.cursor="none"}))}))}))}},{key:"updateDropzoneDimensions",value:function(){if(this.refs.iframeDropzone){var e=(0,s.getElementRect)(this.webform.refs.iframeContainer);this.refs.iframeDropzone.style.height=e&&e.height?"".concat(e.height,"px"):"1000px",this.refs.iframeDropzone.style.width=e&&e.width?"".concat(e.width,"px"):"100%"}}},{key:"onDragStart",value:function(e){var t=e.offsetX,n=void 0===t?0:t,r=e.offsetY,o=void 0===r?0:r;this.itemOffsetX=n,this.itemOffsetY=o,e.dataTransfer.setData("text",""),this.updateDropzoneDimensions(),this.addClass(this.refs.iframeDropzone,"enabled"),this.dropEmitted=!1}},{key:"onDropzoneDrop",value:function(e){return this.dropEmitted=!0,this.dropEvent=e,e.preventDefault(),!1}},{key:"onDragEnd",value:function(e){var t=this.webform.refs.iframeContainer.getBoundingClientRect(),n=this.dropEvent?this.dropEvent.layerX:null,r=this.dropEvent?this.dropEvent.layerY:null;if(this.removeClass(this.refs.iframeDropzone,"enabled"),!this.dropEvent){if(!(!this.dropEmitted&&((0,s.getBrowserInfo)().chrome||(0,s.getBrowserInfo)().edge)&&"macOS"===globalThis.navigator.userAgentData.platform&&t.left2&&void 0!==arguments[2]&&arguments[2],o=r.default.assign((0,p.fastCloneDeep)(s.default.resources.en.translation),t);this.i18next.addResourceBundle(e,"translation",o,!0,!0),n&&(this.language=e)}},{key:"localize",value:function(){var e=this;return this.i18next.initialized?c.default.resolve(this.i18next):(this.i18next.initialized=!0,new c.default((function(t,n){try{e.i18next.init(b(b({},e.options.i18n),{compatibilityJSON:"v3"}),(function(r){if(e.options.language=e.i18next.language.split(";")[0],r)return n(r);t(e.i18next)}))}catch(e){return n(e)}})))}},{key:"keyboardCatchableElement",value:function(e){return"TEXTAREA"!==e.nodeName&&("INPUT"!==e.nodeName||-1===["text","email","password"].indexOf(e.type))}},{key:"addShortcut",value:function(e,t){if(t&&/^([A-Z]|Enter|Esc)$/i.test(t))if("Enter"===(t=r.default.capitalize(t))||"Esc"===t){if("BUTTON"!==e.tagName)return;this.shortcuts.push({shortcut:t,element:e})}else this.shortcuts.push({ctrl:!0,shortcut:t,element:e})}},{key:"removeShortcut",value:function(e,t){t&&/^([A-Z]|Enter|Esc)$/i.test(t)&&r.default.remove(this.shortcuts,{shortcut:t,element:e})}},{key:"src",get:function(){return this._src},set:function(e){this.setSrc(e)}},{key:"loadSubmission",value:function(){var e=this;return this.loadingSubmission=!0,this.formio.submissionId?this.onSubmission=this.formio.loadSubmission().then((function(t){return e.setSubmission(t)}),(function(t){return e.submissionReadyReject(t)})).catch((function(t){return e.submissionReadyReject(t)})):this.submissionReadyResolve(),this.submissionReady}},{key:"setSrc",value:function(e,t){var n=this;return this.setUrl(e,t)?(this.nosubmit=!1,this.formio.loadForm({params:{live:1}}).then((function(e){var t=n.setForm(e);return n.loadSubmission(),t})).catch((function(e){console.warn(e),n.formReadyReject(e)}))):c.default.resolve()}},{key:"url",get:function(){return this._src},set:function(e){this.setUrl(e)}},{key:"setUrl",value:function(e,t){return!(!e||"string"!=typeof e||e===this._src||(this._src=e,this.nosubmit=!0,this.formio=this.options.formio=new u.GlobalFormio(e,t),"form"===this.type&&(this.options.src=e),0))}},{key:"ready",get:function(){var e=this;return this.formReady.then((function(){return k(j(d.prototype),"ready",e).then((function(){return!e.loadingSubmission||e.submissionReady}))}))}},{key:"loading",get:function(){return this._loading},set:function(e){if(this._loading!==e){if(this._loading=e,!this.loader&&e){this.loader=this.ce("div",{class:"loader-wrapper"});var t=this.ce("div",{class:"loader text-center"});this.loader.appendChild(t)}if(this.loader)try{e?this.prependTo(this.loader,this.wrapper):this.removeChildFrom(this.loader,this.wrapper)}catch(e){}}}},{key:"setForm",value:function(e,t){var n,o=this,a=this._form&&(null===(n=this._form.components)||void 0===n?void 0:n.length);try{var l,s;if(a&&JSON.stringify(this._form)===JSON.stringify(e))return c.default.resolve();if(this._form=null!=t&&t.keepAsReference?e:r.default.cloneDeep(e),this.onSetForm&&this.onSetForm(r.default.cloneDeep(this._form),e),null!==(l=this.parent)&&void 0!==l&&null!==(s=l.component)&&void 0!==s&&s.modalEdit)return c.default.resolve()}catch(e){return console.warn(e),c.default.resolve()}if(e&&e.settings&&e.settings.components&&(this.options.components=e.settings.components),e&&e.properties&&(this.options.properties=e.properties),this.options.sanitizeConfig||this.builderMode||(this.options.sanitizeConfig=r.default.get(e,"settings.sanitizeConfig")||r.default.get(e,"globalSettings.sanitizeConfig")),"schema"in e&&(0,i.default)(e.schema,"1.x")>0&&this.ready.then((function(){o.setAlert("alert alert-danger","Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.")})),e&&e.module){var f=null;if("string"==typeof e.module)try{f=this.evaluate("return ".concat(e.module))}catch(e){console.warn(e)}else f=e.module;f&&(u.GlobalFormio.use(f),f.options&&f.options.form&&(this.options=Object.assign(this.options,f.options.form)))}return this.initialized=!1,(this.rebuild()||c.default.resolve()).then((function(){return o.emit("formLoad",e),o.triggerCaptcha(),setTimeout((function(){o.onChange(t),o.formReadyResolve()}),0),o.formReady}))}},{key:"form",get:function(){return this._form||(this._form={components:[]}),this._form},set:function(e){this.setForm(e)}},{key:"submission",get:function(){return this.getValue()},set:function(e){this.setSubmission(e)}},{key:"setSubmission",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=b(b({},n),{},{fromSubmission:!r.default.has(n,"fromSubmission")||n.fromSubmission}),this.onSubmission=this.formReady.then((function(r){return r&&(n=b(b({},n),r)),t.submissionSet=!0,t.triggerChange(n),t.emit("beforeSetSubmission",e),t.setValue(e,n),t.submissionReadyResolve(e)}),(function(e){return t.submissionReadyReject(e)})).catch((function(e){return t.submissionReadyReject(e)}))}},{key:"handleDraftError",value:function(e,t,n){var o=r.default.trim("".concat(this.t(e)," ").concat(t||""));console.warn(o),this.emit(n?"restoreDraftError":"saveDraftError",t||o)}},{key:"saveDraft",value:function(){var e=this;if(this.draftEnabled)if(this.formio)if(u.GlobalFormio.getUser()){var t=(0,p.fastCloneDeep)(this.submission);t.state="draft",this.savingDraft||this.submitting||(this.emit("saveDraftBegin"),this.savingDraft=!0,this.formio.saveSubmission(t).then((function(t){e.submission._id=t._id,e.savingDraft=!1,e.emit("saveDraft",t)})).catch((function(t){e.savingDraft=!1,e.handleDraftError("saveDraftError",t)})))}else this.handleDraftError("saveDraftAuthError");else this.handleDraftError("saveDraftInstanceError")}},{key:"restoreDraft",value:function(e){var t=this,n=this.formio||this.options.formio;n?(this.savingDraft=!0,n.loadSubmissions({params:{state:"draft",owner:e}}).then((function(e){if(e.length>0&&!t.options.skipDraftRestore){var n=(0,p.fastCloneDeep)(e[0]);return t.setSubmission(n).then((function(){t.draftEnabled=!0,t.savingDraft=!1,t.emit("restoreDraft",n)}))}t.draftEnabled=!0,t.savingDraft=!1,t.emit("restoreDraft",null)})).catch((function(e){t.draftEnabled=!0,t.savingDraft=!1,t.handleDraftError("restoreDraftError",e,!0)}))):this.handleDraftError("restoreDraftInstanceError",null,!0)}},{key:"schema",get:function(){var e=(0,p.fastCloneDeep)(r.default.omit(this._form,["components"]));return e.components=[],this.eachComponent((function(t){return e.components.push(t.schema)})),e}},{key:"mergeData",value:function(e,t){r.default.mergeWith(e,t,(function(e,t){if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return t}))}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&e.data||(e={data:{}}),this._submission.metadata=e.metadata||{},this.editing=!!e._id,!this.options.submissionTimezone&&e.metadata&&e.metadata.timezone&&(this.options.submissionTimezone=e.metadata.timezone);var n=k(j(d.prototype),"setValue",this).call(this,e.data,t);return t.sanitize||this.mergeData(this.data,e.data),e.data=this.data,this._submission=e,n}},{key:"getValue",value:function(){return this._submission.data||(this._submission.data={}),this.viewOnly||(this._submission.data=this.data),this._submission}},{key:"init",value:function(){var e=this;return this._submission=this._submission||{data:{}},this.components&&this.components.length&&(this.destroyComponents(),this.components=[]),this.component?this.component.components=this.form?this.form.components:[]:this.component=this.form,this.component.type="form",this.component.input=!1,this.addComponents(),this.on("submitButton",(function(t){e.submit(!1,t).catch((function(e){return!1!==e&&console.log(e)}))}),!0),this.on("checkValidity",(function(t){return e.checkValidity(t,!0,t)}),!0),this.on("requestUrl",(function(t){return e.submitUrl(t.url,t.headers)}),!0),this.on("resetForm",(function(){return e.resetValue()}),!0),this.on("deleteSubmission",(function(){return e.deleteSubmission()}),!0),this.on("refreshData",(function(){return e.updateValue()}),!0),this.executeFormController(),this.formReady}},{key:"executeFormController",value:function(){var e=this;if(!this.form||!this.form.controller||(!this.visible||this.component.hidden)&&this.component.clearOnHide&&!this.rootPristine)return!1;this.formReady.then((function(){e.evaluate(e.form.controller,{components:e.components,instance:e})}))}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.off("submitButton"),this.off("checkValidity"),this.off("requestUrl"),this.off("resetForm"),this.off("deleteSubmission"),this.off("refreshData"),e&&(this.emit("formDelete",this.id),delete u.GlobalFormio.forms[this.id]),k(j(d.prototype),"destroy",this).call(this)}},{key:"build",value:function(e){var t=this;return e||this.element?this.ready.then((function(){e=e||t.element,k(j(d.prototype),"build",t).call(t,e)})):this.ready}},{key:"getClassName",value:function(){var e="formio-form";return this.options.readOnly&&(e+=" formio-read-only"),e}},{key:"render",value:function(){return k(j(d.prototype),"render",this).call(this,this.renderTemplate("webform",{classes:this.getClassName(),children:this.renderComponents()}),this.builderMode?"builder":"form",!0)}},{key:"redraw",value:function(){return this.element?(this.clear(),this.setContent(this.element,this.render()),this.attach(this.element)):c.default.resolve()}},{key:"attach",value:function(e){var t=this;this.element=e,this.loadRefs(e,{webform:"single"});var n=this.attachComponents(this.refs.webform);return this.addEventListener(document,"keydown",this.executeShortcuts),this.currentForm=this,this.hook("attachWebform",e,this),n.then((function(){return t.emit("render",t.element),t.setValue(t._submission,{noUpdateEvent:!0})}))}},{key:"hasRequiredFields",value:function(){var e=!1;return(0,h.eachComponent)(this.form.components,(function(t){if(t.validate.required)return e=!0,!0}),!0),e}},{key:"resetValue",value:function(){r.default.each(this.getComponents(),(function(e){return e.resetValue()})),this.setPristine(!0),this.onChange({resetValue:!0})}},{key:"setAlert",value:function(e,t,n){var r=this;if(e||!this.submitted)if(this.options.noAlerts)t||this.emit("error",!1);else{if(this.alert)try{this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.removeEventListener(e,"click"),r.removeEventListener(e,"keypress")})),this.removeChild(this.alert),this.alert=null}catch(e){}if(t){var o={class:n&&n.classes||"alert alert-".concat(e),id:"error-list-".concat(this.id)},i={message:t instanceof HTMLElement?t.outerHTML:t,attrs:o,type:e};this.alert=(0,p.convertStringToHTMLElement)(this.renderTemplate("alert",i),"#".concat(o.id))}this.alert&&(this.loadRefs(this.alert,{errorRef:"multiple"}),this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.addEventListener(e,"click",(function(e){var t=e.currentTarget.dataset.componentKey;r.focusOnComponent(t)})),r.addEventListener(e,"keydown",(function(e){if(13===e.keyCode){e.preventDefault();var t=e.currentTarget.dataset.componentKey;r.focusOnComponent(t)}}))})),this.prepend(this.alert))}else this.alert&&(this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.removeEventListener(e,"click"),r.removeEventListener(e,"keypress")})),this.removeChild(this.alert),this.alert=null)}},{key:"focusOnComponent",value:function(e){if(e){var t=this.getComponent(e);t&&t.focus()}}},{key:"showErrors",value:function(e,t,n){var o=this;this.loading=!1;var i=this.errors;if(e?Array.isArray(e)?i=i.concat(e):i.push(e):i=k(j(d.prototype),"errors",this),(i=i.concat(this.customErrors)).length){i.forEach((function(e){var t=e.components,n=void 0===t?[]:t;e.component&&n.push(e.component),e.path&&n.push(e.path),n.forEach((function(t){var n=o._parentPath+(0,p.getStringFromComponentPath)(t),i=o.getComponent(t,r.default.identity,n);e.fromServer&&(i.serverErrors?i.serverErrors.push(e):i.serverErrors=[e]),r.default.compact(Array.isArray(i)?i:[i]).forEach((function(t){return t.setCustomValidity(e.message,!0)}))}))}));var a=[];i.forEach((function(e){if(e){var t=function(t,n){var i=!r.default.isUndefined(n)&&e.messages&&e.messages[n],a=i&&i.formattedKeyOrPath||i.path||e.component&&e.component.key||e.fromServer&&e.path,l=a?(0,p.getStringFromComponentPath)(a):"";return l=o._parentPath+l,"string"==typeof e||e.formattedKeyOrPath||(e.formattedKeyOrPath=l),{message:(0,p.unescapeHTML)(t),keyOrPath:l}};if(e.messages=r.default.uniqBy(e.messages,(function(e){return e.message})),e.messages&&e.messages.length){var n=e.component;e.messages.forEach((function(e,r){var i=e.message,l=e.context,s=e.fromServer,u=null!=l&&l.hasLabel||s?o.t("alertMessage",{message:o.t(i)}):o.t("alertMessageWithLabel",{label:o.t(n.label),message:o.t(i)});a.push(t(u,r))}))}else if(e){var i=r.default.isObject(e)?o.t("alertMessage",{message:o.t(e.message||"")}):o.t("alertMessage",{message:o.t(e)});a.push(t(i))}}}));var l=this.renderTemplate("errorsList",{errors:a});return this.root.setAlert("danger",l),t&&this.emit("error",i),i}this.setAlert(!1)}},{key:"onSubmit",value:function(e,t){var n;return this.loading=!1,this.submitting=!1,this.setPristine(!0),this.setValue((0,p.fastCloneDeep)(e),{noValidate:!0,noCheck:!0}),this.setAlert("success","

".concat(this.t("complete"),"

")),this.draftEnabled&&null!==(n=this.triggerSaveDraft)&&void 0!==n&&n.cancel&&this.triggerSaveDraft.cancel(),this.emit("submit",e,t),t&&this.emit("submitDone",e),e}},{key:"normalizeError",value:function(e){return e&&("object"===y(e)&&"details"in e&&(e=e.details),"string"==typeof e&&(e={message:e})),e}},{key:"onSubmissionError",value:function(e){if(e=this.normalizeError(e),this.submitting=!1,this.setPristine(!1),this.emit("submitError",e||this.errors),e&&e.silent)return this.emit("change",{isValid:!0},{silent:!0}),!1;var t=this.showErrors(e,!0);return this.root&&this.root.alert&&this.scrollIntoView(this.root.alert),t}},{key:"onChange",value:function(e,t,n,o){e=e||{};var i=!1;t&&t.component&&(this.customErrors=this.customErrors.filter((function(e){return e.component&&e.component!==t.component.key}))),k(j(d.prototype),"onChange",this).call(this,e,!0);var a=r.default.clone(this.submission);if(e.changed=a.changed=t,e.changes=o,n&&this.pristine&&(this.pristine=!1),a.isValid=this.checkData(a.data,e),this.loading=!1,this.submitted){var l=r.default.filter(this.serverErrors||[],(function(e){return!e.component&&!e.path}));this.showErrors(l.length?l:null)}n&&this.options.saveDraft&&this.triggerSaveDraft(),e&&e.noEmit||(this.emit("change",a,e,n),i=!0),i&&!this.initialized&&(this.emit("initialized"),this.initialized=!0)}},{key:"checkData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=k(j(d.prototype),"checkData",this).call(this,e,t);return(r.default.isEmpty(t)||t.noValidate)&&this.submitted&&this.showErrors(),n}},{key:"deleteSubmission",value:function(){var e=this;return this.formio.deleteSubmission().then((function(){e.emit("submissionDeleted",e.submission),e.resetValue()}))}},{key:"cancel",value:function(e){return this.hook("beforeCancel",!0)&&(e||confirm(this.t("confirmCancel")))?(this.resetValue(),!0):(this.emit("cancelSubmit"),!1)}},{key:"setMetadata",value:function(e){e.metadata=e.metadata||{},r.default.defaults(e.metadata,{timezone:r.default.get(this,"_submission.metadata.timezone",(0,p.currentTimezone)()),offset:parseInt(r.default.get(this,"_submission.metadata.offset",(0,o.default)().utcOffset()),10),origin:document.location.origin,referrer:document.referrer,browserName:navigator.appName,userAgent:navigator.userAgent,pathName:window.location.pathname,onLine:navigator.onLine})}},{key:"submitForm",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.clearServerErrors(),new c.default((function(n,o){if(e.options.readOnly)return n({submission:e.submission,saved:!1});var i=(0,p.fastCloneDeep)(e.submission||{});e.setMetadata(i),i.state=t.state||"submitted";var a="draft"===i.state;e.hook("beforeSubmit",b(b({},i),{},{component:t.component}),(function(l,s){return l?o(l):(i._vnote=s&&s._vnote?s._vnote:"",a||i.data?a||e.checkValidity(i.data,!0)?(e.everyComponent((function(e){i._vnote&&"form"===e.type&&e.component.reference&&(r.default.get(i.data,e.path,{})._vnote=i._vnote),"client-only"===e.component.persistent&&r.default.unset(i.data,e.path)})),void e.hook("customValidation",b(b({},i),{},{component:t.component}),(function(t){if(t)return"string"==typeof t&&(t={message:t}),t=Array.isArray(t)?t:[t],e.customErrors=t,o();if(e.loading=!0,e._form&&e._form.action){var r=i.data._id&&e._form.action.includes(i.data._id)?"PUT":"POST";return u.GlobalFormio.makeStaticRequest(e._form.action,r,i,e.formio?e.formio.options:{}).then((function(e){return n({submission:e,saved:!0})})).catch((function(t){return e.setServerErrors(t),o(t)}))}var a=e.formio;if(e.nosubmit||!a)return n({submission:i,saved:!1});a[a.actionUrl?"saveAction":"saveSubmission"](i).then((function(e){return n({submission:e,saved:!0})})).catch((function(t){return e.setServerErrors(t),o(t)}))}))):o():o("Invalid Submission"))}))}))}},{key:"setServerErrors",value:function(e){e.details?this.serverErrors=e.details.filter((function(e){return e.level?"error"===e.level:e})).map((function(e){return e.fromServer=!0,e})):"string"==typeof e&&(this.serverErrors=[{fromServer:!0,level:"error",message:e}])}},{key:"executeSubmit",value:function(e){var t=this;return this.submitted=!0,this.submitting=!0,this.submitForm(e).then((function(e){var n=e.submission,r=e.saved;return t.onSubmit(n,r)})).then((function(e){return t.submissionInProcess=!1,e})).catch((function(e){return t.submissionInProcess=!1,c.default.reject(t.onSubmissionError(e))}))}},{key:"clearServerErrors",value:function(){var e,t=this;null===(e=this.serverErrors)||void 0===e||e.forEach((function(e){if(e.path){var n=(0,p.getArrayFromComponentPath)(e.path),o=t.getComponent(n,r.default.identity,e.formattedKeyOrPath);o&&(o.serverErrors=[])}})),this.serverErrors=[]}},{key:"submit",value:function(e,t){var n=this;return this.submissionInProcess=!0,e?this.executeSubmit(t):this.beforeSubmit(t).then((function(){return n.executeSubmit(t)}))}},{key:"submitUrl",value:function(e,t){var n=this;if(!e)return console.warn("Missing URL argument");var r=this.submission||{},o=e,i={method:"POST",headers:{}};if(t&&t.length>0&&t.map((function(e){""!==e.header&&""!==e.value&&(i.headers[e.header]=n.interpolate(e.value,r))})),!o||!i)return this.emit("error","You should add a URL to this button."),this.setAlert("warning","You should add a URL to this button."),console.warn("You should add a URL to this button.");u.GlobalFormio.makeStaticRequest(o,i.method,r,{headers:i.headers}).then((function(){n.emit("requestDone"),n.setAlert("success","

Success

")})).catch((function(e){n.showErrors("".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),n.emit("error","".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),console.error("".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),n.setAlert("danger","

".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e,"

"))}))}},{key:"triggerCaptcha",value:function(){if(this&&this.components){var e=[];(0,h.eachComponent)(this.components,(function(t){/^(re)?captcha$/.test(t.type)&&"formLoad"===t.component.eventType&&e.push(t)})),e.length>0&&e[0].verify("".concat(this.form.name?this.form.name:"form","Load"))}}},{key:"nosubmit",get:function(){return this._nosubmit||!1},set:function(e){this._nosubmit=!!e,this.emit("nosubmit",this._nosubmit)}},{key:"conditions",get:function(){var e,t;return null!==(e=null===(t=this.schema.settings)||void 0===t?void 0:t.conditions)&&void 0!==e?e:[]}},{key:"variables",get:function(){var e,t;return null!==(e=null===(t=this.schema.settings)||void 0===t?void 0:t.variables)&&void 0!==e?e:[]}}],n&&w(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(d.default);t.default=A,A.setBaseUrl=u.GlobalFormio.setBaseUrl,A.setApiUrl=u.GlobalFormio.setApiUrl,A.setAppUrl=u.GlobalFormio.setAppUrl},95529:function(e,t,n){"use strict";n(69070),n(68304),n(30489),n(12419),n(78011),n(74819),n(38880),n(49337),n(33321),n(32165),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(2707),n(57327),n(41539),n(74916),n(15306),n(26699),n(32023),n(68309),n(24812),n(47941),n(82772),n(79753),n(92222),n(89554),n(54747),n(47042),n(4723),n(69600),n(91038),n(78783),n(69826),n(34553),n(5212),n(40561),n(66992),n(51532),n(33948),n(23157),n(92087),n(96649),n(96078),n(82526),n(41817),n(9653);var r=h(n(12215)),o=h(n(64430)),i=h(n(31051)),a=h(n(91459)),l=h(n(39086)),s=n(19161),u=n(82531),c=n(32725),f=h(n(1848)),d=h(n(96486)),p=h(n(2201));function h(e){return e&&e.__esModule?e:{default:e}}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0||o.noDragDrop?t:((!r||!r.length&&!r.nodrop||"form"===o.type&&r.length<=1&&(0===r.length||"button"===r[0].type))&&(t=e.renderTemplate("builderPlaceholder",{position:0})+t),e.renderTemplate("builderComponents",{key:o.key,type:o.type,html:t}))},e.options.hooks.renderInput=function(e,t){var n=t.self;return"hidden"===n.type?e+n.name:e},e.options.hooks.renderLoading=function(e,t){var n=t.self;return"form"===n.type&&n.key?n.name:e},e.options.hooks.attachComponents=function(t,n,r,o){if(t){if(o.noDragDrop)return t;var i=t.querySelector('[ref="'.concat(o.component.key,'-container"]'))||t;return i.formioContainer=r,i.formioComponent=o,e.dragula&&e.allowDrop(t)&&e.dragula.containers.push(i),("datagrid"===o.type||"datamap"===o.type)&&n.length>0?t:t.children[0]}},e.options.hooks.attachDatagrid=function(e,t){t.loadRefs(e,E({},"".concat(t.key,"-container"),"single"));var n=t.refs["".concat(t.key,"-container")];n&&t.attachComponents(n.parentNode,[],t.component.components)},e.options.hooks.attachComponent=e.attachComponent.bind(j(e));var b={params:{type:"resource",limit:1e6,select:"_id,title,name,components"}};e.options&&e.options.resourceTag?b.params.tags=[e.options.resourceTag]:e.options&&e.options.hasOwnProperty("resourceTag")||(b.params.tags=["builder"]);var g=new s.GlobalFormio(s.GlobalFormio.projectUrl),k=e.options.builder&&!1===e.options.builder.resource;if(g.loadProject().then((function(t){if(t&&(d.default.get(t,"settings.addConfigToForms",!1)||d.default.get(t,"addConfigToForms",!1))){var n=t.config||{};e.options.formConfig=n;var r="webform._form.config",o=d.default.get(j(e),r);e.webform&&!o&&d.default.set(j(e),r,n)}})).catch((function(e){console.warn("Could not load project settings: ".concat(e.message||e))})),!g.noProject&&!k){var O=e.options.builder&&e.options.builder.resource;g.loadForms(b).then((function(t){t.length&&(e.builder.resource={title:O?O.title:"Existing Resource Fields",key:"resource",weight:O?O.weight:50,subgroups:[],components:[],componentOrder:[]},e.groups.resource={title:O?O.title:"Existing Resource Fields",key:"resource",weight:O?O.weight:50,subgroups:[],components:[],componentOrder:[]},e.groupOrder.includes("resource")||e.groupOrder.push("resource"),e.addExistingResourceFields(t))}))}return e.options.attachMode="builder",e.webform=e.webform||e.createForm(e.options),e.pathComponentsMapping={},e.arrayDataComponentPaths=[],e.nestedDataComponents=[],e.arrayDataComponents=[],e}return t=v,n=[{key:"allowDrop",value:function(){return!0}},{key:"addExistingResourceFields",value:function(e){var t=this;d.default.each(e,(function(e,n){var r="resource-".concat(e.name),o={key:r,title:e.title,components:[],componentOrder:[],default:0===n};(0,c.eachComponent)(e.components,(function(n){if("button"!==n.type&&(!t.options||!t.options.resourceFilter||n.tags&&-1!==n.tags.indexOf(t.options.resourceFilter))){var i=n.label;!i&&n.key&&(i=d.default.upperFirst(n.key)),o.componentOrder.push("component-".concat(n.key)),o.components["component-".concat(n.key)]=d.default.merge((0,u.fastCloneDeep)(l.default.components[n.type]?l.default.components[n.type].builderInfo:l.default.components.unknown.builderInfo),{key:n.key,title:i,group:"resource",subgroup:r},{schema:g(g({},n),{},{label:n.label,key:n.key,lockKey:!0,source:t.options.noSource?void 0:e._id,isNew:!0})})}}),!0),t.groups.resource.subgroups.push(o)})),this.triggerRedraw()}},{key:"attachTooltip",value:function(e,t){return(0,i.default)(e,{allowHTML:!0,trigger:"mouseenter focus",placement:"top",delay:[200,0],zIndex:1e4,content:t})}},{key:"attachComponent",value:function(e,t){var n=this;if(!(t instanceof v)){if(e.formioComponent=t,t.loadRefs(e,{removeComponent:"single",editComponent:"single",moveComponent:"single",copyComponent:"single",pasteComponent:"single",editJson:"single"}),t.refs.copyComponent&&(this.attachTooltip(t.refs.copyComponent,this.t("Copy")),t.addEventListener(t.refs.copyComponent,"click",(function(){return n.copyComponent(t)}))),t.refs.pasteComponent){var r=this.attachTooltip(t.refs.pasteComponent,this.t("Paste below"));t.addEventListener(t.refs.pasteComponent,"click",(function(){r.hide(),n.pasteComponent(t)}))}t.refs.moveComponent&&(this.attachTooltip(t.refs.moveComponent,this.t("Move")),this.keyboardActionsEnabled&&t.addEventListener(t.refs.moveComponent,"click",(function(){n.moveComponent(t)})));var o=this.getParentElement(e);return t.refs.editComponent&&(this.attachTooltip(t.refs.editComponent,this.t("Edit")),t.addEventListener(t.refs.editComponent,"click",(function(){return n.editComponent(t.schema,o,!1,!1,t.component,{inDataGrid:t.isInDataGrid})}))),t.refs.editJson&&(this.attachTooltip(t.refs.editJson,this.t("Edit JSON")),t.addEventListener(t.refs.editJson,"click",(function(){return n.editComponent(t.schema,o,!1,!0,t.component)}))),t.refs.removeComponent&&(this.attachTooltip(t.refs.removeComponent,this.t("Remove")),t.addEventListener(t.refs.removeComponent,"click",(function(){return n.removeComponent(t.schema,o,t.component,t)}))),e}}},{key:"createForm",value:function(e){return this.webform=new r.default(this.element,e),this.element&&(this.loadRefs(this.element,{form:"single"}),this.refs.form&&(this.webform.element=this.refs.form)),this.webform}},{key:"ready",get:function(){return this.webform.ready}},{key:"defaultGroups",get:function(){return{basic:{title:"Basic",weight:0,default:!0},advanced:{title:"Advanced",weight:10},layout:{title:"Layout",weight:20},data:{title:"Data",weight:30},premium:{title:"Premium",weight:40}}}},{key:"redraw",value:function(){return r.default.prototype.redraw.call(this)}},{key:"form",get:function(){return this.webform.form},set:function(e){this.setForm(e)}},{key:"schema",get:function(){return this.webform.schema}},{key:"container",get:function(){return this.webform.form.components}},{key:"findNamespaceRoot",value:function(e){var t=(0,u.getArrayFromComponentPath)(e.path),n=this.webform.getComponent(t);n=Array.isArray(n)?n[0]:n;var r=this.recurseNamespace(n);if(!r||this.form.key===r)return this.form.components;var o=e.component;if(r===e.key)return[].concat(y(o.components),[o]);var i=(0,c.getComponent)(this.form.components,r,!0);return i?i.components:n.components}},{key:"recurseNamespace",value:function(e){return e?["address","container","datagrid","editgrid","dynamicWizard","tree"].includes(e.type)||e.tree||e.arrayTree?e.key:this.recurseNamespace(e.parent):null}},{key:"render",value:function(){var e=this;return this.renderTemplate("builder",{sidebar:this.renderTemplate("builderSidebar",{scrollEnabled:this.sideBarScroll,groupOrder:this.groupOrder,groupId:"builder-sidebar-".concat(this.id),groups:this.groupOrder.map((function(t){return e.renderTemplate("builderSidebarGroup",{group:e.groups[t],groupKey:t,groupId:"builder-sidebar-".concat(e.id),subgroups:e.groups[t].subgroups.map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})})),keyboardActionsEnabled:e.keyboardActionsEnabled})}))}),form:this.webform.render()})}},{key:"attach",value:function(e){var t=this;return this.on("change",(function(e){t.populateCaptchaSettings(e),t.webform.setAlert(!1)})),O(x(v.prototype),"attach",this).call(this,e).then((function(){t.loadRefs(e,{form:"single",sidebar:"single","sidebar-search":"single","sidebar-groups":"single",container:"multiple","sidebar-anchor":"multiple","sidebar-group":"multiple","sidebar-container":"multiple","sidebar-component":"multiple"}),t.sideBarScroll&&T.current.handleBuilderSidebarScroll&&T.current.handleBuilderSidebarScroll.call(t,t),"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.getItem("formio.clipboard")&&t.addClass(t.refs.form,"builder-paste-mode"),(0,u.bootstrapVersion)(t.options)||(t.refs["sidebar-group"].forEach((function(e){e.style.display="true"===e.getAttribute("data-default")?"inherit":"none"})),t.refs["sidebar-anchor"].forEach((function(e,n){t.addEventListener(e,"click",(function(){var r=e.getAttribute("data-parent").slice("#builder-sidebar-".length),o=e.getAttribute("data-target").slice("#group-".length);t.refs["sidebar-group"].forEach((function(e,t){var i="true"===e.getAttribute("data-default"),a=e.getAttribute("id").slice("group-".length),l=e.getAttribute("data-parent").slice("#builder-sidebar-".length);e.style.display=i&&l===o||a===r||t===n?"inherit":"none"}))}),!0)}))),t.keyboardActionsEnabled&&t.refs["sidebar-component"].forEach((function(e){t.addEventListener(e,"keydown",(function(n){13===n.keyCode&&t.addNewComponent(e)}))})),t.addEventListener(t.refs["sidebar-search"],"input",d.default.debounce((function(e){var n=e.target.value;t.searchFields(n)}),300)),t.dragDropEnabled&&t.initDragula();var n=t.dragula;if(t.refs.form)return(0,p.default)([window],{margin:20,maxSpeed:6,scrollWhenOutside:!0,autoScroll:function(){return this.down&&(null==n?void 0:n.dragging)}}),t.webform.attach(t.refs.form)}))}},{key:"searchFields",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.toLowerCase(),r=this.refs.sidebar,o=this.refs["sidebar-groups"];if(r&&o){var i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=d.default.toPlainObject(t),o=r.subgroups,i=void 0===o?[]:o,a=r.components,l=[];for(var s in a){var u=a[s].title.toLowerCase().match(n),c=a[s].key.toLowerCase().match(n);(u||c)&&l.push(a[s])}return e.orderComponents(r,l),n&&(r.default=!0),r.componentOrder.length||i.length?r:null},a=function(t,n){return d.default.cloneDeep(t).filter((function(t){return i(e.groups[t],n)}))},l=function(e,t){return d.default.clone(e).map((function(e){return i(e,t)})).filter((function(e){return!d.default.isNull(e)}))},s=function(t){return{group:i(e.groups[t],n),groupKey:t,groupId:r.id||o.id,subgroups:l(e.groups[t].subgroups,n).map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})}))}};o.innerHTML=a(this.groupOrder,n).map((function(t){return e.renderTemplate("builderSidebarGroup",s(t))})).join(""),this.loadRefs(this.element,{"sidebar-groups":"single","sidebar-anchor":"multiple","sidebar-group":"multiple","sidebar-container":"multiple"}),this.updateDragAndDrop(),""===n&&this.triggerRedraw()}}},{key:"orderComponents",value:function(e,t){var n=t||e.components,r=0===e.key.indexOf("resource-");n&&(e.componentOrder=Object.keys(n).map((function(e){return n[e]})).filter((function(e){return e&&!e.ignore&&!e.ignoreForForm})).sort((function(e,t){return e.weight-t.weight})).map((function(e){return r?"component-".concat(e.key):e.key})))}},{key:"updateDragAndDrop",value:function(){if(this.dragDropEnabled&&this.initDragula(),this.refs.form)return this.webform.attach(this.refs.form)}},{key:"initDragula",value:function(){var e=this,t=this.options;this.dragula&&this.dragula.destroy();var n=Array.prototype.slice.call(this.refs["sidebar-container"]).filter((function(e){return"group-container-resource"!==e.id}));A&&(this.dragula=A(n,{moves:function(e){var n=!0;return Array.from(e.classList).filter((function(e){return 0===e.indexOf("formio-component-")})).forEach((function(e){var r=e.slice("formio-component-".length);t.disabled&&t.disabled.includes(r)&&(n=!1)})),e.classList.contains("no-drag")&&(n=!1),n},copy:function(e){return e.classList.contains("drag-copy")},accepts:function(e,t){return!e.contains(t)&&!t.classList.contains("no-drop")}}).on("drop",(function(t,n,r,o){return e.onDrop(t,n,r,o)})))}},{key:"detach",value:function(){this.dragula&&this.dragula.destroy(),this.dragula=null,this.sideBarScroll&&T.current.clearBuilderSidebarScroll&&T.current.clearBuilderSidebarScroll.call(this,this),O(x(v.prototype),"detach",this).call(this)}},{key:"getComponentInfo",value:function(e,t){var n;if(t&&"resource"===t.slice(0,t.indexOf("-"))){var r=this.groups.resource.subgroups,o=d.default.find(r,{key:t});o&&o.components.hasOwnProperty("component-".concat(e))&&(n=(0,u.fastCloneDeep)(o.components["component-".concat(e)].schema))}else if(this.schemas.hasOwnProperty(e))n=(0,u.fastCloneDeep)(this.schemas[e]);else if(this.groups.hasOwnProperty(t)){var i=this.groups[t].components;i.hasOwnProperty(e)&&(n=(0,u.fastCloneDeep)(i[e].schema))}else if("searchFields"===t)for(var a=this.groups.resource.subgroups,l=0;l1&&void 0!==arguments[1]?arguments[1]:[];if(e)return t.forEach((function(t){e[t]&&(e[t]=e[t].replace(/"/g,"'"))})),e}},{key:"updateComponent",value:function(e,t){var n=this,r=d.default.get(this.webform,"form.settings.sanitizeConfig")||d.default.get(this.webform,"form.globalSettings.sanitizeConfig");if(this.preview){this.preview.form={components:[d.default.omit(g({},e),["hidden","conditional","calculateValue","logic","autofocus","customConditional"])],config:this.options.formConfig||{},sanitizeConfig:r};var o=["label","tooltip"];this.preview.form.components.forEach((function(e){return n.replaceDoubleQuotes(e,o)}));var i=this.componentEdit.querySelector('[ref="preview"]');i&&(this.setContent(i,this.preview.render(),null,r),this.preview.attach(i))}var a=(0,c.getComponent)(this.editForm.components,"defaultValue",!0);if(a&&"hidden"!==e.type)if(t&&(t.component&&"defaultValue"===t.component.key||t.instance&&a.hasComponent&&a.hasComponent(t.instance))){var l=t.instance._data.key,s=(0,u.getArrayFromComponentPath)(t.instance.path);s.shift(),s.length&&(s.unshift(e.key),l=(0,u.getStringFromComponentPath)(s)),d.default.set(this.preview._data,l,t.value),d.default.set(this.webform._data,l,t.value)}else{d.default.assign(a.component,d.default.omit(g({},e),["key","label","labelPosition","labelMargin","labelWidth","placeholder","tooltip","hidden","autofocus","validate","disabled","defaultValue","customDefaultValue","calculateValue","conditional","customConditional","id"]));var f=a.parent,p=-1,h=-1;if(f.tabs.some((function(e,t){e.some((function(e,n){return e.id===a.id&&(p=t,h=n,!0)}))})),-1!==p&&-1!==h&&t&&!d.default.isNil(t.value)){var m=f.tabs[p][h+1];f.removeComponent(a);var y=f.addComponent(a.component,a.data,m);d.default.pull(y.validators,"required"),f.tabs[p].splice(h,1,y),y.checkValidity=function(){return!0},y.build(a.element)}}this.emit("updateComponent",e)}},{key:"findRepeatablePaths",value:function(){var e=[],t=new Map;return(0,c.eachComponent)(this.form.components,(function(n,r){n.key&&(t.has(n.key)?t.get(n.key).includes(r)?e.push(r):t.set(n.key,[].concat(y(t.get(n.key)),[r])):t.set(n.key,[r]))}),!0),e}},{key:"highlightInvalidComponents",value:function(){var e=this.findRepeatablePaths(),t=!1;this.webform.everyComponent((function(n){var r,o,i=n.path;e.includes(i)?(n.setCustomValidity("API Key is not unique: ".concat(n.key)),t=!0):null!==(r=n.error)&&void 0!==r&&null!==(o=r.message)&&void 0!==o&&o.startsWith("API Key is not unique")&&n.setCustomValidity("")})),this.emit("builderFormValidityChange",t)}},{key:"saveComponent",value:function(e,t,n,r){var o=this;this.editForm.detach();var i=t?t.formioContainer:this.container,l=t?t.formioComponent:this;this.dialog.close();var s=i?this.getComponentsPath(e,l.component):"";r||(r=t.formioContainer.find((function(t){return t.id===e.id})));var u=i?i.indexOf(r):0;if(-1!==u){var c=this.editForm.submission.data;c=c.componentJson||c,this.replaceDoubleQuotes(c,["label","tooltip"]),this.hook("beforeSaveComponentSettings",c);var f=null;l.getComponents().forEach((function(e){e.component.key===r.key&&(f=e)}));var d=f.component,p=f.schema,h=this.isParentSaveChildMethod(t.formioComponent);return i&&!h?(i[u]=c,f&&(f.component=c)):h&&t.formioComponent.saveChildComponent(c),(l.rebuild()||a.default.resolve()).then((function(){var e=i?i[u]:f?f.schema:[];if(o.emitSaveComponentEvent(e,d,l.schema,s,u,n,p),o.emit("change",o.form),o.highlightInvalidComponents(),o.isComponentCreated){var r=t.formioComponent.components[0];o.moveComponent(r),o.isComponentCreated=!1}}))}return this.highlightInvalidComponents(),a.default.resolve()}},{key:"emitSaveComponentEvent",value:function(e,t,n,r,o,i,a){this.emit("saveComponent",e,t,n,r,o,i,a)}},{key:"attachEditComponentControls",value:function(e,t,n,r,o){var i=this;this.componentEdit.querySelectorAll('[ref="cancelButton"]').forEach((function(t){i.editForm.addEventListener(t,"click",(function(t){t.preventDefault(),i.editForm.detach(),i.emit("cancelComponent",e),i.dialog.close(),i.highlightInvalidComponents()}))})),this.componentEdit.querySelectorAll('[ref="removeButton"]').forEach((function(n){i.editForm.addEventListener(n,"click",(function(n){n.preventDefault(),i.saved=!0,i.editForm.detach(),i.removeComponent(e,t,r),i.dialog.close(),i.highlightInvalidComponents()}))})),this.componentEdit.querySelectorAll('[ref="saveButton"]').forEach((function(o){i.editForm.addEventListener(o,"click",(function(o){if(o.preventDefault(),!i.editForm.checkValidity(i.editForm.data,!0,i.editForm.data))return i.editForm.setPristine(!1),i.editForm.showErrors(),!1;i.saved=!0,i.saveComponent(e,t,n,r)}))})),this.componentEdit.querySelectorAll('[ref="previewButton"]').forEach((function(a){i.editForm.addEventListener(a,"click",(function(a){a.preventDefault(),i.showPreview=!i.showPreview,i.editForm.detach(),i.setContent(i.componentEdit,i.renderTemplate("builderEditForm",{componentInfo:o.builderInfo,editForm:i.editForm.render(),preview:!!i.preview&&i.preview.render(),showPreview:i.showPreview,helplinks:i.helplinks})),i.editForm.attach(i.componentEdit.querySelector('[ref="editForm"]')),i.attachEditComponentControls(e,t,n,r,o)}))}))}},{key:"editComponent",value:function(e,t,n,o,i){var a,s=this,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(e.key){this.saved=!1;var p=(0,u.fastCloneDeep)(e),h=l.default.components[p.type],m=void 0===h;o=o||m,h=m?l.default.components.unknown:h,this.dialog&&(this.dialog.close(),this.highlightInvalidComponents());var y=d.default.clone(d.default.get(this,"options.editForm",{}));this.editForm&&this.editForm.destroy();var v=d.default.get(this.options,"editForm.".concat(p.type),{});y.editForm=this.form,y.editComponent=e,y.flags=c,this.hook("editComponentParentInstance",y,t),this.editForm=new r.default(g(g({},d.default.omit(this.options,["hooks","builder","events","attachMode","skipInit"])),{},{language:this.options.language},y)),this.hook("editFormProperties",t),this.editForm.form=o&&!m?{components:[{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"componentJson",label:"Component JSON",tooltip:"Edit the JSON for this component."},{type:"checkbox",key:"showFullSchema",label:"Full Schema"}]}:h.editForm(d.default.cloneDeep(v));var b={inFormBuilder:!0};this.hook("instanceOptionsPreview",b);var w=new h(p,b),k=this.hook("builderComponentSchema",e,w);this.editForm.submission=o?{data:{componentJson:k,showFullSchema:this.options.showFullJsonSchema}}:{data:w.component},this.preview&&this.preview.destroy(),h.builderInfo.hasOwnProperty("preview")&&!h.builderInfo.preview||(this.preview=new r.default(d.default.omit(g(g({},this.options),{},{preview:!0}),["hooks","builder","events","attachMode","calculateValue"])),this.hook("previewFormSettitngs",k,o)),this.showPreview=null===(a=h.builderInfo.showPreview)||void 0===a||a,this.componentEdit=this.ce("div",{class:"component-edit-container"}),this.setContent(this.componentEdit,this.renderTemplate("builderEditForm",{componentInfo:h.builderInfo,editForm:this.editForm.render(),preview:!!this.preview&&this.preview.render(),showPreview:this.showPreview,helplinks:this.helplinks})),this.dialog=this.createModal(this.componentEdit,d.default.get(this.options,"dialogAttr",{})),this.editForm.attach(this.componentEdit.querySelector('[ref="editForm"]')),this.hook("editFormWrapper"),this.updateComponent(p),this.editForm.on("change",(function(r){if(r.changed){if(r.changed.component&&"showFullSchema"===r.changed.component.key){var i=r.changed.value;return void(s.editForm.submission={data:{componentJson:i?w.component:e,showFullSchema:i}})}(r.changed.component&&"key"===r.changed.component.key||o)&&(p.keyModified=!0);var a=!1;if(r.changed.instance?a=["label","title"].includes(r.changed.instance.path):r.changed.component&&(a=["label","title"].includes(r.changed.component.key)),a&&n&&(r.data.keyModified||s.editForm.everyComponent((function(e){if("key"===e.key&&"tabs"===e.parent.component.key)return e.setValue(s.updateComponentKey(r.data)),!1})),s.form)){var l=s.findNamespaceRoot(t.formioComponent);l=l.filter((function(e){return y.editComponent.id!==e.id})),f.default.uniquify(l,r.data)}s.updateComponent(r.data.componentJson||r.data,r.changed)}})),this.attachEditComponentControls(e,t,n,i,h);var O=function r(){s.editForm.destroy(!0),s.preview&&(s.preview.destroy(!0),s.preview=null),n&&!s.saved&&(s.removeComponent(e,t,i),s.highlightInvalidComponents()),s.removeEventListener(s.dialog,"close",r),s.dialog=null};this.addEventListener(this.dialog,"close",O),this.emit("editComponent",e)}}},{key:"updateComponentKey",value:function(e){return d.default.camelCase(e.title||e.label||e.placeholder||e.type).replace(/^[0-9]*/,"")}},{key:"moveComponent",value:function(e){var t;this.selectedComponent&&(null===(t=this.selectedComponent.element)||void 0===t||t.classList.remove("builder-component-selected"),this.removeEventListener(document,"keydown")),e.element.focus(),e.element.classList.add("builder-component-selected"),this.selectedComponent=e,this.addEventListener(document,"keydown",this.moveHandler.bind(this))}},{key:"updateComponentPlacement",value:function(e){var t,n,r=this.selectedComponent,o=e?-1:1;if(r){var i=r.element,a=e?i.previousElementSibling:i.nextElementSibling,l=i.parentNode,s=l.formioContainer.length;if(s&&s<=1)return;l.formioContainer&&-1!==(t=d.default.findIndex(l.formioContainer,{key:i.formioComponent.component.key}))&&(n=(n=l.formioContainer.splice(d.default.findIndex(l.formioContainer,{key:i.formioComponent.component.key}),1))[0],l.removeChild(i));var u=l.formioComponent.components.length;if(-1===(t=-1===t?0:t+o))l.formioContainer.push(n),l.appendChild(i);else if(t===u){var c=l.formioContainer[0].key;t=d.default.findIndex(l.formioComponent.components,{key:c});var f=l.formioComponent.components[t].element;l.formioContainer.splice(0,0,n),l.insertBefore(i,f)}else-1!==t&&(l.formioContainer.splice(t,0,n),e?l.insertBefore(i,a):l.insertBefore(i,a.nextElementSibling));i.focus()}}},{key:"stopMoving",value:function(e){var t=e.element.parentNode;this.removeEventListener(document,"keydown"),t.formioComponent.rebuild(),this.selectedComponent=null}},{key:"addNewComponent",value:function(e){var t,n,r=this,o=document.querySelector(".formio-builder-form"),i=e.getAttribute("data-key"),a=e.getAttribute("data-group");i&&a&&(n=this.getComponentInfo(i,a)),this.options.noNewEdit||n.noNewEdit||(f.default.uniquify(this.findNamespaceRoot(o.formioComponent),n),this.editComponent(n,o,!0,null,null)),(null===(t=o.formioComponent.components[0])||void 0===t?void 0:t.element)?o.formioContainer.splice(0,0,n):o.formioContainer.push(n),o.formioComponent.rebuild().then((function(){r.isComponentCreated=!0}))}},{key:"copyComponent",value:function(e){if(!window.sessionStorage)return console.warn("Session storage is not supported in this browser.");this.addClass(this.refs.form,"builder-paste-mode"),window.sessionStorage.setItem("formio.clipboard",JSON.stringify(e.schema))}},{key:"pasteComponent",value:function(e){if(!window.sessionStorage)return console.warn("Session storage is not supported in this browser.");if(this.removeClass(this.refs.form,"builder-paste-mode"),window.sessionStorage){var t=window.sessionStorage.getItem("formio.clipboard");if(t){var n=JSON.parse(t),r=this.getParentElement(e.element);if(r){f.default.uniquify(this.findNamespaceRoot(r.formioComponent),n);var o="",i=0,a=this.isParentSaveChildMethod(r.formioComponent);r.formioContainer&&!a?(i=r.formioContainer.indexOf(e.component),o=this.getComponentsPath(n,r.formioComponent.component),r.formioContainer.splice(i+1,0,n)):a&&r.formioComponent.saveChildComponent(n,!1),r.formioComponent.rebuild(),this.emitSaveComponentEvent(n,n,r.formioComponent.component,o,i+1,!0,n)}this.emit("change",this.form)}}}},{key:"isParentSaveChildMethod",value:function(e){return!(!e||!e.saveChildComponent)}},{key:"getParentElement",value:function(e){var t=e;do{t=t.parentNode}while(t&&!t.formioComponent);return t}},{key:"addBuilderComponentInfo",value:function(e){if(e&&e.group&&this.groups[e.group]){e=d.default.clone(e);var t=this.groups[e.group];return t.components.hasOwnProperty(e.key)||(t.components[e.key]=e),e}}},{key:"init",value:function(){return this.webform&&this.webform.init(),O(x(v.prototype),"init",this).call(this)}},{key:"clear",value:function(){this.webform.initialized&&this.webform.clear()}},{key:"destroy",value:function(e){this.webform.initialized&&this.webform.destroy(e),O(x(v.prototype),"destroy",this).call(this,e)}},{key:"addBuilderGroup",value:function(e,t){this.groups[e]?this.updateBuilderGroup(e,t):(this.groups[e]=t,this.groupOrder.push(e),this.triggerRedraw())}},{key:"updateBuilderGroup",value:function(e,t){this.groups[e]&&(this.groups[e]=t,this.triggerRedraw())}},{key:"generateKey",value:function(e){return e.key||d.default.camelCase(e.title||e.label||e.placeholder||e.type)}}],n&&k(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),v}(o.default);t.default=M},33456:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(49337),n(33321),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(74916),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(57327),n(41539),n(26699),n(32023),n(89554),n(54747),n(69826),n(68309),n(21249),n(47941),n(92222),n(24812),n(34553),n(91058),n(85827),n(68304),n(30489);var o=u(n(91459)),i=u(n(96486)),a=u(n(12215)),l=n(19161),s=n(82531);function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=t.all,r=void 0!==n&&n,o=this.hasExtraPages?this.components:this.pages,a=o.filter(r?i.default.identity:function(t,n){return e._seenPages.includes(n)});return a}},{key:"hasExtraPages",get:function(){return!i.default.isEmpty(this.subWizards)}},{key:"data",get:function(){return g(_(u.prototype),"data",this)},set:function(e){var t=this;this._data=e,i.default.each(this.getPages({all:!0}),(function(e){e.data=t.componentContext(e)}))}},{key:"localData",get:function(){var e,t;return(null===(e=this.pages[this.page])||void 0===e||null===(t=e.root)||void 0===t?void 0:t.submission.data)||this.submission.data}},{key:"checkConditions",value:function(e,t,n){var r=g(_(u.prototype),"checkConditions",this).call(this,e,t,n);return this.establishPages(e),r}},{key:"getComponents",value:function(){return this.submitting?this.getPages({all:this.isLastPage()}):g(_(u.prototype),"getComponents",this).call(this)}},{key:"resetValue",value:function(){this.getPages({all:!0}).forEach((function(e){return e.resetValue()})),this.setPristine(!0)}},{key:"init",value:function(){var e,t,n,r=this;this.options.buttonSettings=i.default.defaults(this.options.buttonSettings,{showPrevious:!0,showNext:!0,showSubmit:!0,showCancel:!this.options.readOnly}),this.isSecondInit||(this.isClickableDefined=null===(t=this.options)||void 0===t||null===(n=t.breadcrumbSettings)||void 0===n?void 0:n.hasOwnProperty("clickable"),this.isSecondInit=!0),this.options.breadcrumbSettings=i.default.defaults(this.options.breadcrumbSettings,{clickable:!0}),this.options.allowPrevious=this.options.allowPrevious||!1,this.page=0;var o=g(_(u.prototype),"init",this).call(this);return this.setComponentSchema(),null!==(e=this.pages)&&void 0!==e&&e[this.page]&&(this.component=this.pages[this.page].component),this.on("subWizardsUpdated",(function(e){var t=r.subWizards.find((function(t){var n;return(null==e?void 0:e.id)&&(null===(n=t.subForm)||void 0===n?void 0:n.id)===(null==e?void 0:e.id)}));r.subWizards.length&&t&&(t.subForm.setValue(e._submission,{},!0),r.establishPages(),r.redraw())})),o}},{key:"wizardKey",get:function(){return"wizard-".concat(this.id)}},{key:"wizard",get:function(){return this.form},set:function(e){this.setForm(e)}},{key:"buttons",get:function(){var e=this,t={};return[{name:"cancel",method:"cancel"},{name:"previous",method:"prevPage"},{name:"next",method:"nextPage"},{name:"submit",method:"submit"}].forEach((function(n){e.hasButton(n.name)&&(t[n.name]=n)})),t}},{key:"buttonOrder",get:function(){var e,t,n;return null!==(e=null===(t=this.options.properties)||void 0===t||null===(n=t.wizardButtonOrder)||void 0===n?void 0:n.toLowerCase().split(", "))&&void 0!==e?e:["cancel","previous","next","submit"]}},{key:"renderContext",get:function(){var e,t;return{disableWizardSubmit:this.form.disableWizardSubmit,wizardKey:this.wizardKey,isBreadcrumbClickable:this.isBreadcrumbClickable(),isSubForm:!!this.parent&&"wizard"===!(null!==(e=this.root)&&void 0!==e&&null!==(t=e.component)&&void 0!==t&&t.type),panels:this.allPages.length?this.allPages.map((function(e){return e.component})):this.pages.map((function(e){return e.component})),buttons:this.buttons,currentPage:this.page,buttonOrder:this.buttonOrder}}},{key:"prepareNavigationSettings",value:function(e){var t=this.currentPanel;return t&&t.buttonSettings&&Object.keys(t.buttonSettings).forEach((function(){Object.keys(e.buttons).forEach((function(n){(void 0!==t.buttonSettings[n]&&!t.buttonSettings[n]||e.isSubForm)&&(e.buttons[n]=null)}))})),this.renderTemplate("wizardNav",e)}},{key:"prepareHeaderSettings",value:function(e,t){return this.currentPanel&&"none"===this.currentPanel.breadcrumb||e.isSubForm?null:this.renderTemplate(t,e)}},{key:"render",value:function(){var e=this,t=this.renderContext;this.component.key&&t.panels.map((function(n){n.key===e.component.key&&(e.currentPanel=n,t.wizardPageTooltip=e.getFormattedTooltip(n.tooltip))}));var n=this.prepareNavigationSettings(t),r="wizardHeader".concat(i.default.get(this.form,"settings.wizardHeaderType","")),o=i.default.get(this.form,"settings.wizardHeaderLocation","left"),a=this.prepareHeaderSettings(t,r);return this.renderTemplate("wizard",h(h({},t),{},{className:g(_(u.prototype),"getClassName",this).call(this),wizardHeader:a,wizardHeaderType:r,wizardHeaderLocation:o,wizardNav:n,components:this.renderComponents([].concat(c(this.prefixComps),c(this.currentPage.components),c(this.suffixComps)))}),this.builderMode?"builder":"form")}},{key:"redrawNavigation",value:function(){if(this.element){var e,t=this.element.querySelector("#".concat(this.wizardKey,"-nav"));t&&(this.detachNav(),t.outerHTML=this.renderTemplate("wizardNav",this.renderContext),t=this.element.querySelector("#".concat(this.wizardKey,"-nav")),this.loadRefs(t,(m(e={},"".concat(this.wizardKey,"-cancel"),"single"),m(e,"".concat(this.wizardKey,"-previous"),"single"),m(e,"".concat(this.wizardKey,"-next"),"single"),m(e,"".concat(this.wizardKey,"-submit"),"single"),e)),this.attachNav())}}},{key:"redrawHeader",value:function(){if(this.element){var e,t=this.element.querySelector("#".concat(this.wizardKey,"-header"));t&&(this.detachHeader(),t.outerHTML=this.renderTemplate("wizardHeader".concat(i.default.get(this.form,"settings.wizardHeaderType","")),this.renderContext),t=this.element.querySelector("#".concat(this.wizardKey,"-header")),this.loadRefs(t,(m(e={},"".concat(this.wizardKey,"-link"),"multiple"),m(e,"".concat(this.wizardKey,"-tooltip"),"multiple"),e)),this.attachHeader())}}},{key:"attach",value:function(e){var t,n,r=this;this.element=e,this.loadRefs(e,(m(t={},this.wizardKey,"single"),m(t,"".concat(this.wizardKey,"-header"),"single"),m(t,"".concat(this.wizardKey,"-cancel"),"single"),m(t,"".concat(this.wizardKey,"-previous"),"single"),m(t,"".concat(this.wizardKey,"-next"),"single"),m(t,"".concat(this.wizardKey,"-submit"),"single"),m(t,"".concat(this.wizardKey,"-link"),"multiple"),m(t,"".concat(this.wizardKey,"-tooltip"),"multiple"),t)),!this.options.readOnly&&!this.editMode||this.enabledIndex||(this.enabledIndex=(null===(n=this.pages)||void 0===n?void 0:n.length)-1),this.hook("attachWebform",e,this);var o=this.attachComponents(this.refs[this.wizardKey],[].concat(c(this.prefixComps),c(this.currentPage.components),c(this.suffixComps)));return this.attachNav(),this.attachHeader(),o.then((function(){r.emit("render",{component:r.currentPage,page:r.page}),r.component.scrollToTop&&r.scrollPageToTop()}))}},{key:"scrollPageToTop",value:function(){var e,t=null!==(e=this.refs["".concat(this.wizardKey,"-header")])&&void 0!==e?e:this.refs[this.wizardKey];t&&("scrollIntoView"in t?t.scrollIntoView(!0):this.scrollIntoView(t))}},{key:"isBreadcrumbClickable",value:function(){var e=this,t=null;return this.pages.map((function(n){i.default.isEqual(e.currentPage.component,n.component)&&(t=n)})),this.isClickableDefined?this.options.breadcrumbSettings.clickable:i.default.get(t,"component.breadcrumbClickable",!0)}},{key:"isAllowPrevious",value:function(){var e=this,t=null;return this.pages.map((function(n){i.default.isEqual(e.currentPage.component,n.component)&&(t=n)})),i.default.get(t.component,"allowPrevious",this.options.allowPrevious)}},{key:"handleNaviageteOnEnter",value:function(e){if(13===e.keyCode){var t=new CustomEvent("click"),n=this.refs["".concat(this.wizardKey,"-").concat(this.buttons.next.name)];n&&n.dispatchEvent(t)}}},{key:"handleSaveOnEnter",value:function(e){if(13===e.keyCode){var t=new CustomEvent("click"),n=this.refs["".concat(this.wizardKey,"-").concat(this.buttons.submit.name)];n&&n.dispatchEvent(t)}}},{key:"attachNav",value:function(){var e=this;this.component.navigateOnEnter&&this.addEventListener(document,"keyup",this.handleNaviageteOnEnter.bind(this)),this.component.saveOnEnter&&this.addEventListener(document,"keyup",this.handleSaveOnEnter.bind(this)),i.default.each(this.buttons,(function(t){var n=e.refs["".concat(e.wizardKey,"-").concat(t.name)];e.addEventListener(n,"click",(function(r){r.preventDefault(),n.setAttribute("disabled","disabled"),e.setLoading(n,!0),e[t.method]().then((function(){n.removeAttribute("disabled"),e.setLoading(n,!1)})).catch((function(){n.removeAttribute("disabled"),e.setLoading(n,!1)}))}))}))}},{key:"emitWizardPageSelected",value:function(e){this.emit("wizardPageSelected",this.pages[e],e)}},{key:"attachHeader",value:function(){var e,t=this,n=this.isAllowPrevious();this.attachTooltips(this.refs["".concat(this.wizardKey,"-tooltip")],this.currentPanel.tooltip),(this.isBreadcrumbClickable()||n)&&(null===(e=this.refs["".concat(this.wizardKey,"-link")])||void 0===e||e.forEach((function(e,r){(!n||r<=t.enabledIndex)&&t.addEventListener(e,"click",(function(e){return t.emit("wizardNavigationClicked",t.pages[r]),e.preventDefault(),t.setPage(r).then((function(){t.emitWizardPageSelected(r)}))}))})))}},{key:"detachNav",value:function(){var e=this;this.component.navigateOnEnter&&this.removeEventListener(document,"keyup",this.handleNaviageteOnEnter.bind(this)),this.component.saveOnEnter&&this.removeEventListener(document,"keyup",this.handleSaveOnEnter.bind(this)),i.default.each(this.buttons,(function(t){e.removeEventListener(e.refs["".concat(e.wizardKey,"-").concat(t.name)],"click")}))}},{key:"detachHeader",value:function(){var e=this;this.refs["".concat(this.wizardKey,"-link")]&&this.refs["".concat(this.wizardKey,"-link")].forEach((function(t){e.removeEventListener(t,"click")}))}},{key:"transformPages",value:function(){var e=this,t=[],n=this.getSortedComponents(this),r=[];this.allPages=[];var o=function t(n,o){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=[],u=["datagrid","editgrid","dynamicWizard"],f=null!=n&&n.subForm?e.getSortedComponents(n.subForm):(null==n?void 0:n.components)||[],d=f.filter((function(e){return e._visible})),p=d.filter((function(e){return!u.includes(e.component.type)&&("form"!==e.type||e.isNestedWizard)})),h=f.filter((function(e){var t;return"wizard"!==(null===(t=e.subForm)||void 0===t?void 0:t._form.display)})),m=!1;if((0,s.eachComponent)(p,(function(n){if(n&&n.component&&("panel"===n.component.type&&null!=n&&n.parent.wizard&&!t(n,o,!1)&&(a&&(e.setRootPanelId(n),l.push(n)),m=!0),n.isNestedWizard&&n.subForm)){var r=t(n,l,a);m||(m=r)}}),!0),"panel"===n.component.type&&(!m&&a&&(e.setRootPanelId(n),o.push(n)),m&&h.length)){var y=i.default.clone(n);y.components=h,e.setRootPanelId(y),r.push(y)}return a&&(o.push.apply(o,c(r).concat(l)),r=[]),m};n.forEach((function(e){e.visible&&o(e,t)}),[]),this.localRoot&&this.id===this.localRoot.id&&t.forEach((function(e,t){e.eachComponent((function(e){e.page=t}))})),this.allPages=t}},{key:"getSortedComponents",value:function(e){var t=e.components,n=e.originalComponents,r=[],o=[];return t&&t.length&&t.map((function(e){"panel"===e.component.type&&(o[e.component.key||e.component.title]=e)})),null==n||n.forEach((function(e){e.key||(e.key=e.title),o[e.key]&&r.push(o[e.key])})),r}},{key:"findRootPanel",value:function(e){var t;return null!==(t=e.parent)&&void 0!==t&&t.parent?this.findRootPanel(e.parent):e}},{key:"setRootPanelId",value:function(e){var t;if(!e.rootPanelId||e.rootPanelId===e.id){var n=null!==(t=e.parent)&&void 0!==t&&t.parent?this.findRootPanel(e.parent):e;e.rootPanelId=n.id}}},{key:"establishPages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;this.pages=[],this.prefixComps=[],this.suffixComps=[];var n=[],r={},o=h(h({},i.default.clone(this.options)),this.parent?{root:this}:{});return this.components&&this.components.length&&this.components.forEach((function(e){"panel"===e.component.type&&(r[e.component.key||e.component.title]=e)})),this.originalComponents&&this.originalComponents.forEach((function(i){if("panel"===i.type){i.key||(i.key=i.title);var a=r[i.key],l=e.shouldForceShow(i),u=e.shouldForceHide(i),c=a?a.visible:(0,s.checkCondition)(i,t,t,e.component,e)&&!i.hidden;l?c=!0:u&&(c=!1),c&&(n.push(i),a&&e.pages.push(a)),!a&&c&&((a=e.createComponent(i,o)).visible=c,e.pages.push(a),a.eachComponent((function(t){t.page=e.pages.length-1})))}else"button"!==i.type&&(e.pages.length?e.suffixComps.push(e.createComponent(i,o)):e.prefixComps.push(e.createComponent(i,o)))})),this.pages.length&&this.emit("pagesChanged"),this.transformPages(),this.allPages&&this.allPages.length&&this.updatePages(),n}},{key:"updatePages",value:function(){this.pages=this.allPages}},{key:"addComponents",value:function(){this.establishPages()}},{key:"setPage",value:function(e){var t=this;if(e===this.page)return o.default.resolve();if(e>=0&&e=this.page?this.pages[this.page]:{components:[]}}},{key:"getNextPage",value:function(){var e;if(null!==(e=this.pages)&&void 0!==e&&e[this.page]){var t=this.submission.data,n=this.pages[this.page].component;if(n){var r=this.pages.length>this.page+1&&!this.showAllErrors?this.page+1:-1;if(n.nextPage){var o=this.evaluate(n.nextPage,{next:r,data:t,page:r,form:n},"next");if(null===o)return this.currentNextPage=null,null;var i=parseInt(o,10);return!isNaN(parseInt(i,10))&&isFinite(i)?(this.currentNextPage=i,i):(this.currentNextPage=this.getPageIndexByKey(o),this.currentNextPage)}return this.currentNextPage=r,r}this.currentNextPage=null}return null}},{key:"getPreviousPage",value:function(){return this.page-1}},{key:"beforeSubmit",value:function(){var e=this.getPages();return o.default.all(e.map((function(e){return e.options.beforeSubmit=!0,e.beforeSubmit()})))}},{key:"beforePage",value:function(e){var t=this;return new o.default((function(n,r){t.hook(e?"beforeNext":"beforePrev",t.currentPage,t.submission,(function(o){o&&(t.showErrors(o,!0),r(o));var i=t.currentPage;i?i.beforePage(e).then(n).catch(r):n()}))}))}},{key:"emitNextPage",value:function(){this.emit("nextPage",{page:this.page,submission:this.submission})}},{key:"nextPage",value:function(){var e=this;return this.options.readOnly?this.beforePage(!0).then((function(){return e.setPage(e.getNextPage()).then((function(){e.emitNextPage()}))})):this.checkValidity(this.localData,!0,this.localData,!0)?(this.checkData(this.submission.data),this.beforePage(!0).then((function(){return e.setPage(e.getNextPage()).then((function(){!e.options.readOnly&&!e.editMode&&e.enabledIndex1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,o=this.getPages({all:!0}).reduce((function(r,o){return t.setNestedValue(o,e.data,n,r)||r}),!1);return this.mergeData(this.data,e.data),o&&this.pageFieldLogic(this.page),e.data=this.data,this._submission=e,r||this.establishPages(e.data),this.setEditMode(e),o}},{key:"isClickable",value:function(e,t){return this.page!==t&&(0,s.firstNonNil)([i.default.get(e,"breadcrumbClickable"),this.options.breadcrumbSettings.clickable])}},{key:"hasButton",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getNextPage(),n=i.default.get(this.currentPage,"component.buttonSettings",{}),r=n.previous,o=void 0===r?this.options.buttonSettings.showPrevious:r,a=n.cancel,l=void 0===a?this.options.buttonSettings.showCancel:a,s=n.submit,u=void 0===s?this.options.buttonSettings.showSubmit:s,c=n.next,f=void 0===c?this.options.buttonSettings.showNext:c;switch(e){case"previous":return o&&this.getPreviousPage()>-1;case"next":return f&&null!==t&&-1!==t;case"cancel":return l&&!this.options.readOnly;case"submit":return u&&!this.options.readOnly&&(null===t||this.page===this.pages.length-1);default:return!0}}},{key:"pageId",value:function(e){return e.key?"".concat(e.key,"-").concat(e.title):e.components&&e.components.length>0?this.pageId(e.components[0]):e.title}},{key:"onChange",value:function(e,t,n,r){var o,a,l=this;g(_(u.prototype),"onChange",this).call(this,e,t,n,r),this.alert&&!this.submitted&&(this.checkValidity(this.localData,!1,this.localData,!0),this.showErrors([],!0,!0));var s,c,f=this.currentNextPage;this.hasExtraPages?(o=this.pages.map((function(e){return e.component.key})),this.establishPages(),a=this.pages.map((function(e){return e.component.key}))):(o=this.currentPanels||this.pages.map((function(e){return e.component.key})),a=this.establishPages().map((function(e){return e.key})),this.currentPanels=a,null!==(s=this.currentPanel)&&void 0!==s&&s.key&&null!==(c=this.currentPanels)&&void 0!==c&&c.length&&this.setPage(this.currentPanels.findIndex((function(e){return e===l.currentPanel.key})))),(!i.default.isEqual(a,o)||e&&e.fromSubmission)&&this.redrawHeader(),f!==this.getNextPage()&&this.redrawNavigation(),this.options.readOnly&&(this.prefixComps.length||this.suffixComps.length)&&this.redraw()}},{key:"redraw",value:function(){var e,t;return null!==(e=this.parent)&&void 0!==e&&null!==(t=e.component)&&void 0!==t&&t.modalEdit?this.parent.redraw():g(_(u.prototype),"redraw",this).call(this)}},{key:"rebuild",value:function(){var e=this,t=this.page;return g(_(u.prototype),"rebuild",this).call(this).then((function(){return e.setPage(t)}))}},{key:"checkValidity",value:function(e,t,n,r){return this.checkCondition(n,e)?(!r||this.isLastPage()?this.getComponents():this.currentPage.components).reduce((function(r,o){return o.checkValidity(e,t,n)&&r}),!0):(this.setCustomValidity(""),!0)}},{key:"errors",get:function(){return this.isLastPage()?g(_(u.prototype),"errors",this):this.currentPage.errors}},{key:"focusOnComponent",value:function(e){var t,n,r=this,o=0,i=this.pages.filter((function(t,n){var r=!1;return t.getComponent(e,(function(t){t.path===e&&(o=n,r=!0)})),r})),a=(t=i,n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,n)||f(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return a&&a!==this.currentPage?this.setPage(o).then((function(){r.checkValidity(r.submission.data,!0,r.submission.data),r.showErrors(),g(_(u.prototype),"focusOnComponent",r).call(r,e)})):g(_(u.prototype),"focusOnComponent",this).call(this,e)}}],n&&v(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),u}(a.default);t.default=S,S.setBaseUrl=l.GlobalFormio.setBaseUrl,S.setApiUrl=l.GlobalFormio.setApiUrl,S.setAppUrl=l.GlobalFormio.setAppUrl},72940:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(26699),n(32023),n(82772),n(34553),n(2707),n(57327),n(41539),n(47941),n(79753),n(89554),n(54747),n(24812),n(40561),n(69826),n(68304),n(30489);var o,i=c(n(95529)),a=c(n(12215)),l=c(n(1848)),s=c(n(96486)),u=n(82531);function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n=this.page?e[this.page]:null}},{key:"form",get:function(){return this._form},set:function(e){if(this._form=e,this._form.components&&Array.isArray(this._form.components)||(this._form.components=[]),0===this.pages.length){var t=this._form.components.filter((function(e){return"button"!==e.type}));this._form.components=[this.getPageConfig(1,t)]}this.rebuild()}},{key:"schema",get:function(){s.default.assign(this.currentPage,this.webform._form.components[0]);var e=new a.default(this.options);return e.setForm(this._form,{noEmit:!0}),e.schema}},{key:"render",value:function(){var e=this;return this.renderTemplate("builderWizard",{sidebar:this.renderTemplate("builderSidebar",{scrollEnabled:this.sideBarScroll,groupOrder:this.groupOrder,groupId:"builder-sidebar-".concat(this.id),groups:this.groupOrder.map((function(t){return e.renderTemplate("builderSidebarGroup",{group:e.groups[t],groupKey:t,groupId:"builder-sidebar-".concat(e.id),subgroups:e.groups[t].subgroups.map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})}))})}))}),pages:this.pages,form:this.webform.render()})}},{key:"attach",value:function(e){var t=this;return this.loadRefs(e,{addPage:"multiple",gotoPage:"multiple"}),this.refs.gotoPage.forEach((function(e,t){e.parentNode.dragInfo={index:t}})),o&&(this.navigationDragula=o([this.element.querySelector(".wizard-pages")],{moves:function(e){return!e.classList.contains("wizard-add-page")},accepts:function(e,t,n,r){return!!r}}).on("drop",this.onReorder.bind(this))),this.refs.addPage.forEach((function(e){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.addPage()}))})),this.refs.gotoPage.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.setPage(n)}))})),p(v(h.prototype),"attach",this).call(this,e)}},{key:"detach",value:function(){this.navigationDragula&&this.navigationDragula.destroy(),this.navigationDragula=null,p(v(h.prototype),"detach",this).call(this)}},{key:"rebuild",value:function(){var e,t=this.currentPage;return this.webform.setForm({display:"form",type:"form",components:t?[t]:[],controller:(null===(e=this._form)||void 0===e?void 0:e.controller)||""},{keepAsReference:!0}),this.redraw()}},{key:"addPage",value:function(e){var t=e&&e.schema?(0,u.fastCloneDeep)(e.schema):this.getPageConfig(this.pages.length+1);return l.default.uniquify(this._form.components,t),this._form.components.push(t),this.emitSaveComponentEvent(t,t,this._form,"components",this._form.components.length-1,!0,t),this.emit("change",this._form),this.rebuild()}},{key:"removePage",value:function(e,t){return this._form.components.splice(t,1),this.emit("change",this._form),e===this.pages.length?0===e?(this._form.components.push(this.getPageConfig(1)),this.rebuild()):this.setPage(e-1):this.rebuild()}},{key:"onReorder",value:function(e,t,n,r){var o=this,i=null==r?void 0:r.classList.contains("wizard-add-page");if(e.dragInfo&&(!r||r.dragInfo||i)){var a=e.dragInfo.index,l=r&&r.dragInfo?r.dragInfo.index:this.pages.length,s=l>a,c=(0,u.fastCloneDeep)(this._form.components),f=this._form.components[a];return c.splice(l,0,f),c.splice(s?a:a+1,1),this._form.components=(0,u.fastCloneDeep)(c),this.rebuild().then((function(){o.emit("change",o._form)}))}console.warn("There is no Drag Info available for either dragged or sibling element")}},{key:"setPage",value:function(e){if(e!==this.page)return this.page=e,this.rebuild()}},{key:"getPageConfig",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{title:"Page ".concat(e),label:"Page ".concat(e),type:"panel",key:"page".concat(e),components:t}}},{key:"pasteComponent",value:function(e){if(!(e instanceof h))return this._form.components.find((function(t){return s.default.isEqual(e.component,t)}))?void this.addPage(e):p(v(h.prototype),"pasteComponent",this).call(this,e)}}],n&&d(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=b},59671:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=l(n(34558)),i=l(n(91459)),a=l(n(96486));function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n\n
  • < 28 bits = Very Weak;
  • \n
  • 28 - 35 bits = Weak; should keep out most people;
  • \n
  • 36 - 59 bits = Reasonable; fairly secure passwords for network and company passwords;
  • \n
  • 60 - 127 bits = Strong; can be good for guarding financial information;
  • \n
  • > 128 bits = Very Strong; often overkill;
  • \n\n",mask:!1,spellcheck:!0,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",validate:{required:!0,min:1,max:128},key:"maxEntropy",type:"number",input:!0},{label:"Style",tooltip:"Specifies the background color style using bootstrap classes",tableView:!0,data:{values:[{label:"Danger",value:"danger"},{label:"Warning",value:"warning"},{label:"Info",value:"info"},{label:"Success",value:"success"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"style",type:"select",indexeddb:{filter:{}},input:!0},{label:"Color",placeholder:"#0079c0",tooltip:"Specifies a color of the indicator element",tableView:!0,key:"color",type:"textfield",input:!0}]},{label:"Update On",tableView:!0,data:{values:[{label:"Strength Level Change",value:"levelChange"},{label:"Entropy Change",value:"entropyChange"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"updateOn",type:"select",indexeddb:{filter:{}},input:!0},{label:"Rules",reorder:!1,addAnotherPosition:"bottom",layoutFixed:!1,enableRowGroups:!1,initEmpty:!1,tableView:!1,defaultValue:[{}],key:"rulesSettings",type:"datagrid",input:!0,components:[{label:"Name",tableView:!0,data:{values:[{label:"Length",value:"length"},{label:"Lower Case",value:"lowerCase"},{label:"Upper Case",value:"upperCase"},{label:"Numeric",value:"numeric"},{label:"Symbols",value:"symbols"}]},selectThreshold:.3,validate:{required:!0,onlyAvailableItems:!1},key:"name",type:"select",indexeddb:{filter:{}},input:!0},{label:"Error Message",tableView:!0,key:"errorMessage",type:"textfield",input:!0},{label:"Required",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1}]},{label:"Custom Rules",tableView:!1,rowDrafts:!1,key:"customRules",type:"editgrid",input:!0,components:[{label:"Name",tableView:!0,validate:{required:!0},key:"name",type:"textfield",input:!0},o.default.javaScriptValue("Check","check","",1100,'

    Example:

    valid = !value.includes(data.email) ? true : "Password should not be variation of the email";

    ',"","",!0),{label:"Increase Characters Pool Size",description:"Set this to amount of characters that may be used in the password if there is a specific group of characters is used.\nE.g., if your validation checks if there is any numeric symbol in the password, then you should set it to 10 (there are 10 possible numbers).\n",mask:!1,spellcheck:!0,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",key:"increaseCharactersPoolSize",type:"number",input:!0},{label:"Required",tooltip:"Check if this check is required to proceed",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1}]},o.default.javaScriptValue("Is Valid","isValid","",1100,"

    Example:

    valid = entropy > maxEntropy / 2 ;

    ","","entropyCurrent entropy bits of the password.levelCurrent strength level of the password.",!0),{label:"Required",description:"Check this if you don't want to allow submitting password which does not correspond to the minimal strength requirements.",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1},{label:"Black List",tooltip:"Add words to search in the password. If there are some words from that list were found, the entropy of the password will be recalculated.\n",tableView:!0,multiple:!0,key:"blackList",type:"textfield",input:!0},o.default.javaScriptValue("Custom Blacklisted Words","customBlackListedWords","",1100,"

    Example:

    values = [ data.name, data.dataOfBirth, data.favoriteColor ];

    ","","",!0),{label:"Disable Blacklisted Words",tooltip:"Check if you want to disable submitting passwords containing words form the clack list",tableView:!1,key:"disableBlacklistedWords",type:"checkbox",input:!0,defaultValue:!1},{label:"Location",hideLabel:!1,tableView:!1,key:"location",type:"container",input:!0,components:[{label:"Insert",tooltip:"Specifies where the indicator will be inserted: before or aftre an element",tableView:!0,data:{values:[{label:"Before",value:"before"},{label:"After",value:"after"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"insert",type:"select",indexeddb:{filter:{}},input:!0},{label:"Selector",placeholder:"[ref='element']",description:"Specifies the selector of the element which will be used as a reference to insert the indicator template",tableView:!0,key:"selector",type:"textfield",input:!0}]},{label:"Template",editor:"ace",tableView:!0,key:"template",type:"textarea",input:!0,as:"html"}];t.default=i},16996:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(2707),n(74916),n(68309),n(44914),n(15306),n(24812),n(24603),n(39714),n(89554),n(41539),n(54747),n(92222),n(69600),n(68304),n(30489);var o=l(n(96486)),i=l(n(59671)),a=l(n(10902));function l(e){return e&&e.__esModule?e:{default:e}}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n/?~]/.test(e)||"Value must contain symbols"},increaseCharactersPoolSize:32}}}},{key:"charactersPoolLength",get:function(){return this._charactersPoolLength},set:function(e){this._charactersPoolLength=e}},{key:"level",get:function(){return this._level||this.getLevel()},set:function(e){this._level=e}},{key:"entropy",get:function(){return this._entropy},set:function(e){var t=this.getLevel(),n="entropyChange"===this.settings.updateOn&&this._entropy!==e;this._entropy=e,this.level=this.getLevel(),("levelChange"===this.settings.updateOn&&t.name!==this.level.name||n)&&this.updateView()}},{key:"dictionarySize",get:function(){return this.settings.dictionarySize||171476}},{key:"template",get:function(){return this.settings.template}},{key:"tooltip",get:function(){var e,t;return(null===(e=this.level)||void 0===e?void 0:e.tooltip)||"".concat(null===(t=this.level)||void 0===t?void 0:t.name," strongness")}},{key:"rulesSettings",get:function(){return this.settings.rulesSettings||[]}},{key:"customRules",get:function(){return this.settings.customRules||[]}},{key:"log2",value:function(e){return"function"==typeof Math.log2?Math.log2(e):Math.log(e)*Math.LOG2E}},{key:"calculatePasswordEntropy",value:function(e,t){return e&&t?this.log2(Math.pow(t,e)):0}},{key:"calculatePasswordEntropyWords",value:function(e){return this.dictionarySize?this.log2(this.dictionarySize)*e:0}},{key:"render",value:function(){var e=this.component.interpolate(this.template,{entropy:this.entropy,maxEntropy:this.maxEntropy,level:this.level,levelName:this.level.name.replace(" ","-").toLowerCase(),levels:this.levels,readOnly:this.component.options.readOnly,pristine:this.component.pristine,t:this.t.bind(this),tooltip:this.tooltip});return this.component.sanitize(e)}},{key:"checkBlackList",value:function(e){var t=s(this.settings.blackList),n=this.settings.customBlacklistedWords;n&&"string"==typeof n&&(n=this.evaluate(n,this.component.evalContext({value:e}),"values"))&&n.length&&t.push.apply(t,s(n));for(var r=e,o=[],i=0;i=Math.round(this.maxEntropy/2)}},{key:"handleRuleCheckResult",value:function(e,t,n,r){if(!0!==e)r.push({validation:t.name,message:n,level:t.required?"error":"warning"});else if(t.increaseCharactersPoolSize)return t.increaseCharactersPoolSize;return 0}},{key:"performChecks",value:function(e){var t=this,n=[],r=0;return this.rulesSettings.forEach((function(i){if(t.rules[i.name]){var a=o.default.merge({},t.rules[i.name],i),l=a.check(e,i.options||{}),s=i.message||l;r+=t.handleRuleCheckResult(l,a,s,n)}})),this.customRules.forEach((function(o){if(o.check&&"string"==typeof o.check){var i=t.evaluate(o.check,t.component.evalContext({value:e}),"valid"),a="string"==typeof i?i:"Password does not meet ".concat(o.name," validation");r+=t.handleRuleCheckResult(i,o,a,n)}})),{charactersPoolSize:r,errors:n}}},{key:"checkValidity",value:function(e){var t,n=e.length,r=this.performChecks(e),o=r.charactersPoolSize,i=r.errors;this.errors=i;var a=this.calculatePasswordEntropy(n,o),l=null!==(t=this.settings.blackList)&&void 0!==t&&t.length||this.settings.customBlacklistedWords?this.checkBlackList(e):null;return l&&!0!==l?(this.handleBlackListCheckResult(l),this.entropy=Math.min(a,l.entropy)):this.entropy=a,this.isValid()||this.errors.push({message:"Password is not strong enough",level:this.settings.required?"error":"warning"}),!this.errors.length}},{key:"handleBlackListCheckResult",value:function(e){var t=e.blacklistedWords,n=this.settings.disableBlacklistedWords,r="Password ".concat(n?"must":"should"," not include common words: ").concat(t.join(", ")),o={name:"blacklist",required:n};this.handleRuleCheckResult(!1,o,r,this.errors)}},{key:"attach",value:function(e){var t=this;f(m(d.prototype),"attach",this).call(this,e);var n=this.component.ce("div",{ref:"passwordStrengthIndicator"});this.insertContainer(e,n)||this.component.append(n),this._element=n,this.component.on("redraw",(function(){return t.updateView()})),this.component.on("componentError",(function(){return t.updateView()})),this.updateView()}},{key:"insertContainer",value:function(e,t){var n,r;if(!e||!t)return!1;var o,i=null===(n=this.settings.location)||void 0===n?void 0:n.insert,a=null===(r=this.settings.location)||void 0===r?void 0:r.selector;if(a&&(o=e.querySelector(a)),!o)return console.warn("No elements found using selector: ".concat(a)),!1;var l=o.parentNode;switch(i){case"after":return!!l&&(l.insertBefore(t,o.nextSibling||null),!0);case"before":return!!l&&(l.insertBefore(t,o),!0);default:return console.warn("Unknown insert option: ".concat(i)),!1}}},{key:"destroy",value:function(){f(m(d.prototype),"destroy",this).call(this)}},{key:"getLevel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.entropy,t=this.levels[0],n=t.maxEntropy;if(e<=t.maxEntropy)return t;if(e>=this.maxEntropy)return this.levels[this.levels.length-1];for(var r=1;rn&&e<=o.maxEntropy)return o;n=o.maxEntropy}return t}},{key:"updateView",value:function(){if(this.element){var e=this.render();this.element.innerHTML=e}}}],r=[{key:"info",get:function(){return{supportedComponents:["password"],name:"passwordStrength",components:a.default,label:"Password Strength",defaultSettings:{rulesSettings:[{name:"length",required:!1,message:"Value should be longer"},{name:"upperCase",required:!1,message:"Value should have uppercase letters"},{name:"numeric",required:!1,message:"Value should have numeric symbols"},{name:"lowerCase",required:!1,message:"Value should be have lowercase letters"},{name:"symbols",required:!1,message:"Value should have symbols"}],updateOn:"levelChange",required:!0,levels:[{name:"Low",maxEntropy:28,style:"danger"},{name:"Medium",maxEntropy:45,style:"warning"},{name:"High",maxEntropy:59,style:"info"},{name:"Very High",maxEntropy:85,style:"success"}],blackList:[],template:"\n
    \n {% if (!ctx.readOnly && !ctx.pristine) { %}\n
    \n {% } %}\n \n ",location:{insert:"after",selector:'[ref="element"]'}}}}}],n&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(i.default);t.default=y},24951:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.editForms=t.default=void 0,n(21249),n(68309);var r,o=(r=n(16996))&&r.__esModule?r:{default:r},i=[o.default.info].map((function(e){var t=e.components,n=e.name;return{type:"form",key:"settings",display:"form",input:!0,components:t,defaultValue:{data:e.defaultSettings},customConditional:function(e){return e.row.name.value===n}}}));t.editForms=i;var a={passwordStrength:o.default};t.default=a},57514:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=l(n(96486)),o=l(n(6487)),i=l(n(95529)),a=l(n(72940));function l(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function S(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||P(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return l.default.defaultsDeep(e,this.defaultSchema)}},{key:"ready",get:function(){return i.default.resolve(this)}},{key:"isPDFReadOnlyMode",get:function(){return this.parent&&this.parent.form&&"pdf"===this.parent.form.display&&this.options.readOnly}},{key:"labelInfo",get:function(){var e={};e.hidden=this.labelIsHidden(),e.className="",e.labelPosition=this.component.labelPosition,e.tooltipClass="".concat(this.iconClass("question-sign")," text-muted");var t=this.isPDFReadOnlyMode;return this.hasInput&&this.component.validate&&(0,c.boolValue)(this.component.validate.required)&&!t&&(e.className+=" field-required"),e.hidden&&(e.className+=" control-label--hidden"),this.info.attr.id&&(e.for=this.info.attr.id),e}},{key:"init",value:function(){var e,t=this;this.disabled=this.shouldDisabled,this._visible=this.conditionallyVisible(null,null),null!==(e=this.component.addons)&&void 0!==e&&e.length&&this.component.addons.forEach((function(e){return t.createAddon(e)}))}},{key:"afterComponentAssign",value:function(){}},{key:"createAddon",value:function(e){var t,n=e.name;if(n){var r=(null===(t=e.settings)||void 0===t?void 0:t.data)||{},o=m.default[n.value],i=null;if(o){var a=o.info.supportedComponents;null!=a&&a.length&&-1===a.indexOf(this.component.type)?console.warn("Addon ".concat(n.label," does not support component of type ").concat(this.component.type,".")):(i=new o(r,this),this.addons.push(i))}return i}}},{key:"destroy",value:function(){C(D(w.prototype),"destroy",this).call(this),this.detach(),this.addons.forEach((function(e){return e.destroy()}))}},{key:"shouldDisabled",get:function(){return this.options.readOnly||this.component.disabled||this.options.hasOwnProperty("disabled")&&this.options.disabled[this.key]}},{key:"isInputComponent",get:function(){return!this.component.hasOwnProperty("input")||this.component.input}},{key:"allowData",get:function(){return this.hasInput}},{key:"hasInput",get:function(){return this.isInputComponent||this.refs.input&&this.refs.input.length}},{key:"defaultSchema",get:function(){return w.schema()}},{key:"key",get:function(){return l.default.get(this.component,"key","")}},{key:"parentVisible",get:function(){return this._parentVisible},set:function(e){this._parentVisible=e}},{key:"parentDisabled",get:function(){return this._parentDisabled},set:function(e){this._parentDisabled=e}},{key:"shouldForceVisibility",value:function(e,t){return!!this.options[t]&&(e||(e=this.component),l.default.isArray(this.options[t])?this.options[t].includes(e.key):this.options[t][e.key])}},{key:"shouldForceHide",value:function(e){return this.shouldForceVisibility(e,"hide")}},{key:"shouldForceShow",value:function(e){return this.shouldForceVisibility(e,"show")}},{key:"visible",get:function(){return!!(this.builderMode||this.previewMode||this.options.showHiddenFields)||!this.shouldForceHide()&&(!!this.shouldForceShow()||this._visible&&this._parentVisible)},set:function(e){if(this._visible!==e){if(e&&this.shouldForceHide())return;if(!e&&this.shouldForceShow())return;this._visible=e,this.clearOnHide(),this.redraw()}}},{key:"currentForm",get:function(){return this._currentForm},set:function(e){this._currentForm=e}},{key:"fullMode",get:function(){return"full"===this.options.attachMode}},{key:"builderMode",get:function(){return"builder"===this.options.attachMode}},{key:"calculatedPath",get:function(){return console.error("component.calculatedPath was deprecated, use component.path instead."),this.path}},{key:"labelPosition",get:function(){return this.component.labelPosition}},{key:"labelWidth",get:function(){var e=this.component.labelWidth;return e>=0?e:30}},{key:"labelMargin",get:function(){var e=this.component.labelMargin;return e>=0?e:3}},{key:"isAdvancedLabel",get:function(){return["left-left","left-right","right-left","right-right"].includes(this.labelPosition)}},{key:"labelPositions",get:function(){return this.labelPosition.split("-")}},{key:"skipInEmail",get:function(){return!1}},{key:"rightDirection",value:function(e){return!this.options.condensedMode&&"right"===e}},{key:"getLabelInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.rightDirection(this.labelPositions[0]),n="left"===this.labelPositions[0]||e,r=this.rightDirection(this.labelPositions[1]),o="";if(this.component.hideLabel){var i=e?0:this.labelWidth+this.labelMargin;o=t?"margin-right: ".concat(i,"%"):"",o=n?"margin-left: ".concat(i,"%"):""}var a="\n flex: ".concat(this.labelWidth,";\n ").concat(t?"margin-left":"margin-right",": ").concat(this.labelMargin,"%;\n "),l="\n flex: ".concat(100-this.labelWidth-this.labelMargin,";\n ").concat(o,";\n ").concat(this.component.hideLabel?"max-width: ".concat(100-this.labelWidth-this.labelMargin):"",";\n ");return{isRightPosition:t,isRightAlign:r,labelStyles:a,contentStyles:l}}},{key:"getModifiedSchema",value:function(e,t,n){var r=this,o={};return t?(l.default.each(e,(function(e,i){if(!l.default.isArray(e)&&l.default.isObject(e)&&t.hasOwnProperty(i)){var a=r.getModifiedSchema(e,t[i],!0);l.default.isEmpty(a)||(o[i]=a)}else l.default.isArray(e)?0===e.length||l.default.isEqual(e,t[i])||(o[i]=e):(!n&&"type"===i||!n&&"key"===i||!n&&"label"===i||!n&&"input"===i||!n&&"tableView"===i||""!==e&&!t.hasOwnProperty(i)||""!==e&&e!==t[i]||t[i]&&e!==t[i])&&(o[i]=e)})),o):e}},{key:"schema",get:function(){return(0,c.fastCloneDeep)(this.getModifiedSchema(l.default.omit(this.component,"id"),this.defaultSchema))}},{key:"isInDataGrid",get:function(){return this.inDataGrid}},{key:"t",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";if(e in v.default&&n._userInput)return e;n.data=this.rootValue,n.row=this.data,n.component=this.component;for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i");return this.getFormattedAttribute(t)}},{key:"isHtmlRenderMode",value:function(){return"html"===this.options.renderMode}},{key:"renderTemplate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,o=r||this.options.renderMode||"form";n.component=this.component,n.self=this,n.options=this.options,n.readOnly=this.options.readOnly,n.iconClass=this.iconClass.bind(this),n.size=this.size.bind(this),n.t=this.t.bind(this),n.transform=this.transform.bind(this),n.id=n.id||this.id,n.key=n.key||this.key,n.value=n.value||this.dataValue,n.disabled=this.disabled,n.builder=this.builderMode,n.render=function(){return console.warn("Form.io 'render' template function is deprecated.\n If you need to render template (template A) inside of another template (template B),\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B"),t.renderTemplate.apply(t,arguments)},n.label=n.labelInfo||this.labelInfo,n.tooltip=this.getFormattedTooltip(this.component.tooltip);var i=["".concat(e,"-").concat(this.component.type,"-").concat(this.key),"".concat(e,"-").concat(this.component.type),"".concat(e,"-").concat(this.key),"".concat(e)];return this.hook("render".concat(e.charAt(0).toUpperCase()+e.substring(1,e.length)),this.interpolate(this.getTemplate(i,o),n),n,o)}},{key:"sanitize",value:function(e,t,n){var r;return this.shouldSanitizeValue||t?c.sanitize(e,{sanitizeConfig:l.default.merge((null===(r=this.options)||void 0===r?void 0:r.sanitizeConfig)||{},n||{})}):e}},{key:"renderString",value:function(e,t){return e?this.interpolate(e,t):""}},{key:"performInputMapping",value:function(e){return e}},{key:"widget",get:function(){var e,t=this.component.widget;return t&&null!==(e=this.root)&&void 0!==e&&e.shadowRoot&&(t.shadowRoot=this.root.shadowRoot),t&&h.default[t.type]?new h.default[t.type](t,this.component,this):null}},{key:"getBrowserLanguage",value:function(){var e,t=window.navigator,n=["language","browserLanguage","systemLanguage","userLanguage"];if(Array.isArray(t.languages))for(var r=0;r [ref="'.concat(n,'"]'):'[ref="'.concat(n,'"]');o&&r.startsWith("single")?this.refs[n]=e.querySelector(i):this.refs[n]=e.querySelectorAll(i)}}},{key:"setOpenModalElement",value:function(e){this.componentModal.setOpenModalElement(e||this.getModalPreviewTemplate())}},{key:"getModalPreviewTemplate",value:function(){var e,t,n="password"===this.component.type?this.dataValue.replace(/./g,"•"):this.dataValue,r=this.error?{level:"error",message:this.error.message}:"";return this.hasInput&&null!==(e=this.component.validate)&&void 0!==e&&e.required&&!this.isPDFReadOnlyMode&&(t={className:"field-required"}),this.renderTemplate("modalPreview",{previewText:this.getValueAsString(n,{modalPreview:!0})||this.t("Click to set value"),messages:r&&this.renderTemplate("message",r),labelInfo:t})}},{key:"build",value:function(e){return e=e||this.element,this.empty(e),this.setContent(e,this.render()),this.attach(e)}},{key:"hasModalSaveButton",get:function(){return!0}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unknown component: ".concat(this.component.type),t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.visible;return this.rendered=!0,this.builderMode||this.previewMode||!this.component.modalEdit?this.renderTemplate("component",{visible:n,id:this.id,classes:this.className,styles:this.customStyle,children:e},t):p.default.render(this,{visible:n,showSaveButton:this.hasModalSaveButton,id:this.id,classes:this.className,styles:this.customStyle,children:e},t)}},{key:"attachTooltips",value:function(e){var t=this;null==e||e.forEach((function(e,n){if(e){var r=e.getAttribute("data-tooltip"),o=e.getAttribute("data-title"),i=t.interpolate(o||r).replace(/(?:\r\n|\r|\n)/g,"
    ");t.tooltips[n]=(0,a.default)(e,{allowHTML:!0,trigger:"mouseenter click focus",placement:"right",zIndex:1e4,interactive:!0,content:t.t(t.sanitize(i),{_userInput:!0})})}}))}},{key:"createComponentModal",value:function(e,t,n){return new p.default(this,e,t,n)}},{key:"attach",value:function(e){if(!this.builderMode&&!this.previewMode&&this.component.modalEdit){var t=!!this.componentModal&&this.componentModal.isOpened,n=t?this.componentModal.currentValue:this.dataValue,r=this.componentModal&&t?this.componentModal.openModalTemplate:null;this.componentModal=this.createComponentModal(e,t,n),this.setOpenModalElement(r)}this.attached=!0,this.element=e,e.component=this,this.element.id&&(this.id=this.element.id,this.component.id=this.id),this.loadRefs(e,{messageContainer:"single",tooltip:"multiple"}),this.attachTooltips(this.refs.tooltip),this.attachLogic(),this.autofocus(),this.hook("attachComponent",e,this);var o=this.component.type;return o&&this.hook("attach".concat(o.charAt(0).toUpperCase()+o.substring(1,o.length)),e,this),this.restoreFocus(),this.addons.forEach((function(t){return t.attach(e)})),i.default.resolve()}},{key:"restoreFocus",value:function(){var e,t,n;(null===(e=this.root)||void 0===e||null===(t=e.focusedComponent)||void 0===t?void 0:t.path)===this.path&&(this.loadRefs(this.element,{input:"multiple"}),this.focus(null===(n=this.root.currentSelection)||void 0===n?void 0:n.index),this.restoreCaretPosition())}},{key:"addShortcut",value:function(e,t){e&&this.root&&this.root!==this&&(t||(t=this.component.shortcut),this.root.addShortcut(e,t))}},{key:"removeShortcut",value:function(e,t){e&&this.root!==this&&(t||(t=this.component.shortcut),this.root.removeShortcut(e,t))}},{key:"detach",value:function(){this.refs={},this.removeEventListeners(),this.detachLogic(),this.tooltip&&this.tooltip.destroy()}},{key:"checkRefresh",value:function(e,t,n){var r=l.default.get(t,"instance.path",!1);r&&this.path===r||("data"===e?this.refresh(this.data,t,n):r&&(0,c.getComponentPath)(t.instance)===e&&t&&t.instance&&this.inContext(t.instance)&&this.refresh(t.value,t,n))}},{key:"checkRefreshOn",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=e||[],!n.noRefresh){!e.length&&n.changed&&(e=[n.changed]);var r=n.fromBlur?this.component.refreshOnBlur:this.component.refreshOn||this.component.redrawOn;r&&(Array.isArray(r)?r.forEach((function(r){return e.forEach((function(e){return t.checkRefresh(r,e,n)}))})):e.forEach((function(e){return t.checkRefresh(r,e,n)})))}}},{key:"refresh",value:function(e){this.hasOwnProperty("refreshOnValue")?this.refreshOnChanged=!l.default.isEqual(e,this.refreshOnValue):this.refreshOnChanged=!0,this.refreshOnValue=(0,c.fastCloneDeep)(e),this.refreshOnChanged&&(this.component.clearOnRefresh&&this.setValue(null),this.triggerRedraw())}},{key:"inContext",value:function(e){if(e.data===this.data)return!0;for(var t=this.parent;t;){if(t.data===e.data)return!0;t=t.parent}return!1}},{key:"viewOnly",get:function(){return this.options.readOnly&&this.options.viewAsHtml}},{key:"createViewOnlyElement",value:function(){return this.element=this.ce("dl",{id:this.id}),this.element&&(this.element.component=this),this.element}},{key:"defaultViewOnlyValue",get:function(){return"-"}},{key:"getWidgetValueAsString",value:function(e,t){var n=this,r=!this.refs.input||!this.refs.input[0]||!this.refs.input[0].widget;if(!e||r)return this.widget&&e?this.widget.getValueAsString(e):e;if(Array.isArray(e)){var o=[];return e.forEach((function(e,r){var i=n.refs.input[r]&&n.refs.input[r].widget;i&&o.push(i.getValueAsString(e,t))})),o}return this.refs.input[0].widget.getValueAsString(e,t)}},{key:"getValueAsString",value:function(e,t){if(!e)return"";if(e=this.getWidgetValueAsString(e,t),Array.isArray(e))return e.join(", ");if(l.default.isPlainObject(e))return JSON.stringify(e);if(null==e)return"";var n=e.toString();return this.sanitize(n)}},{key:"getView",value:function(e,t){return this.component.protected?"--- PROTECTED ---":this.getValueAsString(e,t)}},{key:"updateItems",value:function(){this.restoreValue(),this.onChange.apply(this,arguments)}},{key:"itemValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l.default.isObject(e)&&!l.default.isArray(e)){if(this.valueProperty)return l.default.get(e,this.valueProperty);if(t)return e.value}return e}},{key:"itemValueForHTMLMode",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return Array.isArray(e)?t.itemValueForHTMLMode(e):t.itemValue(e)})).join(", "):this.itemValue(e)}},{key:"createModal",value:function(e,t,n){var r=this,o=this.ce("div",t||{});this.setContent(o,this.renderTemplate("dialog")),o.refs={},this.loadRefs.call(o,o,{dialogOverlay:"single",dialogContents:"single",dialogClose:"single"}),o.refs.dialogContents.appendChild(e),document.body.appendChild(o),document.body.classList.add("modal-open"),o.close=function(){document.body.classList.remove("modal-open"),o.dispatchEvent(new CustomEvent("close"))},this.addEventListener(o,"close",(function(){return r.removeChildFrom(o,document.body)}));var i=function(e){e.preventDefault(),o.close()},a=function(e){n?n().then((function(){return i(e)})).catch((function(){})):i(e)};return this.addEventListener(o.refs.dialogOverlay,"click",a),this.addEventListener(o.refs.dialogClose,"click",a),o}},{key:"optimizeRedraw",get:function(){return!(!this.options.optimizeRedraw||!this.element||this.visible||(this.addClass(this.element,"formio-removed"),0))}},{key:"className",get:function(){var e=this.hasInput?"".concat(this.transform("class","form-group")," has-feedback "):"";return e+="formio-component formio-component-".concat(this.component.type," "),this.key&&"form"!==this.key&&(e+="formio-component-".concat(this.key," ")),this.component.multiple&&(e+="formio-component-multiple "),this.component.customClass&&(e+=this.component.customClass),this.hasInput&&this.component.validate&&(0,c.boolValue)(this.component.validate.required)&&(e+=" required"),this.labelIsHidden()&&(e+=" formio-component-label-hidden"),this.visible||(e+=" formio-hidden"),e}},{key:"customStyle",get:function(){var e="";return l.default.each(this.component.style,(function(t,n){""!==t&&(e+="".concat(n,":").concat(t,";"))})),e}},{key:"isMobile",get:function(){return(0,s.default)()}},{key:"getElement",value:function(){return this.element}},{key:"evalContext",value:function(e){return C(D(w.prototype),"evalContext",this).call(this,Object.assign({component:this.component,row:this.data,rowIndex:this.rowIndex,data:this.rootValue,iconClass:this.iconClass.bind(this),t:this.t.bind(this),submission:this.root?this.root._submission:{data:this.rootValue},form:this.root?this.root._form:{},options:this.options},e))}},{key:"setPristine",value:function(e){this.pristine=e}},{key:"isPristine",get:function(){return this.pristine}},{key:"setDirty",value:function(e){this.dirty=e}},{key:"isDirty",get:function(){return this.dirty}},{key:"removeValue",value:function(e){this.splice(e),this.redraw(),this.restoreValue(),this.triggerRootChange()}},{key:"iconClass",value:function(e,t){var n=this.options.iconset||L.current.defaultIconset||"fa";return L.current.hasOwnProperty("iconClass")?L.current.iconClass(n,e,t):"fa"===this.options.iconset?L.defaultTemplates.iconClass(n,e,t):e}},{key:"size",value:function(e){return L.current.hasOwnProperty("size")?L.current.size(e):e}},{key:"name",get:function(){return this.t(this.component.label||this.component.placeholder||this.key,{_userInput:!0})}},{key:"errorLabel",get:function(){return this.t(this.component.errorLabel||this.component.label||this.component.placeholder||this.key)}},{key:"errorMessage",value:function(e){return this.component.errors&&this.component.errors[e]?this.component.errors[e]:e}},{key:"setContent",value:function(e,t,n,r){return e instanceof HTMLElement&&(e.innerHTML=this.sanitize(t,n,r),!0)}},{key:"restoreCaretPosition",value:function(){var e,t;if(null!==(e=this.root)&&void 0!==e&&e.currentSelection&&null!==(t=this.refs.input)&&void 0!==t&&t.length){var n=this.root.currentSelection,r=n.selection,o=n.index,i=this.refs.input[o],a=function(e){return/text|search|password|tel|url/i.test((null==e?void 0:e.type)||"")};if(i){var l;a(i)&&(l=i).setSelectionRange.apply(l,S(r))}else{var s,u=(null===(s=(i=this.refs.input[this.refs.input.length]).value)||void 0===s?void 0:s.length)||0;a(i)&&i.setSelectionRange(u,u)}}}},{key:"redraw",value:function(){if(!this.element||!this.element.parentNode||this.optimizeRedraw)return i.default.resolve();this.detach(),this.emit("redraw");var e=this.element.parentNode,t=Array.prototype.indexOf.call(e.children,this.element);return this.element.outerHTML=this.sanitize(this.render()),this.element=e.children[t],this.attach(this.element)}},{key:"rebuild",value:function(){return this.destroy(),this.init(),this.visible=this.conditionallyVisible(null,null),this.redraw()}},{key:"removeEventListeners",value:function(){C(D(w.prototype),"removeEventListeners",this).call(this),this.tooltips.forEach((function(e){return e.destroy()})),this.tooltips=[]}},{key:"hasClass",value:function(e,t){if(e)return C(D(w.prototype),"hasClass",this).call(this,e,this.transform("class",t))}},{key:"addClass",value:function(e,t){if(e)return C(D(w.prototype),"addClass",this).call(this,e,this.transform("class",t))}},{key:"removeClass",value:function(e,t){if(e)return C(D(w.prototype),"removeClass",this).call(this,e,this.transform("class",t))}},{key:"hasCondition",value:function(){return null!==this._hasCondition||(this._hasCondition=c.hasCondition(this.component)),this._hasCondition}},{key:"conditionallyVisible",value:function(e,t){return e=e||this.rootValue,t=t||this.data,this.builderMode||this.previewMode||!this.hasCondition()?!this.component.hidden:(e=e||(this.root?this.root.data:{}),this.checkCondition(t,e))}},{key:"checkCondition",value:function(e,t){return c.checkCondition(this.component,e||this.data,t||this.rootValue,this.root?this.root._form:{},this)}},{key:"checkComponentConditions",value:function(e,t,n){e=e||this.rootValue,t=t||{},n=n||this.data,!this.builderMode&!this.previewMode&&this.fieldLogic(e,n)&&this.redraw();var r=this.conditionallyVisible(e,n);return this.visible!==r&&(this.visible=r),r}},{key:"checkConditions",value:function(e,t,n){return e=e||this.rootValue,t=t||{},n=n||this.data,this.checkComponentConditions(e,t,n)}},{key:"logic",get:function(){return this.component.logic||[]}},{key:"fieldLogic",value:function(e,t){var n=this;e=e||this.rootValue,t=t||this.data;var r=this.logic;if(0!==r.length){var o=(0,c.fastCloneDeep)(this.originalComponent),i=r.reduce((function(r,i){var a=c.checkTrigger(o,i.trigger,t,e,n.root?n.root._form:{},n);return!!a&&n.applyActions(o,i.actions,a,t,e)||r}),!1);if(!l.default.isEqual(this.component,o)){this.component=o,i=!0;var a=this.shouldDisabled;this.disabled!==a&&(this.disabled=a)}return i}}},{key:"isIE",value:function(){if("undefined"==typeof window)return!1;var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)}},{key:"defineActionValue",value:function(e,t){return this.evaluate(e.value,t,"value")}},{key:"applyActions",value:function(e,t,n,r,o){var i=this;return o=o||this.rootValue,r=r||this.data,t.reduce((function(t,a){switch(a.type){case"property":c.setActionProperty(e,a,n,r,o,i);var s=a.property.value;l.default.isEqual(l.default.get(i.component,s),l.default.get(e,s))||(t=!0);break;case"value":var u=i.getValue(),f=i.defineActionValue(a,{value:l.default.clone(u),data:o,row:r,component:e,result:n});l.default.isEqual(u,f)||i.component.clearOnHide&&!i.visible||(i.setValue(f),i.viewOnly&&(i.dataValue=f),t=!0);break;case"mergeComponentSchema":var d=i.evaluate(a.schemaDefinition,{value:l.default.clone(i.getValue()),data:o,row:r,component:e,result:n},"schema");l.default.assign(e,d),l.default.isEqual(i.component,e)||(t=!0);break;case"customAction":var p=i.getValue(),h=i.evaluate(a.customAction,{value:l.default.clone(p),data:o,row:r,input:p,component:e,result:n},"value");l.default.isEqual(p,h)||i.component.clearOnHide&&!i.visible||(i.setValue(h),i.viewOnly&&(i.dataValue=h),t=!0)}return t}),!1)}},{key:"addInputError",value:function(e,t,n){this.addMessages(e),this.setErrorClasses(n,t,!!e)}},{key:"removeInputError",value:function(e){this.setErrorClasses(e,!0,!1)}},{key:"addMessages",value:function(e){var t=this;e&&("string"==typeof e&&(e={messages:e,level:"error"}),Array.isArray(e)||(e=[e]),e=l.default.uniqBy(e,(function(e){return e.message})),this.refs.messageContainer&&this.setContent(this.refs.messageContainer,e.map((function(e){return e.message&&"string"==typeof e.message&&(e.message=e.message.replaceAll("<","<").replaceAll(">",">")),t.renderTemplate("message",e)})).join("")))}},{key:"setErrorClasses",value:function(e,t,n,r){var o=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.element;this.clearErrorClasses(),e.forEach((function(e){o.setElementInvalid(o.performInputMapping(e),!1)})),this.setInputWidgetErrorClasses(e,n),this.visible&&(n&&(e.forEach((function(e){o.setElementInvalid(o.performInputMapping(e),!0)})),t&&this.options.highlightErrors?this.addClass(i,this.options.componentErrorClass):this.addClass(i,"has-error")),r&&this.addClass(i,"has-message"))}},{key:"setElementInvalid",value:function(e,t){e&&(t?this.addClass(e,"is-invalid"):this.removeClass(e,"is-invalid"),e.setAttribute("aria-invalid",t?"true":"false"))}},{key:"clearOnHide",value:function(){this.rootPristine&&!this.options.server&&!(0,c.isInsideScopingComponent)(this)||!1===this.component.clearOnHide||this.options.readOnly||this.options.showHiddenFields||(this.visible?!this.hasValue()&&this.shouldAddDefaultValue&&this.setValue(this.defaultValue,{noUpdateEvent:!0}):this.deleteValue())}},{key:"triggerRootChange",value:function(){var e;if(this.options.onChange)(e=this.options).onChange.apply(e,arguments);else if(this.root){var t;(t=this.root).triggerChange.apply(t,arguments)}}},{key:"onChange",value:function(e,t){(e=e||{}).modified&&(e.noPristineChangeOnModified||(this.pristine=!1),this.addClass(this.getElement(),"formio-modified")),"blur"!==this.component.validateOn||this.errors.length||(e.noValidate=!0),this.component.onChange&&this.evaluate(this.component.onChange,{flags:e});var n={instance:this,component:this.component,value:this.dataValue,flags:e};this.emit("componentChange",n);var r=!1;return e.modified&&(r=!0,delete e.modified),t||this.triggerRootChange(e,n,r),n}},{key:"wysiwygDefault",get:function(){return{quill:{theme:"snow",placeholder:this.t(this.component.placeholder,{_userInput:!0}),modules:{toolbar:[[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{font:[]}],["bold","italic","underline","strike",{script:"sub"},{script:"super"},"clean"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["blockquote","code-block"],["link","image","video","formula","source"]]}},ace:{theme:"ace/theme/xcode",maxLines:12,minLines:12,tabSize:2,mode:"ace/mode/javascript",placeholder:this.t(this.component.placeholder,{_userInput:!0})},ckeditor:{image:{toolbar:["imageTextAlternative","|","imageStyle:full","imageStyle:alignLeft","imageStyle:alignCenter","imageStyle:alignRight"],styles:["full","alignLeft","alignCenter","alignRight"]},extraPlugins:[]},default:{}}}},{key:"addCKE",value:function(e,t,n){return(t=l.default.isEmpty(t)?{}:t).base64Upload=!this.component.isUploadEnabled,t.mediaEmbed={previewsInData:!0},t=l.default.merge(this.wysiwygDefault.ckeditor,l.default.get(this.options,"editors.ckeditor.settings",{}),t),this.component.isUploadEnabled&&t.extraPlugins.push((0,y.getFormioUploadAdapterPlugin)(this.fileService,this)),u.GlobalFormio.requireLibrary("ckeditor",I?"CKEDITOR":"ClassicEditor",l.default.get(this.options,"editors.ckeditor.src","".concat(u.GlobalFormio.cdn.ckeditor,"/ckeditor.js")),!0).then((function(){if(!e.parentNode)return i.default.reject();if(I){var r=CKEDITOR.replace(e);return r.on("change",(function(){return n(r.getData())})),i.default.resolve(r)}return ClassicEditor.create(e,t).then((function(e){return e.model.document.on("change",(function(){return n(e.data.get())})),e}))}))}},{key:"addQuill",value:function(e,t,n){var r=this;return t=l.default.isEmpty(t)?this.wysiwygDefault.quill:t,t=k(k({},t=l.default.merge(this.wysiwygDefault.quill,l.default.get(this.options,"editors.quill.settings",{}),t)),{},{modules:k({table:!0},t.modules)}),u.GlobalFormio.requireLibrary("quill-css-".concat(t.theme),"Quill",[{type:"styles",src:"".concat(u.GlobalFormio.cdn.quill,"/quill.").concat(t.theme,".css")}],!0),u.GlobalFormio.requireLibrary("quill","Quill",l.default.get(this.options,"editors.quill.src","".concat(u.GlobalFormio.cdn.quill,"/quill.min.js")),!0).then((function(){return u.GlobalFormio.requireLibrary("quill-table","Quill","".concat(u.GlobalFormio.cdn.baseUrl,"/quill/quill-table.js"),!0).then((function(){if(!e.parentNode)return i.default.reject();r.quill=new Quill(e,I?k(k({},t),{},{modules:{}}):t);var o=document.createElement("textarea");o.setAttribute("class","quill-source-code"),r.quill.addContainer("ql-custom").appendChild(o);var a=e.parentNode.querySelector(".ql-source");a&&r.addEventListener(a,"click",(function(e){e.preventDefault(),"inherit"===o.style.display&&r.quill.setContents(r.quill.clipboard.convert({html:o.value})),o.style.display="none"===o.style.display?"inherit":"none"})),r.addEventListener(e,"click",(function(){return r.quill.focus()}));for(var l=document.querySelectorAll(".ql-formats > button"),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};if(this.hasValue()){var n=this.dataValue||[];l.default.isArray(n)&&n.hasOwnProperty(e)&&(n.splice(e,1),this.dataValue=n,this.triggerChange(t))}}},{key:"unset",value:function(){l.default.unset(this._data,this.key)}},{key:"deleteValue",value:function(){this.setValue(null,{noUpdateEvent:!0,noDefault:!0}),this.unset()}},{key:"getCustomDefaultValue",value:function(e){return this.component.customDefaultValue&&!this.options.preview&&(e=this.evaluate(this.component.customDefaultValue,{value:""},"value")),e}},{key:"shouldAddDefaultValue",get:function(){return!this.options.noDefaults||this.component.defaultValue&&!this.isEmpty(this.component.defaultValue)||this.component.customDefaultValue}},{key:"defaultValue",get:function(){var e=this,t=this.emptyValue;this.component.defaultValue&&(t=this.component.defaultValue),t=this.getCustomDefaultValue(t);var n=function(t){if("string"==typeof t){if("textfield"!==e.component.type){var n=e.placeholderChar;t=(0,o.conformToMask)(t,e.defaultMask,{placeholderChar:n}).conformedValue,c.matchInputMask(t,e.defaultMask)||(t="")}}else t="";return t};return this.defaultMask&&(t=Array.isArray(t)?t.map(n):n(t)),l.default.cloneDeep(t)}},{key:"getValue",value:function(){if(!this.hasInput||this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var e=[];for(var t in this.refs.input)if(this.refs.input.hasOwnProperty(t)){if(!this.component.multiple)return this.getValueAt(t);e.push(this.getValueAt(t))}return 0!==e.length||this.component.multiple?e:""}},{key:"getValueAt",value:function(e){var t=this.performInputMapping(this.refs.input[e]);return t?t.value:void 0}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);if(e=this.dataValue,!this.hasInput)return n;var r=Array.isArray(e),o=this.refs.fileLink||this.refs.input;if(r&&Array.isArray(this.defaultValue)&&this.refs.hasOwnProperty("input")&&o&&o.length!==e.length&&this.visible&&this.redraw(),this.isHtmlRenderMode()&&t&&t.fromSubmission&&n)return this.redraw(),n;for(var i in this.refs.input)this.refs.input.hasOwnProperty(i)&&this.setValueAt(i,r?e[i]:e,t);return n}},{key:"setValueAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.noDefault||null!=t||this.component.multiple||(t=this.defaultValue);var r=this.performInputMapping(this.refs.input[e]),o=this.refs.valueMaskInput;null!=o&&o.mask&&o.mask.textMaskInputElement&&o.mask.textMaskInputElement.update(t),r.mask&&r.mask.textMaskInputElement?r.mask.textMaskInputElement.update(t):r.widget&&r.widget.setValue?r.widget.setValue(t):r.value=t}},{key:"hasSetValue",get:function(){return this.hasValue()&&!this.isEmpty(this.dataValue)}},{key:"setDefaultValue",value:function(){if(this.defaultValue&&this.shouldAddDefaultValue){var e=this.component.multiple&&!this.dataValue.length?[]:this.defaultValue;this.setValue(e,{noUpdateEvent:!0})}}},{key:"restoreValue",value:function(){this.hasSetValue?this.setValue(this.dataValue,{noUpdateEvent:!0}):this.setDefaultValue()}},{key:"normalizeValue",value:function(e){return this.component.multiple&&!Array.isArray(e)&&(e=e?[e]:[]),e}},{key:"updateComponentValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.resetValue||null!=e?e:this.getValue();n=this.normalizeValue(n,t);var r=this.dataValue,o=void 0!==n&&this.hasChanged(n,r);return o&&(this.dataValue=n,o=this.dataValue!==r,this.updateOnChange(t,o)),this.componentModal&&t&&t.fromSubmission&&this.componentModal.setValue(e),o}},{key:"updateValue",value:function(){return this.updateComponentValue.apply(this,arguments)}},{key:"getIcon",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"icon";return this.renderTemplate("icon",{className:this.iconClass(e),ref:r,styles:n,content:t})}},{key:"resetValue",value:function(){this.unset(),this.setValue(this.emptyValue,{noUpdateEvent:!0,noValidate:!0,resetValue:!0})}},{key:"hasChanged",value:function(e,t){return!(null==e&&(null==t||this.isEmpty(t))||(null==e||!this.allowData||this.hasValue())&&l.default.isEqual(e,t))}},{key:"updateOnChange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(e.noUpdateEvent||!t||(this.triggerChange(e),0))}},{key:"convertNumberOrBoolToString",value:function(e){return"number"==typeof e||"boolean"==typeof e?e.toString():e}},{key:"doValueCalculation",value:function(e,t,n){var r;return this.evaluate(this.component.calculateValue,{value:e,data:t,row:n||this.data,submission:(null===(r=this.root)||void 0===r?void 0:r._submission)||{data:this.rootValue}},"value")}},{key:"calculateComponentValue",value:function(e,t,n){if(this.builderMode||l.default.isUndefined(l.default.get(this,"root.data")))return!1;var r=this.component.clearOnHide,o=!this.visible&&r,i=l.default.get(this.component,"allowCalculateOverride",!1);if(o)return this.hasOwnProperty("calculatedValue")&&i&&l.default.unset(this,"calculatedValue"),!1;if(this.options.readOnly&&!this.options.pdf&&!this.component.calculateValue||!this.component.calculateValue&&!this.component.calculateValueVariable||this.options.server&&!this.component.calculateServer||t.dataSourceInitialLoading&&i)return!1;var a=this.dataValue,s=this.doValueCalculation(a,e,n,t);if(this.options.readOnly&&a&&!s)return!1;l.default.isNil(s)&&(s=this.emptyValue);var u=!l.default.isEqual(a,s);if(i){var f=t.fromSubmission&&!0===this.component.persistent;if(this.isEmpty(a))this.calculationLocked=!1;else if(this.calculationLocked||f)return this.calculationLocked=!0,!1;var d=void 0===this.calculatedValue||t.resetValue;d&&(this.calculatedValue=null);var p=this.normalizeValue(this.convertNumberOrBoolToString(s)),h=this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue)),m=this.normalizeValue(this.convertNumberOrBoolToString(a)),y=!l.default.isEqual(h,p),v=!l.default.isEqual(m,h);if(y&&v&&!d)return!1;if(h&&v&&!y)return this.calculatedValue=null,!1;if(t.isReordered||!y)return!1;if(f)return this.calculatedValue=(0,c.fastCloneDeep)(s),!1;if(d&&!this.isEmpty(a)&&u&&y)return!0}return this.calculatedValue=(0,c.fastCloneDeep)(s),!!u&&(t.noPristineChangeOnModified||(this.pristine=!1),t.triggeredComponentId=this.id,this.setValue(s,t))}},{key:"calculateValue",value:function(e,t,n){return e=e||this.rootValue,t=t||{},n=n||this.data,this.calculateComponentValue(e,t,n)}},{key:"label",get:function(){return this.component.label},set:function(e){this.component.label=e,this.labelElement&&(this.labelElement.innerText=e)}},{key:"getRoot",value:function(){return this.root}},{key:"invalidMessage",value:function(e,t,n,r){return n||this.checkCondition(r,e)?this.invalid?this.invalid:!this.hasInput||!t&&this.pristine?"":l.default.map(f.default.checkComponent(this,e),"message").join("\n\n"):""}},{key:"isValid",value:function(e,t){return!this.invalidMessage(e,t)}},{key:"setComponentValidity",value:function(e,t,n){var r=!!e.filter((function(e){return"error"===e.level&&!e.fromServer})).length;return!e.length||n&&!this.error||this.isEmpty(this.defaultValue)&&!t&&this.pristine?n||this.setCustomValidity(""):this.setCustomValidity(e,t),!r}},{key:"checkComponentValidity",value:function(e,t,n){var r,o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=e||this.rootValue,n=n||this.data;var l=a.async,s=void 0!==l&&l,u=a.silentCheck,c=void 0!==u&&u;if(this.shouldSkipValidation(e,t,n))return this.setCustomValidity(""),!s||i.default.resolve(!0);var d=f.default.checkComponent(this,e,n,!0,s),p=d;return null!==(r=this.serverErrors)&&void 0!==r&&r.length&&(p=d.concat(this.serverErrors)),s?p.then((function(e){return o.setComponentValidity(e,t,c)})):this.setComponentValidity(p,t,c)}},{key:"checkValidity",value:function(e,t,n,r){e=e||this.rootValue,n=n||this.data;var o=this.checkComponentValidity(e,t,n,{silentCheck:r});return this.checkModal(),o}},{key:"checkAsyncValidity",value:function(e,t,n,r){return i.default.resolve(this.checkComponentValidity(e,t,n,{async:!0,silentCheck:r}))}},{key:"checkData",value:function(e,t,n){if(e=e||this.rootValue,t=t||{},n=n||this.data,this.resetCaches(),t.fromBlur||this.checkRefreshOn(t.changes,t),t.noCheck)return!0;if(this.checkComponentConditions(e,t,n),this.id!==t.triggeredComponentId&&this.calculateComponentValue(e,t,n),t.noValidate&&!t.validateOnInit&&!t.fromIframe)return t.fromSubmission&&this.rootPristine&&this.pristine&&this.error&&t.changed&&this.checkComponentValidity(e,!!this.options.alwaysDirty,n,!0),!0;var r=!1;if((this.options.alwaysDirty||t.dirty)&&(r=!0),t.fromSubmission&&this.hasValue(e)&&(r=!0),this.setDirty(r),"blur"===this.component.validateOn&&t.fromSubmission)return!0;var o=this.checkComponentValidity(e,r,n,t);return this.checkModal(),o}},{key:"checkModal",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.component.modalEdit&&this.componentModal&&(t&&!e?this.setErrorClasses([this.refs.openModal],t,!e,!!this.errors.length,this.refs.openModalWrapper):this.clearErrorClasses(this.refs.openModalWrapper))}},{key:"validationValue",get:function(){return this.dataValue}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue,t=!(!l.default.isArray(e)||1!==e.length)&&l.default.isEqual(e[0],this.emptyValue);return null==e||0===e.length||l.default.isEqual(e,this.emptyValue)||t}},{key:"isEqual",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dataValue;return this.isEmpty(e)&&this.isEmpty(t)||l.default.isEqual(e,t)}},{key:"validateMultiple",value:function(){return!0}},{key:"errors",get:function(){return this.error?[this.error]:[]}},{key:"clearErrorClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element;this.removeClass(e,this.options.componentErrorClass),this.removeClass(e,"alert alert-danger"),this.removeClass(e,"has-error"),this.removeClass(e,"has-message")}},{key:"setInputWidgetErrorClasses",value:function(e,t){this.isInputComponent&&this.component.widget&&null!=e&&e.length&&e.forEach((function(e){null!=e&&e.widget&&e.widget.setErrorClasses&&e.widget.setErrorClasses(t)}))}},{key:"addFocusBlurEvents",value:function(e){var t=this;this.addEventListener(e,"focus",(function(){t.root.focusedComponent!==t?(t.root.pendingBlur&&t.root.pendingBlur(),t.root.focusedComponent=t,t.emit("focus",t)):t.root.focusedComponent===t&&t.root.pendingBlur&&(t.root.pendingBlur.cancel(),t.root.pendingBlur=null)})),this.addEventListener(e,"blur",(function(){t.root.pendingBlur=c.delay((function(){t.emit("blur",t),"blur"===t.component.validateOn&&t.root.triggerChange({fromBlur:!0},{instance:t,component:t.component,value:t.dataValue,flags:{fromBlur:!0}}),t.root.focusedComponent=null,t.root.pendingBlur=null}))}))}},{key:"setCustomValidity",value:function(e,t,n){var r=this,o=this.isInputComponent?this.refs.input||[]:null;"string"==typeof e&&e&&(e={level:"error",message:e}),Array.isArray(e)||(e=e?[e]:[]);var i=!!e.filter((function(e){return"error"===e.level})).length,a=o;if(this.component.multiple){var l=Array.from(o);l.forEach((function(e){r.setElementInvalid(r.performInputMapping(e),!1)})),this.setInputWidgetErrorClasses(l,!1),a=l.filter((function(t){var n,r;return null===(n=(r=e).some)||void 0===n?void 0:n.call(r,(function(e){var n;return(null==e||null===(n=e.context)||void 0===n?void 0:n.input)===t}))}))}e.length?(this.refs.messageContainer&&this.empty(this.refs.messageContainer),this.error={component:this.component,message:e[0].message,messages:e,external:!!n},this.emit("componentError",this.error),this.addMessages(e,t,a),a&&this.setErrorClasses(a,t,i,!!e.length)):(!this.error||this.error&&this.error.external===!!n)&&(this.refs.messageContainer&&this.empty(this.refs.messageContainer),this.refs.modalMessageContainer&&this.empty(this.refs.modalMessageContainer),this.error=null,a&&this.setErrorClasses(a,t,i,!!e.length),this.clearErrorClasses())}},{key:"isValueHidden",value:function(){return(!this.component.protected||!this.root.editing)&&!(!this.root||!this.root.hasOwnProperty("editing"))&&!(!this.root||!this.root.editing)&&(this.component.protected||!this.component.persistent||"client-only"===this.component.persistent)}},{key:"shouldSkipValidation",value:function(e,t,n){var r=this,o=(this.component||{}).validateWhenHidden,i=void 0!==o&&o;return[function(){return r.options.readOnly},function(){return!r.hasInput},function(){return r.isValueHidden()},function(){return!r.visible&&!i},function(){return!r.checkCondition(n,e)&&!i}].some((function(e){return e()}))}},{key:"whenReady",value:function(){return console.warn("The whenReady() method has been deprecated. Please use the dataReady property instead."),this.dataReady}},{key:"dataReady",get:function(){return i.default.resolve()}},{key:"asString",value:function(e){return e=e||this.getValue(),(Array.isArray(e)?e:[e]).map(l.default.toString).join(", ")}},{key:"disabled",get:function(){return this._disabled||this.parentDisabled},set:function(e){this._disabled=e}},{key:"setDisabled",value:function(e,t){e&&(e.disabled=t,t?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled"))}},{key:"setLoading",value:function(e,t){e&&e.loading!==t&&(e.loading=t,!e.loader&&t&&(e.loader=this.ce("i",{class:"".concat(this.iconClass("refresh",!0)," button-icon-right")})),e.loader&&(t?this.appendTo(e.loader,e):this.removeChildFrom(e.loader,e)))}},{key:"selectOptions",value:function(e,t,n,r){var o=this;l.default.each(n,(function(t){var n={value:t.value};void 0!==r&&t.value===r&&(n.selected="selected");var i=o.ce("option",n);i.appendChild(o.text(t.label)),e.appendChild(i)}))}},{key:"setSelectValue",value:function(e,t){var n=e.querySelectorAll("option");l.default.each(n,(function(e){e.value===t?e.setAttribute("selected","selected"):e.removeAttribute("selected")})),e.onchange&&e.onchange(),e.onselect&&e.onselect()}},{key:"getRelativePath",value:function(e){var t=".".concat(this.key),n=this.isInputComponent?this.path:this.path.slice(0).replace(t,"");return e.replace(n,"")}},{key:"clear",value:function(){this.detach(),this.empty(this.getElement())}},{key:"append",value:function(e){this.appendTo(e,this.element)}},{key:"prepend",value:function(e){this.prependTo(e,this.element)}},{key:"removeChild",value:function(e){this.removeChildFrom(e,this.element)}},{key:"detachLogic",value:function(){var e=this;this.logic.forEach((function(t){if("event"===t.trigger.type){var n=e.interpolate(t.trigger.event);e.off(n)}}))}},{key:"attachLogic",value:function(){var e=this;this.builderMode||this.logic.forEach((function(t){if("event"===t.trigger.type){var n=e.interpolate(t.trigger.event);e.on(n,(function(){for(var n=(0,c.fastCloneDeep)(e.originalComponent),r=arguments.length,o=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:this.element;if(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top;window.scrollTo(n+window.scrollX,r+window.scrollY)}}},{key:"focus",value:function(e){var t;if("beforeFocus"in this.parent&&this.parent.beforeFocus(this),null!==(t=this.refs.input)&&void 0!==t&&t.length){var n,r="number"==typeof e&&this.refs.input[e]?this.refs.input[e]:this.refs.input[this.refs.input.length-1];if("calendar"===(null===(n=this.component.widget)||void 0===n?void 0:n.type)){var o=r.nextSibling;o&&o.focus()}else r.focus()}this.refs.openModal&&this.refs.openModal.focus(),this.parent.refs.openModal&&this.parent.refs.openModal.focus()}},{key:"fileService",get:function(){if(this.options.fileService)return this.options.fileService;if(this.options.formio)return this.options.formio;if(this.root&&this.root.formio)return this.root.formio;var e=new u.GlobalFormio;return this.root&&this.root._form&&this.root._form._id&&(e.formUrl="".concat(e.projectUrl,"/form/").concat(this.root._form._id)),e}},{key:"resetCaches",value:function(){}},{key:"previewMode",get:function(){return!1}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nYou must assign the show variable a boolean result.

    Note: Advanced Conditional logic will override the results of the Simple Conditional logic.

    Example
    show = !!data.showMe;
    ",'

    Click here for an example

    ')];t.default=a},10024:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(61550))&&r.__esModule?r:{default:r},i=[{weight:0,type:"checkbox",label:"Multiple Values",tooltip:"Allows multiple values to be entered for this field.",key:"multiple",input:!0},{type:"textfield",label:"Default Value",key:"defaultValue",weight:5,placeholder:"Default Value",tooltip:"The Default Value will be the value for this field, before user interaction. Having a default value will override the placeholder text.",input:!0},{weight:30,type:"radio",label:"Persistent",tooltip:"A persistent field will be stored in database when the form is submitted.",key:"persistent",input:!0,inline:!0,defaultValue:!0,values:[{label:"None",value:!1},{label:"Server",value:!0},{label:"Client",value:"client-only"}]},{weight:150,type:"checkbox",label:"Protected",tooltip:"A protected field will not be returned when queried via API.",key:"protected",input:!0},{type:"checkbox",input:!0,weight:200,key:"dbIndex",label:"Database Index",tooltip:"Set this field as an index within the database. Increases performance for submission queries."},{weight:400,type:"checkbox",label:"Encrypted",tooltip:"Encrypt this field on the server. This is two way encryption which is not suitable for passwords.",key:"encrypted",input:!0,logic:[{name:"disabled",trigger:{type:"javascript",javascript:"result = !instance.root.options.sac;"},actions:[{name:"disabled",type:"property",property:{label:"Disabled",value:"disabled",type:"boolean"},state:!0}]},{name:"disabledToolTip",trigger:{type:"javascript",javascript:"result = !instance.root.options.sac;"},actions:[{name:"addDisabledTooltip",type:"property",property:{label:"Tooltip",value:"tooltip",type:"string"},text:"Only available with Security Module. Contact sales@form.io for more information."}]}]},{type:"select",input:!0,key:"redrawOn",label:"Redraw On",weight:600,tooltip:"Redraw this component if another component changes. This is useful if interpolating parts of the component like the label.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{"!":[{var:"data.dataSrc"}]}}},{weight:700,type:"checkbox",label:"Clear Value When Hidden",key:"clearOnHide",defaultValue:!0,tooltip:"When a field is hidden, clear the value.",input:!0},o.default.javaScriptValue("Custom Default Value","customDefaultValue","customDefaultValue",1e3,'

    Example:

    value = data.firstName + " " + data.lastName;

    ','

    Example:

    {"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}
    '),o.default.javaScriptValue("Calculated Value","calculateValue","calculateValue",1100,"

    Example:

    value = data.a + data.b + data.c;

    ",'

    Example:

    {"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}

    Click here for an example

    ',"tokenThe decoded JWT token for the authenticated user."),{type:"checkbox",input:!0,weight:1100,key:"calculateServer",label:"Calculate Value on server",tooltip:"Checking this will run the calculation on the server. This is useful if you wish to override the values submitted with the calculations performed on the server."},{type:"checkbox",input:!0,weight:1200,key:"allowCalculateOverride",label:"Allow Manual Override of Calculated Value",tooltip:"When checked, this will allow the user to manually override the calculated value."}];t.default=i},10684:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92087),t.default=[{weight:0,type:"textfield",input:!0,key:"label",label:"Label",placeholder:"Field Label",tooltip:"The label for this field that will appear next to it.",validate:{required:!0},autofocus:!0},{type:"select",input:!0,key:"labelPosition",label:"Label Position",tooltip:"Position for the label for this field.",weight:20,defaultValue:"top",dataSrc:"values",data:{values:[{label:"Top",value:"top"},{label:"Left (Left-aligned)",value:"left-left"},{label:"Left (Right-aligned)",value:"left-right"},{label:"Right (Left-aligned)",value:"right-left"},{label:"Right (Right-aligned)",value:"right-right"},{label:"Bottom",value:"bottom"}]}},{type:"number",input:!0,key:"labelWidth",label:"Label Width",tooltip:"The width of label on line in percentages.",clearOnHide:!1,weight:30,placeholder:"30",suffix:"%",validate:{min:0,max:100},conditional:{json:{and:[{"!==":[{var:"data.labelPosition"},"top"]},{"!==":[{var:"data.labelPosition"},"bottom"]}]}}},{type:"number",input:!0,key:"labelMargin",label:"Label Margin",tooltip:"The width of label margin on line in percentages.",clearOnHide:!1,weight:30,placeholder:"3",suffix:"%",validate:{min:0,max:100},conditional:{json:{and:[{"!==":[{var:"data.labelPosition"},"top"]},{"!==":[{var:"data.labelPosition"},"bottom"]}]}}},{weight:100,type:"textfield",input:!0,key:"placeholder",label:"Placeholder",placeholder:"Placeholder",tooltip:"The placeholder text that will appear when this field is empty."},{weight:200,type:"textarea",input:!0,key:"description",label:"Description",placeholder:"Description for this field.",tooltip:"The description is text that will appear below the input field.",editor:"ace",as:"html",wysiwyg:{minLines:3,isUseWorkerDisabled:!0}},{weight:300,type:"textarea",input:!0,key:"tooltip",label:"Tooltip",placeholder:"To add a tooltip to this field, enter text here.",tooltip:"Adds a tooltip to the side of this field.",editor:"ace",as:"html",wysiwyg:{minLines:3,isUseWorkerDisabled:!0}},{weight:500,type:"textfield",input:!0,key:"customClass",label:"Custom CSS Class",placeholder:"Custom CSS Class",tooltip:"Custom CSS class to add to this component."},{weight:600,type:"textfield",input:!0,key:"tabindex",label:"Tab Index",placeholder:"0",tooltip:"Sets the tabindex attribute of this component to override the tab order of the form. See the MDN documentation on tabindex for more information."},{weight:1100,type:"checkbox",label:"Hidden",tooltip:"A hidden field is still a part of the form, but is hidden from view.",key:"hidden",input:!0},{weight:1200,type:"checkbox",label:"Hide Label",tooltip:"Hide the label (title, if no label) of this component. This allows you to show the label in the form builder, but not when it is rendered.",key:"hideLabel",input:!0},{weight:1350,type:"checkbox",label:"Initial Focus",tooltip:"Make this field the initially focused element on this form.",key:"autofocus",input:!0},{weight:1370,type:"checkbox",label:"Show Label in DataGrid",tooltip:"Show the label inside each row when in a Datagrid.",key:"dataGridLabel",input:!0,customConditional:function(e){var t,n;return null===(t=e.instance.options)||void 0===t||null===(n=t.flags)||void 0===n?void 0:n.inDataGrid}},{weight:1400,type:"checkbox",label:"Disabled",tooltip:"Disable the form input.",key:"disabled",input:!0},{weight:1500,type:"checkbox",label:"Table View",tooltip:"Shows this value within the table view of the submissions.",key:"tableView",input:!0},{weight:1600,type:"checkbox",label:"Modal Edit",tooltip:"Opens up a modal to edit the value of this component.",key:"modalEdit",input:!0}]},77869:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{label:"HTML Attributes",type:"datamap",input:!0,key:"attributes",keyLabel:"Attribute Name",valueComponent:{type:"textfield",key:"value",label:"Attribute Value",input:!0},tooltip:"Provide a map of HTML attributes for component's input element (attributes provided by other component settings or other attributes generated by form.io take precedence over attributes in this grid)",addAnother:"Add Attribute"},{type:"panel",legend:"PDF Overlay",title:"PDF Overlay",key:"overlay",tooltip:"The settings inside apply only to the PDF forms.",weight:2e3,collapsible:!0,collapsed:!0,components:[{type:"textfield",input:!0,key:"overlay.style",label:"Style",placeholder:"",tooltip:"Custom styles that should be applied to this component when rendered in PDF."},{type:"textfield",input:!0,key:"overlay.page",label:"Page",placeholder:"",tooltip:"The PDF page to place this component."},{type:"textfield",input:!0,key:"overlay.left",label:"Left",placeholder:"",tooltip:"The left margin within a page to place this component."},{type:"textfield",input:!0,key:"overlay.top",label:"Top",placeholder:"",tooltip:"The top margin within a page to place this component."},{type:"textfield",input:!0,key:"overlay.width",label:"Width",placeholder:"",tooltip:"The width of the component (in pixels)."},{type:"textfield",input:!0,key:"overlay.height",label:"Height",placeholder:"",tooltip:"The height of the component (in pixels)."}]}]},48911:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(19601);var r,o=(r=n(61550))&&r.__esModule?r:{default:r},i=n(82531),a=[{weight:0,input:!0,label:"Advanced Logic",key:"logic",templates:{header:'
    \n
    \n {{ value.length }} {{ ctx.t("Advanced Logic Configured") }}\n
    \n
    ',row:'
    \n
    \n
    {{ row.name }}
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    ',footer:""},type:"editgrid",addAnother:"Add Logic",saveRow:"Save Logic",components:[{weight:0,input:!0,inputType:"text",label:"Logic Name",key:"name",validate:{required:!0},type:"textfield"},{weight:10,key:"triggerPanel",input:!1,title:"Trigger",tableView:!1,components:[{weight:0,input:!0,tableView:!1,components:[{weight:0,input:!0,label:"Type",key:"type",tableView:!1,data:{values:[{value:"simple",label:"Simple"},{value:"javascript",label:"Javascript"},{value:"json",label:"JSON Logic"},{value:"event",label:"Event"}]},dataSrc:"values",template:"{{ item.label }}",type:"select"},{weight:10,label:"",key:"simple",type:"container",tableView:!1,customConditional:function(e){return"simple"===e.row.type},components:[{input:!0,key:"show",label:"Show",type:"hidden",tableView:!1,calculateValue:function(){return!0}},{type:"select",input:!0,label:"When the form component:",key:"when",dataSrc:"custom",valueProperty:"value",tableView:!1,data:{custom:function(e){return(0,i.getContextComponents)(e)}}},{type:"textfield",input:!0,label:"Has the value:",key:"eq",tableView:!1}]},{weight:10,type:"textarea",key:"javascript",rows:5,editor:"ace",as:"javascript",input:!0,tableView:!1,placeholder:"result = (data['mykey'] > 1);",description:'"row", "data", and "component" variables are available. Return "result".',customConditional:function(e){return"javascript"===e.row.type}},{weight:10,type:"textarea",key:"json",rows:5,editor:"ace",label:"JSON Logic",as:"json",input:!0,tableView:!1,placeholder:"{ ... }",description:'"row", "data", "component" and "_" variables are available. Return the result to be passed to the action if truthy.',customConditional:function(e){return"json"===e.row.type}},{weight:10,type:"textfield",key:"event",label:"Event Name",placeholder:"event",description:"The event that will trigger this logic. You can trigger events externally or via a button.",tableView:!1,customConditional:function(e){return"event"===e.row.type}}],key:"trigger",type:"container"}],type:"panel"},{weight:20,input:!0,label:"Actions",key:"actions",tableView:!1,templates:{header:'
    \n
    {{ value.length }} {{ ctx.t("actions") }}
    \n
    ',row:'
    \n
    \n
    {{ row.name }}
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    ',footer:""},type:"editgrid",addAnother:"Add Action",saveRow:"Save Action",components:[{weight:0,title:"Action",input:!1,key:"actionPanel",type:"panel",components:[{weight:0,input:!0,inputType:"text",label:"Action Name",key:"name",validate:{required:!0},type:"textfield"},{weight:10,input:!0,label:"Type",key:"type",data:{values:[{value:"property",label:"Property"},{value:"value",label:"Value"},{label:"Merge Component Schema",value:"mergeComponentSchema"},{label:"Custom Action",value:"customAction"}]},dataSrc:"values",template:"{{ item.label }}",type:"select"},{weight:20,type:"select",template:"{{ item.label }}",dataSrc:"json",tableView:!1,data:{json:[{label:"Hidden",value:"hidden",type:"boolean"},{label:"Required",value:"validate.required",type:"boolean"},{label:"Disabled",value:"disabled",type:"boolean"},{label:"Label",value:"label",type:"string"},{label:"Title",value:"title",type:"string"},{label:"Prefix",value:"prefix",type:"string"},{label:"Suffix",value:"suffix",type:"string"},{label:"Tooltip",value:"tooltip",type:"string"},{label:"Description",value:"description",type:"string"},{label:"Placeholder",value:"placeholder",type:"string"},{label:"Input Mask",value:"inputMask",type:"string"},{label:"CSS Class",value:"className",type:"string"},{label:"Container Custom Class",value:"customClass",type:"string"}]},key:"property",label:"Component Property",input:!0,customConditional:function(e){return"property"===e.row.type}},{weight:30,input:!0,label:"Set State",key:"state",tableView:!1,data:{values:[{label:"True",value:"true"},{label:"False",value:"false"}]},dataSrc:"values",template:"{{ item.label }}",type:"select",customConditional:function(e){var t=e.row;return"property"===t.type&&t.hasOwnProperty("property")&&"boolean"===t.property.type}},{weight:30,type:"textfield",key:"text",label:"Text",inputType:"text",input:!0,tableView:!1,description:'Can use templating with {{ data.myfield }}. "data", "row", "component" and "result" variables are available.',customConditional:function(e){var t=e.row;return"property"===t.type&&t.hasOwnProperty("property")&&"string"===t.property.type&&!t.property.component}},{weight:20,input:!0,label:"Value (Javascript)",key:"value",editor:"ace",as:"javascript",rows:5,placeholder:"value = data.myfield;",type:"textarea",tableView:!1,description:'"row", "data", "component", and "result" variables are available. Return the value.',customConditional:function(e){return"value"===e.row.type}},{weight:20,input:!0,label:"Schema Defenition",key:"schemaDefinition",editor:"ace",as:"javascript",rows:5,placeholder:"schema = { label: 'Updated' };",type:"textarea",tableView:!1,description:'"row", "data", "component", and "result" variables are available. Return the schema.',customConditional:function(e){return"mergeComponentSchema"===e.row.type}},Object.assign(o.default.logicVariablesTable("inputThe value that was input into this component"),{customConditional:function(e){return"customAction"===e.row.type}}),{weight:20,input:!0,label:"Custom Action (Javascript)",key:"customAction",editor:"ace",rows:5,placeholder:"value = data.myfield;",type:"textarea",tableView:!1,customConditional:function(e){return"customAction"===e.row.type}}]}]}]}];t.default=a},51250:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(61550)),o=i(n(193));function i(e){return e&&e.__esModule?e:{default:e}}var a=[{weight:10,type:"checkbox",label:"Required",tooltip:"A required field must be filled in before the form can be submitted.",key:"validate.required",input:!0},{weight:100,type:"checkbox",label:"Unique",tooltip:"Makes sure the data submitted for this field is unique, and has not been submitted before.",key:"unique",input:!0},{weight:100,type:"checkbox",label:"Validate When Hidden",tooltip:"Validates the component when it is hidden/conditionally hidden. Vaildation errors are displayed in the error alert on the form submission.",key:"validateWhenHidden",input:!0},{weight:0,type:"select",key:"validateOn",defaultValue:"change",input:!0,label:"Validate On",tooltip:"Determines when this component should trigger front-end validation.",dataSrc:"values",data:{values:[{label:"Change",value:"change"},{label:"Blur",value:"blur"}]}},{weight:190,type:"textfield",input:!0,key:"errorLabel",label:"Error Label",placeholder:"Error Label",tooltip:"The label for this field when an error occurs."},{weight:200,key:"validate.customMessage",label:"Custom Error Message",placeholder:"Custom Error Message",type:"textfield",tooltip:"Error message displayed if any error occurred.",input:!0},{type:"panel",title:"Custom Validation",collapsible:!0,collapsed:!0,style:{"margin-bottom":"10px"},key:"custom-validation-js",weight:300,customConditional:function(){return!o.default.noeval||o.default.protectedEval},components:[r.default.logicVariablesTable("inputThe value that was input into this component"),{type:"textarea",key:"validate.custom",rows:5,editor:"ace",hideLabel:!0,as:"javascript",input:!0},{type:"htmlelement",tag:"div",content:"\n \n

    Enter custom validation code.

    \n

    You must assign the valid variable as either true or an error message if validation fails.

    \n
    Example:
    \n
    valid = (input === 'Joe') ? true : 'Your name must be \"Joe\"';
    \n
    "},{type:"well",components:[{weight:100,type:"checkbox",label:"Secret Validation",tooltip:"Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.",description:"Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.",key:"validate.customPrivate",input:!0}]}]},{type:"panel",title:"JSONLogic Validation",collapsible:!0,collapsed:!0,key:"json-validation-json",weight:400,components:[{type:"htmlelement",tag:"div",content:'

    Execute custom logic using JSONLogic.

    Example:
    '+JSON.stringify({if:[{"===":[{var:"input"},"Bob"]},!0,"Your name must be 'Bob'!"]},null,2)+"
    "},{type:"textarea",key:"validate.json",hideLabel:!0,rows:5,editor:"ace",as:"json",input:!0}]},{type:"panel",title:"Custom Errors",collapsible:!0,collapsed:!0,key:"errors",weight:400,components:[{type:"textarea",key:"errors",hideLabel:!0,rows:5,editor:"ace",as:"json",input:!0},{type:"htmlelement",tag:"div",content:'\n

    This allows you to set different custom error messages for different errors\n (in contrast to “Custom Error Message”, which only allows you to set one\n error message for all errors). E.g.

    \n\n
    {\n  "required": "{{ field }} is required. Try again.",\n  "maxLength": "{{ field }} is too long. Try again."\n}
    \n\n

    You can set the following keys (among others):

    \n
      \n
    • required
    • \n
    • min
    • \n
    • max
    • \n
    • minLength
    • \n
    • maxLength
    • \n
    • minWords
    • \n
    • maxWords
    • \n
    • invalid_email
    • \n
    • invalid_date
    • \n
    • invalid_day
    • \n
    • invalid_regex
    • \n
    • mask
    • \n
    • pattern
    • \n
    • custom
    • \n
    \n\n

    Depending on the error message some of the following template variables can be used in the script:

    \n
      \n
    • {{ field }} is replaced with the label of the field.
    • \n
    • {{ min }}
    • \n
    • {{ max }}
    • \n
    • {{ length }}
    • \n
    • {{ pattern }}
    • \n
    • {{ minDate }}
    • \n
    • {{ maxDate }}
    • \n
    • {{ minYear }}
    • \n
    • {{ maxYear }}
    • \n
    • {{ regex }}
    • \n
    \n '}]}];t.default=a},61550:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(57327),n(41539),n(40561);var r=i(n(96486)),o=i(n(193));function i(e){return e&&e.__esModule?e:{default:e}}var a={sortAndFilterComponents:function(e){return r.default.filter(r.default.sortBy(e,"weight"),(function(e){return!e.ignore}))},unifyComponents:function(e,t){return e.key&&t.key?!e.skipMerge&&!t.skipMerge&&e.key===t.key&&(r.default.each(e,(function(n,r){!e.overrideEditForm&&t.hasOwnProperty(r)||(t[r]=n)})),r.default.each(t,(function(n,r){!t.overrideEditForm&&e.hasOwnProperty(r)||(e[r]=n)})),e.components&&(t.components=a.sortAndFilterComponents(r.default.unionWith(e.components,t.components,a.unifyComponents))),!0):r.default.isEqual(e,t)},logicVariablesTable:function(e){return{type:"htmlelement",tag:"div",content:'

    The following variables are available in all scripts.

    '+(e=e||"")+'
    formThe complete form JSON object
    submissionThe complete submission object.
    dataThe complete submission data object.
    rowContextual "row" data, used within DataGrid, EditGrid, and Container components
    componentThe current component JSON
    instanceThe current component instance.
    valueThe current value of the component.
    momentThe moment.js library for date manipulation.
    _An instance of Lodash.
    utilsAn instance of the FormioUtils object.
    utilAn alias for "utils".

    '}},javaScriptValue:function(e,t,n,r,i,a){var l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",s=arguments.length>7?arguments[7]:void 0,u=[this.logicVariablesTable(l),{type:"panel",title:"JavaScript",collapsible:!0,collapsed:!1,style:{"margin-bottom":"10px"},key:"".concat(t,"-js"),customConditional:function(){return!o.default.noeval||o.default.protectedEval},components:[{type:"textarea",key:t,rows:5,editor:"ace",hideLabel:!0,as:"javascript",input:!0},{type:"htmlelement",tag:"div",content:"

    Enter custom javascript code.

    ".concat(i)}]},{type:"panel",title:"JSONLogic",collapsible:!0,collapsed:!0,key:"".concat(t,"-json"),components:[{type:"htmlelement",tag:"div",content:'

    Execute custom logic using JSONLogic.

    Full Lodash support is provided using an "_" before each operation, such as {"_sum": {var: "data.a"}}

    '+a},{type:"textarea",key:n,rows:5,editor:"ace",hideLabel:!0,as:"json",input:!0}]}];return s&&u.splice(2,1),{type:"panel",title:e,theme:"default",collapsible:!0,collapsed:!0,key:"".concat(t,"Panel"),weight:r,components:u}}},l=a;t.default=l},72801:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(24812),n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r},i=n(82531);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t0?e:10,this.refs.modalWrapper.style.paddingTop="".concat(e,"px")}},{key:"openModal",value:function(){this.isOpened=!0,this.refs.modalWrapper.classList.remove("component-rendering-hidden"),"signature"===this.component.component.type&&this.positionOverElement()}},{key:"updateView",value:function(){var e=o.default.isEqual(this.currentValue,this.component.defaultValue)?this.openModalTemplate:this.component.getModalPreviewTemplate();this.component.setContent(this.refs.openModalWrapper,e),this.setOpenEventListener()}},{key:"closeModal",value:function(){this.refs.modalWrapper.classList.remove("formio-dialog-disabled-animation"),this.refs.modalWrapper.classList.add("component-rendering-hidden"),this.isOpened=!1,this.updateView()}},{key:"closeModalHandler",value:function(e){e.preventDefault(),this.component.disabled||this.component.setValue(o.default.cloneDeep(this.currentValue),{resetValue:!0}),this.closeModal()}},{key:"showDialog",value:function(){this.dialogElement=this.component.ce("div");var e='\n

    '.concat(this.component.t("Do you want to clear changes?"),'

    \n
    \n \n \n
    \n ");this.dialogElement.innerHTML=e,this.dialogElement.refs={},this.component.loadRefs.call(this.dialogElement,this.dialogElement,{dialogHeader:"single",dialogCancelButton:"single",dialogYesButton:"single"}),this.dialog=this.component.createModal(this.dialogElement),this.component.addEventListener(this.dialogElement.refs.dialogYesButton,"click",this.saveDialogListener),this.component.addEventListener(this.dialogElement.refs.dialogCancelButton,"click",this.closeDialogListener)}},{key:"closeDialog",value:function(e){e.preventDefault(),this.dialog.close(),this.component.removeEventListener(this.dialogElement.refs.dialogYesButton,"click",this.saveDialogListener),this.component.removeEventListener(this.dialogElement.refs.dialogCancelButton,"click",this.closeDialogListener)}},{key:"saveDialog",value:function(e){this.closeDialog(e),this.closeModalHandler(e)}},{key:"saveModalValueHandler",value:function(e){var t;e.preventDefault(),this.currentValue=(0,i.fastCloneDeep)(null!==(t=this.component.dataValue)&&void 0!==t?t:this.component.getValue()),this.closeModal()}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=d},68093:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t0?this.removeClass(t,"text-danger"):this.addClass(t,"text-danger"),this.setContent(t,this.t("{{ remaining }} ".concat(e," remaining."),{remaining:o}))}else this.setContent(t,this.t("{{ count }} ".concat(e),{count:n}))}},{key:"updateValueAt",value:function(e,t,n){if(t=t||{},s.default.get(this.component,"showWordCount",!1)&&this.refs.wordcount&&this.refs.wordcount[n]){var r=s.default.parseInt(s.default.get(this.component,"validate.maxWords",0),10);this.setCounter(this.t("words"),this.refs.wordcount[n],this.getWordCount(e),r)}if(s.default.get(this.component,"showCharCount",!1)&&this.refs.charcount&&this.refs.charcount[n]){var o=s.default.parseInt(s.default.get(this.component,"validate.maxLength",0),10);this.setCounter(this.t("characters"),this.refs.charcount[n],e.length,o)}}},{key:"getValueAt",value:function(e){var t=this.performInputMapping(this.refs.input[e]);return t&&t.widget?t.widget.getValue():t?t.value:void 0}},{key:"updateValue",value:function(e,t,n){t=t||{};var r=f(y(b.prototype),"updateValue",this).call(this,e,t);return this.triggerUpdateValueAt(this.dataValue,t,n),r}},{key:"parseValue",value:function(e){return e}},{key:"formatValue",value:function(e){return e}},{key:"attach",value:function(e){return this.loadRefs(e,{charcount:"multiple",wordcount:"multiple",prefix:"multiple",suffix:"multiple"}),f(y(b.prototype),"attach",this).call(this,e)}},{key:"getWidget",value:function(e){return e=e||0,this.refs.input&&this.refs.input[e]?this.refs.input[e].widget:null}},{key:"attachElement",value:function(e,t){var n=this;f(y(b.prototype),"attachElement",this).call(this,e,t),e.widget&&e.widget.destroy();var r=l.default.resolve();return e.widget=this.createWidget(t),e.widget&&(r=e.widget.attach(e),this.refs.prefix&&this.refs.prefix[t]&&e.widget.addPrefix(this.refs.prefix[t]),this.refs.suffix&&this.refs.suffix[t]&&e.widget.addSuffix(this.refs.suffix[t])),this.addFocusBlurEvents(e),this.options.submitOnEnter&&this.addEventListener(e,"keypress",(function(e){13===(e.keyCode||e.which)&&(e.preventDefault(),e.stopPropagation(),n.emit("submitButton"))})),r}},{key:"createWidget",value:function(e){var t,n=this;if(!this.component.widget)return null;var r,o="string"==typeof this.component.widget?{type:this.component.widget}:this.component.widget;if(null!==(t=this.root)&&void 0!==t&&t.shadowRoot&&(o.shadowRoot=null===(r=this.root)||void 0===r?void 0:r.shadowRoot),!a.default.hasOwnProperty(o.type))return null;var i=new a.default[o.type](o,this.component,this,e);return i.on("update",(function(){return n.updateValue(n.getValue(),{modified:!0},e)}),!0),i.on("redraw",(function(){return n.redraw()}),!0),i}},{key:"detach",value:function(){if(f(y(b.prototype),"detach",this).call(this),this.refs&&this.refs.input)for(var e=0;e<=this.refs.input.length;e++){var t=this.getWidget(e);t&&t.destroy()}this.refs.input=[]}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),b}(o.default);t.default=v},12775:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.label }}",validate:{onlyAvailableItems:!1}}].concat(t))}}],(n=[{key:"isSelectURL",get:function(){return"url"===this.component.dataSrc}},{key:"selectData",get:function(){var e=a.default.get(this.root,"submission.metadata.selectData",{});return a.default.get(e,this.path)}},{key:"shouldLoad",get:function(){if(this.loadingError)return!1;if(!this.options.readOnly)return!0;if(this.templateKeys&&this.templateKeys.length){var e=this.dataValue,t=this.selectData;return this.templateKeys.reduce((function(n,r){var o=a.default.has(e,r)||(a.default.isArray(t)?t.every((function(e){return a.default.has(e,r)})):a.default.has(t,r));return n||!o}),!1)}return!0}},{key:"getTemplateKeys",value:function(){var e=this.component.template;this.templateKeys=this.options.readOnly&&e?(0,s.getItemTemplateKeys)(e):[]}},{key:"requestHeaders",get:function(){var e=this,t=new i.GlobalFormio.Headers;if(this.component.data&&this.component.data.headers)try{a.default.each(this.component.data.headers,(function(n){n.key&&t.set(n.key,e.interpolate(n.value))}))}catch(e){console.warn(e.message)}return t}},{key:"setItems",value:function(){}},{key:"updateCustomItems",value:function(){}},{key:"loadItems",value:function(){}},{key:"getOptionTemplate",value:function(e,t,n){if(!this.component.template)return e.label;var r={noeval:!0,data:{}},o=this.sanitize(this.component.template?this.interpolate(this.component.template,{item:e},r):e.label,this.shouldSanitizeValue),i=this.component.reference&&null!=t&&t._id?t._id.toString():t;return i&&!a.default.isObject(i)&&r.data.item&&(this.templateData[i]=r.data.item),a.default.isNumber(n)&&(this.templateData[n]=r.data.item),o}},{key:"itemTemplate",value:function(e,t,n){if(a.default.isEmpty(e))return"";var r=this.sanitize(this.getOptionTemplate(e,t,n),this.shouldSanitizeValue);if(r){var o,i=r.replace(/<\/?[^>]+(>|$)/g,""),l=null===(o=this.i18next)||void 0===o?void 0:o.translator;if(!i||l&&!this.t(i,{_userInput:!0}))return;return l?r.replace(i,this.t(i,{_userInput:!0})):i}return this.sanitize(JSON.stringify(e),this.shouldSanitizeValue)}},{key:"handleLoadingError",value:function(e){this.loading=!1,e.networkError&&(this.networkError=!0),this.itemsLoadedResolve(),this.emit("componentError",{component:this.component,message:e.toString()}),console.warn("Unable to load resources for ".concat(this.key))}},{key:"updateItems",value:function(e,t){var n=this;if(!this.component.data)return console.warn("Select component ".concat(this.key," does not have data configuration.")),void this.itemsLoadedResolve();if(this.visible)switch(this.component.dataSrc){case"values":this.setItems(this.component.data.values);break;case"json":this.setItems(this.component.data.json);break;case"custom":this.updateCustomItems(t);break;case"resource":if(!this.component.data.resource||!t&&!this.active)return void this.itemsLoadedResolve();var r=this.options.formio?this.options.formio.formsUrl:"".concat(i.GlobalFormio.getProjectUrl(),"/form");if(r+="/".concat(this.component.data.resource,"/submission"),t||this.additionalResourcesAvailable||!this.serverCount)try{this.loadItems(r,e,this.requestHeaders)}catch(e){console.warn("Unable to load resources for ".concat(this.key))}else this.setItems(this.downloadedResources);break;case"url":if(!t&&!this.active&&!this.calculatedValue&&"select"===this.component.type)return void this.itemsLoadedResolve();var o,s,u=this.component.data.url;if(u.startsWith("/")){var c=u.startsWith("/project")?i.GlobalFormio.getBaseUrl():i.GlobalFormio.getProjectUrl()||i.GlobalFormio.getBaseUrl();u=c+u}this.component.data.method?s="POST"===(o=this.component.data.method).toUpperCase()?this.component.data.body:null:o="GET";var f=this.component.authenticate?{}:{noToken:!0};this.loadItems(u,e,this.requestHeaders,f,o,s);break;case"indexeddb":if("undefined"==typeof window)return;if(window.indexedDB||window.alert("Your browser doesn't support current version of indexedDB"),this.component.indexeddb&&this.component.indexeddb.database&&this.component.indexeddb.table){var d=window.indexedDB.open(this.component.indexeddb.database);d.onupgradeneeded=function(e){if(n.component.customOptions){var t=e.target.result;t.createObjectStore(n.component.indexeddb.table,{keyPath:"myKey",autoIncrement:!0}).transaction.oncomplete=function(){var e=t.transaction(n.component.indexeddb.table,"readwrite");n.component.customOptions.forEach((function(t){e.objectStore(n.component.indexeddb.table).put(t)}))}}},d.onerror=function(){window.alert(d.errorCode)},d.onsuccess=function(e){var t=e.target.result.transaction(n.component.indexeddb.table,"readwrite").objectStore(n.component.indexeddb.table);new l.default((function(e){var n=[];t.getAll().onsuccess=function(t){t.target.result.forEach((function(e){n.push(e)})),e(n)}})).then((function(e){a.default.isEmpty(n.component.indexeddb.filter)||(e=a.default.filter(e,n.component.indexeddb.filter)),n.setItems(e)}))}}}else this.itemsLoadedResolve()}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(o.default);t.default=m},97389:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,weight:0,tooltip:"The source to use for the select data. Values lets you provide your own values and labels. JSON lets you provide raw JSON data. URL lets you provide a URL to retrieve the JSON data from.",key:"dataSrc",defaultValue:"values",label:"Data Source Type",dataSrc:"values"},{type:"textfield",input:!0,key:"data.url",weight:10,label:"Data Source URL",placeholder:"Data Source URL",tooltip:"A URL that returns a JSON array to use as the data source.",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"datagrid",input:!0,label:"Request Headers",key:"data.headers",tooltip:"Set any headers that should be sent along with the request to the url. This is useful for authentication.",weight:11,components:[{label:"Key",key:"key",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}],conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"textfield",input:!0,label:"Value Property",key:"valueProperty",skipMerge:!0,clearOnHide:!1,weight:13,description:"The selected item's property to save.",tooltip:"The property of each item in the data source to use as the select value. If not specified, the item itself will be used.",conditional:{json:{in:[{var:"data.dataSrc"},["json","url","custom"]]}}},{type:"textarea",input:!0,key:"template",label:"Item Template",editor:"ace",as:"html",rows:3,weight:18,tooltip:"The HTML template for the result data items.",allowCalculateOverride:!0,calculateValue:function(e){return!e.data.template&&e.instance&&e.instance._currentForm.options.editComponent?e.instance._currentForm.options.editComponent.template:e.data.template}},{type:"checkbox",input:!0,weight:26,key:"authenticate",label:"Formio Authenticate",tooltip:"Check this if you would like to use Formio Authentication with the request.",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"checkbox",input:!0,weight:29,key:"ignoreCache",label:"Disables Storing Request Result in the Cache",tooltip:"Check it if you don't want the requests and its results to be stored in the cache. By default, it is stored and if the Select tries to make the request to the same URL with the same paremetrs, the cached data will be returned. It allows to increase performance, but if the remote source's data is changing quite often and you always need to keep it up-to-date, uncheck this option.",conditional:{json:{or:[{"===":[{var:"data.dataSrc"},"url"]},{"===":[{var:"data.dataSrc"},"resource"]}]}}}]},99606:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(83593),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(79753),n(69600),n(21249),n(24812),n(89554),n(41539),n(54747),n(32564),n(69826),n(92222),n(68304),n(30489);var o=l(n(68093)),i=l(n(91459)),a=l(n(96486));function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n\n '.concat(this.renderElement("hidden"!==this.component.type?this.dataValue:""),"\n "));var e=this.dataValue;return Array.isArray(e)||(e=e?[e]:[]),d(y(f.prototype),"render",this).call(this,this.renderTemplate("multiValueTable",{rows:e.map(this.renderRow.bind(this)).join(""),disabled:this.disabled,addAnother:this.addAnother}))}},{key:"renderElement",value:function(){return""}},{key:"renderRow",value:function(e,t){return this.renderTemplate("multiValueRow",{index:t,disabled:this.disabled,element:"".concat(this.renderElement(e,t))})}},{key:"attach",value:function(e){var t=this,n=d(y(f.prototype),"attach",this).call(this,e);this.loadRefs(e,{addButton:"multiple",input:"multiple",removeRow:"multiple",mask:"multiple",select:"multiple"});var r=[];return this.refs.input.forEach((function(e,n){r.push(t.attachElement.call(t,e,n))})),this.component.multiple?(this.refs.removeRow.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.removeValue(n)}))})),this.refs.addButton.forEach((function(e){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.addValue()}))})),n.then((function(){return i.default.all(r)}))):i.default.all(r)}},{key:"detach",value:function(){this.refs.input&&this.refs.input.length&&this.refs.input.forEach((function(e){e.mask&&(e.mask.destroy?e.mask.destroy():e.mask.remove()),e.widget&&e.widget.destroy()})),this.refs.mask&&this.refs.mask.length&&this.refs.mask.forEach((function(e){e.mask&&(e.mask.destroy?e.mask.destroy():e.mask.remove())})),d(y(f.prototype),"detach",this).call(this)}},{key:"attachElement",value:function(e,t){var n=this;if(this.addEventListener(e,this.inputInfo.changeEvent,(function(){var r=a.default.get(n.component,"case","mixed");if("mixed"!==r){var o=e.selectionStart,i=e.selectionEnd;"uppercase"===r&&e.value&&(e.value=e.value.toUpperCase()),"lowercase"===r&&e.value&&(e.value=e.value.toLowerCase()),e.selectionStart&&e.selectionEnd&&(e.selectionStart=o,e.selectionEnd=i)}try{n.saveCaretPosition(e,t)}catch(e){console.warn("An error occurred while trying to save caret position",e)}if(!e.mask)return n.updateValue(null,{modified:"hidden"!==n.component.type},t);setTimeout((function(){return n.updateValue(null,{modified:"hidden"!==n.component.type},t)}),1)})),!this.attachMultiMask(t)){var r=function(){n.setInputMask(e);var t=n.component.inputMask,r=n.component.displayMask;t&&r&&r!==t&&n.refs.valueMaskInput&&n.setInputMask(n.refs.valueMaskInput,t)};"blur"===this.inputInfo.changeEvent?this.addEventListener(e,this.inputInfo.changeEvent,(function(){var e;r(),n.dataValue=n.refs.input[0].value,null===(e=document.querySelector('[name="data[submit]"]'))||void 0===e||e.disabled,n.checkComponentValidity()&&n.updateComponentValue(n.refs.input[0].value)})):r()}}},{key:"onSelectMaskHandler",value:function(e){this.updateMask(e.target.maskInput,this.getMaskPattern(e.target.value))}},{key:"getMaskPattern",value:function(e){if(this.multiMasks||(this.multiMasks={}),this.multiMasks[e])return this.multiMasks[e];var t=this.component.inputMasks.find((function(t){return t.label===e}));return this.multiMasks[e]=t?t.mask:this.component.inputMasks[0].mask,this.multiMasks[e]}},{key:"attachMultiMask",value:function(e){if(!(this.isMultipleMasksField&&this.component.inputMasks.length&&this.refs.input.length))return!1;var t=this.refs.select[e];return t.onchange=this.onSelectMaskHandler.bind(this),t.maskInput=this.refs.mask[e],this.setInputMask(t.maskInput,this.component.inputMasks[0].mask),!0}},{key:"updateMask",value:function(e,t){t&&(this.setInputMask(e,t,!this.component.placeholder),this.updateValue())}},{key:"addNewValue",value:function(e){void 0===e&&(e=this.component.defaultValue?this.component.defaultValue:this.emptyValue,Array.isArray(e)&&0===e.length&&(e=this.emptyValue));var t=this.dataValue||[];Array.isArray(t)||(t=[t]),Array.isArray(e)?t=t.concat(e):t.push(e),this.dataValue=t}},{key:"addValue",value:function(){this.addNewValue(),this.redraw(),this.checkConditions(),this.isEmpty(this.dataValue)||this.restoreValue(),this.root&&this.root.onChange()}}])&&u(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.default);t.default=v},40970:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"getComponent"in e?u=e.getComponent(l,t,n):t&&t(e,o),!1})),u||(u=c),u):u}},{key:"getComponentById",value:function(e,t){var n=null;return this.everyComponent((function(r,o){if(r.id===e)return n=r,t&&t(r,o),!1})),n}},{key:"calculateComponentPath",value:function(e){var t="";if(e.component.key){for(var n=this;n&&!n.allowData&&n.parent;)n=n.parent;var r=e.row?"[".concat(Number.parseInt(e.row),"]"):"";return t=n.path?"".concat(n.path).concat(r,"."):"",(t+=e._parentPath&&e.component.shouldIncludeSubFormPath?e._parentPath:"")+e.component.key}}},{key:"createComponent",value:function(e,t,n,r,i){var l;if(e){t=t||this.options,n=n||this.data,t.parent=this,t.parentVisible=this.visible,t.root=(null===(l=t)||void 0===l?void 0:l.root)||this.root||this,t.localRoot=this.localRoot,t.skipInit=!0,"pdf"===t.display&&this.builderMode||(e.id=(0,s.getRandomComponentId)()),!this.isInputComponent&&this.component.shouldIncludeSubFormPath&&(e.shouldIncludeSubFormPath=!0);var u=a.default.create(e,t,n,!0),c=this.calculateComponentPath(u);if(c&&(u.path=c),u.init(),e.internal)return u;if(r){var f=o.default.findIndex(this.components,{id:r.id});-1!==f?this.components.splice(f,0,u):this.components.push(u)}else if(i){var d=o.default.findIndex(this.components,{id:i.id});-1!==d?this.components[d]=u:this.components.push(u)}else this.components.push(u);return u}}},{key:"getContainer",value:function(){return this.element}},{key:"componentComponents",get:function(){return this.component.components||[]}},{key:"nestedKey",get:function(){return"nested-".concat(this.key)}},{key:"templateName",get:function(){return"container"}},{key:"init",value:function(){return this.components=this.components||[],this.addComponents(),v(k(y.prototype),"init",this).call(this)}},{key:"addComponents",value:function(e,t){var n=this;e=e||this.data,(t=t||this.options).components?this.components=t.components:(this.hook("addComponents",this.componentComponents,this)||[]).forEach((function(t){return n.addComponent(t,e)}))}},{key:"addComponent",value:function(e,t,n,r){return t=t||this.data,this.options.parentPath&&(e.shouldIncludeSubFormPath=!0),e=this.hook("addComponent",e,t,n,r),this.createComponent(e,this.options,t,n||null)}},{key:"beforeFocus",value:function(){this.parent&&"beforeFocus"in this.parent&&this.parent.beforeFocus(this)}},{key:"render",value:function(e){return v(k(y.prototype),"render",this).call(this,e||this.renderTemplate(this.templateName,{children:this.visible?this.renderComponents():"",nestedKey:this.nestedKey,collapsed:!this.options.pdf&&this.collapsed}))}},{key:"renderComponents",value:function(e){var t=(e=e||this.getComponents()).map((function(e){return e.render()}));return this.renderTemplate("components",{children:t,components:e})}},{key:"attach",value:function(e){var t=this,n=v(k(y.prototype),"attach",this).call(this,e);this.loadRefs(e,m({header:"single",collapsed:this.collapsed},this.nestedKey,"single"));var r=l.default.resolve();return this.refs[this.nestedKey]&&(r=this.attachComponents(this.refs[this.nestedKey])),this.visible||this.attachComponentsLogic(),this.component.collapsible&&this.refs.header&&(this.addEventListener(this.refs.header,"click",(function(){t.collapsed=!t.collapsed})),this.addEventListener(this.refs.header,"keydown",(function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),t.collapsed=!t.collapsed)}))),l.default.all([n,r])}},{key:"attachComponentsLogic",value:function(e){e=e||this.components,o.default.each(e,(function(e){e.attachLogic(),o.default.isFunction(e.attachComponentsLogic)&&e.attachComponentsLogic()}))}},{key:"attachComponents",value:function(e,t,n){if(t=t||this.components,n=n||this.component.components,!(e=this.hook("attachComponents",e,t,n,this)))return new l.default((function(){}));var r=0,o=[];return Array.prototype.slice.call(e.children).forEach((function(e){!e.getAttribute("data-noattach")&&t[r]&&(o.push(t[r].attach(e)),r++)})),l.default.all(o)}},{key:"removeComponent",value:function(e,t){t=t||this.components,e.destroy(),o.default.remove(t,{id:e.id})}},{key:"removeComponentByKey",value:function(e,t){var n=this;if(!this.getComponent(e,(function(e,r){n.removeComponent(e,r),t&&t(e,r)})))return t&&t(null),null}},{key:"removeComponentById",value:function(e,t){var n=this;if(!this.getComponentById(e,(function(e,r){n.removeComponent(e,r),t&&t(e,r)})))return t&&t(null),null}},{key:"updateValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.components.reduce((function(e,n){return n.updateValue(null,t)||e}),v(k(y.prototype),"updateValue",this).call(this,e,t))}},{key:"shouldSkipValidation",value:function(e,t,n){return!this.component.input||v(k(y.prototype),"shouldSkipValidation",this).call(this,e,t,n)}},{key:"checkData",value:function(e,t,n,r){if(this.builderMode)return!0;e=e||this.rootValue,t=t||{},n=n||this.data;var i=(r=r&&o.default.isArray(r)?r:this.getComponents()).reduce((function(r,o){return o.checkData(e,f({},t),n)&&r}),v(k(y.prototype),"checkData",this).call(this,e,f({},t),n));return this.checkModal(i,this.isDirty),i}},{key:"checkConditions",value:function(e,t,n){var r=v(k(y.prototype),"checkConditions",this).call(this,e,t,n);return this.getComponents().forEach((function(n){return n.checkConditions(e,t,n.data)})),r}},{key:"clearOnHide",value:function(e){v(k(y.prototype),"clearOnHide",this).call(this,e),this.component.clearOnHide&&(!this.allowData||this.hasValue()||this.options.server&&!this.visible||(this.dataValue=this.defaultValue),this.hasValue()&&this.restoreComponentsContext()),this.getComponents().forEach((function(t){return t.clearOnHide(e)}))}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){return t.data=e.dataValue}))}},{key:"beforePage",value:function(e){return l.default.all(this.getComponents().map((function(t){return t.beforePage(e)})))}},{key:"beforeSubmit",value:function(){return l.default.all(this.getComponents().map((function(e){return e.beforeSubmit()})))}},{key:"calculateValue",value:function(e,t,n){return!!this.conditionallyVisible()&&this.getComponents().reduce((function(r,o){return o.calculateValue(e,t,n)||r}),v(k(y.prototype),"calculateValue",this).call(this,e,t,n))}},{key:"isLastPage",value:function(){return this.pages.length-1===this.page}},{key:"isValid",value:function(e,t){return this.getComponents().reduce((function(n,r){return r.isValid(e,t)&&n}),v(k(y.prototype),"isValid",this).call(this,e,t))}},{key:"checkChildComponentsValidity",value:function(e,t,n,r,o){return this.getComponents().reduce((function(o,i){return i.checkValidity(e,t,n,r)&&o}),o)}},{key:"checkValidity",value:function(e,t,n,r){if(!this.checkCondition(n,e))return this.setCustomValidity(""),!0;var o=this.checkChildComponentsValidity(e,t,n,r,v(k(y.prototype),"checkValidity",this).call(this,e,t,n,r));return this.checkModal(o,t),o}},{key:"checkAsyncValidity",value:function(e,t,n,r){var o=this;return this.ready.then((function(){var i=[v(k(y.prototype),"checkAsyncValidity",o).call(o,e,t,n,r)];return o.eachComponent((function(o){return i.push(o.checkAsyncValidity(e,t,n,r))})),l.default.all(i).then((function(e){return e.reduce((function(e,t){return e&&t}),!0)}))}))}},{key:"setPristine",value:function(e){v(k(y.prototype),"setPristine",this).call(this,e),this.getComponents().forEach((function(t){return t.setPristine(e)}))}},{key:"isPristine",get:function(){return this.pristine&&this.getComponents().every((function(e){return e.isPristine}))}},{key:"isDirty",get:function(){return this.dirty&&this.getComponents().every((function(e){return e.isDirty}))}},{key:"detach",value:function(){this.components.forEach((function(e){e.detach()})),v(k(y.prototype),"detach",this).call(this)}},{key:"clear",value:function(){this.components.forEach((function(e){e.clear()})),v(k(y.prototype),"clear",this).call(this)}},{key:"destroy",value:function(){this.destroyComponents(),v(k(y.prototype),"destroy",this).call(this)}},{key:"destroyComponents",value:function(){var e=this;this.getComponents().slice().forEach((function(t){return e.removeComponent(t,e.components)})),this.components=[]}},{key:"errors",get:function(){var e=this.error?[this.error]:[];return this.getComponents().reduce((function(e,t){return e.concat(t.errors||[])}),e).filter((function(e){return"hidden"!==e.level}))}},{key:"getValue",value:function(){return this.data}},{key:"resetValue",value:function(){v(k(y.prototype),"resetValue",this).call(this),this.getComponents().forEach((function(e){return e.resetValue()})),this.setPristine(!0)}},{key:"dataReady",get:function(){return l.default.all(this.getComponents().map((function(e){return e.dataReady})))}},{key:"setNestedValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e._data=this.componentContext(e),"button"!==e.type&&("components"===e.type?e.tree&&e.hasValue(t)?e.setValue(o.default.get(t,e.key),n):e.setValue(t,n):t&&e.hasValue(t)?e.setValue(o.default.get(t,e.key),n):this.rootPristine&&!e.visible||!e.shouldAddDefaultValue?void 0:(n.noValidate=!n.dirty,n.resetValue=!0,e.setValue(e.defaultValue,n)))}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e&&(e.submitAsDraft&&!e.submit&&(n.noValidate=!0),this.getComponents().reduce((function(r,o){return t.setNestedValue(o,e,n,r)||r}),!1))}},{key:"lazyLoad",get:function(){var e;return null!==(e=this.component.lazyLoad)&&void 0!==e&&e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"getComponent"in e?s=e.getComponent(i,t,n):t&&t(e,o),a=null!==u?s:a.concat(s||l))}),u),a&&0!==a.length||!l||(a=null!==u?l:[l]),a):a}},{key:"everyComponent",value:function(e,t,n){var r;if(o.default.isObject(t)&&(n=t,t=null),null===(r=n)||void 0===r||!r.email){var i=this.getComponents(t);o.default.each(i,(function(t,r){return!1!==e(t,i,r)&&("function"!=typeof t.everyComponent||!1!==t.everyComponent(e,n))&&void 0}))}}},{key:"getValueAsString",value:function(e,t){if(null!=t&&t.email){var n,r='\n \n \n \n ';return null===(n=this.component.components)||void 0===n||n.forEach((function(e){var t=e.label||e.key;r+='")})),r+="\n \n \n \n ",this.iteratableRows.forEach((function(e){var n=e.components;r+="",o.default.each(n,(function(e){r+='"})),r+=""})),r+="\n \n
    '.concat(t,"
    ',e.isInputComponent&&e.visible&&!e.skipInEmail&&(r+=e.getView(e.dataValue,t)),r+="
    \n "}return e&&e.length?f(m(v.prototype),"getValueAsString",this).call(this,e,t):""}},{key:"getComponents",value:function(e){return void 0!==e?this.iteratableRows[e]?this.iteratableRows[e].components:[]:f(m(v.prototype),"getComponents",this).call(this)}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(l.default);t.default=y},67329:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(24603),n(74916),n(39714),n(89554),n(41539),n(54747),n(15306),n(68304),n(24812),n(30489);var o=s(n(64430)),i=s(n(24561)),a=s(n(96486)),l=n(82531);function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t\n ').concat(e.getView(e.dataValue,t),"\n \n "))}),c(c({},t),{},{fromRoot:!0})),n+="\n \n \n "}return a.default.isEmpty(e)?"":null!=t&&t.modalPreview?(delete t.modalPreview,this.getDataValueAsTable(e,t)):"[Complex Data]"}},{key:"getDataValueAsTable",value:function(e,t){var n='\n \n \n ',r=new RegExp("<(.*?)>");return this.components.forEach((function(e){if(e.isInputComponent&&e.visible&&!e.skipInEmail){var o=e.getView(e.dataValue,t);n+='\n \n \n \n \n ")}}),c(c({},t),{},{fromRoot:!0})),n+="\n \n
    '.concat(e.label,'').concat(e.component&&"html"===e.component.inputFormat&&r.test(o)?o:''),"
    \n "}},{key:"everyComponent",value:function(e,t){if(null!=t&&t.email){if(!t.fromRoot)return;delete t.fromRoot}return m(g(f.prototype),"everyComponent",this).call(this,e,t)}},{key:"getValue",value:function(){return this.dataValue}},{key:"updateValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.default.prototype.updateValue.call(this,e,t)}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1,r=this.hasValue();return r&&a.default.isEmpty(this.dataValue)&&(t.noValidate=!0),e&&a.default.isObject(e)&&r||(n=!0,this.dataValue=this.defaultValue),n=m(g(f.prototype),"setValue",this).call(this,e,t)||n,this.updateOnChange(t,n),n}}],r=[{key:"savedValueTypes",value:function(e){return(0,l.getComponentSavedTypes)(e)||[l.componentValueTypes.object]}}],n&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(i.default);t.default=w},7115:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=this.defaultSchema;return e.components&&(t=i.default.omit(t,"components")),i.default.defaultsDeep(e,t)}},{key:"init",value:function(){if(this.components=this.components||[],(this.builderMode||this.manualModeEnabled)&&u.default.prototype.addComponents.call(this,this.manualMode?this.address:{}),s.default.prototype.init.call(this),!this.builderMode)if(this.component.provider){var e=this.component,t=e.provider,n=e.providerOptions;this.provider=this.initializeProvider(t,n)}else if(this.component.map){this.component.provider=l.GoogleAddressProvider.name,this.component.providerOptions=this.component.providerOptions||{};var r=this.component,o=r.map,a=r.provider,c=r.providerOptions,f=o.key,d=o.region;f&&i.default.set(c,"params.key",f),d&&i.default.set(c,"params.region",d),this.provider=this.initializeProvider(a,c)}}},{key:"initializeProvider",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.interpolate(t.url),r=a.GlobalFormio.Providers.getProvider("address",e);return new r(v(v({},t),{},{url:n}))}},{key:"emptyValue",get:function(){return this.manualModeEnabled?{mode:x.Autocomplete,address:{}}:{}}},{key:"mode",get:function(){var e,t;return this.manualModeEnabled&&null!==(e=null===(t=this.dataValue)||void 0===t?void 0:t.mode)&&void 0!==e?e:x.Autocomplete},set:function(e){this.manualModeEnabled&&(this.dataValue.mode=e)}},{key:"autocompleteMode",get:function(){return this.mode===x.Autocomplete}},{key:"manualMode",get:function(){return this.mode===x.Manual}},{key:"manualModeEnabled",get:function(){return!this.isMultiple&&Boolean(this.component.enableManualMode)}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){t.data=e.address,t.setValue(t.dataValue,{noUpdateEvent:!0})}))}},{key:"isMultiple",get:function(){return Boolean(this.component.multiple)}},{key:"address",get:function(){return this.isMultiple?i.default.isArray(this.dataValue)?this.dataValue:[this.dataValue]:this.manualModeEnabled&&this.dataValue?this.dataValue.address:this.dataValue},set:function(e){this.manualModeEnabled&&!this.isMultiple?this.dataValue.address=e:this.dataValue=e}},{key:"defaultValue",get:function(){var e=O(j(_.prototype),"defaultValue",this);return this.isMultiple&&(e=i.default.isArray(e)?e:[e]),e}},{key:"defaultSchema",get:function(){return _.schema()}},{key:"isValueInLegacyFormat",value:function(e){return e&&!e.mode}},{key:"normalizeValue",value:function(e){return this.manualModeEnabled&&this.isValueInLegacyFormat(e)?{mode:x.Autocomplete,address:e}:e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=s.default.prototype.setValue.call(this,e,t);return this.manualMode&&this.restoreComponentsContext(),(n||!i.default.isEmpty(e)&&t.fromSubmission)&&this.redraw(),n}},{key:"modeSwitcher",get:function(){return this.refs&&this.refs[_.modeSwitcherRef]||null}},{key:"removeValueIcon",get:function(){return this.refs&&this.refs[_.removeValueIconRef]||null}},{key:"searchInput",get:function(){return this.refs&&this.refs[_.searchInputRef]||null}},{key:"addRowButton",get:function(){return this.refs&&this.refs[_.addRowButtonRef]||null}},{key:"removeRowButton",get:function(){return this.refs&&this.refs[_.removeRowButtonRef]||null}},{key:"searchInputAttributes",get:function(){var e={name:this.options.name,type:"text",class:"form-control",lang:this.options.language,tabindex:this.component.tabindex||0};return this.component.placeholder&&(e.placeholder=this.t(this.component.placeholder)),this.disabled&&(e.disabled="disabled"),i.default.defaults(e,this.component.attributes),e}},{key:"templateName",get:function(){return"address"}},{key:"gridTemplateName",get:function(){return"multiValueTable"}},{key:"rowTemplateName",get:function(){return"multiValueRow"}},{key:"hasChildren",get:function(){return!this.isMultiple&&(this.builderMode||this.manualModeEnabled)}},{key:"addAnother",get:function(){return this.t(this.component.addAnother||"Add Another")}},{key:"renderElement",value:function(e){return this.renderTemplate(this.templateName,{children:this.hasChildren?this.renderComponents():"",nestedKey:this.nestedKey,inputAttributes:this.searchInputAttributes,ref:{modeSwitcher:_.modeSwitcherRef,removeValueIcon:_.removeValueIconRef,searchInput:_.searchInputRef},displayValue:this.getDisplayValue(e),mode:{autocomplete:this.autocompleteMode,manual:this.manualMode}})}},{key:"renderRow",value:function(e,t){return this.renderTemplate(this.rowTemplateName,{index:t,disabled:this.disabled,element:"".concat(this.renderElement(e,t))})}},{key:"renderGrid",value:function(){return this.renderTemplate(this.gridTemplateName,{rows:this.address.map(this.renderRow.bind(this)).join(""),disabled:this.disabled,addAnother:this.addAnother})}},{key:"render",value:function(){return this.isMultiple?O(j(_.prototype),"render",this).call(this,this.renderGrid()):O(j(_.prototype),"render",this).call(this,this.renderElement())}},{key:"onSelectAddress",value:function(e,t,n){var r;this.isMultiple?(this.address[n]=e,this.address=function(e){if(Array.isArray(e))return m(e)}(r=this.address)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):this.address=e,this.triggerChange({modified:!0}),t&&(t.value=this.getDisplayValue(this.isMultiple?this.address[n]:this.address)),this.updateRemoveIcon(n)}},{key:"addRow",value:function(){this.address=this.address.concat(this.emptyValue),O(j(_.prototype),"redraw",this).call(this)}},{key:"attach",value:function(e){var t,n=this,r=(this.builderMode||this.manualMode?O(j(_.prototype),"attach",this):s.default.prototype.attach).call(this,e);if(!this.builderMode&&!this.provider&&this.component.provider){var a=this.component,l=a.provider,u=a.providerOptions;this.provider=this.initializeProvider(l,u)}return this.loadRefs(e,(b(t={},_.addRowButtonRef,"single"),b(t,_.modeSwitcherRef,"single"),b(t,_.removeRowButtonRef,"multiple"),b(t,_.removeValueIconRef,"multiple"),b(t,_.searchInputRef,"multiple"),t)),this.searchInput.forEach((function(e,t){!n.builderMode&&e&&n.provider&&("google"===n.component.provider?n.provider.attachAutocomplete(e,t,n.onSelectAddress.bind(n)):(0,o.default)({input:e,debounceWaitMs:300,fetch:function(e,t){var r=e;n.provider.search(r).then(t)},render:function(e){var t=n.ce("div");return t.textContent=n.getDisplayValue(e),t},onSelect:function(r){n.onSelectAddress(r,e,t)}}),n.addEventListener(e,"blur",(function(){e&&e.value&&(e.value=n.getDisplayValue(n.isMultiple?n.address[t]:n.address))})),n.addEventListener(e,"keyup",(function(){e&&(e.value||n.clearAddress(e,t))})))})),this.addRowButton&&this.addEventListener(this.addRowButton,"click",(function(e){e.preventDefault(),n.addRow()})),this.removeRowButton.forEach((function(e,t){n.addEventListener(e,"click",(function(e){e.preventDefault(),n.removeValue(t)}))})),this.modeSwitcher&&this.addEventListener(this.modeSwitcher,"change",(function(){n.modeSwitcher&&(n.dataValue=n.emptyValue,n.mode=n.modeSwitcher.checked?x.Manual:x.Autocomplete,n.builderMode||(n.manualMode&&n.restoreComponentsContext(),n.triggerChange({modified:!0})),n.redraw())})),this.builderMode||(this.removeValueIcon.forEach((function(e,t){n.updateRemoveIcon(t);var r=function(){var e,r=null===(e=n.searchInput)||void 0===e?void 0:e[t];n.clearAddress(r,t),r&&r.focus()};n.addEventListener(e,"click",r),n.addEventListener(e,"keydown",(function(e){"Enter"===e.key&&r()}))})),i.default.each(this.refs.searchInput||[],(function(e){return n.addFocusBlurEvents(e)}))),r}},{key:"addChildComponent",value:function(e){e.customConditional=C}},{key:"redraw",value:function(){var e=this,t=this.modeSwitcher&&document.activeElement===this.modeSwitcher;return O(j(_.prototype),"redraw",this).call(this).then((function(n){return t&&e.modeSwitcher&&e.modeSwitcher.focus(),n}))}},{key:"clearAddress",value:function(e,t){var n;this.isEmpty()||this.triggerChange(),null!==(n=this.address)&&void 0!==n&&n[t]?this.address[t]=this.emptyValue:this.address=this.emptyValue,e&&(e.value=""),this.updateRemoveIcon(t)}},{key:"getDisplayValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.address;return this.provider&&!this.manualMode?this.provider.getDisplayValue(e):""}},{key:"validateMultiple",value:function(){return this.isMultiple}},{key:"updateRemoveIcon",value:function(e){var t,n=null===(t=this.removeValueIcon)||void 0===t?void 0:t[e];if(n){var r=this.isMultiple?this.address[e]:this.address;this.isEmpty(r)||this.disabled?this.addClass(n,E):this.removeClass(n,E)}}},{key:"getValueAsString",value:function(e,t){if(!e)return"";var n=this.normalizeValue(e),r=this.manualModeEnabled?n:{address:n,mode:x.Autocomplete},o=r.address,a=r.mode===x.Manual;return this.provider&&!a?this.getDisplayValue(o):a?this.component.manualModeViewString?this.interpolate(this.component.manualModeViewString,{address:o,data:this.data,component:this.component}):this.getComponents().filter((function(e){return e.hasValue(o)})).map((function(e){return[e,i.default.get(o,e.key)]})).filter((function(e){var t=p(e,2),n=t[0],r=t[1];return!n.isEmpty(r)})).map((function(e){var n=p(e,2),r=n[0],o=n[1];return r.getValueAsString(o,t)})).join(", "):O(j(_.prototype),"getValueAsString",this).call(this,o,t)}},{key:"focus",value:function(){this.searchInput&&this.searchInput[0]&&this.searchInput[0].focus()}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nlink for available options",conditional:{json:{"===":[{var:"data.provider"},"google"]}}},{type:"textarea",input:!0,key:"manualModeViewString",label:"Manual Mode View String",placeholder:"Enter Manual Mode View String",description:'"address" variable references component value, "data" - submission data and "component" - address component schema.',weight:60,rows:5,editor:"ace",tooltip:"Specify template which should be when quering view string for the component value entered in manual mode. This string is used in table view, CSV export and email rendering. When left blank combined value of all components joined with comma will be used."}];t.default=a},93808:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(49337),n(33321),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(68309),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(24812),n(89554),n(41539),n(54747),n(92222),n(69720),n(74916),n(15306),n(96649),n(96078),n(82526),n(41817),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r},i=n(82531);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=o.default.isArray(e)?e:[e];var r=this.createMessagesList("error",e);return this.showAlert("error",r,n),t&&this.parentComponent.emit("error",e),e}},{key:"showMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e;r instanceof HTMLElement?r.setAttribute("ref","messageRef"):r=this.parentComponent.ce("p",{ref:"messageRef"}),this.showAlert(t,r,n)}},{key:"createMessagesList",value:function(e){if("error"===e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.customClasses,o=n.customEvents;this.setAlert(e,t,{customClasses:r}),this.alert&&(this.attach({customEvents:o}),this.parentComponent.prependTo(this.alert,this.container))}},{key:"setAlert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.alertTypes[e];if(this.alert&&this.clear(),t){var o=n.id,i=void 0===o?"".concat(e,"-list-").concat(this.parentComponent.id):o,a=n.customClasses,l=void 0===a?"alert alert-".concat(r):a;this.alert=this.parentComponent.ce("div",{id:i,class:l}),t instanceof HTMLElement?this.parentComponent.appendTo(t,this.alert):this.parentComponent.setContent(this.alert,t)}}},{key:"attach",value:function(e){var t,n,r,o=this,i=e.customEvents,a=void 0===i?{}:i;this.eventListenersKeys=[],this.loadRefs(this.alert,this.refsNames);var u=(null===(t=a.click)||void 0===t?void 0:t.listeners)||[],c=(null===(n=a.keypress)||void 0===n?void 0:n.listeners)||[];a=f(f({},a),{},{click:[].concat(l(u),[function(e){var t=e.currentTarget.dataset.componentKey;o.focusOnComponent(t)}]),keypress:[].concat(l(c),[function(e){var t=e.currentTarget.dataset.componentKey;o.focusOnComponent(t)}])}),null!==(r=this.refs.messageRef)&&void 0!==r&&r.length&&this.refs.messageRef.forEach((function(e){Object.entries(a).forEach((function(t){var n,r,i=(r=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(n,r)||s(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0];i[1].forEach((function(t){return o.parentComponent.addEventListener(e,a,t)})),o.eventListenersKeys.push(a)}))}))}},{key:"clear",value:function(){var e=this;try{var t;null!==(t=this.refs.messageRef)&&void 0!==t&&t.length&&this.refs.messageRef.forEach((function(t){e.eventListenersKeys.forEach((function(n){return e.parentComponent.removeEventListener(t,n)}))})),this.refs={},this.parentComponent.removeChildFrom(this.alert,this.container),this.alert=null}catch(e){}}},{key:"focusOnComponent",value:function(e){if(e){var t,n=this.parentComponent._parentPath?e.replace(this.parentComponent._parentPath,""):e,r=null===(t=this.parentComponent.root)||void 0===t?void 0:t.getComponent(n,null,e);r&&o.default.isFunction(r.focus)&&r.focus()}}},{key:"createMessage",value:function(e,t,n,r,o){if("error"===e)return this.createErrorMessage(t,n,r,o)}},{key:"createErrorMessage",value:function(e,t,n,r){var a,l,s={style:"cursor: pointer",ref:"messageRef",tabIndex:0,"aria-label":"".concat(t,". Click to navigate to the field with following error.")},u=this.parentComponent.ce("li",s);this.parentComponent.setContent(u,t);var c=!o.default.isUndefined(n)&&(null==r||null===(a=r.messages)||void 0===a?void 0:a[n]),f=(null==c?void 0:c.path)||(null==r||null===(l=r.component)||void 0===l?void 0:l.key);if(f){var d=(0,i.getStringFromComponentPath)(f);u.dataset.componentKey=d}this.parentComponent.appendTo(u,e)}},{key:"appendErrorToList",value:function(e,t){var n,r=this;if(null!=e&&null!==(n=e.messages)&&void 0!==n&&n.length)e.messages.forEach((function(n,o){var i=n.message;r.createMessage("error",t,i,o,e)}));else if(e){var i=o.default.isObject(e)?e.message||"":e;this.createMessage("error",t,i)}}}],n&&p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=m},89395:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=K(n(15178)),o=K(n(7115)),i=K(n(28110)),a=K(n(87533)),l=K(n(98237)),s=K(n(3248)),u=K(n(45187)),c=K(n(67400)),f=K(n(87018)),d=K(n(11988)),p=K(n(21006)),h=K(n(4025)),m=K(n(69403)),y=K(n(68489)),v=K(n(16659)),b=K(n(52710)),g=K(n(59973)),w=K(n(44415)),k=K(n(12775)),O=K(n(45574)),_=K(n(16494)),S=K(n(40970)),P=K(n(1512)),j=K(n(81089)),x=K(n(93268)),E=K(n(54570)),C=K(n(20481)),A=K(n(124)),T=K(n(64328)),M=K(n(99966)),R=K(n(24120)),D=K(n(66369)),I=K(n(68427)),L=K(n(39450)),V=K(n(5657)),N=K(n(28145)),F=K(n(3611)),B=K(n(53983)),U=K(n(65105)),z=K(n(69561)),H=K(n(18995)),q=K(n(81541)),W=K(n(793));function K(e){return e&&e.__esModule?e:{default:e}}r.default.address.editForm=o.default,r.default.button.editForm=i.default,r.default.checkbox.editForm=a.default,r.default.columns.editForm=l.default,r.default.component.editForm=s.default,r.default.container.editForm=u.default,r.default.content.editForm=c.default,r.default.currency.editForm=f.default,r.default.datagrid.editForm=d.default,r.default.datamap.editForm=p.default,r.default.datetime.editForm=h.default,r.default.day.editForm=m.default,r.default.editgrid.editForm=y.default,r.default.email.editForm=v.default,r.default.fieldset.editForm=b.default,r.default.file.editForm=g.default,r.default.form.editForm=w.default,r.default.list.editForm=k.default,r.default.hidden.editForm=O.default,r.default.htmlelement.editForm=_.default,r.default.nested.editForm=S.default,r.default.number.editForm=P.default,r.default.panel.editForm=j.default,r.default.password.editForm=x.default,r.default.phoneNumber.editForm=E.default,r.default.radio.editForm=C.default,r.default.recaptcha.editForm=A.default,r.default.resource.editForm=T.default,r.default.select.editForm=R.default,r.default.selectboxes.editForm=M.default,r.default.signature.editForm=D.default,r.default.survey.editForm=I.default,r.default.table.editForm=L.default,r.default.tabs.editForm=V.default,r.default.tags.editForm=N.default,r.default.textarea.editForm=F.default,r.default.textfield.editForm=B.default,r.default.time.editForm=U.default,r.default.tree.editForm=z.default,r.default.unknown.editForm=H.default,r.default.url.editForm=q.default,r.default.well.editForm=W.default;var Y=r.default;t.default=Y},28110:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n")}))}},{key:"attach",value:function(e){var t=this;return this.loadRefs(e,{input:"multiple"}),this.input=this.refs.input[0],this.refs.input&&(this.addEventListener(this.input,this.inputInfo.changeEvent,(function(){return t.updateValue(null,{modified:!0})})),this.addShortcut(this.input)),h(b(p.prototype),"attach",this).call(this,e)}},{key:"detach",value:function(e){e&&this.input&&this.removeShortcut(this.input),h(b(p.prototype),"detach",this).call(this)}},{key:"emptyValue",get:function(){return"radio"===this.component.inputType&&null}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return h(b(p.prototype),"isEmpty",this).call(this,e)||!1===e}},{key:"key",get:function(){return this.component.name?this.component.name:h(b(p.prototype),"key",this)}},{key:"getValueAt",value:function(e){return this.component.name?this.refs.input[e].checked?this.component.value:"":!!this.refs.input[e].checked}},{key:"getValue",value:function(){var e=h(b(p.prototype),"getValue",this).call(this);return this.component.name?e?this.setCheckedState(e):this.setCheckedState(this.dataValue):""===e?this.dataValue:!!e}},{key:"checked",get:function(){return this.component.name?this.dataValue===this.component.value:!!this.dataValue}},{key:"setCheckedState",value:function(e){if(this.input)return this.component.name?(this.input.value=e===this.component.value?this.component.value:0,this.input.checked=e===this.component.value?1:0):"on"===e?(this.input.value=1,this.input.checked=1):"off"===e?(this.input.value=0,this.input.checked=0):e?(this.input.value=1,this.input.checked=1):(this.input.value=0,this.input.checked=0),this.input.checked?this.input.setAttribute("checked",!0):this.input.removeAttribute("checked"),e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setCheckedState(e),h(b(p.prototype),"setValue",this).call(this,e,t)}},{key:"getValueAsString",value:function(e){var t=this.component,n=t.name,r=t.value,i=n?o.default.isEqual(e,r):e;return this.t(i?"Yes":"No")}},{key:"updateValue",value:function(e,t){this.component.name&&t.modified&&this.dataValue===this.component.value&&(this.input.checked=0,this.input.value=0,this.dataValue="",this.updateOnChange(t,!0));var n=h(b(p.prototype),"updateValue",this).call(this,e,t);return n&&this.input&&(this.input.checked?this.input.setAttribute("checked","true"):this.input.removeAttribute("checked")),n}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nContent',key:"content",weight:30,input:!0,customConditional:function(e){return"property"===e.row.type&&e.row.hasOwnProperty("property")&&"string"===e.row.property.type&&"content"===e.row.property.component}}]}]}]}]},87018:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:this.dataValue,n=S(E(_.prototype),"isEmpty",this).call(this,t);return null!==(e=this.components)&&void 0!==e&&e.length?this.components.reduce((function(e,t){return e&&t.isEmpty()}),!0):n}},{key:"getRowChunks",value:function(e,t){var n=e.reduce((function(e,t){var n=c(e,2),r=n[0],o=n[1],i=r+t;return[i,[].concat(h(o),[[r,i]])]}),[0,[]]);return c(n,2)[1].map((function(e){return o.default.slice.apply(o.default,[t].concat(h(e)))}))}},{key:"getGroups",value:function(){var e=o.default.get(this.component,"rowGroups",[]),t=o.default.map(e,"numberOfRows").slice(0,-1).reduce((function(e,t){var n=e[e.length-1];return e.concat(n+t)}),[0]);return e.reduce((function(e,n,r){return u(u({},e),{},O({},t[r],n))}),{})}},{key:"getGroupSizes",value:function(){return o.default.map(o.default.get(this.component,"rowGroups",[]),"numberOfRows")}},{key:"hasRowGroups",value:function(){return o.default.get(this,"component.enableRowGroups",!1)&&!this.builderMode}},{key:"totalRowsNumber",value:function(e){return o.default.sum(o.default.map(e,"numberOfRows"))}},{key:"setStaticValue",value:function(e){this.dataValue=o.default.range(e).map((function(){return{}}))}},{key:"hasExtraColumn",value:function(){return this.hasRemoveButtons()||this.canAddColumn}},{key:"hasRemoveButtons",value:function(){return!this.builderMode&&!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode&&this.dataValue.length>o.default.get(this.component,"validate.minLength",0)}},{key:"hasTopSubmit",value:function(){return this.hasAddButton()&&["top","both"].includes(this.addAnotherPosition)}},{key:"hasBottomSubmit",value:function(){return this.hasAddButton()&&["bottom","both"].includes(this.addAnotherPosition)}},{key:"canAddColumn",get:function(){return this.builderMode&&!this.options.design}},{key:"render",value:function(){var e=this.getColumns(),t=0,n=this.hasRemoveButtons();this.component.reorder&&t++,n&&t++,this.canAddColumn&&t++;var r=Math.floor(12/(e.length+t));return S(E(_.prototype),"render",this).call(this,this.renderTemplate("datagrid",{rows:this.getRows(),columns:e,groups:this.hasRowGroups()?this.getGroups():[],visibleColumns:this.visibleColumns,hasToggle:o.default.get(this,"component.groupToggle",!1),hasHeader:this.hasHeader(),hasExtraColumn:this.hasExtraColumn(),hasAddButton:this.hasAddButton(),hasRemoveButtons:n,hasTopSubmit:this.hasTopSubmit(),hasBottomSubmit:this.hasBottomSubmit(),hasGroups:this.hasRowGroups(),numColumns:e.length+(this.hasExtraColumn()?1:0),datagridKey:this.datagridKey,allowReorder:this.allowReorder,builder:this.builderMode,canAddColumn:this.canAddColumn,tabIndex:this.tabIndex,placeholder:this.renderTemplate("builderPlaceholder",{position:this.componentComponents.length}),colWidth:r.toString()}))}},{key:"getRows",value:function(){return this.rows.map((function(e){var t={};return o.default.each(e,(function(e,n){t[n]=e.render()})),t}))}},{key:"getColumns",value:function(){var e=this;return this.columns.filter((function(t){return!e.visibleColumns.hasOwnProperty(t.key)||e.visibleColumns[t.key]}))}},{key:"hasHeader",value:function(){return this.component.components.reduce((function(e,t){return e||(t.label||t.title)&&!t.hideLabel}),!1)}},{key:"loadRefs",value:function(e,t){if(S(E(_.prototype),"loadRefs",this).call(this,e,t),"single"===t.messageContainer){var n=o.default.last(e.querySelectorAll("[ref=messageContainer]"));this.refs.messageContainer=n||this.refs.messageContainer}}},{key:"attach",value:function(e){var t,n=this;this.loadRefs(e,(O(t={},"".concat(this.datagridKey,"-row"),"multiple"),O(t,"".concat(this.datagridKey,"-tbody"),"single"),O(t,"".concat(this.datagridKey,"-addRow"),"multiple"),O(t,"".concat(this.datagridKey,"-removeRow"),"multiple"),O(t,"".concat(this.datagridKey,"-group-header"),"multiple"),O(t,this.datagridKey,"multiple"),O(t,"messageContainer","single"),t)),this.allowReorder&&(this.refs["".concat(this.datagridKey,"-row")].forEach((function(e,t){e.dragInfo={index:t}})),r&&(this.dragula=r([this.refs["".concat(this.datagridKey,"-tbody")]],{moves:function(e,t,n){var r=n.getAttribute("data-key");if(t.getAttribute("data-key")===r)return n.classList.contains("formio-drag-button")}}).on("drop",this.onReorder.bind(this)),this.dragula.on("cloned",(function(e,t){e&&e.children&&t&&t.children&&o.default.each(t.children,(function(t,n){var r=getComputedStyle(t,null);if(""!==r.cssText)e.children[n].style.cssText=r.cssText;else{var o=Object.values(r).reduce((function(e,t){return"".concat(e).concat(t,":").concat(r.getPropertyValue(t),";")}),"");e.children[n].style.cssText=o}}))})))),this.refs["".concat(this.datagridKey,"-addRow")].forEach((function(e){n.addEventListener(e,"click",n.addRow.bind(n))})),this.refs["".concat(this.datagridKey,"-removeRow")].forEach((function(e,t){n.addEventListener(e,"click",n.removeRow.bind(n,t))})),this.hasRowGroups()&&(this.refs.chunks=this.getRowChunks(this.getGroupSizes(),this.refs["".concat(this.datagridKey,"-row")]),this.refs["".concat(this.datagridKey,"-group-header")].forEach((function(e,t){n.addEventListener(e,"click",(function(){return n.toggleGroup(e,t)}))})));var i=this.getColumns(),a=i.length;return this.rows.forEach((function(e,t){var r=0;i.forEach((function(e){n.attachComponents(n.refs[n.datagridKey][t*a+r],[n.rows[t][e.key]],n.getComponentsContainer()),r++}))})),S(E(_.prototype),"attach",this).call(this,e)}},{key:"getComponentsContainer",value:function(){return this.component.components}},{key:"onReorder",value:function(e,t,n,r){if(!e.dragInfo||r&&!r.dragInfo)console.warn("There is no Drag Info available for either dragged or sibling element");else{var o=e.dragInfo.index,i=r?r.dragInfo.index:this.dataValue.length,l=i>o,s=(0,a.fastCloneDeep)(this.dataValue),u=s[o];s.splice(i,0,u),s.splice(l?o:o+1,1),this.setValue(s,{isReordered:!0}),this.rebuild()}}},{key:"focusOnNewRowElement",value:function(e){Object.keys(e).find((function(t){var n=e[t].element;if(n){var r=(0,a.getFocusableElements)(n);if(r&&r[0])return r[0].focus(),!0}return!1}))}},{key:"addRow",value:function(){var e,t=this,n=this.rows.length;this.dataValue.length===n&&this.dataValue.push({});var r=this.dataValue,o=this.defaultValue;this.initEmpty&&o[n]?(e=o[n],r[n]=e):e=r[n],this.rows[n]=this.createRowComponents(e,n),this.emit("dataGridAddRow",{component:this.component,row:e}),this.checkConditions(),this.triggerChange(),this.redraw().then((function(){t.focusOnNewRowElement(t.rows[n])}))}},{key:"updateComponentsRowIndex",value:function(e,t){var n=this;e.forEach((function(e,r){var o;if(null!==(o=e.options)&&void 0!==o&&o.name){var i="[".concat(n.key,"][").concat(t,"]");e.options.name=e.options.name.replace("[".concat(n.key,"][").concat(e.rowIndex,"]"),i)}e.rowIndex=t,e.row="".concat(t,"-").concat(r),e.path=n.calculateComponentPath(e)}))}},{key:"updateRowsComponents",value:function(e){var t=this;this.rows.slice(e).forEach((function(n,r){t.updateComponentsRowIndex(Object.values(n),e+r)}))}},{key:"removeRow",value:function(e){var t=0===e&&1===this.rows.length,n={isReordered:!t,resetValue:t};this.splice(e,n),this.emit("dataGridDeleteRow",{index:e});var r=c(this.rows.splice(e,1),1)[0];this.removeRowComponents(r),this.updateRowsComponents(e),this.setValue(this.dataValue,n),this.redraw()}},{key:"removeRowComponents",value:function(e){var t=this;o.default.each(e,(function(e){return t.removeComponent(e)}))}},{key:"getRowValues",value:function(){return this.dataValue}},{key:"setRowComponentsData",value:function(e,t){o.default.each(this.rows[e],(function(e){e.data=t}))}},{key:"createRows",value:function(e,t){var n=this,r=!1,o=this.getRowValues();o.forEach((function(e,o){!t&&n.rows[o]?n.setRowComponentsData(o,e):(n.rows[o]&&n.removeRowComponents(n.rows[o]),n.rows[o]=n.createRowComponents(e,o),r=!0)}));var i=this.rows.splice(o.length),a=!!i.length;return a&&i.forEach((function(e){return n.removeRowComponents(e)})),e||!r&&!a||this.redraw(),r}},{key:"createRowComponents",value:function(e,t){var n=this,r={};return this.tabIndex=0,this.component.components.map((function(i,a){var l,s=o.default.clone(n.options);s.name+="[".concat(t,"]"),s.row="".concat(t,"-").concat(a),n.builderMode?(i.id=i.id+t,l=i):l=u(u({},i),{},{id:i.id+t});var c=n.createComponent(l,s,e);c.parentDisabled=!!n.disabled,c.rowIndex=t,c.inDataGrid=!0,l.tabindex&&parseInt(l.tabindex)>n.tabIndex&&(n.tabIndex=parseInt(l.tabindex)),r[i.key]=c})),r}},{key:"checkValidity",value:function(e,t,n,r){if(e=e||this.rootValue,n=n||this.data,!this.checkCondition(n,e))return this.setCustomValidity(""),!0;if(!this.checkComponentValidity(e,t,n,{silentCheck:r}))return!1;var o=this.checkRows("checkValidity",e,t,!0,r);return this.checkModal(o,t),o}},{key:"checkColumns",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||this.rootValue;var r=!1;if(!this.rows||!this.rows.length)return{rebuild:!1,show:!1};if(this.builderMode)return{rebuild:!1,show:!0};var i={},a=!1,l=this.dataValue;this.rows.forEach((function(r,s){o.default.each(r,(function(r,u){if(r&&"function"==typeof r.checkConditions){var c=void 0===i[u];if(i[u]=!!i[u]||r.checkConditions(e,n,l[s])&&"hidden"!==r.type,r.component.logic&&c){var f=o.default.findIndex(t.columns,["key",u]);o.default.isEqual(t.columns[f],r.component)||(a=!0,t.columns[f]=r.component)}}}))}));var s=!o.default.isEqual(i,this.visibleColumns)||a;return o.default.each(i,(function(e){r|=e})),this.visibleColumns=i,{rebuild:s,show:r}}},{key:"checkComponentConditions",value:function(e,t,n){var r=this.visible;if(!S(E(_.prototype),"checkComponentConditions",this).call(this,e,t,n))return!1;var o=this.checkColumns(e,t),i=o.rebuild,a=o.show;return!i&&r||this.createRows(!1,i),a}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return this.dataValue=this.defaultValue,this.createRows(),!1;Array.isArray(e)||("object"===p(e)?e=[e]:(this.createRows(),e=[{}])),!e||e.length||this.initEmpty||e.push({});var r=n.fromSubmission&&!o.default.isEqual(e,this.emptyValue),i=this.hasChanged(e,this.dataValue);return this.dataValue=e,(this.initRows||r||Array.isArray(this.dataValue)&&this.dataValue.length!==this.rows.length)&&!this.createRows()&&i&&this.redraw(),this.componentModal&&r&&this.componentModal.setValue(e),this.rows.forEach((function(r,i){e.length<=i||o.default.each(r,(function(r){r.rowIndex=i,t.setNestedValue(r,e[i],n)}))})),this.updateOnChange(n,i),i}},{key:"restoreComponentsContext",value:function(){var e=this;this.rows.forEach((function(t,n){return o.default.forIn(t,(function(t){return t.data=e.dataValue[n]}))}))}},{key:"getComponent",value:function(e,t){var n,r=d(n=e=Array.isArray(e)?e:[e])||y(n)||m(n)||f(),i=r[0],a=r.slice(1),l=[];if(o.default.isNumber(i)&&a.length){var s=a.pop();return(l=this.rows[i][s])||Object.entries(this.rows[i]).forEach((function(e){var n=c(e,2)[1];if("getComponent"in n){var r=n.getComponent([s],t);r&&(l=r)}})),l&&o.default.isFunction(t)&&t(l,this.getComponents()),a.length&&"getComponent"in l?l.getComponent(a,t):l}return o.default.isString(i)?(this.everyComponent((function(e,n){if(e.component.key===i){var r=e;a.length>0&&"getComponent"in e?r=e.getComponent(a,t):t&&t(e,n),l=l.concat(r)}})),l.length>0?l:null):l}},{key:"toggleGroup",value:function(e,t){e.classList.toggle("collapsed"),o.default.each(this.refs.chunks[t],(function(e){e.classList.toggle("hidden")}))}}],l=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(e.valueComponent=this.components[this.components.length-1].schema),i.default.omit(e,"components")}},{key:"init",value:function(){this.components=[],this.rows=[],this.createRows(),this.visibleColumns=d({key:!0},this.valueKey,!0),this.component.valueComponent.hideLabel=!0}},{key:"defaultSchema",get:function(){return g.schema()}},{key:"emptyValue",get:function(){return{}}},{key:"dataValue",get:function(){return!this.key||!this.visible&&this.component.clearOnHide?this.emptyValue:(!this.hasValue()&&this.shouldAddDefaultValue&&(this.dataValue=this.emptyValue),i.default.get(this.data,this.key))},set:function(e){!function(e,t,n,r,o){if(!f(e,t,n,r||e)&&o)throw new Error("failed to set property")}(b(g.prototype),"dataValue",e,this,!0)}},{key:"defaultValue",get:function(){var e=y(b(g.prototype),"defaultValue",this);return Array.isArray(e)?e[0]:this.emptyValue}},{key:"keySchema",get:function(){return{type:"textfield",input:!0,hideLabel:!0,label:this.component.keyLabel||"Key",key:"__key",disableBuilderActions:!0}}},{key:"valueKey",get:function(){return this.component.valueComponent.key}},{key:"getRowValues",value:function(){var e=this.dataValue;return this.builderMode?[e]:i.default.isEmpty(e)?[]:Object.keys(e).map((function(){return e}))}},{key:"getComponentsContainer",value:function(){return this.builderMode?this.getComponents().map((function(e){return e.component})):y(b(g.prototype),"getComponentsContainer",this).call(this)}},{key:"iteratableRows",get:function(){return this.rows.map((function(e){return Object.keys(e).map((function(t){return{components:e[t],data:e[t].dataValue}}))}))}},{key:"componentContext",value:function(e){return this.iteratableRows[e.row].find((function(t){return t.components.key===e.key})).data}},{key:"hasHeader",value:function(){return!0}},{key:"hasRemoveButtons",value:function(){return!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode}},{key:"getColumns",value:function(){var e=Object.assign({},this.keySchema),t=Object.assign({},this.component.valueComponent);return e.hideLabel=!1,t.hideLabel=!1,this.component.keyBeforeValue?[e,t]:[t,e]}},{key:"getRowKey",value:function(e){var t=Object.keys(this.dataValue);return t[e]||(t[e]=(0,l.uniqueKey)(this.dataValue,this.defaultRowKey)),t[e]}},{key:"defaultRowKey",get:function(){return"key"}},{key:"setRowComponentsData",value:function(e,t){i.default.each(this.rows[e],(function(n){"__key"===n.key?n.data={__key:Object.keys(t)[e]}:n.data=t}))}},{key:"getValueAsString",value:function(e,t){var n=this;if(null!=t&&t.email&&this.visible&&!this.skipInEmail&&i.default.isObject(e)){var r='\n \n \n ';return(r=Object.keys(e).reduce((function(r,o){return r+'\n \n \n \n \n ")}),r))+"\n \n
    '.concat(o,'').concat(n.getView(e[o],t),"
    \n "}return i.default.isEmpty(e)?"":null!=t&&t.modalPreview?(delete t.modalPreview,this.getDataValueAsTable(e,t)):"object"===u(e)?"[Complex Data]":e}},{key:"getDataValueAsTable",value:function(e,t){var n=this,r='\n \n \n ';return this.visible&&i.default.isObject(e)&&Object.keys(e).forEach((function(o){r+='\n \n \n \n \n ")})),r+="\n \n
    '.concat(o,'').concat(n.getView(e[o],t),"
    \n "}},{key:"createRowComponents",value:function(e,t){var n=this,r=this.builderMode?this.valueKey:this.getRowKey(t),o=i.default.clone(this.options);o.events=new a.default,o.name+="[".concat(t,"]"),o.row="".concat(t);var s={};s.__key=this.createComponent(this.keySchema,o,{__key:this.builderMode?this.defaultRowKey:r}),s.__key.on("componentChange",(function(e){var t=n.dataValue,o=(0,l.uniqueKey)(t,e.value);t[o]=t[r],delete t[r];var i=s[n.valueKey];i.component.key=o,i.path=n.calculateComponentPath(i),r=o}));var u=i.default.clone(this.component.valueComponent);u.key=r;var c=this.options;return c.row=o.row,s[this.valueKey]=this.createComponent(u,c,this.dataValue),s}},{key:"canAddColumn",get:function(){return!1}},{key:"addChildComponent",value:function(e){this.component.valueComponent=e}},{key:"saveChildComponent",value:function(e){e.key!==this.keySchema.key&&(this.component.valueComponent=e)}},{key:"removeChildComponent",value:function(){var e=g.schema();this.component.valueComponent=e.valueComponent}},{key:"addRow",value:function(){var e=this.rows.length;this.rows[e]=this.createRowComponents(this.dataValue,e),this.redraw(),this.triggerChange()}},{key:"removeRow",value:function(e){var t=Object.keys(this.dataValue);t[e]&&delete this.dataValue[t[e]],this.rows.splice(e,1),this.redraw(),this.triggerChange()}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.hasChanged(e,this.dataValue);return this.dataValue=e,this.createRows(),this.updateOnChange(t,n),n}},{key:"checkColumns",value:function(){return!this.builderMode&&this.dataValue&&Object.keys(this.dataValue).length&&Object.keys(this.dataValue).length>(this.rows||[]).length?{rebuild:!0,show:!0}:{rebuild:!1,show:!0}}}],o=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return!(!e||"Invalid Date"!==e.toString())||v(g(h.prototype),"isEmpty",this).call(this,e)}},{key:"formatValue",value:function(e){var t=i.default.utc(e).toISOString();return"Invalid date"===t?e:t}},{key:"isEqual",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dataValue;return this.isEmpty(e)&&this.isEmpty(t)||i.default.utc(e).format(this.momentFormat)===i.default.utc(t).format(this.momentFormat)}},{key:"createWrapper",value:function(){return!1}},{key:"checkValidity",value:function(e,t,n){return this.refs.input&&this.refs.input.forEach((function(e){e.widget&&e.widget.enteredDate&&(t=!0)})),v(g(h.prototype),"checkValidity",this).call(this,e,t,n)}},{key:"getValueAsString",value:function(e){var t=a.default.convertFormatToMoment(this.component.format);t+=t.match(/z$/)?"":" z";var n=this.timezone;return e&&!this.attached&&n?Array.isArray(e)&&this.component.multiple?e.map((function(e){return o.default.trim(a.default.momentDate(e,t,n).format(t))})).join(", "):o.default.trim(a.default.momentDate(e,t,n).format(t)):Array.isArray(e)&&this.component.multiple?e.map((function(e){return o.default.trim((0,i.default)(e).format(t))})).join(", "):(e?o.default.trim((0,i.default)(e).format(t)):e)||""}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n \n !!data.match(/\\d{4}-\\d{2}-\\d{2}/g));\nvalid = isValid || 'Invalid date';"},weight:21},{type:"panel",title:"Custom Disabled Dates",collapsible:!0,collapsed:!0,style:{"margin-bottom":"10px"},key:"panel-disable-function",customConditional:function(){return!r.default.noeval||r.default.protectedEval},components:[o(n(61550)).default.logicVariablesTable("dateThe date object."),{type:"textarea",input:!0,editor:"ace",key:"datePicker.disableFunction",label:"Disabling dates by a function",description:'For more information check out the Docs',weight:22},{type:"htmlelement",tag:"div",content:"

    Example

    // Disable all weekends
    date.getDay() === 0 || date.getDay() === 6
    \n "}]},{type:"checkbox",input:!0,key:"datePicker.disableWeekends",label:"Disable weekends",tooltip:"Check to disable weekends",weight:23},{type:"checkbox",input:!0,key:"datePicker.disableWeekdays",label:"Disable weekdays",tooltip:"Check to disable weekdays",weight:23}];t.default=i},48893:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,key:"displayInTimezone",label:"Display in Timezone",tooltip:"This will display the captured date time in the select timezone.",weight:30,defaultValue:"viewer",dataSrc:"values",data:{values:[{label:"of Viewer",value:"viewer"},{label:"of Submission",value:"submission"},{label:"of Location",value:"location"},{label:"UTC",value:"utc"}]}},{type:"select",input:!0,key:"timezone",label:"Select Timezone",tooltip:"Select the timezone you wish to display this Date",weight:31,lazyLoad:!0,defaultValue:"",valueProperty:"name",dataSrc:"url",data:{url:"{{options.cdnUrl}}/timezones.json"},template:"{{ item.label }}",conditional:{json:{"===":[{var:"data.displayInTimezone"},"location"]}}},{type:"checkbox",input:!0,key:"useLocaleSettings",label:"Use Locale Settings",tooltip:"Use locale settings to display date and time.",weight:51},{type:"checkbox",input:!0,key:"allowInput",label:"Allow Manual Input",tooltip:"Check this if you would like to allow the user to manually enter in the date.",weight:51},{type:"textfield",input:!0,key:"format",label:"Format",placeholder:"Format",description:'Use formats provided by DateParser Codes',tooltip:"The date format for displaying the datetime value.",weight:52},{type:"editgrid",input:!0,key:"shortcutButtons",label:"Shortcut Buttons",description:"You can specify few buttons which will be shown above the calendar. Use Label to specify the name of the button and onClick to specify which date/time will be set when user clicks the button. E.g, date = new Date()",templates:{header:'
    \n
    Label
    \n
    onClick
    \n
    ',row:'
    \n
    \n {{ flattenedComponents.label.getView(row.label) }}\n
    \n
    \n {{ flattenedComponents.onClick.getView(row.onClick) }}\n
    \n {% if (!instance.disabled) { %}\n
    \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n
    \n {% } %}\n
    '},components:[{label:"Label",key:"label",type:"textfield",input:!0,validate:{required:!0}},{label:"onClick",key:"onClick",type:"textarea",editor:"ace",input:!0,validate:{required:!0}}],defaultValue:[]}]},97839:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"checkbox",input:!0,key:"enableTime",label:"Enable Time Input",tooltip:"Enables time input for this field.",weight:0},{type:"number",input:!0,key:"timePicker.hourStep",label:"Hour Step Size",tooltip:"The number of hours to increment/decrement in the time picker.",weight:10},{type:"number",input:!0,key:"timePicker.minuteStep",label:"Minute Step Size",tooltip:"The number of minutes to increment/decrement in the time picker.",weight:20},{type:"checkbox",input:!0,key:"timePicker.showMeridian",label:"12 Hour Time (AM/PM)",tooltip:"Display time in 12 hour time with AM/PM.",weight:30}]},35733:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(82772),t.default=[{type:"checkbox",input:!0,key:"enableMinDateInput",label:"Use Input to add moment.js for minDate",persistent:!1,weight:10,tooltip:"Enables to use input for moment functions instead of calendar."},{type:"datetime",input:!0,key:"datePicker.minDate",label:"Use calendar to set minDate",skipMerge:!0,weight:10,tooltip:"Enables to use calendar to set date.",customConditional:function(e){var t=e.data,n=e.component;return!(n.datePicker&&n.datePicker.minDate&&-1!==n.datePicker.minDate.indexOf("moment")||t.enableMinDateInput)}},{type:"textfield",input:!0,enableTime:!1,key:"datePicker.minDate",skipMerge:!0,label:"Minimum Date",weight:10,tooltip:"The minimum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().subtract(10, 'days')",customConditional:function(e){var t=e.data,n=e.component;return!(!n.datePicker||!n.datePicker.minDate||-1===n.datePicker.minDate.indexOf("moment"))||t.enableMinDateInput}},{type:"checkbox",input:!0,key:"enableMaxDateInput",label:"Use Input to add moment.js for maxDate",persistent:!1,weight:20,tooltip:"Enables to use input for moment functions instead of calendar."},{type:"datetime",input:!0,key:"datePicker.maxDate",skipMerge:!0,label:"Use calendar to set maxDate",weight:20,tooltip:"Enables to use calendar to set date.",customConditional:function(e){var t=e.data,n=e.component;return!(n.datePicker&&n.datePicker.maxDate&&-1!==n.datePicker.maxDate.indexOf("moment")||t.enableMaxDateInput)}},{type:"textfield",input:!0,enableTime:!1,key:"datePicker.maxDate",skipMerge:!0,label:"Maximum Date",tooltip:"The maximum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().add(10, 'days')",weight:20,customConditional:function(e){var t=e.data,n=e.component;return!(!n.datePicker||!n.datePicker.maxDate||-1===n.datePicker.maxDate.indexOf("moment"))||t.enableMaxDateInput}}]},69403:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne&&(t.refs.day.value=t.refs.day.max),r(t.refs.month,"month")()})),this.addEventListener(this.refs.year,"input",r(this.refs.year,"year")),this.addEventListener(this.refs.input,this.info.changeEvent,(function(){return t.updateValue(null,{modified:!0})})),[this.refs.day,this.refs.month,this.refs.year].filter((function(e){return!!e})).forEach((function(e){w(O(v.prototype),"addFocusBlurEvents",t).call(t,e)}))),this.setValue(this.dataValue),this.disabled=this.shouldDisabled,n}},{key:"validateRequired",value:function(e,t){var n=this.parts,r=n.day,o=n.month,i=n.year;return!(this.dayRequired&&!r||this.monthRequired&&!o||this.yearRequired&&!i||(0,l.boolValue)(e)&&this.isEmpty(t))}},{key:"disabled",set:function(e){(function(e,t,n,r,o){if(!m(e,t,n,r||e)&&o)throw new Error("failed to set property")})(O(v.prototype),"disabled",e,this,!0),this.refs.year&&this.refs.month&&this.refs.day&&(e?(this.refs.year.setAttribute("disabled","disabled"),this.refs.month.setAttribute("disabled","disabled"),this.refs.day.setAttribute("disabled","disabled")):(this.refs.year.removeAttribute("disabled"),this.refs.month.removeAttribute("disabled"),this.refs.day.removeAttribute("disabled")))}},{key:"normalizeValue",value:function(e){if(!e||this.valueMask.test(e))return e;var t=[],n=e.split("/"),r=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),o=r[0],i=r[1],a=r[2],l=this.component.defaultValue?this.component.defaultValue.split("/"):"",s=function(e,r){return t.push(e?n.shift():r)};return this.dayFirst&&s(this.showDay,l?l[o]:"00"),s(this.showMonth,l?l[i]:"00"),this.dayFirst||s(this.showDay,l?l[o]:"00"),s(this.showYear,l?l[a]:"0000"),t.join("/")}},{key:"setValueAt",value:function(e,t){if(!t||"Invalid date"===t)return null;var n,r=t.split("/");this.component.dayFirst&&(n=r.shift());var o=r.shift();this.component.dayFirst||(n=r.shift());var i=r.shift();this.refs.day&&this.showDay&&(this.refs.day.value="00"===n?"":parseInt(n,10)),this.refs.month&&this.showMonth&&(this.refs.month.value="00"===o?"":parseInt(o,10)),this.refs.year&&this.showYear&&(this.refs.year.value="0000"===i?"":parseInt(i,10))}},{key:"getFieldValue",value:function(e){var t=this.dataValue?this.dataValue.split("/"):[],n=0;switch(e){case"month":n=t[this.dayFirst?1:0];break;case"day":n=t[this.dayFirst?0:1];break;case"year":n=t[2]}return n=parseInt(n,10),!o.default.isNaN(n)&&o.default.isNumber(n)?n:0}},{key:"parts",get:function(){return{day:this.getFieldValue("day"),month:this.getFieldValue("month"),year:this.getFieldValue("year")}}},{key:"format",get:function(){var e="";return this.component.dayFirst&&this.showDay&&(e+="D/"),this.showMonth&&(e+="M/"),!this.component.dayFirst&&this.showDay&&(e+="D/"),this.showYear?e+="YYYY":e.length?e.substring(0,e.length-1):e}},{key:"getDate",value:function(e){var t,n,r,i=[],a=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),l=a[0],s=a[1],u=a[2],c=e||this.component.defaultValue;return c&&(i=c.split("/").map((function(e){return parseInt(e,10)}))),this.showDay&&this.refs.day&&(t=parseInt(this.refs.day.value,10)),(void 0===t||o.default.isNaN(t))&&(t=i[l]&&!o.default.isNaN(i[l])?i[l]:0),this.showMonth&&this.refs.month&&(n=parseInt(this.refs.month.value,10)),(void 0===n||o.default.isNaN(n))&&(n=i[s]&&!o.default.isNaN(i[s])?i[s]:0),this.showYear&&this.refs.year&&(r=parseInt(this.refs.year.value)),(void 0===r||o.default.isNaN(r))&&(r=i[u]&&!o.default.isNaN(i[u])?i[u]:0),t||n||r?(t=this.showDay?t.toString().padStart(2,0):"",n=this.showMonth?n.toString().padStart(2,0):"",r=this.showYear?r.toString().padStart(4,0):"",this.component.dayFirst?"".concat(t).concat(this.showDay&&this.showMonth||this.showDay&&this.showYear?"/":"").concat(n).concat(this.showMonth&&this.showYear?"/":"").concat(r):"".concat(n).concat(this.showDay&&this.showMonth||this.showMonth&&this.showYear?"/":"").concat(t).concat(this.showDay&&this.showYear?"/":"").concat(r)):null}},{key:"date",get:function(){return this.getDate()}},{key:"validationValue",get:function(){return this.dataValue}},{key:"getValue",value:function(){return w(O(v.prototype),"getValue",this).call(this)||this.dataValue}},{key:"getValueAt",value:function(e){var t=this.date||this.emptyValue;return t?(this.refs.input[e].value=t,this.refs.input[e].value):(this.refs.input[e].value="",null)}},{key:"getValueAsString",value:function(e){return this.getDate(e)||""}},{key:"focus",value:function(e){if(e&&"string"==typeof e&&this.refs[e])this.refs[e].focus();else if(this.dayFirst&&this.showDay||!this.dayFirst&&!this.showMonth&&this.showDay){var t;null===(t=this.refs.day)||void 0===t||t.focus()}else if(this.dayFirst&&!this.showDay&&this.showMonth||!this.dayFirst&&this.showMonth){var n;null===(n=this.refs.month)||void 0===n||n.focus()}else if(!this.showDay&&!this.showDay&&this.showYear){var r;null===(r=this.refs.year)||void 0===r||r.focus()}}},{key:"restoreCaretPosition",value:function(){var e,t,n;if(null!==(e=this.root)&&void 0!==e&&e.currentSelection){var r=this.root.currentSelection,o=r.selection,i=r.index;if(this.refs[i]){var a=this.refs[i];/text|search|password|tel|url/i.test((null==(t=a)?void 0:t.type)||"")&&a.setSelectionRange.apply(a,function(e){if(Array.isArray(e))return p(e)}(n=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||d(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}}},{key:"isPartialDay",value:function(e){if(!e)return!1;var t=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),n=t[0],r=t[1],o=t[2],i=e.split("/");return"00"===i[n]||"00"===i[r]||"0000"===i[o]}},{key:"getValidationFormat",value:function(){return this.dayFirst?"DD-MM-YYYY":"MM-DD-YYYY"}}])&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(a.default);t.default=_},51951:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"multiple",ignore:!0}]},86842:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.day.type",label:"Type",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:210,type:"textfield",input:!0,key:"fields.day.placeholder",label:"Placeholder",placeholder:"Day Placeholder",tooltip:"The placeholder text that will appear when Day field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Day part of the component.",key:"fields.day.hide",input:!0},{weight:214,type:"checkbox",label:"Day First",tooltip:"Display the Day field before the Month field.",key:"dayFirst",input:!0}]},84846:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{weight:15,type:"checkbox",label:"Hide Input Labels",tooltip:"Hide the labels of component inputs. This allows you to show the labels in the form builder, but not when it is rendered.",key:"hideInputLabels",input:!0},{type:"select",input:!0,key:"inputsLabelPosition",label:"Inputs Label Position",tooltip:"Position for the labels for inputs for this field.",weight:40,defaultValue:"top",dataSrc:"values",data:{values:[{label:"Top",value:"top"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Bottom",value:"bottom"}]}},{key:"placeholder",ignore:!0},{weight:213,type:"checkbox",label:"Use Locale Settings",tooltip:"Use locale settings to display day.",key:"useLocaleSettings",input:!0}]},65207:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.month.type",label:"Type of input",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:210,type:"textfield",input:!0,key:"fields.month.placeholder",label:"Placeholder",placeholder:"Month Placeholder",tooltip:"The placeholder text that will appear when Month field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Month part of the component.",key:"fields.month.hide",input:!0}]},6474:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"validate.required",ignore:!0},{key:"validate.unique",ignore:!0},{weight:0,type:"checkbox",label:"Require Day",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.day.required",input:!0},{weight:10,type:"checkbox",label:"Require Month",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.month.required",input:!0},{weight:20,type:"checkbox",label:"Require Year",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.year.required",input:!0},{weight:40,type:"textfield",label:"Minimum Day",placeholder:"yyyy-MM-dd",tooltip:"A minimum date that can be set. You can also use Moment.js functions. For example: \n \n moment().subtract(10, 'days')",key:"minDate",input:!0},{weight:30,type:"textfield",label:"Maximum Day",placeholder:"yyyy-MM-dd",tooltip:"A maximum day that can be set. You can also use Moment.js functions. For example: \n \n moment().add(10, 'days')",key:"maxDate",input:!0}]},2420:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.year.type",label:"Type of input",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:203,type:"number",input:!0,key:"fields.year.minYear",label:"Minimum Year",placeholder:"1900",tooltip:"The minimum year that can be entered."},{weight:204,type:"number",input:!0,key:"fields.year.maxYear",label:"Maximum Year",placeholder:"2030",tooltip:"The maximum year that can be entered."},{weight:210,type:"textfield",input:!0,key:"fields.year.placeholder",label:"Placeholder",placeholder:"Year Placeholder",tooltip:"The placeholder text that will appear when Year field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Year part of the component.",key:"fields.year.hide",input:!0}]},68489:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'.concat(this.t("Do you want to clear data?"),'\n
    \n \n \n
    \n ")}},{key:"defaultRowTemplate",get:function(){return this.displayAsTable?O.defaultTableRowTemplate:O.defaultRowTemplate}},{key:"defaultHeaderTemplate",get:function(){return this.displayAsTable?O.defaultTableHeaderTemplate:O.defaultHeaderTemplate}},{key:"rowTemplate",get:function(){return s.Evaluator.noeval?this.displayAsTable?u.default.tableRow:u.default.row:this.displayAsTable?r.default.get(this.component,"templates.tableRow",this.defaultRowTemplate):r.default.get(this.component,"templates.row",this.defaultRowTemplate)}},{key:"headerTemplate",get:function(){return s.Evaluator.noeval?this.displayAsTable?u.default.tableHeader:u.default.header:this.displayAsTable?r.default.get(this.component,"templates.tableHeader",this.defaultHeaderTemplate):r.default.get(this.component,"templates.header",this.defaultHeaderTemplate)}},{key:"hasScopedChildren",get:function(){return!this.inlineEditMode}},{key:"defaultSchema",get:function(){return O.schema()}},{key:"emptyValue",get:function(){return[]}},{key:"editgridKey",get:function(){return"editgrid-".concat(this.key)}},{key:"rowRef",get:function(){return"".concat(this.editgridKey,"-row")}},{key:"rowElements",get:function(){return this.refs[this.rowRef]}},{key:"rowRefs",get:function(){return this.refs["editgrid-".concat(this.component.key,"-row")]}},{key:"addRowRef",get:function(){return"".concat(this.editgridKey,"-addRow")}},{key:"addRowElements",get:function(){return this.refs[this.addRowRef]}},{key:"saveRowRef",get:function(){return"".concat(this.editgridKey,"-saveRow")}},{key:"saveRowElements",get:function(){return this.refs[this.saveRowRef]}},{key:"cancelRowRef",get:function(){return"".concat(this.editgridKey,"-cancelRow")}},{key:"cancelRowElements",get:function(){return this.refs[this.cancelRowRef]}},{key:"inlineEditMode",get:function(){return this.component.inlineEdit}},{key:"saveEditMode",get:function(){return!this.inlineEditMode}},{key:"minLength",get:function(){return this.builderMode?0:r.default.get(this.component,"validate.minLength",0)}},{key:"data",get:function(){return this._data},set:function(e){this._data=e;var t=this.dataValue;(this.editRows||[]).forEach((function(e,n){t[n]||e.state===j.New||(t[n]={});var r=t[n]||{};e.data=r,e.components.forEach((function(e){e.data=r}))}))}},{key:"dataValue",get:function(){return _(P(O.prototype),"dataValue",this)||[]},set:function(e){!function(e,t,n,r,o){if(!w(e,t,n,r||e)&&o)throw new Error("failed to set property")}(P(O.prototype),"dataValue",e,this,!0)}},{key:"displayAsTable",get:function(){return this.component.displayAsTable}},{key:"iteratableRows",get:function(){return this.editRows}},{key:"defaultValue",get:function(){var e=_(P(O.prototype),"defaultValue",this),t=Array.isArray(e)?e:[];return r.default.times(this.minLength-t.length,(function(){return t.push({})})),t}},{key:"hasRemoveButtons",value:function(){return!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode&&this.dataValue.length>r.default.get(this.component,"validate.minLength",0)}},{key:"init",value:function(){var e=this;if(this.builderMode)return this.editRows=[],_(P(O.prototype),"init",this).call(this);this.components=this.components||[];var t=this.dataValue;!t.length&&this.component.openWhenEmpty?(this.editRows=[],this.createRow({},0)):this.editRows=t.map((function(t,n){return{components:e.lazyLoad?[]:e.createRowComponents(t,n),data:t,state:j.Saved,backup:null,error:null,rowIndex:n}})),this.prevHasAddButton=this.hasAddButton(),this.checkData(),this.setVariableTypeComponents(),this.variableTypeComponentsIndexes.length&&r.default.each(this.editRows||[],(function(t,n){return e.checkRowVariableTypeComponents(t,n)}))}},{key:"checkRowVariableTypeComponents",value:function(e,t){var n=e.components;r.default.some(this.variableTypeComponentsIndexes,(function(e){var t=n[e];return t.type!==t.component.type}))&&(e.components=this.createRowComponents(e.data,t,!0))}},{key:"setVariableTypeComponents",value:function(){var e=this;this.variableTypeComponentsIndexes=[],r.default.each(this.component.components,(function(t,n){t.typeChangeEnabled&&e.variableTypeComponentsIndexes.push(n)}))}},{key:"isOpen",value:function(e){return[j.New,j.Editing,j.Viewing].includes(e.state)}},{key:"isComponentVisibleInSomeRow",value:function(e){var t=this,n=this.editRows,o=[j.Saved,j.Editing,j.Draft],i=n.filter((function(e){return r.default.includes(o,e.state)}));this.visibleInHeader=this.visibleInHeader||[];var a=function(e,n){n||r.default.remove(t.visibleInHeader,(function(t){return t===e.key})),n&&!r.default.includes(t.visibleInHeader,e.key)&&t.visibleInHeader.push(e.key)};if(r.default.isEmpty(n)){var l,u=this.createRowComponents({},0);(0,s.eachComponent)(u,(function(t){t.component.key===e.key&&(l=t),t.checkConditions()}));var c=!l||l.visible;return h(this.components).forEach((function(e){return t.removeComponent(e,t.components)})),a(e,c),c}var f=r.default.get(this.component,"openWhenEmpty")&&1===n.length&&n[0].state===j.New;return r.default.isEmpty(n)||!r.default.isEmpty(i)||f?r.default.some(f?n:i,(function(n,o){var i;if(n.state===j.Editing)i=r.default.includes(t.visibleInHeader,e.key);else{var l=t.flattenComponents(o)[e.key];i=!l||l.visible,a(e,i)}return i})):r.default.includes(this.visibleInHeader,e.key)}},{key:"render",value:function(e){var t=this;if(this.builderMode)return _(P(O.prototype),"render",this).call(this);var n=this.dataValue,o=this.headerTemplate,i=this.t.bind(this),a=this.displayAsTable?"editgridTable":"editgrid";return _(P(O.prototype),"render",this).call(this,e||this.renderTemplate(a,{ref:{row:this.rowRef,addRow:this.addRowRef,saveRow:this.saveRowRef,cancelRow:this.cancelRowRef},header:this.renderString(o,{displayValue:function(e){return t.displayComponentValue(e,!0)},components:this.component.components,value:n,t:i}),footer:this.renderString(r.default.get(this.component,"templates.footer"),{components:this.component.components,value:n,t:i}),rows:this.editRows.map(this.renderRow.bind(this)),openRows:this.editRows.map((function(e){return t.isOpen(e)})),errors:this.editRows.map((function(e){return e.error})),hasAddButton:this.hasAddButton(),hasRemoveButtons:this.hasRemoveButtons()}))}},{key:"renderComponents",value:function(e){var t=(e=e||this.getComponents()).map((function(e){return e.render()})),n=this.displayAsTable&&this.prevHasAddButton?"tableComponents":"components";return this.renderTemplate(n,{children:t,components:e})}},{key:"attach",value:function(e){var t,n=this;if(this.builderMode)return _(P(O.prototype),"attach",this).call(this,e);this.loadRefs(e,(k(t={},this.addRowRef,"multiple"),k(t,this.saveRowRef,"multiple"),k(t,this.cancelRowRef,"multiple"),k(t,this.rowRef,"multiple"),t)),this.addRowElements.forEach((function(e){n.addEventListener(e,"click",(function(){return n.addRow()}))}));var o=0;this.rowElements.forEach((function(e,t){var i=n.editRows[t];null!=i&&i.isRowSelected&&e.classList.add("selected"),n.isOpen(i)?(n.attachComponents(e,i.components),n.addEventListener(n.saveRowElements[o],"click",(function(){return n.saveRow(t,!0)})),n.addEventListener(n.cancelRowElements[o],"click",(function(){return n.cancelRow(t)})),o++):[{className:"removeRow",event:"click",action:function(){return n.removeRow(t,!0)}},{className:"editRow",event:"click",action:function(){n.editRow(t).then((function(){if(n.component.rowDrafts){var e;n.validateRow(i,!1);var t=i.errors&&!!i.errors.length;n.component.modal&&t&&(null===(e=n.root)||void 0===e?void 0:e.submitted)&&(n.alert.showErrors(i.errors,!1),i.alerts=!0)}}))}},{className:"row",event:"click",action:function(){e.classList.toggle("selected");var r="editGridSelectRow";Array.from(e.classList).includes("selected")?i.isRowSelected=!0:(delete i.isRowSelected,r="editGridUnSelectRow"),n.emit(r,{component:n.component,data:n.dataValue[t]})}}].forEach((function(t){var o=t.className,i=t.event,a=t.action,l=e.getElementsByClassName(o);Array.prototype.forEach.call(l,(function(e){n.options.pdf&&r.default.intersection(e.classList,["editRow","removeRow"]).length?e.style.display="none":n.addEventListener(e,i,a)}))}))})),o?this.addClass(this.refs.component,"formio-component-".concat(this.component.type,"-row-open")):this.removeClass(this.refs.component,"formio-component-".concat(this.component.type,"-row-open"));var i=_(P(O.prototype),"attach",this).call(this,e);return this.loadRefs(e,{messageContainer:"single-scope"}),i}},{key:"flattenRowDataValue",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(o){r.default.isObject(e[o])&&!r.default.isNil(e[o])?Object.assign(n,t.flattenRowDataValue(e[o])):n[o]=e[o]})),n}},{key:"isComponentVisibleInRow",value:function(e,t){var n=t[e.key];return!n||n.visible}},{key:"displayComponentValue",value:function(e,t){return!!(e.hasOwnProperty("tableView")&&!e.tableView||!t?r.default.includes(this.visibleInHeader,e.key):this.isComponentVisibleInSomeRow(e))}},{key:"renderRow",value:function(e,t){var n=this,r=this.dataValue;if(this.isOpen(e))return this.renderComponents(e.components);var o=this.flattenComponents(t),i=this.rowTemplate;return this.renderString(i,{row:r[t]||{},data:this.data,rowIndex:t,components:this.component.components,flattenedComponents:o,displayValue:function(e){return n.displayComponentValue(e)},isVisibleInRow:function(e){return n.isComponentVisibleInRow(e,o)},getView:function(e,t){var n,r,i=o[e.key],a=i?i.getView(t||i.dataValue):"",l=new RegExp("<(.*?)>");return"string"!=typeof a||!a.length||null!==(n=i.component)&&void 0!==n&&n.template||!l.test(a)||"html"===(null===(r=i.component)||void 0===r?void 0:r.inputFormat)?a:'')},state:this.editRows[t].state,t:this.t.bind(this)})}},{key:"eachComponent",value:function(e,t){r.default.each(this.getComponents(t),(function(t,n){if(!1===e(t,n))return!1}))}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){var n,r=e.dataValue[t.rowIndex],o=null===(n=e.editRows[t.rowIndex])||void 0===n?void 0:n.data;t.data=r||o}))}},{key:"flattenComponents",value:function(e){var t={};return this.everyComponent((function(e){t[e.component.flattenAs||e.key]=e}),e),t}},{key:"getComponents",value:function(e){var t;return this.editRows=this.editRows||[],this.builderMode?_(P(O.prototype),"getComponents",this).call(this):r.default.isNumber(e)?(null===(t=this.editRows[e])||void 0===t?void 0:t.components)||[]:this.editRows.reduce((function(e,t){return e.concat(t.components||[])}),[])}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calculatedValue=void 0,_(P(O.prototype),"destroy",this).call(this,e)}},{key:"destroyComponents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.builderMode)return _(P(O.prototype),"destroyComponents",this).call(this);var n=this.getComponents(t).slice();n.forEach((function(t){return e.removeComponent(t,e.components)}))}},{key:"createRow",value:function(e,t){var n={components:this.createRowComponents(e,t),data:e,state:j.New,backup:null,error:null,rowIndex:t};return this.editRows.push(n),this.inlineEditMode&&this.dataValue.push(e),n}},{key:"addRow",value:function(){if(!this.options.readOnly){var e=this.editRows.length,t=this.createRow({},e);return t.state===j.New&&(this.emptyRow=(0,s.fastCloneDeep)(t.data)),this.inlineEditMode&&this.triggerChange(),this.emit("editGridAddRow",{component:this.component,row:t}),this.checkRow("checkData",null,{},t.data,t.components),this.component.modal?this.addRowModal(e):this.redraw(),t}}},{key:"addRowModal",value:function(e){var t=this,n=this.ce("div"),r=this.editRows[e];r.willBeSaved=!1;var o=r.components;n.innerHTML=this.renderComponents(o);var i=this.component.modal?this.createModal(n,{},(function(){return t.showDialog(e)})):void 0;return i.classList.add("editgrid-row-modal-".concat(this.id)),r.dialog=i,this.alert&&(this.alert.clear(),this.alert=null),this.alert=new l.default(i.refs.dialogContents,this),this.addEventListener(i,"close",(function(){r.willBeSaved||(t.editRows[e]&&t.editRows[e].state!==j.New&&t.editRows[e].components.forEach((function(e){e.setPristine(!0)})),t.cancelRow(e)),t.alert&&(t.alert.clear(),t.alert=null),delete r.confirmationDialog,delete r.dialog})),i.refs.dialogContents.appendChild(this.ce("button",{class:"btn btn-primary",onClick:function(){t.component.rowDrafts||r.components.forEach((function(e){return e.setPristine(!1)})),t.validateRow(r,!0)||t.component.rowDrafts?(r.willBeSaved=!0,i.close(),t.saveRow(e,!0)):(t.alert.showErrors(r.errors,!1),r.alerts=!0)}},this.component.saveRow||"Save")),this.attachComponents(n,o)}},{key:"showDialog",value:function(e){var t=this.editRows[e];if(t.state===j.New?r.default.isEqual(this.emptyRow,t.data):r.default.isEqual(t.backup,t.data))return Promise.resolve();var n=this.ce("div",{ref:"confirmationDialog"}),i=this.component.dialogTemplate||this.defaultDialogTemplate;n.innerHTML=i,n.refs={},this.loadRefs.call(n,n,{dialogHeader:"single",dialogCancelButton:"single",dialogYesButton:"single"});var a=this.createModal(n);a.classList.add("editgrid-row-modal-confirmation-".concat(this.id));var l,s=function(e){e.preventDefault(),a.close()},u=new o.default((function(e,t){l={resolve:e,reject:t}}));return this.addEventListener(n.refs.dialogYesButton,"click",(function(e){s(e),l.resolve()})),this.addEventListener(n.refs.dialogCancelButton,"click",(function(e){s(e),l.reject()})),t.confirmationDialog=a,u}},{key:"editRow",value:function(e){var t=this.editRows[e],n=t.state===j.Editing||t.state===j.New;if(!t||n)return o.default.resolve();t.prevState=t.state,t.state=this.options.readOnly?j.Viewing:j.Editing,this.lazyLoad&&0===t.components.length&&(t.components=this.createRowComponents(t.data,e));var r=(0,s.fastCloneDeep)(t.data);return this.inlineEditMode?t.backup=r:(t.backup=(0,s.fastCloneDeep)(t.data),t.data=r,this.restoreRowContext(t)),this.component.modal?this.addRowModal(e):this.redraw()}},{key:"clearErrors",value:function(e){var t=this.editRows[e];t&&Array.isArray(t.components)&&t.components.forEach((function(e){e.setPristine(!0),e.setCustomValidity("")}))}},{key:"cancelRow",value:function(e){if(!this.options.readOnly){var t=this.editRows[e];switch(t.state){case j.New:t.state=j.Removed,this.clearErrors(e),this.destroyComponents(e),this.inlineEditMode&&this.splice(e),this.editRows.splice(e,1),this.openWhenEmpty();break;case j.Editing:t.state=t.prevState,this.inlineEditMode&&(this.dataValue[e]=t.backup),t.data=t.backup,t.backup=null,this.restoreRowContext(t),this.clearErrors(e)}this.emit("editGridCancelRow",{instance:this,component:this.component,editRow:t}),this.checkValidity(null,!0),this.redraw(),this.component.rowDrafts&&this.checkValidity(this.data,!1)}}},{key:"saveRow",value:function(e,t){var n=this,r=this.editRows[e];if(!this.options.readOnly){this.component.rowDrafts||r.components.forEach((function(e){return e.setPristine(!1)}));var o=this.validateRow(r,!0);if(!this.component.rowDrafts&&!o)return!1;if(this.saveEditMode){var i,a,l=this.dataValue;switch(null!==(i=this.root)&&void 0!==i&&null!==(a=i.focusedComponent)&&void 0!==a&&a.component.typeChangeEnabled&&(this.root.focusedComponent=null),r.state){case j.New:var s=l.length;l.push(r.data),r.components.forEach((function(e){return e.rowIndex=s})),e!==s&&(this.editRows.splice(e,1),this.editRows.splice(s,0,r));break;case j.Editing:l[e]=r.data}}return r.state=this.component.rowDrafts&&!o?j.Draft:j.Saved,r.backup=null,this.updateValue(),this.emit("editGridSaveRow",{component:this.component,row:r.data,instance:this}),this.triggerChange({modified:t,noPristineChangeOnModified:t&&this.component.rowDrafts,isolateRow:!0}),this.component.rowDrafts&&r.components.forEach((function(e){return e.setPristine(n.pristine)})),this.checkValidity(null,!0),this.redraw(),r.alerts&&(r.alerts=!1),!0}}},{key:"beforeFocus",value:function(e){"beforeFocus"in this.parent&&this.parent.beforeFocus(this);var t=this.getRelativePath(e.path),n=(0,s.getArrayFromComponentPath)(t),o=n[0],i=n[0];this.editRows.forEach((function(e,t){e.rowIndex===o&&(i=t)})),r.default.isNumber(i)&&this.editRow(i)}},{key:"updateComponentsRowIndex",value:function(e,t){e.forEach((function(e,n){e.rowIndex=t,e.row="".concat(t,"-").concat(n)}))}},{key:"updateRowsComponents",value:function(e){var t=this;this.editRows.slice(e).forEach((function(n,r){t.updateComponentsRowIndex(n.components,e+r)}))}},{key:"baseRemoveRow",value:function(e){var t=this.editRows[e];return t.state=j.Removed,this.destroyComponents(e),t}},{key:"removeRow",value:function(e,t){this.options.readOnly||(this.clearErrors(e),this.baseRemoveRow(e),this.splice(e),this.emit("editGridDeleteRow",{index:e}),this.editRows.splice(e,1),this.openWhenEmpty(),this.updateRowsComponents(e),this.updateValue(),this.triggerChange({modified:t,noPristineChangeOnModified:t&&this.component.rowDrafts,isolateRow:!0}),this.checkValidity(null,!0),this.checkData(),this.redraw())}},{key:"createRowComponents",value:function(e,t,n){var o=this;if(this.components)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;if(null!==(e=i.instance.root)&&void 0!==e&&e.id&&(null===(n=o.root)||void 0===n?void 0:n.id)!==i.instance.root.id?i.instance.root.triggerChange(r,i,a):o.component.modal||o.triggerRootChange(r,i,a),!o.inlineEditMode){var l=o.editRows[t];if(null!=l&&l.alerts)o.checkData(null,p(p({},r),{},{changed:i,rowIndex:t}),o.data);else if(l){var s=o.component.rowDrafts&&!o.shouldValidateDraft(l);o.checkRow("checkData",null,p(p({},r),{},{changed:i,silentCheck:s}),l.data,l.components,s)}o.variableTypeComponentsIndexes.length&&(o.checkRowVariableTypeComponents(l,t),o.redraw())}};var d=o.createComponent(r.default.assign({},c,{row:f.row}),f,e,null,n&&a?a[l]:null);return d.rowIndex=t,d.inEditGrid=!0,d}))}},{key:"hasOpenRows",value:function(){var e=this;return this.editRows.some((function(t){return e.isOpen(t)}))}},{key:"shouldValidateDraft",value:function(e){var t,n;return e.state===j.Draft&&!this.pristine&&!(null!==(t=this.root)&&void 0!==t&&t.pristine)&&!this.hasOpenRows()||(null===(n=this.root)||void 0===n?void 0:n.submitted)}},{key:"shouldValidateRow",value:function(e,t){return this.shouldValidateDraft(e)||e.state===j.Editing||e.alerts||t}},{key:"validateRow",value:function(e,t,n){var r,o=this,i=!0,a=h(this.errors);return this.shouldValidateRow(e,t)&&e.components.forEach((function(r){var a=o.component.rowDrafts&&!o.shouldValidateDraft(e)||n;i&=r.checkValidity(null,t,null,a)})),this.component.validate&&this.component.validate.row&&("true"!==(i=this.evaluate(this.component.validate.row,{valid:i,row:e.data},"valid",!0)).toString()?(e.error=i,i=!1):e.error=null,null===i&&(i="Invalid row validation for ".concat(this.key))),e.errors=i?null:this.errors.filter((function(e){return!a.includes(e)})),(!this.component.rowDrafts||null!==(r=this.root)&&void 0!==r&&r.submitted)&&this.showRowErrorAlerts(e,!!i),!!i}},{key:"showRowErrorAlerts",value:function(e,t){var n;e.alerts&&this.alert&&(null!==(n=e.errors)&&void 0!==n&&n.length&&!t?(this.alert.showErrors(e.errors,!1),e.alerts=!0):this.alert.clear())}},{key:"checkValidity",value:function(e,t,n,r){return e=e||this.rootValue,n=n||this.data,this.checkCondition(n,e)?this.checkComponentValidity(e,t,n,{silentCheck:r}):(this.setCustomValidity(""),!0)}},{key:"checkComponentValidity",value:function(e,t,n){var r,o,i=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=a.silentCheck,s=this.errors.length,u=_(P(O.prototype),"checkComponentValidity",this).call(this,e,t,n,a);if(!u&&!this.alert&&!this.hasOpenRows())return!1;if(this.shouldSkipValidation(e,t,n))return!0;var c,f=!0,d=!1;if(this.editRows.forEach((function(e,n){var r=i.validateRow(e,t,l);if(f&=r,i.rowRefs){var o=i.rowRefs[n];if(o){var a=o.querySelector(".editgrid-row-error");r||!a||i.component.rowDrafts&&!i.shouldValidateDraft(e)?a&&(a.textContent=""):(i.addClass(a,"help-block"),a.textContent=i.t(i.errorMessage("invalidRowError")))}}d|=t&&i.isOpen(e)})),!f)return l||this.component.rowDrafts&&(null===(c=this.root)||void 0===c||!c.submitted)||(this.setCustomValidity(this.t(this.errorMessage("invalidRowsError")),t),this.removeClass(this.element,"has-error")),!1;if(d&&this.saveEditMode&&!this.component.openWhenEmpty)return this.setCustomValidity(this.t(this.errorMessage("unsavedRowsError")),t),!1;var p=this.invalid||this.invalidMessage(e,t);return(null===(r=this.errors)||void 0===r?void 0:r.length)!==s&&null!==(o=this.root)&&void 0!==o&&o.submitted&&!p?(this.setCustomValidity(p,t),this.root.showErrors()):this.setCustomValidity(p,t),u}},{key:"changeState",value:function(e,t){this.visible&&(e||t.resetValue&&this.component.modalEdit)?this.rebuild():this.redraw()}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e||(e=this.defaultValue),!Array.isArray(e)){if("object"!==f(e))return!1;e=[e]}var r=this.hasChanged(e,this.dataValue);n.noValidate=!r,!this.parent||this.options.server&&!this.parent.parentVisible||this.parent.checkComponentConditions(),this.dataValue=e,this.dataValue.forEach((function(e,r){var o=t.editRows[r];o?(o.data=e,t.restoreRowContext(o,n),o.state=j.Saved,o.backup=null,o.error=null):t.editRows[r]={components:t.lazyLoad?[]:t.createRowComponents(e,r),data:e,state:j.Saved,backup:null,error:null}}));var o=this.dataValue.length;return this.editRows[o]&&this.editRows[o].state===j.New&&(o+=1),this.editRows.slice(o).forEach((function(e,n){return t.baseRemoveRow(o+n)})),this.editRows=this.editRows.slice(0,o),this.openWhenEmpty(),this.updateOnChange(n,r),this.options.server||this.checkData(),this.changeState(r,n),r}},{key:"openWhenEmpty",value:function(){var e=!this.dataValue.length&&this.component.openWhenEmpty;this.editRows.length||!e||this.builderMode||this.createRow({},0)}},{key:"restoreRowContext",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.components.forEach((function(r){r.data=e.data,t.setNestedValue(r,e.data,n)}))}},{key:"emptyRows",value:function(){var e=this;this.editRows.forEach((function(t,n){return e.destroyComponents(n)})),this.editRows=[]}},{key:"resetValue",value:function(){_(P(O.prototype),"resetValue",this).call(this),this.emptyRows()}}],a=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n\n {% util.eachComponent(components, function(component) { %}\n {% if (displayValue(component)) { %}\n
    {{ t(component.label) }}
    \n {% } %}\n {% }) %}\n '}},{key:"defaultTableHeaderTemplate",get:function(){return'\n \n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty(\'tableView\') || component.tableView) { %}\n {{ component.label }}\n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n Actions\n {% } %}\n \n '}},{key:"defaultRowTemplate",get:function(){return'
    \n {% util.eachComponent(components, function(component) { %}\n {% if (displayValue(component)) { %}\n
    \n {{ isVisibleInRow(component) ? getView(component, row[component.key]) : \'\'}}\n
    \n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n
    \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n
    \n {% } %}\n
    '}},{key:"defaultTableRowTemplate",get:function(){return'\n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty(\'tableView\') || component.tableView) { %}\n \n {{ getView(component, row[component.key]) }}\n \n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n \n {% } %}\n '}}],n&&v(t.prototype,n),a&&v(t,a),Object.defineProperty(t,"prototype",{writable:!1}),O}(i.default);t.default=x,x.prototype.hasChanged=a.default.prototype.hasChanged},30923:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"checkbox",input:!0,weight:105,key:"inlineEdit",label:"Inline Editing",tooltip:"Check this if you would like your changes within 'edit' mode to be committed directly to the submission object as that row is being changed"},{key:"defaultValue",ignore:!0},{key:"multiple",ignore:!0}]},58917:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(193))&&r.__esModule?r:{default:r},i=[{key:"placeholder",ignore:!0},{type:"checkbox",label:"Open First Row when Empty",key:"openWhenEmpty",tooltip:"Check this if you would like to open up the first row when the EditGrid is empty",weight:1e3,input:!0,conditional:{json:{"!==":[{var:"data.modal"},!0]}}},{type:"checkbox",label:"Disable Adding / Removing Rows",key:"disableAddingRemovingRows",tooltip:"Check if you want to hide Add Another button and Remove Row button",weight:1001,input:!0,clearOnHide:!1,calculateValue:"value = data.disableAddingRemovingRows;"},{type:"checkbox",label:"Display EditGrid as Table",key:"displayAsTable",tooltip:"use Table Template",weight:1002,input:!1,customConditional:function(){return!o.default.noeval}},{weight:1010,type:"textarea",input:!0,key:"conditionalAddButton",label:"Conditional Add Button",placeholder:"show = ...",tooltip:"Specify condition when Add Button should be displayed.",editor:"ace",as:"javascript",wysiwyg:{minLines:3}}];t.default=i},67930:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(193))&&r.__esModule?r:{default:r},i=[{type:"textarea",label:"Header Template",key:"templates.header",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the header of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&!t.displayAsTable}},{type:"textarea",label:"Table Header Template",key:"templates.tableHeader",rows:6,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the header of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&t.displayAsTable}},{type:"textarea",label:"Row Template",key:"templates.row",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Three available variables. "row" is an object of one row\'s data, "components" is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved"). To add click events, add the classes "editRow" and "removeRow" to elements.',tooltip:"This is the Lodash Template used to render each row of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&!t.displayAsTable}},{type:"textarea",label:"Table Row Template",key:"templates.tableRow",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Three available variables. "row" is an object of one row\'s data, "components" is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved"). To add click events, add the classes "editRow" and "removeRow" to elements.',tooltip:"This is the Lodash Template used to render each row of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&t.displayAsTable}},{type:"textarea",label:"Footer Template",key:"templates.footer",rows:5,editor:"ace",as:"handlebars",input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the footer of the Edit grid.",customConditional:function(){return!o.default.noeval||o.default.protectedEval}},{type:"textfield",input:!0,key:"rowClass",label:"Row CSS Class",placeholder:"Row CSS Class",tooltip:"CSS class to add to the edit row wrapper."},{type:"textfield",input:!0,key:"addAnother",label:"Add Another Text",placeholder:"Add Another",tooltip:"Set the text of the Add Another button."},{weight:70,type:"checkbox",label:"Display as Modal",tooltip:"Display a modal to add or edit entries in the table",key:"modal",input:!0},{type:"textfield",input:!0,key:"saveRow",label:"Save Row Text",placeholder:"Save",tooltip:"Set the text of the Save Row button."},{type:"textfield",input:!0,key:"removeRow",label:"Remove Row Text",placeholder:"Remove",tooltip:"Set the text of the remove Row button."}];t.default=i},83881:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{ignore:!0,key:"unique"},{weight:110,key:"validate.minLength",label:"Minimum Length",placeholder:"Minimum Length",type:"number",tooltip:"The minimum length requirement this field must meet.",input:!0},{weight:120,key:"validate.maxLength",label:"Maximum Length",placeholder:"Maximum Length",type:"number",tooltip:"The maximum length requirement this field must meet.",input:!0},{type:"checkbox",input:!0,weight:105,key:"rowDrafts",label:"Enable Row Drafts",tooltip:"Allow save rows even if their data is invalid. Errors will occur when try to submit with invalid rows."}]},85201:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.util.eachComponent(e.components,(function(r){n+="\n ",r.hasOwnProperty("tableView")&&!r.tableView||(n+='\n
    '+(null==(t=e.t(r.label))?"":t)+"
    \n "),n+="\n "})),n+="\n
    \n"}},41578:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(23370)),o=i(n(85201));function i(e){return e&&e.__esModule?e:{default:e}}var a={row:r.default,header:o.default};t.default=a},23370:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.util.eachComponent(e.components,(function(r){n+="\n ",r.hasOwnProperty("tableView")&&!r.tableView||(n+='\n
    \n '+(null==(t=e.getView(r,e.row[r.key]))?"":t)+"\n
    \n "),n+="\n "})),n+="\n ",e.self.options.readOnly||(n+='\n
    \n
    \n \n \n
    \n
    \n '),n+="\n
    \n"}},16659:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return e=s(d(h.prototype),"normalizeValue",this).call(this,e,t),this.options.server&&e&&(e=Array.isArray(e)?e.map((function(e){return e.toLowerCase()})):e.toLowerCase()),e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function h(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return new u.default((function(n){var r=e.ce("input",y({type:"file",style:"height: 0; width: 0; visibility: hidden;",tabindex:"-1"},t));document.body.appendChild(r),r.addEventListener("change",(function(){n(r.files),document.body.removeChild(r)}),!0),"function"==typeof r.trigger?r.trigger("click"):r.click()}))}},{key:"cameraMode",get:function(){return this._cameraMode},set:function(e){this._cameraMode=e,e?this.startVideo():this.stopVideo()}},{key:"useWebViewCamera",get:function(){return this.imageUpload&&x}},{key:"imageUpload",get:function(){return Boolean(this.component.image)}},{key:"browseOptions",get:function(){var e={};if(this.component.multiple&&(e.multiple=!0),!this.isMobile.any){var t=this.component.filePattern.trim()||"",n="image/*";!this.imageUpload||t&&"*"!==t?this.imageUpload&&!t.includes(n)?e.accept="".concat(n,",").concat(t):e.accept=t:e.accept=n}return e}},{key:"deleteFile",value:function(e){var t=this.component.options,n=void 0===t?{}:t;if(e&&["url","indexeddb"].includes(this.component.storage)){var r=this.fileService;if(r&&"function"==typeof r.deleteFile)r.deleteFile(e,n);else{var o=this.options.formio||this.root&&this.root.formio;o&&o.makeRequest("",e.url,"delete")}}}},{key:"attach",value:function(e){var t=this;this.loadRefs(e,{fileDrop:"single",fileBrowse:"single",galleryButton:"single",cameraButton:"single",takePictureButton:"single",toggleCameraMode:"single",videoPlayer:"single",fileLink:"multiple",removeLink:"multiple",fileStatusRemove:"multiple",fileImage:"multiple",fileType:"multiple",fileProcessingLoader:"single"}),this.refs.input=[];var n=k(P(w.prototype),"attach",this).call(this,e);if(this.refs.fileDrop){this.statuses.length||this.refs.fileDrop.removeAttribute("hidden");var r=this;this.addEventListener(this.refs.fileDrop,"dragover",(function(e){this.className="fileSelector fileDragOver",e.preventDefault()})),this.addEventListener(this.refs.fileDrop,"dragleave",(function(e){this.className="fileSelector",e.preventDefault()})),this.addEventListener(this.refs.fileDrop,"drop",(function(e){this.className="fileSelector",e.preventDefault(),r.upload(e.dataTransfer.files)}))}if(this.refs.fileBrowse&&this.addEventListener(this.refs.fileBrowse,"click",(function(e){e.preventDefault(),t.browseFiles(t.browseOptions).then((function(e){t.upload(e)}))})),this.refs.fileLink.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.getFile(t.dataValue[n])}))})),this.refs.removeLink.forEach((function(e,n){t.addEventListener(e,"click",(function(e){var r=t.dataValue[n];t.deleteFile(r),e.preventDefault(),t.splice(n),t.redraw()}))})),this.refs.fileStatusRemove.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault();var r=t.statuses[n];s.default.pull(t.filesUploading,r.originalName),r.abort&&r.abort(),t.statuses.splice(n,1),t.redraw()}))})),this.refs.galleryButton&&x&&this.addEventListener(this.refs.galleryButton,"click",(function(e){e.preventDefault(),x.getPicture((function(e){window.resolveLocalFileSystemURL(e,(function(e){e.file((function(e){var n=new FileReader;n.onloadend=function(n){var r=new Blob([new Uint8Array(n.target.result)],{type:e.type});r.name=e.name,t.upload([r])},n.readAsArrayBuffer(e)}))}))}),(function(e){console.error(e)}),{sourceType:x.PictureSourceType.PHOTOLIBRARY})})),this.refs.cameraButton&&x&&this.addEventListener(this.refs.cameraButton,"click",(function(e){e.preventDefault(),x.getPicture((function(e){window.resolveLocalFileSystemURL(e,(function(e){e.file((function(e){var n=new FileReader;n.onloadend=function(n){var r=new Blob([new Uint8Array(n.target.result)],{type:e.type});r.name=e.name,t.upload([r])},n.readAsArrayBuffer(e)}))}))}),(function(e){console.error(e)}),{sourceType:x.PictureSourceType.CAMERA,encodingType:x.EncodingType.PNG,mediaType:x.MediaType.PICTURE,saveToPhotoAlbum:!0,correctOrientation:!1})})),this.refs.takePictureButton&&this.addEventListener(this.refs.takePictureButton,"click",(function(e){e.preventDefault(),t.takePicture()})),this.refs.toggleCameraMode&&this.addEventListener(this.refs.toggleCameraMode,"click",(function(e){e.preventDefault(),t.cameraMode=!t.cameraMode,t.redraw()})),this.refs.fileType.forEach((function(e,n){t.dataValue[n].fileType=t.dataValue[n].fileType||t.component.fileTypes[0].label,t.addEventListener(e,"change",(function(e){e.preventDefault();var r=t.component.fileTypes.find((function(t){return t.value===e.target.value}));t.dataValue[n].fileType=r.label}))})),this.fileService){var o=[];this.filesReady=new u.default((function(e,n){t.filesReadyResolve=e,t.filesReadyReject=n})),this.refs.fileImage.forEach((function(e,n){o.push(t.loadImage(t.dataValue[n]).then((function(t){return e.src=t})))})),o.length?u.default.all(o).then((function(){t.filesReadyResolve()})).catch((function(){return t.filesReadyReject()})):this.filesReadyResolve()}return n}},{key:"fileSize",value:function(e,t,n,r,o){return"".concat((t=Math,n=t.log,o=n(e)/n(1024)|0,e/t.pow(1024,o)).toFixed(2)," ").concat(o?"".concat("kMGTPEZY"[--o],"B"):"Bytes")}},{key:"globStringToRegex",value:function(e){var t="",n=[];if((e=e.replace(/\s/g,"")).length>2&&"/"===e[0]&&"/"===e[e.length-1])t=e.substring(1,e.length-1);else{var r=e.split(",");if(r.length>1)for(var o=0;o|:\\-]","g"),"\\$&"),"$")).replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:t,excludes:n}}},{key:"translateScalars",value:function(e){if("string"==typeof e){if(e.search(/kb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2));if(e.search(/mb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2)*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2)*1024*1024);if(e.search(/b/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(60*e.substring(0,e.length-1));if(e.search(/h/i)===e.length-1)return parseFloat(3600*e.substring(0,e.length-1))}return e}},{key:"validatePattern",value:function(e,t){if(!t)return!0;var n=this.globStringToRegex(t),r=!0;if(n.regexp&&n.regexp.length){var o=new RegExp(n.regexp,"i");r=!s.default.isNil(e.type)&&o.test(e.type)||!s.default.isNil(e.name)&&o.test(e.name)}return n.excludes.reduce((function(t,n){var r=new RegExp(n,"i");return t&&(s.default.isNil(e.type)||!r.test(e.type))&&(s.default.isNil(e.name)||!r.test(e.name))}),r)}},{key:"validateMinSize",value:function(e,t){return e.size+.1>=this.translateScalars(t)}},{key:"validateMaxSize",value:function(e,t){return e.size-.1<=this.translateScalars(t)}},{key:"upload",value:function(e){var t=this;this.component.multiple||(this.statuses.length&&(this.statuses=[]),e=Array.prototype.slice.call(e,0,1)),this.component.storage&&e&&e.length&&(this.fileDropHidden=!0,Array.prototype.forEach.call(e,function(){var e,n=(e=p().mark((function e(n){var r,o,i,l,u,d,h,m,v,b,g,w,k,O,_,S,P,j,x,E,C,A,T,M;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,a.uniqueName)(n.name,t.component.fileNameTemplate,t.evalContext()),o=n.name?n.name.replaceAll("<","<").replaceAll(">",">"):n.name,i={abort:function(){return null},originalName:o,name:r,size:n.size,status:"info",message:t.t("Processing file. Please wait..."),hash:""},"true"!==t.root.form.submissionRevisions){e.next=12;break}return t.statuses.push(i),t.redraw(),l=new f.default,e.next=9,new Promise((function(e,r){t.emit("fileUploadingStart"),l.md5(n,(function(t,n){return t?r(t):e(n)}))}));case 9:u=e.sent,t.emit("fileUploadingEnd"),i.hash=u;case 12:if(t.filesUploading||(t.filesUploading=[]),d=t.filesUploading.some((function(e){return e===n.name})),t.filesUploading.push(n.name),h=t.dataValue.some((function(e){return e.originalName===n.name})),m=t.statuses.findIndex((function(e){return e.originalName===n.name&&"error"===e.status})),(h||d)&&(i.status="error",i.message=t.t("File with the same name is already ".concat(d?"being ":"","uploaded"))),-1!==m&&(t.statuses.splice(m,1),t.redraw()),t.component.filePattern&&!t.validatePattern(n,t.component.filePattern)&&(i.status="error",i.message=t.t("File is the wrong type; it must be {{ pattern }}",{pattern:t.component.filePattern})),t.component.fileMinSize&&!t.validateMinSize(n,t.component.fileMinSize)&&(i.status="error",i.message=t.t("File is too small; it must be at least {{ size }}",{size:t.component.fileMinSize})),t.component.fileMaxSize&&!t.validateMaxSize(n,t.component.fileMaxSize)&&(i.status="error",i.message=t.t("File is too big; it must be at most {{ size }}",{size:t.component.fileMaxSize})),v=t.interpolate(t.component.dir||""),(b=t.fileService)||(i.status="error",i.message=t.t("File Service not provided.")),"true"!==t.root.form.submissionRevisions&&(t.statuses.push(i),t.redraw()),"error"===i.status){e.next=62;break}if(t.component.privateDownload&&(n.private=!0),g=t.component,w=g.storage,k=g.options,O=void 0===k?{}:k,_=t.interpolate(t.component.url,{file:i}),S=null,P=null,t.root.everyComponent((function(e){var t,n;(null!==(t=e.component)&&void 0!==t&&t.submissionAccess||null!==(n=e.component)&&void 0!==n&&n.defaultPermission)&&(P=e.component.submissionAccess?e.component.submissionAccess:[{type:e.component.defaultPermission,roles:[]}]).forEach((function(t){S=["admin","write","create"].includes(t.type)?e.component.key:null}))})),j=t.component.fileKey||"file",x=S?t.currentForm.submission.data[S]._id:null,E=null,!t.root.options.fileProcessor){e.next=55;break}return e.prev=37,t.refs.fileProcessingLoader&&(t.refs.fileProcessingLoader.style.display="block"),C=(0,c.default)(t.fileService,t.root.options.fileProcessor),e.next=42,C(n,t.component.properties);case 42:E=e.sent,e.next=52;break;case 45:return e.prev=45,e.t0=e.catch(37),i.status="error",i.message=t.t("File processing has been failed."),t.fileDropHidden=!1,t.redraw(),e.abrupt("return");case 52:return e.prev=52,t.refs.fileProcessingLoader&&(t.refs.fileProcessingLoader.style.display="none"),e.finish(52);case 55:A=0,T=!(!t.component.useMultipartUpload||!t.component.multipart)&&y(y({},t.component.multipart),{},{progressCallback:function(e){A++,i.status="progress",i.progress=parseInt(100*A/e),delete i.message,t.redraw()},changeMessage:function(e){i.message=e,t.redraw()}}),i.message=t.t("Starting upload..."),t.redraw(),M=b.uploadFile(w,E||n,r,v,(function(e){i.status="progress",i.progress=parseInt(100*e.loaded/e.total),delete i.message,t.redraw()}),_,O,j,P,x,(function(){t.emit("fileUploadingStart",M)}),(function(e){return i.abort=e}),T).then((function(e){var n=t.statuses.indexOf(i);-1!==n&&t.statuses.splice(n,1),e.originalName=o,e.hash=i.hash,t.hasValue()||(t.dataValue=[]),t.dataValue.push(e),s.default.pull(t.filesUploading,e.originalName),t.fileDropHidden=!1,t.redraw(),t.triggerChange(),t.emit("fileUploadingEnd",M)})).catch((function(e){i.status="error",i.message="string"==typeof e?e:e.toString(),delete i.progress,t.fileDropHidden=!1,s.default.pull(t.filesUploading,n.name),t.redraw(),t.emit("fileUploadingEnd",M)})),e.next=63;break;case 62:t.filesUploading.splice(t.filesUploading.indexOf(n.name),1);case 63:case"end":return e.stop()}}),e,null,[[37,45,52,55]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,l,"next",e)}function l(e){h(i,r,o,a,l,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}()))}},{key:"getFile",value:function(e){var t=this.component.options,n=void 0===t?{}:t,r=this.fileService;if(!r)return alert("File Service not provided");this.component.privateDownload&&(e.private=!0),r.downloadFile(e,n).then((function(e){e&&(["base64","indexeddb"].includes(e.storage)?(0,l.default)(e.url,e.originalName||e.name,e.type):window.open(e.url,"_blank"))})).catch((function(e){alert(e)}))}},{key:"focus",value:function(){"beforeFocus"in this.parent&&this.parent.beforeFocus(this),this.refs.fileBrowse&&this.refs.fileBrowse.focus()}},{key:"destroy",value:function(){this.stopVideo(),k(P(w.prototype),"destroy",this).call(this)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nS3 Multipart Upload API is designed to improve the upload experience for larger objects (> 5GB).",conditional:{json:{"===":[{var:"data.storage"},"s3"]}}},{label:"Multipart Upload",tableView:!1,key:"multipart",type:"container",input:!0,components:[{label:"Part Size (MB)",applyMaskOn:"change",mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:"partSize",type:"number",input:!0,defaultValue:500}],conditional:{json:{"===":[{var:"data.useMultipartUpload"},!0]}}},{type:"textfield",input:!0,key:"url",label:"Url",weight:10,placeholder:"Enter the url to post the files to.",tooltip:"See https://github.com/danialfarid/ng-file-upload#server-side for how to set up the server.",conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"options.indexeddb",label:"Database",weight:10,placeholder:"Enter the indexeddb database name",conditional:{json:{in:[{var:"data.storage"},["indexeddb"]]}}},{type:"textfield",input:!0,label:"Table",key:"options.indexeddbTable",weight:10,placeholder:"Enter the name for indexeddb table",conditional:{json:{in:[{var:"data.storage"},["indexeddb"]]}}},{type:"textarea",key:"options",label:"Custom request options",tooltip:"Pass your custom xhr options(optional)",rows:5,editor:"ace",input:!0,weight:15,placeholder:'{\n "withCredentials": true,\n "headers": {\n "Authorization": "Basic "\n }\n }',conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"fileKey",label:"File form-data key",weight:17,placeholder:"Enter the key name of a file for form data.",tooltip:"Key name that you would like to modify for the file while calling API request.",conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"dir",label:"Directory",placeholder:"(optional) Enter a directory for the files",tooltip:"This will place all the files uploaded in this field in the directory",weight:20,conditional:{json:{"!==":[{var:"data.storage"},"googledrive"]}}},{type:"textfield",input:!0,key:"dir",label:"Folder ID",placeholder:"(optional) Enter an ID of the folder for the files",tooltip:"This will place all the files uploaded in this field in the folder",weight:20,conditional:{json:{"===":[{var:"data.storage"},"googledrive"]}}},{type:"textfield",input:!0,key:"fileNameTemplate",label:"File Name Template",placeholder:"(optional) { {name} }-{ {guid} }",tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:"checkbox",input:!0,key:"image",label:"Display as image(s)",tooltip:"Instead of a list of linked files, images will be rendered in the view.",weight:30},{type:"checkbox",input:!0,key:"uploadOnly",label:"Upload Only",tooltip:"When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.",weight:33},{type:"checkbox",input:!0,key:"privateDownload",label:"Private Download",tooltip:"When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.",weight:31,conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"imageSize",label:"Image Size",placeholder:"100",tooltip:"The image size for previewing images.",weight:40,conditional:{json:{"==":[{var:"data.image"},!0]}}},{type:"checkbox",input:!0,key:"webcam",label:"Enable web camera",tooltip:"This will allow using an attached camera to directly take a picture instead of uploading an existing file.",weight:32},{type:"textfield",input:!0,key:"webcamSize",label:"Webcam Width",placeholder:"320",tooltip:"The webcam size for taking pictures.",weight:38,conditional:{json:{"==":[{var:"data.webcam"},!0]}}},{type:"datagrid",input:!0,label:"File Types",key:"fileTypes",tooltip:"Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.",weight:11,components:[{label:"Label",key:"label",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}]},{type:"textfield",input:!0,key:"filePattern",label:"File Pattern",placeholder:".jpg,video/*,application/pdf",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file patterns.",weight:50},{type:"textfield",input:!0,key:"fileMinSize",label:"File Minimum Size",placeholder:"1MB",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file sizes.",weight:60},{type:"textfield",input:!0,key:"fileMaxSize",label:"File Maximum Size",placeholder:"10MB",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file sizes.",weight:70}];t.default=a},13415:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"unique",ignore:!0},{key:"validateOn",ignore:!0}]},44415:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return e.parentPath="".concat(this.path,".data."),e.events=this.createEmitter(),o.default.set(e,"buttonSettings.showSubmit",!1),this.options?(this.options.base&&(e.base=this.options.base),this.options.project&&(e.project=this.options.project),(this.options.readOnly||this.component.disabled)&&(e.readOnly=this.options.readOnly||this.component.disabled),this.options.breadcrumbSettings&&(e.breadcrumbSettings=this.options.breadcrumbSettings),this.options.buttonSettings&&(e.buttonSettings=o.default.clone(this.options.buttonSettings)),this.options.viewAsHtml&&(e.viewAsHtml=this.options.viewAsHtml),this.options.language&&(e.language=this.options.language),this.options.template&&(e.template=this.options.template),this.options.templates&&(e.templates=this.options.templates),this.options.renderMode&&(e.renderMode=this.options.renderMode),this.options.attachMode&&(e.attachMode=this.options.attachMode),this.options.iconset&&(e.iconset=this.options.iconset),this.options.fileService&&(e.fileService=this.options.fileService),this.options.onChange&&(e.onChange=this.options.onChange),this.options.preview&&(e.preview=this.options.preview),this.options.saveDraft&&(e.saveDraft=this.options.saveDraft,e.formio=new c.GlobalFormio(this.formSrc)),this.options.saveDraftThrottle&&(e.saveDraftThrottle=this.options.saveDraftThrottle),this.options.skipDraftRestore&&(e.skipDraftRestore=this.options.skipDraftRestore),e):e}},{key:"render",value:function(){if(this.builderMode)return g(_(b.prototype),"render",this).call(this,this.component.label||"Nested form");var e=this.subForm?this.subForm.render():this.renderTemplate("loading");return g(_(b.prototype),"render",this).call(this,e)}},{key:"asString",value:function(e){return this.getValueAsString(e)}},{key:"getValueAsString",value:function(e,t){if(!e)return"No data provided";if(!e.data&&e._id)return e._id;if(!e.data||!Object.keys(e.data).length)return"No data provided";if(null!=t&&t.email){var n='\n \n \n ';return this.everyComponent((function(e){e.isInputComponent&&e.visible&&!e.skipInEmail&&(n+='\n \n \n \n \n "))}),h(h({},t),{},{fromRoot:!0})),n+="\n \n
    '.concat(e.label,'').concat(e.getView(e.dataValue,t),"
    \n "}return o.default.isEmpty(e)?"":"[Complex Data]"}},{key:"attach",value:function(e){var t=this;return this.builderMode?g(_(b.prototype),"attach",this).call(this,e):g(_(b.prototype),"attach",this).call(this,e).then((function(){return!t.isSubFormLazyLoad()||t.hasLoadedForm||t.subFormLoading||t.createSubForm(!0),t.subFormReady.then((function(){if(t.empty(e),t.options.builder)t.setContent(e,t.ce("div",{class:"text-muted text-center p-2"},t.text(t.formObj.title)));else{if(t.setContent(e,t.render()),t.subForm&&(t.isNestedWizard&&(e=t.root.element),t.subForm.attach(e),t.valueChanged=t.hasSetValue,t.valueChanged||"submitted"===t.dataValue.state?t.restoreValue():t.setDefaultValue()),!t.builderMode&&t.component.modalEdit){var n=!!t.componentModal&&t.componentModal.isOpened,r=n?t.componentModal.currentValue:t.dataValue;t.componentModal=new a.default(t,e,n,r),t.setOpenModalElement()}t.calculateValue()}}))}))}},{key:"detach",value:function(){this.subForm&&this.subForm.detach(),g(_(b.prototype),"detach",this).call(this)}},{key:"currentForm",get:function(){return this._currentForm},set:function(e){var t=this;this._currentForm=e,this.subForm&&this.subForm.getComponents().forEach((function(e){e.currentForm=t}))}},{key:"hasLoadedForm",get:function(){return this.formObj&&this.formObj.components&&Array.isArray(this.formObj.components)&&this.formObj.components.length}},{key:"isRevisionChanged",get:function(){return o.default.isNumber(this.subFormRevision)&&o.default.isNumber(this.formObj._vid)&&this.formObj._vid!==this.subFormRevision}},{key:"destroy",value:function(){this.subForm&&(this.subForm.destroy(),this.subForm=null,this.subFormReady=null),g(_(b.prototype),"destroy",this).call(this)}},{key:"redraw",value:function(){return this.subForm&&(this.subForm.form=this.formObj,this.setSubFormDisabled(this.subForm)),g(_(b.prototype),"redraw",this).call(this)}},{key:"everyComponent",value:function(){var e;this.subForm&&(e=this.subForm).everyComponent.apply(e,arguments)}},{key:"setSubFormDisabled",value:function(e){e.disabled=this.disabled}},{key:"updateSubWizards",value:function(e){var t,n,r=this;if(this.isNestedWizard&&null!==(t=this.root)&&void 0!==t&&t.subWizards&&"wizard"===(null==e||null===(n=e._form)||void 0===n?void 0:n.display)){var o=this.root.subWizards.findIndex((function(e){return e.component.form===r.component.form}));-1!==o?this.root.subWizards[o]=this:this.root.subWizards.push(this),this.emit("subWizardsUpdated",e)}}},{key:"createSubForm",value:function(e){var t=this;return this.subFormReady=this.loadSubForm(e).then((function(e){if(e)return(0,u.eachComponent)(e.components,(function(e){t.hideSubmitButton(e)})),t.subForm&&t.subForm.destroy(),new f.default(e,t.getSubOptions()).ready.then((function(e){return t.subForm=e,t.subForm.currentForm=t,t.subForm.parent=t,t.subForm.parentVisible=t.visible,t.subForm.on("change",(function(){t.subForm&&(t.dataValue=t.subForm.getValue(),t.triggerChange({noEmit:!0}))})),t.subForm.url=t.formSrc,t.subForm.nosubmit=!0,t.subForm.root=t.root,t.subForm.localRoot=t.isNestedWizard?t.localRoot:t.subForm,t.restoreValue(),t.valueChanged=t.hasSetValue,t.onChange(),t.subForm}))})).then((function(e){return t.updateSubWizards(e),e})),this.subFormReady}},{key:"hideSubmitButton",value:function(e){"button"===e.type&&("submit"===e.action||!e.action)&&(e.hidden=!0)}},{key:"loadSubForm",value:function(e){var t,n=this;return this.builderMode||this.isHidden()||this.isSubFormLazyLoad()&&!e?s.default.resolve():!this.hasLoadedForm||this.isRevisionChanged||this.options.pdf&&null!==(t=this.component)&&void 0!==t&&t.useOriginalRevision&&o.default.isNull(this.subForm)&&!this.subFormLoading?this.formSrc?(this.subFormLoading=!0,new c.GlobalFormio(this.formSrc).loadForm({params:{live:1}}).then((function(e){return n.formObj=e,n.options.pdf&&n.component.useOriginalRevision&&(n.formObj.display="form"),n.subFormLoading=!1,e})).catch((function(e){return console.log(e),null}))):s.default.resolve():(this.root&&this.root.form&&this.root.form.config&&!this.formObj.config&&(this.formObj.config=this.root.form.config),s.default.resolve(this.formObj))}},{key:"subFormData",get:function(){var e;return(null===(e=this.dataValue)||void 0===e?void 0:e.data)||{}}},{key:"checkComponentValidity",value:function(e,t,n,r){var o=(r=r||{}).silentCheck||!1;return this.subForm?this.subForm.checkValidity(this.subFormData,t,null,o):g(_(b.prototype),"checkComponentValidity",this).call(this,e,t,n,r)}},{key:"checkComponentConditions",value:function(e,t,n){var r=this,o=g(_(b.prototype),"checkComponentConditions",this).call(this,e,t,n);return o?this.subForm?this.subForm.checkConditions(this.subFormData):(this.subFormReady&&this.subFormReady.then((function(){if(r.subForm)return r.subForm.checkConditions(r.subFormData)})),o):o}},{key:"calculateValue",value:function(e,t,n){return this.subForm?this.subForm.calculateValue(this.subFormData,t):g(_(b.prototype),"calculateValue",this).call(this,e,t,n)}},{key:"setPristine",value:function(e){g(_(b.prototype),"setPristine",this).call(this,e),this.subForm&&this.subForm.setPristine(e)}},{key:"shouldSubmit",get:function(){return this.subFormReady&&(!this.component.hasOwnProperty("reference")||this.component.reference)&&!this.isHidden()}},{key:"getSubFormData",value:function(){return"pdf"===o.default.get(this.subForm,"form.display")?this.subForm.getSubmission():s.default.resolve(this.dataValue)}},{key:"submitSubForm",value:function(e){var t=this;return this.shouldSubmit?this.subFormReady.then((function(){return t.subForm?(t.subForm.nosubmit=!1,t.subForm.submitForm().then((function(e){return t.subForm.loading=!1,t.subForm.showAllErrors=!1,t.dataValue=e.submission,t.dataValue})).catch((function(n){return t.subForm.showAllErrors=!0,e?(t.subForm.onSubmissionError(n),s.default.reject(n)):{}}))):t.dataValue})):this.getSubFormData()}},{key:"beforePage",value:function(e){var t=this;return e?this.submitSubForm(!0).then((function(){return g(_(b.prototype),"beforePage",t).call(t,e)})):g(_(b.prototype),"beforePage",this).call(this,e)}},{key:"beforeSubmit",value:function(){var e,t,n,r=this,o=this.dataValue;null!==(e=this.subForm)&&void 0!==e&&e.draftEnabled&&null!==(t=this.subForm.triggerSaveDraft)&&void 0!==t&&t.cancel&&this.subForm.triggerSaveDraft.cancel();var i=o&&o._id&&o.form,a=this.options.saveDraft&&"draft"===o.state;return!i||null!==(n=this.subForm)&&void 0!==n&&n.wizard||a?this.submitSubForm(!1).then((function(){return r.dataValue})).then((function(){return g(_(b.prototype),"beforeSubmit",r).call(r)})):(this.dataValue=o,s.default.resolve(this.dataValue))}},{key:"isSubFormLazyLoad",value:function(){var e,t;return"wizard"===(null===(e=this.root)||void 0===e||null===(t=e._form)||void 0===t?void 0:t.display)&&this.component.lazyLoad}},{key:"isHidden",value:function(){return!this.visible||!g(_(b.prototype),"checkConditions",this).call(this,this.rootValue)}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=g(_(b.prototype),"setValue",this).call(this,e,n);if(this.valueChanged=!0,this.subForm){var i,a=e._frid?"_frid":"_vid",l=this.useOriginalRevision&&(o.default.isNumber(e[a])||o.default.isNumber(e._fvid))&&o.default.isNumber(null===(i=this.subForm.form)||void 0===i?void 0:i[a])&&e._fvid!==this.subForm.form[a];l?(this.setFormRevision(e._frid||e._fvid),this.createSubForm().then((function(){t.attach(t.element)}))):this.setSubFormValue(e,n)}return r}},{key:"setSubFormValue",value:function(e,t){if(e&&e._id&&this.subForm.formio&&o.default.isEmpty(e.data)){var n=e.form||this.formObj.form||this.component.form,r="".concat(this.subForm.formio.formsUrl,"/").concat(n,"/submission/").concat(e._id);this.subForm.setUrl(r,this.options),this.subForm.loadSubmission().catch((function(t){console.error("Unable to load subform submission ".concat(e._id,":"),t)}))}else this.subForm.setValue(e,t)}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return null===e||o.default.isEqual(e,this.emptyValue)||this.areAllComponentsEmpty(null==e?void 0:e.data)&&!(null!=e&&e._id)}},{key:"areAllComponentsEmpty",value:function(e){var t=!0;return this.subForm?this.subForm.everyComponent((function(n){var r=o.default.get(e,n.key);t&=n.isEmpty(r)})):t=!1,t}},{key:"getValue",value:function(){return this.subForm?this.subForm.getValue():this.dataValue}},{key:"errors",get:function(){var e=g(_(b.prototype),"errors",this);return this.subForm&&(e=e.concat(this.subForm.errors)),e}},{key:"updateSubFormVisibility",value:function(){this.subForm&&(this.subForm.parentVisible=this.visible)}},{key:"isNestedWizard",get:function(){var e,t,n,r,o;return"wizard"===(null===(e=this.subForm)||void 0===e||null===(t=e._form)||void 0===t?void 0:t.display)&&"wizard"===(null===(n=this.parent)||void 0===n||null===(r=n.parent)||void 0===r||null===(o=r._form)||void 0===o?void 0:o.display)}},{key:"visible",get:function(){return g(_(b.prototype),"visible",this)},set:function(e){var t=this,n=this.isNestedWizard;if(this._visible!==e){if(this._visible=e,!this.subForm&&e)return this.createSubForm(),this.subFormReady.then((function(){t.updateSubFormVisibility(),t.clearOnHide()})),void this.redraw();this.updateSubFormVisibility(),this.clearOnHide(),n?this.rebuild():this.redraw()}!e&&n&&this.root.redraw()}},{key:"parentVisible",get:function(){return g(_(b.prototype),"parentVisible",this)},set:function(e){var t=this;if(this._parentVisible!==e){if(this._parentVisible=e,this.clearOnHide(),!this.subForm&&e)return this.createSubForm(),this.subFormReady.then((function(){t.updateSubFormVisibility()})),void this.redraw();this.updateSubFormVisibility(),this.redraw()}}},{key:"isInternalEvent",value:function(e){switch(e){case"focus":case"blur":case"componentChange":case"componentError":case"error":case"formLoad":case"languageChanged":case"render":case"checkValidity":case"initialized":case"submit":case"submitButton":case"nosubmit":case"updateComponent":case"submitDone":case"submissionDeleted":case"requestDone":case"nextPage":case"prevPage":case"wizardNavigationClicked":case"updateWizardNav":case"restoreDraft":case"saveDraft":case"saveComponent":case"pdfUploaded":return!0;default:return!1}}},{key:"createEmitter",value:function(){var e=new l.default,t=e.emit,n=this;return e.emit=function(e){for(var r=e.replace("".concat(n.options.namespace,"."),""),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a

    Example:

    value = data.firstName + " " + data.lastName;

    ','

    Example:

    {"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}
    '),o.default.javaScriptValue("Calculated Value","calculateValue","calculateValue",130,"

    Example:

    value = data.a + data.b + data.c;

    ",'

    Example:

    {"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}

    Click here for an example

    '),{weight:140,type:"checkbox",label:"Clear Value When Hidden",key:"clearOnHide",defaultValue:!0,tooltip:"When a field is hidden, clear the value.",input:!0}];t.default=i},70838:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"tooltip",ignore:!0},{key:"tabIndex",ignore:!0},{key:"autofocus",ignore:!0}]},5318:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(69826),n(41539),t.default=[{type:"select",input:!0,dataSrc:"url",data:{url:"/form?limit=1000000&select=_id,title,display"},searchField:"title__regex",template:"{{ item.title }}",valueProperty:"_id",authenticate:!0,label:"Form",key:"form",weight:10,lazyLoad:!1,tooltip:"The form to load within this form component.",validate:{required:!0}},{label:"Lazy Load",inputType:"checkbox",defaultValue:!0,clearOnHide:!0,errorLabel:"",key:"lazyLoad",type:"checkbox",tooltip:"if it is checked, the subform is loaded after navigation to the page with this component within the wizard.",input:!0,customConditional:function(e){var t,n,r,o,i=e.instance,a=e.data,l=null===(t=i.root)||void 0===t||null===(n=t.getComponent("form"))||void 0===n?void 0:n.defaultDownloadedResources.find((function(e){return e._id===a.form})),s="wizard";return(null===(r=i.options)||void 0===r||null===(o=r.editForm)||void 0===o?void 0:o.display)===s&&l&&l.display!==s}},{type:"select",input:!0,dataSrc:"url",data:{url:"/form/{{ data.form }}/v"},searchField:"title__regex",template:"{{ item._vid }}",valueProperty:"_id",authenticate:!0,label:"Form Revision",key:"revision",weight:10,lazyLoad:!0,tooltip:"You can lock the nested form to a specific revision by choosing the revision number here.",customConditional:"show = !!data.form"},{type:"checkbox",input:!0,weight:19,key:"useOriginalRevision",label:"Use Original Revision while Submissions Viewing",tooltip:"Using this option will make form load the original revision (the one which was used to make a submission) when viewing a submission."},{type:"checkbox",input:!0,weight:20,key:"reference",label:"Save as reference",tooltip:"Using this option will save this field as a reference and link its value to the value of the origin record."}]},45574:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return this.updateValue(e,t)}},{key:"getValue",value:function(){return this.dataValue}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n]+)>)/g,"").trim())return" ".concat(this.component.content," ");var e=i.default.get(this.root,"submission",{}),t=this.component.content?this.interpolate(this.component.content,{metadata:e.metadata||{},submission:e,data:this.rootValue,row:this.data}):"";return this.sanitize(t,this.shouldSanitizeValue)}},{key:"singleTags",get:function(){return["br","img","hr"]}},{key:"checkRefreshOn",value:function(e){u(p(m.prototype),"checkRefreshOn",this).call(this,e),!this.builderMode&&this.component.refreshOnChange&&this.element&&!i.default.isUndefined(e)&&(i.default.isBoolean(e)&&e||!i.default.isEmpty(e))&&this.conditionallyVisible(this.data,this.row)&&this.setContent(this.element,this.renderContent())}},{key:"renderContent",value:function(){var e=this,t=i.default.get(this.root,"submission",{});return this.renderTemplate("html",{component:this.component,tag:this.component.tag,attrs:(this.component.attrs||[]).map((function(n){return{attr:n.attr,value:e.interpolate(n.value,{metadata:t.metadata||{},submission:t,data:e.rootValue,row:e.data})}})),content:this.content,singleTags:this.singleTags})}},{key:"render",value:function(){return u(p(m.prototype),"render",this).call(this,this.renderContent())}},{key:"dataReady",get:function(){var e;return(null===(e=this.root)||void 0===e?void 0:e.submissionReady)||Promise.resolve()}},{key:"attach",value:function(e){var t=this;return this.loadRefs(e,{html:"single"}),this.dataReady.then((function(){t.refs.html&&t.setContent(t.refs.html,t.content)})),u(p(m.prototype),"attach",this).call(this,e)}}])&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),m}(o.default);t.default=h},97234:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"tooltip",ignore:!0},{key:"hideLabel",ignore:!0},{key:"autofocus",ignore:!0},{key:"disabled",ignore:!0},{key:"tabindex",ignore:!0},{key:"tableView",ignore:!0},{type:"textfield",input:!0,key:"tag",weight:50,label:"HTML Tag",placeholder:"HTML Element Tag",tooltip:"The tag of this HTML element."},{type:"textfield",input:!0,key:"className",weight:60,label:"CSS Class",placeholder:"CSS Class",tooltip:"The CSS class for this HTML element."},{type:"datagrid",input:!0,label:"Attributes",key:"attrs",tooltip:"The attributes for this HTML element. Only safe attributes are allowed, such as src, href, and title.",weight:70,components:[{label:"Attribute",key:"attr",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}]},{type:"textarea",input:!0,editor:"ace",rows:10,as:"html",label:"Content",tooltip:"The content of this HTML element.",defaultValue:'
    Content
    ',key:"content",weight:80},{weight:85,type:"checkbox",label:"Refresh On Change",tooltip:"Rerender the field whenever a value on the form changes.",key:"refreshOnChange",input:!0}]},75367:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"logic",components:[{key:"actions",components:[{key:"actionPanel",components:[{data:{json:[{label:"Hidden",value:"hidden",type:"boolean"},{label:"Required",value:"validate.required",type:"boolean"},{label:"Disabled",value:"disabled",type:"boolean"},{label:"Label",value:"label",type:"string"},{label:"Title",value:"title",type:"string"},{label:"Tooltip",value:"tooltip",type:"string"},{label:"Description",value:"description",type:"string"},{label:"Placeholder",value:"placeholder",type:"string"},{label:"CSS Class",value:"className",type:"string"},{label:"Container Custom Class",value:"customClass",type:"string"},{label:"Content",value:"content",type:"string",component:"content"}]},key:"property"},{type:"textarea",editor:"ace",rows:10,as:"html",label:"Content",tooltip:"The content of this HTML element.",defaultValue:'
    Content
    ',key:"content",weight:30,input:!0,customConditional:function(e){return"property"===e.row.type&&e.row.hasOwnProperty("property")&&"string"===e.row.property.type&&"content"===e.row.property.component}}]}]}]}]},15178:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=X(n(78621)),o=X(n(83696)),i=X(n(37784)),a=X(n(67559)),l=X(n(64430)),s=X(n(72801)),u=X(n(20787)),c=X(n(37419)),f=X(n(29147)),d=X(n(56742)),p=X(n(93560)),h=X(n(54263)),m=X(n(34160)),y=X(n(1870)),v=X(n(15734)),b=X(n(99184)),g=X(n(58192)),w=X(n(11621)),k=X(n(13089)),O=X(n(63820)),_=X(n(99606)),S=X(n(68093)),P=X(n(57700)),j=X(n(50919)),x=X(n(24561)),E=X(n(67329)),C=X(n(99495)),A=X(n(40996)),T=X(n(95548)),M=X(n(40736)),R=X(n(55089)),D=X(n(44311)),I=X(n(30210)),L=X(n(66572)),V=X(n(14224)),N=X(n(59024)),F=X(n(14051)),B=X(n(55655)),U=X(n(26135)),z=X(n(53700)),H=X(n(16186)),q=X(n(6610)),W=X(n(8745)),K=X(n(8948)),Y=X(n(5570)),G=X(n(37978)),$=X(n(12151)),J=X(n(86267));function X(e){return e&&e.__esModule?e:{default:e}}var Z={address:r.default,base:l.default,component:l.default,componentmodal:s.default,button:o.default,checkbox:i.default,columns:a.default,container:u.default,content:c.default,currency:f.default,datagrid:d.default,datamap:p.default,datetime:h.default,day:m.default,editgrid:y.default,email:v.default,input:O.default,field:S.default,multivalue:_.default,list:P.default,fieldset:b.default,file:g.default,form:w.default,hidden:k.default,htmlelement:j.default,nested:x.default,nesteddata:E.default,nestedarray:C.default,number:A.default,panel:T.default,password:M.default,phoneNumber:R.default,radio:D.default,recaptcha:I.default,resource:L.default,select:N.default,selectboxes:V.default,signature:F.default,survey:B.default,table:U.default,tabs:z.default,tags:H.default,textarea:q.default,textfield:W.default,time:K.default,tree:Y.default,unknown:G.default,url:$.default,well:J.default};t.default=Z},1512:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};return g(k(y.prototype),"setValueAt",this).call(this,e,this.formatValue(this.parseValue(t)),n)}},{key:"parseValue",value:function(e){"string"==typeof e&&(e=e.split(this.delimiter).join("").replace(this.decimalSeparator,"."));var t=parseFloat(e);return a.default.isNaN(t)?null:String(t).replace(".",this.decimalSeparator)}},{key:"formatValue",value:function(e){return this.component.requireDecimal&&e&&!e.includes(this.decimalSeparator)?"".concat(e).concat(this.decimalSeparator).concat(a.default.repeat("0",this.decimalLimit)):this.component.requireDecimal&&e&&e.includes(this.decimalSeparator)?"".concat(e).concat(a.default.repeat("0",this.decimalLimit-e.split(this.decimalSeparator)[1].length)):e}},{key:"focus",value:function(){var e=this.refs.input[0];e&&(g(k(y.prototype),"focus",this).call(this),e.setSelectionRange(0,e.value.length))}},{key:"getMaskedValue",value:function(e){return(e=null===e?"0":e.toString()).includes(".")&&"."!==this.decimalSeparator&&(e=e.replace(".",this.decimalSeparator)),(0,i.conformToMask)(this.formatValue(e),this.numberMask).conformedValue}},{key:"getValueAsString",value:function(e,t){var n=this;return e||0===e?(e=this.getWidgetValueAsString(e,t),Array.isArray(e)?e.map((function(e){return n.getMaskedValue(e)})).join(", "):this.getMaskedValue(e)):""}},{key:"addFocusBlurEvents",value:function(e){var t=this;g(k(y.prototype),"addFocusBlurEvents",this).call(this,e),this.addEventListener(e,"blur",(function(){e.value=t.getValueAsString(t.formatValue(t.parseValue(e.value)))}))}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nYou must assign the next variable with the API key of the next page.

    \n

    The global variable data is provided, and allows you to access the data of any form component, by using its API key.

    \n

    Also moment library is available, and allows you to manipulate dates in a convenient way.

    \n
    Example
    next = data.addComment ? 'page3' : 'page4';
    \n","\n

    Submission data is available as JsonLogic variables, with the same api key as your components.

    \n")),{},{customConditional:function(e){var t=!1;if("wizard"===e.instance.options.editForm.display){var n=e.instance.options.editForm.components,r=e.instance.options.editComponent;n&&r&&(t=n.some((function(e){var t=(0,a.default)((0,l.default)(e),(0,l.default)(r))||[];return t.push("components"),(0,o.default)((0,i.default)(e,t),(0,i.default)(r,t))})))}return t}})];t.default=p},74893:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(5212),n(41539);var r=l(n(18446)),o=l(n(57557)),i=l(n(91966)),a=l(n(3674));function l(e){return e&&e.__esModule?e:{default:e}}var s=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"autofocus",ignore:!0},{key:"tableView",ignore:!0},{key:"label",hidden:!0,calculateValue:function(e){return e.data.title}},{key:"tabindex",hidden:!0},{weight:1,type:"textfield",input:!0,placeholder:"Panel Title",label:"Title",key:"title",tooltip:"The title text that appears in the header of this panel."},{weight:20,type:"textarea",input:!0,key:"tooltip",label:"Tooltip",placeholder:"To add a tooltip to this field, enter text here.",tooltip:"Adds a tooltip to the side of this field."},{weight:30,type:"select",input:!0,label:"Theme",key:"theme",dataSrc:"values",data:{values:[{label:"Default",value:"default"},{label:"Primary",value:"primary"},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Danger",value:"danger"},{label:"Warning",value:"warning"}]}},{weight:40,type:"fieldset",input:!1,components:[{type:"select",input:!0,label:"Breadcrumb Type",key:"breadcrumb",dataSrc:"values",data:{values:[{label:"Default",value:"default"},{label:"Condensed",value:"condensed"},{label:"Hidden",value:"none"}]}},{input:!0,type:"checkbox",label:"Allow click on Breadcrumb",key:"breadcrumbClickable",defaultValue:!0,conditional:{json:{"!==":[{var:"data.breadcrumb"},"none"]}}},{input:!0,type:"checkbox",label:"Allow Previous",key:"allowPrevious",defaultValue:!1,tooltip:"Determines if the breadcrumb bar is clickable or not for visited tabs.",conditional:{json:{"===":[{var:"data.breadcrumbClickable"},!1]}}},{weight:50,label:"Panel Navigation Buttons",optionsLabelPosition:"right",values:[{label:"Previous",value:"previous"},{label:"Cancel",value:"cancel"},{label:"Next",value:"next"}],inline:!0,type:"selectboxes",key:"buttonSettings",input:!0,inputType:"checkbox",defaultValue:{previous:!0,cancel:!0,next:!0}},{weight:55,label:"Navigate Wizard on Enter",type:"checkbox",key:"navigateOnEnter",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Use the Enter key to go forward through pages."},{weight:56,label:"Save on Enter",type:"checkbox",key:"saveOnEnter",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Use the Enter key to submit form on last page."},{weight:60,label:"Scroll up on page opening",type:"checkbox",key:"scrollToTop",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Scroll to the top of the wizard page when user navigates to it"}],customConditional:function(e){var t=!1;if("wizard"===e.instance.options.editForm.display){var n=e.instance.options.editForm.components,l=e.instance.options.editComponent;n&&l&&(t=n.some((function(e){var t=(0,i.default)((0,a.default)(e),(0,a.default)(l))||[];return t.push("components"),(0,r.default)((0,o.default)(e,t),(0,o.default)(l,t))})))}return t}},{weight:650,type:"checkbox",label:"Collapsible",tooltip:"If checked, this will turn this Panel into a collapsible panel.",key:"collapsible",input:!0},{weight:651,type:"checkbox",label:"Initially Collapsed",tooltip:"Determines the initial collapsed state of this Panel.",key:"collapsed",input:!0,conditional:{json:{"===":[{var:"data.collapsible"},!0]}}}];t.default=s},93268:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n\n \n \n '.concat(e.maskName,'\n ').concat(e.value,"\n \n \n \n "):u(p(m.prototype),"getValueAsString",this).call(this,e,t)}}])&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),m}(o.default);t.default=h},24482:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"validate.minLength",ignore:!0},{key:"validate.maxLength",ignore:!0},{key:"validate.pattern",ignore:!0},{key:"validate.minWords",ignore:!0},{key:"validate.maxWords",ignore:!0}]},20481:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{{ item.label }}",dataSrc:"values",data:{values:[{label:"Autotype",value:"auto"},{label:"String",value:"string"},{label:"Number",value:"number"},{label:"Boolean",value:"boolean"},{label:"Object",value:"object"}]}},{key:"template",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}}];t.default=a},4473:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"placeholder",ignore:!0},{type:"select",input:!0,label:"Options Label Position",key:"optionsLabelPosition",tooltip:"Position for the label for options for this field.",dataSrc:"values",weight:32,defaultValue:"right",data:{values:[{label:"Top",value:"top"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Bottom",value:"bottom"}]}},{type:"checkbox",input:!0,key:"inline",label:"Inline Layout",tooltip:"Displays the checkboxes/radios horizontally.",weight:650}]},17325:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"validateOn",ignore:!0},{key:"unique",ignore:!0},{weight:52,type:"checkbox",label:"Allow only available values",tooltip:"Check this if you would like to perform a validation check to ensure the selected value is an available option.",key:"validate.onlyAvailableItems",input:!0}]},124:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n3&&void 0!==arguments[3]?arguments[3]:{};e=e||this.rootValue,n=n||this.data;var i=o.async,a=void 0!==i&&i;if(!a)return y(w(m.prototype),"checkComponentValidity",this).call(this,e,t,n,o);var l=n[this.component.key];return l&&l.token?l.success?this.hook("validateReCaptcha",l.token,(function(){return s.default.resolve(!0)})).then((function(e){return e})).catch((function(e){return r.setCustomValidity(r.t(e.message||e)),!1})):(this.setCustomValidity(this.t("reCaptchaTokenValidationError")),s.default.resolve(!1)):(this.setCustomValidity(this.t("reCaptchaTokenNotSpecifiedError")),s.default.resolve(!1))}},{key:"normalizeValue",value:function(e){return this.recaptchaResult?this.recaptchaResult:e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.data }}"}].concat(t))}},{key:"builderInfo",get:function(){return{title:"Resource",icon:"files-o",weight:90,documentation:"/userguide/form-building/form-components#resource",schema:h.schema()}}}],(n=[{key:"init",value:function(){s(d(h.prototype),"init",this).call(this),this.component.dataSrc="resource",this.component.data={resource:this.component.resource}}},{key:"defaultSchema",get:function(){return h.schema()}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=p},18577:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"resourceInfo",weight:-10,type:"htmlelement",tag:"div",className:"alert alert-danger",content:"This component has been deprecated and will be removed in a future version of Formio.js."},{type:"select",input:!0,dataSrc:"url",data:{url:"/form?type=resource&limit=1000000&select=_id,title"},authenticate:!0,template:"{{ item.title }}",valueProperty:"_id",label:"Resource",key:"resource",weight:50,tooltip:"The resource to be used with this field."},{type:"tags",input:!0,key:"selectFields",label:"Select Fields",tooltip:"The properties on the resource to return as part of the options. If left blank, all properties will be returned.",placeholder:"Enter the fields to select.",weight:51},{type:"tags",input:!0,key:"searchFields",label:"Search Fields",tooltip:"A list of search filters based on the fields of the resource. See the Resource.js documentation for the format of these filters.",placeholder:"The fields to query on the server",weight:52},{type:"textfield",input:!0,key:"filter",label:"Filter Query",weight:53,description:"The filter query for results.",tooltip:"Use this to provide additional filtering using query parameters."},{type:"textfield",input:!0,key:"sort",label:"Sort Query",weight:53,description:"The sort query for results",tooltip:"Use this to provide additional sorting using query parameters"},{type:"textarea",input:!0,key:"template",label:"Item Template",editor:"ace",as:"html",rows:3,weight:53,tooltip:"The HTML template for the result data items."},{type:"checkbox",input:!0,weight:54,key:"addResource",label:"Add Resource",tooltip:"Allows to create a new resource while entering a submission.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",label:"Add Resource Label",key:"addResourceLabel",tooltip:"Set the text of the Add Resource button.",placeholder:"Add Resource",weight:55,input:!0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!!":{var:"data.addResource"}}]}}}]},24120:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,u.getRandomComponentId)();if(!o.default.isNil(t)){var i=this.component.idPath?this.component.idPath.split(".").reduceRight((function(e,t){return w({},t,e)}),r):{},a=p({value:this.getOptionValue(e),label:t},i),l=!!this.component.uniqueOptions&&!!this.selectOptions.find((function(e){return o.default.isEqual(e.value,a.value)}));if(!l&&(e&&this.selectOptions.push(a),this.refs.selectContainer&&"html5"===this.component.widget)){a.value&&o.default.isObject(a.value)&&o.default.isEmpty(a.value)&&(a.value="");var s=document.createElement("div");s.innerHTML=this.sanitize(this.renderTemplate("selectOption",{selected:o.default.isEqual(this.getOptionValue(this.dataValue),a.value),option:a,attrs:n,id:r,useId:(""===this.valueProperty||this.isEntireObjectDisplay())&&o.default.isObject(e)&&r}),this.shouldSanitizeValue).trim(),a.element=s.firstChild,this.refs.selectContainer.appendChild(a.element)}}}},{key:"addValueOptions",value:function(e){var t=this;e=e||[];var n=!1,r=this.dataValue;if(this.options.pdf&&!e.length&&"url"===this.component.dataSrc&&this.valueProperty&&(r=Array.isArray(r)?r.map((function(e){return o.default.set({},t.valueProperty,e)})):o.default.set({},this.valueProperty,r)),!this.selectOptions.length){var i=Array.isArray(r)&&this.component.multiple?r:[r];(n=this.addCurrentChoices(i,e))||this.component.multiple||this.addPlaceholder()}return n}},{key:"disableInfiniteScroll",value:function(){this.downloadedResources&&(this.downloadedResources.serverCount=this.downloadedResources.length,this.serverCount=this.downloadedResources.length)}},{key:"setItems",value:function(e,t){var n,r,i,a=this;if(this.selectItems=e,"string"==typeof e)try{e=JSON.parse(e)}catch(t){console.warn(t.message),e=[]}if(this.component.onSetItems){var l="function"==typeof this.component.onSetItems?this.component.onSetItems(this,e):this.evaluate(this.component.onSetItems,{items:e},"items");l&&(e=l)}if(!this.choices&&this.refs.selectContainer&&this.empty(this.refs.selectContainer),this.component.selectValues&&(e=o.default.get(e,this.component.selectValues,e)||[]),this.itemsFromUrl){i=!!this.isSelectURL&&o.default.isEqual(e,this.downloadedResources);var s=this.component.limit>e.length,u=i&&this.downloadedResources&&this.downloadedResources.length===e.length;s?this.disableInfiniteScroll():u?this.selectOptions=[]:this.serverCount=e.serverCount}if(this.isScrollLoading&&e)i||(this.downloadedResources=this.downloadedResources?this.downloadedResources.concat(e):e),this.downloadedResources.serverCount=e.serverCount||this.downloadedResources.serverCount;else if(this.downloadedResources=e||[],this.selectOptions=[],!o.default.isEmpty(this.dataValue)&&this.component.idPath){var c=o.default.get(this.dataValue,this.component.idPath,null),f=!o.default.isNil(c)&&e.find((function(e){return o.default.get(e,a.component.idPath)===c}));f&&this.setValue(f)}if(t||this.addValueOptions(e),"html5"!==this.component.widget||this.component.placeholder||this.addOption(null,""),o.default.each(e,(function(e,t){if(!(a.root&&a.root.options.editForm&&a.root.options.editForm._id&&a.root.options.editForm._id===e._id)){var n=a.selectValueAndLabel(e);a.addOption(n.value,n.label,{},o.default.get(e,a.component.idPath,String(t)))}})),this.choices?this.choices.setChoices(this.selectOptions,"value","label",!0):this.loading,this.isScrollLoading=!1,this.loading=!1,!t||!(null===(n=this.choices)||void 0===n||null===(r=n.input)||void 0===r?void 0:r.isFocussed))if(!this.isEmpty()||this.isRemoveButtonPressed)this.setValue(this.dataValue,{noUpdateEvent:!0});else if(this.shouldAddDefaultValue&&!this.options.readOnly){var d=this.defaultValue;this.isEmpty(d)||this.setValue(d)}this.itemsLoadedResolve()}},{key:"getSingleItemValueForHTMLMode",value:function(e){var t,n=null===(t=this.selectOptions)||void 0===t?void 0:t.find((function(t){var n=t.value;return o.default.isEqual(n,e)}));return n&&n.label||e}},{key:"itemValueForHTMLMode",value:function(e){var t=this;return this.isHtmlRenderMode()?Array.isArray(e)?e.map((function(e){return Array.isArray(e)?t.itemValueForHTMLMode(e):t.getSingleItemValueForHTMLMode(e)})).join(", "):this.getSingleItemValueForHTMLMode(e):O(j(k.prototype),"itemValueForHTMLMode",this).call(this,e)}},{key:"defaultValue",get:function(){var e=O(j(k.prototype),"defaultValue",this);return e||!1!==this.component.defaultValue&&0!==this.component.defaultValue||(e=this.component.defaultValue),e}},{key:"loadingError",get:function(){return!this.component.refreshOn&&!this.component.refreshOnBlur&&this.networkError}},{key:"loadItems",value:function(e,t,n,r,a,l){var s=this;if(r=r||{},!this.shouldLoad||!this.itemsFromUrl&&this.options.readOnly)return this.isScrollLoading=!1,this.loading=!1,void this.itemsLoadedResolve();var u=parseInt(this.component.minSearch,10);if(this.component.searchField&&u>0&&(!t||t.length0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return O(j(k.prototype),"isEmpty",this).call(this,e)||void 0===e}},{key:"refresh",value:function(e,t){var n=t.instance;this.component.clearOnRefresh&&n&&!n.pristine&&this.setValue(this.emptyValue),this.updateItems(null,!0)}},{key:"additionalResourcesAvailable",get:function(){return o.default.isNil(this.serverCount)||this.serverCount>this.downloadedResources.length}},{key:"serverCount",get:function(){return this.isFromSearch?this.searchServerCount:this.defaultServerCount},set:function(e){this.isFromSearch?this.searchServerCount=e:this.defaultServerCount=e}},{key:"downloadedResources",get:function(){return this.isFromSearch?this.searchDownloadedResources:this.defaultDownloadedResources},set:function(e){this.isFromSearch?this.searchDownloadedResources=e:this.defaultDownloadedResources=e}},{key:"addPlaceholder",value:function(){this.component.placeholder&&this.addOption("",this.component.placeholder,{placeholder:!0})}},{key:"activate",value:function(){!this.loading&&this.active||this.setLoadingItem(),this.active||(this.activated=!0,this.triggerUpdate())}},{key:"setLoadingItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.choices?e?this.choices.setChoices([{value:"".concat(this.id,"-loading"),label:"Loading...",disabled:!0}],"value","label"):this.choices.setChoices([{value:"",label:''),disabled:!0}],"value","label",!0):"url"!==this.component.dataSrc&&"resource"!==this.component.dataSrc||this.addOption("",this.t("loading..."))}},{key:"active",get:function(){return!this.component.lazyLoad||this.activated}},{key:"render",value:function(){var e=this.inputInfo;return e.attr=e.attr||{},e.multiple=this.component.multiple,O(j(k.prototype),"render",this).call(this,this.wrapElement(this.renderTemplate("select",{input:e,selectOptions:"",index:null})))}},{key:"wrapElement",value:function(e){return this.component.addResource&&!this.options.readOnly?this.renderTemplate("resourceAdd",{element:e}):e}},{key:"choicesOptions",value:function(){var e=!this.component.hasOwnProperty("searchEnabled")||this.component.searchEnabled,t=this.t(this.component.placeholder,{_userInput:!0}),n=this.component.customOptions||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){console.warn(e.message),n={}}var r={maxPatternLength:1e3,distance:1e3};return p({removeItemButton:!this.component.disabled&&o.default.get(this.component,"removeItemButton",!0),itemSelectText:"",classNames:{containerOuter:"choices form-group formio-choices",containerInner:this.transform("class","form-control ui fluid selection dropdown")},addItemText:!1,allowHTML:!0,placeholder:!!this.component.placeholder,placeholderValue:t,noResultsText:this.t("No results found"),noChoicesText:this.t("No choices to choose from"),searchPlaceholderValue:this.t("Type to search"),shouldSort:!1,position:this.component.dropdown||"auto",searchEnabled:e,searchChoices:!this.component.searchField,searchFields:o.default.get(this,"component.searchFields",["label"]),shadowRoot:this.root?this.root.shadowRoot:null,fuseOptions:this.component.useExactSearch?p({tokenize:!0,matchAllTokens:!0},r):Object.assign({},o.default.get(this,"component.fuseOptions",{}),p({include:"score",threshold:o.default.get(this,"component.selectThreshold",.3)},r)),valueComparer:o.default.isEqual,resetScrollPosition:!1},n)}},{key:"attach",value:function(e){var t,n,a,s=this,u=O(j(k.prototype),"attach",this).call(this,e);this.loadRefs(e,{selectContainer:"single",addResource:"single",autocompleteInput:"single"});var c=this.refs.autocompleteInput;c&&this.addEventListener(c,"change",(function(e){s.setValue(e.target.value)}));var f=this.refs.selectContainer;if(f){if(this.addEventListener(f,this.inputInfo.changeEvent,(function(){return s.updateValue(null,{modified:!0})})),this.attachRefreshOnBlur(),"html5"===this.component.widget)return this.addFocusBlurEvents(f),this.triggerUpdate(null,!0),this.visible&&this.setItems(this.selectItems||[]),this.focusableElement=f,this.addEventListener(f,"focus",(function(){return s.update()})),void this.addEventListener(f,"keydown",(function(e){var t=e.key;["Backspace","Delete"].includes(t)&&s.setValue(s.emptyValue)}));var d=f.tabIndex;this.addPlaceholder(),f.setAttribute("dir",this.i18next.dir()),null!==(t=this.choices)&&void 0!==t&&null!==(n=t.containerOuter)&&void 0!==n&&null!==(a=n.element)&&void 0!==a&&a.parentNode&&this.choices.destroy();var p=this.choicesOptions();if(r&&(this.choices=new r(f,p),this.selectOptions&&this.selectOptions.length&&this.choices.setChoices(this.selectOptions,"value","label",!0),this.component.multiple?this.focusableElement=this.choices.input.element:(this.focusableElement=this.choices.containerInner.element,this.choices.containerOuter.element.setAttribute("tabIndex","-1"),this.addEventListener(this.choices.containerOuter.element,"focus",(function(){return s.focusableElement.focus()}))),this.addFocusBlurEvents(this.focusableElement),this.itemsFromUrl&&!this.component.noRefreshOnScroll&&(this.scrollList=this.choices.choiceList.element,this.addEventListener(this.scrollList,"scroll",(function(){return s.onScroll()}))),p.removeItemButton&&this.addEventListener(f,"removeItem",(function(){s.isRemoveButtonPressed=!0}))),window&&this.choices&&this.shouldPositionDropdown&&this.addEventListener(window.document,"scroll",(function(){s.positionDropdown(!0)}),!1,!0),this.focusableElement.setAttribute("tabIndex",d),this.component.searchField){this.choices&&this.choices.input&&this.choices.input.element&&this.addEventListener(this.choices.input.element,"input",(function(e){s.isFromSearch=!!e.target.value,e.target.value?(s.serverCount=null,s.downloadedResources=[]):s.triggerUpdate()})),this.addEventListener(f,"choice",(function(){s.component.multiple&&"resource"===s.component.dataSrc&&s.isFromSearch&&s.triggerUpdate(),s.isFromSearch=!1}));var m=this.component.searchField&&(this.isSelectResource||this.isSelectURL)?1e3*(0===this.component.searchDebounce?0:this.component.searchDebounce||this.defaultSchema.searchDebounce):0;this.addEventListener(f,"search",o.default.debounce((function(e){var t;t=e,s.triggerUpdate(t.detail.value),s.positionDropdown()}),m)),this.addEventListener(f,"stopSearch",(function(){return s.triggerUpdate()})),this.addEventListener(f,"hideDropdown",(function(){s.choices&&s.choices.input&&s.choices.input.element&&(s.choices.input.element.value=""),s.updateItems(null,!0)}))}return this.addEventListener(f,"showDropdown",(function(){s.update(),s.positionDropdown()})),this.shouldPositionDropdown&&this.addEventListener(f,"highlightChoice",(function(){s.positionDropdown()})),this.choices&&p.placeholderValue&&this.choices._isSelectOneElement&&(this.addPlaceholderItem(p.placeholderValue),this.addEventListener(f,"removeItem",(function(){s.addPlaceholderItem(p.placeholderValue)}))),this.addValueOptions(),this.setChoicesValue(this.dataValue),this.isSelectResource&&this.refs.addResource&&this.addEventListener(this.refs.addResource,"click",(function(e){e.preventDefault();var t=s.ce("div"),n=s.createModal(t),r=o.default.get(s.root,"formio.projectUrl",i.GlobalFormio.getProjectUrl()),a="".concat(r,"/form/").concat(s.component.data.resource);new l.default(t,a,{}).ready.then((function(e){e.on("submit",(function(e){var t=s.valueProperty?o.default.get(e,s.valueProperty):e;s.component.multiple&&(t=[].concat(h(s.dataValue),[t])),s.setValue(t),s.triggerUpdate(),n.close()}))}))})),this.disabled=this.shouldDisabled,this.triggerUpdate(),u}}},{key:"setDropdownPosition",value:function(){var e,t,n,r,i=null===(e=this.choices)||void 0===e||null===(t=e.dropdown)||void 0===t?void 0:t.element,a=null===(n=this.choices)||void 0===n||null===(r=n.containerOuter)||void 0===r?void 0:r.element;if(i&&a){var l=a.getBoundingClientRect(),s=a.classList.contains("is-flipped");o.default.assign(i.style,{top:"".concat(s?l.top-i.offsetHeight:l.top+l.height,"px"),left:"".concat(l.left,"px"),width:"".concat(l.width,"px"),position:"fixed",bottom:"unset",right:"unset"})}}},{key:"hasDataGridAncestor",value:function(e){return!(!(e=e||this).inDataGrid&&"datagrid"!==e.type)||!!e.parent&&this.hasDataGridAncestor(e.parent)}},{key:"positionDropdown",value:function(e){var t,n=this;this.shouldPositionDropdown&&this.choices&&(null!==(t=this.choices.dropdown)&&void 0!==t&&t.isActive||!e)&&(this.setDropdownPosition(),this.itemsLoaded.then((function(){n.setDropdownPosition()})))}},{key:"isLoadingAvailable",get:function(){return!this.isScrollLoading&&this.additionalResourcesAvailable}},{key:"onScroll",value:function(){this.isLoadingAvailable&&(this.isScrollLoading=!0,this.setLoadingItem(!0),this.triggerUpdate(this.choices.input.element.value))}},{key:"attachRefreshOnBlur",value:function(){var e=this;this.component.refreshOnBlur&&this.on("blur",(function(t){e.checkRefreshOn([{instance:t,value:t.dataValue}],{fromBlur:!0})}))}},{key:"addPlaceholderItem",value:function(e){this.choices._store.activeItems.length||this.choices._addItem({value:e,label:e,choiceId:0,groupId:-1,customProperties:null,placeholder:!0,keyCode:null})}},{key:"update",value:function(){"custom"===this.component.dataSrc&&this.updateCustomItems(),this.activate()}},{key:"disabled",get:function(){return O(j(k.prototype),"disabled",this)},set:function(e){g(j(k.prototype),"disabled",e,this,!0),this.choices&&(e?(this.setDisabled(this.choices.containerInner.element,!0),this.focusableElement.removeAttribute("tabIndex"),this.choices.disable()):(this.setDisabled(this.choices.containerInner.element,!1),this.focusableElement.setAttribute("tabIndex",this.component.tabindex||0),this.choices.enable()))}},{key:"visible",get:function(){return O(j(k.prototype),"visible",this)},set:function(e){e&&!this._visible!=!e&&this.triggerUpdate(),g(j(k.prototype),"visible",e,this,!0)}},{key:"addCurrentChoices",value:function(e,t,n){var r=this;if(!e)return!1;var i=[],a=e.reduce((function(e,a){if(!a||o.default.isEmpty(a))return e;var l=!1,s=t===r.selectOptions;return t&&t.length&&o.default.each(t,(function(e){if(e._id&&a._id&&e._id===a._id)return l=!0,!1;var t=n?e.value:r.itemValue(e,s);return!(l|=o.default.isEqual(t,a))})),l?l||e:(i.push(r.selectValueAndLabel(a)),!0)}),!1);return i.length&&(this.choices&&this.choices.setChoices(i,"value","label"),i.map((function(e){r.addOption(e.value,e.label)}))),a}},{key:"getValueAsString",value:function(e,t){var n=this;return this.component.multiple&&Array.isArray(e)?e.map((function(e){return n.asString(e,t)})).join(", "):this.asString(e,t)}},{key:"getValue",value:function(){if(this.viewOnly||this.loading||!this.component.lazyLoad&&!this.selectOptions.length||!this.element)return this.dataValue;var e=this.emptyValue;if(this.choices)e=this.choices.getValue(!0),!this.component.multiple&&this.component.placeholder&&e===this.t(this.component.placeholder,{_userInput:!0})&&(e=this.emptyValue);else if(this.refs.selectContainer){if(e=this.refs.selectContainer.value,""===this.valueProperty||this.isEntireObjectDisplay()){if(""===e)return{};var t=this.selectOptions[e]||this.selectOptions.find((function(t){return t.id===e}));t&&o.default.isObject(t.value)&&(e=t.value)}}else e=this.dataValue;return null==e&&(e=""),e}},{key:"redraw",value:function(){var e=O(j(k.prototype),"redraw",this).call(this);return this.triggerUpdate(),e}},{key:"normalizeSingleValue",value:function(e){if(!o.default.isNil(e)){if(o.default.isObject(e)&&0===Object.keys(e).length)return e;var t=this.component.dataType||"auto",n={value:e,number:function(){var t=Number(this.value),n=e.toString()===t.toString();return!Number.isNaN(t)&&Number.isFinite(t)&&""!==e&&n&&(this.value=t),this},boolean:function(){return!o.default.isString(this.value)||"true"!==this.value.toLowerCase()&&"false"!==this.value.toLowerCase()||(this.value="true"===this.value.toLowerCase()),this},string:function(){return this.value=String(this.value),this},object:function(){return this},auto:function(){return o.default.isObject(this.value)?this.value=this.object().value:this.value=this.string().number().boolean().value,this}};try{return n[t]().value}catch(t){return console.warn("Failed to normalize value",t),e}}}},{key:"normalizeValue",value:function(e){var t=this;return this.component.multiple&&Array.isArray(e)?e.map((function(e){return t.normalizeSingleValue(e)})):O(j(k.prototype),"normalizeValue",this).call(this,this.normalizeSingleValue(e))}},{key:"setMetadata",value:function(e){var t,n=this;if(!o.default.isNil(e)){var r=o.default.isObject(e);if(r&&0===Object.keys(e).length)return e;var i=this.component.reference&&null!=e&&e._id?e._id.toString():e,a=!r||this.component.reference;if(i&&a&&this.templateData&&this.templateData[i]&&null!==(t=this.root)&&void 0!==t&&t.submission){var l=this.root.submission;l.metadata||(l.metadata={}),l.metadata.selectData||(l.metadata.selectData={});var s=this.templateData[i];if(this.component.multiple){s={};var u=this.dataValue;u&&o.default.isArray(u)&&u.length&&u.forEach((function(e){var t=n.component.reference?e._id.toString():e;s[t]=n.templateData[t]})),s[e]=this.templateData[e]}o.default.set(l.metadata.selectData,this.path,s)}}}},{key:"updateValue",value:function(e,t){var n=this,r=O(j(k.prototype),"updateValue",this).call(this,e,t);return!r&&this.selectMetadata||(this.component.multiple&&Array.isArray(this.dataValue)?this.dataValue.forEach((function(e){return n.setMetadata(e)})):this.setMetadata(this.dataValue)),r}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.dataValue,i=this.updateValue(e,n);if("html5"===this.component.widget&&(o.default.isEqual(e,r)||o.default.isEqual(r,{})&&o.default.isEqual(n,{}))&&!n.fromSubmission)return!1;e=this.dataValue;var a=!this.isEmpty(r),l=!this.isEmpty(e);if(this.component.multiple&&Array.isArray(e)?e=e.map((function(e){return"boolean"==typeof e||"number"==typeof e?e.toString():e})):"boolean"!=typeof e&&"number"!=typeof e||(e=e.toString()),this.isHtmlRenderMode()&&n&&n.fromSubmission&&i)return this.itemsLoaded.then((function(){t.redraw()})),i;if(this.loading)return i;if(this.isInitApiCallNeeded(l)){this.loading=!0,this.lazyLoadInit=!0;var s=this.component.searchField||this.component.valueProperty;return this.triggerUpdate(o.default.get(e.data||e,s,e),!0),i}return this.itemsLoaded.then((function(){t.addValueOptions(),t.setChoicesValue(e,a,n)})),i}},{key:"isInitApiCallNeeded",value:function(e){return this.component.lazyLoad&&!this.lazyLoadInit&&!this.active&&!this.selectOptions.length&&e&&this.shouldInitialLoad&&this.visible&&(this.component.searchField||this.component.valueProperty)}},{key:"setChoicesValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!this.isEmpty(e)||n.fromSubmission;if(t=void 0===t||t,this.choices)if(r){this.choices.removeActiveItems();var i=Array.isArray(e)&&this.component.multiple?e:[e];this.addCurrentChoices(i,this.selectOptions,!0)||this.choices.setChoices(this.selectOptions,"value","label",!0),this.choices.setChoiceByValue(i)}else(t||n.resetValue)&&this.choices.removeActiveItems();else if(r){var a=Array.isArray(e)?e:[e];if(!o.default.isEqual(this.dataValue,this.defaultValue)&&this.selectOptions.length<2||this.selectData&&n.fromSubmission){var l=this.selectValueAndLabel(this.dataValue),s=l.value,u=l.label;this.addOption(s,u)}o.default.each(this.selectOptions,(function(e){o.default.each(a,(function(t){if(""===e.value&&(e.value={}),o.default.isEqual(t,e.value)&&e.element)return e.element.selected=!0,e.element.setAttribute("selected","selected"),!1}))}))}else o.default.each(this.selectOptions,(function(e){e.element&&(e.element.selected=!1,e.element.removeAttribute("selected"))}))}},{key:"itemsLoaded",get:function(){return this._itemsLoaded||s.default.resolve()},set:function(e){this._itemsLoaded=e}},{key:"validateValueAvailability",value:function(e,t){var n=this;if(!(0,u.boolValue)(e)||!t)return!0;var r=this.getOptionsValues();return!!r&&(o.default.isObject(t)?-1!==r.findIndex((function(e){return function(e){var r=n.normalizeSingleValue(e);if(!o.default.isObject(r))return!1;try{return JSON.stringify(r)===JSON.stringify(t)}catch(e){return console.warn.error("Error while comparing items",e),!1}}(e)})):-1!==r.findIndex((function(e){return n.normalizeSingleValue(e)===t})))}},{key:"getOptionValue",value:function(e){return o.default.isObject(e)&&this.isEntireObjectDisplay()?this.normalizeSingleValue(e):o.default.isObject(e)&&(this.valueProperty||"resource"!==this.component.key)?e:o.default.isObject(e)&&!this.valueProperty?this.interpolate(this.component.template,{item:e}).replace(/<\/?[^>]+(>|$)/g,""):o.default.isNull(e)?this.emptyValue:String(this.normalizeSingleValue(e))}},{key:"getOptionsValues",value:function(){var e=this,t=[];switch(this.component.dataSrc){case"values":t=this.component.data.values;break;case"json":t=this.component.data.json;break;case"custom":t=this.getCustomItems()}if("string"==typeof t)try{t=JSON.parse(t)}catch(e){console.warn(e.message),t=[]}if(Array.isArray(t))return t.map((function(t){return e.getOptionValue(e.itemValue(t))}))}},{key:"deleteValue",value:function(){this.setValue("",{noUpdateEvent:!0}),this.unset()}},{key:"validateMultiple",value:function(){return!1}},{key:"isBooleanOrNumber",value:function(e){return"number"==typeof e||"boolean"==typeof e}},{key:"getNormalizedValues",value:function(){var e=this;if(this.component&&this.component.data&&this.component.data.values)return this.component.data.values.map((function(t){return{label:t.label,value:String(e.normalizeSingleValue(t.value))}}))}},{key:"asString",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(e,t){return t?(Array.isArray(e)?e.forEach((function(e){return e[t]=e[t].toString()})):e[t]=e[t].toString(),e):(n.isBooleanOrNumber(e)&&(e=e.toString()),Array.isArray(e)&&e.some((function(e){return n.isBooleanOrNumber(e)}))&&(e=e.map((function(e){n.isBooleanOrNumber(e)&&(e=e.toString())}))),e)};if(e=i(e=null!==(t=e)&&void 0!==t?t:this.getValue()),["values","custom"].includes(this.component.dataSrc)&&!this.asyncCustomValues()){var a,l="values"===this.component.dataSrc?{items:i(this.getNormalizedValues(),"value"),valueProperty:"value"}:{items:i(this.getCustomItems(),this.valueProperty),valueProperty:this.valueProperty},s=l.items,c=l.valueProperty,f=function(){var t=o.default.find(s,[c,e]),r=n.defaultSchema.data.values||[];return o.default.isEqual(t,r[0])?"-":t};e=this.component.multiple&&Array.isArray(e)?o.default.filter(s,(function(t){return e.includes(t.value)})):c?null!==(a=f())&&void 0!==a?a:{value:e,label:e}:e}if(o.default.isString(e))return e;var d=function(e){var t=n.itemTemplate(e);return r.csv&&t?(0,u.unescapeHTML)(t):t};if(Array.isArray(e)){var p=[];return e.forEach((function(e){return p.push(d(e))})),"resource"===this.component.dataSrc&&p.length>0?p.join(", "):p.length>0?p.join("
    "):"-"}return this.isEntireObjectDisplay()&&o.default.isObject(e)?JSON.stringify(e):o.default.isNil(e)?"-":d(e)}},{key:"detach",value:function(){var e,t;this.off("blur"),this.choices&&(null!==(e=this.choices.containerOuter)&&void 0!==e&&null!==(t=e.element)&&void 0!==t&&t.parentNode&&this.choices.destroy(),this.choices=null),O(j(k.prototype),"detach",this).call(this)}},{key:"focus",value:function(){this.focusableElement&&(O(j(k.prototype),"focus",this).call(this),this.focusableElement.focus())}},{key:"setErrorClasses",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.element;O(j(k.prototype),"setErrorClasses",this).call(this,e,t,n,r,o),this.choices?O(j(k.prototype),"setErrorClasses",this).call(this,[this.choices.containerInner.element],t,n,r,o):O(j(k.prototype),"setErrorClasses",this).call(this,[this.refs.selectContainer],t,n,r,o)}}],c=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n {\n var item = {};\n _.each(templateKeys, k => _.set(item, k, _.get(i, k)));\n return item;\n })\n "),t}})}},{key:"savedValueTypes",value:function(e){var t=u.componentValueTypes.boolean,n=u.componentValueTypes.string,r=u.componentValueTypes.number,o=u.componentValueTypes.object,i=u.componentValueTypes.array,a=e.dataType,l=e.reference;return(0,u.getComponentSavedTypes)(e)||(l?[o]:"object"===a?[o,i]:u.componentValueTypes[a]?[u.componentValueTypes[a]]:[t,n,r,o,i])}}],n&&v(t.prototype,n),c&&v(t,c),Object.defineProperty(t,"prototype",{writable:!1}),k}(a.default);t.default=x},12832:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(69826),n(41539),n(32564),n(92087);var r,o=(r=n(96486))&&r.__esModule?r:{default:r},i=n(82531),a=function(e){setTimeout((function(){var t,n=e.instance,r=e.data,i=null==n?void 0:n.root.getComponent("selectData");if(i&&n.getValue()&&null!==(t=n.downloadedResources)&&void 0!==t&&t.length){var a="url"===r.dataSrc&&r.data.url&&r.valueProperty,l="resource"===r.dataSrc&&r.data.resource&&r.valueProperty,s=a||l?function(e){var t=e.instance,n=e.data,r=t.downloadedResources.find((function(e){return o.default.get(e,n.valueProperty)===t.getValue()})),i={data:{},noeval:!0};return t.interpolate(n.template,{item:r},i),i.data.item}(e):void 0;i.setValue(s)}}),0)},l=[{key:"dataSrc",data:{values:[{label:"Values",value:"values"},{label:"URL",value:"url"},{label:"Resource",value:"resource"},{label:"Custom",value:"custom"},{label:"Raw JSON",value:"json"}]}},{type:"textfield",weight:10,input:!0,key:"indexeddb.database",label:"Database name",tooltip:"The name of the indexeddb database.",conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textfield",input:!0,key:"indexeddb.table",label:"Table name",weight:16,tooltip:"The name of table in the indexeddb database.",conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textarea",as:"json",editor:"ace",weight:18,input:!0,key:"indexeddb.filter",label:"Row Filter",tooltip:"Filter table items that match the object.",defaultValue:{},conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"data.json",label:"Data Source Raw JSON",tooltip:"A valid JSON array to use as a data source.",description:'
    Example:
    ["apple", "banana", "orange"].
    Example 2:
    [{"name": "John", "email": "john.doe@test.com"}, {"name": "Jane", "email": "jane.doe@test.com"}].
    ',conditional:{json:{"===":[{var:"data.dataSrc"},"json"]}}},{type:"checkbox",input:!0,label:"Lazy Load Data",key:"lazyLoad",tooltip:"When set, this will not fire off the request to the URL until this control is within focus. This can improve performance if you have many Select dropdowns on your form where the API's will only fire when the control is activated.",weight:11,conditional:{json:{and:[{in:[{var:"data.dataSrc"},["resource","url"]]},{"!==":[{var:"data.widget"},"html5"]}]}}},{type:"datagrid",input:!0,label:"Data Source Values",key:"data.values",tooltip:"Values to use as the data source. Labels are shown in the select field. Values are the corresponding values saved with the submission.",weight:10,reorder:!0,defaultValue:[{label:"",value:""}],components:[{label:"Label",key:"label",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield",allowCalculateOverride:!0,calculateValue:"value = _.camelCase(row.label);"}],conditional:{json:{"===":[{var:"data.dataSrc"},"values"]}}},{type:"select",input:!0,dataSrc:"url",data:{url:"/form?type=resource&limit=1000000&select=_id,title"},authenticate:!0,template:"{{ item.title }}",valueProperty:"_id",clearOnHide:!1,label:"Resource",key:"data.resource",lazyLoad:!1,weight:10,tooltip:"The resource to be used with this field.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",input:!0,label:"Data Path",key:"selectValues",weight:12,description:"The object path to the iterable items.",tooltip:"The property within the source data, where iterable items reside. For example: results.items or results[0].items",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"select",input:!0,label:"Value Property",key:"valueProperty",skipMerge:!0,clearOnHide:!0,tooltip:"The field to use as the value.",weight:11,refreshOn:"data.resource",template:"{{ item.label }}",valueProperty:"key",dataSrc:"url",lazyLoad:!1,onSetItems:function(e,t){var n="resource"===t.type?[{label:"{Entire Object}",key:"data"}]:[];return(0,i.eachComponent)(t.components,(function(e,t){e.input&&n.push({label:e.label||e.key,key:"data.".concat(t)})})),n},onChange:function(e){if(e&&e.flags&&e.flags.modified){var t=e.instance.data.valueProperty,n="{{ item.".concat(t||"data"," }}"),r=t?"".concat(t,"__regex"):"";e.instance.root.getComponent("template").setValue(n),e.instance.root.getComponent("searchField").setValue(r)}},data:{url:"/form/{{ data.data.resource }}"},conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!==":[{var:"data.reference"},!0]},{var:"data.data.resource"}]}}},{type:"select",input:!0,label:"Storage Type",key:"dataType",clearOnHide:!0,tooltip:"The type to store the data. If you select something other than autotype, it will force it to that type.",weight:12,template:"{{ item.label }}",dataSrc:"values",data:{values:[{label:"Autotype",value:"auto"},{label:"String",value:"string"},{label:"Number",value:"number"},{label:"Boolean",value:"boolean"},{label:"Object",value:"object"}]}},{type:"textfield",input:!0,key:"idPath",weight:12,label:"ID Path",placeholder:"id",tooltip:"Path to the select option id."},{type:"textfield",input:!0,label:"Select Fields",key:"selectFields",tooltip:"The properties on the resource to return as part of the options. Separate property names by commas. If left blank, all properties will be returned.",placeholder:"Comma separated list of fields to select.",weight:14,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"===":[{var:"data.valueProperty"},""]}]}}},{type:"checkbox",input:!0,key:"disableLimit",label:"Disable limiting response",tooltip:"When enabled the request will not include the limit and skip options in the query string",weight:15,conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"textfield",input:!0,key:"searchField",label:"Search Query Name",weight:16,description:"Name of URL query parameter",tooltip:"The name of the search querystring parameter used when sending a request to filter results with. The server at the URL must handle this query parameter.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"searchDebounce",label:"Search request delay",weight:16,description:"The delay (in seconds) before the search request is sent.",tooltip:"The delay in seconds before the search request is sent, measured from the last character input in the search field.",validate:{min:0,customMessage:"",json:"",max:1},delimiter:!1,requireDecimal:!1,encrypted:!1,defaultValue:.3,conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"minSearch",weight:17,label:"Minimum Search Length",tooltip:"The minimum amount of characters they must type before a search is made.",defaultValue:0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"url"]},{"!=":[{var:"data.searchField"},""]}]}}},{type:"textfield",input:!0,key:"filter",label:"Filter Query",weight:18,description:"The filter query for results.",tooltip:"Use this to provide additional filtering using query parameters.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"textfield",input:!0,key:"sort",label:"Sort Query",weight:18,description:"The sort query for results",tooltip:"Use this to provide additional sorting using query parameters",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"limit",label:"Limit",weight:18,description:"Maximum number of items to view per page of results.",tooltip:"Use this to limit the number of items to request or view.",clearOnHide:!1,conditional:{json:{and:[{in:[{var:"data.dataSrc"},["url","resource"]]},{"!==":[{var:"data.disableLimit"},!0]}]}}},{type:"textarea",input:!0,key:"data.custom",label:"Custom Values",editor:"ace",rows:10,weight:14,placeholder:"values = data['mykey'] or values = Promise.resolve(['myValue'])",tooltip:"Write custom code to return the value options or a promise with value options. The form data object is available.",conditional:{json:{"===":[{var:"data.dataSrc"},"custom"]}}},{type:"select",input:!0,key:"refreshOn",label:"Refresh Options On",weight:19,tooltip:"Refresh data when another field changes.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values","custom"]]}}},{type:"select",input:!0,key:"refreshOnBlur",label:"Refresh Options On Blur",weight:19,tooltip:"Refresh data when another field is blured.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values"]]}}},{type:"checkbox",input:!0,weight:20,key:"clearOnRefresh",label:"Clear Value On Refresh Options",defaultValue:!1,tooltip:"When the Refresh On field is changed, clear this components value.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values","custom"]]}}},{type:"checkbox",input:!0,weight:21,key:"searchEnabled",label:"Enable Static Search",defaultValue:!0,tooltip:"When checked, the select dropdown will allow for searching within the static list of items provided."},{type:"checkbox",input:!0,weight:21,key:"noRefreshOnScroll",label:"Disable Options Refresh When Scrolling",defaultValue:!1,tooltip:"When checked, the select with search input won't perform new api requests when scrolling through the list of options.",conditional:{json:{and:[{in:[{var:"data.dataSrc"},["url","resource"]]},{"===":[{var:"data.searchEnabled"},!0]}]}}},{label:"Search Threshold",mask:!1,tableView:!0,alwaysEnabled:!1,type:"number",input:!0,key:"selectThreshold",validate:{min:0,customMessage:"",json:"",max:1},delimiter:!1,requireDecimal:!1,encrypted:!1,defaultValue:.3,weight:22,tooltip:"At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything."},{type:"checkbox",input:!0,weight:23,key:"addResource",label:"Add Resource",tooltip:"Allows to create a new resource while entering a submission.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",label:"Add Resource Label",key:"addResourceLabel",tooltip:"Set the text of the Add Resource button.",placeholder:"Add Resource",weight:24,input:!0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!!":{var:"data.addResource"}}]}}},{type:"checkbox",input:!0,weight:25,key:"reference",label:"Save as reference",tooltip:"Using this option will save this field as a reference and link its value to the value of the origin record.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"checkbox",input:!0,weight:27,key:"readOnlyValue",label:"Read Only Value",tooltip:"Check this if you would like to show just the value when in Read Only mode."},{type:"textarea",as:"json",editor:"ace",weight:28,input:!0,key:"customOptions",label:"Choices.js options",tooltip:"A raw JSON object to use as options for the Select component (Choices JS).",defaultValue:{}},{type:"checkbox",input:!0,weight:29,key:"useExactSearch",label:"Use exact search",tooltip:"Disables search algorithm threshold."},{key:"defaultValue",onSetItems:function(e){a(e.evalContext())},onChange:function(e){e&&e.flags&&e.flags.modified&&a(e)}},{key:"selectData",conditional:{json:{and:[{"!==":[{var:"data.valueProperty"},null]},{"!==":[{var:"data.valueProperty"},""]}]}}},{key:"template",onChange:function(e){if(e&&e.flags&&e.flags.modified){var t=e.instance.root.getComponent("defaultValue");if(!t)return;a(t.evalContext())}}}];t.default=l},47158:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,weight:20,tooltip:"Select the type of widget you'd like to use.",key:"widget",defaultValue:"choicesjs",label:"Widget Type",dataSrc:"values",data:{values:[{label:"ChoicesJS",value:"choicesjs"},{label:"HTML 5",value:"html5"}]}},{weight:1230,type:"checkbox",label:"Unique Options",tooltip:"Display only unique dropdown options.",key:"uniqueOptions",input:!0}]},47446:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:50,type:"checkbox",label:"Perform server validation of remote value",tooltip:"Check this if you would like for the server to perform a validation check to ensure the selected value is an available option. This requires a Search query to ensure a record is found.",key:"validate.select",input:!0,conditional:{json:{var:"data.searchField"}}},{weight:52,type:"checkbox",label:"Allow only available values",tooltip:"Check this if you would like to perform a validation check to ensure the selected value is an available option (only for synchronous values).",key:"validate.onlyAvailableItems",input:!0,conditional:{json:{in:[{var:"data.dataSrc"},["values","json","custom"]]}}}]},99966:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.dataValue,t=!0;for(var n in e)if(e.hasOwnProperty(n)&&e[n]){t=!1;break}return t}},{key:"getValue",value:function(){if(this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var e={};return r.default.each(this.refs.input,(function(t){e[t.value]=!!t.checked})),e}},{key:"normalizeValue",value:function(e){var t=this;"object"!==c(e=e||{})&&(e="string"==typeof e?u({},e,!0):{}),Array.isArray(e)&&r.default.each(e,(function(t){e[t]=!0}));var n=r.default.keys(r.default.pickBy(e,(function(e){return e})));if(this.isSelectURL&&this.templateData&&r.default.every(n,(function(e){return t.templateData[e]}))){var o=this.root.submission;o.metadata.selectData||(o.metadata.selectData={});var i=[];n.forEach((function(e){return i.push(t.templateData[e])})),r.default.set(o.metadata.selectData,this.path,i)}return e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);return e=this.dataValue,this.isHtmlRenderMode()?n&&this.redraw():r.default.each(this.refs.input,(function(t){r.default.isUndefined(e[t.value])&&(e[t.value]=!1),t.checked=!!e[t.value]})),n}},{key:"getValueAsString",value:function(e){return e?this.isSelectURL?(0,r.default)(e).pickBy((function(e){return e})).keys().join(", "):(0,r.default)(this.component.values||[]).filter((function(t){return e[t.value]})).map("label").join(", "):""}},{key:"setSelectedClasses",value:function(){var e=this;if(this.refs.wrapper){var t=this.dataValue,n=Object.keys(t);this.refs.wrapper.forEach((function(o,i){var a=n[i],l=e.refs.input[i];(null==l?void 0:l.value.toString())!==a&&(a=n.find((function(e){return(null==l?void 0:l.value.toString())===e})));var s=t[a];s&&a||e.isSelectURL&&!e.shouldLoad&&e.listData&&-1!==r.default.findIndex(e.selectData,e.listData[i])?(e.addClass(o,e.optionSelectedClass),l.setAttribute("checked","true")):!s&&a&&(e.removeClass(o,e.optionSelectedClass),l.removeAttribute("checked"))}))}}},{key:"setInputsDisabled",value:function(e,t){this.refs.input&&this.refs.input.forEach((function(n){(t&&!n.checked||!t)&&(n.disabled=e)}))}},{key:"checkComponentValidity",value:function(e,t,n,r){var o=this,i=this.component.validate.minSelectedCount,a=this.component.validate.maxSelectedCount,l=this.isValid(e,t);if((a||i)&&!this.shouldSkipValidation(e,t,n)){var s=Object.keys(this.validationValue).reduce((function(e,t){return o.validationValue[t]&&e++,e}),0);if(a&&s>=a?this.setInputsDisabled(!0,!0):a&&!this.shouldDisabled&&this.setInputsDisabled(!1),!l&&a&&s>a){var u=this.t(this.component.maxSelectedCountMessage||"You can only select up to {{maxCount}} items.",{maxCount:a});return this.setCustomValidity(u,t),!1}if(!l&&i&&s1&&void 0!==arguments[1]?arguments[1]:{},n=y(w(m.prototype),"setValue",this).call(this,e,t);return this.refs.signatureImage&&(this.options.readOnly||this.disabled)&&(this.refs.signatureImage.setAttribute("src",e),this.showCanvas(!1)),this.signaturePad&&(e?n&&this.triggerChange():this.signaturePad.clear()),this.signaturePad&&this.dataValue&&this.signaturePad.isEmpty()&&this.setDataToSigaturePad(),n}},{key:"showCanvas",value:function(e){e?(this.refs.canvas&&(this.refs.canvas.style.display="inherit"),this.refs.signatureImage&&(this.refs.signatureImage.style.display="none")):(this.refs.canvas&&(this.refs.canvas.style.display="none"),this.refs.signatureImage&&(this.refs.signatureImage.style.display="inherit",this.refs.signatureImage.style.maxHeight="100%"))}},{key:"onDisabled",value:function(){this.showCanvas(!y(w(m.prototype),"disabled",this)),this.signaturePad&&(y(w(m.prototype),"disabled",this)?(this.signaturePad.off(),this.refs.refresh&&this.refs.refresh.classList.add("disabled"),this.refs.signatureImage&&this.dataValue&&this.refs.signatureImage.setAttribute("src",this.dataValue)):(this.signaturePad.on(),this.refs.refresh&&this.refs.refresh.classList.remove("disabled")))}},{key:"checkSize",value:function(e,t){if(this.refs.padBody&&(e||this.refs.padBody&&this.refs.padBody.offsetWidth!==this.currentWidth)){this.scale=e?t:this.scale,this.currentWidth=this.refs.padBody.offsetWidth;var n=this.currentWidth*this.scale,r=this.ratio?n/this.ratio:this.refs.padBody.offsetHeight*this.scale,o=this.ratio?r:this.refs.padBody.offsetHeight*this.scale;this.refs.canvas.width=n,this.refs.canvas.height=r>o?o:r,this.refs.canvas.style.maxWidth="".concat(this.currentWidth*this.scale,"px"),this.refs.canvas.style.maxHeight="".concat(o,"px");var i=this.refs.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0),i.scale(1/this.scale,1/this.scale),i.fillStyle=this.signaturePad.backgroundColor,i.fillRect(0,0,this.refs.canvas.width,this.refs.canvas.height),this.signaturePad.clear(),this.dataValue&&this.setDataToSigaturePad(),this.showCanvas(!0)}}},{key:"renderElement",value:function(e,t){return this.renderTemplate("signature",{element:y(w(m.prototype),"renderElement",this).call(this,e,t),required:l.default.get(this.component,"validate.required",!1)})}},{key:"hasModalSaveButton",get:function(){return!1}},{key:"getModalPreviewTemplate",value:function(){return this.renderTemplate("modalPreview",{previewText:this.dataValue?""):this.t("Click to Sign")})}},{key:"attach",value:function(e){var t=this;this.loadRefs(e,{canvas:"single",refresh:"single",padBody:"single",signatureImage:"single"});var n=y(w(m.prototype),"attach",this).call(this,e);return this.refs.refresh&&this.options.readOnly&&this.refs.refresh.classList.add("disabled"),this.refs.canvas&&(this.signaturePad=new o.default(this.refs.canvas,{minWidth:this.component.minWidth,maxWidth:this.component.maxWidth,penColor:this.component.penColor,backgroundColor:this.component.backgroundColor}),this.signaturePad.addEventListener("endStroke",(function(){return t.setValue(t.signaturePad.toDataURL())})),this.refs.signatureImage.setAttribute("src",this.signaturePad.toDataURL()),this.onDisabled(),this.refs.padBody&&(this.refs.padBody.style.maxWidth||(this.refs.padBody.style.maxWidth="100%"),this.builderMode||this.options.preview||(this.observer=new i.default((function(){t.checkSize()})),this.observer.observe(this.refs.padBody)),this.addEventListener(window,"resize",l.default.debounce((function(){return t.checkSize()}),10)),setTimeout(function e(){this.refs.padBody&&this.refs.padBody.offsetWidth?this.checkSize():setTimeout(e.bind(this),20)}.bind(this),20))),this.addEventListener(this.refs.refresh,"click",(function(e){e.preventDefault(),t.showCanvas(!0),t.signaturePad.clear(),t.setValue(t.defaultValue)})),this.setValue(this.dataValue),n}},{key:"detach",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.signaturePad&&this.signaturePad.off(),this.signaturePad=null,this.currentWidth=0,y(w(m.prototype),"detach",this).call(this)}},{key:"getValueAsString",value:function(e){return l.default.isUndefined(e)&&this.inDataTable?"":e?"Yes":"No"}},{key:"focus",value:function(){this.refs.padBody.focus()}},{key:"setDataToSigaturePad",value:function(){this.signaturePad.fromDataURL(this.dataValue,{ratio:1,width:this.refs.canvas.width,height:this.refs.canvas.height})}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;o.default.each(this.component.questions,(function(n){o.default.each(t.refs.input,(function(r){r.name===t.getInputName(n)&&(r.checked=r.value===e[n.value])}))}));var r=this.updateValue(e,n);return r&&this.isHtmlRenderMode()&&this.redraw(),r}},{key:"emptyValue",get:function(){return{}}},{key:"defaultValue",get:function(){var e=m(g(h.prototype),"defaultValue",this);if(e&&!o.default.isObject(e)&&this.component.values.some((function(t){return t.value===e}))){var t={};return this.component.questions.forEach((function(n){t[n.value]=e})),t}return e}},{key:"getValue",value:function(){var e=this;if(this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var t={};return o.default.each(this.component.questions,(function(n){o.default.each(e.refs.input,(function(r){if(r.checked&&r.name===e.getInputName(n))return t[n.value]=r.value,!1}))})),t}},{key:"disabled",get:function(){return m(g(h.prototype),"disabled",this)},set:function(e){(function(e,t,n,r,o){if(!d(e,t,n,r||e)&&o)throw new Error("failed to set property")})(g(h.prototype),"disabled",e,this,!0),o.default.each(this.refs.input,(function(e){e.disabled=!0}))}},{key:"validateRequired",value:function(e,t){return!(0,a.boolValue)(e)||this.component.questions.reduce((function(e,n){return e&&Boolean(t[n.value])}),!0)}},{key:"getInputName",value:function(e){return"".concat(this.options.name,"[").concat(e.value,"]")}},{key:"getValueAsString",value:function(e,t){var n=this;if(null!=t&&t.email){var r='\n \n \n \n \n \n \n \n \n ';return o.default.forIn(e,(function(e,t){var i=o.default.find(n.component.questions,["value",t]),a=o.default.find(n.component.values,["value",e]);i&&a&&(r+='\n \n \n \n \n "))})),r+="
    QuestionValue
    '.concat(i.label,'').concat(a.label,"
    "}if(o.default.isPlainObject(e)){var i=this.component,a=i.values,l=void 0===a?[]:a,s=i.questions,u=void 0===s?[]:s;return o.default.isEmpty(e)?"":o.default.map(e,(function(e,t){var n=o.default.get(o.default.find(l,(function(t){return o.default.isEqual(t.value,e)})),"label",e),r=o.default.get(o.default.find(u,(function(e){return o.default.isEqual(e.value,t)})),"label",t);return"".concat(r,": ").concat(n)})).join("; ")}return m(g(h.prototype),"getValueAsString",this).call(this,e,t)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:this.element;this.component.modalEdit&&m(v(y.prototype),"setErrorClasses",this).call(this,e,t,n,r,i),e.forEach((function(e){o.addClass(e,"is-invalid"),"openModal"!==e.getAttribute("ref")&&(o.options.highlightErrors?o.addClass(e,"tab-error"):o.addClass(e,"has-error"))}))}},{key:"clearErrorClasses",value:function(e){var t=this;if(!this.options.server&&this.rendered){if(this.component.modalEdit){var n=Array.isArray(e)||e instanceof NodeList?this.element:e;m(v(y.prototype),"clearErrorClasses",this).call(this,n)}(e=Array.isArray(e)||e instanceof NodeList?e:[e]).forEach((function(e){t.removeClass(e,"is-invalid"),t.removeClass(e,"tab-error"),t.removeClass(e,"has-error")}))}}},{key:"handleTabsValidation",value:function(){if(this.refs[this.tabLinkKey]&&this.refs[this.tabLinkKey].length&&this.tabs.length){this.clearErrorClasses(this.refs[this.tabLinkKey]);var e=this.tabs.reduce((function(e,t,n){return t.some((function(e){return!!e.error}))?[].concat(l(e),[n]):e}),[]);if(e.length){var t=l(this.refs[this.tabLinkKey]).filter((function(t,n){return e.includes(n)}));this.setErrorClasses(t)}}}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=y(w(m.prototype),"setValue",this).call(this,e,n);if(this.choices){var o=this.dataValue;if(this.choices.removeActiveItems(),o){"string"==typeof o&&(o=o.split(this.delimiter).filter((function(e){return e})));var i=Array.isArray(o)?o:[o];this.choices.setValue(i.map((function(e){return t.sanitize(e,t.shouldSanitizeValue)})))}}return r}},{key:"disabled",get:function(){return y(w(m.prototype),"disabled",this)},set:function(e){(function(e,t,n,r,o){if(!p(e,t,n,r||e)&&o)throw new Error("failed to set property")})(w(m.prototype),"disabled",e,this,!0),this.choices&&(e?this.choices.disable():this.choices.enable())}},{key:"focus",value:function(){this.refs.input&&this.refs.input.length&&this.refs.input[0].parentNode.lastChild.focus()}},{key:"getValueAsString",value:function(e){if(!e)return"";if(Array.isArray(e))return e.join("".concat(this.delimiter||","," "));var t=e.toString();return this.sanitize(t,this.shouldSanitizeValue)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n"},{weight:22,type:"number",input:!0,key:"maxTags",label:"Max Tags",defaultValue:0,tooltip:"The maximum amount of tags that can be added. 0 for infinity."},{weight:24,type:"select",input:!0,key:"storeas",label:"Store As",dataSrc:"values",data:{values:[{label:"String (CSV)",value:"string"},{label:"Array of Tags",value:"array"}]}}]},3611:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n");return this.renderTemplate("well",{children:o,nestedKey:this.key,value:e})}return this.renderTemplate("input",{prefix:this.prefix,suffix:this.suffix,input:n,value:e,index:t})}},{key:"autoExpand",get:function(){return this.component.autoExpand}},{key:"updateEditorValue",value:function(e,t){t=this.getConvertedValue(this.trimBlanks(t));var n=this.dataValue;if(this.component.multiple&&Array.isArray(n)){var r=i.default.clone(n);r[e]=t,t=r}i.default.isEqual(t,n)||i.default.isEmpty(t)&&i.default.isEmpty(n)||this.updateValue(t,{modified:!this.autoModified},e),this.autoModified=!1}},{key:"attachElement",value:function(e,t){var n=this;if(this.autoExpand&&(this.isPlain||this.options.readOnly||this.options.htmlView)&&"TEXTAREA"===e.nodeName&&this.addAutoExpanding(e,t),this.options.readOnly)return e;this.component.wysiwyg&&!this.component.editor&&(this.component.editor="ckeditor");var r=i.default.isEmpty(this.component.wysiwyg)?this.wysiwygDefault[this.component.editor]||this.wysiwygDefault.default:this.component.wysiwyg;return this.editorsReady[t]=new a.default((function(o){switch(n.component.editor){case"ace":r||(r={}),r.mode=n.component.as?"ace/mode/".concat(n.component.as):"ace/mode/javascript",n.addAce(e,r,(function(e){return n.updateEditorValue(t,e)})).then((function(e){n.editors[t]=e;var r=n.dataValue;return r=n.component.multiple&&Array.isArray(r)?r[t]:r,e.setValue(n.setConvertedValue(r,t)),o(e),e})).catch((function(e){return console.warn(e)}));break;case"quill":(r.hasOwnProperty("toolbarGroups")||r.hasOwnProperty("toolbar"))&&(console.warn("The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information."),r=n.wysiwygDefault.quill),n.addQuill(e,r,(function(){return n.updateEditorValue(t,n.editors[t].root.innerHTML)})).then((function(e){if(n.editors[t]=e,n.component.isUploadEnabled){var r=n;e.getModule("uploader").options.handler=function(){for(var e,t=arguments.length,n=new Array(t),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};if(f(m(v.prototype),"setValueAt",this).call(this,e,t,r),this.editorsReady[e]){var o=function(r){return function(o){if(!r.skipWysiwyg)switch(n.autoModified=!0,n.component.editor){case"ace":o.setValue(n.setConvertedValue(t,e));break;case"quill":if(n.component.isUploadEnabled)n.setAsyncConvertedValue(t).then((function(e){var t=o.clipboard.convert({html:e});o.setContents(t)}));else{var i=n.setConvertedValue(t,e),a=o.clipboard.convert({html:i});o.setContents(a)}break;case"ckeditor":o.data.set(n.setConvertedValue(t,e))}}};this.editorsReady[e].then(o(i.default.clone(r)))}}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isPlain||this.options.readOnly||this.disabled?(e=this.component.multiple&&Array.isArray(e)?e.map((function(e,n){return t.setConvertedValue(e,n)})):this.setConvertedValue(e),f(m(v.prototype),"setValue",this).call(this,e,n)):(n.skipWysiwyg=(""!==e||!n.resetValue)&&i.default.isEqual(e,this.getValue()),f(m(v.prototype),"setValue",this).call(this,e,n))}},{key:"setContent",value:function(e,t,n){f(m(v.prototype),"setContent",this).call(this,e,t,n,{addAttr:["allow","allowfullscreen","frameborder","scrolling"],addTags:["iframe"]})}},{key:"setReadOnlyValue",value:function(e,t){t=t||0,(this.options.readOnly||this.disabled)&&this.refs.input&&this.refs.input[t]&&("plain"===this.component.inputFormat?this.refs.input[t].innerText=this.isPlain?e:this.interpolate(e,{},{noeval:!0}):this.setContent(this.refs.input[t],this.isPlain?e:this.interpolate(e,{},{noeval:!0}),this.shouldSanitizeValue))}},{key:"isJsonValue",get:function(){return this.component.as&&"json"===this.component.as}},{key:"setConvertedValue",value:function(e,t){if(this.isJsonValue&&!i.default.isNil(e))try{e=JSON.stringify(e,null,2)}catch(e){console.warn(e)}return i.default.isString(e)||(e=""),this.setReadOnlyValue(e,t),e}},{key:"setAsyncConvertedValue",value:function(e){if(this.isJsonValue&&e)try{e=JSON.stringify(e,null,2)}catch(e){console.warn(e)}i.default.isString(e)||(e="");var t=(new DOMParser).parseFromString(e,"text/html"),n=t.getElementsByTagName("img");return n.length?this.setImagesUrl(n).then((function(){return e=t.getElementsByTagName("body")[0].innerHTML})):a.default.resolve(e)}},{key:"setImagesUrl",value:function(e){var t=this;return a.default.all(i.default.map(e,(function(e){var n;try{n=JSON.parse(e.getAttribute("alt"))}catch(e){console.warn(e)}return t.fileService.downloadFile(n).then((function(t){e.setAttribute("src",t.url)}))})))}},{key:"addAutoExpanding",value:function(e,t){var n=null,r=null,o=function(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t},a=function(){0!==e.scrollHeight&&function(t,r){for(var o=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&o.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;e.style.height="",e.style.height="".concat(e.scrollHeight+n,"px"),o.forEach((function(e){e.node.scrollTop=e.scrollTop}))}(e)},l=i.default.debounce((function(){a();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),i=e.offsetHeight;i0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return f(m(v.prototype),"isEmpty",this).call(this,this.trimBlanks(e))}},{key:"defaultValue",get:function(){var e=f(m(v.prototype),"defaultValue",this);return"quill"!==this.component.editor||e||(e="


    "),e}},{key:"getConvertedValue",value:function(e){if(this.isJsonValue&&e)try{e=JSON.parse(e)}catch(e){}return e}},{key:"detach",value:function(){var e=this;this.editors.forEach((function(e){e.destroy&&e.destroy()})),this.editors=[],this.editorsReady=[],this.updateSizes.forEach((function(t){return e.removeEventListener(window,"resize",t)})),this.updateSizes=[],f(m(v.prototype),"detach",this).call(this)}},{key:"getValue",value:function(){return this.isPlain?this.getConvertedValue(f(m(v.prototype),"getValue",this).call(this)):this.dataValue}},{key:"focus",value:function(){var e=this;switch(f(m(v.prototype),"focus",this).call(this),this.component.editor){case"ckeditor":var t;null===(t=this.editorsReady[0])||void 0===t||t.then((function(){var t,n;null!==(t=e.editors[0].editing)&&void 0!==t&&null!==(n=t.view)&&void 0!==n&&n.focus&&e.editors[0].editing.view.focus(),e.element.scrollIntoView()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}));break;case"ace":var n;null===(n=this.editorsReady[0])||void 0===n||n.then((function(){e.editors[0].focus(),e.element.scrollIntoView()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}));break;case"quill":var r;null===(r=this.editorsReady[0])||void 0===r||r.then((function(){e.editors[0].focus()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}))}}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nhttps://github.com/danialfarid/ng-file-upload#server-side for how to set up the server.",conditional:{json:{"===":[{var:"data.uploadStorage"},"url"]}}},{type:"textarea",key:"uploadOptions",label:"Image Upload Custom request options",tooltip:"Pass your custom xhr options(optional)",rows:5,editor:"ace",input:!0,weight:415.4,placeholder:'{\n "withCredentials": true\n }',conditional:{json:{"===":[{var:"data.uploadStorage"},"url"]}}},{type:"textfield",input:!0,key:"uploadDir",label:"Image Upload Directory",placeholder:"(optional) Enter a directory for the files",tooltip:"This will place all the files uploaded in this field in the directory",weight:415.5,conditional:{json:{"===":[{var:"data.isUploadEnabled"},!0]}}},{type:"textfield",key:"fileKey",input:!0,label:"File form-data Key",tooltip:"Key name that you would like to modify for the file while calling API request.",rows:5,weight:415.6,placeholder:"Enter the key name of a file for form data.",conditional:{json:{and:[{"===":[{var:"data.editor"},"quill"]},{"===":[{var:"data.isUploadEnabled"},!0]},{"===":[{var:"data.uploadStorage"},"url"]}]}}},{type:"select",input:!0,key:"as",label:"Save As",dataSrc:"values",tooltip:"This setting determines how the value should be entered and stored in the database.",clearOnHide:!0,data:{values:[{label:"String",value:"string"},{label:"JSON",value:"json"},{label:"HTML",value:"html"}]},conditional:{json:{or:[{"===":[{var:"data.editor"},"quill"]},{"===":[{var:"data.editor"},"ace"]}]}},weight:416},{type:"textarea",input:!0,editor:"ace",rows:10,as:"json",label:"Editor Settings",tooltip:"Enter the WYSIWYG editor JSON configuration.",key:"wysiwyg",customDefaultValue:function(e,t,n,r,o){return o?o.wysiwygDefault:""},conditional:{json:{or:[{"===":[{var:"data.editor"},"ace"]},{"===":[{var:"data.editor"},"ckeditor"]},{"===":[{var:"data.editor"},"quill"]}]}},weight:417}];t.default=a},94799:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:125,key:"validate.minWords",label:"Minimum Word Length",placeholder:"Minimum Word Length",type:"number",tooltip:"The minimum amount of words that can be added to this field.",input:!0},{weight:126,key:"validate.maxWords",label:"Maximum Word Length",placeholder:"Maximum Word Length",type:"number",tooltip:"The maximum amount of words that can be added to this field.",input:!0}]},53983:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};if(e&&"object"===d(e)||(e={value:e,maskName:this.component.inputMasks[0].label}),!e.value){var n=t.noDefault?this.emptyValue:this.defaultValue;e.value=Array.isArray(n)?n[0]:n}return e}},{key:"normalizeValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isMultipleMasksField?Array.isArray(e)?w(O(v.prototype),"normalizeValue",this).call(this,e.map((function(e){return t.maskValue(e,n)}))):w(O(v.prototype),"normalizeValue",this).call(this,this.maskValue(e,n)):w(O(v.prototype),"normalizeValue",this).call(this,e)}},{key:"setValueAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.isMultipleMasksField)return w(O(v.prototype),"setValueAt",this).call(this,e,t,n);var r=(t=this.maskValue(t,n)).value||"",i=this.refs.mask?this.refs.mask[e]:null,l=this.refs.select?this.refs.select[e]:null,s=this.getMaskPattern(t.maskName);if(!(i&&l&&s))return w(O(v.prototype),"setValueAt",this).call(this,e,r,n);if(i.inputmask)this.setInputMask(i,s),i.inputmask.setValue(r);else{var u=this.placeholderChar;i.value=(0,o.conformToMask)(r,a.getInputMask(s),{placeholderChar:u}).conformedValue}l.value=t.maskName}},{key:"unmaskValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.component.displayMask,n=a.getInputMask(t,this.placeholderChar);return a.unmaskValue(e,n,this.placeholderChar)}},{key:"getValueAt",value:function(e){if(!this.isMultipleMasksField){var t,n,r=w(O(v.prototype),"getValueAt",this).call(this,e),o=this.component.inputMask,a=this.component.displayMask;return o&&!a||a===o?r:a&&!o?this.unmaskValue(r,a):a&&a!==o?i.default.format(i.default.unmask(r,a),o):null!==(t=this.refs.valueMaskInput)&&void 0!==t&&t.mask&&this.refs.valueMaskInput.mask.textMaskInputElement?(this.refs.valueMaskInput.mask.textMaskInputElement.update(r),null===(n=this.refs.valueMaskInput)||void 0===n?void 0:n.value):r}var l=this.refs.mask?this.refs.mask[e]:null,s=this.refs.select?this.refs.select[e]:null;return{value:l?l.value:void 0,maskName:s?s.value:void 0}}},{key:"checkInputMaskValue",value:function(e){var t=!0,n=s.default.values(e.split("").reduce((function(e,n,r,o){var i;return"{"!==n&&"}"!==n||("{"!==o[r+1]&&"}"!==o[r+1]||(t=!1),e[n]=(null!==(i=e[n])&&void 0!==i?i:0)+1),e}),{}));return n[0]!==n[1]&&(t=!1),t}},{key:"setInputMask",value:function(e,t,n){if("textfield"===this.type){t=t||this.component.displayMask||this.component.inputMask;var r=a.getInputMask(t,this.placeholderChar);if(this.defaultMask=r,e&&t){try{e.mask&&e.mask.remove(),this.checkInputMaskValue(t)&&(e.mask=new i.default(t,{clearMaskOnLostFocus:!!this.component.placeholder,showMaskOnHover:!this.component.placeholder,placeholder:this.placeholderChar||""}).mask(e))}catch(e){console.warn(e)}r.numeric&&e.setAttribute("pattern","\\d*"),this.component.placeholder&&e.setAttribute("placeholder",this.component.placeholder)}}else w(O(v.prototype),"setInputMask",this).call(this,e,t,n)}},{key:"isHtmlRenderMode",value:function(){return w(O(v.prototype),"isHtmlRenderMode",this).call(this)||(this.options.readOnly||this.disabled)&&"html"===this.component.inputFormat&&"textfield"===this.type}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return this.isMultipleMasksField?w(O(v.prototype),"isEmpty",this).call(this,e)||(this.component.multiple?0===e.length:!e.maskName||!e.value):w(O(v.prototype),"isEmpty",this).call(this,(e||"").toString().trim())}},{key:"truncateMultipleSpaces",value:function(e){return e?e.trim().replace(/\s{2,}/g," "):e}},{key:"validationValue",get:function(){var e=w(O(v.prototype),"validationValue",this);return e&&this.component.truncateMultipleSpaces?this.truncateMultipleSpaces(e):e}},{key:"beforeSubmit",value:function(){var e=this,t=this.dataValue;return this.component.truncateMultipleSpaces&&t?(t=this.truncateMultipleSpaces(t),this.dataValue=t,l.default.resolve(t).then((function(){return w(O(v.prototype),"beforeSubmit",e).call(e)}))):l.default.resolve(t)}},{key:"getValueAsString",value:function(e,t){return null!=t&&t.email&&this.visible&&!this.skipInEmail&&s.default.isObject(e)?'\n \n \n \n \n \n \n \n
    '.concat(e.maskName,'').concat(e.value,"
    \n "):(e&&"plain"===this.component.inputFormat&&/<[^<>]+>/g.test(e)&&(e=e.replaceAll("<","<").replaceAll(">",">")),w(O(v.prototype),"getValueAsString",this).call(this,e,t))}}],u=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.label }}",data:{values:[{value:"plain",label:"Plain"},{value:"html",label:"HTML"},{value:"raw",label:"Raw (Insecure)"}]},defaultValue:"plain",input:!0},{weight:200,type:"radio",label:"Text Case",key:"case",tooltip:"When data is entered, you can change the case of the value.",input:!0,values:[{value:"mixed",label:"Mixed (Allow upper and lower case)"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"}]},{weight:205,type:"checkbox",input:!0,key:"truncateMultipleSpaces",label:"Truncate Multiple Spaces"}]},58054:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(22457)),o=i(n(96486));function i(e){return e&&e.__esModule?e:{default:e}}var a=[{weight:400,type:"select",input:!0,key:"widget.type",label:"Widget",placeholder:"Select a widget",tooltip:"The widget is the display UI used to input the value of the field.",defaultValue:"input",onChange:function(e){e.data.widget=o.default.pick(e.data.widget,"type")},dataSrc:"values",data:{values:[{label:"Input Field",value:"input"},{label:"Calendar Picker",value:"calendar"}]},conditional:{json:{"===":[{var:"data.type"},"textfield"]}}},{weight:405,type:"textarea",key:"widget",label:"Widget Settings",refreshOn:"wiget.type",clearOnHide:!1,calculateValue:function(e){var t=e.instance.calculatedValue,n=e.data.widget.type;if(o.default.isEmpty(o.default.omit(e.data.widget,"type"))||o.default.isEmpty(o.default.omit(t,"type"))){if(t&&!t.type)return e.data.widget;var i=e.instance._currentForm.options.editComponent.widget;if(i&&!o.default.isEmpty(o.default.omit(i,"type"))&&n===i.type)return o.default.omit(i,"language");if(n)return o.default.omit(r.default[n].defaultSettings,"language")}return e.data.widget},input:!0,rows:5,editor:"ace",as:"json",conditional:{json:{"!==":[{var:"data.widget.type"},"input"]}}},{weight:410,type:"textfield",input:!0,key:"inputMask",label:"Input Mask",tooltip:"An input mask helps the user with input by ensuring a predefined format.

    9: numeric
    a: alphabetical
    *: alphanumeric

    Example telephone mask: (999) 999-9999

    See the jquery.inputmask documentation for more information.",customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:410,type:"textfield",input:!0,key:"displayMask",label:"Display Mask",tooltip:"A display mask helps to display the input in a readable way, this won't affect the value which will be saved (to affect both view and saved value, delete Display Mask and use Input Mask).

    9: numeric
    a: alphabetical
    *: alphanumeric

    Example telephone mask: (999) 999-9999

    See the jquery.inputmask documentation for more information.",customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:410,type:"select",input:!0,key:"applyMaskOn",label:"Apply Mask On",tooltip:"Select the type of applying mask.",defaultValue:"change",dataSrc:"values",data:{values:[{label:"Change",value:"change"},{label:"Blur",value:"blur"}]},customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:411,type:"textfield",input:!0,key:"inputMaskPlaceholderChar",label:"Input Mask Placeholder Char",tooltip:"You can specify a char which will be used as a placeholder in the field.
    E.g., ˍ
    Make note that placeholder char will be replaced by a space if it is used inside the mask",validation:{maxLength:1},customConditional:function(e){return e.data.inputMask||e.data.displayMask}},{weight:413,type:"checkbox",input:!0,key:"allowMultipleMasks",label:"Allow Multiple Masks"},{weight:1350,type:"checkbox",input:!0,key:"spellcheck",defaultValue:!0,label:"Allow Spellcheck"},{weight:417,type:"datagrid",input:!0,key:"inputMasks",label:"Input Masks",customConditional:function(e){return!0===e.data.allowMultipleMasks},reorder:!0,components:[{type:"textfield",key:"label",label:"Label",input:!0},{type:"textfield",key:"mask",label:"Mask",input:!0}]},{weight:320,type:"textfield",input:!0,key:"prefix",label:"Prefix"},{weight:330,type:"textfield",input:!0,key:"suffix",label:"Suffix"},{weight:700,type:"textfield",input:!0,key:"autocomplete",label:"Autocomplete",placeholder:"on",tooltip:"Indicates whether input elements can by default have their values automatically completed by the browser. See the MDN documentation on autocomplete for more information."},{weight:1300,type:"checkbox",label:"Hide Input",tooltip:"Hide the input in the browser. This does not encrypt on the server. Do not use for passwords.",key:"mask",input:!0},{weight:1200,type:"checkbox",label:"Show Word Counter",tooltip:"Show a live count of the number of words.",key:"showWordCount",input:!0},{weight:1201,type:"checkbox",label:"Show Character Counter",tooltip:"Show a live count of the number of characters.",key:"showCharCount",input:!0}];t.default=a},64082:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:110,key:"validate.minLength",label:"Minimum Length",placeholder:"Minimum Length",type:"number",tooltip:"The minimum length requirement this field must meet.",input:!0},{weight:120,key:"validate.maxLength",label:"Maximum Length",placeholder:"Maximum Length",type:"number",tooltip:"The maximum length requirement this field must meet.",input:!0},{weight:125,key:"validate.minWords",label:"Minimum Word Length",placeholder:"Minimum Word Length",type:"number",tooltip:"The minimum amount of words that can be added to this field.",input:!0},{weight:126,key:"validate.maxWords",label:"Maximum Word Length",placeholder:"Maximum Word Length",type:"number",tooltip:"The maximum amount of words that can be added to this field.",input:!0},{weight:130,key:"validate.pattern",label:"Regular Expression Pattern",placeholder:"Regular Expression Pattern",type:"textfield",tooltip:"The regular expression pattern test that the field value must pass before the form can be submitted.",input:!0}]},65105:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},i=r.data,l=void 0===i?{}:i,s=r.children,u=void 0===s?[]:s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=c.checkNode,d=c.createComponents,p=c.isNew,h=void 0===p||p,m=c.removeComponents,y=c.parentPath,v=void 0===y?"":y;a(this,e),this.parent=t,this.previousData={},this.persistentData=o.default.cloneDeep(l),this.new=h,this.createComponents=d,this.checkNode=f,this.removeComponents=m,this.revertAvailable=!1,this.editing=!1,this.collapsed=!1,this.components=[],this.children=[],this.parentPath=v,this.resetData(),this.children=u.map((function(t,r){return new e(n,t,{checkNode:f,createComponents:d,isNew:!1,removeComponents:m,parentPath:n.getChildrenPath(r)})}))}var t,n;return t=e,(n=[{key:"value",get:function(){return this.new?null:{data:o.default.cloneDeep(this.persistentData),children:this.children.filter((function(e){return!e.new})).map((function(e){return e.value}))}}},{key:"isRoot",get:function(){return null===this.parent}},{key:"changing",get:function(){return this.new||this.editing}},{key:"hasChangingChildren",get:function(){return this.changin||this.children.some((function(e){return e.hasChangingChildren}))}},{key:"hasData",get:function(){return!o.default.isEmpty(this.persistentData)}},{key:"hasChildren",get:function(){return Array.isArray(this.children)&&this.children.length>0}},{key:"getChildrenPath",value:function(e){return this.parentPath?"".concat(this.parentPath,".children[").concat(e,"]"):""}},{key:"eachChild",value:function(e){return e(this),this.children.forEach((function(t){return t.eachChild(e)})),this}},{key:"getComponents",value:function(){return this.children.reduce((function(e,t){return e.concat(t.getComponents())}),this.components)}},{key:"validateNode",value:function(){var e=this,t=!0;return this.getComponents().forEach((function(n){n.setPristine(!1),t&=n.checkValidity(null,!1,e.persistentData)})),t}},{key:"addChild",value:function(){if(this.new)return null;var t=new e(this,{},{checkNode:this.checkNode,createComponents:this.createComponents,isNew:!0,removeComponents:this.removeComponents,parentPath:this.getChildrenPath(this.children.length)});return this.children=this.children.concat(t),t}},{key:"removeChild",value:function(e){return this.new||(this.children=this.children.filter((function(t){return t!==e}))),this}},{key:"edit",value:function(){return this.new?this:(this.editing=!0,this.resetData())}},{key:"save",value:function(){var e=this.validateNode();return this.changing&&e&&(this.new?this.new=!1:(this.editing=!1,this.revertAvailable=!0),this.commitData()),e}},{key:"cancel",value:function(){return this.new?this.remove():this.editing&&(this.editing=!1,this.resetData()),this}},{key:"remove",value:function(){return this.parent.removeChild(this),this.parent=null,this.clearComponents(),this}},{key:"revert",value:function(){return this.revertAvailable?(this.data=this.previousData,this.commitData()):this}},{key:"commitData",value:function(){return this.previousData=this.persistentData,this.persistentData=o.default.cloneDeep(this.data),this.clearComponents(),this}},{key:"resetData",value:function(){return this.data=o.default.cloneDeep(this.persistentData),this.updateComponentsContext(),this}},{key:"updateComponentsContext",value:function(){return this.changing?this.instantiateComponents():this.clearComponents(),this}},{key:"instantiateComponents",value:function(){var e=this;this.components=this.createComponents(this.data,this),this.components.forEach((function(t){if(e.parentPath){var n=e.calculateComponentPath(t);t.path=n}})),this.checkNode(this)}},{key:"clearComponents",value:function(){this.removeComponents(this.components),this.components=[]}},{key:"calculateComponentPath",value:function(e){var t="";return e.component.key&&(t="".concat(this.parentPath,".data.").concat(e.component.key)),t}}])&&l(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=s},69561:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.hasChildren&&!e.collapsed?this.renderChildNodes(e.children,!t):[],r=e.changing?this.renderEdit(e):this.renderView(e);return this.renderTemplate("tree",{odd:t,childNodes:n,content:r,node:e})}},{key:"renderChildNodes",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return t.map((function(t){return e.renderTree(t,n)}))}},{key:"renderEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.renderTemplate("treeEdit",{children:this.renderComponents(e.components),node:e})}},{key:"renderView",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.renderTemplate("treeView",{values:this.viewComponents.map((function(t){return t.data=e.data,t.checkComponentConditions(e.data),t.getView(t.dataValue)})),nodeData:e.data,node:e})}},{key:"attach",value:function(e){return this.builderMode?b(O(v.prototype),"attach",this).call(this,e):(this.loadRefs(e,{root:"single"}),u.default.all([b(O(v.prototype),"attach",this).call(this,e),this.attachNode(this.refs.root,this.treeRoot)]))}},{key:"attachNode",value:function(e,t){if(!e)return u.default.resolve();var n=u.default.resolve(),r=u.default.resolve();return t.refs=o.default.reduce(e.children,(function(e,t){return t.hasAttribute("ref")?d(d({},e),{},y({},t.getAttribute("ref"),t)):e}),{}),t.refs.content&&(this.attachActions(t),n=this.attachComponents(t)),t.refs.childNodes&&(r=this.attachChildren(t)),u.default.all([n,r])}},{key:"attachActions",value:function(e){var t,n=this;e.editing||this.loadRefs.call(e,e.refs.content,{addChild:"single",editNode:"single",removeNode:"single",revertNode:"single",toggleNode:"single"}),this.loadRefs.call(e,(null===(t=e.refs.content.children[0])||void 0===t?void 0:t.children[1])||e.refs.content,{cancelNode:"single",saveNode:"single"}),e.refs.addChild&&this.addEventListener(e.refs.addChild,"click",(function(){n.addChild(e)})),e.refs.cancelNode&&this.addEventListener(e.refs.cancelNode,"click",(function(){n.cancelNode(e)})),e.refs.editNode&&this.addEventListener(e.refs.editNode,"click",(function(){n.editNode(e)})),e.refs.removeNode&&this.addEventListener(e.refs.removeNode,"click",(function(){n.removeNode(e)})),e.refs.revertNode&&this.addEventListener(e.refs.revertNode,"click",(function(){n.revertNode(e)})),e.refs.saveNode&&this.addEventListener(e.refs.saveNode,"click",(function(){n.saveNode(e)})),e.refs.toggleNode&&this.addEventListener(e.refs.toggleNode,"click",(function(){n.toggleNode(e)}))}},{key:"attachComponents",value:function(e){if(this.builderMode){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);return this.setRoot(),n}},{key:"addChild",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.addChild",{parent:e,component:this},(function(){var n=e.addChild();return t.redraw(),n}))}},{key:"cancelNode",value:function(e){var t=this;this.options.readOnly||this.hook("tree.cancelNode",{node:e,component:this},(function(){return e.isRoot?e.persistentData&&!o.default.isEmpty(e.persistentData)?(e.cancel(),t.redraw()):t.removeRoot():(e.cancel(),t.redraw()),e}))}},{key:"editNode",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.editNode",{node:e,component:this},(function(){return e.edit(),t.redraw(),e}))}},{key:"removeNode",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.removeNode",{node:e,component:this},(function(){return e.isRoot?t.removeRoot():(e.remove(),t.updateTree()),e}))}},{key:"revertNode",value:function(e){var t=this;!this.options.readOnly&&e.revertAvailable&&this.hook("tree.revertNode",{node:e,component:this},(function(){return e.revert(),t.updateTree(),e}))}},{key:"saveNode",value:function(e){var t=this;this.options.readOnly||this.hook("tree.saveNode",{node:e,component:this},(function(){return e.save()&&t.updateTree(),e}))}},{key:"toggleNode",value:function(e){var t=this;this.hook("tree.toggleNode",{node:e,component:this},(function(){return e.collapsed=!e.collapsed,t.redraw(),e}))}},{key:"removeRoot",value:function(){this.options.readOnly||(this.dataValue=this.defaultValue,this.setRoot(),this.redraw())}},{key:"setRoot",value:function(){var e=this.getValue();this.treeRoot=new s.default(null,e,{isNew:!!this.builderMode||!e.data,createComponents:this.createComponents.bind(this),checkNode:this.checkNode.bind(this,this.data),removeComponents:this.removeComponents,parentPath:this.isDefaultValueComponent?this.path||this.component.key:null}),this.hook("tree.setRoot",{root:this.treeRoot,component:this}),this.redraw()}},{key:"getValue",value:function(){return this.dataValue||{}}},{key:"updateTree",value:function(){this.updateValue(this.treeRoot.value),this.redraw()}},{key:"checkData",value:function(e,t,n){return this.checkNode(e,this.treeRoot,t,n)}},{key:"checkNode",value:function(e,t,n,r){var o=this;return t.children.reduce((function(t,i){return o.checkNode(e,i,n,r)&&t}),b(O(v.prototype),"checkData",this).call(this,e,n,t.data,t.components)&&!t.editing&&!t.new)}},{key:"getComponents",value:function(){return this.treeRoot&&(this.isDefaultValueComponent||!this.isDefaultValueComponent&&!this.builderMode)?this.treeRoot.getComponents():b(O(v.prototype),"getComponents",this).call(this)}},{key:"getValueAsString",value:function(e,t){if(null!=t&&t.email){var n="";return n+=function e(t){var n,r,o='\n \n \n ';return o+="\n \n ",o+=Object.keys(t.data).map((function(e){return'\n \n \n \n ",o+="\n \n
    '.concat(e,'\n ').concat(t.data[e],"\n
    \n ")})),0!==(null===(n=t.children)||void 0===n?void 0:n.length)&&(null===(r=t.children)||void 0===r||r.forEach((function(t){o+=e(t)}))),o+="\n
    \n "}(e),n}return b(O(v.prototype),"getValueAsString",this).call(this,e,t)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ncustom component documentation.',type:"htmlelement",weight:5},{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"componentJson",label:"Custom Element JSON",tooltip:"Enter the JSON for this custom element."}]},81541:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:"".concat(o.default.getApiUrl(),"/externalModules.js"),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"externalModules";o.default.requireLibrary(t,t,e,!0).then((function(e){o.default.use(e)}))},o.default.Components=l.default,o.default.Templates=u.default,o.default.Builders=a.default,o.default.Utils=g.default,o.default.Form=b.default,o.default.Displays=s.default,o.default.Providers=c.default,o.default.Rules=f.default,o.default.Widgets=v.default,o.default.Evaluator=w.default,o.default.Conjunctions=d.default,o.default.Operators=p.default,o.default.QuickRules=h.default,o.default.Transformers=m.default,o.default.ValueSources=y.default,o.default.AllComponents=i.default,o.default.Licenses=k.default,o.default.Formio=o.default,o.default.Components.setComponents(i.default);var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===_(e))for(var n=0,i=Object.keys(e);n1&&void 0!==arguments[1]?arguments[1]:{};(e=r.default.isArray(e)?e:[e]).forEach((function(e){Array.isArray(e)?e.forEach((function(e){return S(e,t)})):S(e,t)}))}},68204:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6701))&&r.__esModule?r:{default:r},i={lng:"en",nsSeparator:"::",keySeparator:".|.",pluralSeparator:"._.",contextSeparator:"._.",resources:{en:{translation:(0,n(82531).fastCloneDeep)(o.default)}}};t.default=i},69078:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var n=0;n=u)for(;u>>0,"object"===r(e[o])?e[o].baseVal=a.join(" "):e[o]=a.join(" "),f())},i.remove=function(){d.apply(i,t=arguments);for(var t,n={},u=0,c=[];u>>0,"object"===r(e[o])?e[o].baseVal=a.join(" "):e[o]=a.join(" "),f()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):l[e]?(i.remove(e),!1):(i.add(e),!0)},i}}();"DOMTokenList"in e&&(!("classList"in(s=document.createElement("x")))||!s.classList.toggle("x",!1)&&!s.className)||("DOMTokenList"in(l=e)&&l.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(l.DOMTokenList=u),function(){var e=document.createElement("span");"classList"in e&&(e.classList.toggle("x",!1),e.classList.contains("x")&&(e.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var r=!this.contains(e);return this[r?"add":"remove"](e),r}return this[(n=!!n)?"add":"remove"](e),n}))}(),function(){var e=document.createElement("span");if("classList"in e&&(e.classList.add("a","b"),!e.classList.contains("b"))){var t=e.classList.constructor.prototype.add;e.classList.constructor.prototype.add=function(){for(var e=arguments,n=arguments.length,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.beforeMergeOptions(t),this.options=o.default.merge({},this.defaultOptions,t)}var t,n,r;return t=e,n=[{key:"beforeMergeOptions",value:function(){}},{key:"defaultOptions",get:function(){return{}}},{key:"queryProperty",get:function(){return"query"}},{key:"responseProperty",get:function(){return null}},{key:"displayValueProperty",get:function(){return null}},{key:"serialize",value:function(e){return o.default.toPairs(e).map((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(i))})).join("&")}},{key:"getRequestOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o.default.merge({},this.options,e)}},{key:"getRequestUrl",value:function(){throw new Error("Method AddressProvider#getRequestUrl(options) is abstract.")}},{key:"makeRequest",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.GlobalFormio.makeStaticRequest(this.getRequestUrl(e),"GET",null,{noToken:!0})}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRequestOptions(n),i=r.params=r.params||{};return i[this.queryProperty]=e,this.makeRequest(r).then((function(e){return t.responseProperty?o.default.get(e,t.responseProperty,[]):e}))}},{key:"getDisplayValue",value:function(e){return this.displayValueProperty?o.default.get(e,this.displayValueProperty,""):String(e)}}],r=[{key:"name",get:function(){return"address"}},{key:"displayName",get:function(){return"Address"}}],n&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.AddressProvider=c},25823:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params;return"https://atlas.microsoft.com/search/address/json?".concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"azure"}},{key:"displayName",get:function(){return"Azure Maps"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6542).AddressProvider);t.AzureAddressProvider=u},45555:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params,n=e.url;return"".concat(n,"?").concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"custom"}},{key:"displayName",get:function(){return"Custom"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(n(6542).AddressProvider);t.CustomAddressProvider=f},7763:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleAddressProvider=void 0,n(73210),n(89554),n(41539),n(54747),n(5212),n(68304),n(24812),n(30489);var o=n(19161),i=s(n(96486)),a=n(6542),l=s(n(91459));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};u(this,m),(t=h.call(this,n)).setAutocompleteOptions();var r="https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&callback=googleMapsCallback";return null!==(e=n.params)&&void 0!==e&&e.key&&(r+="&key=".concat(n.params.key)),o.GlobalFormio.requireLibrary(t.getLibraryName(),"google.maps.places",r),t}return t=m,r=[{key:"name",get:function(){return"google"}},{key:"displayName",get:function(){return"Google Maps"}}],(n=[{key:"displayValueProperty",get:function(){return"formattedPlace"}},{key:"alternativeDisplayValueProperty",get:function(){return"formatted_address"}},{key:"autocompleteOptions",get:function(){return this._autocompleteOptions},set:function(e){this._autocompleteOptions=e}},{key:"setAutocompleteOptions",value:function(){var e=i.default.get(this.options,"params.autocompleteOptions",{});i.default.isObject(e)||(e={}),this.addRequiredProviderOptions(e),this.autocompleteOptions=e}},{key:"beforeMergeOptions",value:function(e){this.convertRegionToAutocompleteOption(e)}},{key:"getLibraryName",value:function(){return"googleMaps"}},{key:"convertRegionToAutocompleteOption",value:function(e){var t=e,n=i.default.get(t,"params.region","");if(n&&!i.default.has(e,"params.autocompleteOptions")){var r={UK:"GB"};r[n=n.toUpperCase().trim()]&&(n=r[n]),i.default.set(t,"params.autocompleteOptions.componentRestrictions.country",[n])}}},{key:"getRequiredAddressProperties",value:function(){return["address_components","formatted_address","geometry","place_id","plus_code","types"]}},{key:"addRequiredProviderOptions",value:function(e){var t=this.getRequiredAddressProperties();i.default.isArray(e.fields)&&e.fields.length>0&&e.fields.forEach((function(e){t.some((function(t){return e===t}))||t.push(e)})),e.fields=t}},{key:"filterPlace",value:function(e){e=e||{};var t={};return this.autocompleteOptions&&this.autocompleteOptions.fields.forEach((function(n){e[n]&&(t[n]=e[n])})),t}},{key:"attachAutocomplete",value:function(e,t,n){var r=this;o.GlobalFormio.libraryReady(this.getLibraryName()).then((function(){var o=new google.maps.places.Autocomplete(e,r.autocompleteOptions);o.addListener("place_changed",(function(){var a=r.filterPlace(o.getPlace());a.formattedPlace=i.default.get(o,"gm_accessors_.place.se.formattedPrediction",a[r.alternativeDisplayValueProperty]),n(a,e,t)}))}))}},{key:"search",value:function(){return l.default.resolve()}},{key:"makeRequest",value:function(){return l.default.resolve()}},{key:"getDisplayValue",value:function(e){var t=i.default.has(e,this.displayValueProperty)?this.displayValueProperty:this.alternativeDisplayValueProperty;return i.default.get(e,t,"")}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),m}(a.AddressProvider);t.GoogleAddressProvider=h},21680:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params;return"https://nominatim.openstreetmap.org/search?".concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"nominatim"}},{key:"displayName",get:function(){return"OpenStreetMap Nominatim"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6542).AddressProvider);t.NominatimAddressProvider=u},56499:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(96649),n(96078),n(82526),n(41817),n(41539),n(9653),n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var o,i=n(25823),a=n(45555),l=n(7763),s=n(21680);function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=(u(o={},i.AzureAddressProvider.name,i.AzureAddressProvider),u(o,a.CustomAddressProvider.name,a.CustomAddressProvider),u(o,l.GoogleAddressProvider.name,l.GoogleAddressProvider),u(o,s.NominatimAddressProvider.name,s.NominatimAddressProvider),o);t.default=c},49452:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={}},10695:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=n(89738))&&r.__esModule?r:{default:r}).default;t.default=o},82302:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var r,o=(r=n(91459))&&r.__esModule?r:{default:r};t.default=function(e,t){return function(n,r){return new o.default((function(o,i){var a=new XMLHttpRequest;a.onerror=function(e){e.networkError=!0,i(e)},a.onabort=function(e){e.networkError=!0,i(e)},a.onload=function(){if(a.status>=200&&a.status<300){var e=a.getResponseHeader("Content-Type")||n.type;o(new File([a.response],n.name,{type:e}))}else i(a.response||"Unable to process file")},a.onabort=i,a.open("POST",t.url);var l=e.getToken();l&&a.setRequestHeader("x-jwt-token",l),a.responseType="arraybuffer";var s=new FormData;s.append("file",n),s.append("processorOptions",JSON.stringify(t.options||{})),s.append("options",JSON.stringify(r||{})),a.send(s)}))}}},64666:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(73210),n(68309);var r,o=(r=n(3975))&&r.__esModule?r:{default:r},i=function(e){return{uploadFile:function(t,n,r,i,a,l,s,u,c,f){return o.default.upload(e,"azure",(function(e,n){return e.openAndSetHeaders("PUT",n.url),e.setRequestHeader("Content-Type",t.type),e.setRequestHeader("x-ms-blob-type","BlockBlob"),t}),t,n,r,i,u,c,f).then((function(){return{storage:"azure",name:o.default.path([r,n]),size:t.size,type:t.type,groupPermissions:u,groupId:c}}))},downloadFile:function(t){return e.makeRequest("file","".concat(e.formUrl,"/storage/azure?name=").concat(o.default.trim(t.name)),"GET")}}};i.title="Azure File Services";var a=i;t.default=a},52174:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(91459))&&r.__esModule?r:{default:r},i=function(){return{title:"Base64",name:"base64",uploadFile:function(e,t){var n=this,r=new FileReader;return new o.default((function(o,i){r.onload=function(n){var r=n.target.result;o({storage:"base64",name:t,url:r,size:e.size,type:e.type})},r.onerror=function(){return i(n)},r.readAsDataURL(e)}))},downloadFile:function(e){return o.default.resolve(e)}}};i.title="Base64";var a=i;t.default=a},37771:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222);var r,o=(r=n(91459))&&r.__esModule?r:{default:r},i=n(3975),a=function(e){return{uploadFile:function(t,n,r,a,l,s,u,c,f,d){return new o.default((function(o,l){var s=new XMLHttpRequest;"function"==typeof a&&(s.upload.onprogress=a),"function"==typeof d&&d((function(){return s.abort()}));var u=new FormData;u.append("name",n),u.append("dir",r),u.append("file",t),s.onerror=function(e){e.networkError=!0,l(e)},s.onload=function(){if(s.status>=200&&s.status<300){var e=JSON.parse(s.response);e.storage="googledrive",e.size=t.size,e.type=t.type,e.groupId=f,e.groupPermissions=c,o(e)}else l(s.response||"Unable to upload file")},s.onabort=l,s.open("POST","".concat(e.formUrl,"/storage/gdrive")),(0,i.setXhrHeaders)(e,s);var p=e.getToken();p&&s.setRequestHeader("x-jwt-token",p),s.send(u)}))},downloadFile:function(t){var n=e.getToken();return t.url="".concat(e.formUrl,"/storage/gdrive?fileId=").concat(t.id,"&fileName=").concat(t.originalName).concat(n?"&x-jwt-token=".concat(n):""),o.default.resolve(t)}}};a.title="Google Drive";var l=a;t.default=l},34198:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(52174)),o=u(n(87527)),i=u(n(64666)),a=u(n(7433)),l=u(n(3769)),s=u(n(37771));function u(e){return e&&e.__esModule?e:{default:e}}var c={base64:r.default,s3:o.default,url:a.default,azure:i.default,indexeddb:l.default,googledrive:s.default};t.default=c},3769:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var r,o=n(67429),i=(r=n(91459))&&r.__esModule?r:{default:r},a=function(){return{title:"indexedDB",name:"indexeddb",uploadFile:function(e,t,n,r,a,l){var s=this;if("indexedDB"in window)return new i.default((function(e){var t=indexedDB.open(l.indexeddb,3);t.onsuccess=function(t){var n=t.target.result;e(n)},t.onupgradeneeded=function(e){e.target.result.createObjectStore(l.indexeddbTable)}})).then((function(t){var n=new FileReader;return new i.default((function(r,i){n.onload=function(){var n=new Blob([e],{type:e.type}),i=(0,o.v4)(n),s={id:i,data:n,name:e.name,size:e.size,type:e.type,url:a},u=t.transaction([l.indexeddbTable],"readwrite");u.objectStore(l.indexeddbTable).put(s,i).onerror=function(e){console.log("error storing data"),console.error(e)},u.oncomplete=function(){r({storage:"indexeddb",name:e.name,size:e.size,type:e.type,url:a,id:i})}},n.onerror=function(){return i(s)},n.readAsDataURL(e)}))}));console.log("This browser doesn't support IndexedDB")},downloadFile:function(e,t){var n=this;return new i.default((function(e){indexedDB.open(t.indexeddb,3).onsuccess=function(t){var n=t.target.result;e(n)}})).then((function(r){return new i.default((function(o,i){var a=r.transaction([t.indexeddbTable],"readonly"),l=a.objectStore(t.indexeddbTable).get(e.id);l.onsuccess=function(){a.oncomplete=function(){var t=l.result,r=new File([l.result.data],e.name,{type:l.result.type}),a=new FileReader;a.onload=function(n){t.url=n.target.result,t.storage=e.storage,o(t)},a.onerror=function(){return i(n)},a.readAsDataURL(r)}},l.onerror=function(){return i(n)}}))}))},deleteFile:function(e,t){var n=this;return new i.default((function(e){indexedDB.open(t.indexeddb,3).onsuccess=function(t){var n=t.target.result;e(n)}})).then((function(r){return new i.default((function(o,i){var a=r.transaction([t.indexeddbTable],"readwrite"),l=a.objectStore(t.indexeddbTable).delete(e.id);l.onsuccess=function(){a.oncomplete=function(){var e=l.result;o(e)}},l.onerror=function(){return i(n)}}))}))}}};a.title="IndexedDB";var l=a;t.default=l},87527:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(69070),n(82526),n(41817),n(32165),n(66992),n(78783),n(33948),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(68309),n(68304),n(65069),n(96649),n(96078),n(9653),n(57327),n(38880),n(49337),n(33321),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(79753),n(89554),n(41539),n(54747),n(47941),n(88674),n(74916),n(4723),n(47042),n(92222),n(73210);var o=l(n(91459)),i=l(n(3975)),a=n(99887);function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function d(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)}))}}var h=window.AbortController||n(65988);function m(e){return{uploadFile:function(t,n,r,o,l,s,u,c,d,m,y){var v=this;return p(f().mark((function l(){var s,u;return f().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return s=function(){var e=p(f().mark((function e(o,l,s){var u,c,d,p,m;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.data.fileName=n,l.data.key=i.default.path([l.data.key,r,n]),!l.signed){e.next=29;break}if(!y||!Array.isArray(l.signed)){e.next=23;break}return u=new h,c=u.signal,"function"==typeof s&&s((function(){return u.abort()})),e.prev=7,e.next=10,v.uploadParts(t,l.signed,l.data.headers,l.partSizeActual,y,c);case 10:return d=e.sent,e.next=13,(0,a.withRetries)(v.completeMultipartUpload,[l,d,y],3);case 13:return e.abrupt("return");case 16:throw e.prev=16,e.t0=e.catch(7),u.abort(),v.abortMultipartUpload(l),e.t0;case 21:e.next=27;break;case 23:return o.openAndSetHeaders("PUT",l.signed),o.setRequestHeader("Content-Type",t.type),l.data.headers&&Object.keys(l.data.headers).forEach((function(e){o.setRequestHeader(e,l.data.headers[e])})),e.abrupt("return",t);case 27:e.next=34;break;case 29:for(m in p=new FormData,l.data)p.append(m,l.data[m]);return p.append("file",t),o.openAndSetHeaders("POST",l.url),e.abrupt("return",p);case 34:case"end":return e.stop()}}),e,null,[[7,16]])})));return function(t,n,r){return e.apply(this,arguments)}}(),l.next=3,i.default.upload(e,"s3",s,t,n,r,o,c,d,m,y);case 3:return u=l.sent,l.abrupt("return",{storage:"s3",name:n,bucket:u.bucket,key:u.data.key,url:i.default.path([u.url,u.data.key]),acl:u.data.acl,size:t.size,type:t.type});case 5:case"end":return l.stop()}}),l)})))()},completeMultipartUpload:function(t,n,r){return p(f().mark((function o(){var i,a,l,s;return f().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=r.changeMessage,a=e.getToken(),i("Completing AWS S3 multipart upload..."),o.next=5,fetch("".concat(e.formUrl,"/storage/s3/multipart/complete"),{method:"POST",headers:u({"Content-Type":"application/json"},a?{"x-jwt-token":a}:{}),body:JSON.stringify({parts:n,uploadId:t.uploadId,key:t.key})});case 5:return l=o.sent,o.next=8,l.text();case 8:if(s=o.sent,l.ok){o.next=11;break}throw new Error(s||l.statusText);case 11:if(null==s||!s.match(/Error/)){o.next=13;break}throw new Error(s);case 13:case"end":return o.stop()}}),o)})))()},abortMultipartUpload:function(t){var n=t.uploadId,r=t.key,o=e.getToken();fetch("".concat(e.formUrl,"/storage/s3/multipart/abort"),{method:"POST",headers:u({"Content-Type":"application/json"},o?{"x-jwt-token":o}:{}),body:JSON.stringify({uploadId:n,key:r})}).catch((function(e){return console.error("Error while aborting multipart upload:",e)}))},uploadParts:function(e,t,n,r,i,a){var l=i.changeMessage,s=i.progressCallback;l("Chunking and uploading parts to AWS S3...");for(var u=[],c=function(o){var i=o*r,l=(o+1)*r,c=o=200&&c.status<300){var e={};try{e=(e="string"==typeof c.response?JSON.parse(c.response):{})&&e.data?e.data:e}catch(t){e={}}var r=e.hasOwnProperty("url")?e.url:"".concat(c.responseURL,"/").concat(n);r&&"/"===r[0]&&(r="".concat(t).concat(r)),i({url:r,data:e})}else u(c.response||"Unable to upload file")},c.onerror=function(){return u(c)},c.onabort=function(){return u(c)};var h=t+(t.indexOf("?")>-1?"&":"?");for(var m in r)h+="".concat(m,"=").concat(r[m],"&");"&"===h[h.length-1]&&(h=h.substr(0,h.length-1)),c.open("POST",h),f&&c.setRequestHeader("Content-Type","application/json");var y=e.getToken();if(y&&c.setRequestHeader("x-jwt-token",y),a){var v="string"==typeof a?JSON.parse(a):a;for(var b in v)if("headers"===b){var g=v.headers;for(var w in g)c.setRequestHeader(w,g[w])}else c[b]=v[b]}c.send(f?o:d)}))};return{title:"Url",name:"url",uploadFile:function(n,r,o,i,l,s,u,c,f,d){var p=function(c){var f;return t(l,r,{baseUrl:encodeURIComponent(e.projectUrl),project:c?c.project:"",form:c?c._id:""},(f={},a(f,u,n),a(f,"name",r),a(f,"dir",o),f),s,i,d).then((function(t){return t.data=t.data||{},t.data.baseUrl=e.projectUrl,t.data.project=c?c.project:"",t.data.form=c?c._id:"",{storage:"url",name:r,url:t.url,size:n.size,type:n.type,data:t.data}}))};return n.private&&e.formId?e.loadForm().then((function(e){return p(e)})):p()},deleteFile:function(e){return new i.default((function(t,n){var r=new XMLHttpRequest;r.open("DELETE",e.url,!0),r.onload=function(){r.status>=200&&r.status<300?t("File deleted"):n(r.response||"Unable to delete file")},r.send(null)}))},downloadFile:function(n){return n.private?(e.submissionId&&n.data&&(n.data.submission=e.submissionId),t(n.url,n.name,{},JSON.stringify(n)).then((function(e){return e.data}))):i.default.resolve(n)}}};l.title="Url";var s=l;t.default=s},99887:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),l=new x(r||[]);return i(a,"_invoke",{value:_(e,n,l)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function h(){}function m(){}function y(){}var v={};c(v,l,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(E([])));g&&g!==t&&n.call(g,l)&&(v=g);var w=y.prototype=h.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function o(i,a,l,s){var u=d(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==r(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,l,s)}),(function(e){o("throw",e,l,s)})):t.resolve(f).then((function(e){c.value=e,l(c)}),(function(e){return o("throw",e,l,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=d(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function E(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==l[2]?l[2]:3,a=l.length>3&&void 0!==l[3]?l[3]:null,r){e.next=4;break}throw new Error(a);case 4:return e.abrupt("return",t.apply(void 0,i(n)).catch((function(){return u(t,n,r-1,a)})));case 5:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)}n(79753),n(82526),n(41817),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(68309),n(74916),n(69070),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(89554),n(54747),n(68304),n(65069),Object.defineProperty(t,"__esModule",{value:!0}),t.withRetries=u,n(41539),n(88674)},3975:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(96649),n(96078),n(82526),n(41817),n(9653),n(69070),n(47941),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(68309),n(68304),n(65069),n(47042),Object.defineProperty(t,"__esModule",{value:!0}),t.setXhrHeaders=t.default=void 0,n(69600),n(21249),n(57327),n(41539),n(73210),n(88674),n(92222);var o=a(n(91459)),i=a(n(92742));function a(e){return e&&e.__esModule?e:{default:e}}function l(){l=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),l=new x(r||[]);return o(a,"_invoke",{value:_(e,n,l)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function h(){}function m(){}function y(){}var v={};c(v,a,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(E([])));g&&g!==t&&n.call(g,a)&&(v=g);var w=y.prototype=h.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function i(o,a,l,s){var u=d(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==r(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,l,s)}),(function(e){i("throw",e,l,s)})):t.resolve(f).then((function(e){c.value=e,l(c)}),(function(e){return i("throw",e,l,s)}))}s(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=d(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t=200&&s.status<300)a(n);else if(504===s.status){var e=new Error("Network request failed");e.networkError=!0,l(e)}else l(s.response||"Unable to upload file")},s.send(e)})).catch(l)}))}},h=p;t.default=h},51508:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=i(n(75146)),o=i(n(96486));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,t){for(var n=0;n\n ',e.component.disableClearIcon||(n+='\n \n '),n+="\n \n"}return n+="\n",e.self.manualModeEnabled&&(n+='\n
    \n \n
    \n"),n+="\n",e.self.manualMode&&(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"),n+"\n"}},87302:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.displayValue?n+=null==(t=e.displayValue)?"":t:n+="-",n+"
    \n"}},45284:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(4295)),o=i(n(87302));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},34801:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="'+(null==(t=e.t("errorListHotkey"))?"":t)+"\n "),n+"\n\n"}},75284:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(34801))&&r.__esModule?r:{default:r}).default};t.default=o},3824:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},15590:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(3824))&&r.__esModule?r:{default:r}).default};t.default=o},6e4:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.disableBuilderActions||(n+='\n
    \n \n \n
    \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),n+"\n "+(null==(t=e.html)?"":t)+"\n\n"}},14943:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(6e4))&&r.__esModule?r:{default:r}).default};t.default=o},15858:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},89298:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(15858))&&r.__esModule?r:{default:r}).default};t.default=o},47995:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title,{_userInput:!0}))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+"

    \n
    \n ",e.helplinks&&(n+='\n \n "),n+='\n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n
    \n

    '+(null==(t=e.t("Preview"))?"":t)+'

    \n
    \n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n
    \n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.t(e.componentInfo.help))?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},74798:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47995))&&r.__esModule?r:{default:r}).default};t.default=o},72807:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n '+(null==(t=e.t("Drag and Drop a form component"))?"":t)+"\n\n"}},65181:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(72807))&&r.__esModule?r:{default:r}).default};t.default=o},42904:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n
    \n"}},98953:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(42904))&&r.__esModule?r:{default:r}).default};t.default=o},96746:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",!e.group.componentOrder||e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n"}},31440:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(96746))&&r.__esModule?r:{default:r}).default};t.default=o},41737:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n
    \n"}},19838:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(41737))&&r.__esModule?r:{default:r}).default};t.default=o},26982:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="<"+(null==(t=e.input.type)?"":t)+'\n ref="button"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n ",e.component.description&&(n+='\n aria-describedby="d-'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n '),n+="\n>\n",e.component.leftIcon&&(n+=' '),n+="\n"+(null==(t=e.input.content)?"":t)+"\n",e.component.tooltip&&(n+='\n \n'),n+="\n",e.component.rightIcon&&(n+=' '),n+"\n\n
    \n \n
    \n'}},35858:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"\n"}},40707:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(26982)),o=i(n(35858));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},18952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='
    \n \n ",e.component.tooltip&&(n+='\n \n '),n+"\n
    \n"}},24609:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n
    ',e.checked?n+="True":n+="False",n+"
    \n"}},28569:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(18952)),o=i(n(24609));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},89199:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},36567:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(89199))&&r.__esModule?r:{default:r}).default};t.default=o},8404:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+'\n
    \n '),n+"\n
    \n"}},28857:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(8404))&&r.__esModule?r:{default:r}).default};t.default=o},64229:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n
    \n
    '+(null==(t=e.t(e.component.label))?"":t)+(null==(t=e.self.isIE()?", dialog":"")?"":t)+"\n ",e.options.vpat?n+='\n \n ':n+='\n \n ',n+='\n
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+"\n "),n+='\n
    \n ',e.options.vpat&&(n+='\n \n "),n+'\n \n
    \n
    \n
    \n \n
    \n
    \n'}},6311:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(64229))&&r.__esModule?r:{default:r}).default};t.default=o},16499:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+((null==(t=e.children.join(""))?"":t)+"\n")}},16056:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(16499))&&r.__esModule?r:{default:r}).default};t.default=o},46441:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"}},64401:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(46441))&&r.__esModule?r:{default:r}).default};t.default=o},25486:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={"border-default":"","formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active","formio-form-error":"formio-error-wrapper has-message","formio-form-alert":"alert alert-danger","formio-label-error":"","formio-input-error":"","formio-alert-danger":"alert alert-danger","formio-alert-success":"alert alert-success","formio-alert-warning":"alert alert-warning","formio-modal-cancel-button":"btn btn-danger formio-dialog-button","formio-modal-confirm-button":"btn btn-primary formio-dialog-button"}},79025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+='\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",!e.builder&&e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n '+(null==(t=e.t("Add/Remove"))?"":t)+"\n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n "+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},79822:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.hasHeader&&(n+="\n \n \n ",e.columns.forEach((function(r){n+='\n \n "})),n+="\n \n \n "),n+="\n \n ",e.rows.forEach((function(r){n+="\n \n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n
    \n '+(null==(t=r[o.key])?"":t)+"\n
    \n"}},27915:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(79025)),o=i(n(79822));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},62796:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n "),n+="\n
    "+(null==(t=e.day)?"":t)+"
    \n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+'\n\n\n'}},11594:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(62796))&&r.__esModule?r:{default:r}).default};t.default=o},63645:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n \n
    \n'}},10158:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(63645))&&r.__esModule?r:{default:r}).default};t.default=o},9665:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},46248:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},21838:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(9665)),o=i(n(46248));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},82064:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n ',e.header&&(n+='\n \n '+(null==(t=e.header)?"":t)+"\n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+='\n \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n \n "),n+="\n ",e.errors[o]&&(n+='\n \n "),n+="\n \n "})),n+="\n \n ",e.footer&&(n+="\n \n \n "+(null==(t=e.footer)?"":t)+"\n \n \n "),n+="\n
    \n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n
    \n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n
    \n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},84940:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n ',e.header&&(n+='\n \n '+(null==(t=e.header)?"":t)+"\n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+='\n \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n \n "),n+="\n ",e.errors[o]&&(n+='\n \n "),n+="\n \n "})),n+="\n \n ",e.footer&&(n+="\n \n \n "+(null==(t=e.footer)?"":t)+"\n \n \n "),n+="\n
    \n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n
    \n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n
    \n
    \n"}},5342:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(82064)),o=i(n(84940));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},92161:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"\n ",e.options.vpat&&(n+='\n \n '),n+="\n

    \n
      \n ",e.errors.forEach((function(e){n+='\n
    • \n \n '+(null==(t=e.message)?"":t)+"\n \n
    • \n "})),n+="\n
    \n"}},21337:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(92161))&&r.__esModule?r:{default:r}).default};t.default=o},21193:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},81336:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},77703:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(81336)),o=i(n(21193));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,align:o.default};t.default=a},3677:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="
    \n ",e.component.legend&&(n+='\n \n '+(null==(t=e.t(e.component.legend,{_userInput:!0}))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n \n "),n+="\n ",e.collapsed||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},2619:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(3677))&&r.__esModule?r:{default:r}).default};t.default=o},99748:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.options.vpat&&(n+='\n \n'),n+="\n",e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+="\n ",e.options.vpat&&(n+="\n
    "+(null==(t=e.component.filePattern&&"*"!==e.component.filePattern?e.t("Allowed file types: ")+e.component.filePattern:"Any file types are allowed")?"":t)+"
    \n "),n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      \n '+(null==(t=e.t("Press to open "))?"":t)+""+(null==(t=r.originalName||r.name)?"":t)+"\n \n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n \n '),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'\n \n '+(null==(t=e.t("Remove button. Press to remove "+r.originalName||0))?"":t)+'\n '+(null==(t=r.message?r.message.replace(";","."):"")?"":t)+'\n \n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},10910:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(99748))&&r.__esModule?r:{default:r}).default};t.default=o},80692:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="<"+(null==(t=e.tag)?"":t)+' class="formio-component-htmlelement '+(null==(t=e.component.className)?"":t)+'" ref="html"\n ',e.attrs.forEach((function(e){n+="\n "+(null==(t=e.attr)?"":t)+'="'+(null==(t=e.value)?"":t)+'"\n '})),n+="\n>"+(null==(t=e.t(e.content))?"":t),e.singleTags&&-1!==e.singleTags.indexOf(e.tag)||(n+=""),n+="\n"}},28209:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(80692))&&r.__esModule?r:{default:r}).default};t.default=o},72663:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},34885:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(72663))&&r.__esModule?r:{default:r}).default};t.default=o},64968:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),t.default=function(e,t,n){if("fa"===e)switch(t){case"save":t="download";break;case"zoom-in":t="search-plus";break;case"zoom-out":t="search-minus";break;case"question-sign":t="question-circle";break;case"remove-circle":t="times-circle-o";break;case"new-window":t="window-restore";break;case"move":t="arrows";break;case"time":t="clock-o"}return n?"".concat(e," ").concat(e,"-").concat(t," ").concat(e,"-spin"):"".concat(e," ").concat(e,"-").concat(t)}},5508:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(83710),n(41539),n(39714),n(96649),n(96078),n(82526),n(41817),n(9653);var r=pe(n(45284)),o=pe(n(15590)),i=pe(n(14943)),a=pe(n(89298)),l=pe(n(74798)),s=pe(n(65181)),u=pe(n(98953)),c=pe(n(31440)),f=pe(n(19838)),d=pe(n(40707)),p=pe(n(28569)),h=pe(n(36567)),m=pe(n(28857)),y=pe(n(6311)),v=pe(n(16056)),b=pe(n(42142)),g=pe(n(64401)),w=pe(n(27915)),k=pe(n(11594)),O=pe(n(10158)),_=pe(n(21838)),S=pe(n(5342)),P=pe(n(77703)),j=pe(n(2619)),x=pe(n(10910)),E=pe(n(28209)),C=pe(n(34885)),A=pe(n(64968)),T=pe(n(98781)),M=pe(n(59811)),R=pe(n(38304)),D=pe(n(97028)),I=pe(n(56105)),L=pe(n(40822)),V=pe(n(75441)),N=pe(n(20073)),F=pe(n(44857)),B=pe(n(87505)),U=pe(n(5392)),z=pe(n(32878)),H=pe(n(2265)),q=pe(n(40486)),W=pe(n(24628)),K=pe(n(80247)),Y=pe(n(80411)),G=pe(n(36236)),$=pe(n(58830)),J=pe(n(3246)),X=pe(n(4287)),Z=pe(n(40708)),Q=pe(n(67741)),ee=pe(n(75401)),te=pe(n(1)),ne=pe(n(29304)),re=pe(n(56429)),oe=pe(n(13380)),ie=pe(n(41345)),ae=pe(n(187)),le=pe(n(88057)),se=pe(n(75273)),ue=pe(n(24376)),ce=pe(n(25486)),fe=pe(n(21337)),de=pe(n(75284));function pe(e){return e&&e.__esModule?e:{default:e}}function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n","datetime"===e.component.type&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n \n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n \n"),n+="\n",(e.component.showCharCount||e.component.showWordCount)&&(n+='\n
    \n ',e.component.showCharCount&&(n+='\n \n '),n+="\n ",e.component.showWordCount&&(n+='\n \n '),n+="\n
    \n"),n+"\n"}},19423:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},98781:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(62247)),o=i(n(19423));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ","number"!==e.component.type&&"phoneNumber"!==e.component.type&&"currency"!==e.component.type||(n+='\n , '+(null==(t=e.t("numeric only"))?"":t)+",\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+"\n\n"}},59811:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(2025))&&r.__esModule?r:{default:r}).default};t.default=o},76904:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n
    \n'}},38304:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(76904))&&r.__esModule?r:{default:r}).default};t.default=o},71956:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"Loading...\n"}},97028:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(71956))&&r.__esModule?r:{default:r}).default};t.default=o},31597:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n'}},56105:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(31597))&&r.__esModule?r:{default:r}).default};t.default=o},46742:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.message)?"":t)+"
    \n"}},40822:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(46742))&&r.__esModule?r:{default:r}).default};t.default=o},47190:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\n\n '+(null==(t=e.previewText)?"":t)+'\n\n
    \n '+(null==(t=e.messages)?"":t)+"\n
    \n"}},44857:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47190))&&r.__esModule?r:{default:r}).default};t.default=o},34585:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n '+(null==(t=e.t("Close"))?"":t)+'\n \n
    \n
    \n
    \n'}},75441:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(34585))&&r.__esModule?r:{default:r}).default};t.default=o},16160:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n \n \n \n
    '+(null==(t=e.content)?"":t)+"
    \n
    \n"}},20073:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(16160))&&r.__esModule?r:{default:r}).default};t.default=o},31737:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},5392:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(31737))&&r.__esModule?r:{default:r}).default};t.default=o},47935:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},32878:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47935))&&r.__esModule?r:{default:r}).default};t.default=o},33793:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='\n '+(null==(t=e.label)?"":t)+"\n "})),n+='\n \n \n \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n \n \n "),n+="\n ",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n\n"}},2265:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47760))&&r.__esModule?r:{default:r}).default};t.default=o},52342:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\t\n\t\t\n\t\n\t\n\t\t\n\t\n
    \n '+(null==(t=e.submitButton)?"":t)+"\n
    \n"}},40486:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(52342))&&r.__esModule?r:{default:r}).default};t.default=o},67384:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n\t
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},24628:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(67384))&&r.__esModule?r:{default:r}).default};t.default=o},47733:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n

    '+(null==(t=e.t("Upload a PDF File"))?"":t)+'

    \n \n
    \n \n '+(null==(t=e.t("Drop pdf to start, or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+'\n \n \n
    \n
    \n\n
    \n
    \n\n'}},80247:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47733))&&r.__esModule?r:{default:r}).default};t.default=o},36564:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n "})),n+="\n\n"}},92635:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label,{_userInput:!0})})).join(", "))?"":t)+"\n
    \n"}},80411:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(36564)),o=i(n(92635));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},59464:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},36236:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(59464))&&r.__esModule?r:{default:r}).default};t.default=o},99291:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+=''+(null==(t=e.selectOptions)?"":t)+'\n\n'}},29645:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.self.itemValueForHTMLMode(e.value))?"":t:n+="-",n+"
    \n"}},58830:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(99291)),o=i(n(29645));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},37040:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="\n"}},89741:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.selected&&(n+=null==(t=e.t(e.option.label,{_userInput:!0}))?"":t),n+"\n"}},3246:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(37040)),o=i(n(89741));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},66272:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},47044:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},4287:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(66272)),o=i(n(47044));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},79419:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n
    \n "+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n \n \n
    \n"}},80188:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},40708:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(79419)),o=i(n(80188));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},61915:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n
    \n
    \n

    '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+'

    \n
    \n \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n \n"})),n+="\n"}},78395:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n
    \n ",e.component.components.forEach((function(r,o){n+='\n \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n "})),n+="\n\n"}},67741:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(61915)),o=i(n(78395));function i(e){return e&&e.__esModule?e:{default:e}}var a={flat:r.default,form:o.default};t.default=a},13381:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ",e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    '+(null==(t=e.t(e.component.label))?"":t)+"
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},75401:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(13381))&&r.__esModule?r:{default:r}).default};t.default=o},81863:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.children.forEach((function(e){n+='\n \n '+(null==(t=e)?"":t)+"\n \n"})),n+="\n"}},42142:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(81863))&&r.__esModule?r:{default:r}).default};t.default=o},45568:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.node.isRoot?n+='\n
    \n':n+='\n
  • \n',n+="\n ",e.content&&(n+='\n
    \n '+(null==(t=e.content)?"":t)+"\n
    \n "),n+="\n ",e.childNodes&&e.childNodes.length&&(n+='\n
      \n '+(null==(t=e.childNodes.join(""))?"":t)+"\n
    \n "),n+="\n",e.node.isRoot?n+="\n
  • \n":n+="\n \n",n+"\n"}},1:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(45568))&&r.__esModule?r:{default:r}).default};t.default=o},62720:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    '+(null==(t=e.children)?"":t)+"
    \n ",e.readOnly||(n+='\n
    \n \n \n
    \n "),n+"\n
    \n"}},29304:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(62720));function o(e){return e&&e.__esModule?e:{default:e}}var i={treeView:{form:o(n(26062)).default},treeEdit:{form:r.default}};t.default=i},26062:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(e){n+='\n
    \n '+(null==(t=e)?"":t)+"\n
    \n "})),n+='\n
    \n
    \n ',e.node.hasChildren&&(n+='\n \n "),n+="\n ",e.readOnly||(n+='\n \n \n \n ",e.node.revertAvailable&&(n+='\n \n "),n+="\n "),n+="\n
    \n
    \n
    \n"}},50332:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},83946:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.children)?"":t)+"
    \n"}},56429:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(83946)),o=i(n(50332));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,builder:o.default};t.default=a},80643:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},13380:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(80643))&&r.__esModule?r:{default:r}).default};t.default=o},7349:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},77090:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?(n+='\n
    \n ',"right"!==e.wizardHeaderLocation&&(n+='\n
    \n '+(null==(t=e.wizardHeader)?"":t)+"\n
    \n "),n+='\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n ","right"===e.wizardHeaderLocation&&(n+='\n
    \n '+(null==(t=e.wizardHeader)?"":t)+"\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n "):n+="\n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+"\n
    \n
    \n"}},41345:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(77090)),o=i(n(7349));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,builder:o.default};t.default=a},29864:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},187:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(29864))&&r.__esModule?r:{default:r}).default};t.default=o},47626:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},88057:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47626))&&r.__esModule?r:{default:r}).default};t.default=o},9289:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},75273:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(9289))&&r.__esModule?r:{default:r}).default};t.default=o},38054:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.buttonOrder.forEach((function(r){n+="\n ","cancel"===r&&e.buttons.cancel&&(n+='\n
    • \n \n
    • \n "),n+="\n ","previous"===r&&e.buttons.previous&&(n+='\n
    • \n \n
    • \n "),n+="\n ","next"===r&&e.buttons.next&&(n+='\n
    • \n \n
    • \n "),n+="\n ","submit"===r&&e.buttons.submit&&(n+="\n
    • \n ",e.disableWizardSubmit?n+='\n \n ":n+='\n \n ",n+="\n
    • \n "),n+="\n "})),n+="\n
    \n"}},24376:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(38054))&&r.__esModule?r:{default:r}).default};t.default=o},14086:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n"}},4778:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(14086))&&r.__esModule?r:{default:r}).default};t.default=o},52601:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",!e.group.componentOrder||e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n"}},53195:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(52601))&&r.__esModule?r:{default:r}).default};t.default=o},95514:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n
    \n"}},85646:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(95514))&&r.__esModule?r:{default:r}).default};t.default=o},26216:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n
    \n
    '+(null==(t=e.t(e.component.label))?"":t)+(null==(t=e.self.isIE()?", dialog":"")?"":t)+"\n ",e.options.vpat?n+='\n \n ':n+='\n \n ',n+='\n
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+"\n "),n+='\n
    \n ',e.options.vpat&&(n+='\n \n "),n+'\n \n
    \n
    \n
    \n \n
    \n
    \n'}},42126:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(26216))&&r.__esModule?r:{default:r}).default};t.default=o},94909:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={"form-group":"formio-form-group"}},82849:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+='\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",!e.builder&&e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n '+(null==(t=e.t("Add/Remove"))?"":t)+"\n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n "+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},99622:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(82849))&&r.__esModule?r:{default:r}).default};t.default=o},44749:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n \n
    \n'}},43705:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(44749))&&r.__esModule?r:{default:r}).default};t.default=o},2034:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.options.vpat&&(n+='\n \n'),n+="\n",e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+="\n ",e.options.vpat&&(n+="\n
    "+(null==(t=e.component.filePattern&&"*"!==e.component.filePattern?e.t("Allowed file types: ")+e.component.filePattern:"Any file types are allowed")?"":t)+"
    \n "),n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      \n '+(null==(t=e.t("Press to open "))?"":t)+""+(null==(t=r.originalName||r.name)?"":t)+"\n \n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n \n '),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'\n \n '+(null==(t=e.t("Remove button. Press to remove "+r.originalName||0))?"":t)+'\n '+(null==(t=r.message?r.message.replace(";","."):"")?"":t)+'\n \n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},79719:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(2034))&&r.__esModule?r:{default:r}).default};t.default=o},66248:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(83710),n(41539),n(39714);var r=y(n(4778)),o=y(n(53195)),i=y(n(85646)),a=y(n(42126)),l=y(n(99622)),s=y(n(43705)),u=y(n(79719)),c=y(n(38158)),f=y(n(94785)),d=y(n(11293)),p=y(n(19594)),h=y(n(28705)),m=y(n(94909));function y(e){return e&&e.__esModule?e:{default:e}}var v={transform:function(e,t){return t&&"class"===e&&this.cssClasses.hasOwnProperty(t.toString())?this.cssClasses[t.toString()]:t},builderSidebar:r.default,builderSidebarGroup:o.default,builderWizard:i.default,componentModal:a.default,datagrid:l.default,dialog:s.default,file:u.default,input:c.default,label:f.default,modalPreview:d.default,radio:p.default,table:h.default,cssClasses:m.default};t.default=v},44274:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";if(Array.prototype.join,(e.prefix||e.suffix)&&(n+='\n
    \n '),n+="\n ",e.prefix&&(n+='\n
    \n ',e.prefix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.prefix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.prefix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n "),n+="\n ",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n <"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n aria-labelledby="l-'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+" ",e.component.description&&(n+="d-"+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)),n+='"\n aria-required="'+(null==(t="input"!==e.input.ref&&e.input.ref?e.component.fields&&e.component.fields[e.input.ref]&&e.component.fields[e.input.ref].required||!1:e.component.validate.required)?"":t)+'"\n >'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n","datetime"===e.component.type&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n
    \n"),n+="\n",(e.component.showCharCount||e.component.showWordCount)&&(n+='\n
    \n ',e.component.showCharCount&&(n+='\n \n '),n+="\n ",e.component.showWordCount&&(n+='\n \n '),n+="\n
    \n"),n+"\n"}},39221:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},38158:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(44274)),o=i(n(39221));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},92293:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ","number"!==e.component.type&&"phoneNumber"!==e.component.type&&"currency"!==e.component.type||(n+='\n , '+(null==(t=e.t("numeric only"))?"":t)+",\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+"\n\n"}},94785:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(92293))&&r.__esModule?r:{default:r}).default};t.default=o},25770:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\n\n '+(null==(t=e.previewText)?"":t)+'\n\n
    \n '+(null==(t=e.messages)?"":t)+"\n
    \n"}},11293:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(25770))&&r.__esModule?r:{default:r}).default};t.default=o},12892:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n "})),n+="\n\n"}},19594:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(12892))&&r.__esModule?r:{default:r}).default};t.default=o},81809:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ",e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    '+(null==(t=e.t(e.component.label))?"":t)+"
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},28705:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(81809))&&r.__esModule?r:{default:r}).default};t.default=o},75146:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(5508)),o=l(n(66248)),i=l(n(81575)),a=l(n(95295));function l(e){return e&&e.__esModule?e:{default:e}}var s={bootstrap:r.default,bootstrap3:i.default.templates.bootstrap3,bootstrap5:o.default,semantic:a.default.templates.semantic};t.default=s},6701:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={unsavedRowsError:"Please save all rows before proceeding.",invalidRowsError:"Please correct invalid rows before proceeding.",invalidRowError:"Invalid row. Please correct it or delete.",alertMessageWithLabel:"{{label}}: {{message}}",alertMessage:"{{message}}",complete:"Submission Complete",error:"Please fix the following errors before submitting.",errorListHotkey:"Press Ctrl + Alt + X to go back to the error list.",errorsListNavigationMessage:"Click to navigate to the field with following error.",submitError:"Please check the form and correct all errors before submitting.",required:"{{field}} is required",unique:"{{field}} must be unique",array:"{{field}} must be an array",array_nonempty:"{{field}} must be a non-empty array",nonarray:"{{field}} must not be an array",select:"{{field}} contains an invalid selection",pattern:"{{field}} does not match the pattern {{pattern}}",minLength:"{{field}} must have at least {{length}} characters.",maxLength:"{{field}} must have no more than {{length}} characters.",minWords:"{{field}} must have at least {{length}} words.",maxWords:"{{field}} must have no more than {{length}} words.",min:"{{field}} cannot be less than {{min}}.",max:"{{field}} cannot be greater than {{max}}.",maxDate:"{{field}} should not contain date after {{- maxDate}}",minDate:"{{field}} should not contain date before {{- minDate}}",maxYear:"{{field}} should not contain year greater than {{maxYear}}",minYear:"{{field}} should not contain year less than {{minYear}}",invalid_email:"{{field}} must be a valid email.",invalid_url:"{{field}} must be a valid url.",invalid_regex:"{{field}} does not match the pattern {{regex}}.",invalid_date:"{{field}} is not a valid date.",invalid_day:"{{field}} is not a valid day.",mask:"{{field}} does not match the mask.",valueIsNotAvailable:"{{ field }} is an invalid value.",stripe:"{{stripe}}",month:"Month",day:"Day",year:"Year",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",next:"Next",previous:"Previous",cancel:"Cancel",submit:"Submit Form",confirmCancel:"Are you sure you want to cancel?",saveDraftInstanceError:"Cannot save draft because there is no formio instance.",saveDraftAuthError:"Cannot save draft unless a user is authenticated.",restoreDraftInstanceError:"Cannot restore draft because there is no formio instance.",saveDraftError:"Unable to save draft.",restoreDraftError:"Unable to restore draft.",time:"Invalid time",cancelButtonAriaLabel:"Cancel button. Click to reset the form",previousButtonAriaLabel:"Previous button. Click to go back to the previous tab",nextButtonAriaLabel:"Next button. Click to go to the next tab",submitButtonAriaLabel:"Submit Form button. Click to submit the form",reCaptchaTokenValidationError:"ReCAPTCHA: Token validation error",reCaptchaTokenNotSpecifiedError:"ReCAPTCHA: Token is not specified in submission"}},62604:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),t.ZP=void 0,n(92222),n(24812),n(32564),n(74916),n(68304),n(30489);var o,i=(o=n(57062))&&o.__esModule?o:{default:o};function a(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),o=1;os&&(i=a.greater(s,t),l=!1)}if(o&&e.isValid()){var u=(0,r.default)(o,t);e0&&void 0!==arguments[0]?arguments[0]:{},n=t.value;return o.default.isArray(n)?o.default.some(n,(function(n){return e.execute(l(l({},t),{},{value:n}))})):this.execute(t)}}],r=[{key:"operatorKey",get:function(){return""}},{key:"displayedName",get:function(){return""}},{key:"requireValue",get:function(){return!0}}],n&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=f},93928:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(30381));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"isAfter",n=e.value,r=e.instance,o=e.conditionComponentPath;if(!n)return!1;var i=null;if(r&&r.root&&(i=r.root.getComponent(o)),i&&i.isPartialDay&&i.isPartialDay(n))return!1;var a=this.getFormattedDates(s(s({},e),{},{conditionTriggerComponent:i})),l=a.date,u=a.comparedDate;return l[t](u)}}],r=[{key:"operatorKey",get:function(){return"dateGreaterThan"}},{key:"displayedName",get:function(){return"Greater Than"}}],n&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.default);t.default=y},39094:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;nn}}])&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.default);t.default=d},77085:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;nn||i.default.isEqual(t,n))}}])&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.default);t.default=d},23723:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(26699),n(32023),n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n-1;(n||i.tree||!d)&&(c=t(i,f,e));var p=function(){return i.key&&!["panel","table","well","columns","fieldset","tabs","form"].includes(i.type)&&(["datagrid","container","editgrid","address","dynamicWizard","datatable","tagpad"].includes(i.type)||i.tree)?f:i.key&&"form"===i.type?"".concat(f,".data"):r};c||(l?i.columns.forEach((function(e){return b(e.components,t,n,p(),o?i:null)}),!0):s?i.rows.forEach((function(e){Array.isArray(e)&&e.forEach((function(e){return b(e.components,t,n,p(),o?i:null)}),!0)})):u&&b(i.components,t,n,p(),o?i:null,!0))}})),e.noRecurse&&delete e.noRecurse}}function g(e,t){if((0,s.default)(t))return e.key===t||e.path===t;var n=!1;return(0,l.default)(t,(function(t,o){if(!(n=(0,r.default)(e,o)===t))return!1})),n}function w(e,t){var n=[];return b(e,(function(e){g(e,t)&&n.push(e)}),!0),n}function k(e,t,n,r){if(e){if(n=n||[],!t)return r(e);e.forEach((function(o,i){var a=n.slice();a.push(i),o&&(o.hasOwnProperty("columns")&&Array.isArray(o.columns)&&(a.push("columns"),o.columns.forEach((function(e,n){var o=a.slice();o.push(n),o.push("components"),k(e.components,t,o,r)}))),o.hasOwnProperty("rows")&&Array.isArray(o.rows)&&(a.push("rows"),o.rows.forEach((function(e,n){var o=a.slice();o.push(n),e.forEach((function(e,n){var i=o.slice();i.push(n),i.push("components"),k(e.components,t,i,r)}))}))),o.hasOwnProperty("components")&&Array.isArray(o.components)&&(a.push("components"),k(o.components,t,a,r)),o.key===t&&r(o,a,e))}))}}function O(e,t){var n=t.pop();0!==t.length&&(e=(0,r.default)(e,t)),e.splice(n,1)}function _(e){return parseFloat((0,s.default)(e)?e.replace(/[^\de.+-]/gi,""):e)}},55666:function(e,t,n){"use strict";n(4129),n(69070),n(38880),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(82526),n(41817),n(41539),n(32165),n(66992),n(78783),n(33948);var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var s=a?Object.getOwnPropertyDescriptor(e,l):null;s&&(s.get||s.set)?Object.defineProperty(r,l,s):r[l]=e[l]}return r.default=e,n&&n.set(e,r),r}(n(82531));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}"object"===(void 0===n.g?"undefined":i(n.g))&&(n.g.FormioUtils=r);var a=r;t.default=a},52013:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.lodashOperators=void 0,t.lodashOperators=["chunk","compact","concat","difference","differenceBy","differenceWith","drop","dropRight","dropRightWhile","dropWhile","findIndex","findLastIndex","first","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","intersectionBy","intersectionWith","join","last","lastIndexOf","nth","slice","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","tail","take","takeRight","takeRightWhile","takeWhile","union","unionBy","unionWith","uniq","uniqBy","uniqWith","unzip","unzipWith","without","xor","xorBy","xorWith","zip","zipObject","zipObjectDeep","zipWith","countBy","every","filter","find","findLast","flatMap","flatMapDeep","flatMapDepth","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","now","flip","negate","overArgs","partial","partialRight","rearg","rest","spread","castArray","clone","cloneDeep","cloneDeepWith","cloneDeep","conformsTo","eq","gt","gte","isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBoolean","isBuffer","isDate","isElement","isEmpty","isEqual","isEqualWith","isError","isFinite","isFunction","isInteger","isLength","isMap","isMatch","isMatchWith","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isWeakMap","isWeakSet","lt","lte","toArray","toFinite","toInteger","toLength","toNumber","toPlainObject","toSafeInteger","toString","add","ceil","divide","floor","max","maxBy","mean","meanBy","min","minBy","multiply","round","subtract","sum","sumBy","clamp","inRange","random","at","entries","entriesIn","findKey","findLastKey","functions","functionsIn","get","has","hasIn","invert","invertBy","invoke","keys","keysIn","mapKeys","mapValues","omit","omitBy","pick","pickBy","result","toPairs","toPairsIn","transform","values","valuesIn","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words","cond","conforms","constant","defaultTo","flow","flowRight","identity","iteratee","matches","matchesProperty","method","methodOf","nthArg","over","overEvery","overSome","property","propertyOf","range","rangeRight","stubArray","stubFalse","stubObject","stubString","stubTrue","times","toPath","uniqueId"]},82531:function(e,t,n){"use strict";n(82526),n(41817),n(32165),n(78783),n(91038),n(69070),Object.defineProperty(t,"__esModule",{value:!0});var r={evaluate:!0,getRandomComponentId:!0,getPropertyValue:!0,getElementRect:!0,boolValue:!0,isMongoId:!0,checkCalculated:!0,checkSimpleConditional:!0,getComponentActualValue:!0,checkCustomConditional:!0,checkJsonConditional:!0,checkCondition:!0,checkTrigger:!0,setActionProperty:!0,unescapeHTML:!0,convertStringToHTMLElement:!0,uniqueName:!0,guid:!0,getDateSetting:!0,isValidDate:!0,currentTimezone:!0,offsetDate:!0,zonesLoaded:!0,shouldLoadZones:!0,loadZones:!0,momentDate:!0,formatDate:!0,formatOffset:!0,getLocaleDateFormatInfo:!0,convertFormatToFlatpickr:!0,convertFormatToMoment:!0,convertFormatToMask:!0,getInputMask:!0,unmaskValue:!0,matchInputMask:!0,getNumberSeparators:!0,getNumberDecimalLimit:!0,getCurrencyAffixes:!0,fieldData:!0,delay:!0,iterateKey:!0,uniqueKey:!0,bootstrapVersion:!0,unfold:!0,firstNonNil:!0,withSwitch:!0,observeOverload:!0,getContextComponents:!0,getContextButtons:!0,translateHTMLTemplate:!0,sanitize:!0,fastCloneDeep:!0,interpolate:!0,isInputComponent:!0,getArrayFromComponentPath:!0,hasInvalidComponent:!0,getStringFromComponentPath:!0,round:!0,getIEBrowserVersion:!0,getBrowserInfo:!0,getComponentPathWithoutIndicies:!0,getComponentPath:!0,getDataParentComponent:!0,isPromise:!0,isInsideScopingComponent:!0,getFocusableElements:!0,componentValueTypes:!0,getComponentSavedTypes:!0,getItemTemplateKeys:!0,isSelectResourceWithObjectValue:!0,_:!0,jsonLogic:!0,moment:!0,Evaluator:!0,ConditionOperators:!0};Object.defineProperty(t,"ConditionOperators",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"Evaluator",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o.default}}),t.boolValue=function(e){return o.default.isBoolean(e)?e:o.default.isString(e)?"true"===e.toLowerCase():!!e},t.bootstrapVersion=function(e){return e.bootstrap?e.bootstrap:"function"==typeof $&&"function"==typeof $().collapse?parseInt($.fn.collapse.Constructor.VERSION.split(".")[0],10):0},t.checkCalculated=function(e,t,n){e.calculateValue&&o.default.set(n,e.key,w(e.calculateValue,{value:void 0,data:t?t.data:n,row:n,util:this,component:e},"value"))},t.checkCondition=function(e,t,n,r,i){var a=e.customConditional,l=e.conditional;return a?S(0,a,t,n,r,"show",!0,i):l&&(l.when||o.default.some(l.conditions||[],(function(e){return e.component&&e.operator})))?O(e,l,t=j(e,t,i),n,i):!l||!l.json||P(e,l.json,t,n,r,!0)},t.checkCustomConditional=S,t.checkJsonConditional=P,t.checkSimpleConditional=O,t.checkTrigger=function(e,t,n,r,o,i){if(!t[t.type])return!1;switch(t.type){case"simple":return n=j(e,n,i,t.simple),O(e,t.simple,n,r,i);case"javascript":return S(0,t.javascript,n,r,o,"result",!1,i);case"json":return P(e,t.json,n,r,o,!1)}return!1},t.componentValueTypes=void 0,t.convertFormatToFlatpickr=function(e){return e.replace(/Z/g,"").replace(/y/g,"Y").replace("YYYY","Y").replace("YY","y").replace("MMMM","F").replace(/M/g,"n").replace("nnn","M").replace("nn","m").replace(/d/g,"j").replace(/jj/g,"d").replace("EEEE","l").replace("EEE","D").replace("HH","H").replace("hh","G").replace("mm","i").replace("ss","S").replace(/a/g,"K")},t.convertFormatToMask=function(e){return e.replace(/M{4}/g,"MM").replace(/M{3}/g,"***").replace(/e/g,"Q").replace(/[ydhmsHMG]/g,"9").replace(/a/g,"AA")},t.convertFormatToMoment=M,t.convertStringToHTMLElement=function(e,t){return(new window.DOMParser).parseFromString(e,"text/html").body.querySelector(t)},t.currentTimezone=E,t.delay=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\[\d+\]/,"")},t.getComponentSavedTypes=function(e){var t=e||{};return!0!==t.persistent?[]:t.multiple?[z.array]:null},t.getContextButtons=function(e){var t=[];return e.utils.eachComponent(e.instance.options.editForm.components,(function(e){"button"===e.type&&t.push({label:"".concat(e.key," (").concat(e.label,")"),value:e.key})})),t},t.getContextComponents=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=[];return e.utils.eachComponent(e.instance.options.editForm.components,(function(i,a){var l=!t||!i.tree;i.key!==e.data.key&&l&&!o.default.includes(n,i.type)&&r.push({label:"".concat(i.label||i.key," (").concat(a,")"),value:a})})),r},t.getCurrencyAffixes=function(e){var t=e.currency,n=void 0===t?"USD":t,r=e.decimalLimit,o=e.decimalSeparator,i=e.lang,a="(.*)?".concat(100..toLocaleString(i));r&&(a+="".concat("."===o?"\\.":o).concat((0).toLocaleString(i),"{").concat(r,"}")),a+="(.*)?";var l=100..toLocaleString(i,{style:"currency",currency:n,useGrouping:!0,maximumFractionDigits:r||0,minimumFractionDigits:r||0}).replace(".",o).match(new RegExp(a));return{prefix:(null==l?void 0:l[1])||"",suffix:(null==l?void 0:l[2])||""}},t.getDataParentComponent=U,t.getDateSetting=function(e){if(o.default.isNil(e)||o.default.isNaN(e)||""===e)return null;if(e instanceof Date)return e;if("function"==typeof e.toDate)return e.isValid()?e.toDate():null;var t="string"!=typeof e||-1===e.indexOf("moment(")?(0,l.default)(e):null;if(t&&t.isValid())return t.toDate();t=null;try{var n=p.default.evaluator("return ".concat(e,";"),"moment")(l.default);"string"==typeof n?t=(0,l.default)(n):"function"==typeof n.toDate?t=(0,l.default)(n.toDate().toUTCString()):n instanceof Date&&(t=(0,l.default)(n))}catch(e){return null}return t&&t.isValid()?t.toDate():null},t.getElementRect=function(e){var t=window.getComputedStyle(e,null);return{x:k(t,"left"),y:k(t,"top"),width:k(t,"width"),height:k(t,"height")}},t.getFocusableElements=function(e){return e.querySelectorAll("button:not([disabled]), input:not([disabled]), select:not([disabled]),\n textarea:not([disabled]), button:not([disabled]), [href]")},t.getIEBrowserVersion=function(){var e=F(),t=e.ie,n=e.version;return t?n:null},t.getInputMask=function(e,t){if(e instanceof Array)return e;var n=[];n.numeric=!0;for(var r=0;r1&&t.push(n[1])})),t},t.getLocaleDateFormatInfo=function(e){var t={},n=new Date(2017,11,21).toLocaleDateString(e);return t.dayFirst=n.slice(0,2)===21..toString(),t},t.getNumberDecimalLimit=function(e,t){if(o.default.has(e,"decimalLimit"))return o.default.get(e,"decimalLimit");var n=t||20,r=o.default.get(e,"validate.step","any");if("any"!==r){var i=r.toString().split(".");i.length>1&&(n=i[1].length)}return n},t.getNumberSeparators=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",t=12345.6789.toLocaleString(e),n=t.match(/..(.)...(.)../);return n?{delimiter:n.length>1?n[1]:",",decimalSeparator:n.length>2?n[2]:"."}:{delimiter:",",decimalSeparator:"."}},t.getPropertyValue=k,t.getRandomComponentId=function(){return"e".concat(Math.random().toString(36).substring(7))},t.getStringFromComponentPath=function(e){if(!o.default.isArray(e))return e;var t="";return e.forEach((function(e,n){o.default.isNumber(e)?t+="[".concat(e,"]"):t+=0===n?e:".".concat(e)})),t},t.guid=x,t.hasInvalidComponent=function e(t){return t.getComponents().some((function(t){return o.default.isArray(t.components)?e(t):t.error}))},t.interpolate=void 0,t.isInputComponent=function(e){if(!1===e.input||!0===e.input)return e.input;switch(e.type){case"htmlelement":case"content":case"columns":case"fieldset":case"panel":case"table":case"tabs":case"well":case"button":return!1;default:return!0}},t.isInsideScopingComponent=function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n&&null!=t&&t.hasScopedChildren)return!0;var r=U(t);return!(null==r||!r.hasScopedChildren)||!(null==r||!r.parent)&&e(r.parent,!1)},t.isMongoId=function(e){return e.toString().match(/^[0-9a-fA-F]{24}$/)},t.isPromise=function(e){return e&&e.then&&"function"==typeof e.then&&"[object Promise]"===Object.prototype.toString.call(e)},t.isSelectResourceWithObjectValue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.reference,n=e.dataSrc,r=e.valueProperty;return t||"resource"===n&&(!r||"data"===r)},t.isValidDate=function(e){return o.default.isDate(e)&&!o.default.isNaN(e.getDate())},t.iterateKey=R,Object.defineProperty(t,"jsonLogic",{enumerable:!0,get:function(){return a.default}}),t.loadZones=T,t.matchInputMask=function(e,t){if(!t)return!0;if(e.length>t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?50:n,o=t.delay,i=void 0===o?500:o,a=0,l=0,s=function(){return a=0};return function(){if(0!==l&&(clearTimeout(l),l=0),l=setTimeout(s,i),(a+=1)>=r)return clearTimeout(l),s(),e()}},t.offsetDate=C,t.round=function(e,t){return o.default.isNumber(e)?e.toFixed(t):e},t.sanitize=function(e,t){if("function"!=typeof f.default.sanitize)return e;var n={ADD_ATTR:["ref","target"],USE_PROFILES:{html:!0}};if(t.sanitizeConfig&&t.sanitizeConfig.useProfiles&&Object.keys(t.sanitizeConfig.useProfiles).forEach((function(e){n.USE_PROFILES[e]=t.sanitizeConfig.useProfiles[e]})),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addAttr)&&t.sanitizeConfig.addAttr.length>0&&t.sanitizeConfig.addAttr.forEach((function(e){n.ADD_ATTR.push(e)})),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addTags)&&t.sanitizeConfig.addTags.length>0&&(n.ADD_TAGS=t.sanitizeConfig.addTags),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.allowedTags)&&t.sanitizeConfig.allowedTags.length>0&&(n.ALLOWED_TAGS=t.sanitizeConfig.allowedTags),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.allowedAttrs)&&t.sanitizeConfig.allowedAttrs.length>0&&(n.ALLOWED_ATTR=t.sanitizeConfig.allowedAttrs),t.sanitizeConfig&&t.sanitizeConfig.allowedUriRegex){var r=t.sanitizeConfig.allowedUriRegex;n.ALLOWED_URI_REGEXP=o.default.isString(r)?new RegExp(r):r}return t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addUriSafeAttr)&&t.sanitizeConfig.addUriSafeAttr.length>0&&(n.ADD_URI_SAFE_ATTR=t.sanitizeConfig.addUriSafeAttr),f.default.sanitize(e,n)},t.setActionProperty=function(e,t,n,r,i,a){var l=t.property.value;switch(t.property.type){case"boolean":var s=o.default.get(e,l,!1).toString(),u=t.state.toString();s!==u&&o.default.set(e,l,"true"===u);break;case"string":var c={data:i,row:r,component:e,result:n},f=t.property.component?t[t.property.component]:t.text,d=o.default.get(e,l,""),h=a&&a.interpolate?a.interpolate(f,c):p.default.interpolate(f,c);h!==d&&o.default.set(e,l,h)}return e},t.shouldLoadZones=A,t.translateHTMLTemplate=function(e,t){if(!/<[^>]*>/.test(e))return t(e);var n=document.createElement("div");return n.innerHTML=e,n.innerText&&n.children.length?(N(n,t),n.innerHTML):e},t.unescapeHTML=function(e){return"undefined"!=typeof window&&"DOMParser"in window?(new window.DOMParser).parseFromString(e,"text/html").documentElement.textContent:e},t.unfold=D,t.uniqueKey=function(e,t){for(var n=t;e.hasOwnProperty(n);)n=R(n);return n},t.uniqueName=function(e,t,n){(t=t||"{{fileName}}-{{guid}}").includes("{{guid}}")||(t="".concat(t,"-{{guid}}"));var r=e.split("."),i=r.slice(0,r.length-1).join("."),a=r.length>1?".".concat(o.default.last(r)):"";return i=i.substr(0,100),n=Object.assign(n||{},{fileName:i,guid:x()}),"".concat(p.default.interpolate(t,n)).concat(a).replace(/[^0-9a-zA-Z.\-_ ]/g,"-")},t.unmaskValue=function(e,t,n){if(!t||!e||e.length>t.length)return e;for(var r=e.split(""),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n]*>(.*?)<\/a>/g);if(o&&o.length){if(1===o.length&&o[0].length===e.innerHTML.length)return e.innerHTML.replace(n,r);var i=o.map((function(e){var n=document.createElement("a");return n.innerHTML=e,V(n,t)}));return"".concat(r," (").concat(i.join(", "),")")}return e.innerText.replace(n,r)}return e.innerHTML}function N(e,t){var n,r=e.children.length&&(function(e){if(Array.isArray(e))return y(e)}(n=e.children)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r&&r.every((function(e){return 0===e.children.length&&L.some((function(t){return e.nodeName===t}))}));!r||o?e.innerHTML=V(e,t):r.forEach((function(e){return N(e,t)}))}function F(){var e={};if("undefined"==typeof window)return e;var t=window.navigator.userAgent.toLowerCase(),n=/(edge|edg)\/([\w.]+)/.exec(t)||/(opr)[/]([\w.]+)/.exec(t)||/(yabrowser)[ /]([\w.]+)/.exec(t)||/(chrome)[ /]([\w.]+)/.exec(t)||/(iemobile)[/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+).*(version)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],r={browser:n[5]||n[3]||n[1]||"",version:n[4]||n[2]||"0"};return r.browser&&(e[r.browser]=!0,e.version=parseInt(r.version,10)),(e.chrome||e.opr||e.safari||e.edg||e.yabrowser)&&(e.isWebkit=!0),(e.rv||e.iemobile)&&(e.ie=!0),e.edg&&(e.edge=!0),e.opr&&(e.opera=!0),e}function B(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e&&e.key&&"wizard"!==(null==e||null===(t=e._form)||void 0===t?void 0:t.display)?(n=e.isInputComponent||!0===e.input?"".concat(e.key).concat(n?".":"").concat(n):n,B(e.parent,n)):n}function U(e){if(e){var t=e.parent;return t&&(t.isInputComponent||t.input)?t:U(t)}}var z={number:"number",string:"string",boolean:"boolean",array:"array",object:"object",date:"date",any:"any"};t.componentValueTypes=z},24897:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(64753))&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.config=r.default.defaults(t,e.config),this.validators={required:{key:"validate.required",method:"validateRequired",hasLabel:!0,message:function(e){return e.t(e.errorMessage("required"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!(0,o.boolValue)(t)||e.isValueHidden())return!0;var r=e.validators.some((function(e){return"calendar"===e}));return!n&&r&&e.widget.enteredDate?!this.validators.calendar.check.call(this,e,t,n):!e.isEmpty(n)}},onlyAvailableItems:{key:"validate.onlyAvailableItems",method:"validateValueAvailability",hasLabel:!0,message:function(e){return e.t(e.errorMessage("valueIsNotAvailable"),{field:e.errorLabel,data:e.data})},check:function(e,t){return!(0,o.boolValue)(t)}},unique:{key:"validate.unique",hasLabel:!0,message:function(e){return e.t(e.errorMessage("unique"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){var i=this;return!(0,o.boolValue)(t)||!!(!n||r.default.isObjectLike(n)&&r.default.isEmpty(n))||!this.config.db||new a.default((function(t){var a,l=i.config.form,s=i.config.submission,u="data.".concat(e.path),c=function(e,t,n){var o=n.split(/\[\d+\]?./),i=n;if(o.length>1){i=o.shift();var a={};r.default.reduce(o,(function(t,n,i){var l=i===o.length-1,s=r.default.get(a,t,a),u="$elemMatch['".concat(n,"']");return r.default.set(s,u,l?e:{}),t?"".concat(t,".").concat(u):u}),""),t[i]=a}else t[i]=e},f={form:l._id},d={};r.default.isString(n)?e.component.dbIndex?c(n,f,u):"email"===e.component.type||"textfield"===e.component.type&&"[A-Za-z0-9]+"===(null===(a=e.component.validate)||void 0===a?void 0:a.pattern)?(c(n,f,u),d={collation:{locale:"en",strength:2}}):c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n),"$")),$options:"i"},f,u):r.default.isPlainObject(n)&&n.address&&n.address.address_components&&n.address.place_id?c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n.address.place_id),"$")),$options:"i"},f,"".concat(u,".address.place_id")):r.default.isArray(n)?c({$all:n},f,u):(r.default.isObject(n)||r.default.isNumber(n))&&c({$eq:n},f,u),f.deleted={$eq:null},f.state="submitted";var p=function(n,r){return n?t(!1):r?s._id&&r._id.toString()===s._id?void t(!0):(e.conflictId=r._id.toString(),t(!1)):t(!0)};i.config.db.findOne(f,null,d,(function(e,t){if(!e||!d.collation)return p(e,t);delete f[u],c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n),"$")),$options:"i"},f,u),i.config.db.findOne(f,p)}))})).catch((function(){return!1}))}},multiple:{key:"validate.multiple",hasLabel:!0,message:function(e){var t=(0,o.boolValue)(e.component.multiple)||Array.isArray(e.emptyValue),n=e.component.validate.required,r=t?n?"array_nonempty":"array":"nonarray";return e.t(e.errorMessage(r),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!e.validateMultiple())return!0;var i=(0,o.boolValue)(t),a=Array.isArray(e.emptyValue),l=Array.isArray(n),s=e.component.validate.required;return i?l?!s||!!n.length:!!r.default.isNil(n)&&!s:a||!l}},select:{key:"validate.select",hasLabel:!0,message:function(e){return e.t(e.errorMessage("select"),{field:e.errorLabel,data:e.data})},check:function(e,t,n,i,a,l,s){if(!(0,o.boolValue)(t))return!0;if(!n||r.default.isEmpty(n))return!0;if(!s)return!0;var u=e.component,c={url:t,method:"GET",qs:{},json:!0,headers:{}};if(r.default.isBoolean(c.url)){if(c.url=!!c.url,!c.url||"url"!==u.dataSrc||!u.data.url||!u.searchField)return!0;c.url=u.data.url,c.qs[u.searchField]=n,u.filter&&(c.url+=(c.url.includes("?")?"&":"?")+u.filter),u.selectFields&&(c.qs.select=u.selectFields)}return!c.url||(c.url=(0,o.interpolate)(c.url,{data:e.data}),c.url+=(c.url.includes("?")?"&":"?")+r.default.chain(c.qs).map((function(e,t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))})).join("&").value(),u.data&&u.data.headers&&r.default.each(u.data.headers,(function(e){e.key&&(c.headers[e.key]=e.value)})),u.authenticate&&this.config.token&&(c.headers["x-jwt-token"]=this.config.token),w(new O(c.url,{headers:new k(c.headers)})).then((function(e){return!!e.ok&&e.json()})).then((function(e){return e&&e.length})).catch((function(){return!1})))}},min:{key:"validate.min",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("min"),{field:e.errorLabel,min:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t),o=parseFloat(n);return!(!Number.isNaN(r)&&!Number.isNaN(o))||o>=r}},max:{key:"validate.max",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("max"),{field:e.errorLabel,max:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t),o=parseFloat(n);return!(!Number.isNaN(r)&&!Number.isNaN(o))||o<=r}},minSelectedCount:{key:"validate.minSelectedCount",message:function(e,t){return e.component.minSelectedCountMessage?e.component.minSelectedCountMessage:e.t(e.errorMessage("minSelectedCount"),{minCount:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t);if(!r)return!0;var o=Object.keys(n).reduce((function(e,t){return n[t]&&e++,e}),0);return!o||o>=r}},maxSelectedCount:{key:"validate.maxSelectedCount",message:function(e,t){return e.component.maxSelectedCountMessage?e.component.maxSelectedCountMessage:e.t(e.errorMessage("maxSelectedCount"),{minCount:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t);return!r||Object.keys(n).reduce((function(e,t){return n[t]&&e++,e}),0)<=r}},minLength:{key:"validate.minLength",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minLength"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!(n&&r&&"string"==typeof n&&!e.isEmpty(n))||n.length>=r}},maxLength:{key:"validate.maxLength",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxLength"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||"string"!=typeof n||n.length<=r}},maxWords:{key:"validate.maxWords",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxWords"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||"string"!=typeof n||n.trim().split(/\s+/).length<=r}},minWords:{key:"validate.minWords",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minWords"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||!n||"string"!=typeof n||n.trim().split(/\s+/).length>=r}},email:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_email"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}},url:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_url"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||/^(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(n)&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}},date:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_date"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||"Invalid date"!==n&&"Invalid Date"!==n&&("string"==typeof n&&(n=new Date(n)),n instanceof Date==1&&"Invalid Date"!==n.toString())}},day:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_day"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!n)return!0;var r=h(e.dayFirst?[0,1,2]:[1,0,2],3),o=r[0],i=r[1],a=r[2],l=n.split("/").map((function(e){return parseInt(e,10)})),s=l[o],u=l[i],c=l[a],f=function(e,t){switch(e){case 1:case 3:case 5:case 7:case 8:case 10:case 12:default:return 31;case 4:case 6:case 9:case 11:return 30;case 2:return function(e){return!(e%400&&(!(e%100)||e%4))}(t)?29:28}}(u,c);return!(s<0||s>f||u<0||u>12||c<0||c>9999)}},pattern:{key:"validate.pattern",hasLabel:!0,message:function(e,t){return e.t(r.default.get(e,"component.validate.patternMessage",e.errorMessage("pattern")),{field:e.errorLabel,pattern:t,data:e.data})},check:function(e,t,n){return!!e.isEmpty(n)||(!t||new RegExp("^".concat(t,"$")).test(n))}},json:{key:"validate.json",check:function(e,t,n,r,o,i){if(!t)return!0;var a=e.evaluate(t,{data:r,row:i,rowIndex:o,input:n});return null===a||a}},mask:{key:"inputMask",hasLabel:!0,message:function(e){return e.t(e.errorMessage("mask"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){var r;if(e.isMultipleMasksField){var i=n?n.maskName:void 0,a=e.getMaskByName(i);a&&(r=a),n=n?n.value:n}else r=t;return n&&r&&"string"==typeof n&&"textfield"===e.type?l.default.isValid(n,r):(r=r?(0,o.getInputMask)(r):null,!(n&&r&&!e.skipMaskValidation)||(r=r.map((function(t){return t===e.placeholderChar?" ":t})),(0,o.matchInputMask)(n,r)))}},custom:{key:"validate.custom",message:function(e){return e.t(e.errorMessage("custom"),{field:e.errorLabel,data:e.data})},check:function(e,t,n,r,o,i){if(!t)return!0;var a=e.evaluate(t,{valid:!0,data:r,rowIndex:o,row:i,input:n},"valid",!0);return null===a||a}},maxDate:{key:"maxDate",hasLabel:!0,message:function(e,t){var n=(0,o.getDateSetting)(t);return e.t(e.errorMessage("maxDate"),{field:e.errorLabel,maxDate:(0,i.default)(n).format(e.format)})},check:function(e,t,n){if(e.isPartialDay&&e.isPartialDay(n))return!0;var a=e.getValidationFormat?(0,i.default)(n,e.getValidationFormat()):(0,i.default)(n),l=(0,o.getDateSetting)(t);return!!r.default.isNull(l)||(l.setHours(0,0,0,0),a.isBefore(l)||a.isSame(l))}},minDate:{key:"minDate",hasLabel:!0,message:function(e,t){var n=(0,o.getDateSetting)(t);return e.t(e.errorMessage("minDate"),{field:e.errorLabel,minDate:(0,i.default)(n).format(e.format)})},check:function(e,t,n){if(e.isPartialDay&&e.isPartialDay(n))return!0;var a=e.getValidationFormat?(0,i.default)(n,e.getValidationFormat()):(0,i.default)(n),l=(0,o.getDateSetting)(t);return!!r.default.isNull(l)||(l.setHours(0,0,0,0),a.isAfter(l)||a.isSame(l))}},minYear:{key:"minYear",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minYear"),{field:e.errorLabel,minYear:t})},check:function(e,t,n){var r=t,o=/\d{4}$/.exec(n);return o=o?o[0]:null,!+r||!+o||+o>=+r}},maxYear:{key:"maxYear",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxYear"),{field:e.errorLabel,maxYear:t})},check:function(e,t,n){var r=t,o=/\d{4}$/.exec(n);return o=o?o[0]:null,!+r||!+o||+o<=+r}},calendar:{key:"validate.calendar",messageText:"",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.calendar.messageText),{field:e.errorLabel,maxDate:(0,i.default)(e.dataValue).format(e.format)})},check:function(e,t,n,r,a){this.validators.calendar.messageText="";var l=e.getWidget(a);if(!l)return!0;var s=l.settings,c=l.enteredDate,f=s.minDate,d=s.maxDate,p=s.format,h=[(0,o.convertFormatToMoment)(p)];if(h[0].match(/M{3,}/g)&&h.push(h[0].replace(/M{3,}/g,"MM")),!n&&c){var m=(0,u.checkInvalidDate)(c,h,f,d),y=m.message,v=m.result;if(!v)return this.validators.calendar.messageText=y,v}return n&&c?(0,i.default)(n).format()!==(0,i.default)(c,h,!0).format()&&c.match(/_/gi)?(this.validators.calendar.messageText=u.CALENDAR_ERROR_MESSAGES.INCOMPLETE,!1):(l.enteredDate="",!0):void 0}},time:{key:"validate.time",messageText:"Invalid time",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.time.messageText),{field:e.errorLabel})},check:function(e,t,n){return!!e.isEmpty(n)||(0,i.default)(n,e.component.format).isValid()}},availableValueProperty:{key:"validate.availableValueProperty",method:"validateValueProperty",messageText:"Invalid Value Property",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.availableValueProperty.messageText),{field:e.errorLabel})},check:function(e,t,n){return"url"!==e.component.dataSrc||!r.default.isUndefined(n)&&!r.default.isObject(n)}}}}var t,n;return t=e,n=[{key:"checkValidator",value:function(e,t,n,r,o,i,l,s){var u,c=this;u=t.method&&"function"==typeof e[t.method]?e[t.method](n,r,o,i,l,s):t.check.call(this,e,n,r,o,i,l,s);var f=function(r){return"string"==typeof r?r:!r&&t.message?t.message.call(c,e,n,i,l):""};return s?a.default.resolve(u).then(f):f(u)}},{key:"validate",value:function(e,t,n,i,l,s,u,c,f){if(!c&&!r.default.get(e.component,"validateWhenHidden",!1))return!1;var d=this.validators[t],p=r.default.get(f||e.component,d.key,null),h=this.checkValidator(e,d,p,n,i,l,s,u),m=function(i){if(i){var a,s={message:(0,o.unescapeHTML)(r.default.get(i,"message",i)),level:"warning"===r.default.get(i,"level")?"warning":"error",path:(0,o.getArrayFromComponentPath)(e.path||""),context:{validator:t,hasLabel:d.hasLabel,setting:p,key:e.key,label:e.label,value:n,index:l,input:null===(a=e.refs.input)||void 0===a?void 0:a[l]}};return"unique"===t&&e.conflictId&&(s.conflictId=e.conflictId),s}return!1};return u?a.default.resolve(h).then(m):m(h)}},{key:"checkComponent",value:function(e,t,n){var o,i=this,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u="undefined"!=typeof process&&"node"===r.default.get(process,"release.name")&&!r.default.defaultTo(e.component.persistent,!0);if(u||!1===e.component.validate)return s?a.default.resolve([]):[];t=t||e.rootValue,n=n||e.data;var c=e.component.multiple&&Array.isArray(e.validationValue)?e.validationValue:[e.validationValue],f=e.conditionallyVisible(),d=[];null!=e&&null!==(o=e.addons)&&void 0!==o&&o.length&&c.forEach((function(t){e.addons.forEach((function(e){e.checkValidity(t)||d.push.apply(d,p(e.errors||[]))}))}));var h=r.default.get(e,"component.validations"),m=[];if(h&&Array.isArray(h)&&h.length){var y=r.default.chain(h).groupBy((function(e){return e.mode})).value();if(e.calculateCondition){l=!0;var v=r.default.chain(y.ui).filter("active").groupBy((function(e){return e.group||null})).value(),b=v.null||[];delete v.null,b.forEach((function(t){var n=t.condition,r=t.message,o=t.severity;e.calculateCondition(n)||m.push({level:o||"error",message:e.t(r),componentInstance:e})})),r.default.forEach(v,(function(t){r.default.forEach(t,(function(t){var n=t.condition,r=t.message,o=t.severity;if(!e.calculateCondition(n))return m.push({level:o||"error",message:e.t(r),componentInstance:e}),!1}))}))}else m=this.checkValidations(e,h,t,n,c,s);e.validators.includes("custom")&&y.js&&r.default.each(y.js,(function(o){m.push(r.default.map(c,(function(r,a){return i.validate(e,"custom",r,t,a,n,s,f,o)})))})),e.validators.includes("json")&&y.json&&r.default.each(y.json,(function(o){m.push(r.default.map(c,(function(r,a){return i.validate(e,"json",r,t,a,n,s,f,o)})))}))}var g=r.default.get(e,"component.validate.custom"),w=r.default.get(e,"component.validate.customMessage"),k=(0,r.default)(e.validators).chain().map((function(o){return i.validators.hasOwnProperty(o)?"required"!==o||c.length?r.default.map(c,(function(r,a){return i.validate(e,o,r,t,a,n,s,f)})):[i.validate(e,o,null,t,0,n,s,f)]:{message:'Validator for "'.concat(o,'" is not defined'),level:"warning",context:{validator:o,key:e.key,label:e.label}}})).flatten().value();e.component.validate=e.component.validate||{},e.component.validate.unique=e.component.unique,k.push(this.validate(e,"unique",e.validationValue,t,0,t,s,f)),e.component.validate.multiple=e.component.multiple,k.push(this.validate(e,"multiple",e.validationValue,t,0,t,s,f)),k.push.apply(k,d),k.push.apply(k,p(m));var O=function(o){return o=(0,r.default)(o).chain().flatten().compact().value(),(w||g)&&r.default.each(o,(function(r){r.message=e.t(w||r.message,{field:e.errorLabel,data:t,row:n,error:r}),r.context.hasLabel=!1})),l?o:r.default.reject(o,(function(e){return"warning"===e.level}))};return s?a.default.all(k).then(O):O(k)}},{key:"checkValidations",value:function(e,t,n,r,o,i){var a=this,l=t.map((function(t){return a.checkRule(e,t,n,r,o,i)})).reduce((function(e,t){return t?[].concat(p(e),p(t)):e}),[]).filter((function(e){return e})).reduce((function(e,t){return e[t.context.validator]=t,e}),{});return Object.values(l)}},{key:"checkRule",value:function(e,t,n,r,o,i){var a=c.default.getRule(t.rule),l=[];if(a){var s=new a(e,t.settings,this.config);o.map((function(o,a){var u=s.check(o,n,r,i);!0!==u&&l.push({level:t.level||"error",message:e.t(t.message||s.defaultMessage,{settings:t.settings,field:e.errorLabel,data:n,row:r,error:u}),context:{key:e.key,index:a,label:e.label,validator:t.rule}})}))}return 0!==l.length&&l}},{key:"check",get:function(){return this.checkComponent}},{key:"get",value:function(){r.default.get.call(this,arguments)}},{key:"each",value:function(){r.default.each.call(this,arguments)}},{key:"has",value:function(){r.default.has.call(this,arguments)}}],n&&b(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.ValidationChecker=_,_.config={db:null,token:null,form:null,submission:null};var S=new _;t.default=S},4338:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nd||isNaN(c)||c<0||c>12||isNaN(f)||f<0||f>9999)}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(p)},81365:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},58788:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},36056:function(e,t,n){"use strict";n(69070),n(68304),n(24812),n(30489),n(12419),n(78011),n(32165),n(66992),n(78783),n(33948),n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=n(82531),o=a(n(30381)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},17579:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},40535:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=+t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},49561:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},64753:function(e,t,n){"use strict";var r=n(480),o=n(31266),i=n(22762),a=n(81365),l=n(58788),s=n(35239),u=n(54266),c=n(89017),f=n(93942),d=n(40177),p=n(43117),h=n(36056),m=n(24391),y=n(17579),v=n(49561),b=n(86947),g=n(71912),w=n(18754),k=n(68135),O=n(40535),_=n(18722),S=n(30173);e.exports={custom:r,date:o,day:i,email:a,json:l,mask:s,max:u,maxDate:c,maxLength:f,maxWords:d,min:p,minDate:h,minLength:m,minWords:y,pattern:v,required:b,select:g,unique:w,url:k,minYear:O,maxYear:_,time:S}},87892:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=2&&"en"!==i)return o.GlobalFormio.requireLibrary("flatpickr-".concat(i),"flatpickr-".concat(i),"".concat(o.GlobalFormio.cdn["flatpickr-formio"],"/l10n/flatpickr-").concat(i,".js"),!0).then((function(){return n.initFlatpickr(t)}));n.initFlatpickr(t)}}))})).catch((function(e){console.warn(e)}))}},{key:"disableWeekends",get:function(){return function(e){return 0===e.getDay()||6===e.getDay()}}},{key:"disableWeekdays",get:function(){var e=this;return function(t){return!e.disableWeekends(t)}}},{key:"disableFunction",get:function(){var e=this;return function(t){return e.evaluate("return ".concat(e.settings.disableFunction),{date:t})}}},{key:"timezone",get:function(){return this.componentInstance.getTimezone(this.settings)}},{key:"defaultSettings",get:function(){return h.defaultSettings}},{key:"addSuffix",value:function(e){var t=this;return this.addEventListener(e,"click",(function(){setTimeout((function(){t.calendar&&(!t.calendar.isOpen&&Date.now()-t.closedOn>200?t.calendar.open():t.calendar.isOpen&&t.calendar.close())}),0)})),e}},{key:"disabled",set:function(e){(function(e,t,n,r,o){if(!p(e,t,n,r||e)&&o)throw new Error("failed to set property")})(w(h.prototype),"disabled",e,this,!0),this.calendar&&(e?this.calendar._input.setAttribute("disabled","disabled"):this.calendar._input.removeAttribute("disabled"),this.calendar.close(),this.calendar.redraw())}},{key:"input",get:function(){return this.calendar?this.calendar.altInput:null}},{key:"disabledDates",get:function(){return this.settings.disabledDates?this.settings.disabledDates.split(",").map((function(e){var t=/\d{4}-\d{2}-\d{2}/g,n=e.match(t);if(n&&n.length)return 1===n.length?e.match(t)[0]:{from:e.match(t)[0],to:e.match(t)[1]}})):[]}},{key:"localeFormat",get:function(){var e="";return this.settings.enableDate&&(e+=this.defaultFormat.date),this.settings.enableTime&&(e+=this.defaultFormat.time),e}},{key:"dateTimeFormat",get:function(){return this.settings.useLocaleSettings?this.localeFormat:(0,a.convertFormatToFlatpickr)(this.dateFormat)}},{key:"dateFormat",get:function(){return s.default.get(this.settings,"format",k)}},{key:"getDateValue",value:function(e,t,n){return n?(0,a.momentDate)(e,this.valueFormat,this.timezone).format((0,a.convertFormatToMoment)(t)):(0,l.default)(e).format((0,a.convertFormatToMoment)(t))}},{key:"getValue",value:function(){if(!this.calendar)return y(w(h.prototype),"getValue",this).call(this);var e=this.calendar.selectedDates;return e&&e.length?e[0]instanceof Date?this.getDateValue(e[0],this.valueFormat,"date"===this.settings.saveAs):"Invalid Date":y(w(h.prototype),"getValue",this).call(this)}},{key:"isValueISO8601",value:function(e){return e&&"string"==typeof e&&e.match(/-[0-9]{2}T[0-9]{2}:/)}},{key:"setValue",value:function(e){var t="text"===this.settings.saveAs;if(!this.calendar)return e=e?(0,a.formatDate)(this.timezonesUrl,e,(0,a.convertFormatToMoment)(this.settings.format),this.timezone,(0,a.convertFormatToMoment)(this.valueMomentFormat)):e,y(w(h.prototype),"setValue",this).call(this,e);var n=this.loadZones();e?t||!this.settings.readOnly||n?this.isValueISO8601(e)?this.calendar.setDate(e,!1):this.calendar.setDate((0,l.default)(e,this.valueMomentFormat).toDate(),!1):this.calendar.setDate((0,a.momentDate)(e,this.valueFormat,this.timezone).format(),!1):this.calendar.clear(!1)}},{key:"getValueAsString",value:function(e,t){var n=t||this.dateFormat,r=this.calendar?this.valueFormat:this.settings.dateFormat;return"text"===this.settings.saveAs&&this.componentInstance.parent&&!this.settings.readOnly?(0,l.default)(e,(0,a.convertFormatToMoment)(r)).format((0,a.convertFormatToMoment)(r)):(0,a.formatDate)(this.timezonesUrl,e,n,this.timezone,(0,a.convertFormatToMoment)(r))}},{key:"setErrorClasses",value:function(e){this.input&&(e?(this.addClass(this.input,"is-invalid"),this.input.setAttribute("aria-invalid","true")):(this.removeClass(this.input,"is-invalid"),this.input.setAttribute("aria-invalid","false")))}},{key:"validationValue",value:function(e){return"string"==typeof e?new Date(e):e.map((function(e){return new Date(e)}))}},{key:"isCalendarElement",value:function(e){var t,n,r,o,i;return!e||!(null===(t=this.calendar)||void 0===t||null===(n=t.config)||void 0===n||null===(r=n.appendTo)||void 0===r||!r.contains(e))||(null===(o=this.calendar)||void 0===o||null===(i=o.calendarContainer)||void 0===i?void 0:i.contains(e))}},{key:"initFlatpickr",value:function(e){var t=this;if(this.calendar=new e(this._input,f(f({},this.settings),{},{disableMobile:!0})),this.calendar.altInput.addEventListener("input",(function(e){t.settings.allowInput&&t.settings.currentValue!==e.target.value&&(t.settings.manualInputValue=e.target.value,t.settings.isManuallyOverriddenValue=!0,t.settings.currentValue=e.target.value),""===e.target.value&&t.calendar.selectedDates.length>0?(t.settings.wasDefaultValueChanged=!0,t.settings.defaultValue=e.target.value,t.calendar.clear()):t.settings.wasDefaultValueChanged=!1})),this.settings.readOnly||s.default.some(["MMMM"],(function(e){return s.default.includes(t.settings.format,e)}))||this.setInputMask(this.calendar._input,(0,a.convertFormatToMask)(this.settings.format)),_){var n=this.calendar._handlers.find((function(e){var n=e.event,r=e.element;return"blur"===n&&r===t.calendar._input}));this.calendar._input.removeEventListener("blur",n.handler),this.addEventListener(this.calendar._input,"blur",(function(e){var n=t.settings.shadowRoot?t.settings.shadowRoot.activeElement:document.activeElement,r=e.relatedTarget?e.relatedTarget:n;e.target===t.calendar._input&&!t.isCalendarElement(r)&&t.calendar.setDate(t.calendar._input.value,!0,e.target===t.calendar.altInput?t.calendar.config.altFormat:t.calendar.config.dateFormat)}))}this.addEventListener(this.calendar._input,"blur",(function(e){var n=t.settings.shadowRoot?t.settings.shadowRoot.activeElement:document.activeElement,r=e.relatedTarget?e.relatedTarget:n;if(_&&!r||t.isCalendarElement(r)){if(!t.calendar.input.value&&t.calendar.config.noCalendar){var o,i,s,u,c=(0,l.default)({hour:null===(o=t.calendar)||void 0===o||null===(i=o.config)||void 0===i?void 0:i.defaultHour,minute:null===(s=t.calendar)||void 0===s||null===(u=s.config)||void 0===u?void 0:u.defaultMinute}).toDate();t.calendar.setDate(c,!0,t.settings.format)}}else{var f=t.calendar.input.value,d=f?(0,l.default)(t.calendar.input.value,(0,a.convertFormatToMoment)(t.valueFormat)).toDate():f;t.calendar.setDate(d,!0,t.settings.altFormat)}})),this.addEventListener(this.calendar.altInput,"keydown",(function(e){13===e.keyCode&&t.calendar.isOpen&&(t.calendar.close(),e.stopPropagation())})),this.setValue(this.componentValue)}},{key:"initShortcutButtonsPlugin",value:function(e){var t=this;this.settings.plugins=[e({button:this.component.shortcutButtons.map((function(e){return{label:e.label,attributes:e.attribute}})),onClick:function(e){var n=t.component.shortcutButtons[e].onClick,r=t.evaluate(n,{date:new Date},"date");t.calendar.setDate(r,!0)}})]}},{key:"componentValue",get:function(){var e=this.componentInstance.dataValue;return Array.isArray(e)&&(e=e[this.valueIndex]),e}},{key:"getFlatpickrFormatDate",value:function(e){var t=this;return function(n,r){return t.settings.readOnly&&r===t.settings.altFormat?!t.settings.enableTime||t.loadZones()?e.formatDate(n,r):new Date(t.getValue()).toString()===n.toString()?(0,a.formatOffset)(t.timezonesUrl,e.formatDate.bind(e),new Date(t.componentValue),r,t.timezone):(0,a.formatOffset)(t.timezonesUrl,e.formatDate.bind(e),n,r,t.timezone):e.formatDate(n,r)}}},{key:"destroy",value:function(){y(w(h.prototype),"destroy",this).call(this),this.calendar&&this.calendar.destroy()}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=S},581:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(19601),n(24812),n(68304),n(30489);var o=l(n(96486)),i=l(n(34558)),a=l(n(91459));function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){for(var n=0;n"+(null==(t=e.message)?"":t)+"\n"}},2101:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(68286);t.default={form:r.default}},83787:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},48433:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83787);t.default={form:r.default}},85539:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.disableBuilderActions||(n+='\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n '),n+"\n "+(null==(t=e.html)?"":t)+"\n
    \n"}},7581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85539);t.default={form:r.default}},82097:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},2434:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(82097);t.default={form:r.default}},17894:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title,{_userInput:!0}))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+"

    \n
    \n ",e.helplinks&&(n+='\n \n"),n+='\n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n
    \n

    '+(null==(t=e.t("Preview"))?"":t)+'

    \n
    \n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n
    \n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.componentInfo.help)?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},58809:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17894);t.default={form:r.default}},41852:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n '+(null==(t=e.t("Drag and Drop a form component"))?"":t)+"\n\n"}},59624:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41852);t.default={form:r.default}},70307:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n
    \n"}},92470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70307);t.default={form:r.default}},74913:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n\n"}},64959:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(74913);t.default={form:r.default}},86227:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},7569:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86227);t.default={form:r.default}},51382:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active"}},70897:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n '+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},5118:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var n,r="";return Array.prototype.join,r+='\n ',hasHeader&&(r+="\n \n \n ",columns.forEach((function(e){r+='\n \n "})),r+="\n \n \n "),r+="\n \n ",rows.forEach((function(e){r+="\n \n ",columns.forEach((function(t){r+='\n \n "})),r+="\n \n "})),r+="\n \n
    \n '+(null==(n=e.hideLabel?"":t(e.label||e.title))?"":n)+"\n ",e.tooltip&&(r+=' '),r+="\n
    \n '+(null==(n=e[t.key])?"":n)+"\n
    \n"}},14714:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70897),o=n(5118);t.default={form:r.default,html:o.default}},97842:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+'\n
    \n\n'}},11024:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97842);t.default={form:r.default}},44033:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n \n
    \n
    \n'}},95371:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44033);t.default={form:r.default}},61424:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},47456:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},43614:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(61424),o=n(47456);t.default={form:r.default,html:o.default}},44787:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"

    \n
      \n ",e.errors.forEach((function(r){n+='\n '+(null==(t=r.message)?"":t)+"\n "})),n+="\n
    \n"}},40079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44787);t.default={form:r.default}},96735:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},63646:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},20798:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(96735),o=n(63646);t.default={align:r.default,form:o.default}},65526:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      '+(null==(t=r.originalName||r.name)?"":t)+"\n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n
    \n '+(null==(t=e.t("Drop files to attach,"))?"":t)+"\n ",e.self.imageUpload&&e.component.webcam&&(n+='\n '+(null==(t=e.t("Use Camera,"))?"":t)+"\n "),n+="\n "+(null==(t=e.t("or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+"\n
    \n "),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n}},66565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65526);t.default={form:r.default}},18320:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},3429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18320);t.default={form:r.default}},42260:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if("fa"===e)switch(t){case"save":t="download";break;case"zoom-in":t="search-plus";break;case"zoom-out":t="search-minus";break;case"question-sign":t="question-circle";break;case"remove-circle":t="times-circle-o";break;case"new-window":t="window-restore";break;case"move":t="arrows"}return n?e+" "+e+"-"+t+" "+e+"-spin":e+" "+e+"-"+t}},65441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(91033),o=n(48433),i=n(7581),a=n(2434),l=n(58809),s=n(59624),u=n(92470),c=n(64959),f=n(7569),d=n(51382),p=n(14714),h=n(11024),m=n(95371),y=n(43614),v=n(20798),b=n(66565),g=n(3429),w=n(42260),k=n(55691),O=n(17875),_=n(35284),S=n(49074),P=n(36786),j=n(8609),x=n(3499),E=n(12477),C=n(96950),A=n(61659),T=n(92882),M=n(80710),R=n(634),D=n(83980),I=n(95722),L=n(45546),V=n(68497),N=n(72065),F=n(48866),B=n(16299),U=n(2101),z=n(40079);t.default={transform:function(e,t){return t&&"class"===e&&this.cssClasses.hasOwnProperty(t.toString())?this.cssClasses[t.toString()]:t},handleBuilderSidebarScroll:function(e){e.scrollResizeObserver&&e.scrollResizeObserver.disconnect(),e.scrollResizeObserver=new r.default((function(){setTimeout((function(){var t=e.refs,n=t.form,r=t.sidebar,o=n&&n.parentNode&&n.parentNode.clientHeight,i=r&&r.clientHeight,a=r&&r.parentNode&&r.parentNode.style;a&&o&&i&&(a.height=Math.max(i+20,o)+"px")}))})),e.scrollResizeObserver.observe(e.refs.form),e.scrollResizeObserver.observe(e.refs.sidebar)},clearBuilderSidebarScroll:function(e){e.scrollResizeObserver&&(e.scrollResizeObserver.disconnect(),e.scrollResizeObserver=null)},defaultIconset:"glyphicon",iconClass:w.default,cssClasses:d.default,builder:o.default,builderComponent:i.default,builderComponents:a.default,builderEditForm:l.default,builderPlaceholder:s.default,builderSidebar:u.default,builderSidebarGroup:c.default,columns:f.default,datagrid:p.default,day:h.default,dialog:m.default,editgrid:y.default,field:v.default,file:b.default,icon:g.default,input:k.default,label:O.default,message:_.default,modaldialog:S.default,modaledit:P.default,multiValueRow:j.default,multiValueTable:x.default,panel:E.default,radio:C.default,resourceAdd:A.default,signature:T.default,survey:M.default,tab:R.default,table:D.default,well:I.default,wizard:L.default,wizardHeader:V.default,wizardHeaderClassic:N.default,wizardHeaderVertical:F.default,wizardNav:B.default,errorsList:z.default,alert:U.default}},25169:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";if(Array.prototype.join,(e.prefix||e.suffix)&&(n+='\n
    \n '),n+="\n ",e.prefix&&(n+='\n
    \n ',e.prefix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.prefix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.prefix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n "),n+="\n ",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n <"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n >'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n",e.suffix&&(n+='\n
    \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n
    \n"),n+="\n",e.component.showCharCount&&(n+='\n\n'),n+="\n",e.component.showWordCount&&(n+='\n\n'),n+"\n"}},81944:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},55691:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25169),o=n(81944);t.default={form:r.default,html:o.default}},83340:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.label.hidden||(n+="\n "+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n "),n+"\n\n"}},17875:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83340);t.default={form:r.default}},68059:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'

    '+(null==(t=e.message)?"":t)+"

    \n"}},35284:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(68059);t.default={form:r.default}},64375:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n '+(null==(t=e.t("Close"))?"":t)+'\n \n
    \n
    \n
    \n'}},49074:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(64375);t.default={form:r.default}},90685:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n \n \n \n
    '+(null==(t=e.content)?"":t)+"
    \n
    \n"}},36786:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(90685);t.default={form:r.default}},1948:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},8609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1948);t.default={form:r.default}},48021:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},3499:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(48021);t.default={form:r.default}},16094:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',(!e.component.hideLabel||e.builder||e.component.collapsible||e.component.tooltip)&&(n+='\n
    \n

    \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n

    \n
    \n "),n+="\n ",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},12477:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16094);t.default={form:r.default}},22159:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(r){for(var o in n+='\n
    \n \n
    \n "})),n+="\n
    \n"}},31152:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label,{_userInput:!0})})).join(", "))?"":t)+"\n
    \n"}},96950:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22159),o=n(31152);t.default={form:r.default,html:o.default}},72264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},61659:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(72264);t.default={form:r.default}},16866:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},96141:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},92882:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16866),o=n(96141);t.default={form:r.default,html:o.default}},40207:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n
    \n "+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n \n \n
    \n"}},55754:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},80710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(40207),o=n(55754);t.default={form:r.default,html:o.default}},87603:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n
    \n
    \n

    '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+'

    \n
    \n
    \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n
    \n"})),n+="\n"}},17469:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.component.components.forEach((function(r,o){n+='\n
    '+(null==(t=e.tabComponents[o])?"":t)+"
    \n "})),n+="\n
    \n
    \n"}},634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(87603),o=n(17469);t.default={flat:r.default,form:o.default}},94957:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    "+(null==(t=e.t(r,{_userInput:!0}))?"":t)+"
    \n "})),n+="\n
    \n"}},83980:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(94957);t.default={form:r.default}},25378:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},95722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25378);t.default={form:r.default}},55040:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},24088:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?n+='\n
    \n
    \n '+(null==(t=e.wizardHeader)?"":t)+'\n
    \n
    \n '+(null==(t=e.components)?"":t)+'\n
    \n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n ":n+=" \n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+" \n
    \n
    "}},45546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(55040),o=n(24088);t.default={form:o.default,builder:r.default}},38917:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},68497:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38917);t.default={form:r.default}},18760:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},72065:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18760);t.default={form:r.default}},34611:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},48866:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34611);t.default={form:r.default}},81201:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.buttons.cancel&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.previous&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.next&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.submit&&(n+='\n
    • \n \n
    • \n "),n+"\n
    \n"}},16299:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(81201);t.default={form:r.default}},68531:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65441);t.default={bootstrap3:r.default}},57062:function(e){var t;window,t=()=>(()=>{"use strict";var e={282:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var r=n(883);t.addChoice=function(e){var t=e.value,n=e.label,o=e.id,i=e.groupId,a=e.disabled,l=e.elementId,s=e.customProperties,u=e.placeholder,c=e.keyCode;return{type:r.ACTION_TYPES.ADD_CHOICE,value:t,label:n,id:o,groupId:i,disabled:a,elementId:l,customProperties:s,placeholder:u,keyCode:c}},t.filterChoices=function(e){return{type:r.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:r.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:r.ACTION_TYPES.CLEAR_CHOICES}}},783:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var r=n(883);t.addGroup=function(e){var t=e.value,n=e.id,o=e.active,i=e.disabled;return{type:r.ACTION_TYPES.ADD_GROUP,value:t,id:n,active:o,disabled:i}}},464:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var r=n(883);t.addItem=function(e){var t=e.value,n=e.label,o=e.id,i=e.choiceId,a=e.groupId,l=e.customProperties,s=e.placeholder,u=e.keyCode;return{type:r.ACTION_TYPES.ADD_ITEM,value:t,label:n,id:o,choiceId:i,groupId:a,customProperties:l,placeholder:s,keyCode:u}},t.removeItem=function(e,t){return{type:r.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:r.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},137:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.resetTo=t.clearAll=void 0;var r=n(883);t.clearAll=function(){return{type:r.ACTION_TYPES.CLEAR_ALL}},t.resetTo=function(e){return{type:r.ACTION_TYPES.RESET_TO,state:e}},t.setIsLoading=function(e){return{type:r.ACTION_TYPES.SET_IS_LOADING,isLoading:e}}},373:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o=0?this._store.getGroupById(o):null;return this._store.dispatch((0,u.highlightItem)(n,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:n,value:a,label:s,groupValue:c&&c.value?c.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,n=e.groupId,r=void 0===n?-1:n,o=e.value,i=void 0===o?"":o,a=e.label,l=void 0===a?"":a,s=r>=0?this._store.getGroupById(r):null;return this._store.dispatch((0,u.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:i,label:l,groupValue:s&&s.value?s.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(n){t._removeItem(n),e&&t._triggerChange(n.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow,t.dropdown.height),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,n){var r=e?n.value:n;return t.push(r),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,n,r){var o=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===n&&(n="label"),void 0===r&&(r=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(r&&this.clearChoices(),"function"==typeof e){var i=e(this);if("function"==typeof Promise&&i instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return o._handleLoadingState(!0)})).then((function(){return i})).then((function(e){return o.setChoices(e,t,n,r)})).catch((function(e){o.config.silent||console.error(e)})).then((function(){return o._handleLoadingState(!1)})).then((function(){return o}));if(!Array.isArray(i))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof i));return this.setChoices(i,t,n,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)o._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:n});else{var r=e;o._addChoice({value:r[t],label:r[n],isSelected:!!r.selected,isDisabled:!!r.disabled,placeholder:!!r.placeholder,customProperties:r.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,l.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,c.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,n=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,n=t.activeGroups,r=t.activeChoices,o=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),n.length>=1&&!this._isSearching){var i=r.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));i.length>=1&&(o=this._createChoicesFragment(i,o)),o=this._createGroupsFragment(n,r,o)}else r.length>=1&&(o=this._createChoicesFragment(r,o));if(o.childNodes&&o.childNodes.length>0){var a=this._store.activeItems,l=this._canAddItem(a,this.input.value);if(l.response)this.choiceList.append(o),this._highlightChoice();else{var s=this._getTemplate("notice",l.notice);this.choiceList.append(s)}}else{var u=void 0;s=void 0,this._isSearching?(s="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,u=this._getTemplate("notice",s,"no-results")):(s="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,u=this._getTemplate("notice",s,"no-choices")),this.choiceList.append(u)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,n){var r=this;return void 0===n&&(n=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var o=function(e){return t.filter((function(t){return r._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===r.config.renderSelectedChoices||!t.selected)}))}(e);if(o.length>=1){var i=r._getTemplate("choiceGroup",e);n.appendChild(i),r._createChoicesFragment(o,n,!0)}})),n},e.prototype._createChoicesFragment=function(e,t,n){var o=this;void 0===t&&(t=document.createDocumentFragment()),void 0===n&&(n=!1);var i=this.config,a=i.renderSelectedChoices,l=i.searchResultLimit,s=i.renderChoiceLimit,u=this._isSearching?h.sortByScore:this.config.sorter,c=function(e){if("auto"!==a||o._isSelectOneElement||!e.selected){var n=o._getTemplate("choice",e,o.config.itemSelectText);t.appendChild(n)}},f=e;"auto"!==a||this._isSelectOneElement||(f=e.filter((function(e){return!e.selected})));var d=f.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,m=d.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(u);var y=f.length,v=this._isSelectOneElement?r(r([],p,!0),m,!0):m;this._isSearching?y=l:s&&s>0&&!n&&(y=s);for(var b=0;b=r){var a=o?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:a})}else i&&(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var n=!0,r="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var o=(0,h.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,r="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&o&&n&&(n=!1,r="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&n&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(n=!1,r="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:n,notice:r}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,n="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(n," "))return 0;var o=this._store.searchableChoices,i=t,s=Object.assign(this.config.fuseOptions,{keys:r([],this.config.searchFields,!0),includeMatches:!0}),u=new a.default(o,s).search(i);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,l.filterChoices)(u)),u.length},e.prototype._addEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,n=this._store.activeItems,r=this.input.isFocussed,o=this.dropdown.isActive,i=this.itemList.hasChildren(),a=String.fromCharCode(t),l=/[^\x00-\x1F]/.test(a),s=d.KEY_CODES.BACK_KEY,u=d.KEY_CODES.DELETE_KEY,c=d.KEY_CODES.ENTER_KEY,f=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,h=d.KEY_CODES.UP_KEY,m=d.KEY_CODES.DOWN_KEY,y=d.KEY_CODES.PAGE_UP_KEY,v=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||o||!l||(this.showDropdown(),this.input.isFocussed||(this.input.value+=e.key.toLowerCase())),t){case f:return this._onSelectKey(e,i);case c:return this._onEnterKey({event:e,activeItems:n,hasActiveDropdown:o});case p:return this._onEscapeKey(o);case h:case y:case m:case v:return this._onDirectionKey({event:e,hasActiveDropdown:o});case u:case s:return this._onDeleteKey(e,n,r)}},e.prototype._onKeyUp=function(e){var t=e.target,n=e.keyCode,r=this.input.value,o=this._store.activeItems,i=this._canAddItem(o,r),a=d.KEY_CODES.BACK_KEY,s=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(i.notice&&r){var u=this._getTemplate("notice",i.notice);this.dropdown.element.innerHTML=u.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var c=(n===a||n===s)&&t&&!t.value,f=!this._isTextElement&&this._isSearching,p=this._canSearch&&i.response;c&&f?(this._isSearching=!1,this._store.dispatch((0,l.activateChoices)(!0))):p&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var n=e.ctrlKey,r=e.metaKey;(n||r)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e){var t=e.event,n=e.activeItems,r=e.hasActiveDropdown,o=t.target,i=d.KEY_CODES.ENTER_KEY,a=o&&o.hasAttribute("data-button");if(this._isTextElement&&o&&o.value){var l=this.input.value;this._canAddItem(n,l).response&&(this.hideDropdown(!0),this._addItem({value:l}),this._triggerChange(l),this.clearInput())}if(a&&(this._handleButtonAction(n,o),t.preventDefault()),r){var s=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));s&&(n[0]&&(n[0].keyCode=i),this._handleChoiceAction(n,s)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e){var t=e.event,n=e.hasActiveDropdown,r=t.keyCode,o=t.metaKey,i=d.KEY_CODES.DOWN_KEY,a=d.KEY_CODES.PAGE_UP_KEY,l=d.KEY_CODES.PAGE_DOWN_KEY;if(n||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var s=r===i||r===l?1:-1,u="[data-choice-selectable]",c=void 0;if(o||r===l||r===a)c=s>0?this.dropdown.element.querySelector("".concat(u,":last-of-type")):this.dropdown.element.querySelector(u);else{var f=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));c=f?(0,h.getAdjacentEl)(f,u,s):this.dropdown.element.querySelector(u)}c&&((0,h.isScrolledIntoView)(c,this.choiceList.element,s)||this.choiceList.scrollToChildElement(c,s),this._highlightChoice(c)),t.preventDefault()}},e.prototype._onDeleteKey=function(e,t,n){var r=e.target;this._isSelectOneElement||r.value||!n||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(b&&this.choiceList.element.contains(t)){var n=this.choiceList.element.firstElementChild,r="ltr"===this._direction?e.offsetX>=n.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,n=this,r=e.target;r&&this.containerOuter.element.contains(r)&&((t={})[d.TEXT_TYPE]=function(){r===n.input.element&&n.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){n.containerOuter.addFocusState(),r===n.input.element&&n.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){r===n.input.element&&(n.showDropdown(!0),n.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,n=this,r=e.target;if(r&&this.containerOuter.element.contains(r)&&!this._isScrollingOnIe){var o=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){r===n.input.element&&(n.containerOuter.removeFocusState(),o&&n.unhighlightAll(),n.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){n.containerOuter.removeFocusState(),(r===n.input.element||r===n.containerOuter.element&&!n._canSearch)&&n.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){r===n.input.element&&(n.containerOuter.removeFocusState(),n.hideDropdown(!0),o&&n.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,c.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var r=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),r?this._highlightPosition=n.indexOf(r):(r=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(r=n[0]),r.classList.add(this.config.classNames.highlightedState),r.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:r}),this.dropdown.isActive&&(this.input.setActiveDescendant(r.id),this.containerOuter.setActiveDescendant(r.id))}},e.prototype._addItem=function(e){var t=e.value,n=e.label,r=void 0===n?null:n,o=e.choiceId,i=void 0===o?-1:o,a=e.groupId,l=void 0===a?-1:a,s=e.customProperties,c=void 0===s?{}:s,f=e.placeholder,p=void 0!==f&&f,h=e.keyCode,m=void 0===h?-1:h,y="string"==typeof t?t.trim():t,v=this._store.items,b=r||y,g=i||-1,w=l>=0?this._store.getGroupById(l):null,k=v?v.length+1:1;this.config.prependValue&&(y=this.config.prependValue+y.toString()),this.config.appendValue&&(y+=this.config.appendValue.toString()),this._store.dispatch((0,u.addItem)({value:y,label:b,id:k,choiceId:g,groupId:l,customProperties:c,placeholder:p,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(k),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:k,value:y,label:b,customProperties:c,groupValue:w&&w.value?w.value:null,keyCode:m})},e.prototype._removeItem=function(e){var t=e.id,n=e.value,r=e.label,o=e.customProperties,i=e.choiceId,a=e.groupId,l=a&&a>=0?this._store.getGroupById(a):null;t&&i&&(this._store.dispatch((0,u.removeItem)(t,i)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:n,label:r,customProperties:o,groupValue:l&&l.value?l.value:null}))},e.prototype._addChoice=function(e){var t=e.value,n=e.label,r=void 0===n?null:n,o=e.isSelected,i=void 0!==o&&o,a=e.isDisabled,s=void 0!==a&&a,u=e.groupId,c=void 0===u?-1:u,f=e.customProperties,d=void 0===f?{}:f,p=e.placeholder,h=void 0!==p&&p,m=e.keyCode,y=void 0===m?-1:m;if(null!=t){var v=this._store.choices,b=r||t,g=v?v.length+1:1,w="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(g);this._store.dispatch((0,l.addChoice)({id:g,groupId:c,elementId:w,value:t,label:b,disabled:s,customProperties:d,placeholder:h,keyCode:y})),i&&this._addItem({value:t,label:b,choiceId:g,customProperties:d,placeholder:h,keyCode:y})}},e.prototype._addGroup=function(e){var t=this,n=e.group,r=e.id,o=e.valueKey,i=void 0===o?"value":o,a=e.labelKey,l=void 0===a?"label":a,u=(0,h.isType)("Object",n)?n.choices:Array.from(n.getElementsByTagName("OPTION")),c=r||Math.floor((new Date).valueOf()*Math.random()),f=!!n.disabled&&n.disabled;u?(this._store.dispatch((0,s.addGroup)({value:n.label,id:c,active:!0,disabled:f})),u.forEach((function(e){var n=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[i],label:(0,h.isType)("Object",e)?e[l]:e.innerHTML,isSelected:e.selected,isDisabled:n,groupId:c,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,s.addGroup)({value:n.label,id:n.id,active:!1,disabled:n.disabled}))},e.prototype._getTemplate=function(e){for(var t,n=[],o=1;o{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=n(883),i=function(){function e(e){var t=e.element,n=e.type,r=e.classNames,o=e.position;this.element=t,this.classNames=r,this.type=n,this.position=o,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return e.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},e.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.shouldFlip=function(e,t,n){if("number"!=typeof e)return!1;var r=!1;return"auto"===this.position?(r=!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches)&&n.getBoundingClientRect().top-t<0&&(r=!1):"top"===this.position&&(r=!0),r},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t,this.element)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},e.prototype.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},e.prototype.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===o.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===o.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){(0,r.wrap)(e,this.element)},e.prototype.unwrap=function(e){this.element.parentNode&&(this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element))},e.prototype.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=i},217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){var t=e.element,n=e.type,r=e.classNames;this.element=t,this.classNames=r,this.type=n,this.isActive=!1}return Object.defineProperty(e.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.element.getBoundingClientRect().height},enumerable:!1,configurable:!0}),e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}();t.default=n},520:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedSelect=t.WrappedInput=t.List=t.Input=t.Container=t.Dropdown=void 0;var o=r(n(217));t.Dropdown=o.default;var i=r(n(613));t.Container=i.default;var a=r(n(11));t.Input=a.default;var l=r(n(624));t.List=l.default;var s=r(n(541));t.WrappedInput=s.default;var u=r(n(982));t.WrappedSelect=u.default},11:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=n(883),i=function(){function e(e){var t=e.element,n=e.type,r=e.classNames,o=e.preventPaste;this.element=t,this.type=n,this.classNames=r,this.preventPaste=o,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return(0,r.sanitise)(this.element.value)},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.element.value},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.style,n=e.value,r=e.placeholder;t.minWidth="".concat(r.length+1,"ch"),t.width="".concat(n.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==o.SELECT_ONE_TYPE&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=i},624:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(883),o=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.append=function(e){this.element.appendChild(e)},e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.hasChildren=function(){return this.element.hasChildNodes()},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var n=this;if(e){var r=this.element.offsetHeight,o=this.element.scrollTop+r,i=e.offsetHeight,a=e.offsetTop+i,l=t>0?this.element.scrollTop+a-o:e.offsetTop;requestAnimationFrame((function(){n._animateScroll(l,t)}))}},e.prototype._scrollDown=function(e,t,n){var r=(n-e)/t,o=r>1?r:1;this.element.scrollTop=e+o},e.prototype._scrollUp=function(e,t,n){var r=(e-n)/t,o=r>1?r:1;this.element.scrollTop=e-o},e.prototype._animateScroll=function(e,t){var n=this,o=r.SCROLLING_SPEED,i=this.element.scrollTop,a=!1;t>0?(this._scrollDown(i,o,e),ie&&(a=!0)),a&&requestAnimationFrame((function(){n._animateScroll(e,t)}))},e}();t.default=o},730:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=function(){function e(e){var t=e.element,n=e.classNames;if(this.element=t,this.classNames=n,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,r.dispatchEvent)(this.element,e,t)},e}();t.default=o},541:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=t.element,r=t.classNames,o=t.delimiter,i=e.call(this,{element:n,classNames:r})||this;return i.delimiter=o,i}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(i(n(730)).default);t.default=a},982:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=t.element,r=t.classNames,o=t.template,i=e.call(this,{element:n,classNames:r})||this;return i.template=o,i}return o(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,n=document.createDocumentFragment();e.forEach((function(e){return r=e,o=t.template(r),void n.appendChild(o);var r,o})),this.appendDocFragment(n)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(i(n(730)).default);t.default=a},883:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var r=n(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:r.sortByAlpha,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat((0,r.sanitise)(e),'"')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},18:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},978:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},359:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},285:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},187:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(18),t),o(n(978),t),o(n(948),t),o(n(359),t),o(n(285),t),o(n(533),t),o(n(287),t),o(n(132),t),o(n(837),t),o(n(598),t),o(n(369),t),o(n(37),t),o(n(47),t),o(n(923),t),o(n(876),t)},287:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},837:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},598:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},369:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},923:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},876:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},799:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomProperties=t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,n){var r=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return r=r.replace(/(:|\.|\[|\]|,)/g,""),"".concat(n,"-").concat(r)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,n){return null!=n&&(0,t.getType)(n)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,n){void 0===n&&(n=1);for(var r="".concat(n>0?"next":"previous","ElementSibling"),o=e[r];o;){if(o.matches(t))return o;o=o[r]}return o},t.isScrolledIntoView=function(e,t,n){return void 0===n&&(n=1),!!e&&(n>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var l=r;return l.choiceId&&l.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(l.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var s=r;return e.map((function(e){var t=e;return t.active=s.results.some((function(e){var n=e.item,r=e.score;return n.id===t.id&&(t.score=r,!0)})),t}));case"ACTIVATE_CHOICES":var u=r;return e.map((function(e){var t=e;return t.active=u.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=!1,t.default=function(e,n){return void 0===e&&(e=t.defaultState),void 0===n&&(n={}),"SET_IS_LOADING"===n.type?n.isLoading:e}},744:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o{Object.defineProperty(t,"__esModule",{value:!0});var n={containerOuter:function(e,t,n,r,o,i,a){var l=e.classNames.containerOuter,s=Object.assign(document.createElement("div"),{className:l});return s.dataset.type=i,t&&(s.dir=t),r&&(s.tabIndex=0),n&&(s.setAttribute("role",o?"combobox":"listbox"),o&&s.setAttribute("aria-autocomplete","list")),s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),a&&s.setAttribute("aria-labelledby",a),s},containerInner:function(e){var t=e.classNames.containerInner;return Object.assign(document.createElement("div"),{className:t})},itemList:function(e,t){var n=e.classNames,r=n.list,o=n.listSingle,i=n.listItems;return Object.assign(document.createElement("div"),{className:"".concat(r," ").concat(t?o:i)})},placeholder:function(e,t){var n,r=e.allowHTML,o=e.classNames.placeholder;return Object.assign(document.createElement("div"),((n={className:o})[r?"innerHTML":"innerText"]=t,n))},item:function(e,t,n){var r,o,i=e.allowHTML,a=e.classNames,l=a.item,s=a.button,u=a.highlightedState,c=a.itemSelectable,f=a.placeholder,d=t.id,p=t.value,h=t.label,m=t.customProperties,y=t.active,v=t.disabled,b=t.highlighted,g=t.placeholder,w=Object.assign(document.createElement("div"),((r={className:l})[i?"innerHTML":"innerText"]=h,r));if(Object.assign(w.dataset,{item:"",id:d,value:p,customProperties:m}),y&&w.setAttribute("aria-selected","true"),v&&w.setAttribute("aria-disabled","true"),g&&w.classList.add(f),w.classList.add(b?u:c),n){v&&w.classList.remove(c),w.dataset.deletable="";var k="Remove item",O=Object.assign(document.createElement("button"),((o={type:"button",className:s})[i?"innerHTML":"innerText"]=k,o));O.setAttribute("aria-label","".concat(k,": '").concat(p,"'")),O.dataset.button="",w.appendChild(O)}return w},choiceList:function(e,t){var n=e.classNames.list,r=Object.assign(document.createElement("div"),{className:n});return t||r.setAttribute("aria-multiselectable","true"),r.setAttribute("role","listbox"),r},choiceGroup:function(e,t){var n,r=e.allowHTML,o=e.classNames,i=o.group,a=o.groupHeading,l=o.itemDisabled,s=t.id,u=t.value,c=t.disabled,f=Object.assign(document.createElement("div"),{className:"".concat(i," ").concat(c?l:"")});return f.setAttribute("role","group"),Object.assign(f.dataset,{group:"",id:s,value:u}),c&&f.setAttribute("aria-disabled","true"),f.appendChild(Object.assign(document.createElement("div"),((n={className:a})[r?"innerHTML":"innerText"]=u,n))),f},choice:function(e,t,n){var r,o=e.allowHTML,i=e.classNames,a=i.item,l=i.itemChoice,s=i.itemSelectable,u=i.selectedState,c=i.itemDisabled,f=i.placeholder,d=t.id,p=t.value,h=t.label,m=t.groupId,y=t.elementId,v=t.disabled,b=t.selected,g=t.placeholder,w=Object.assign(document.createElement("div"),((r={id:y})[o?"innerHTML":"innerText"]=h,r.className="".concat(a," ").concat(l),r));return b&&w.classList.add(u),g&&w.classList.add(f),w.setAttribute("role",m&&m>0?"treeitem":"option"),Object.assign(w.dataset,{choice:"",id:d,value:p,selectText:n}),v?(w.classList.add(c),w.dataset.choiceDisabled="",w.setAttribute("aria-disabled","true")):(w.classList.add(s),w.dataset.choiceSelectable=""),w},input:function(e,t){var n=e.classNames,r=n.input,o=n.inputCloned,i=Object.assign(document.createElement("input"),{type:"text",name:"search_terms",className:"".concat(r," ").concat(o),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return i.setAttribute("role","textbox"),i.setAttribute("aria-autocomplete","list"),i.setAttribute("aria-label",t),i},dropdown:function(e){var t=e.classNames,n=t.list,r=t.listDropdown,o=document.createElement("div");return o.classList.add(n,r),o.setAttribute("aria-expanded","false"),o},notice:function(e,t,n){var r,o=e.allowHTML,i=e.classNames,a=i.item,l=i.itemChoice,s=i.noResults,u=i.noChoices;void 0===n&&(n="");var c=[a,l];return"no-choices"===n?c.push(u):"no-results"===n&&c.push(s),Object.assign(document.createElement("div"),((r={})[o?"innerHTML":"innerText"]=t,r.className=c.join(" "),r))},option:function(e){var t=e.label,n=e.value,r=e.customProperties,o=e.active,i=e.disabled,a=new Option(t,n,!1,o);return r&&(a.dataset.customProperties="".concat(r)),a.disabled=!!i,a}};t.default=n},996:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function l(e,n,s){(s=s||{}).arrayMerge=s.arrayMerge||o,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=r;var u=Array.isArray(n);return u===Array.isArray(e)?u?s.arrayMerge(e,n,s):function(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}(e,n,s):r(n,s)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var s=l;e.exports=s},221:(e,t,n)=>{function r(e){return Array.isArray?Array.isArray(e):"[object Array]"===u(e)}function o(e){return"string"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e}function l(e){return null!=e}function s(e){return!e.trim().length}function u(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}n.r(t),n.d(t,{default:()=>F});const c=Object.prototype.hasOwnProperty;class f{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=d(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let t=null,n=null,i=null,a=1,l=null;if(o(e)||r(e))i=e,t=p(e),n=h(e);else{if(!c.call(e,"name"))throw new Error("Missing name property in key");const r=e.name;if(i=r,c.call(e,"weight")&&(a=e.weight,a<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(r));t=p(r),n=h(r),l=e.getFn}return{path:t,id:n,weight:a,src:i,getFn:l}}function p(e){return r(e)?e:e.split(".")}function h(e){return r(e)?e.join("."):e}var m={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(l(e))if(t[f]){const d=e[t[f]];if(!l(d))return;if(f===t.length-1&&(o(d)||i(d)||function(e){return!0===e||!1===e||function(e){return a(e)&&null!==e}(e)&&"[object Boolean]"==u(e)}(d)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(r(d)){s=!0;for(let e=0,n=d.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();o(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let a=t.getFn?t.getFn(e):this.getFn(e,t.path);if(l(a))if(r(a)){let e=[];const t=[{nestedArrIndex:-1,value:a}];for(;t.length;){const{nestedArrIndex:n,value:i}=t.pop();if(l(i))if(o(i)&&!s(i)){let t={v:i,i:n,n:this.norm.get(i)};e.push(t)}else r(i)&&i.forEach(((e,n)=>{t.push({nestedArrIndex:n,value:e})}))}n.$[i]=e}else if(o(a)&&!s(a)){let e={v:a,n:this.norm.get(a)};n.$[i]=e}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function b(e,t,{getFn:n=m.getFn,fieldNormWeight:r=m.fieldNormWeight}={}){const o=new v({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(d)),o.setSources(t),o.create(),o}function g(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=m.distance,ignoreLocation:i=m.ignoreLocation}={}){const a=t/e.length;if(i)return a;const l=Math.abs(r-n);return o?a+l/o:l?1:a}const w=32;function k(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:e,alphabet:k(e),startIndex:t})},c=this.pattern.length;if(c>w){let e=0;const t=c%w,n=c-t;for(;e{const{isMatch:h,score:y,indices:v}=function(e,t,n,{location:r=m.location,distance:o=m.distance,threshold:i=m.threshold,findAllMatches:a=m.findAllMatches,minMatchCharLength:l=m.minMatchCharLength,includeMatches:s=m.includeMatches,ignoreLocation:u=m.ignoreLocation}={}){if(t.length>w)throw new Error("Pattern length exceeds max of 32.");const c=t.length,f=e.length,d=Math.max(0,Math.min(r,f));let p=i,h=d;const y=l>1||s,v=y?Array(f):[];let b;for(;(b=e.indexOf(t,h))>-1;){let e=g(t,{currentLocation:b,expectedLocation:d,distance:o,ignoreLocation:u});if(p=Math.min(e,p),h=b+c,y){let e=0;for(;e=s;i-=1){let a=i-1,l=n[e.charAt(a)];if(y&&(v[a]=+!!l),b[i]=(b[i+1]<<1|1)&l,r&&(b[i]|=(k[i+1]|k[i])<<1|1|k[i+1]),b[i]&S&&(O=g(t,{errors:r,currentLocation:a,expectedLocation:d,distance:o,ignoreLocation:u}),O<=p)){if(p=O,h=a,h<=d)break;s=Math.max(1,2*d-h)}}if(g(t,{errors:r+1,currentLocation:d,expectedLocation:d,distance:o,ignoreLocation:u})>p)break;k=b}const P={isMatch:h>=0,score:Math.max(.001,O)};if(y){const e=function(e=[],t=m.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let a=e.length;i=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}(v,l);e.length?s&&(P.indices=e):P.isMatch=!1}return P}(e,t,d,{location:r+p,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:l,includeMatches:n,ignoreLocation:s});h&&(f=!0),c+=y,h&&v&&(u=[...u,...v])}));let d={isMatch:f,score:f?c/this.chunks.length:1};return f&&n&&(d.indices=u),d}}class _{constructor(e){this.pattern=e}static isMultiMatch(e){return S(e,this.multiRegex)}static isSingleMatch(e){return S(e,this.singleRegex)}search(){}}function S(e,t){const n=e.match(t);return n?n[1]:null}class P extends _{constructor(e,{location:t=m.location,threshold:n=m.threshold,distance:r=m.distance,includeMatches:o=m.includeMatches,findAllMatches:i=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,isCaseSensitive:l=m.isCaseSensitive,ignoreLocation:s=m.ignoreLocation}={}){super(e),this._bitapSearch=new O(e,{location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:s})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class j extends _{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0;const r=[],o=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+o,r.push([t,n-1]);const i=!!r.length;return{isMatch:i,score:i?0:1,indices:r}}}const x=[class extends _{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},j,class extends _{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},P],E=x.length,C=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,A=new Set([P.type,j.type]);const T=[];function M(e,t){for(let n=0,r=T.length;n!(!e.$and&&!e.$or),I=e=>({[R]:Object.keys(e).map((t=>({[t]:e[t]})))});function L(e,t,{auto:n=!0}={}){const i=e=>{let l=Object.keys(e);const s=(e=>!!e.$path)(e);if(!s&&l.length>1&&!D(e))return i(I(e));if((e=>!r(e)&&a(e)&&!D(e))(e)){const r=s?e.$path:l[0],i=s?e.$val:e[r];if(!o(i))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:h(r),pattern:i};return n&&(a.searcher=M(i,t)),a}let u={children:[],operator:l[0]};return l.forEach((t=>{const n=e[t];r(n)&&n.forEach((e=>{u.children.push(i(e))}))})),u};return D(e)||(e=I(e)),i(e)}function V(e,t){const n=e.matches;t.matches=[],l(n)&&n.forEach((e=>{if(!l(e.indices)||!e.indices.length)return;const{indices:n,value:r}=e;let o={indices:n,value:r};e.key&&(o.key=e.key.src),e.idx>-1&&(o.refIndex=e.idx),t.matches.push(o)}))}function N(e,t){t.score=e.score}class F{constructor(e,t={},n){this.options={...m,...t},this.options.useExtendedSearch,this._keyStore=new f(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof v))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){l(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,r=this._docs.length;n{let n=1;e.matches.forEach((({key:e,norm:r,score:o})=>{const i=e?e.weight:null;n*=Math.pow(0===o&&i?Number.EPSILON:o,(i||1)*(t?1:r))})),e.score=n}))}(u,{ignoreFieldNorm:s}),a&&u.sort(l),i(t)&&t>-1&&(u=u.slice(0,t)),function(e,t,{includeMatches:n=m.includeMatches,includeScore:r=m.includeScore}={}){const o=[];return n&&o.push(V),r&&o.push(N),e.map((e=>{const{idx:n}=e,r={item:t[n],refIndex:n};return o.length&&o.forEach((t=>{t(e,r)})),r}))}(u,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=M(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach((({v:e,i:n,n:o})=>{if(!l(e))return;const{isMatch:i,score:a,indices:s}=t.searchIn(e);i&&r.push({item:e,idx:n,matches:[{score:a,value:e,norm:o,indices:s}]})})),r}_searchLogical(e){const t=L(e,this.options),n=(e,t,r)=>{if(!e.children){const{keyId:n,searcher:o}=e,i=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:o});return i&&i.length?[{idx:r,item:t,matches:i}]:[]}const o=[];for(let i=0,a=e.children.length;i{if(l(e)){let a=n(t,e,r);a.length&&(o[r]||(o[r]={idx:r,item:e,matches:[]},i.push(o[r])),a.forEach((({matches:e})=>{o[r].matches.push(...e)})))}})),i}_searchObjectList(e){const t=M(e,this.options),{keys:n,records:r}=this._myIndex,o=[];return r.forEach((({$:e,i:r})=>{if(!l(e))return;let i=[];n.forEach(((n,r)=>{i.push(...this._findMatches({key:n,value:e[r],searcher:t}))})),i.length&&o.push({idx:r,item:e,matches:i})})),o}_findMatches({key:e,value:t,searcher:n}){if(!l(t))return[];let o=[];if(r(t))t.forEach((({v:t,i:r,n:i})=>{if(!l(t))return;const{isMatch:a,score:s,indices:u}=n.searchIn(t);a&&o.push({score:s,key:e,value:t,idx:r,norm:i,indices:u})}));else{const{v:r,n:i}=t,{isMatch:a,score:l,indices:s}=n.searchIn(r);a&&o.push({score:l,key:e,value:r,norm:i,indices:s})}return o}}F.version="6.6.2",F.createIndex=b,F.parseIndex=function(e,{getFn:t=m.getFn,fieldNormWeight:n=m.fieldNormWeight}={}){const{keys:r,records:o}=e,i=new v({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i},F.config=m,F.parseQuery=L,function(...e){T.push(...e)}(class{constructor(e,{isCaseSensitive:t=m.isCaseSensitive,includeMatches:n=m.includeMatches,minMatchCharLength:r=m.minMatchCharLength,ignoreLocation:o=m.ignoreLocation,findAllMatches:i=m.findAllMatches,location:a=m.location,threshold:l=m.threshold,distance:s=m.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:i,ignoreLocation:o,location:a,threshold:l,distance:s},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let n=e.trim().split(C).filter((e=>e&&!!e.trim())),r=[];for(let e=0,o=n.length;e{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;tc,applyMiddleware:()=>b,bindActionCreators:()=>y,combineReducers:()=>h,compose:()=>v,createStore:()=>d,legacy_createStore:()=>p});var s="function"==typeof Symbol&&Symbol.observable||"@@observable",u=function(){return Math.random().toString(36).substring(7).split("").join(".")},c={INIT:"@@redux/INIT"+u(),REPLACE:"@@redux/REPLACE"+u(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+u()}};function f(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function d(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(l(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(l(1));return n(d)(e,t)}if("function"!=typeof e)throw new Error(l(2));var o=e,i=t,a=[],u=a,p=!1;function h(){u===a&&(u=a.slice())}function m(){if(p)throw new Error(l(3));return i}function y(e){if("function"!=typeof e)throw new Error(l(4));if(p)throw new Error(l(5));var t=!0;return h(),u.push(e),function(){if(t){if(p)throw new Error(l(6));t=!1,h();var n=u.indexOf(e);u.splice(n,1),a=null}}}function v(e){if(!f(e))throw new Error(l(7));if(void 0===e.type)throw new Error(l(8));if(p)throw new Error(l(9));try{p=!0,i=o(i,e)}finally{p=!1}for(var t=a=u,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.d(r,{default:()=>o});var e=n(373),t=n.n(e);n(187),n(883),n(789),n(686);const o=t()})(),r.default})(),e.exports=t()},95295:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38571);t.default={framework:"semantic",templates:r.default}},38571:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5487);t.default={semantic:r.default}},89345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+=""+(null==(t=e.message)?"":t)+"\n"}},35692:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(89345);t.default={form:r.default}},23138:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},84594:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23138);t.default={form:r.default}},16751:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},61967:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16751);t.default={form:r.default}},84558:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},13332:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84558);t.default={form:r.default}},26680:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+'

    \n
    \n \n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n '+(null==(t=e.t("Preview"))?"":t)+'\n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.componentInfo.help)?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},85097:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26680);t.default={form:r.default}},36634:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n Drag and Drop a form component\n\n'}},59144:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(36634);t.default={form:r.default}},21102:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n"}},67767:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21102);t.default={form:r.default}},3414:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title))?"":t)+'\n \n
    \n
    \n
    \n
    \n \n
    \n ',e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n
    \n
    \n\n"}},18840:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3414);t.default={form:r.default}},17517:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n"}},29733:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17517);t.default={form:r.default}},50052:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="<"+(null==(t=e.input.type)?"":t)+'\n ref="button"\n class="ui button '+(null==(t=e.transform("theme",e.component.theme))?"":t)+" "+(null==(t=e.component.customClass)?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n>\n",e.component.leftIcon&&(n+=' '),n+="\n"+(null==(t=e.input.content)?"":t)+"\n",e.component.tooltip&&(n+='\n \n'),n+="\n",e.component.rightIcon&&(n+=' '),n+"\n\n
    \n \n
    \n'}},12749:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"\n"}},21614:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50052),o=n(12749);t.default={form:r.default,html:o.default}},1237:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='
    \n <'+(null==(t=e.input.type)?"":t)+'\n ref="input"\n id="'+(null==(t=e.id)?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n ",e.checked&&(n+="checked=true"),n+="\n >\n \n \n ",e.component.tooltip&&(n+='\n \n '),n+"\n
    \n"}},51266:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n
    ',e.checked?n+="True":n+="False",n+"
    \n"}},48424:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1237),o=n(51266);t.default={form:r.default,html:o.default}},46530:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n "})),n+="\n
    \n"}},43960:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46530);t.default={form:r.default}},23475:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+'\n
    \n '),n+"\n
    \n"}},71427:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23475);t.default={form:r.default}},51284:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"has-error":"error","is-invalid":"error","formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active"}},15894:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n ",e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n '+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},46719:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.hasHeader&&(n+="\n \n \n ",e.columns.forEach((function(r){n+='\n \n "})),n+="\n \n \n "),n+="\n \n ",e.rows.forEach((function(r){n+="\n \n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n
    \n '+(null==(t=r[o.key])?"":t)+"\n
    \n"}},99126:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15894),o=n(46719);t.default={form:r.default,html:o.default}},20173:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.dayFirst&&e.showDay&&(n+='\n
    \n \n "+(null==(t=e.day)?"":t)+"\n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n \n "+(null==(t=e.month)?"":t)+"\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n \n "+(null==(t=e.day)?"":t)+"\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n \n "+(null==(t=e.year)?"":t)+"\n
    \n "),n+'\n
    \n\n'}},20446:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20173);t.default={form:r.default}},97483:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.header&&(n+='\n
    \n '+(null==(t=e.header)?"":t)+"\n
    \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},5264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.header&&(n+='\n
    \n '+(null==(t=e.header)?"":t)+"\n
    \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},96943:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97483),o=n(5264);t.default={form:r.default,html:o.default}},95463:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"

    \n
      \n ",e.errors.forEach((function(r){n+='\n '+(null==(t=r.message)?"":t)+"\n "})),n+="\n
    \n\n"}},69240:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95463);t.default={form:r.default}},64129:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description))?"":t)+"
    \n"),n+"\n"}},99809:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description))?"":t)+"
    \n"),n+"\n"}},4061:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99809),o=n(64129);t.default={form:r.default,align:o.default}},54427:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n '+(null==(t=e.t(e.component.legend))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n ",e.collapsed||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},72297:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(54427);t.default={form:r.default}},75762:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+='\n
    \n
    \n
    \n ',e.disabled||(n+='\n
    \n '),n+='\n
    \n
    '+(null==(t=e.t("Size"))?"":t)+"
    \n ",e.self.hasTypes&&(n+='\n
    '+(null==(t=e.t("Type"))?"":t)+"
    \n "),n+="\n
    \n
    \n ",e.files.forEach((function(r){n+='\n
  • \n
    \n ',e.disabled||(n+='\n
    \n '),n+='\n
    '+(null==(t=r.originalName||r.name)?"":t)+"\n ",n+='\n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+"
    \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
    \n \n
    \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
    '+(null==(t=r.fileType)?"":t)+"
    \n "),n+="\n
    \n
  • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n
    \n '+(null==(t=e.t("Drop files to attach,"))?"":t)+"\n ",e.self.imageUpload&&e.component.webcam&&(n+='\n '+(null==(t=e.t("Use Camera,"))?"":t)+"\n "),n+="\n "+(null==(t=e.t("or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+"\n
    \n "),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},7007:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(75762);t.default={form:r.default}},84481:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},63751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84481);t.default={form:r.default}},83836:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r={"plus-squre-o":"plus square outline","minus-squre-o":"minus square outline","question-sign":"question circle","remove-circle":"trash alternate outline","new-window":"external alternate","files-o":"file outline",move:"arrows alternate",link:"linkify"};return r.hasOwnProperty(t)&&(t=r[t]),t=(t=(t=t||"").replace(/-/g," ")).replace(/ o$/," outline"),n?"icon ".concat(t," loading"):"icon ".concat(t)}},5487:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n\n',e.prefix&&(n+='\n\n"),n+="\n",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n<"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n>'+(null==(t=e.input.content)?"":t)+"\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n",e.component.showCharCount&&(n+='\n\n'),n+="\n",e.component.showWordCount&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML))?"":t)+"\n":n+="\n "+(null==(t=e.t(e.suffix))?"":t)+"\n",n+="\n
    \n"),n+"\n
    \n"}},2305:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},89504:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10090),o=n(2305);t.default={form:r.default,html:o.default}},31520:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.label.hidden||(n+="\n "+(null==(t=e.t(e.component.label))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n "),n+"\n\n"}},61206:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(31520);t.default={form:r.default}},83345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n
    \n'}},11042:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83345);t.default={form:r.default}},23432:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"Loading...\n"}},72763:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23432);t.default={form:r.default}},18182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.message)?"":t)+"\n
    \n"}},30490:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18182);t.default={form:r.default}},9637:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},71580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9637);t.default={form:r.default}},42412:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},29367:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42412);t.default={form:r.default}},4860:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(!e.component.hideLabel||e.builder||e.component.collapsible||e.component.tooltip)&&(n+='\n

    \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n

    \n"),n+="\n",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"),n+"\n"}},88576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4860);t.default={form:r.default}},84275:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(r){for(var o in n+='\n
    \n
    \n <'+(null==(t=e.input.type)?"":t)+'\n ref="input"\n ',e.input.attr)n+="\n "+(null==(t=o)?"":t)+'="'+(null==(t=e.input.attr[o])?"":t)+'"\n ';n+='\n value="'+(null==(t=r.value)?"":t)+'"\n ',(e.value===r.value||"object"==typeof e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value])&&(n+="\n checked=true\n "),n+="\n ",r.disabled&&(n+="\n disabled=true\n "),n+='\n id="'+(null==(t=e.instance.root&&e.instance.root.id)?"":t)+"-"+(null==(t=e.id)?"":t)+"-"+(null==(t=e.row)?"":t)+"-"+(null==(t=r.value)?"":t)+'"\n >\n \n
    \n
    \n "})),n+="\n
    \n"}},2227:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label)})).join(", "))?"":t)+"\n
    \n"}},1746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84275),o=n(2227);t.default={form:r.default,html:o.default}},25396:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},56533:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25396);t.default={form:r.default}},5721:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='\n\n'}},80260:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.self.itemValueForHTMLMode(e.value))?"":t:n+="-",n+"
    \n"}},60587:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5721),o=n(80260);t.default={form:r.default,html:o.default}},93593:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="\n"}},60345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.selected&&(n+=null==(t=e.t(e.option.label))?"":t),n+"\n"}},14668:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(93593),o=n(60345);t.default={form:r.default,html:o.default}},90538:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},96515:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},95339:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(90538),o=n(96515);t.default={form:r.default,html:o.default}},87090:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    '+(null==(t=e.t(r.label))?"":t)+"
    "+(null==(t=e.t(r.label))?"":t)+"\n \n
    \n"}},13556:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},88020:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(87090),o=n(13556);t.default={form:r.default,html:o.default}},74216:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n

    '+(null==(t=e.t(r.label))?"":t)+'

    \n
    \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},25238:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n ",e.component.components.forEach((function(r,o){n+='\n
    '+(null==(t=e.tabComponents[o])?"":t)+"
    \n "})),n+="\n
    \n"}},31533:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(74216),o=n(25238);t.default={flat:r.default,form:o.default}},949:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,o){n+='\n \n "})),n+="\n \n
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},83725:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(949);t.default={form:r.default}},37552:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.node.isRoot?n+='\n
    \n
    \n ':n+='\n
    \n ',n+="\n ",e.content&&(n+='\n
    \n '+(null==(t=e.content)?"":t)+"\n
    \n "),n+="\n ",e.childNodes&&e.childNodes.length&&(n+='\n
    \n '+(null==(t=e.childNodes.join(""))?"":t)+"\n
    \n "),n+="\n ",e.node.isRoot?n+="\n
    \n
    \n ":n+="\n
    \n",n+"\n"}},62441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(37552);t.default={form:r.default}},16016:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    '+(null==(t=e.children)?"":t)+"
    \n ",e.readOnly||(n+='\n
    \n \n
    \n "),n+"\n
    \n"}},12923:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16016),o=n(47379);t.default={treeView:{form:o.default},treeEdit:{form:r.default}}},47379:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',e.values.forEach((function(e){n+='\n
    \n '+(null==(t=e)?"":t)+"\n
    \n "})),n+='\n
    \n
    \n ',e.node.hasChildren&&(n+='\n \n
    \n '),n+="\n ",e.readOnly||(n+='\n \n
    \n \n
    \n \n ",e.node.revertAvailable&&(n+='\n
    \n \n "),n+="\n "),n+="\n
    \n
    \n
    \n
    \n"}},21710:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'

    '+(null==(t=e.t(e.component.title))?"":t)+"

    \n"}},32178:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.children)?"":t)+"
    \n"}},4599:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21710),o=n(32178);t.default={form:o.default,builder:r.default}},2230:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},76709:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2230);t.default={form:r.default}},70084:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title))?"":t)+"
    \n"}},16466:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?n+='\n
    \n
    \n '+(null==(t=e.wizardHeader)?"":t)+'\n
    \n
    \n
    \n '+(null==(t=e.components)?"":t)+'\n
    \n
    \n
    \n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n
    \n ":n+=" \n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+" \n
    \n
    "}},42317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70084),o=n(16466);t.default={form:o.default,builder:r.default}},93363:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},86739:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(93363);t.default={form:r.default}},28267:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},7130:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28267);t.default={form:r.default}},81256:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},54815:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(81256);t.default={form:r.default}},41993:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.buttons.cancel&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.previous&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.next&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.submit&&(n+='\n
    \n \n
    \n "),n+"\n
    \n"}},86858:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41993);t.default={form:r.default}},43281:function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);Object.defineProperty(t,"createAutoCorrectedDatePipe",{enumerable:!0,get:function(){return r(o).default}});var i=n(2);Object.defineProperty(t,"createNumberMask",{enumerable:!0,get:function(){return r(i).default}});var a=n(3);Object.defineProperty(t,"emailMask",{enumerable:!0,get:function(){return r(a).default}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mm dd yyyy",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.minYear,i=void 0===o?1:o,a=t.maxYear,l=void 0===a?9999:a,s=e.split(/[^dmyHMS]+/).sort((function(e,t){return r.indexOf(e)-r.indexOf(t)}));return function(t){var r=[],o={dd:31,mm:12,yy:99,yyyy:l,HH:23,MM:59,SS:59},a={dd:1,mm:1,yy:0,yyyy:i,HH:0,MM:0,SS:0},u=t.split("");s.forEach((function(t){var n=e.indexOf(t),i=parseInt(o[t].toString().substr(0,1),10);parseInt(u[n],10)>i&&(u[n+1]=u[n],u[n]=0,r.push(n))}));var c=0,f=s.some((function(r){var s=e.indexOf(r),u=r.length,f=t.substr(s,u).replace(/\D/g,""),d=parseInt(f,10);"mm"===r&&(c=d||0);var p="dd"===r?n[c]:o[r];if("yyyy"===r&&(1!==i||9999!==l)){var h=parseInt(o[r].toString().substring(0,f.length),10);return dh}return d>p||f.length===u&&d0&&void 0!==arguments[0]?arguments[0]:a,t=e.length;if(e===a||e[0]===y[0]&&1===t)return y.split(a).concat([p]).concat(b.split(a));if(e===j&&S)return y.split(a).concat(["0",j,p]).concat(b.split(a));var i=e[0]===u&&M;i&&(e=e.toString().substr(1));var l=e.lastIndexOf(j),s=-1!==l,m=void 0,v=void 0,g=void 0;if(e.slice(-1*N)===b&&(e=e.slice(0,-1*N)),s&&(S||A)?(m=e.slice(e.slice(0,V)===y?V:0,l),v=n((v=e.slice(l+1,t)).replace(f,a))):m=e.slice(0,V)===y?e.slice(V):e,L&&(void 0===L?"undefined":o(L))===d){var k="."===O?"[.]":""+O,_=(m.match(new RegExp(k,"g"))||[]).length;m=m.slice(0,L+_*F)}return m=m.replace(f,a),D||(m=m.replace(/^0+(0$|[^0])/,"$1")),g=n(m=w?r(m,O):m),(s&&S||!0===A)&&(e[l-1]!==j&&g.push(h),g.push(j,h),v&&((void 0===E?"undefined":o(E))===d&&(v=v.slice(0,E)),g=g.concat(v)),!0===A&&e[l-1]===j&&g.push(p)),V>0&&(g=y.split(a).concat(g)),i&&(g.length===V&&g.push(p),g=[c].concat(g)),b.length>0&&(g=g.concat(b.split(a))),g}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},m=t.prefix,y=void 0===m?i:m,v=t.suffix,b=void 0===v?a:v,g=t.includeThousandsSeparator,w=void 0===g||g,k=t.thousandsSeparatorSymbol,O=void 0===k?l:k,_=t.allowDecimal,S=void 0!==_&&_,P=t.decimalSymbol,j=void 0===P?s:P,x=t.decimalLimit,E=void 0===x?2:x,C=t.requireDecimal,A=void 0!==C&&C,T=t.allowNegative,M=void 0!==T&&T,R=t.allowLeadingZeroes,D=void 0!==R&&R,I=t.integerLimit,L=void 0===I?null:I,V=y&&y.length||0,N=b&&b.length||0,F=O&&O.length||0;return e.instanceOf="createNumberMask",e};var i="$",a="",l=",",s=".",u="-",c=/-/,f=/\D+/g,d="number",p=/\d/,h="[]"},function(e,t,n){"use strict";function r(e,t,n){var r=[];return e[t]===n?r.push(n):r.push(d,n),r.push(d),r}function o(e,t,n,r){var o=c;return-1!==t&&(o=-1===n?e.slice(t+1,e.length):e.slice(t+1,n)),(o=o.replace(new RegExp("[\\s"+r+"]",h),c))===f?s:o.length<1?p:o[o.length-1]===u?o.slice(0,o.length-1):o}function i(e,t,n,r){var o=c;return-1!==t&&(o=e.slice(t+1,e.length)),0===(o=o.replace(new RegExp("[\\s"+n+".]",h),c)).length?e[t-1]===u&&r!==e.length?s:c:o}function a(e,t){return e.split(c).map((function(e){return e===p?e:t?y:m}))}Object.defineProperty(t,"__esModule",{value:!0});var l=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),s="*",u=".",c="",f="@",d="[]",p=" ",h="g",m=/[^\s]/,y=/[^.\s]/,v=/\s/g;t.default={mask:function(e,t){e=e.replace(v,c);var n=t.placeholderChar,l=t.currentCaretPosition,s=e.indexOf(f),d=e.lastIndexOf(u),p=d1&&h.substr(-1)===l&&o!==f.length&&(h=h.slice(0,h.length-1)),h};var r="@",o=/@/g,i="",a="@.",l=".",s="..",u=[],c=/\./g}])},47853:function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.inputElement,n=e.afterUpdate,r=(0,a.default)(e),o=function(e){var t=e.target.value;r.update(t),"function"==typeof n&&n(t)};return t.addEventListener("input",o),r.update(t.value),{textMaskInputElement:r,destroy:function(){t.removeEventListener("input",o)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.conformToMask=void 0,t.maskInput=o;var i=n(2);Object.defineProperty(t,"conformToMask",{enumerable:!0,get:function(){return r(i).default}});var a=r(n(5));t.default=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placeholderChar="_",t.strFunction="function"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(0,o.isArray)(t)){if((void 0===t?"undefined":r(t))!==i.strFunction)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=(0,o.processCaretTraps)(t).maskWithoutCaretTraps}var s=n.guide,u=void 0===s||s,c=n.previousConformedValue,f=void 0===c?l:c,d=n.placeholderChar,p=void 0===d?i.placeholderChar:d,h=n.placeholder,m=void 0===h?(0,o.convertMaskToPlaceholder)(t,p):h,y=n.currentCaretPosition,v=n.keepCharPositions,b=!1===u&&void 0!==f,g=e.length,w=f.length,k=m.length,O=t.length,_=g-w,S=_>0,P=y+(S?-_:0),j=P+Math.abs(_);if(!0===v&&!S){for(var x=l,E=P;E=P&&t=0;A--){var T=C[A].char;T!==p&&T===m[A>=P&&w===O?A-_:A]&&C.splice(A,1)}var M=l,R=!1;e:for(var D=0;D0)for(;C.length>0;){var L=C.shift(),V=L.char,N=L.isNew;if(V===p&&!0!==b){M+=p;continue e}if(t[D].test(V)){if(!0===v&&!1!==N&&f!==l&&!1!==u&&S){for(var F=C.length,B=null,U=0;U0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.placeholderChar;if(!r(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\nThe placeholder character that was received is: "+JSON.stringify(t)+"\n\nThe mask that was received is: "+JSON.stringify(e));return e.map((function(e){return e instanceof RegExp?t:e})).join("")},t.isArray=r,t.isString=function(e){return"string"==typeof e||e instanceof String},t.isNumber=function(e){return"number"==typeof e&&void 0===e.length&&!isNaN(e)},t.isNil=function(e){return null==e},t.processCaretTraps=function(e){for(var t=[],n=void 0;-1!==(n=e.indexOf(a));)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}};var o=n(1),i=[],a="[]"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.previousConformedValue,o=void 0===t?r:t,i=e.previousPlaceholder,a=void 0===i?r:i,l=e.currentCaretPosition,s=void 0===l?0:l,u=e.conformedValue,c=e.rawValue,f=e.placeholderChar,d=e.placeholder,p=e.indexesOfPipedChars,h=void 0===p?n:p,m=e.caretTrapIndexes,y=void 0===m?n:m;if(0===s||!c.length)return 0;var v=c.length,b=o.length,g=d.length,w=u.length,k=v-b,O=k>0;if(k>1&&!O&&0!==b)return s;var _=0,S=void 0,P=void 0;if(!O||o!==u&&u!==d){var j=u.toLowerCase(),x=c.toLowerCase().substr(0,s).split(r).filter((function(e){return-1!==j.indexOf(e)}));P=x[x.length-1];var E=a.substr(0,x.length).split(r).filter((function(e){return e!==f})).length,C=d.substr(0,x.length).split(r).filter((function(e){return e!==f})).length,A=C!==E,T=void 0!==a[x.length-1]&&void 0!==d[x.length-2]&&a[x.length-1]!==f&&a[x.length-1]!==d[x.length-1]&&a[x.length-1]===d[x.length-2];!O&&(A||T)&&E>0&&d.indexOf(P)>-1&&void 0!==c[s]&&(S=!0,P=c[s]);for(var M=h.map((function(e){return j[e]})),R=M.filter((function(e){return e===P})).length,D=x.filter((function(e){return e===P})).length,I=d.substr(0,d.indexOf(f)).split(r).filter((function(e,t){return e===P&&c[t]!==e})).length,L=I+D+R+(S?1:0),V=0,N=0;N=L));N++);}else _=s-k;if(O){for(var F=_,B=_;B<=g;B++)if(d[B]===f&&(F=B),d[B]===f||-1!==y.indexOf(B)||B===g)return F}else if(S){for(var U=_-1;U>=0;U--)if(u[U]===P||-1!==y.indexOf(U)||0===U)return U}else for(var z=_;z>=0;z--)if(d[z-1]===f||-1!==y.indexOf(z)||0===z)return z};var n=[],r=""},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){(n?n.activeElement:document.activeElement)===e&&(m?y((function(){return e.setSelectionRange(t,t,p)}),0):e.setSelectionRange(t,t,p))}function i(e){if((0,c.isString)(e))return e;if((0,c.isNumber)(e))return String(e);if(null==e)return d;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value received was:\n\n "+JSON.stringify(e))}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:e,p=r.inputElement,m=r.mask,y=r.guide,v=r.pipe,b=r.placeholderChar,g=void 0===b?f.placeholderChar:b,w=r.keepCharPositions,k=void 0!==w&&w,O=r.showMask,_=void 0!==O&&O;if(void 0===n&&(n=p.value),n!==t.previousConformedValue){(void 0===m?"undefined":l(m))===h&&void 0!==m.pipe&&void 0!==m.mask&&(v=m.pipe,m=m.mask);var S=void 0,P=void 0;if(m instanceof Array&&(S=(0,c.convertMaskToPlaceholder)(m,g)),!1!==m){var j=i(n),x=p.selectionEnd,E=t.previousConformedValue,C=t.previousPlaceholder,A=void 0;if((void 0===m?"undefined":l(m))===f.strFunction){if(!1===(P=m(j,{currentCaretPosition:x,previousConformedValue:E,placeholderChar:g})))return;var T=(0,c.processCaretTraps)(P);P=T.maskWithoutCaretTraps,A=T.indexes,S=(0,c.convertMaskToPlaceholder)(P,g)}else P=m;var M={previousConformedValue:E,guide:y,placeholderChar:g,pipe:v,placeholder:S,currentCaretPosition:x,keepCharPositions:k},R=(0,u.default)(j,P,M).conformedValue,D=(void 0===v?"undefined":l(v))===f.strFunction,I={};D&&(!1===(I=v(R,a({rawValue:j},M)))?I={value:E,rejected:!0}:(0,c.isString)(I)&&(I={value:I}));var L=D?I.value:R,V=(0,s.default)({previousConformedValue:E,previousPlaceholder:C,conformedValue:L,placeholder:S,rawValue:j,currentCaretPosition:x,placeholderChar:g,indexesOfPipedChars:I.indexesOfPipedChars,caretTrapIndexes:A}),N=L===S&&0===V?_?S:d:L;t.previousConformedValue=N,t.previousPlaceholder=S,p.value!==N&&(j.includes("e-")?p.value=j:p.value=N,o(p,V,e.shadowRoot))}}}}};var s=r(n(4)),u=r(n(2)),c=n(3),f=n(1),d="",p="none",h="object",m="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),y="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout}])},65988:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n0?1:-1)*Math.floor(Math.abs(t)):t}(e);return Math.min(Math.max(t,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(e,n){if(null!=e&&null!=n){var r=e[n];if(null==r)return;if(!t(r))throw new TypeError(r+" is not a function");return r}},a=function(e){var t=e.next();return!Boolean(t.done)&&t},function(e){"use strict";var n,l,s,u=this,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!t(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var f=i(e,o(e));if(void 0!==f){l=t(u)?Object(new u):[];var d,p,h=f.call(e);if(null==h)throw new TypeError("Array.from requires an array-like or iterable object");for(s=0;;){if(!(d=a(h)))return l.length=s,l;p=d.value,l[s]=c?c.call(n,p,s):p,s++}}else{var m=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var y,v=r(m.length);for(l=t(u)?Object(new u(v)):new Array(v),s=0;s0){var t=e[0],r=t.previousElementSibling;if(r&&-1!==r.className.indexOf("group")&&!r.previousElementSibling&&(t=r),t.offsetTopi&&(n.scrollTop+=o-i)}}}()}function _(){w()&&O()}function S(){_()}function P(e){e.target!==n?_():e.preventDefault()}function j(t){for(var n=t.which||t.keyCode||0,r=0,o=e.keysToIgnore||[38,13,27,39,37,16,17,18,20,91,9];r=112&&n<=123&&!e.keysToIgnore||40===n&&w()||C(0)}function x(t){var n=t.which||t.keyCode||0;if(38===n||40===n||27===n){var o=w();if(27===n)k();else{if(!o||d.length<1)return;38===n?function(){if(d.length<1)r=void 0;else if(r===d[0])r=d[d.length-1];else for(var e=d.length-1;e>0;e--)if(r===d[e]||1===e){r=d[e-1];break}}():function(){if(d.length<1&&(r=void 0),r&&r!==d[d.length-1]){for(var e=0;e=h||1===t?(g(),o=window.setTimeout((function(){e.fetch(i,(function(e){y===n&&e&&(p=i,r=(d=e).length<1||c?void 0:d[0],O())}),t,a)}),0===t?s:0)):k()}function A(){setTimeout((function(){t.activeElement!==v&&k()}),200)}return n.className="autocomplete "+(e.className||""),n.setAttribute("role","listbox"),v.setAttribute("role","combobox"),v.setAttribute("aria-expanded","false"),v.setAttribute("aria-autocomplete","list"),v.setAttribute("aria-controls",n.id),v.setAttribute("aria-owns",n.id),v.setAttribute("aria-activedescendant",""),v.setAttribute("aria-haspopup","listbox"),i.position="absolute",n.addEventListener("mousedown",(function(e){e.stopPropagation(),e.preventDefault()})),n.addEventListener("focus",(function(){return v.focus()})),v.addEventListener("keydown",x),v.addEventListener(f,j),v.addEventListener("blur",A),v.addEventListener("focus",E),window.addEventListener("resize",S),t.addEventListener("scroll",P,!0),{destroy:function(){v.removeEventListener("focus",E),v.removeEventListener("keydown",x),v.removeEventListener(f,j),v.removeEventListener("blur",A),window.removeEventListener("resize",S),t.removeEventListener("scroll",P,!0),v.removeAttribute("role"),v.removeAttribute("aria-expanded"),v.removeAttribute("aria-autocomplete"),v.removeAttribute("aria-controls"),v.removeAttribute("aria-activedescendant"),v.removeAttribute("aria-owns"),v.removeAttribute("aria-haspopup"),g(),k()}}}}()},4389:function(e,t){t.defaults={},t.set=function(e,n,r){var o=r||{},i=t.defaults,a=o.expires||i.expires,l=o.domain||i.domain,s=void 0!==o.path?o.path:void 0!==i.path?i.path:"/",u=void 0!==o.secure?o.secure:i.secure,c=void 0!==o.httponly?o.httponly:i.httponly,f=void 0!==o.samesite?o.samesite:i.samesite,d=a?new Date("number"==typeof a?(new Date).getTime()+864e5*a:a):0;document.cookie=e.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+n.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(d&&d.getTime()>=0?";expires="+d.toUTCString():"")+(l?";domain="+l:"")+(s?";path="+s:"")+(u?";secure":"")+(c?";httponly":"")+(f?";samesite="+f:"")},t.get=function(e){for(var t=document.cookie.split(";");t.length;){var n=t.pop(),r=n.indexOf("=");if(r=r<0?n.length:r,decodeURIComponent(n.slice(0,r).replace(/^\s+/,""))===e)return decodeURIComponent(n.slice(r+1))}return null},t.erase=function(e,n){t.set(e,"",{expires:-1,domain:n&&n.domain,path:n&&n.path,secure:0,httponly:0})},t.all=function(){for(var e={},t=document.cookie.split(";");t.length;){var n=t.pop(),r=n.indexOf("=");r=r<0?n.length:r,e[decodeURIComponent(n.slice(0,r).replace(/^\s+/,""))]=decodeURIComponent(n.slice(r+1))}return e}},354:function(e){e.exports=function(){"use strict";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(e){var t=function(e,t){return e+t&4294967295},n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,n,r,o,i,a){return n=t(t(n,e),t(o,a)),t(n<>>32-i,r)}function o(e,t,n,o,i,a,l){return r(t&n|~t&o,e,t,i,a,l)}function i(e,t,n,o,i,a,l){return r(t&o|n&~o,e,t,i,a,l)}function a(e,t,n,o,i,a,l){return r(t^n^o,e,t,i,a,l)}function l(e,t,n,o,i,a,l){return r(n^(t|~o),e,t,i,a,l)}function s(e,n){var r=e[0],s=e[1],u=e[2],c=e[3];r=o(r,s,u,c,n[0],7,-680876936),c=o(c,r,s,u,n[1],12,-389564586),u=o(u,c,r,s,n[2],17,606105819),s=o(s,u,c,r,n[3],22,-1044525330),r=o(r,s,u,c,n[4],7,-176418897),c=o(c,r,s,u,n[5],12,1200080426),u=o(u,c,r,s,n[6],17,-1473231341),s=o(s,u,c,r,n[7],22,-45705983),r=o(r,s,u,c,n[8],7,1770035416),c=o(c,r,s,u,n[9],12,-1958414417),u=o(u,c,r,s,n[10],17,-42063),s=o(s,u,c,r,n[11],22,-1990404162),r=o(r,s,u,c,n[12],7,1804603682),c=o(c,r,s,u,n[13],12,-40341101),u=o(u,c,r,s,n[14],17,-1502002290),r=i(r,s=o(s,u,c,r,n[15],22,1236535329),u,c,n[1],5,-165796510),c=i(c,r,s,u,n[6],9,-1069501632),u=i(u,c,r,s,n[11],14,643717713),s=i(s,u,c,r,n[0],20,-373897302),r=i(r,s,u,c,n[5],5,-701558691),c=i(c,r,s,u,n[10],9,38016083),u=i(u,c,r,s,n[15],14,-660478335),s=i(s,u,c,r,n[4],20,-405537848),r=i(r,s,u,c,n[9],5,568446438),c=i(c,r,s,u,n[14],9,-1019803690),u=i(u,c,r,s,n[3],14,-187363961),s=i(s,u,c,r,n[8],20,1163531501),r=i(r,s,u,c,n[13],5,-1444681467),c=i(c,r,s,u,n[2],9,-51403784),u=i(u,c,r,s,n[7],14,1735328473),r=a(r,s=i(s,u,c,r,n[12],20,-1926607734),u,c,n[5],4,-378558),c=a(c,r,s,u,n[8],11,-2022574463),u=a(u,c,r,s,n[11],16,1839030562),s=a(s,u,c,r,n[14],23,-35309556),r=a(r,s,u,c,n[1],4,-1530992060),c=a(c,r,s,u,n[4],11,1272893353),u=a(u,c,r,s,n[7],16,-155497632),s=a(s,u,c,r,n[10],23,-1094730640),r=a(r,s,u,c,n[13],4,681279174),c=a(c,r,s,u,n[0],11,-358537222),u=a(u,c,r,s,n[3],16,-722521979),s=a(s,u,c,r,n[6],23,76029189),r=a(r,s,u,c,n[9],4,-640364487),c=a(c,r,s,u,n[12],11,-421815835),u=a(u,c,r,s,n[15],16,530742520),r=l(r,s=a(s,u,c,r,n[2],23,-995338651),u,c,n[0],6,-198630844),c=l(c,r,s,u,n[7],10,1126891415),u=l(u,c,r,s,n[14],15,-1416354905),s=l(s,u,c,r,n[5],21,-57434055),r=l(r,s,u,c,n[12],6,1700485571),c=l(c,r,s,u,n[3],10,-1894986606),u=l(u,c,r,s,n[10],15,-1051523),s=l(s,u,c,r,n[1],21,-2054922799),r=l(r,s,u,c,n[8],6,1873313359),c=l(c,r,s,u,n[15],10,-30611744),u=l(u,c,r,s,n[6],15,-1560198380),s=l(s,u,c,r,n[13],21,1309151649),r=l(r,s,u,c,n[4],6,-145523070),c=l(c,r,s,u,n[11],10,-1120210379),u=l(u,c,r,s,n[2],15,718787259),s=l(s,u,c,r,n[9],21,-343485551),e[0]=t(r,e[0]),e[1]=t(s,e[1]),e[2]=t(u,e[2]),e[3]=t(c,e[3])}function u(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function c(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function f(e){var t,n,r,o,i,a,l=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)s(c,u(e.substring(t-64,t)));for(n=(e=e.substring(t-64)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),t>55)for(s(c,r),t=0;t<16;t+=1)r[t]=0;return o=(o=8*l).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,r[14]=i,r[15]=a,s(c,r),c}function d(e){var t,n,r,o,i,a,l=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)s(u,c(e.subarray(t-64,t)));for(n=(e=t-64>2]|=e[t]<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),t>55)for(s(u,r),t=0;t<16;t+=1)r[t]=0;return o=(o=8*l).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,r[14]=i,r[15]=a,s(u,r),u}function p(e){var t,r="";for(t=0;t<4;t+=1)r+=n[e>>8*t+4&15]+n[e>>8*t&15];return r}function h(e){var t;for(t=0;t>16)+(t>>16)+(n>>16)<<16|65535&n}),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var o,i,a,l,s=this.byteLength,u=t(n,s),c=s;return r!==e&&(c=t(r,s)),u>c?new ArrayBuffer(0):(o=c-u,i=new ArrayBuffer(o),a=new Uint8Array(i),l=new Uint8Array(this,u,o),a.set(l),i)}}(),w.prototype.append=function(e){return this.appendBinary(m(e)),this},w.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,n=this._buff.length;for(t=64;t<=n;t+=64)s(this._hash,u(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},w.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),n=h(this._hash),e&&(n=g(n)),this.reset(),n},w.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},w.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},w.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},w.prototype._finish=function(e,t){var n,r,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(s(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=r,e[15]=o,s(this._hash,e)},w.hash=function(e,t){return w.hashBinary(m(e),t)},w.hashBinary=function(e,t){var n=h(f(e));return t?g(n):n},w.ArrayBuffer=function(){this.reset()},w.ArrayBuffer.prototype.append=function(e){var t,n=b(this._buff.buffer,e,!0),r=n.length;for(this._length+=e.byteLength,t=64;t<=r;t+=64)s(this._hash,c(n.subarray(t-64,t)));return this._buff=t-64>2]|=r[t]<<(t%4<<3);return this._finish(i,o),n=h(this._hash),e&&(n=g(n)),this.reset(),n},w.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.ArrayBuffer.prototype.getState=function(){var e=w.prototype.getState.call(this);return e.buff=v(e.buff),e},w.ArrayBuffer.prototype.setState=function(e){return e.buff=y(e.buff,!0),w.prototype.setState.call(this,e)},w.ArrayBuffer.prototype.destroy=w.prototype.destroy,w.ArrayBuffer.prototype._finish=w.prototype._finish,w.ArrayBuffer.hash=function(e,t){var n=h(d(new Uint8Array(e)));return t?g(n):n},w}()}));return class{md5(t,n,r){this.aborted=!1,this.progress=0;let o=0;const i=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,a=2097152,l=Math.ceil(t.size/a),s=new e.ArrayBuffer,u=new FileReader;function c(){const e=o*a,n=e+a>=t.size?t.size:e+a;u.readAsArrayBuffer(i.call(t,e,n))}c(),u.onloadend=e=>{s.append(e.target.result),o++,this.progress=o/l,r&&"function"==typeof r&&r(this.progress),this.aborted?n("aborted"):o{const n=s(e),r=s(t),o=n.pop(),i=r.pop(),a=d(n,r);return 0!==a?a:o&&i?d(o.split("."),i.split(".")):o||i?o?-1:1:0},o=e=>"string"==typeof e&&/^[v\d]/.test(e)&&l.test(e),i=(e,t,n)=>{m(n);const o=r(e,t);return p[n].includes(o)},a=(e,t)=>{const n=t.match(/^([<>=~^]+)/),r=n?n[1]:"=";if("^"!==r&&"~"!==r)return i(e,t,r);const[o,a,l]=s(e),[u,c,p]=s(t);return 0===f(o,u)&&("^"===r?d([a,l],[c,p])>=0:0===f(a,c)&&f(l,p)>=0)},l=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,s=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(l);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},u=e=>"*"===e||"x"===e||"X"===e,c=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},f=(e,t)=>{if(u(e)||u(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(c(e),c(t));return n>r?1:n{for(let n=0;n":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},h=Object.keys(p),m=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===h.indexOf(e))throw new Error(`Invalid operator, expected one of ${h.join("|")}`)}},19662:function(e,t,n){var r=n(60614),o=n(66330),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},39483:function(e,t,n){var r=n(4411),o=n(66330),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a constructor")}},96077:function(e,t,n){var r=n(60614),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},51223:function(e,t,n){var r=n(5112),o=n(70030),i=n(3070).f,a=r("unscopables"),l=Array.prototype;null==l[a]&&i(l,a,{configurable:!0,value:o(null)}),e.exports=function(e){l[a][e]=!0}},31530:function(e,t,n){"use strict";var r=n(28710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},25787:function(e,t,n){var r=n(47976),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},19670:function(e,t,n){var r=n(70111),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},23013:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:function(e,t,n){var r=n(47293);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},90260:function(e,t,n){"use strict";var r,o,i,a=n(23013),l=n(19781),s=n(17854),u=n(60614),c=n(70111),f=n(92597),d=n(70648),p=n(66330),h=n(68880),m=n(98052),y=n(3070).f,v=n(47976),b=n(79518),g=n(27674),w=n(5112),k=n(69711),O=n(29909),_=O.enforce,S=O.get,P=s.Int8Array,j=P&&P.prototype,x=s.Uint8ClampedArray,E=x&&x.prototype,C=P&&b(P),A=j&&b(j),T=Object.prototype,M=s.TypeError,R=w("toStringTag"),D=k("TYPED_ARRAY_TAG"),I=a&&!!g&&"Opera"!==d(s.opera),L=!1,V={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},N={BigInt64Array:8,BigUint64Array:8},F=function(e){var t=b(e);if(c(t)){var n=S(t);return n&&f(n,"TypedArrayConstructor")?n.TypedArrayConstructor:F(t)}},B=function(e){if(!c(e))return!1;var t=d(e);return f(V,t)||f(N,t)};for(r in V)(i=(o=s[r])&&o.prototype)?_(i).TypedArrayConstructor=o:I=!1;for(r in N)(i=(o=s[r])&&o.prototype)&&(_(i).TypedArrayConstructor=o);if((!I||!u(C)||C===Function.prototype)&&(C=function(){throw M("Incorrect invocation")},I))for(r in V)s[r]&&g(s[r],C);if((!I||!A||A===T)&&(A=C.prototype,I))for(r in V)s[r]&&g(s[r].prototype,A);if(I&&b(E)!==A&&g(E,A),l&&!f(A,R))for(r in L=!0,y(A,R,{get:function(){return c(this)?this[D]:void 0}}),V)s[r]&&h(s[r],D,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:L&&D,aTypedArray:function(e){if(B(e))return e;throw M("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!g||v(C,e)))return e;throw M(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(l){if(n)for(var o in V){var i=s[o];if(i&&f(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}A[e]&&!n||m(A,e,n?t:I&&j[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(l){if(g){if(n)for(r in V)if((o=s[r])&&f(o,e))try{delete o[e]}catch(e){}if(C[e]&&!n)return;try{return m(C,e,n?t:I&&C[e]||t)}catch(e){}}for(r in V)!(o=s[r])||o[e]&&!n||m(o,e,t)}},getTypedArrayConstructor:F,isView:function(e){if(!c(e))return!1;var t=d(e);return"DataView"===t||f(V,t)||f(N,t)},isTypedArray:B,TypedArray:C,TypedArrayPrototype:A}},13331:function(e,t,n){"use strict";var r=n(17854),o=n(1702),i=n(19781),a=n(23013),l=n(76530),s=n(68880),u=n(89190),c=n(47293),f=n(25787),d=n(19303),p=n(17466),h=n(57067),m=n(11179),y=n(79518),v=n(27674),b=n(8006).f,g=n(3070).f,w=n(21285),k=n(41589),O=n(58003),_=n(29909),S=l.PROPER,P=l.CONFIGURABLE,j=_.get,x=_.set,E="ArrayBuffer",C="Wrong index",A=r.ArrayBuffer,T=A,M=T&&T.prototype,R=r.DataView,D=R&&R.prototype,I=Object.prototype,L=r.Array,V=r.RangeError,N=o(w),F=o([].reverse),B=m.pack,U=m.unpack,z=function(e){return[255&e]},H=function(e){return[255&e,e>>8&255]},q=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},W=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},K=function(e){return B(e,23,4)},Y=function(e){return B(e,52,8)},G=function(e,t){g(e.prototype,t,{get:function(){return j(this)[t]}})},$=function(e,t,n,r){var o=h(n),i=j(e);if(o+t>i.byteLength)throw V(C);var a=j(i.buffer).bytes,l=o+i.byteOffset,s=k(a,l,l+t);return r?s:F(s)},J=function(e,t,n,r,o,i){var a=h(n),l=j(e);if(a+t>l.byteLength)throw V(C);for(var s=j(l.buffer).bytes,u=a+l.byteOffset,c=r(+o),f=0;fee;)(Z=Q[ee++])in T||s(T,Z,A[Z]);M.constructor=T}v&&y(D)!==I&&v(D,I);var te=new R(new T(2)),ne=o(D.setInt8);te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||u(D,{setInt8:function(e,t){ne(this,e,t<<24>>24)},setUint8:function(e,t){ne(this,e,t<<24>>24)}},{unsafe:!0})}else M=(T=function(e){f(this,M);var t=h(e);x(this,{bytes:N(L(t),0),byteLength:t}),i||(this.byteLength=t)}).prototype,D=(R=function(e,t,n){f(this,D),f(e,M);var r=j(e).byteLength,o=d(t);if(o<0||o>r)throw V("Wrong offset");if(o+(n=void 0===n?r-o:p(n))>r)throw V("Wrong length");x(this,{buffer:e,byteLength:n,byteOffset:o}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=o)}).prototype,i&&(G(T,"byteLength"),G(R,"buffer"),G(R,"byteLength"),G(R,"byteOffset")),u(D,{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return W($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return W($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return U($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return U($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){J(this,1,e,z,t)},setUint8:function(e,t){J(this,1,e,z,t)},setInt16:function(e,t){J(this,2,e,H,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){J(this,2,e,H,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){J(this,4,e,q,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){J(this,4,e,q,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){J(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){J(this,8,e,Y,t,arguments.length>2?arguments[2]:void 0)}});O(T,E),O(R,"DataView"),e.exports={ArrayBuffer:T,DataView:R}},1048:function(e,t,n){"use strict";var r=n(47908),o=n(51400),i=n(26244),a=n(85117),l=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),s=i(n),u=o(e,s),c=o(t,s),f=arguments.length>2?arguments[2]:void 0,d=l((void 0===f?s:o(f,s))-c,s-u),p=1;for(c0;)c in n?n[u]=n[c]:a(n,u),u+=p,c+=p;return n}},21285:function(e,t,n){"use strict";var r=n(47908),o=n(51400),i=n(26244);e.exports=function(e){for(var t=r(this),n=i(t),a=arguments.length,l=o(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,u=void 0===s?n:o(s,n);u>l;)t[l++]=e;return t}},18533:function(e,t,n){"use strict";var r=n(42092).forEach,o=n(9341)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97745:function(e,t,n){var r=n(26244);e.exports=function(e,t){for(var n=0,o=r(t),i=new e(o);o>n;)i[n]=t[n++];return i}},48457:function(e,t,n){"use strict";var r=n(49974),o=n(46916),i=n(47908),a=n(53411),l=n(97659),s=n(4411),u=n(26244),c=n(86135),f=n(18554),d=n(71246),p=Array;e.exports=function(e){var t=i(e),n=s(this),h=arguments.length,m=h>1?arguments[1]:void 0,y=void 0!==m;y&&(m=r(m,h>2?arguments[2]:void 0));var v,b,g,w,k,O,_=d(t),S=0;if(!_||this===p&&l(_))for(v=u(t),b=n?new this(v):p(v);v>S;S++)O=y?m(t[S],S):t[S],c(b,S,O);else for(k=(w=f(t,_)).next,b=n?new this:[];!(g=o(k,w)).done;S++)O=y?a(w,m,[g.value,S],!0):g.value,c(b,S,O);return b.length=S,b}},41318:function(e,t,n){var r=n(45656),o=n(51400),i=n(26244),a=function(e){return function(t,n,a){var l,s=r(t),u=i(s),c=o(a,u);if(e&&n!=n){for(;u>c;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},42092:function(e,t,n){var r=n(49974),o=n(1702),i=n(68361),a=n(47908),l=n(26244),s=n(65417),u=o([].push),c=function(e){var t=1==e,n=2==e,o=3==e,c=4==e,f=6==e,d=7==e,p=5==e||f;return function(h,m,y,v){for(var b,g,w=a(h),k=i(w),O=r(m,y),_=l(k),S=0,P=v||s,j=t?P(h,_):n||d?P(h,0):void 0;_>S;S++)if((p||S in k)&&(g=O(b=k[S],S,w),e))if(t)j[S]=g;else if(g)switch(e){case 3:return!0;case 5:return b;case 6:return S;case 2:u(j,b)}else switch(e){case 4:return!1;case 7:u(j,b)}return f?-1:o||c?c:j}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},86583:function(e,t,n){"use strict";var r=n(22104),o=n(45656),i=n(19303),a=n(26244),l=n(9341),s=Math.min,u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0,f=l("lastIndexOf"),d=c||!f;e.exports=d?function(e){if(c)return r(u,this,arguments)||0;var t=o(this),n=a(t),l=n-1;for(arguments.length>1&&(l=s(l,i(arguments[1]))),l<0&&(l=n+l);l>=0;l--)if(l in t&&t[l]===e)return l||0;return-1}:u},81194:function(e,t,n){var r=n(47293),o=n(5112),i=n(7392),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,n){"use strict";var r=n(47293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},53671:function(e,t,n){var r=n(19662),o=n(47908),i=n(68361),a=n(26244),l=TypeError,s=function(e){return function(t,n,s,u){r(n);var c=o(t),f=i(c),d=a(c),p=e?d-1:0,h=e?-1:1;if(s<2)for(;;){if(p in f){u=f[p],p+=h;break}if(p+=h,e?p<0:d<=p)throw l("Reduce of empty array with no initial value")}for(;e?p>=0:d>p;p+=h)p in f&&(u=n(u,f[p],p,c));return u}};e.exports={left:s(!1),right:s(!0)}},83658:function(e,t,n){"use strict";var r=n(19781),o=n(43157),i=TypeError,a=Object.getOwnPropertyDescriptor,l=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=l?function(e,t){if(o(e)&&!a(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},41589:function(e,t,n){var r=n(51400),o=n(26244),i=n(86135),a=Array,l=Math.max;e.exports=function(e,t,n){for(var s=o(e),u=r(t,s),c=r(void 0===n?s:n,s),f=a(l(c-u,0)),d=0;u0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},l=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,l=0;a1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),i(d,n?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return b(this,0===e?0:e,t)}}:{add:function(e){return b(this,e=0===e?0:e,e)}}),p&&r(d,"size",{get:function(){return m(this).size}}),f},setStrong:function(e,t,n){var r=t+" Iterator",o=v(t),i=v(r);c(e,t,(function(e,t){y(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?f("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,f(void 0,!0))}),n?"entries":"values",!n,!0),d(t)}}},29320:function(e,t,n){"use strict";var r=n(1702),o=n(89190),i=n(62423).getWeakData,a=n(25787),l=n(19670),s=n(68554),u=n(70111),c=n(20408),f=n(42092),d=n(92597),p=n(29909),h=p.set,m=p.getterFor,y=f.find,v=f.findIndex,b=r([].splice),g=0,w=function(e){return e.frozen||(e.frozen=new k)},k=function(){this.entries=[]},O=function(e,t){return y(e.entries,(function(e){return e[0]===t}))};k.prototype={get:function(e){var t=O(this,e);if(t)return t[1]},has:function(e){return!!O(this,e)},set:function(e,t){var n=O(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&b(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var f=e((function(e,o){a(e,p),h(e,{type:t,id:g++,frozen:void 0}),s(o)||c(o,e[r],{that:e,AS_ENTRIES:n})})),p=f.prototype,y=m(t),v=function(e,t,n){var r=y(e),o=i(l(t),!0);return!0===o?w(r).set(t,n):o[r.id]=n,e};return o(p,{delete:function(e){var t=y(this);if(!u(e))return!1;var n=i(e);return!0===n?w(t).delete(e):n&&d(n,t.id)&&delete n[t.id]},has:function(e){var t=y(this);if(!u(e))return!1;var n=i(e);return!0===n?w(t).has(e):n&&d(n,t.id)}}),o(p,n?{get:function(e){var t=y(this);if(u(e)){var n=i(e);return!0===n?w(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),f}}},77710:function(e,t,n){"use strict";var r=n(82109),o=n(17854),i=n(1702),a=n(54705),l=n(98052),s=n(62423),u=n(20408),c=n(25787),f=n(60614),d=n(68554),p=n(70111),h=n(47293),m=n(17072),y=n(58003),v=n(79587);e.exports=function(e,t,n){var b=-1!==e.indexOf("Map"),g=-1!==e.indexOf("Weak"),w=b?"set":"add",k=o[e],O=k&&k.prototype,_=k,S={},P=function(e){var t=i(O[e]);l(O,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(g&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return g&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!p(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!f(k)||!(g||O.forEach&&!h((function(){(new k).entries().next()})))))_=n.getConstructor(t,e,b,w),s.enable();else if(a(e,!0)){var j=new _,x=j[w](g?{}:-0,1)!=j,E=h((function(){j.has(1)})),C=m((function(e){new k(e)})),A=!g&&h((function(){for(var e=new k,t=5;t--;)e[w](t,t);return!e.has(-0)}));C||((_=t((function(e,t){c(e,O);var n=v(new k,e,_);return d(t)||u(t,n[w],{that:n,AS_ENTRIES:b}),n}))).prototype=O,O.constructor=_),(E||A)&&(P("delete"),P("has"),b&&P("get")),(A||x)&&P(w),g&&O.clear&&delete O.clear}return S[e]=_,r({global:!0,constructor:!0,forced:_!=k},S),y(_,e),g||n.setStrong(_,e,b),_}},99920:function(e,t,n){var r=n(92597),o=n(53887),i=n(31236),a=n(3070);e.exports=function(e,t,n){for(var l=o(t),s=a.f,u=i.f,c=0;c9999?"+":"";return r+i(s(t),r?6:4,0)+"-"+i(v(e)+1,2,0)+"-"+i(d(e),2,0)+"T"+i(h(e),2,0)+":"+i(y(e),2,0)+":"+i(b(e),2,0)+"."+i(n,3,0)+"Z"}:c},38709:function(e,t,n){"use strict";var r=n(19670),o=n(92140),i=TypeError;e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw i("Incorrect hint");return o(this,e)}},47045:function(e,t,n){var r=n(56339),o=n(3070);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},98052:function(e,t,n){var r=n(60614),o=n(3070),i=n(56339),a=n(13072);e.exports=function(e,t,n,l){l||(l={});var s=l.enumerable,u=void 0!==l.name?l.name:t;if(r(n)&&i(n,u,l),l.global)s?e[t]=n:a(t,n);else{try{l.unsafe?e[t]&&(s=!0):delete e[t]}catch(e){}s?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!l.nonConfigurable,writable:!l.nonWritable})}return e}},89190:function(e,t,n){var r=n(98052);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},13072:function(e,t,n){var r=n(17854),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},85117:function(e,t,n){"use strict";var r=n(66330),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw o("Cannot delete property "+r(t)+" of "+r(e))}},19781:function(e,t,n){var r=n(47293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},80317:function(e,t,n){var r=n(17854),o=n(70111),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},7207:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},48324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},98509:function(e,t,n){var r=n(80317)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},68886:function(e,t,n){var r=n(88113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871:function(e,t,n){var r=n(83823),o=n(35268);e.exports=!r&&!o&&"object"==typeof window&&"object"==typeof document},83823:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},30256:function(e,t,n){var r=n(88113);e.exports=/MSIE|Trident/.test(r)},71528:function(e,t,n){var r=n(88113),o=n(17854);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},6833:function(e,t,n){var r=n(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268:function(e,t,n){var r=n(84326),o=n(17854);e.exports="process"==r(o.process)},71036:function(e,t,n){var r=n(88113);e.exports=/web0s(?!.*chrome)/i.test(r)},88113:function(e,t,n){var r=n(35005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,o,i=n(17854),a=n(88113),l=i.process,s=i.Deno,u=l&&l.versions||s&&s.version,c=u&&u.v8;c&&(o=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},98008:function(e,t,n){var r=n(88113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},80748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109:function(e,t,n){var r=n(17854),o=n(31236).f,i=n(68880),a=n(98052),l=n(13072),s=n(99920),u=n(54705);e.exports=function(e,t){var n,c,f,d,p,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||l(h,{}):(r[h]||{}).prototype)for(c in t){if(d=t[c],f=e.dontCallGetSet?(p=o(n,c))&&p.value:n[c],!u(m?c:h+(y?".":"#")+c,e.forced)&&void 0!==f){if(typeof d==typeof f)continue;s(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),a(n,c,d,e)}}},47293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},27007:function(e,t,n){"use strict";n(74916);var r=n(21470),o=n(98052),i=n(22261),a=n(47293),l=n(5112),s=n(68880),u=l("species"),c=RegExp.prototype;e.exports=function(e,t,n,f){var d=l(e),p=!a((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),h=p&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!p||!h||n){var m=r(/./[d]),y=t(d,""[e],(function(e,t,n,o,a){var l=r(e),s=t.exec;return s===i||s===c.exec?p&&!a?{done:!0,value:m(t,n,o)}:{done:!0,value:l(n,t,o)}:{done:!1}}));o(String.prototype,e,y[0]),o(c,d,y[1])}f&&s(c[d],"sham",!0)}},76677:function(e,t,n){var r=n(47293);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},22104:function(e,t,n){var r=n(34374),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},49974:function(e,t,n){var r=n(21470),o=n(19662),i=n(34374),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},34374:function(e,t,n){var r=n(47293);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},27065:function(e,t,n){"use strict";var r=n(1702),o=n(19662),i=n(70111),a=n(92597),l=n(50206),s=n(34374),u=Function,c=r([].concat),f=r([].join),d={},p=function(e,t,n){if(!a(d,t)){for(var r=[],o=0;o]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,f,d){var p=n+e.length,h=r.length,m=c;return void 0!==f&&(f=o(f),m=u),l(d,m,(function(o,l){var u;switch(a(l,0)){case"$":return"$";case"&":return e;case"`":return s(t,0,n);case"'":return s(t,p);case"<":u=f[s(l,1,-1)];break;default:var c=+l;if(0===c)return o;if(c>h){var d=i(c/10);return 0===d?o:d<=h?void 0===r[d-1]?a(l,1):r[d-1]+a(l,1):o}u=r[c-1]}return void 0===u?"":u}))}},17854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},92597:function(e,t,n){var r=n(1702),o=n(47908),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(17854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},60490:function(e,t,n){var r=n(35005);e.exports=r("document","documentElement")},64664:function(e,t,n){var r=n(19781),o=n(47293),i=n(80317);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},11179:function(e){var t=Array,n=Math.abs,r=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,l,s){var u,c,f,d=t(s),p=8*s-l-1,h=(1<>1,y=23===l?r(2,-24)-r(2,-77):0,v=e<0||0===e&&1/e<0?1:0,b=0;for((e=n(e))!=e||e===1/0?(c=e!=e?1:0,u=h):(u=o(i(e)/a),e*(f=r(2,-u))<1&&(u--,f*=2),(e+=u+m>=1?y/f:y*r(2,1-m))*f>=2&&(u++,f/=2),u+m>=h?(c=0,u=h):u+m>=1?(c=(e*f-1)*r(2,l),u+=m):(c=e*r(2,m-1)*r(2,l),u=0));l>=8;)d[b++]=255&c,c/=256,l-=8;for(u=u<0;)d[b++]=255&u,u/=256,p-=8;return d[--b]|=128*v,d},unpack:function(e,t){var n,o=e.length,i=8*o-t-1,a=(1<>1,s=i-7,u=o-1,c=e[u--],f=127&c;for(c>>=7;s>0;)f=256*f+e[u--],s-=8;for(n=f&(1<<-s)-1,f>>=-s,s+=t;s>0;)n=256*n+e[u--],s-=8;if(0===f)f=1-l;else{if(f===a)return n?NaN:c?-1/0:1/0;n+=r(2,t),f-=l}return(c?-1:1)*n*r(2,f-t)}}},68361:function(e,t,n){var r=n(1702),o=n(47293),i=n(84326),a=Object,l=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?l(e,""):a(e)}:a},79587:function(e,t,n){var r=n(60614),o=n(70111),i=n(27674);e.exports=function(e,t,n){var a,l;return i&&r(a=t.constructor)&&a!==n&&o(l=a.prototype)&&l!==n.prototype&&i(e,l),e}},42788:function(e,t,n){var r=n(1702),o=n(60614),i=n(5465),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},62423:function(e,t,n){var r=n(82109),o=n(1702),i=n(3501),a=n(70111),l=n(92597),s=n(3070).f,u=n(8006),c=n(1156),f=n(52050),d=n(69711),p=n(76677),h=!1,m=d("meta"),y=0,v=function(e){s(e,m,{value:{objectID:"O"+y++,weakData:{}}})},b=e.exports={enable:function(){b.enable=function(){},h=!0;var e=u.f,t=o([].splice),n={};n[m]=1,e(n).length&&(u.f=function(n){for(var r=e(n),o=0,i=r.length;ob;b++)if((w=A(e[b]))&&u(m,w))return w;return new h(!1)}y=c(e,v)}for(k=P?e.next:y.next;!(O=o(k,y)).done;){try{w=A(O.value)}catch(e){d(y,"throw",e)}if("object"==typeof w&&w&&u(m,w))return w}return new h(!1)}},99212:function(e,t,n){var r=n(46916),o=n(19670),i=n(58173);e.exports=function(e,t,n){var a,l;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){l=!0,a=e}if("throw"===t)throw n;if(l)throw a;return o(a),n}},63061:function(e,t,n){"use strict";var r=n(13383).IteratorPrototype,o=n(70030),i=n(79114),a=n(58003),l=n(97497),s=function(){return this};e.exports=function(e,t,n,u){var c=t+" Iterator";return e.prototype=o(r,{next:i(+!u,n)}),a(e,c,!1,!0),l[c]=s,e}},51656:function(e,t,n){"use strict";var r=n(82109),o=n(46916),i=n(31913),a=n(76530),l=n(60614),s=n(63061),u=n(79518),c=n(27674),f=n(58003),d=n(68880),p=n(98052),h=n(5112),m=n(97497),y=n(13383),v=a.PROPER,b=a.CONFIGURABLE,g=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,k=h("iterator"),O="keys",_="values",S="entries",P=function(){return this};e.exports=function(e,t,n,a,h,y,j){s(n,t,a);var x,E,C,A=function(e){if(e===h&&I)return I;if(!w&&e in R)return R[e];switch(e){case O:case _:case S:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",M=!1,R=e.prototype,D=R[k]||R["@@iterator"]||h&&R[h],I=!w&&D||A(h),L="Array"==t&&R.entries||D;if(L&&(x=u(L.call(new e)))!==Object.prototype&&x.next&&(i||u(x)===g||(c?c(x,g):l(x[k])||p(x,k,P)),f(x,T,!0,!0),i&&(m[T]=P)),v&&h==_&&D&&D.name!==_&&(!i&&b?d(R,"name",_):(M=!0,I=function(){return o(D,this)})),h)if(E={values:A(_),keys:y?I:A(O),entries:A(S)},j)for(C in E)(w||M||!(C in R))&&p(R,C,E[C]);else r({target:t,proto:!0,forced:w||M},E);return i&&!j||R[k]===I||p(R,k,I,{name:h}),m[t]=I,E}},13383:function(e,t,n){"use strict";var r,o,i,a=n(47293),l=n(60614),s=n(70111),u=n(70030),c=n(79518),f=n(98052),d=n(5112),p=n(31913),h=d("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):m=!0),!s(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:p&&(r=u(r)),l(r[h])||f(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},97497:function(e){e.exports={}},26244:function(e,t,n){var r=n(17466);e.exports=function(e){return r(e.length)}},56339:function(e,t,n){var r=n(47293),o=n(60614),i=n(92597),a=n(19781),l=n(76530).CONFIGURABLE,s=n(42788),u=n(29909),c=u.enforce,f=u.get,d=Object.defineProperty,p=a&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),h=String(String).split("String"),m=e.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||l&&e.name!==t)&&(a?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&n&&i(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?a&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=c(e);return i(r,"source")||(r.source=h.join("string"==typeof t?t:"")),e};Function.prototype.toString=m((function(){return o(this)&&f(this).source||s(this)}),"toString")},74758:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},95948:function(e,t,n){var r,o,i,a,l,s,u,c,f=n(17854),d=n(49974),p=n(31236).f,h=n(20261).set,m=n(6833),y=n(71528),v=n(71036),b=n(35268),g=f.MutationObserver||f.WebKitMutationObserver,w=f.document,k=f.process,O=f.Promise,_=p(f,"queueMicrotask"),S=_&&_.value;S||(r=function(){var e,t;for(b&&(e=k.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},m||b||v||!g||!w?!y&&O&&O.resolve?((u=O.resolve(void 0)).constructor=O,c=d(u.then,u),a=function(){c(r)}):b?a=function(){k.nextTick(r)}:(h=d(h,f),a=function(){h(r)}):(l=!0,s=w.createTextNode(""),new g(r).observe(s,{characterData:!0}),a=function(){s.data=l=!l})),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},78523:function(e,t,n){"use strict";var r=n(19662),o=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw o("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,n){var r=n(47850),o=TypeError;e.exports=function(e){if(r(e))throw o("The method doesn't accept regular expressions");return e}},77023:function(e,t,n){var r=n(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},2814:function(e,t,n){var r=n(17854),o=n(47293),i=n(1702),a=n(41340),l=n(53111).trim,s=n(81361),u=i("".charAt),c=r.parseFloat,f=r.Symbol,d=f&&f.iterator,p=1/c(s+"-0")!=-1/0||d&&!o((function(){c(Object(d))}));e.exports=p?function(e){var t=l(a(e)),n=c(t);return 0===n&&"-"==u(t,0)?-0:n}:c},83009:function(e,t,n){var r=n(17854),o=n(47293),i=n(1702),a=n(41340),l=n(53111).trim,s=n(81361),u=r.parseInt,c=r.Symbol,f=c&&c.iterator,d=/^[+-]?0x/i,p=i(d.exec),h=8!==u(s+"08")||22!==u(s+"0x16")||f&&!o((function(){u(Object(f))}));e.exports=h?function(e,t){var n=l(a(e));return u(n,t>>>0||(p(d,n)?16:10))}:u},21574:function(e,t,n){"use strict";var r=n(19781),o=n(1702),i=n(46916),a=n(47293),l=n(81956),s=n(25181),u=n(55296),c=n(47908),f=n(68361),d=Object.assign,p=Object.defineProperty,h=o([].concat);e.exports=!d||a((function(){if(r&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=d({},e)[n]||l(d({},t)).join("")!=o}))?function(e,t){for(var n=c(e),o=arguments.length,a=1,d=s.f,p=u.f;o>a;)for(var m,y=f(arguments[a++]),v=d?h(l(y),d(y)):l(y),b=v.length,g=0;b>g;)m=v[g++],r&&!i(p,y,m)||(n[m]=y[m]);return n}:d},70030:function(e,t,n){var r,o=n(19670),i=n(36048),a=n(80748),l=n(3501),s=n(60490),u=n(80317),c=n(6200)("IE_PROTO"),f=function(){},d=function(e){return"