@syncfusion/ej2-form-renderer 34.2.8 → 35.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-form-renderer.umd.min.js +2 -2
- package/dist/ej2-form-renderer.umd.min.js.map +1 -1
- package/dist/es6/ej2-form-renderer.es2015.js +3261 -1523
- package/dist/es6/ej2-form-renderer.es2015.js.map +1 -1
- package/dist/es6/ej2-form-renderer.es5.js +3316 -1540
- package/dist/es6/ej2-form-renderer.es5.js.map +1 -1
- package/dist/global/ej2-form-renderer.min.js +2 -2
- package/dist/global/ej2-form-renderer.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/{common → form-renderer/common}/checkbox-group.js +1 -1
- package/src/{common → form-renderer/common}/conditional-rule-engine.d.ts +1 -6
- package/src/{common → form-renderer/common}/custom-validation-engine.d.ts +1 -1
- package/src/{common → form-renderer/common}/expressions/expression-engine.d.ts +1 -4
- package/src/{common → form-renderer/common}/expressions/expression-parser.d.ts +1 -9
- package/src/{common → form-renderer/common}/index.d.ts +2 -0
- package/src/{common → form-renderer/common}/index.js +2 -0
- package/src/{common → form-renderer/common}/json-converter.d.ts +6 -1
- package/src/{common → form-renderer/common}/json-converter.js +49 -8
- package/src/form-renderer/common/props-forwarder.d.ts +38 -0
- package/src/form-renderer/common/props-forwarder.js +123 -0
- package/src/{common → form-renderer/common}/utils.d.ts +6 -0
- package/src/form-renderer/form-renderer/custom-widget-resolver.d.ts +17 -0
- package/src/form-renderer/form-renderer/custom-widget-resolver.js +39 -0
- package/src/form-renderer/form-renderer/form-renderer-model.d.ts +125 -0
- package/src/form-renderer/form-renderer/form-renderer.d.ts +373 -0
- package/src/form-renderer/{form-renderer.js → form-renderer/form-renderer.js} +419 -298
- package/src/form-renderer/form-renderer/index.d.ts +7 -0
- package/src/form-renderer/form-renderer/index.js +6 -0
- package/src/form-renderer/{render-form-field.js → form-renderer/render-form-field.js} +154 -25
- package/src/form-renderer/index.d.ts +3 -4
- package/src/form-renderer/index.js +3 -3
- package/src/index.d.ts +1 -4
- package/src/index.js +1 -4
- package/common.d.ts +0 -4
- package/common.js +0 -4
- package/src/form-renderer/form-renderer-model.d.ts +0 -65
- package/src/form-renderer/form-renderer.d.ts +0 -425
- package/styles/bds-lite.css +0 -599
- package/styles/bds-lite.scss +0 -2
- package/styles/bds.css +0 -599
- package/styles/bds.scss +0 -2
- package/styles/bootstrap-dark-lite.css +0 -608
- package/styles/bootstrap-dark-lite.scss +0 -2
- package/styles/bootstrap-dark.css +0 -608
- package/styles/bootstrap-dark.scss +0 -2
- package/styles/bootstrap-lite.css +0 -595
- package/styles/bootstrap-lite.scss +0 -2
- package/styles/bootstrap.css +0 -595
- package/styles/bootstrap.scss +0 -2
- package/styles/bootstrap4-lite.css +0 -595
- package/styles/bootstrap4-lite.scss +0 -2
- package/styles/bootstrap4.css +0 -595
- package/styles/bootstrap4.scss +0 -2
- package/styles/bootstrap5-dark-lite.css +0 -595
- package/styles/bootstrap5-dark-lite.scss +0 -2
- package/styles/bootstrap5-dark.css +0 -595
- package/styles/bootstrap5-dark.scss +0 -2
- package/styles/bootstrap5-lite.css +0 -595
- package/styles/bootstrap5-lite.scss +0 -2
- package/styles/bootstrap5.3-lite.css +0 -679
- package/styles/bootstrap5.3-lite.scss +0 -2
- package/styles/bootstrap5.3.css +0 -679
- package/styles/bootstrap5.3.scss +0 -2
- package/styles/bootstrap5.css +0 -595
- package/styles/bootstrap5.scss +0 -2
- package/styles/fabric-dark-lite.css +0 -608
- package/styles/fabric-dark-lite.scss +0 -2
- package/styles/fabric-dark.css +0 -608
- package/styles/fabric-dark.scss +0 -2
- package/styles/fabric-lite.css +0 -595
- package/styles/fabric-lite.scss +0 -2
- package/styles/fabric.css +0 -595
- package/styles/fabric.scss +0 -2
- package/styles/fluent-dark-lite.css +0 -595
- package/styles/fluent-dark-lite.scss +0 -2
- package/styles/fluent-dark.css +0 -595
- package/styles/fluent-dark.scss +0 -2
- package/styles/fluent-lite.css +0 -595
- package/styles/fluent-lite.scss +0 -2
- package/styles/fluent.css +0 -595
- package/styles/fluent.scss +0 -2
- package/styles/fluent2-lite.css +0 -681
- package/styles/fluent2-lite.scss +0 -2
- package/styles/fluent2.css +0 -681
- package/styles/fluent2.scss +0 -2
- package/styles/form-renderer/_all.scss +0 -2
- package/styles/form-renderer/_bds-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap-dark-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap4-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap5-dark-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap5-definition.scss +0 -8
- package/styles/form-renderer/_bootstrap5.3-definition.scss +0 -8
- package/styles/form-renderer/_fabric-dark-definition.scss +0 -8
- package/styles/form-renderer/_fabric-definition.scss +0 -8
- package/styles/form-renderer/_fluent-dark-definition.scss +0 -8
- package/styles/form-renderer/_fluent-definition.scss +0 -8
- package/styles/form-renderer/_fluent2-definition.scss +0 -8
- package/styles/form-renderer/_highcontrast-definition.scss +0 -8
- package/styles/form-renderer/_highcontrast-light-definition.scss +0 -8
- package/styles/form-renderer/_layout.scss +0 -480
- package/styles/form-renderer/_material-dark-definition.scss +0 -8
- package/styles/form-renderer/_material-definition.scss +0 -8
- package/styles/form-renderer/_material3-dark-definition.scss +0 -8
- package/styles/form-renderer/_material3-definition.scss +0 -8
- package/styles/form-renderer/_mixin.scss +0 -26
- package/styles/form-renderer/_tailwind-dark-definition.scss +0 -8
- package/styles/form-renderer/_tailwind-definition.scss +0 -8
- package/styles/form-renderer/_tailwind3-definition.scss +0 -8
- package/styles/form-renderer/_theme.scss +0 -69
- package/styles/form-renderer/_variables.scss +0 -2
- package/styles/form-renderer/bds.css +0 -599
- package/styles/form-renderer/bds.scss +0 -2
- package/styles/form-renderer/bootstrap-dark.css +0 -608
- package/styles/form-renderer/bootstrap-dark.scss +0 -2
- package/styles/form-renderer/bootstrap.css +0 -595
- package/styles/form-renderer/bootstrap.scss +0 -2
- package/styles/form-renderer/bootstrap4.css +0 -595
- package/styles/form-renderer/bootstrap4.scss +0 -2
- package/styles/form-renderer/bootstrap5-dark.css +0 -595
- package/styles/form-renderer/bootstrap5-dark.scss +0 -2
- package/styles/form-renderer/bootstrap5.3.css +0 -679
- package/styles/form-renderer/bootstrap5.3.scss +0 -2
- package/styles/form-renderer/bootstrap5.css +0 -595
- package/styles/form-renderer/bootstrap5.scss +0 -2
- package/styles/form-renderer/fabric-dark.css +0 -608
- package/styles/form-renderer/fabric-dark.scss +0 -2
- package/styles/form-renderer/fabric.css +0 -595
- package/styles/form-renderer/fabric.scss +0 -2
- package/styles/form-renderer/fluent-dark.css +0 -595
- package/styles/form-renderer/fluent-dark.scss +0 -2
- package/styles/form-renderer/fluent.css +0 -595
- package/styles/form-renderer/fluent.scss +0 -2
- package/styles/form-renderer/fluent2.css +0 -681
- package/styles/form-renderer/fluent2.scss +0 -2
- package/styles/form-renderer/highcontrast-light.css +0 -595
- package/styles/form-renderer/highcontrast-light.scss +0 -2
- package/styles/form-renderer/highcontrast.css +0 -608
- package/styles/form-renderer/highcontrast.scss +0 -2
- package/styles/form-renderer/material-dark.css +0 -608
- package/styles/form-renderer/material-dark.scss +0 -2
- package/styles/form-renderer/material.css +0 -595
- package/styles/form-renderer/material.scss +0 -2
- package/styles/form-renderer/material3-dark.css +0 -677
- package/styles/form-renderer/material3-dark.scss +0 -2
- package/styles/form-renderer/material3.css +0 -679
- package/styles/form-renderer/material3.scss +0 -2
- package/styles/form-renderer/tailwind-dark.css +0 -595
- package/styles/form-renderer/tailwind-dark.scss +0 -2
- package/styles/form-renderer/tailwind.css +0 -595
- package/styles/form-renderer/tailwind.scss +0 -2
- package/styles/form-renderer/tailwind3.css +0 -669
- package/styles/form-renderer/tailwind3.scss +0 -2
- package/styles/highcontrast-light-lite.css +0 -595
- package/styles/highcontrast-light-lite.scss +0 -2
- package/styles/highcontrast-light.css +0 -595
- package/styles/highcontrast-light.scss +0 -2
- package/styles/highcontrast-lite.css +0 -608
- package/styles/highcontrast-lite.scss +0 -2
- package/styles/highcontrast.css +0 -608
- package/styles/highcontrast.scss +0 -2
- package/styles/material-dark-lite.css +0 -608
- package/styles/material-dark-lite.scss +0 -2
- package/styles/material-dark.css +0 -608
- package/styles/material-dark.scss +0 -2
- package/styles/material-lite.css +0 -595
- package/styles/material-lite.scss +0 -2
- package/styles/material.css +0 -595
- package/styles/material.scss +0 -2
- package/styles/material3-dark-lite.css +0 -677
- package/styles/material3-dark-lite.scss +0 -2
- package/styles/material3-dark.css +0 -677
- package/styles/material3-dark.scss +0 -2
- package/styles/material3-lite.css +0 -679
- package/styles/material3-lite.scss +0 -2
- package/styles/material3.css +0 -679
- package/styles/material3.scss +0 -2
- package/styles/tailwind-dark-lite.css +0 -595
- package/styles/tailwind-dark-lite.scss +0 -2
- package/styles/tailwind-dark.css +0 -595
- package/styles/tailwind-dark.scss +0 -2
- package/styles/tailwind-lite.css +0 -595
- package/styles/tailwind-lite.scss +0 -2
- package/styles/tailwind.css +0 -595
- package/styles/tailwind.scss +0 -2
- package/styles/tailwind3-lite.css +0 -669
- package/styles/tailwind3-lite.scss +0 -2
- package/styles/tailwind3.css +0 -669
- package/styles/tailwind3.scss +0 -2
- /package/src/{common → form-renderer/common}/checkbox-group.d.ts +0 -0
- /package/src/{common → form-renderer/common}/conditional-rule-engine.js +0 -0
- /package/src/{common → form-renderer/common}/custom-validation-engine.js +0 -0
- /package/src/{common → form-renderer/common}/datagrid-component.d.ts +0 -0
- /package/src/{common → form-renderer/common}/datagrid-component.js +0 -0
- /package/src/{common → form-renderer/common}/expressions/dependency-tracker.d.ts +0 -0
- /package/src/{common → form-renderer/common}/expressions/dependency-tracker.js +0 -0
- /package/src/{common → form-renderer/common}/expressions/expression-engine.js +0 -0
- /package/src/{common → form-renderer/common}/expressions/expression-parser.js +0 -0
- /package/src/{common → form-renderer/common}/expressions/grid-expressions.d.ts +0 -0
- /package/src/{common → form-renderer/common}/expressions/grid-expressions.js +0 -0
- /package/src/{common → form-renderer/common}/expressions/index.d.ts +0 -0
- /package/src/{common → form-renderer/common}/expressions/index.js +0 -0
- /package/src/{common → form-renderer/common}/minmax-rule-engine.d.ts +0 -0
- /package/src/{common → form-renderer/common}/minmax-rule-engine.js +0 -0
- /package/src/{common → form-renderer/common}/option-fetcher.d.ts +0 -0
- /package/src/{common → form-renderer/common}/option-fetcher.js +0 -0
- /package/src/{common → form-renderer/common}/parser.d.ts +0 -0
- /package/src/{common → form-renderer/common}/parser.js +0 -0
- /package/src/{common → form-renderer/common}/static-html-renderer.d.ts +0 -0
- /package/src/{common → form-renderer/common}/static-html-renderer.js +0 -0
- /package/src/{common → form-renderer/common}/utils.js +0 -0
- /package/src/form-renderer/{render-form-field.d.ts → form-renderer/render-form-field.d.ts} +0 -0
- /package/src/form-renderer/{types → form-renderer/types}/form-schema.d.ts +0 -0
- /package/src/form-renderer/{types → form-renderer/types}/form-schema.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-form-renderer.umd.min.js
|
|
3
|
-
* version :
|
|
3
|
+
* version : 35.1.37
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-image-editor"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-notifications","@syncfusion/ej2-image-editor","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-data","@syncfusion/ej2-grids"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Splitbuttons,e.ej2Dropdowns,e.ej2Calendars,e.ej2Notifications,e.ej2ImageEditor,e.ej2Richtexteditor,e.ej2Data,e.ej2Grids)}(this,function(e,_,N,S,q,z,Q,W,H,X,ee,G,h,r){"use strict";t.evaluateCondition=function(e,t){try{return"field"in e&&"operator"in e&&"value"in e?this.evaluateSimpleRule(e,t):"condition"in e&&"rules"in e&&this.evaluateCompositeRule(e,t)}catch(e){return!1}},t.evaluateSimpleRule=function(e,t){try{var n=t[e.field],a=e.operator.toLowerCase();if(void 0===n)if(-1===["equal","equals","notequal","notequals","isempty","isnotempty"].indexOf(a))return!1;var i=Array.isArray(n),r=new _.Internationalization;switch(a){case"equal":case"equals":return n===e.value;case"notequal":case"notequals":return n!==e.value;case"startswith":return n.startsWith(e.value);case"doesnotstartswith":return!n.startsWith(e.value);case"greaterthan":case"lessthan":case"greaterthanorequal":case"lessthanorequal":var o=Number(n),s=Number(e.value);return Number.isNaN(o)||Number.isNaN(s)?!1:"greaterthan"===a?s<o:"lessthan"===a?o<s:"greaterthanorequal"===a?s<=o:o<=s;case"dategreaterthan":case"datelessthan":var l=r.parseDate(n,{format:"MM/dd/yyyy"}),c=r.parseDate(e.value,{format:"MM/dd/yyyy"});return null!==l&&null!==c?"dategreaterthan"===a?c<l:"datelessthan"===a?l<c:l<=c:!1;case"timegreaterthan":case"timelessthan":var d=r.parseDate(n,{format:"hh:mm a",type:"time"}),u=r.parseDate(e.value,{format:"hh:mm a",type:"time"});if(null!==d&&null!==u){if("timegreaterthan"===a)return u<d;if("timelessthan"===a)return d<u}return!1;case"datetimegreaterthan":case"datetimelessthan":var p=r.parseDate(n,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"}),h=r.parseDate(e.value,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"});if(null!==p&&null!==h){if("datetimegreaterthan"===a)return h<p;if("datetimelessthan"===a)return p<h}return!1;case"contains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1!==n.indexOf(e.value):-1!==String(n).indexOf(String(e.value));case"notcontains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?!e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1===n.indexOf(e.value):-1===String(n).indexOf(String(e.value));case"isempty":return i?0===n.length:!n||0===String(n).length;case"isnotempty":return i?0<n.length:!!n&&0<String(n).length;default:return!1}}catch(e){return!1}},t.evaluateCompositeRule=function(e,t){var n,a=this;try{return Array.isArray(e.rules)&&0!==e.rules.length?"and"===(n=e.condition.toLowerCase())?e.rules.every(function(e){return a.evaluateCondition(e,t)}):"or"===n&&e.rules.some(function(e){return a.evaluateCondition(e,t)}):!1}catch(e){return!1}},t.isFieldVisible=function(e,t){try{return e&&e.visibleWhen?this.evaluateCondition(e.visibleWhen,t):!0}catch(e){return!0}},t.isFieldReadOnly=function(e,t){try{return e&&e.readOnlyWhen?this.evaluateCondition(e.readOnlyWhen,t):!1}catch(e){return!1}},t.isFieldDisabled=function(e,t){try{return e&&e.disabledWhen?this.evaluateCondition(e.disabledWhen,t):!1}catch(e){return!1}},t.isFieldHidden=function(e,t){try{return e&&e.hideWhen?this.evaluateCondition(e.hideWhen,t):!1}catch(e){return!1}},t.isFieldRequired=function(e,t){try{return e&&e.requiredWhen?this.evaluateCondition(e.requiredWhen,t):!1}catch(e){return!1}},t.getConditionalValue=function(e,t){try{return e&&e.setValueWhen?this.evaluateCondition(e.setValueWhen.condition,t)?e.setValueWhen.value:void 0:void 0}catch(e){}},t.evaluateConditionalDataRules=function(e,t){if(e&&Array.isArray(e))for(var n=0;n<e.length;n++){var a=e[n];if(this.evaluateCondition(a.condition,t))return n}return-1},t.getChoiceBasedOptions=function(e,t,n,a){try{var i,r=n&&n[a];return null==r?e.showAllWhenNotMapped?t:[]:(i=String(r))in e.choiceMapping?e.choiceMapping[i].filter(function(e){return-1!==t.indexOf(e)}):e.showAllWhenNotMapped?t:[]}catch(e){return t}};var $=t;function t(){}var c=function(){return(c=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},d=function(e){return e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random())};function E(t){for(var o=new Map,e=0,n=Object.keys(t.properties);e<n.length;e++){var a=n[e];o.set(a,t.properties[a])}function s(e){for(var r=[],t=function(e){if("field"===e.type){var t=e;if(l.has(t.propertyId))return"continue";l.add(t.propertyId);var n=o.get(t.propertyId);n?r.push(T(n)):(n={id:t.propertyId||d("textbox"),name:""+"_"+Math.floor(1e3*Math.random()),type:"textbox",label:"Unknown Field",_configured:!0},r.push(n))}else{var a,i;"table"===e.type?(a=c({id:(t=e).id||d("table"),name:t.name,type:"table",label:t.label||"Table",cssClass:t.cssClass,hideBorders:t.hideBorders,rows:t.rows,columns:t.cols,columnWidths:t.columnWidths,tableCells:[],_configured:!0},t.conditions?{conditions:t.conditions}:{}),t.cells.forEach(function(e){var t=[];e.forEach(function(e){e=s(e.children);t.push(e)}),a.tableCells.push(t)}),r.push(a)):"panel"===e.type?(t=c({id:(n=e).id||d("panel"),type:"panel",name:n.name,cssClass:n.cssClass,hideBorders:n.hideBorders,hideLabel:n.hideLabel,label:n.label||"Panel",children:s(n.children),_configured:!0},n.conditions?{conditions:n.conditions}:{}),r.push(t)):"tabs"===e.type?(i=c({id:(n=e).id||d("tabs"),type:"tabs",name:n.name,label:n.label||"Tabs",cssClass:n.cssClass,tabOptions:n.tabOptions,tabItems:[],_configured:!0},n.conditions?{conditions:n.conditions}:{}),n.tabs.forEach(function(e){i.tabItems.push({header:e.header,content:s(e.children)})}),r.push(i)):"card"===e.type&&(n=c({id:(t=e).id||d("card"),type:"card",name:t.name,label:t.label||"Card",cssClass:t.cssClass,hideLabel:t.hideLabel,children:s(t.children),_configured:!0},t.conditions?{conditions:t.conditions}:{}),void 0!==t.cardTitle&&(n.cardTitle=t.cardTitle),void 0!==t.cardSubtitle&&(n.cardSubtitle=t.cardSubtitle),r.push(n))}},n=0,a=e;n<a.length;n++)t(a[n]);return r}var i,l=new Set;return i=t.layout&&0!==t.layout.length?s(t.layout):Object.keys(t.properties).map(function(e){return T(t.properties[e])}),c({version:t.version,components:i},t.settings?{settings:t.settings}:{})}function T(t){var e=void 0!==t.options&&0<t.options.length,n={id:t.id||d(t.widget||A(t.type,t.format,e)),name:t.name,type:t.widget||A(t.type,t.format,e),label:t.label||t.id},a=new Set(["id","type","name","label","format","widget","defaultValue","required","options","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);return Object.keys(t).forEach(function(e){a.has(e)||"id"===e||"name"===e||"type"===e||"label"===e||(n[e]=t[e])}),void 0!==t.defaultValue&&(n.defaultValue=t.defaultValue),void 0!==t.expressionValue&&(n.expressionValue=t.expressionValue),void 0!==t.required&&(n.required=t.required),void 0!==t.content&&(n.content=t.content),void 0!==t.buttonType&&(n.buttonType=t.buttonType),void 0!==t.textboxType&&(n.textboxType=t.textboxType),void 0!==t.options&&(n.options=t.options),void 0!==t.minLength&&(n.minLength=t.minLength),void 0!==t.maxLength&&(n.maxLength=t.maxLength),void 0!==t.minValue&&(n.minValue=t.minValue),void 0!==t.maxValue&&(n.maxValue=t.maxValue),void 0!==t.minDate&&(n.minDate=t.minDate),void 0!==t.maxDate&&(n.maxDate=t.maxDate),void 0!==t.minTime&&(n.minTime=t.minTime),void 0!==t.maxTime&&(n.maxTime=t.maxTime),void 0!==t.pattern&&(n.regex=t.pattern),n}function A(e,t,n){return"string"===e?"date"===t?"date":"date-time"===t?"dateTime":"time"===t?"time":"email"===t?"email":"url"===t?"url":n?"dropdown":"textbox":"number"===e?"number":"boolean"===e?"checkbox":"array"===e?"multiselect":"button"===e?"button":"message"===e?"message":"sign"===e?"signature":"image"===e?"imageEditor":"file"===e?"fileUpload":"color"===e?"colorPicker":"grid"===e?"dataGrid":"textbox"}n.prototype.setAvailableFields=function(e){var t=this;this.availableFields.clear(),e.forEach(function(e){t.availableFields.set(e.name,e)})},n.prototype.validateFieldOperations=function(e){var t=[];if(0!==this.availableFields.size)for(var n=["-","*","/","%","^"],a=["-","*","/","%","^","+"],i=new Set,r=/(\{[^}]+\})/g;null!==(u=r.exec(e));){var o,s,l,c,d,u,p,h,m=u[0],f=m.slice(1,-1),y=this.availableFields.get(f);y&&(m=(u=u.index)+m.length,p=e.substring(Math.max(0,u-10),u),o=e.substring(m,Math.min(e.length,m+10)),s=p.replace(/\s+$/,"").slice(-1),l=o.replace(/^\s+/,"").charAt(0),c=p.replace(/\s+$/,""),d=o.replace(/^\s+/,""),u=u-(p.length-c.length)-1,p=m+(o.length-d.length),"string"!==y.type||y.format||(s&&-1!==n.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on string field '{"+f+"}'"),i.add(h)),!l)||-1===n.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on string field '{"+f+"}'"),i.add(h)),"date"!==y.format&&"date-time"!==y.format&&"time"!==y.format||(s&&-1!==a.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on date field '{"+f+"}'"),i.add(h)),!l)||-1===a.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on date field '{"+f+"}'"),i.add(h)))}return t},n.prototype.validate=function(e){var t=[];if(!e||""===e.trim())return{valid:!0,errors:[]};(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push("Unbalanced braces in expression");(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push("Unbalanced parentheses in expression");for(var n=/(\w+)\s*\(/g;null!==(a=n.exec(e));){var a=a[1].toUpperCase();a===a.toUpperCase()&&-1===this.supportedFunctions.indexOf(a)&&t.push("Unknown function: "+a)}var i=this.validateFieldOperations(e);return t.push.apply(t,i),{valid:0===t.length,errors:t}},n.prototype.compile=function(e,t){void 0===t&&(t={});try{var n;return t.availableFields&&Array.isArray(t.availableFields)&&this.setAvailableFields(t.availableFields),this.validate(e).valid?(n=e,n=this.compileFieldReferences(e),n=t.isCustomValidation?this.compileInputReferences(n):n,n=this.compileBareFunctionCalls(n),n=this.compileMatrixExpressions(n),function(e){try{return new Function("context","\n try {\n return "+n+";\n } catch (e) {\n return null;\n }\n ")(e)}catch(e){return null}}):function(){return null}}catch(e){return function(){return null}}},n.prototype.compileMatrixExpressions=function(e){var a=["PI","TRUE","FALSE","NULL","UNDEFINED","Math"],i=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"];return e.replace(/\$?\{([^}]+)\}/g,function(e,t){var n=t;return i.forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),a.forEach(function(e){var t=new RegExp("\\b"+e+"\\b","g");n=n.replace(t,"context."+e)}),"("+n+")"})},n.prototype.compileBareFunctionCalls=function(e){var n=e;return["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"].forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),n},n.prototype.compileFieldReferences=function(e){return e.replace(/\{([^{}]+)\}/g,function(e,t){return t.startsWith("\\")&&t.endsWith("\\")?e:"context['"+t.replace(/\./g,"'].[")+"']"})},n.prototype.compileInputReferences=function(e){var t=[],n=e=(e=(e=e.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g,function(e){return t.push(e),"__STRING_"+(t.length-1)+"__"})).replace(/(?<!context\[')\binput\./g,"context['input'].")).replace(/(?<!context\[')\binput\b(?!\s*[(\.])/g,"context['input']");return t.forEach(function(e,t){n=n.replace("__STRING_"+t+"__",e)}),n};var D=n;function n(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS","INCLUDES","CONTAINS","ISNAN","SUPPORTEDVALUESOF","TOSTRING","DATE","GETTIME","EVERY","SOME"],this.availableFields=new Map}a.prototype.extractFieldReferences=function(e){if(!e)return[];for(var t,n=new Set,a=e.replace(this.escapedBracePattern,""),i=/\{([^{}]+)\}/g;null!==(t=i.exec(a));){var r=t[1].trim();this.isFunctionCall(r)||this.isOperator(r)||(r=r.split(/[.\[\]]/)[0].trim())&&!this.isKeyword(r)&&n.add(r)}for(var o=/\$\{([^}]+)\}/g;null!==(t=o.exec(a));)for(var s=t[1],l=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[(\.])/g;null!==(c=l.exec(s));){var c=c[1];this.isKeyword(c)||"Math"===c||n.add(c)}return Array.from(n)},a.prototype.buildGraph=function(e){for(var t={},n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=this.extractFieldReferences(e[i]);t[i]=r}return t},a.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,c=[],d=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),c.push(t.slice(i).concat([r]))):d(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||d(n,[])}return c},a.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];i[a]&&s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},a.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},a.prototype.isOperator=function(e){return/^[+\-*/()=!<>&|]/.test(e)},a.prototype.isKeyword=function(e){return-1!==["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"].indexOf(e.toUpperCase())};var V=a;function a(){this.escapedBracePattern=/\\{.*?\\}/g}var O=function(){return(O=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=(o.prototype.evaluate=function(e,t,n,a){void 0===n&&(n={}),void 0===a&&(a=!1);try{if(!e||""===e.trim())return null;var i=n.timeout,r=void 0===i?5e3:i,o=n.maxDepth,s=void 0===o?10:o,l=n.locale,c=void 0===l?"en-US":l,d=n.throwOnError,u=void 0!==d&&d,p=this.getCacheKey(e,t);if(!a&&this.evaluationCache.has(p))return this.evaluationCache.get(p);var h=this.compiledFunctions.get(e),m=(h||(h=this.parser.compile(e,{timeout:r,maxDepth:s,locale:c,isCustomValidation:a}),this.compiledFunctions.set(e,h)),this.buildContext(t)),f=Date.now(),y=h(m);if(Date.now()-f>r){var v=new Error("Expression evaluation exceeded timeout of "+r+"ms");if(u)throw v;return null}return this.evaluationCache.set(p,y),y}catch(v){if(n.throwOnError)throw v;return null}},o.prototype.extractDependencies=function(e){return e?this.dependencyTracker.extractFieldReferences(e):[]},o.prototype.buildDependencyGraph=function(e){var n=this,a={};return e.forEach(function(e){var t;e.expressionValue&&(t=n.extractDependencies(e.expressionValue),a[e.name]=t)}),a},o.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,c=[],d=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),c.push(t.slice(i).concat([r]))):d(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||d(n,[])}return c},o.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},o.prototype.clearCache=function(){this.evaluationCache.clear(),this.compiledFunctions.clear()},o.prototype.getCacheKey=function(e,t){return e+":"+JSON.stringify(t)},o.prototype.buildContext=function(e){var n=new _.Internationalization,a=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return O({},e,{PI:Math.PI,TRUE:!0,FALSE:!1,NULL:null,UNDEFINED:void 0,Math:Math,SUM:function(e){return Array.isArray(e)?e.reduce(function(e,t){return Number(e)+Number(t)},0):0},AVG:function(e){return Array.isArray(e)&&0!==e.length?e.reduce(function(e,t){return Number(e)+Number(t)},0)/e.length:0},MIN:function(e){return Array.isArray(e)&&0<e.length?Math.min.apply(Math,e.map(Number)):0},MAX:function(e){return Array.isArray(e)&&0<e.length?Math.max.apply(Math,e.map(Number)):0},COUNT:function(e){return Array.isArray(e)?e.length:0},ROUND:function(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},FLOOR:Math.floor,CEIL:Math.ceil,ABS:Math.abs,SQRT:Math.sqrt,UPPER:function(e){return String(e).toUpperCase()},LOWER:function(e){return String(e).toLowerCase()},CONCAT:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(String).join("")},LENGTH:function(e){return String(e).length},TRIM:function(e){return String(e).trim()},SUBSTRING:function(e,t,n){return void 0!==n?String(e).substr(t,n):String(e).substr(t)},TODAY:function(){return a(new Date)},AGE:function(e){var e="string"==typeof e?new Date(e):e,t=new Date,n=t.getFullYear()-e.getFullYear(),a=t.getMonth()-e.getMonth();return(a<0||0==a&&t.getDate()<e.getDate())&&n--,n},DATEFORMAT:function(e,t){e="string"==typeof e?new Date(e):e;return n.getDateFormat({format:t,type:"date"})(e)},DATEDIFF:function(e,t){e="string"==typeof e?new Date(e):e,t="string"==typeof t?new Date(t):t;return Math.floor((t.getTime()-e.getTime())/864e5)},ADDDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()+Number(t)),a(e)},SUBDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()-Number(t)),a(e)}})},o);function o(){this.evaluationCache=new Map,this.compiledFunctions=new Map,this.parser=new D,this.dependencyTracker=new V}function te(e){return{primary:"e-primary",flat:"e-flat",information:"e-info",error:"e-danger",success:"e-success",warning:"e-warning"}[e||"primary"]||"e-primary"}function ne(e){return"submit"===e||"reset"===e?e:"button"}function ae(e){return{Left:"flex-start",Right:"flex-end",Center:"center"}[e||"Left"]||"flex-start"}var u={EMAIL:/^(?!.*\.\.)[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,URL:/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/,DATE_ISO:/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,DIGITS:/^[0-9]*$/,PHONE:/^[+]?[0-9]{9,13}$/,CREDIT_CARD:/^\d{13,16}$/};function I(t,e){function n(e){e.forEach(function(e){e.name&&e.id in t&&(a[e.name]=t[e.id]),e.children&&n(e.children),e.tabItems&&e.tabItems.forEach(function(e){return e.content&&n(e.content)}),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(n)})})}var a={};return n(e),a}function R(t,e,n){if("string"!=typeof t||!/{[^}]+}/.test(t))return t;n=n?I(e,n):e;try{var a=M.evaluate(t,n);return null!=a?String(a):""}catch(e){return t}}function J(e,t,n){return e&&"object"==typeof e&&!Array.isArray(e)&&"lookup"===e.type&&n?n&&0<n.length?n:[]:e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type?0<t.length?t:[]:Array.isArray(e)?e:e&&"object"==typeof e&&!Array.isArray(e)&&"raw"===e.type&&Array.isArray(e.data)?e.data:[]}var M=new i;j.fetch=function(e,c,d,u){var p;return e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type&&e.url?(p=e,new Promise(function(t){try{var e,n,a,i={},r=(p.headers&&Array.isArray(p.headers)&&p.headers.forEach(function(e){e.key&&e.key.trim()&&(i[e.key]=e.value)}),new h.DataManager({url:p.url,adaptor:function(e){switch(e){case"WebApiAdaptor":return new h.WebApiAdaptor;case"ODataV4Adaptor":return new h.ODataV4Adaptor;default:return new h.UrlAdaptor}}(p.adaptorType),headers:Object.keys(i).length?i:void 0})),o=new h.Query,s=(p.search&&p.search.enabled&&p.search.fields&&0<p.search.fields.length&&(e=p.search.key||"search",n=d?R(e,d,u):/[{}]/.test(e)?"":e,o=o.search(n,p.search.fields)),p.sort&&p.sort.enabled&&p.sort.field&&(a="descending"===p.sort.direction?"descending":"ascending",o=o.sortBy(p.sort.field,a)),p.filters&&Array.isArray(p.filters)&&0<p.filters.length&&p.filters.forEach(function(e){var t;e.field&&e.operator&&void 0!==e.value&&""!==e.value&&""!==(t=d?R(e.value,d,u):/[{}]/.test(e.value)?"":e.value)&&(o=o.where(e.field,e.operator,t))}),p.queryParams&&Object.keys(p.queryParams).forEach(function(e){o=o.addParams(e,p.queryParams[e])}),p.skip&&(o=o.skip(p.skip)),p.take&&(o=o.take(p.take)),!1),l=setTimeout(function(){s=!0,t({id:c,options:[]})},15e3);r.executeQuery(o).then(function(e){s||(clearTimeout(l),e=e.result,p.dataPath&&(e=function(e,t){if(!t||null==e)return e;for(var n=e,a=0,i=t.split(/\.(?![^\[]*\])/);a<i.length;a++){var r=i[a];if(null==n)return null;var o,s=r.match(/^(\w*)\[(\d+)\]$/);n=s?(o=s[1],s=parseInt(s[2]),o?n[o]&&n[o][s]:n[s]):n[r]}return n}(e,p.dataPath)),e=Array.isArray(e)?e:"string"==typeof e?[e]:[],t({id:c,options:e}))}).catch(function(e){s||(clearTimeout(l),t({id:c,options:[]}))})}catch(e){t({id:c,options:[]})}})):Promise.resolve({id:c,options:[]})};var Y=j;function j(){}s.prototype.getSelectedItems=function(){var e=this.formState?this.formState.values[this.component.id]:_.isNullOrUndefined(this.valueProp())?this.component.defaultValue:this.valueProp();return Array.isArray(e)?e:[]},s.prototype.valueProp=function(){return this._value},s.prototype.setValue=function(e){this._value=e},s.prototype.handleCheckboxChange=function(t,e){var n=this.getSelectedItems(),e=e?n.concat([t]):n.filter(function(e){return e!==t});this.formState&&this.onChangeCb(e)},Object.defineProperty(s.prototype,"sizeCssClass",{get:function(){return(this.component.cssClass||"")+("Small"===this.component.size?" e-small":"Bigger"===this.component.size?" e-bigger":"")},enumerable:!0,configurable:!0}),s.prototype.render=function(e){var i=this,r=this.component,t=r.label&&r.required?r.label+" *":r.label||"",e=e||this.target,n=document.createElement("div"),o=(n.className=("checkbox-group "+(r.cssClass||"")).trim(),n.setAttribute("role","group"),n.setAttribute("aria-label",t),n.title=r.tooltip||"",(t=r.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{}),t=(Object.keys(o).forEach(function(e){"class"!==e&&"className"!==e&&"style"!==e&&n.setAttribute(e,String(o[e]))}),"display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";gap:"+(r.gap||"8px")+";align-items:flex-start;"),s=(n.setAttribute("style",t),document.createElement("div")),t=(s.className="checkbox-group-items","display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";flex-wrap:wrap;gap:"+(r.gap||"2px")+";width:100%;"),t=(s.setAttribute("style",t),Array.isArray(r.options)?r.options:["Option 1"]),l=this.getSelectedItems();return t.forEach(function(e,t){var n="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,e="string"==typeof e?e:null!=e.label?e.label:null!=e.value?e.value:String(n),a=document.createElement("input"),e=(s.appendChild(a),new z.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==l.indexOf(n),disabled:!!r.disabled,labelPosition:r.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),htmlAttributes:o,change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)}),n.appendChild(s),e&&e.appendChild(n),this.container=n,this.itemsContainer=s,n},s.prototype.refreshSelection=function(){var n=this,a=this.getSelectedItems();(Array.isArray(this.component.options)?this.component.options:["Option 1"]).forEach(function(e,t){e="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,t=n.checkboxes[t];t&&(t.checked=-1!==a.indexOf(e))})},s.prototype.destroy=function(){for(var e=0,t=this.checkboxes;e<t.length;e++){var n=t[e];try{n.destroy()}catch(e){}}this.checkboxes=[],this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.itemsContainer=null},s.prototype.setOptions=function(e){var i=this;if(this.component.options=e,this.itemsContainer){for(var t=0,n=this.checkboxes;t<n.length;t++){var a=n[t];try{a.destroy()}catch(e){}}for(this.checkboxes=[];this.itemsContainer.firstChild;)this.itemsContainer.removeChild(this.itemsContainer.firstChild);var r=this.getSelectedItems();e.forEach(function(e,t){var n="string"==typeof e?e:e.value||e.label||e.key,e="string"==typeof e?e:e.label||e.value||String(n),a=document.createElement("input"),e=(i.itemsContainer.appendChild(a),new z.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==r.indexOf(n),disabled:!!i.component.disabled,labelPosition:i.component.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)})}};var ie=s;function s(e){this.checkboxes=[],this.component=e.component,this.formState=e.formState,this.onChangeCb=e.onChange,this.optionRef=e.optionRef,this.enableRtl=e.enableRtl,this.target=e.target,this.container=null,this.itemsContainer=null,this.ref=e.ref}var L=function(){return(L=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},P=(l.prototype.parseColumnValue=function(e,t){var n;return null==e||""===e?e:"number"===t?(n=parseFloat(String(e)),isNaN(n)?0:n):"boolean"!==t||"boolean"==typeof e?e:"true"===e||"1"===e||1===e||!0===e},l.prototype.evaluateRowExpressions=function(e,a){for(var i=this,r=L({},e),e=a.filter(function(e){return e.expression&&e.expression.toString().trim()}),o=this,t=0,n=e;t<n.length;t++)!function(t){if(!t.expression)return;try{var n={},e=(a.forEach(function(e){var t=r[e.field];n[e.field]=i.parseColumnValue(t,e.type)}),o.engine.evaluate(t.expression,n,{throwOnError:!1}));r[t.field]=e}catch(e){r[t.field]=null}}(n[t]);return r},l.prototype.extractCalculatedColumns=function(e){return e.filter(function(e){return e.expression&&e.expression.toString().trim()})},l.prototype.getEngine=function(){return this.engine},l);function l(){this.engine=new i}var B=function(){return(B=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},U=(p.prototype.validate=function(e,t,n){if(!e||""===e.trim())return!0;try{var a,i,r=B({},n,{input:t,valid:!0}),o=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*['"](.+?)['"]\s*$/);return o?(a=o[1].trim(),i=o[2],!0===this.expressionEngine.evaluate(a,r,{throwOnError:!1},!0)||i):"Invalid validation expression format"}catch(e){return"Validation expression error"}},p.prototype.extractDependencies=function(e){var t;return e?(t=(t=e.match(/valid\s*=\s*(.+)/))?t[1]:e,this.expressionEngine.extractDependencies(t).filter(function(e){return"input"!==e})):[]},p.prototype.validateConditionSyntax=function(e,t){if(!e||""===e.trim())return["Condition cannot be empty"];var n=[],a=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length,a=(a!==i&&n.push("Unbalanced parentheses ("+a+" open, "+i+" close)"),(e.match(/\{/g)||[]).length),i=(e.match(/\}/g)||[]).length;a!==i&&n.push("Unbalanced braces ("+a+" open, "+i+" close)");a=this.extractDependencies(e).filter(function(e){return-1===t.indexOf(e)});return 0<a.length&&n.push("Unknown field references: "+a.join(", ")),n},p.prototype.buildExpression=function(e,t){return"valid = "+e.trim()+" ? true : '"+t.replace(/'/g,"\\'")+"'"},p.prototype.parseExpression=function(e){e=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*'(.+)'/);return e?{condition:e[1].trim(),errorMessage:e[2].replace(/\\'/g,"'")}:null},p);function p(){this.expressionEngine=new i}var m=function(){return(m=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},re=(Object.defineProperty(f.prototype,"calculatedColumns",{get:function(){return this.gridExpressions.extractCalculatedColumns(this.columns)},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"hasExpressions",{get:function(){return 0<this.calculatedColumns.length},enumerable:!0,configurable:!0}),f.prototype.buildToolbar=function(){var e=[];return this.allowAdding&&e.push("Add"),this.allowEditing&&e.push("Edit"),this.allowDeleting&&e.push("Delete"),e.push("Update","Cancel"),e},f.prototype.mapColumn=function(e){var t,n=e.validationRules?m({},e.validationRules):{},a=this.mapCustomValidationToSyncfusion(e);return a&&(t=e.customValidation&&e.customValidation[0]&&e.customValidation[0].expression&&(this.validationEngine.parseExpression?this.validationEngine.parseExpression(e.customValidation[0].expression).errorMessage:"Validation failed")||"Validation failed",n.required=[!0,t],n.custom=[a,t]),{field:e.field,headerText:e.headerText,type:e.type||"string",isPrimaryKey:e.isPrimaryKey||!1,width:e.width,format:"date"===e.type?e.format||"MM/dd/yyyy":e.format,editType:e.editType,allowEditing:!1!==e.allowEditing&&!e.expression,validationRules:n,edit:this.createEditParams(e)}},f.prototype.render=function(e){var n=this,t=Array.isArray(this.dataSource)?this.dataSource:[],t=(this.hasExpressions&&0<t.length?this.currentData=t.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=t,document.createElement("div")),a=(t.className="datagrid-wrapper",t.style.width="string"==typeof this.width?this.width:this.width+"px",t.style.height="auto",document.createElement("div")),i=(a.className="datagrid-grid",t.appendChild(a),this.id&&(a.id=this.id),new r.Grid({dataSource:this.currentData,allowPaging:this.allowPaging,filterSettings:{mode:"Immediate"},pageSettings:{pageSize:this.pageSize},editSettings:{allowEditing:this.allowEditing,allowAdding:this.allowAdding,allowDeleting:this.allowDeleting,mode:"Normal"},enableRtl:this.enableRtl,locale:this.locale||"en-US",cssClass:this.cssClass,toolbar:this.buildToolbar(),actionComplete:this.handleActionComplete,height:"string"==typeof this.height?this.height:this.height+"px",width:"string"==typeof this.width?this.width:this.width+"px",allowSorting:!0,allowFiltering:this.allowFiltering,allowSelection:!0,columns:(this.columns||[]).map(function(e){return n.mapColumn(e)})}));return i.appendTo(a),this.ref(i),this.grid=i,e&&e.appendChild(t),this.wrapper=t},f.prototype.getRef=function(){var e=this;return{getGridData:function(){return e.currentData},gridRef:{current:this.grid}}},f.prototype.getGridData=function(){return this.currentData},f.prototype.setDataSource=function(e){var n=this;this.grid&&(e=Array.isArray(e)?e:[],this.hasExpressions&&0<e.length?this.currentData=e.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=e,this.grid.dataSource=this.currentData,this.grid.refreshBatchData?this.grid.setProperties({dataSource:this.currentData},!0):this.grid.dataSource=this.currentData,this.grid.refresh)&&this.grid.refresh()},f.prototype.setColumns=function(e){this.grid&&(e&&0!==e.length?0===this.grid.columns.length&&e&&1===e.length&&(this.grid.columns=e):this.grid.columns=[],this.columns=e,this.grid.refresh)&&!this.isPreviewMode&&(this.dataSource&&Array.isArray(this.dataSource)&&0<this.dataSource.length&&!this.hasExpressions&&(this.grid.dataSource=this.dataSource),this.grid.refresh())},f.prototype.destroy=function(){if(this.grid){try{this.grid.destroy()}catch(e){}this.grid=null}this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.wrapper=null,this.gridExpressions=null,this.validationEngine=null,this.currentData=[],this.columns=[],this.dataSource=[]},f);function f(e){var l=this;this.grid=null,this.wrapper=null,this.mapCustomValidationToSyncfusion=function(s){if(s.customValidation&&0!==s.customValidation.length)return function(e){var n=l.grid&&l.grid.editModule?l.grid.editModule.formObj:null;if(n){var a={};(l.columns||[]).forEach(function(e){var t=n.getInputElement(e.field);t&&(t=t.value,a[e.field]="number"===e.type?parseInt(t,10):t)});for(var t=0,i=s.customValidation;t<i.length;t++){var r,o=i[t];if(o.expression)return r="number"===s.type?parseInt(e.value,10):e.value,!0===l.validationEngine.validate(o.expression,r,a)}}return!0}},this.createEditParams=function(t){if(l.hasExpressions){var n=l.calculatedColumns;if(n.some(function(e){return!!e.expression&&-1!==e.expression.indexOf("{"+t.field+"}")}))return{params:{change:function(){var e,o;l.grid&&l.grid.element&&(e=l.grid.element.querySelector("form"))&&e.ej2_instances&&e.ej2_instances[0]&&(o=e.ej2_instances[0],n.forEach(function(e){var t=o.getInputElement(e.field);if(t)try{var n={};l.columns.forEach(function(e){var t=o.getInputElement(e.field);t&&(n[e.field]=t.value)});var a,i,r=l.gridExpressions.evaluateRowExpressions(n,l.columns)[e.field];null!=r&&("boolean"===e.type?t.checked=!!r:"number"===e.type?(i=(a=t.closest(".e-control-wrapper"))?a.querySelector('input.e-control:not([type="hidden"])'):null)&&i.ej2_instances&&i.ej2_instances[0]?i.ej2_instances[0].value=r:t.value=r:"date"===e.type?t.ej2_instances[0].value=new Date(r):t.value=r)}catch(e){}}))}}}}},this.handleActionComplete=function(e){var t;if(l.grid)switch(e.requestType){case"save":case"delete":case"add":l.grid.dataSource&&(t=Array.isArray(l.grid.dataSource)?l.grid.dataSource:[],l.currentData=t,l.onDataChange)&&l.onDataChange(t)}},this.id=e.id,this.columns=e.columns||[],this.dataSource=Array.isArray(e.dataSource)?e.dataSource:[],this.height=null!=e.height?e.height:"200px",this.width=null!=e.width?e.width:"100%",this.locale=e.locale,this.cssClass=e.cssClass,this.pageSize=null!=e.pageSize?e.pageSize:6,this.allowPaging=!1!==e.allowPaging,this.allowAdding=!1!==e.allowAdding,this.allowEditing=!1!==e.allowEditing,this.allowDeleting=!1!==e.allowDeleting,this.allowFiltering=!0===e.allowFiltering,this.onDataChange=e.onDataChange,this.isPreviewMode=e.isPreviewMode,this.enableRtl=e.enableRtl,this.ref=e.ref,this.currentData=Array.isArray(this.dataSource)?this.dataSource:[],this.gridExpressions=new P,this.validationEngine=new U}r.Grid.Inject(r.Edit,r.Toolbar,r.Page,r.Resize,r.Sort,r.Filter);function Z(e,t){e&&t&&e.setAttribute("id",t)}function F(r){function e(t){var e=o.validateOn||"Change",n={};return e&&"Change"!==e||(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),"Blur"===e&&(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),n}var t,o=r.component,s=r.value,l=r.onChange,a=r.onBlur,c=r.onClick,n=void 0!==(n=r.hasError)&&n,d=r.locale,i=r.formState,u=r.settings,p=r.components,h=r.enableRtl,m=r.ref,j=r.l10n,L=r.initializedGrids||new Set,f=r.target,y={floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled},v=(t=o.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{},P=(o.required&&(v["aria-required"]="true"),n?"e-error":""),g=((o.cssClass||"")+" "+P+" "+("Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"")).trim();switch(o.type){case"textbox":var b=new q.TextBox(K({id:o.name,type:o.multiline?"hidden":o.textboxType||"text",name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",multiline:o.multiline,showClearButton:o.showClearButton,autocomplete:!1===o.autocomplete||void 0===o.autocomplete?"off":"on",readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"textarea":b=new q.TextArea(K({id:o.name,name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",cols:o.cols||200,rows:o.textareaRows||4,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,maxLength:o.maxLength||255,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,resizeMode:"Vertical"},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"number":b=""===s?void 0:s,b=new q.NumericTextBox({locale:d,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==b?b:o.defaultValue||void 0,decimals:o.decimals||2,currency:o.currency,format:o.numberFormat||"n2",step:o.step||1,min:o.minValue||void 0,max:o.maxValue||void 0,readonly:o.readOnly||!1,showClearButton:o.showClearButton||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),b.appendTo(f)),m(b),b;case"checkbox":b=o.label&&o.required?o.label+" *":o.label,b=new z.CheckBox({locale:d,name:o.id,enableRtl:h,label:b,labelPosition:o.checkboxLabelPosition,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,indeterminate:o.indeterminate||!1,disabled:o.disabled,cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"checkboxGroup":var x=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(x.push.apply(x,e.options),C.setOptions(x))}).catch(function(){}),J(o.options,x)),b=0<b.length?b:o.options||["Option 1"],C=new ie({component:K({},o,{options:b}),formState:i,value:s,enableRtl:h,onChange:function(e){return l(e)},optionRef:r.ref,target:f,ref:m});return f&&Z(f,o.name),C.render(f),C;case"radio":var b=Array.isArray(o.options)?o.options:["Option 1"],B=_.createElement("div",{id:o.name+"-group",className:"e-radio-group "+P});return b.forEach(function(e,t){var n=e,a=_.createElement("div"),i=(a.style.marginBottom="8px",B.appendChild(a),_.createElement("input",{id:o.name+"_"+t+"_"+n,attrs:{type:"radio"}})),a=(a.appendChild(i),new z.RadioButton({name:o.id,label:e,enableRtl:h,locale:d,disabled:o.disabled,value:n,htmlAttributes:v,labelPosition:o.fieldLabelPosition,checked:o.defaultValue===n||s===n,cssClass:g,change:function(e){e.value===n&&l(n)}}));a.appendTo(i),m(a,t),r.ref&&"function"==typeof r.ref&&r.ref(a,t)}),f&&f.appendChild(B),[];case"dropdown":var w=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(w.push.apply(w,e.options),S.dataSource=w)}).catch(function(){}),J(o.options,w)),b=0<b.length?b:o.options||["Option 1"],S=(o.conditions&&o.conditions.choiceBasedField&&0<(b=$.getChoiceBasedOptions(o.conditions.choiceBasedField,b,i?i.values:void 0,o.conditions.choiceBasedField.primaryFieldId)).length&&null!=s&&-1===b.indexOf(s)&&i&&(i.values[o.id]=null),new W.DropDownList(K({id:o.name,name:o.id,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:d,enableRtl:h,cssClass:g,dataSource:b,value:void 0!==i.values[o.id]?i.values[o.id]:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",htmlAttributes:v},e(function(e){return e.value||""}))));return W.DropDownList.Inject(W.VirtualScroll),f&&S.appendTo(f),m(S),S;case"multiselect":var E=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(E.push.apply(E,e.options),T.dataSource=E)}).catch(function(){}),J(o.options,E)),b=0<b.length?b:o.options||["Option 1"],T=new W.MultiSelect(K({name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,placeholder:o.placeholder,dataSource:b,fields:{text:"text",value:"value"},showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,allowCustomValue:o.allowCustomValue||!1,addTagOnBlur:o.addTagOnBlur||!1,delimiterChar:o.delimiterChar||",",showSelectAll:o.showSelectAll||!1,mode:o.showSelectAll?"CheckBox":o.visualMode||void 0,selectAllText:o.selectAllText,unSelectAllText:o.unSelectAllText,showDropDownIcon:!1!==o.showDropDownIcon,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return W.MultiSelect.Inject(W.CheckBoxSelection,W.VirtualScroll),f&&T.appendTo(f),m(T),T;case"date":b=new H.DatePicker(K({floatLabelType:y.floatLabelType,id:o.name,name:o.id,enableRtl:h,locale:d,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy",readOnly:o.readOnly||!1,showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,calendarMode:o.calendarMode||"Gregorian",dayHeaderFormat:o.dayHeaderFormat||"Short",depth:o.depth||"Month",start:o.start||"Month",firstDayOfWeek:o.firstDayOfWeek||0,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DatePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"dateTime":b=new H.DateTimePicker(K({id:o.name,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:d,enableRtl:h,name:o.id,dayHeaderFormat:o.dayHeaderFormat||"Short",value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,depth:o.depth||"Month",start:o.start||"Month",step:o.step||1,readonly:o.readOnly||!1,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,minTime:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,maxTime:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DateTimePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"time":b=new H.TimePicker(K({id:o.name,locale:d,name:o.id,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,step:o.step||30,readonly:o.readOnly||!1,min:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,max:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"dateRange":b=new H.DateRangePicker(K({id:o.name,locale:d,enableRtl:h,name:o.id,floatLabelType:y.floatLabelType,dayHeaderFormat:o.dayHeaderFormat||"Short",placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,depth:o.depth||"Month",start:o.start||"Month",min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,format:o.format||"MM/dd/yyyy",separator:o.separator||" - ",showClearButton:void 0!==o.showClearButton&&o.showClearButton,readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"switch":b=new z.Switch({locale:d,enableRtl:h,value:o.defaultValue,name:o.id,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,disabled:o.disabled,onLabel:o.onLabel||"",offLabel:o.offLabel||"",cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"button":var A,D,b=o.buttonsGroups||o.buttons||[];return b&&0<b.length?(I={display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.gap||"8px",justifyContent:ae(o.position),width:o.width||void 0},A=_.createElement("div",{id:o.name,attrs:{role:"group","aria-label":o.label||"Button Group",className:g+" "+(h?"e-rtl":"")}}),Object.assign(A.style,I),D=[],b.forEach(function(e,t){var n=o.name+"_"+t,a=[te(e.style)].filter(Boolean).join(" "),i=(a+="Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"",ne(e.type)),n=_.createElement("button",{id:String(n),attrs:{name:String(n),type:i}}),i=(A.appendChild(n),new z.Button({locale:d,enableRtl:h,cssClass:a,disabled:e.disabled||!1,content:e.label||"Button "+(t+1),iconCss:e.iconCss,iconPosition:e.iconPosition}));i.appendTo(n),i.element.onclick=function(e){c&&c(e)},m(i,t),D.push(i),r.ref&&"function"==typeof r.ref&&r.ref(i,t)}),f&&f.appendChild(A),D):(I=ne(o.buttonType),b=[te(o.style),"submit"===I?"submit-btn form-submit-type":"","reset"===I?"form-reset-type":"",o.cssClass||"e-primary","Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":""].filter(Boolean).join(" ")||"e-primary",V={display:"flex",justifyContent:ae(o.position),width:o.width||"100%"},O=_.createElement("div",{id:o.name+"-container"}),Object.assign(O.style,V),V=_.createElement("button",{id:o.name,attrs:{type:I}}),O.appendChild(V),(I=new z.Button({enableRtl:h,locale:d,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition,content:o.label})).appendTo(V),m(I),I.element.onclick=function(e){c&&c(e)},f&&f.appendChild(O),I);case"splitButton":var b=["primary"===o.style?"e-primary":"",(o.style,""),"information"===o.style?"e-info":"","error"===o.style?"e-danger":"","success"===o.style?"e-success":"","warning"===o.style?"e-warning":"",o.cssClass||""].filter(Boolean).join(" ")||void 0,V={display:"flex",justifyContent:ae(o.position)},O=_.createElement("div",{id:o.name+"-container",attrs:{"aria-label":"Splitbutton"}}),I=(Object.assign(O.style,V),o.options&&0<o.options.length?o.options.map(function(e,t){return{text:e,id:o.id+"_option_"+t}}):[{text:"Option 1",id:o.id+"_option_0"}]),V=_.createElement("button",{id:o.name}),I=(O.appendChild(V),new Q.SplitButton({locale:d,enableRtl:h,content:o.label||"Split Button",items:I,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition||"Left",click:function(e){c&&c(K({},e))},select:function(e){c&&c(K({},e,{selectedItem:e.item.text}))}}));return I.appendTo(V),f&&f.appendChild(O),m(I),I;case"signature":b=_.createElement("canvas",{id:o.name}),V=new q.Signature({enableRtl:h,locale:d,backgroundColor:o.backgroundColor||"",strokeColor:o.strokeColor||"",maxStrokeWidth:o.maxValue,minStrokeWidth:o.minValue,velocity:o.velocity,disabled:o.disabled,change:function(){return l(o.name)}});return f&&(V.appendTo(b),f.appendChild(b)),m(V),V;case"rating":O=new q.Rating({enableRtl:h,locale:d,value:void 0!==s?s:o.defaultValue||0,disabled:o.disabled,cssClass:g,allowReset:o.allowReset,itemsCount:o.itemsCount,min:o.minValue,precision:o.precision,readOnly:o.readOnly,showTooltip:o.showRatingTooltip||!1,showLabel:o.showRatingLabel,labelPosition:o.showRatingLabel?o.ratingLabelPosition:void 0,valueChanged:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),O.appendTo(f)),m(O),O;case"colorPicker":I=new q.ColorPicker({enableRtl:h,locale:d,value:void 0!==s?s:o.defaultValue||"",disabled:o.disabled,enableOpacity:o.enableOpacity,showButtons:o.showButtons,showRecentColors:o.showRecentColors,noColor:o.showNoColor,cssClass:g,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),I.appendTo(f)),m(I),I;case"inputMask":b=new q.MaskedTextBox(K({id:o.name,name:o.id,enableRtl:h,floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled,locale:d,value:void 0!==s?s:o.defaultValue||"",mask:o.mask||"000-000-0000",promptChar:o.promptChar||"_",customCharacters:o.customCharacters,readOnly:o.readOnly||!1,showClearButton:!1!==o.showClearButton,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"rangeSlider":V=new q.Slider({enableRtl:h,locale:d,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:0,min:o.minValue||0,max:o.maxValue||100,step:o.step||1,cssClass:g,enabled:!o.disabled,readonly:o.readOnly,showButtons:o.showButtons,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),V.appendTo(f)),m(V),V;case"fileUpload":O=new q.Uploader({enableRtl:h,locale:d,type:"file",enabled:!o.disabled,allowedExtensions:o.allowExtensions,asyncSettings:{saveUrl:o.saveUrl,removeUrl:o.removeUrl},buttons:o.buttons||{browse:"Choose File",clear:"Clear All",upload:"Upload All"},maxFileSize:o.maxValue,minFileSize:o.minValue,multiple:!!o.allowMultiple,showFileList:o.showFileList,htmlAttributes:v,cssClass:g,change:function(e){return l(e.file)}});return f&&(Z(f,o.name),O.appendTo(f)),m(O),O;case"imageEditor":var R,I=_.createElement("div",{id:o.name,attrs:{"data-field":o.id}});return setTimeout(function(){R=new ee.ImageEditor({locale:d,enableRtl:h,disabled:o.disabled,cssClass:g,height:(null!=o.height?o.height:"350px").toString(),width:(null!=o.width?o.width:"100%").toString(),editComplete:function(){return l(o.name)},fileOpened:function(){return l(o.name)}},"#"+o.name)},100),f&&f.appendChild(I),m(R),R;case"message":var F=new X.Message({locale:d,enableRtl:h,severity:o.severity||o.messageType||"info",variant:o.variant,content:o.content||"Message",showCloseIcon:o.showCloseIcon,showIcon:void 0!==o.showIcon&&o.showIcon||!1,cssClass:g});return f&&(Z(f,o.name),F.appendTo(f)),m(F),F;case"dataGrid":var k=o,b=function(e,t){if(e&&e.conditionalData&&Array.isArray(e.conditionalData))for(var n=0,a=e.conditionalData;n<a.length;n++){var i=a[n];if($.evaluateCondition(i.condition,t))return{dataSource:i.dataSource,columns:i.columns&&0<i.columns.length?i.columns:void 0}}}(k.conditions,i&&i.values||{}),N=b?b.dataSource:void 0,V=b?b.columns:void 0,O=(N||k.dataSource,[]),U=(Y.fetch(N||k.dataSource,k.id,i&&i.values,p).then(function(e){e.id===k.id&&0<e.options.length&&(e=J(N||k.dataSource,e.options,U),M.setDataSource(e))}),[]),I=J(N||k.dataSource,O,U),b=0<I.length?I:void 0!==k.dataSource&&null!==k.dataSource?k.dataSource:[],O=V&&0<V.length?V:void 0!==k.columns&&null!==k.columns?k.columns:[],I=f||_.createElement("div",{id:k.name,className:k.cssClass}),M=(f&&Z(f,o.name),new re({locale:d,name:k.name||"",columns:O,enableRtl:h,dataSource:void 0!==b&&0<b.length?b:s,height:null!=k.height?k.height:"200px",width:null!=k.width?k.width:"100%",pageSize:k.pageSize||6,allowPaging:!1!==k.allowPaging,allowFiltering:k.allowFiltering,allowAdding:!1!==k.allowAdding,allowEditing:!1!==k.allowEditing,allowDeleting:!1!==k.allowDeleting,onDataChange:function(e){return l(e)},cssClass:g,target:I,ref:m}));return M.render(I),!L.has(o.id)&&i&&Array.isArray(b)&&(i.values[o.id]=b,M.isInitialized=!0,L.add(o.id)),"function"==typeof r.ref?r.ref(M):r.ref&&(r.ref.current=M),f||I;case"richTextEditor":V={items:["Undo","Redo","|","Bold","Italic","Underline","StrikeThrough","InlineCode","|","CreateLink","Image","CreateTable","CodeBlock","HorizontalLine","Blockquote","EmojiPicker","|","LineHeight","Formats","Alignments","|","BulletFormatList","NumberFormatList","Checklist","|","Outdent","Indent","|","FontColor","BackgroundColor","FontName","FontSize","|","LowerCase","UpperCase","SuperScript","SubScript","|","SourceCode","|"]},O=(o.enableImportFromWord&&o.enableImportFromWord.enabled&&V.items.push("ImportWord"),o.enableExportToWord&&o.enableExportToWord.enabled&&V.items.push("ExportWord"),o.enableExportToPdf&&o.enableExportToPdf.enabled&&V.items.push("ExportPdf"),V.items.push("Print"),function(e){return!!e&&e.enabled&&"string"==typeof e.serviceUrl&&""!==e.serviceUrl.trim()}),b=O(o.enableImportFromWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"")?o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"").replace(/^\/+/,"")}:void 0,I=O(o.enableExportToWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToWord?o.enableExportToWord.serviceUrl:"")?o.enableExportToWord?o.enableExportToWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToWord?o.enableExportToWord.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.docx",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,O=O(o.enableExportToPdf)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"")?o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.pdf",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,V=new G.RichTextEditor({locale:d,toolbarSettings:V,enableRtl:h,value:void 0!==s?s:o.defaultValue||"",placeholder:o.placeholder||"",enabled:!o.disabled,readonly:o.readOnly||!1,maxLength:o.maxLength||void 0,cssClass:g||void 0,height:o.height||"300px",width:o.width||"100%",htmlAttributes:v,importWord:b,exportPdf:O,exportWord:I,change:function(e){return l(e.value)}});return G.RichTextEditor.Inject(G.Toolbar,G.Link,G.HtmlEditor,G.QuickToolbar,G.Image,G.Count,G.Table,G.EmojiPicker,G.PasteCleanup,G.SlashMenu,G.CodeBlock,G.ClipBoardCleanup,G.AutoFormat,G.ImportExport),V.appendTo(f),m(V),V;default:F=new X.Message({locale:d,enableRtl:h,severity:"Warning",content:j.getConstant("unsupportedComponent")+" : "+o.type,cssClass:g});return f&&(Z(f,o.name),F.appendTo(f)),m(F),F}}var K=function(){return(K=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},y=function(){return(y=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},oe={strict:!1,maxInputSize:5242880,defaultTextType:"textbox",inferTypeFromValue:!0,generateIds:!0,includeMetadata:!0,customTypeMap:{},validateUnknownFields:!1},se=(v.prototype.parse=function(e){var t=[],n=[];if("string"==typeof e){if(e.length>this.config.maxInputSize)return this.formatError(t,n,"Input exceeds maximum size of "+this.config.maxInputSize+" bytes");var a=le(e);if(!a.valid)return this.formatError(t,n,a.errors&&a.errors[0]||"Invalid JSON");try{e=JSON.parse(e)}catch(e){return this.formatError(t,n,"Failed to parse JSON: "+e.message)}}var a=this.detectFormat(e),i=(a.ambiguousFormats&&0<a.ambiguousFormats.length&&(n.push("Ambiguous format detected."),n.push("Using "+a.format+" format ("+("json-schema"===a.format?"properties priority":"pages priority")+")")),[]);switch(a.format){case"configured-schema":i=e.properties||[];break;case"json-schema":var r=this.parseJsonSchema(e),i=r.components;r.warnings&&n.push.apply(n,r.warnings);break;case"surveyjs":i=this.parseSurveyJS(e);break;case"openapi":i=this.parseOpenAPI(e);break;case"data-inference":0<(i=this.parseDataInference(e)).length&&n.push("Field types inferred from data; please verify");break;default:t.push("Could not determine input format")}0===i.length&&t.push("No form fields could be extracted from input");!i.some(function(e){return"button"===e.type&&"submit"===e.buttonType})&&0<i.length&&i.push({id:this.generateComponentId("button"),type:"button",label:"Submit",style:"primary",buttonType:"submit"});var o={version:e.version||"0.1.0",components:i},s=ce(o),s=(!s.valid&&s.errors&&t.push.apply(t,s.errors),s.warnings&&n.push.apply(n,s.warnings),this.config.strict&&0<n.length&&(t.push.apply(t,n),n.length=0),de(o));return{success:0===t.length,schema:s,errors:t,warnings:n,metadata:{detectedFormat:a.format,confidence:a.confidence,sourceHints:a.hints}}},v.prototype.formatError=function(e,t,n){return e.push(n),{success:!1,schema:null,errors:e,warnings:t,metadata:{detectedFormat:"unknown",confidence:"low",sourceHints:[]}}},v.prototype.detectFormat=function(e){var t,n,a,i=[],r=[];return e&&"object"==typeof e?e.$schema&&"string"==typeof e.$schema&&e.$schema.includes("json-schema")?(i.push("$schema property detected"),{format:"json-schema",confidence:"high",hints:i}):(t=e.properties&&"object"==typeof e.properties,n=e.pages&&Array.isArray(e.pages),a=e.elements&&Array.isArray(e.elements),t&&n?(i.push("Multiple format patterns detected"),i.push("Selected based on priority rules"),r.push("properties format","pages format"),{format:"json-schema",confidence:"medium",hints:i,ambiguousFormats:r}):n?(i.push("pages array detected"),e.pages[0]&&e.pages[0].elements&&i.push("elements structure matched"),{format:"surveyjs",confidence:"high",hints:i}):a&&!t?(i.push("elements array at root level"),{format:"surveyjs",confidence:"medium",hints:i}):t?(i.push("properties object detected"),"object"===e.type&&i.push("type: object matched"),e.required&&Array.isArray(e.required)&&i.push("required array found"),this.hasExampleFields(e.properties)?(i.push("example fields detected (API schema pattern)"),{format:"openapi",confidence:"high",hints:i}):{format:"json-schema",confidence:"high",hints:i}):this.isDataInferenceCandidate(e)?(i.push("Simple object with primitive values"),i.push("No schema indicators found"),{format:"data-inference",confidence:"medium",hints:i}):{format:"unknown",confidence:"low",hints:["Could not identify format"]}):{format:"unknown",confidence:"low",hints:["Input is not a valid object"]}},v.prototype.hasExampleFields=function(e){if(e&&"object"==typeof e)for(var t=0,n=Object.keys(e);t<n.length;t++){var a=e[n[t]];if(a&&"example"in a)return!0}return!1},v.prototype.isDataInferenceCandidate=function(t){return!(!t||"object"!=typeof t||t.$schema||t.properties||t.pages||t.elements)&&Object.keys(t).every(function(e){e=t[e];return null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||!!Array.isArray(e)&&e.every(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e})})},v.prototype.inferComponentType=function(e,t){var t=this.inferTypeFromValue(e,t);return t.type?y({},t,{confidence:"high",method:"value-type"}):(t=this.matchFieldNamePattern(e)).type?y({},t,{confidence:"high",method:"name-pattern"}):{type:this.config.defaultTextType,confidence:"low",method:"fallback"}},v.prototype.inferTypeFromValue=function(e,t){return this.config.inferTypeFromValue?null==t?this.matchFieldNamePattern(e):"string"==typeof t?t.includes("@")&&t.includes(".")?{type:"textbox",textboxType:"email"}:/^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test(t)?{type:"textbox",textboxType:"url"}:/^\d{4}-\d{2}-\d{2}/.test(t)?{type:"date"}:"textbox"!==(e=this.matchFieldNamePattern(e)).type||e.textboxType?e:{type:this.config.defaultTextType}:"number"==typeof t?{type:"number"}:"boolean"==typeof t?{type:"checkbox"}:Array.isArray(t)?{type:"multiselect"}:{type:"textbox"}:{type:"textbox"}},v.prototype.matchFieldNamePattern=function(e){if(this.config.customTypeMap){var t=this.config.customTypeMap[e.toLowerCase()];if(t)return{type:t}}t=e.toLowerCase().replace(/[_\-\s]+/g," ");return/email|mail|e-?mail/.test(t)?{type:"textbox",textboxType:"email"}:/date|birth|birthday|dob|created|updated/.test(t)?{type:"date"}:/phone|tel|mobile|cell|cellphone|msisdn/.test(t)?{type:"textbox",textboxType:"number"}:/url|link|uri|website/.test(t)?{type:"textbox",textboxType:"url"}:/password|pwd|pass|security|secret|key|token/.test(t)?{type:"textbox",textboxType:"password"}:/\b(?:age|count|qty|quantity|amount|price|cost|salary|fee|rate|number|num)\b/.test(t)?{type:"number"}:/active|enabled|visible|deleted|archived|approved|confirmed/.test(t)?{type:"checkbox"}:/select|choice|option|type|status|category|kind/.test(t)?{type:"dropdown"}:/description|comment|note|bio|biography|about|message|content|summary|details/.test(t)?{type:"textarea"}:{type:"textbox"}},v.prototype.parseJsonSchema=function(e){var t=[],n=[];if(e.properties&&"object"==typeof e.properties)for(var a=this.flattenNestedProperties(e.properties,"",n),i=0,r=Object.keys(a);i<r.length;i++){var o=r[i],s=a[o],l=this.mapJsonSchemaType(s),c=-1!==(e.required||[]).indexOf(o);t.push(this.createComponent(o,s,l,{required:c}))}return{components:t,warnings:n}},v.prototype.flattenNestedProperties=function(e,t,n){for(var a={},i=!1,r=0,o=Object.keys(e);r<o.length;r++){var s,l=o[r],c=t?t+"_"+l:l;"object"===(d=e[l]).type&&d.properties&&"object"==typeof d.properties?(i=!0,s=this.flattenNestedProperties(d.properties,c,n),Object.assign(a,s)):a[c]=d}if(i&&!t){n.push("NESTED_OBJECTS_FLATTENED: Nested objects converted to flat structure");for(var d,u=0,p=Object.keys(e);u<p.length;u++)"object"===(d=e[l=p[u]]).type&&d.properties&&this.collectFlattenedFieldNames(d.properties,l,n)}return a},v.prototype.collectFlattenedFieldNames=function(e,t,n){for(var a=0,i=Object.keys(e);a<i.length;a++){var r=i[a],o=e[r],s=t+"_"+r;n.push("Field '"+t+"."+r+"' flattened to '"+s+"'"),"object"===o.type&&o.properties&&this.collectFlattenedFieldNames(o.properties,s,n)}},v.prototype.parseSurveyJS=function(e){var t=this,n=[];return e.pages&&Array.isArray(e.pages)&&e.pages.forEach(function(e){e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))})}),!n.length&&e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))}),n},v.prototype.createComponentFromSurveyJS=function(e){var t=this.mapSurveyJSType(e.type||"text"),n={},a=(!0===e.isRequired&&(n.required=!0),e.validators&&Array.isArray(e.validators)&&e.validators.forEach(function(e){"numeric"===e.type&&(void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue)&&(n.maxValue=e.maxValue),"text"===e.type&&(void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength)&&(n.maxLength=e.maxLength)}),y({id:this.generateComponentId(t),type:t,label:e.title||e.label||this.humanizeFieldName(e.name),defaultValue:e.defaultValue,expressionValue:e.expressionValue},0<Object.keys(n).length?n:void 0));return"dropdown"!==t&&"multiselect"!==t&&"radio"!==t&&"splitButton"!==t||e.choices&&Array.isArray(e.choices)&&(a.options=e.choices),a},v.prototype.mapSurveyJSType=function(e){return{text:"textbox",email:"email",number:"number",checkbox:"checkbox",radiogroup:"radio",dropdown:"dropdown",tagbox:"multiselect",multiselect:"multiselect",rating:"number",comment:"textarea",date:"date"}[e]||"textbox"},v.prototype.parseOpenAPI=function(e){var t=[];if(e.properties&&"object"==typeof e.properties)for(var n=Object.keys(e.properties),a=e.required||[],i=0,r=n;i<r.length;i++){var o=r[i],s=e.properties[o],l=this.mapJsonSchemaType(s),c=-1!==a.indexOf(o);t.push(this.createComponent(o,s,l,{required:c}))}return t},v.prototype.parseDataInference=function(e){for(var t=[],n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=e[i],o=this.inferComponentType(i,r),i={id:this.generateComponentId(o.type),type:o.type,label:this.humanizeFieldName(i),defaultValue:r,expressionValue:void 0};o.textboxType&&(i.textboxType=o.textboxType,"email"===o.textboxType?i.regex=u.EMAIL:"url"===o.textboxType&&(i.regex=u.URL)),"date"===o.type&&null!=i.defaultValue&&(o=this.formatDateTimeValue(i.defaultValue))&&(i.defaultValue=o),Array.isArray(r)&&0<r.length&&(i.options=r),t.push(i)}return t},v.prototype.createComponent=function(e,t,n,a){var i={},a=(!0===(void 0!==t.required?t:a).required&&(i.required=!0),t.minLength&&(i.minLength=t.minLength),t.maxLength&&(i.maxLength=t.maxLength),t.minDate&&(i.minDate=t.minDate),t.maxDate&&(i.maxDate=t.maxDate),t.minTime&&(i.minTime=t.minTime),t.minValue&&(i.minValue=t.minValue),t.maxValue&&(i.maxValue=t.maxValue),t.pattern&&(i.pattern=t.pattern),t.id||this.generateComponentId(n.type)),r=(a=a,r="string"==typeof(r=this.generateComponentId(n.type))&&r?r:"field_"+Date.now()+"_"+Math.floor(1e3*Math.random()),null==a||!(a=String(a).trim())||"__proto__"===a||"prototype"===a||"constructor"===a||(a=a.replace(/[^A-Za-z0-9_-]/g,"_"),"__proto__"===(a=100<(a=/^[A-Za-z_]/.test(a)?a:"f_"+a).length?a.slice(0,100):a))||"prototype"===a||"constructor"===a?r:a),a=y({id:r,name:t.name,type:n.type,label:t.title||t.label||this.humanizeFieldName(e),defaultValue:t.default||t.defaultValue||void 0,expressionValue:t.expressionValue||void 0,content:t.content,buttonType:t.buttonType,textboxType:t.textboxType},0<Object.keys(i).length?i:void 0);return n.textboxType&&(a.textboxType=n.textboxType,"email"===n.textboxType?i.pattern||(i.regex="^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",i.validationMessage="Please enter a valid email address"):"url"!==n.textboxType||i.pattern||(i.regex="^(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",i.validationMessage="Please enter a valid URL")),"date"===n.type&&void 0!==a.defaultValue&&null!==a.defaultValue&&(r=this.formatDateTimeValue(a.defaultValue))&&(a.defaultValue=r),"splitButton"!==n.type&&"dropdown"!==n.type&&"multiselect"!==n.type&&"radio"!==n.type||!t.enum&&!t.options||(a.options=t.enum||t.options),a},v.prototype.parseDateFromValue=function(e){if(null!=e){if("number"==typeof e)return e<1e12?new Date(1e3*e):new Date(e);if("string"==typeof e){var e=e.trim(),t=new Date(e);if(!isNaN(t.getTime()))return t;t=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0));t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2})(?:[:](\d{2}))?)?/);if(t)return new Date(Number(t[3]),Number(t[1])-1,Number(t[2]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0))}}return null},v.prototype.formatDate=function(e){var t=e.getMonth()+1,n=e.getDate();return(t<10?"0"+t:String(t))+"/"+(n<10?"0"+n:String(n))+"/"+e.getFullYear()},v.prototype.formatDateTimeValue=function(e){var t,n=this.parseDateFromValue(e);if(n)return t=this.formatDate(n),0!==n.getHours()||0!==n.getMinutes()||/\dT\d{2}:\d{2}/.test(String(e))?""+t:t},v.prototype.mapJsonSchemaType=function(e){var t,n,a=e.type;return"string"===a?(t=(e.format||"").toString().toLowerCase(),n=((e.title||e.label||"")+" "+(e.description||"")).toLowerCase(),/email|mail|e-?mail/.test(t)||/email|mail|e-?mail/.test(n)?{type:"textbox",textboxType:"email"}:/uri|url|link|website/.test(t)||/uri|url|link|website/.test(n)?{type:"textbox",textboxType:"url"}:/phone|tel|mobile|cell|msisdn/.test(t)||/phone|tel|mobile|cell|msisdn/.test(n)?{type:"textbox",textboxType:"number"}:/password|pwd|pass|security|secret|key/.test(t)||/password|pwd|pass|security|secret|key/.test(n)?{type:"textbox",textboxType:"password"}:"date"===t||"date-time"===t||/date|birthday|dob/.test(n)?{type:"date"}:e.enum||e.options?{type:"dropdown"}:{type:this.config.defaultTextType}):"number"===a||"integer"===a?{type:"number"}:"boolean"===a?{type:"checkbox"}:"array"===a?{type:"multiselect"}:"message"===a?{type:"message"}:"button"===a?{type:"button"}:"signature"===a||"sign"===a?{type:"signature"}:"image"===a||"imageEditor"===a?{type:"imageEditor"}:"file"===a||"fileUpload"===a?{type:"fileUpload"}:"color"===a||"colorPicker"===a?{type:"colorPicker"}:"splitButton"===a?{type:"splitButton"}:{type:this.config.defaultTextType}},v.prototype.generateComponentId=function(e){return this.config.generateIds?e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random()):""},v.prototype.humanizeFieldName=function(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2")},v);function v(e){this.config=y({},oe,e)}var le=function(e){try{return JSON.parse(e),{valid:!0}}catch(e){return{valid:!1,errors:["Invalid JSON syntax: "+e.message]}}},ce=function(e){var t,r,n=[],a=[];return e.components?Array.isArray(e.components)||n.push('Property "components" must be an array'):n.push("Missing required property: components"),Array.isArray(e.components)&&(t=new Set,r=function(e,i){void 0===i&&(i="root"),e.id?(t.has(e.id)&&n.push("Duplicate component ID found: "+e.id),t.add(e.id)):n.push("Component at "+i+' is missing "id" property'),e.type||n.push('Component "'+(e.id||"unknown")+'" is missing "type" property'),e.children&&Array.isArray(e.children)&&e.children.forEach(function(e,t){r(e,i+".children["+t+"]")}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e,n){e.content&&Array.isArray(e.content)&&e.content.forEach(function(e,t){r(e,i+".tabItems["+n+"].content["+t+"]")})}),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e,a){Array.isArray(e)&&e.forEach(function(e,n){Array.isArray(e)&&e.forEach(function(e,t){r(e,i+".tableCells["+a+"]["+n+"]["+t+"]")})})})},e.components.forEach(function(e,t){r(e,"components["+t+"]")})),{valid:0===n.length,errors:0<n.length?n:void 0,warnings:0<a.length?a:void 0}},de=function(e){function n(e){var t=y({},e,{_configured:!0});return e.children&&Array.isArray(e.children)&&(t.children=e.children.map(n)),e.tabItems&&Array.isArray(e.tabItems)&&(t.tabItems=e.tabItems.map(function(e){return y({},e,{content:e.content?e.content.map(n):[]})})),e.tableCells&&Array.isArray(e.tableCells)&&(t.tableCells=e.tableCells.map(function(e){return e.map(function(e){return Array.isArray(e)?e.map(n):[]})})),t}e={version:e.version||"0.1.0",components:e.components||[]};return e.components=e.components.map(n),e},ue=(g.prototype.resolveHtml=function(e){try{return this.enableHtmlSanitizer?_.SanitizeHtmlHelper.sanitize(e):e}catch(e){return""}},g.prototype.render=function(){var e=document.createElement("div");return this.id&&(e.id=this.id),e.innerHTML=this.resolveHtml(this.content),this.el=e},g.prototype.update=function(e){this.content=e,this.el&&(this.el.innerHTML=this.resolveHtml(this.content))},g.prototype.getElement=function(){return this.el},g.prototype.destroy=function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,this.content="",this.enableHtmlSanitizer=!1,this.id=void 0},g);function g(e){this.content=e.content,this.id=e.id,this.enableHtmlSanitizer=!!_.isNullOrUndefined(e.enableHtmlSanitizer)||e.enableHtmlSanitizer,this.el=e.target||null}b.getConstraints=function(e,t,n){var a,i,r=this;return void 0===n&&(n="number"),e&&0!==e.length?(a=e.find(function(e){return!1===e.enabled}))?(i=this.resolveValue(a.minValue,{}),a=this.resolveValue(a.maxValue,{}),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:i,maxDate:a,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:i,maxTime:a}:{minValue:i,maxValue:a,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):0===(i=e.filter(function(e){return!0===e.enabled})).length||0===(a=i.map(function(e){return{min:r.resolveValue(e.minValue,t),max:r.resolveValue(e.maxValue,t)}}).filter(function(e){return void 0!==e.min||void 0!==e.max})).length?this.getEmptyConstraints(n):(e=this.getPermissiveMin(a,n),i=this.getPermissiveMax(a,n),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:e,maxDate:i,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:e,maxTime:i}:{minValue:e,maxValue:i,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):this.getEmptyConstraints(n)},b.resolveValue=function(e,t){return"number"==typeof e||"string"==typeof e?e:e&&"object"==typeof e&&e.field&&void 0!==(t=t[e.field])?t:void 0},b.getPermissiveMin=function(e,t){var a=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertToISO(e),a.convertToISO(t.min)<n))?t.min:e},void 0):"time"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertTimeTo24Hour(e),a.convertTimeTo24Hour(t.min)<n))?t.min:e},void 0):0<(t=e.map(function(e){return e.min}).filter(function(e){return void 0!==e})).length?Math.min.apply(Math,t):void 0},b.getPermissiveMax=function(e,t){var n=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertToISO(e)<n.convertToISO(t.max))?t.max:e},void 0):"time"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertTimeTo24Hour(e)<n.convertTimeTo24Hour(t.max))?t.max:e},void 0):0<(t=e.map(function(e){return e.max}).filter(function(e){return void 0!==e})).length?Math.max.apply(Math,t):void 0},b.convertToISO=function(e){var t,n,a;return e?(!e.includes("-")||10!==e.length)&&-1!==e.indexOf("/")&&(t=(a=e.split("/"))[0],n=a[1],a=a[2],t)&&n&&a?a+"-"+(t.length<2?"0"+t:t)+"-"+(n.length<2?"0"+n:n):e:""},b.convertTimeTo24Hour=function(e){var t,n,a,i;return e?(i=/PM/i.test(e),((t=/AM/i.test(e))||i)&&(a=(n=e.replace(/\s*(AM|PM)/i,"").trim().split(":"))[0],n=n[1],a)&&n?(a=parseInt(a,10),i&&12!==a?a+=12:t&&12===a&&(a=0),((i=String(a)).length<2?"0"+i:i)+":"+n):e):""},b.getEmptyConstraints=function(e){return{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},b.validateValue=function(e,t,n){if(null!=e&&""!==e)if("date"===n||"dateRange"===n){if(t.minDate){var a=this.convertToISO(t.minDate);if(this.convertToISO(e)<a)return{isValid:!1,error:"Date must be on or after "+t.minDate}}if(t.maxDate)if(this.convertToISO(t.maxDate)<this.convertToISO(e))return{isValid:!1,error:"Date must be on or before "+t.maxDate}}else if("time"===n){if(t.minTime&&e<t.minTime)return{isValid:!1,error:"Time must be on or after "+t.minTime};if(t.maxTime&&e>t.maxTime)return{isValid:!1,error:"Time must be on or before "+t.maxTime}}else{a=Number(e);if(void 0!==t.minValue)if(a<Number(t.minValue))return{isValid:!1,error:"Value must be at least "+t.minValue};if(void 0!==t.maxValue)if(Number(t.maxValue)<a)return{isValid:!1,error:"Value must be at most "+t.maxValue}}return{isValid:!0}};var pe=b;function b(){}he=function(e,t){return(he=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var he,x,me,fe=function(e,t){function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},k=function(){return(k=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},C=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;0<=s;s--)(i=e[s])&&(o=(r<3?i(o):3<r?i(t,n,o):i(t,n))||o);return 3<r&&o&&Object.defineProperty(t,n,o),o},ye=["textbox","number","checkbox","dropdown","multiselect","date","dateTime","time","dateRange","switch","rating","colorPicker","inputMask","fileUpload"],ve={unsupportedComponent:"Unsupported Component type"},fe=(x=_.Component,fe(w,x),(me=w).prototype.getModuleName=function(){return"form-renderer"},w.prototype.getPersistData=function(){return this.addOnPersist(["formState",JSON.stringify(this.formState)])},w.prototype.preRender=function(){_.enableRipple(!0),this.createdFired=!1,this.expressionEngine=new i},w.prototype.render=function(){var a=this;if(this.clearEngineCaches(),this.removePreviousRoot(),this.normalizeSchema(),this.element.classList.add("form-renderer-container"),this.className&&_.addClass([this.element],this.className.replace(/\s+/g," ").trim().split(" ")),this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl"),this.hasLayoutComponentsCache=this.computeHasLayoutComponents(),this.idToLabelCache=this.computeIdToLabel(),this.initialValuesCache=this.buildInitialValues(),this.buildValidationRulesAndBridge(),this.isInitialized||(this.isInitialized=!0),this.formState&&this.initialValuesCache)for(var e=0,t=Object.keys(this.initialValuesCache);e<t.length;e++){var n=t[e],i=this.initialValuesCache[n];this.formState.values[n]||(this.formState.values[n]=i)}this.currentFormValues=k({},this.formState?this.formState.values:{}),this.initExpressionEngine(),this.buildConditionalDependencyMap();var r=_.createElement("form",{className:"form-renderer "+this.layoutClass,attrs:{role:"region","aria-label":this.processedSchemaCache.settings&&this.processedSchemaCache.settings.name||"Form"}});this.element.appendChild(r),this.inputRefs={},(this.processedSchemaCache.components||[]).forEach(function(e){var t,n=a.renderComponent(e);n&&r.appendChild(n),"richTextEditor"===e.type&&(t=n.querySelector(".e-richtexteditor"),_.getComponent(t,"richtexteditor").refreshUI()),"dataGrid"===e.type&&(t=n.querySelector(".e-control.e-toolbar"),_.getComponent(t,"toolbar").refresh()),"tabs"===e.type&&(t=n.querySelector(".e-control.e-tab"),_.getComponent(t,"tab").refreshOverflow())}),this.created&&!this.createdFired&&setTimeout(function(){0<Object.keys(a.inputRefs).length&&(a.createdFired=!0,a.trigger("created",{}))},0)},w.prototype.normalizeSchema=function(){var e=this.schema;try{if(e){var t,n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){return this.failure&&this.trigger("failure",{error:e}),void(this.processedSchemaCache={version:"1.0.0",components:[]})}n&&"object"==typeof n&&n.properties&&Array.isArray(n.layout)?this.processedSchemaCache=E(n):(t=(new se).parse("string"==typeof e?e:JSON.stringify(e))).success&&t.schema?this.processedSchemaCache=t.schema:(this.failure&&this.trigger("failure",{error:t.errors}),this.processedSchemaCache={version:"1.0.0",components:[]})}else this.processedSchemaCache={version:"1.0.0",components:[]}}catch(e){this.failure&&this.trigger("failure",{error:e}),this.processedSchemaCache={version:"1.0.0",components:[]}}},w.prototype.computeHasLayoutComponents=function(){var p;return!!this.processedSchemaCache.components&&(p=function(e){for(var t=0,n=e;t<n.length;t++){var a=n[t];if(-1!==["table","tabs","panel","card"].indexOf(a.type))return!0;if(a.children&&p(a.children))return!0;if(a.tableCells)for(var i=0,r=a.tableCells;i<r.length;i++)for(var o=0,s=r[i];o<s.length;o++){var l=s[o];if(p(l))return!0}if(a.tabItems)for(var c=0,d=a.tabItems;c<d.length;c++){var u=d[c];if(u.content&&p(u.content))return!0}}return!1})(this.processedSchemaCache.components)},Object.defineProperty(w.prototype,"layoutClass",{get:function(){if(this.hasLayoutComponentsCache)return"";switch(this.layout){case"TwoColumn":return"twolayout";case"ThreeColumn":return"threelayout";case"FourColumn":return"fourlayout";default:return""}},enumerable:!0,configurable:!0}),w.prototype.collectAllComponents=function(e){function t(e){e.forEach(function(e){n.push(e),e.children&&0<e.children.length&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n=[];return t(e),n},w.prototype.computeIdToLabel=function(){function t(e){e.forEach(function(e){e.label&&-1===["panel","table","tabs","card","button","message","splitButton"].indexOf(e.type)&&(e.name?n[e.id]=e.name:e.label&&(n[e.id]=e.label)),e.children&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n={};return t(this.processedSchemaCache.components),n},w.prototype.buildValidationRulesAndBridge=function(){function s(e,o){void 0===o&&(o=!0),e.forEach(function(p){var e,t,n,h,a,i,r,m;p&&(e={},t=o&&!1!==p.visible&&$.isFieldVisible(p.conditions,d),n=o&&$.isFieldHidden(p.conditions,d),t)&&!n&&(a=$.isFieldRequired(p.conditions,d),i=$.isFieldDisabled(p.conditions,d),r=$.isFieldReadOnly(p.conditions,d),h=!!p.required||a,a=!!p.disabled||i,i=!!p.readOnly||r,p.customValidation&&Array.isArray(p.customValidation)&&0<p.customValidation.length&&!a&&!i&&(r=((r=p.customValidation&&p.customValidation[0]&&p.customValidation[0].expression)&&r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)?r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)[1]:void 0)||p.validationMessage||(p.label||p.id)+" is invalid",m=l,e.customValidation=[function(e){var t=e.value;if(!h||""!==t&&null!=t){for(var n={},a=(m.collectAllComponents(m.processedSchemaCache.components).forEach(function(e){e.name&&(n[e.id]=e.name)}),k({},m.currentFormValues||{})),i=0,r=Object.keys(k({},a));i<r.length;i++){var o=r[i],s=a[o],l=n[o];l&&(a[l]=s,delete a[o])}for(var c=0,d=p.customValidation;c<d.length;c++){var u=d[c];if(!m.customValidationEngine)return!0;if(!0!==m.customValidationEngine.validate(u.expression,t,a))return!1}}return!0},r]),!h||a||i||(e.required=[!0,p.validationMessage||p.label+" is required"]),!p.minLength||a||i||(e.minLength=[p.minLength,"Minimum "+p.minLength+" characters allowed"]),!p.maxLength||a||i||(e.maxLength=[p.maxLength,"Maximum "+p.maxLength+" characters allowed"]),"textbox"!==p.type||!p.textboxType||p.regex||e.regex||a||i||("email"===p.textboxType?e.regex=[u.EMAIL,p.validationMessage||"Invalid format"]:"url"===p.textboxType&&(e.regex=[u.URL,p.validationMessage||"Invalid format"])),!p.regex||a||i||(e.regex=[p.regex,p.validationMessage||"Invalid format"]),0<Object.keys(e).length&&(c[p.id]=e),p.children&&s(p.children,t&&!n),p.tableCells&&p.tableCells.forEach(function(e){return e.forEach(function(e){return s(e,t&&!n)})}),p.tabItems)&&p.tabItems.forEach(function(e){e.content&&s(e.content,t&&!n)})})}var l=this,c={},d=this.formState&&this.formState.values||{},n=(s(this.processedSchemaCache.components),this.formState?k({},this.formState.values):k({},this.initialValuesCache));if(this.formState={values:Object.assign(Object.create(null),this.initialValuesCache,n),errors:this.enablePersistence?this.formState.errors:Object.create(null)},n&&Object.keys(n).forEach(function(e){e in l.formState.values||(l.formState.values[e]=n[e])}),this.validator){try{this.validator.refresh(),this.validator.destroy()}catch(e){}this.validator=null}var a=this;this.validator=new q.FormValidator(this.element,{rules:c,locale:this.locale,ignore:"e-hidden",errorClass:"e-error",validClass:"e-valid",errorElement:"div",errorContainer:"div",customPlacement:function(e,t){var n=e.getAttribute("name");if(n){var a=document.getElementById("error-"+n);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(t),a.style.display="block"}else e.parentElement&&e.parentElement.appendChild(t)}else e.parentElement&&e.parentElement.appendChild(t)},validationComplete:function(e){if(a.syncFormStateErrors(),e&&e.inputName){var t=document.getElementById("error-"+e.inputName);if(t)if("success"===e.status){for(;t.firstChild;)t.removeChild(t.firstChild);t.style.display="none"}else"failure"===e.status&&(t.style.display="block")}},submit:function(e){a.validator&&(a.validator.validate()&&a.handleSubmitData(k({},a.formState.values)),e)&&"function"==typeof e.preventDefault&&e.preventDefault()},reset:function(){}}),n&&Object.keys(n).forEach(function(e){var t=l.validator.getInputElement(e);if(t&&void 0!==n[e]&&null!==n[e])try{t.value=String(n[e])}catch(e){}})},w.prototype.syncFormStateErrors=function(){var e={};if(this.validator)for(var t=0,n=this.validator.errorRules||[];t<n.length;t++){var a=n[t];a&&a.name&&(e[a.name]=a.message)}this.formState.errors=e},w.prototype.buildInitialValues=function(){var t=this,n={},e=this.collectAllComponents(this.processedSchemaCache.components),a=new Set;return e.forEach(function(e){if("staticHtml"!==e.type)if("dataGrid"===e.type&&(n[e.id]=Array.isArray(e.dataSource)?e.dataSource:[]),void 0!==e.defaultValue)n[e.id]=e.defaultValue;else switch(e.type){case"checkbox":case"switch":n[e.id]=!1}a.add(e.id)}),this.formState&&Object.keys(this.formState.values).filter(function(e){return!a.has(e)}).forEach(function(e){delete t.formState.values[e]}),n},w.prototype.initExpressionEngine=function(){if(this.processedSchemaCache.components&&0!==this.processedSchemaCache.components.length)try{var e=this.expressionEngine,t=this.collectAllComponents(this.processedSchemaCache.components),n=e.buildDependencyGraph(t),a=(e.detectCircularDependencies(n).length,this.expressionDependencyGraph=n,new Set);t.forEach(function(e){e.expressionValue&&a.add(e.id)}),this.computedFieldNames=a}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.disposeTooltipInstance=function(e){var t=this.tooltipRefs[e]||null;if(t){try{t.destroy()}catch(e){this.trigger("failure",{error:e})}this.renderedInstances=this.renderedInstances.filter(function(e){return e!==t}),this.tooltipRefs[e]=null}},w.prototype.renderField=function(r){var o=this,s=this.formState,e=s?s.values:{};if(-1!==["panel","table","tabs","card","message","button","splitButton","staticHtml"].indexOf(r.type))return null;var t=$.isFieldReadOnly(r.conditions,e),n=$.isFieldDisabled(r.conditions,e),a=$.isFieldRequired(r.conditions,e),i=$.getConditionalValue(r.conditions,e),t=!!r.readOnly||t,n=!!r.disabled||n,a=!!r.required||a,l=pe.getConstraints(r.minMaxRange,e,r.type),c=("dateTime"===r.type&&(c=pe.getConstraints(r.minMaxRange,e,"date"),e=pe.getConstraints(r.minMaxTimeRange,e,"time"),l={minValue:void 0,maxValue:void 0,minDate:c.minDate,maxDate:c.maxDate,minTime:e.minTime,maxTime:e.maxTime}),r.labelPosition||"top"),e=r.labelWidth||"auto",d=!r.hideLabel&&!!r.label&&-1===["checkbox","button","staticHtml"].indexOf(r.type),u=!(!s||!s.errors[r.id]),p=u&&!(!s||-1===s.errors[r.id].indexOf("required")),u=u&&!(p&&!a),p=void 0!==i,h=this.conditionalValueApplied[r.id]||!1,i=(s&&(p&&!h?(s.values[r.id]=i,this.conditionalValueApplied[r.id]=!0):!p&&h&&(this.conditionalValueApplied[r.id]=!1)),_.createElement("div",{className:"form-group",attrs:{"data-field-id":r.id,"data-fr-field":r.id}})),p=_.createElement("div",{className:"field-wrapper label-"+c.toLowerCase()}),c=(d&&(h=_.createElement("label",{className:"field-label"}),-1===ye.indexOf(r.type)&&"textarea"!==r.type||h.setAttribute("for",_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name),h.style.width="left"===c.toLowerCase()?e+"%":"auto",(d=_.createElement("span")).textContent=r.label,h.appendChild(d),a&&((c=_.createElement("span",{className:"required-asterisk"})).textContent="*",h.appendChild(c)),this.disposeTooltipInstance(r.id),r.tooltip&&((e=_.createElement("span",{className:"e-msg-icon e-icons e-circle-info tooltip-icon",attrs:{"aria-label":r.tooltip,title:r.tooltip,tabindex:"0",role:"button","aria-haspopup":"true"}})).style.cursor="pointer",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.flexShrink="0",h.appendChild(e),(d=new S.Tooltip({content:r.tooltip,enableRtl:this.enableRtl})).appendTo(e),this.tooltipRefs[r.id]=d,this.renderedInstances.push(d)),p.appendChild(h)),_.createElement("div",{className:"field-input"})),e=("radio"===r.type||"checkboxGroup"===r.type)&&Array.isArray(r.options)?function(e,t){e&&"number"==typeof t&&(o.inputRefs[r.name+"_"+t]=e)}:function(e){e&&(o.inputRefs[r.name]=e)},d=k({},r,{readOnly:t,disabled:n,required:a},void 0!==l.minValue&&{minValue:l.minValue},void 0!==l.maxValue&&{maxValue:l.maxValue},void 0!==l.minDate&&{minDate:l.minDate},void 0!==l.maxDate&&{maxDate:l.maxDate},void 0!==l.minTime&&{minTime:l.minTime},void 0!==l.maxTime&&{maxTime:l.maxTime}),h=-1!==ye.indexOf(r.type)?"input":"textarea"===r.type?"textarea":"div",t=_.createElement(h,{attrs:{"aria-label":r.label+" "+r.type}}),m=("radio"===r.type||"checkboxGroup"===r.type?((n=_.createElement("input")).id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,n.setAttribute("name",r.id),n.style.display="none",n.setAttribute("aria-hidden","true"),t.appendChild(n)):(t.id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,t.setAttribute("name",r.id)),c.appendChild(t),F({component:d,value:s?s.values[r.id]:void 0,onChange:function(e){var t,n,a,i;"staticHtml"!==r.type&&("signature"===r.type&&(e=o.inputRefs[e].getSignature()),"imageEditor"===r.type&&(n=o.inputRefs[e].getImageData(),(a=document.createElement("canvas")).width=n.width,a.height=n.height,(t=a.getContext("2d"))&&t.putImageData(n,0,0),e=a.toDataURL()),"radio"!==r.type&&"checkboxGroup"!==r.type||(o.validator.getInputElement(r.id).value=e),t=r,n=e,a=new _.Internationalization,i=a.getDateFormat({format:"MM/dd/yyyy",type:"date"}),"date"===t.type&&(n=i(new Date(n))),"time"===t.type&&(n=(i=a.getDateFormat({format:"hh:mm a",type:"time"}))(new Date(n))),"dateTime"===t.type&&(n=(i=a.getDateFormat({format:"MM/dd/yyyy hh:mm a",type:"dateTime"}))(new Date(n))),e=n="dateRange"===t.type&&Array.isArray(n)?n.map(function(e){return e?i(new Date(e)):null}):n,o.formState&&s&&(o.formState.values[r.id]=e,s.values[r.id]=e),o.trigger("change",{fieldName:r.name,label:r.label||r.id,value:e}),o.afterValueChange(r.id))},formState:s,settings:this.processedSchemaCache.settings,onBlur:function(){if(s&&"staticHtml"!==r.type&&o.validator){try{o.beforeValidate(r.id),o.validator.validate(r.id)}catch(e){}o.syncFormStateErrors()}},ref:e,hasError:u,locale:this.locale,components:this.collectAllComponents(this.processedSchemaCache.components),enableRtl:this.enableRtl,target:t,l10n:this.l10n}));if(Array.isArray(m))m.forEach(function(e){if(e&&"function"==typeof e.destroy)o.renderedInstances.push(e);else if(e instanceof HTMLElement)for(var t=0,n=Object.keys(o.inputRefs);t<n.length;t++){var a=n[t],a=o.inputRefs[a],i=a&&(a.element||a.target||a.hostElement&&a.hostElement());i&&(i===e||e.contains(i))&&o.renderedInstances.push(a)}});else if(m)if("function"==typeof m.destroy)this.renderedInstances.push(m);else if(m instanceof HTMLElement)for(var f=0,y=Object.keys(this.inputRefs);f<y.length;f++){var v=y[f],v=this.inputRefs[v],g=v&&(v.element||v.target||v.hostElement&&v.hostElement());g&&(g===m||m.contains(g))&&this.renderedInstances.push(v)}a=_.createElement("div",{id:"error-"+(r.id||r.name||r.label),className:"e-error-message",attrs:{role:"alert","aria-live":"assertive"}});return a.style.display="none",u&&s&&s.errors[r.id]&&(a.textContent=s.errors[r.id],a.classList.add("e-error"),a.style.display="block"),c.appendChild(a),p.appendChild(c),i.appendChild(p),r.description&&((l=_.createElement("div",{className:"field-description",attrs:{"aria-describedby":"description-"+r.label}})).textContent=r.description,i.appendChild(l)),i},w.prototype.renderComponent=function(s){var n,a,i,l=this,e=this.formState,t=e?e.values:{},r=!1!==s.visible&&$.isFieldVisible(s.conditions,t),o=$.isFieldHidden(s.conditions,t);if(!r||o)return e&&void 0!==e.values[s.id]&&null!==e.values[s.id]&&(e.values[s.id]=null),null;if(me.PRESERVABLE_TYPES.has(s.type)&&this.preservedFields.has(s.id)){r=this.preservedFields.get(s.id);if(r)return this.preservedFields.delete(s.id),r}switch(s.type){case"panel":(I=_.createElement("fieldset",{className:"form-panel-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",s.label&&!s.hideLabel&&((c=_.createElement("legend",{className:s.hideBorders?"":"panel-legend"})).textContent=s.label,I.appendChild(c));var c,d=_.createElement("div",{className:"panel-content"});return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&d.appendChild(e)}),I.appendChild(d),I;case"table":for(var u=s.rows||(s.tableCells?s.tableCells.length:2),p=s.columns||(s.tableCells&&s.tableCells[0]?s.tableCells[0].length:2),h=Math.floor(12/p),m=s.columnWidths,f=m?(c=m.widths,c=(i=c.map(function(e){return null===e?NaN:Number(e)})).reduce(function(e,t){return e+(isNaN(t)?0:t)},0),c=Math.max(0,Math.round(100-c)),C=i.map(function(e,t){return isNaN(e)?t:-1}).filter(function(e){return 0<=e}),0===(x=C.length)?i.map(function(e){return Math.round(e)}):(n=Math.floor(c/x),a=c-n*x,C.forEach(function(e){var t=0<a?n+1:n;i[e]=t,a=Math.max(0,a-1)}),i.map(function(e){return isNaN(e)?0:Math.round(e)}))):[],y=_.createElement("div",{className:"form-table-renderer "+(s.hideBorders?"":"table-border")+" "+(s.cssClass||""),attrs:{role:"group","aria-label":s.label||"Table Layout"}}),v=0;v<u;v++){for(var g=_.createElement("div",{className:"e-form-table-row"}),b=(s.hideBorders&&(g.style.display="flex",g.style.gap="1.5rem"),0);b<p;b++)!function(e){var t=s.tableCells&&s.tableCells[v]&&s.tableCells[v][e]||[],n=h,e=f[e],a=1===p?{width:"100%"}:e?{width:e+"%"}:{},i=!m||Array.isArray(m.widths)&&m.widths.every(function(e){return null===e}),r=0===v,o=_.createElement("div",{className:"e-form-table-cell "+(!e&&i?"col-"+n:"")});s.hideBorders?Object.assign(o.style,a,{padding:r?"0":"12px 0 0 0"}):Object.assign(o.style,a),t.forEach(function(e){e=l.renderComponent(e);e&&o.appendChild(e)}),g.appendChild(o)}(b);y.appendChild(g)}return y;case"tabs":var x=_.createElement("div",{className:"form-tabs-renderer "+(s.cssClass||"")}),C=_.createElement("div",{className:"e-tab"}),w=(C.id=s.id,_.createElement("div",{className:"e-tab-header"})),S=_.createElement("div",{className:"e-content"}),E=(C.appendChild(w),C.appendChild(S),x.appendChild(C),(s.tabItems||[]).forEach(function(e){var t=_.createElement("div"),t=(t.textContent=e.header,w.appendChild(t),_.createElement("div")),n=_.createElement("div",{className:"tab-content-renderer"});(e.content||[]).forEach(function(e){e=l.renderComponent(e);e&&n.appendChild(e)}),t.appendChild(n),S.appendChild(t)}),new N.Tab({enableRtl:this.enableRtl,cssClass:s.cssClass,enablePersistence:!0,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:function(e){if("undefined"==typeof window)return null;try{window.localStorage.setItem("tab"+s.id,JSON.stringify({selectedItem:e.selectedIndex}))}catch(e){}}}));return E.appendTo(C),this.renderedInstances.push(E),x;case"card":(I=_.createElement("fieldset",{className:"e-card form-card-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",I.style.padding="0";var E=_.createElement("div",{className:"e-card-header"}),T=_.createElement("div",{className:"e-card-header-caption"}),A=_.createElement("div",{className:"e-card-title"}),D=(A.textContent=s.cardTitle||s.label||"Card Title",T.appendChild(A),s.cardSubtitle&&((A=_.createElement("div",{className:"e-card-sub-title"})).textContent=s.cardSubtitle,T.appendChild(A)),E.appendChild(T),I.appendChild(E),_.createElement("div",{className:"e-card-content card-content"}));return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&D.appendChild(e)}),I.appendChild(D),I;case"staticHtml":A=new ue({content:s.defaultValue||"<p>HTML content</p>",id:s.id,enableHtmlSanitizer:s.enableHtmlSanitizer}),T=A.render();return this.renderedInstances.push(A),T;case"message":var V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:s,locale:this.locale,value:void 0,onChange:function(){},enableRtl:this.enableRtl,target:R,ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e}}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"button":var E=$.isFieldDisabled(s.conditions,t),I=!!s.disabled||E,V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:k({},s,{disabled:I}),value:void 0,onChange:function(){},locale:this.locale,onClick:function(e){l.buttonClick&&(t=s.buttonsGroups?e.target&&e.target.ej2_instances?e.target.ej2_instances[0].content:"":s.label||"",l.trigger("buttonClick",{fieldName:s.name,label:t,event:e}));var t=e.target;t.type&&"reset"===t.type&&((e=t.closest("form"))&&(e.querySelectorAll('input[type="checkbox"]').forEach(function(e){e.ej2_instances[0].checked=!1}),e.querySelectorAll(".e-control.e-multiselect.e-lib").forEach(function(e){e.ej2_instances[0].value=[]})),l.formState.values={},e.reset(),l.rerenderForm(),l.validator.destroy())},ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e},enableRtl:this.enableRtl,target:R}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"splitButton":var R,A=$.isFieldDisabled(s.conditions,t),T=!!s.disabled||A,V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:k({},s,{disabled:T}),value:void 0,locale:this.locale,onChange:function(){},onClick:function(e){l.buttonClick&&l.trigger("buttonClick",{fieldName:s.name,label:s.label||"",event:e})},ref:function(e){e&&(l.inputRefs[s.name]=e)},enableRtl:this.enableRtl,target:R}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;default:return this.renderField(s)}},w.prototype.afterValueChange=function(e){this.formState&&(this.currentFormValues=k({},this.formState.values),this.evaluateExpressions(),this.retriggerCustomValidation(),this.beforeValidate(e),this.validator.validate(e),this.syncFormStateErrors(),e)&&this.isConditionalTrigger(e)&&this.scheduleRerender(e)},w.prototype.beforeValidate=function(e){var t=this.element.querySelector("#"+e+"-info"),t=(t&&t.classList.contains("e-error")&&t.classList.remove("e-error"),this.getInputElementByName(e)),e=t.parentElement,n=e.parentElement;(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||t.classList.contains("e-input")&&e.classList.contains("e-input-group")?e:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:t).classList.remove("e-error"),this.validator&&(this.validator.errorRules=[])},w.prototype.scheduleRerender=function(e){var t=this;e&&this.pendingChangedFieldIds.add(e),this.rerenderScheduled||(this.rerenderScheduled=!0,Promise.resolve().then(function(){t.rerenderScheduled=!1;var e=new Set(t.pendingChangedFieldIds);t.pendingChangedFieldIds.clear(),t.rerenderForm(e)}))},w.prototype.collectConditionFieldIds=function(e,t){if(e)if("string"==typeof e.field)t.add(e.field);else if(Array.isArray(e.rules))for(var n=0,a=e.rules;n<a.length;n++){var i=a[n];this.collectConditionFieldIds(i,t)}},w.prototype.collectDataSourceReferenceIds=function(e,n,a){if("string"==typeof e){e=e.match(/\{([^}]+)\}/g);if(e)for(var t=0,i=e;t<i.length;t++)!function(e){var t=e.slice(1,-1),e=n.find(function(e){return e.name===t});e&&e.id&&a.add(e.id)}(i[t])}},w.prototype.buildConditionalDependencyMap=function(){for(var C=new Set,w=new Map,S=this.collectAllComponents(this.processedSchemaCache.components),e=function(e){var n=new Set,t=(w.set(e.id,n),e.conditions);if(t){for(var a=0,i=["visibleWhen","hideWhen","disabledWhen","requiredWhen","readOnlyWhen","choiceBasedField","conditionalData"];a<i.length;a++){var r=i[a];t[r]&&(E.collectConditionFieldIds(t[r],C),E.collectConditionFieldIds(t[r],n))}if(Array.isArray(t.conditionalData))for(var o=0,s=t.conditionalData;o<s.length;o++){var l=s[o];if(l&&l.condition&&(E.collectConditionFieldIds(l.condition,C),E.collectConditionFieldIds(l.condition,n)),l&&Array.isArray(l.conditions))for(var c=0,d=l.conditions;c<d.length;c++){var u=d[c];E.collectConditionFieldIds(u,C),E.collectConditionFieldIds(u,n)}}t.setValueWhen&&t.setValueWhen.condition&&(E.collectConditionFieldIds(t.setValueWhen.condition,C),E.collectConditionFieldIds(t.setValueWhen.condition,n)),t.choiceBasedField&&"string"==typeof t.choiceBasedField.primaryFieldId&&(C.add(t.choiceBasedField.primaryFieldId),n.add(t.choiceBasedField.primaryFieldId))}function p(e){var t;e&&!0===e.enabled&&((t=function(e){e&&"object"==typeof e&&"string"==typeof e.field&&(C.add(e.field),n.add(e.field))})(e.minValue),t(e.maxValue))}var h=e.minMaxRange;if(Array.isArray(h))for(var m=0,f=h;m<f.length;m++)p(f[m]);h=e.minMaxTimeRange;if(Array.isArray(h))for(var y=0,v=h;y<v.length;y++)p(v[y]);h=e.dataSource;if("dataGrid"===e.type&&h&&"url"===h.type&&(h.search&&"string"==typeof h.search.key&&(E.collectDataSourceReferenceIds(h.search.key,S,C),E.collectDataSourceReferenceIds(h.search.key,S,n)),Array.isArray(h.filters)))for(var g=0,b=h.filters;g<b.length;g++){var x=b[g];"string"==typeof x.value&&(E.collectDataSourceReferenceIds(x.value,S,C),E.collectDataSourceReferenceIds(x.value,S,n))}},E=this,t=0,n=S;t<n.length;t++)e(n[t]);this.conditionalTriggerFieldIds=C,this.consumerDependencyMap=w},w.prototype.isConditionalTrigger=function(e){return this.conditionalTriggerFieldIds.has(e)},w.prototype.rerenderForm=function(e){var n=this,i=e||new Set,e=document.activeElement,t=e&&e.getAttribute?e.getAttribute("name"):null,a=null,r=null;if(t&&e&&void 0!==e.selectionStart)try{a=e.selectionStart,r=e.selectionEnd}catch(e){}for(var o,e=this.element.scrollTop,s=this.element.scrollLeft,l=window.scrollX,c=window.scrollY,d=(this.preservedFields.clear(),this.collectAllComponents(this.processedSchemaCache.components)),u=this,p=0,h=d;p<h.length;p++)!function(e){var t,n,a;!me.PRESERVABLE_TYPES.has(e.type)||(t=u.consumerDependencyMap.get(e.id),n=!1,t&&i.forEach(function(e){t.has(e)&&(n=!0)}),n)||(a=u.element.querySelector('[data-field-id="'+e.id+'"]'))&&a.parentElement&&(a.parentElement.removeChild(a),u.preservedFields.set(e.id,a))}(h[p]);this.refreshing=!0,this.destroyRenderedExcludingPreserved(),this.removePreviousRoot(),this.validator&&this.validator.destroy(),this.render(),this.refreshing=!1;try{this.element.scrollTop=e,this.element.scrollLeft=s,window.scrollTo(l,c)}catch(e){}if(t){d=this.getInputElementByName(t);if(d&&"function"==typeof d.focus)try{if(d.focus(),null!==a&&null!==r&&"function"==typeof d.setSelectionRange)try{d.setSelectionRange(a,r)}catch(e){}}catch(e){}}0<this.preservedFields.size&&(o=[],this.preservedFields.forEach(function(e,t){if(n.element.contains(e)||document.body.contains(e))o.push(t);else{n.destroyPreservedSubtree(e);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}n.preservedFields.delete(t)}}),o.forEach(function(e){return n.preservedFields.delete(e)}))},w.prototype.removePreviousRoot=function(){if(this.element)for(;0<this.element.childNodes.length;)this.element.removeChild(this.element.firstChild)},w.prototype.destroyRenderedInstance=function(e){if(e&&"function"==typeof e.destroy){var t=e;if(!(t.isDestroyed||t.destroyed||t.disposed)){var n=e.element||e.target||(e.hostElement&&"function"==typeof e.hostElement?e.hostElement():void 0);try{t.isDestroyed=!0,t.destroyed=!0,t.disposed=!0,e.destroy()}catch(e){console.warn("FormRenderer: failed to destroy child instance.",e)}finally{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}}}}},w.prototype.destroyRenderedExcludingPreserved=function(){for(var n=[],a=Array.from(this.preservedFields.values()),i=this,e=0,t=this.renderedInstances;e<t.length;e++)!function(e){var t=e&&(e.element||e.target||e.hostElement&&e.hostElement());!!t&&a.some(function(e){return e===t||e.contains(t)})?n.push(e):i.destroyRenderedInstance(e)}(t[e]);this.renderedInstances=n;for(var r=Object.keys(this.inputRefs),o=this,s=0,l=r;s<l.length;s++)!function(e){var t=o.inputRefs[e],n=t&&(t.element||t.target||t.hostElement&&t.hostElement());!!n&&a.some(function(e){return e===n||e.contains(n)})||delete o.inputRefs[e]}(l[s]);this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set},w.prototype.destroyPreservedSubtree=function(e){for(var t=[],n=0,a=this.renderedInstances;n<a.length;n++){var i=a[n],r=i&&(i.element||i.target||i.hostElement&&i.hostElement());r&&(r===e||e.contains(r))?this.destroyRenderedInstance(i):t.push(i)}this.renderedInstances=t},w.prototype.getInputElementByName=function(e){e=this.element.querySelector('[name="'+e+'"]');if(!e)return null;if(!e.classList.contains("e-control")){var t=e.parentElement?e.parentElement.querySelector(".e-control"):null;if(t)return t}return e},w.prototype.evaluateExpressions=function(){if(this.formState&&this.expressionEngine&&!this.expressionEvaluationInProgress)try{this.expressionEvaluationInProgress=!0;for(var p=this.expressionEngine,e=this.expressionDependencyGraph,h=this.formState.values||{},m=this.collectAllComponents(this.processedSchemaCache.components),t=this.previousFormValues,f=this.computedFieldNames,y={},n=(m.forEach(function(e){e.name&&(y[e.id]=e.name)}),{}),a=Object.keys(h),i=0,r=a;i<r.length;i++){var o=r[i],s=h[o];(g=y[o])&&(n[g]=s)}for(var l=k({},t),c=(Object.assign(t,n),new Set),d=Object.keys(n),u=0,v=d;u<v.length;u++)!function(t){var e=Object.keys(y).find(function(e){return y[e]===t});e&&n[t]!==l[t]&&!f.has(e)&&c.add(t)}(g=v[u]);if(0!==c.size){for(var g,b=p.getTopologicalOrder(e),x=this,C=0,w=b;C<w.length;C++)!function(t){var e=m.find(function(e){return e.name===t});if(e&&e.expressionValue){f.add(e.id);try{if(!1!==e.visible&&$.isFieldVisible(e.conditions,h)){for(var n={},a=Object.keys(h),i=0,r=a;i<r.length;i++){var o=r[i],s=h[o],l=y[o];l&&(n[l]=s)}if(null!=(d="string"==typeof(d=p.evaluate(e.expressionValue,n))&&-1!==d.indexOf("undefined")?d.replace(/undefined/g,""):d)&&""!==d)switch(e.type){case"number":var c=Number(d),d=isNaN(c)?0:c;break;case"checkbox":case"switch":d=Boolean(d);break;case"textbox":case"textarea":d=String(d);break;case"dateRange":case"checkboxGroup":case"multiselect":break;default:d=String(d)}if(null!=d&&d!==h[e.id]&&x.formState&&(x.formState.values[e.id]=d,x.validator)){var u=x.getInputElementByName(e.id);if(u)try{u.ej2_instances[0]?u.ej2_instances[0].value=d:u.value=String(d)}catch(e){}}}}catch(e){x.failure&&x.trigger("failure",{error:e})}}}(g=w[C]);Object.assign(t,n)}}finally{this.expressionEvaluationInProgress=!1}},w.prototype.retriggerCustomValidation=function(){var t=this;if(this.formState&&this.customValidationEngine)try{var a,i=this.collectAllComponents(this.processedSchemaCache.components),n=this.formState.values||{},r=this.previousFormValues,o=new Set;Object.keys(n).forEach(function(e){n[e]!==r[e]&&o.add(e)}),0!==o.size&&(a=new Set,o.forEach(function(t){var e=i.find(function(e){return e.id===t});e&&e.customValidation&&Array.isArray(e.customValidation)&&a.add(t)}),i.forEach(function(n){n.customValidation&&Array.isArray(n.customValidation)&&n.customValidation.forEach(function(e){t.customValidationEngine.extractDependencies(e.expression).forEach(function(t){var e=i.find(function(e){return e.id===t||e.name===t});e&&o.has(e.id)&&a.add(n.id)})})}),this.previousFormValues=k({},n))}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.handleSubmitData=function(e){for(var t=this.formState,n=!(!t||!t.errors)&&0===Object.keys(t.errors).length,a={},i=t?t.values:{},r=new Set(["button","message","panel","table","tabs"]),t=this.collectAllComponents(this.processedSchemaCache.components||[]),o=new Set(t.filter(function(e){return r.has(e.type)}).map(function(e){return e.id})),s=new Set(t.filter(function(e){return!1===e.visible||!(!e.conditions||!e.conditions.visibleWhen||$.isFieldVisible(e.conditions,i))||!!(e.conditions&&e.conditions.hideWhen&&$.isFieldHidden(e.conditions,i))}).map(function(e){return e.id})),l=new Set(t.filter(function(e){return!!e.disabled||!(!e.conditions||!e.conditions.disabledWhen)&&$.isFieldDisabled(e.conditions,i)}).map(function(e){return e.id})),c=0,d=Object.keys(e);c<d.length;c++){var u=d[c],p=e[u];if(o.has(u)||s.has(u)||l.has(u))return;a[this.idToLabelCache[u]||u]=p}this.submit&&this.trigger("submit",{data:a,isValid:n})},w.prototype.getComponent=function(e){return this.inputRefs[e]||null},w.prototype.onPropertyChanged=function(e,t){var n=!1;e.schema!==t.schema&&(n=!0),e.locale!==t.locale&&(n=!0),e.enableRtl!==t.enableRtl&&(n=!0),e.layout!==t.layout&&(n=!0),(n=e.locale!==t.locale?!0:n)&&(this.refreshing=!0,this.destroyRendered(),this.removePreviousRoot(),this.isInitialized=!1,this.render(),this.refreshing=!1)},w.prototype.destroyRendered=function(){var t=this;if(this.validator){try{this.validator.destroy()}catch(e){this.trigger("failure",{error:e})}this.validator=null}this.renderedInstances.forEach(function(e){t.destroyRenderedInstance(e)}),this.renderedInstances=[],this.removePreviousRoot(),this.inputRefs={},this.tooltipRefs={},this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set,this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.pendingChangedFieldIds=new Set},w.prototype.clearPersistedTabSelections=function(){if("undefined"==typeof window)return null;try{var e=this.processedSchemaCache&&this.processedSchemaCache.components?this.processedSchemaCache.components:[];this.collectAllComponents(e).forEach(function(e){"tabs"===e.type&&e.id&&window.localStorage.removeItem("tab"+e.id)})}catch(e){}},w.prototype.destroy=function(){this.destroyRendered(),this.formState={values:{},errors:{}},this.expressionEngine=null,this.customValidationEngine=null,this.clearEngineCaches(),this.clearPersistedTabSelections(),this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.conditionalTriggerFieldIds=new Set,x.prototype.destroy.call(this)},w.prototype.clearEngineCaches=function(){if(this.expressionEngine)try{this.expressionEngine.clearCache()}catch(e){}if(this.customValidationEngine){var e=this.customValidationEngine.expressionEngine;if(e&&"function"==typeof e.clearCache)try{e.clearCache()}catch(e){}}},w.PRESERVABLE_TYPES=new Set(["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"]),C([_.Property(null)],w.prototype,"schema",void 0),C([_.Property("SingleColumn")],w.prototype,"layout",void 0),C([_.Property("")],w.prototype,"className",void 0),C([_.Event()],w.prototype,"submit",void 0),C([_.Event()],w.prototype,"change",void 0),C([_.Event()],w.prototype,"buttonClick",void 0),C([_.Event()],w.prototype,"failure",void 0),C([_.Event()],w.prototype,"created",void 0),me=C([_.NotifyPropertyChanges],w));function w(e,t){e=x.call(this,e,t)||this;return e.processedSchemaCache={version:"1.0.0",components:[]},e.l10n=new _.L10n("form-renderer",ve,e.locale),e.formState={values:Object.create(null),errors:Object.create(null)},e.validator=null,e.inputRefs={},e.conditionalValueApplied={},e.expressionEngine=null,e.expressionDependencyGraph={},e.expressionEvaluationInProgress=!1,e.previousFormValues={},e.computedFieldNames=new Set,e.customValidationEngine=new U,e.currentFormValues={},e.isInitialized=!1,e.hasLayoutComponentsCache=!1,e.idToLabelCache={},e.initialValuesCache={},e.renderedInstances=[],e.tooltipRefs={},e.createdFired=!1,e.rerenderScheduled=!1,e.conditionalTriggerFieldIds=new Set,e.preservedFields=new Map,e.consumerDependencyMap=new Map,e.pendingChangedFieldIds=new Set,e}(C=e.FormLayout||(e.FormLayout={})).SingleColumn="SingleColumn",C.TwoColumn="TwoColumn",C.ThreeColumn="ThreeColumn",C.FourColumn="FourColumn";e.FORM_COMPONENT_TYPES=["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"],e.FormRenderer=fe,e.defaultLocale=ve,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-image-editor"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-notifications","@syncfusion/ej2-image-editor","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-data","@syncfusion/ej2-grids"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Splitbuttons,e.ej2Dropdowns,e.ej2Calendars,e.ej2Notifications,e.ej2ImageEditor,e.ej2Richtexteditor,e.ej2Data,e.ej2Grids)}(this,function(e,_,I,F,z,q,X,H,G,ee,te,$,h,r){"use strict";t.evaluateCondition=function(e,t){try{return"field"in e&&"operator"in e&&"value"in e?this.evaluateSimpleRule(e,t):"condition"in e&&"rules"in e&&this.evaluateCompositeRule(e,t)}catch(e){return!1}},t.evaluateSimpleRule=function(e,t){try{var n=t[e.field],a=e.operator.toLowerCase();if(void 0===n)if(-1===["equal","equals","notequal","notequals","isempty","isnotempty"].indexOf(a))return!1;var i=Array.isArray(n),r=new _.Internationalization;switch(a){case"equal":case"equals":return n===e.value;case"notequal":case"notequals":return n!==e.value;case"startswith":return n.startsWith(e.value);case"doesnotstartswith":return!n.startsWith(e.value);case"greaterthan":case"lessthan":case"greaterthanorequal":case"lessthanorequal":var o=Number(n),s=Number(e.value);return Number.isNaN(o)||Number.isNaN(s)?!1:"greaterthan"===a?s<o:"lessthan"===a?o<s:"greaterthanorequal"===a?s<=o:o<=s;case"dategreaterthan":case"datelessthan":var l=r.parseDate(n,{format:"MM/dd/yyyy"}),d=r.parseDate(e.value,{format:"MM/dd/yyyy"});return null!==l&&null!==d?"dategreaterthan"===a?d<l:"datelessthan"===a?l<d:l<=d:!1;case"timegreaterthan":case"timelessthan":var c=r.parseDate(n,{format:"hh:mm a",type:"time"}),u=r.parseDate(e.value,{format:"hh:mm a",type:"time"});if(null!==c&&null!==u){if("timegreaterthan"===a)return u<c;if("timelessthan"===a)return c<u}return!1;case"datetimegreaterthan":case"datetimelessthan":var p=r.parseDate(n,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"}),h=r.parseDate(e.value,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"});if(null!==p&&null!==h){if("datetimegreaterthan"===a)return h<p;if("datetimelessthan"===a)return p<h}return!1;case"contains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1!==n.indexOf(e.value):-1!==String(n).indexOf(String(e.value));case"notcontains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?!e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1===n.indexOf(e.value):-1===String(n).indexOf(String(e.value));case"isempty":return i?0===n.length:!n||0===String(n).length;case"isnotempty":return i?0<n.length:!!n&&0<String(n).length;default:return!1}}catch(e){return!1}},t.evaluateCompositeRule=function(e,t){var n,a=this;try{return Array.isArray(e.rules)&&0!==e.rules.length?"and"===(n=e.condition.toLowerCase())?e.rules.every(function(e){return a.evaluateCondition(e,t)}):"or"===n&&e.rules.some(function(e){return a.evaluateCondition(e,t)}):!1}catch(e){return!1}},t.isFieldVisible=function(e,t){try{return e&&e.visibleWhen?this.evaluateCondition(e.visibleWhen,t):!0}catch(e){return!0}},t.isFieldReadOnly=function(e,t){try{return e&&e.readOnlyWhen?this.evaluateCondition(e.readOnlyWhen,t):!1}catch(e){return!1}},t.isFieldDisabled=function(e,t){try{return e&&e.disabledWhen?this.evaluateCondition(e.disabledWhen,t):!1}catch(e){return!1}},t.isFieldHidden=function(e,t){try{return e&&e.hideWhen?this.evaluateCondition(e.hideWhen,t):!1}catch(e){return!1}},t.isFieldRequired=function(e,t){try{return e&&e.requiredWhen?this.evaluateCondition(e.requiredWhen,t):!1}catch(e){return!1}},t.getConditionalValue=function(e,t){try{return e&&e.setValueWhen?this.evaluateCondition(e.setValueWhen.condition,t)?e.setValueWhen.value:void 0:void 0}catch(e){}},t.evaluateConditionalDataRules=function(e,t){if(e&&Array.isArray(e))for(var n=0;n<e.length;n++){var a=e[n];if(this.evaluateCondition(a.condition,t))return n}return-1},t.getChoiceBasedOptions=function(e,t,n,a){try{var i,r=n&&n[a];return null==r?e.showAllWhenNotMapped?t:[]:(i=String(r))in e.choiceMapping?e.choiceMapping[i].filter(function(e){return-1!==t.indexOf(e)}):e.showAllWhenNotMapped?t:[]}catch(e){return t}};var Y=t;function t(){}function x(e){return e+"_"+Math.floor(1e3*Math.random())}var E=function(){return(E=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},T=function(e){return e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random())};function O(e,t){return!e||""===e.trim()||""===(e=e.replace(/[^\w\s]/g,"").trim())||0===(e=e.split(/[\s_]+/)).length?t||"field":e.map(function(e,t){return 0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join("")||t||"field"}function R(e,t,n){if(!t.has(e))return e;if(n){n=e+"_"+n.split("_").pop();if(!t.has(n))return n}for(var a=2;t.has(""+e+a);)a++;return""+e+a}var k={textbox:{type:"string"},textarea:{type:"string"},email:{type:"string",format:"email"},url:{type:"string",format:"url"},phone:{type:"string"},password:{type:"string"},inputMask:{type:"string"},number:{type:"number"},rangeSlider:{type:"number"},rating:{type:"number"},checkbox:{type:"boolean"},switch:{type:"boolean"},date:{type:"string",format:"date"},dateTime:{type:"string",format:"date-time"},time:{type:"string",format:"time"},dateRange:{type:"string",format:"date"},multiselect:{type:"array"},checkboxGroup:{type:"array"},dropdown:{type:"string"},radio:{type:"string"},splitButton:{type:"string"},button:{type:"button"},message:{type:"message"},signature:{type:"sign"},imageEditor:{type:"image"},fileUpload:{type:"file"},colorPicker:{type:"color"},dataGrid:{type:"grid"},staticHtml:{type:"string"},table:null,panel:null,tabs:null,card:null};function y(e,t){if(e&&e.rules&&Array.isArray(e.rules)){var n=e.rules.map(function(e){return e.rules&&Array.isArray(e.rules)?y(e,t):e.field&&!t.has(e.field)?null:e}).filter(function(e){return null!=e});if(0!==n.length)return E({},e,{rules:n})}}function N(e,t){var n={id:g(e.id,T(t.type)),name:e.name,type:t.type};return t.format&&(n.format=t.format),void 0!==e.label&&(n.label=e.label),void 0!==e.defaultValue&&(n.defaultValue=e.defaultValue),void 0!==e.expressionValue&&(n.expressionValue=e.expressionValue),void 0!==e.content&&(n.content=e.content),void 0!==e.buttonType&&(n.buttonType=e.buttonType),void 0!==e.textboxType&&(n.textboxType=e.textboxType),void 0!==e.required&&(n.required=e.required),void 0!==e.options&&(n.options=e.options),void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength&&(n.maxLength=e.maxLength),void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue&&(n.maxValue=e.maxValue),void 0!==e.minDate&&(n.minDate=e.minDate),void 0!==e.maxDate&&(n.maxDate=e.maxDate),void 0!==e.minTime&&(n.minTime=e.minTime),void 0!==e.maxTime&&(n.maxTime=e.maxTime),void 0!==e.regex&&(t=e.regex,n.pattern=t instanceof RegExp?t.source:t),void 0!==e.pattern&&(t=e.pattern,n.pattern=t instanceof RegExp?t.source:t),n}function L(t,o){for(var s=new Map,e=0,n=Object.keys(t.properties);e<n.length;e++){var a=n[e];s.set(a,t.properties[a])}function l(e){for(var r=[],t=0,n=e;t<n.length;t++)!function(e){if("field"===e.type){var t=e;if(d.has(t.propertyId))return;d.add(t.propertyId);var n=s.get(t.propertyId);n?r.push(C(n,o)):(n={id:t.propertyId||T("textbox"),name:x(""),type:"textbox",label:"Unknown Field",_configured:!0},r.push(n))}else{var a,i;"table"===e.type?(a=E({id:(t=e).id||T("table"),name:t.name,type:"table",label:t.label||"Table",cssClass:t.cssClass,hideBorders:t.hideBorders,rows:t.rows,columns:t.cols,columnWidths:t.columnWidths,tableCells:[],_configured:!0},t.conditions?{conditions:t.conditions}:{}),t.cells.forEach(function(e){var t=[];e.forEach(function(e){e=l(e.children);t.push(e)}),a.tableCells.push(t)}),r.push(a)):"panel"===e.type?(t=E({id:(n=e).id||T("panel"),type:"panel",name:n.name,cssClass:n.cssClass,hideBorders:n.hideBorders,hideLabel:n.hideLabel,label:n.label||"Panel",children:l(n.children),_configured:!0},n.conditions?{conditions:n.conditions}:{}),r.push(t)):"tabs"===e.type?(i=E({id:(n=e).id||T("tabs"),type:"tabs",name:n.name,label:n.label||"Tabs",cssClass:n.cssClass,tabOptions:n.tabOptions,tabItems:[],_configured:!0},n.conditions?{conditions:n.conditions}:{}),n.tabs.forEach(function(e){i.tabItems.push({header:e.header,content:l(e.children)})}),r.push(i)):"card"===e.type&&(n=E({id:(t=e).id||T("card"),type:"card",name:t.name,label:t.label||"Card",cssClass:t.cssClass,hideLabel:t.hideLabel,children:l(t.children),_configured:!0},t.conditions?{conditions:t.conditions}:{}),void 0!==t.cardTitle&&(n.cardTitle=t.cardTitle),void 0!==t.cardSubtitle&&(n.cardSubtitle=t.cardSubtitle),r.push(n))}}(n[t]);return r}var i,d=new Set;return i=t.layout&&0!==t.layout.length?l(t.layout):Object.keys(t.properties).map(function(e){return C(t.properties[e],o)}),E({version:t.version,components:i},t.settings?{settings:t.settings}:{})}function C(t,e){var n=void 0!==t.options&&0<t.options.length,a={id:t.id||T(t.widget||A(t.type,t.format,n)),name:t.name,type:t.widget||A(t.type,t.format,n),label:t.label||t.id},i=new Set(["id","type","name","label","format","widget","defaultValue","required","options","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);return Object.keys(t).forEach(function(e){i.has(e)||"id"===e||"name"===e||"type"===e||"label"===e||(a[e]=t[e])}),void 0!==t.defaultValue&&(a.defaultValue=t.defaultValue),void 0!==t.expressionValue&&(a.expressionValue=t.expressionValue),void 0!==t.required&&(a.required=t.required),void 0!==t.content&&(a.content=t.content),void 0!==t.buttonType&&(a.buttonType=t.buttonType),void 0!==t.textboxType&&(a.textboxType=t.textboxType),void 0!==t.options&&(a.options=t.options),void 0!==t.minLength&&(a.minLength=t.minLength),void 0!==t.maxLength&&(a.maxLength=t.maxLength),void 0!==t.minValue&&(a.minValue=t.minValue),void 0!==t.maxValue&&(a.maxValue=t.maxValue),void 0!==t.minDate&&(a.minDate=t.minDate),void 0!==t.maxDate&&(a.maxDate=t.maxDate),void 0!==t.minTime&&(a.minTime=t.minTime),void 0!==t.maxTime&&(a.maxTime=t.maxTime),void 0!==t.pattern&&(a.regex=t.pattern),t.name&&e&&Object.prototype.hasOwnProperty.call(e,t.name)&&("checkbox"!==a.type&&"switch"!==a.type||(a.checked=e[t.name]),"dataGrid"===a.type?a.dataSource=e[t.name]:a.defaultValue=e[t.name]),a}function A(e,t,n){return"string"===e?"date"===t?"date":"date-time"===t?"dateTime":"time"===t?"time":"email"===t?"email":"url"===t?"url":n?"dropdown":"textbox":"number"===e?"number":"boolean"===e?"checkbox":"array"===e?"multiselect":"button"===e?"button":"message"===e?"message":"sign"===e?"signature":"image"===e?"imageEditor":"file"===e?"fileUpload":"color"===e?"colorPicker":"grid"===e?"dataGrid":"textbox"}function M(e){switch(e){case"number":case"rangeSlider":case"rating":return"number";case"checkbox":case"switch":return"boolean";case"multiselect":case"checkboxGroup":return"array";case"button":return"button";case"message":return"message";case"signature":return"sign";case"imageEditor":return"image";case"fileUpload":return"file";case"colorPicker":return"color";case"dataGrid":return"grid";default:return"string"}}function w(e,t){var n=function(e,t){for(var n=e.length,a=t.length,i=[],r=0;r<=n;r++)i[r]=[r];for(var o=0;o<=a;o++)i[0][o]=o;for(r=1;r<=n;r++)for(o=1;o<=a;o++){var s=e[r-1]===t[o-1]?0:1;i[r][o]=Math.min(i[r-1][o]+1,i[r][o-1]+1,i[r-1][o-1]+s)}return i[n][a]}(e.toLowerCase(),t.toLowerCase()),e=Math.max(e.length,t.length);return 0===e?100:Math.round((e-n)/e*100)}function j(e,t){if(t.properties[e.id])return{existingId:e.id,newDataId:e.id,confidence:"exact",method:"id",similarity:100};for(var n=null,a=0,i=Object.keys(t.properties);a<i.length;a++){var r,o=i[a];"table"!==(c=t.properties[o]).widget&&"panel"!==c.widget&&"tabs"!==c.widget&&(r=e.id||"",0===o.indexOf(r+"_")||0===r.indexOf(o+"_")?(h=Math.round(Math.min(r.length,o.length)/Math.max(r.length,o.length)*100),(!n||n.similarity&&h>n.similarity)&&(n={existingId:o,newDataId:e.id,confidence:90<=h?"high":70<=h?"medium":"low",method:"id",similarity:h})):85<=(r=w(o,r))&&(!n||n.similarity&&r>n.similarity)&&(n={existingId:o,newDataId:e.id,confidence:90<=r?"high":"medium",method:"id",similarity:r}))}if(n&&n.similarity&&70<=n.similarity)return n;for(var s=null,l=0,d=Object.keys(t.properties);l<d.length;l++){var c,u,p,h,o=d[l];"table"!==(c=t.properties[o]).widget&&"panel"!==c.widget&&"tabs"!==c.widget&&(u=c.label||o,p=e.label||e.id,u&&p&&(h=w(u,p),!s||s.similarity&&h>s.similarity))&&(s={existingId:o,newDataId:e.id,confidence:90<=h?"high":70<=h?"medium":"low",method:100===h?"label-exact":"label-fuzzy",similarity:h})}return s&&s.similarity&&70<=s.similarity?s:{existingId:e.id,newDataId:e.id,confidence:"exact",method:"new",similarity:100}}function P(e){for(var t=new Set,n=e.slice();0<n.length;){var a=n.shift();"field"===a.type?t.add(a.propertyId):"table"===a.type?a.cells.forEach(function(e){return e.forEach(function(e){return n.push.apply(n,e.children)})}):"panel"===a.type?n.push.apply(n,a.children):"tabs"===a.type?a.tabs.forEach(function(e){return n.push.apply(n,e.children)}):"card"===a.type&&n.push.apply(n,a.children)}return t}n.prototype.setAvailableFields=function(e){var t=this;this.availableFields.clear(),e.forEach(function(e){t.availableFields.set(e.name,e)})},n.prototype.validateFieldOperations=function(e){var t=[];if(0!==this.availableFields.size)for(var n=["-","*","/","%","^"],a=["-","*","/","%","^","+"],i=new Set,r=/(\{[^}]+\})/g;null!==(u=r.exec(e));){var o,s,l,d,c,u,p,h,m=u[0],f=m.slice(1,-1),y=this.availableFields.get(f);y&&(m=(u=u.index)+m.length,p=e.substring(Math.max(0,u-10),u),o=e.substring(m,Math.min(e.length,m+10)),s=p.replace(/\s+$/,"").slice(-1),l=o.replace(/^\s+/,"").charAt(0),d=p.replace(/\s+$/,""),c=o.replace(/^\s+/,""),u=u-(p.length-d.length)-1,p=m+(o.length-c.length),"string"!==y.type||y.format||(s&&-1!==n.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on string field '{"+f+"}'"),i.add(h)),!l)||-1===n.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on string field '{"+f+"}'"),i.add(h)),"date"!==y.format&&"date-time"!==y.format&&"time"!==y.format||(s&&-1!==a.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on date field '{"+f+"}'"),i.add(h)),!l)||-1===a.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on date field '{"+f+"}'"),i.add(h)))}return t},n.prototype.validate=function(e){var t=[];if(!e||""===e.trim())return{valid:!0,errors:[]};(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push("Unbalanced braces in expression");(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push("Unbalanced parentheses in expression");for(var n=/(\w+)\s*\(/g;null!==(a=n.exec(e));){var a=a[1].toUpperCase();a===a.toUpperCase()&&-1===this.supportedFunctions.indexOf(a)&&t.push("Unknown function: "+a)}var i=this.validateFieldOperations(e);return t.push.apply(t,i),{valid:0===t.length,errors:t}},n.prototype.compile=function(e,t){void 0===t&&(t={});try{var n;return t.availableFields&&Array.isArray(t.availableFields)&&this.setAvailableFields(t.availableFields),this.validate(e).valid?(n=e,n=this.compileFieldReferences(e),n=t.isCustomValidation?this.compileInputReferences(n):n,n=this.compileBareFunctionCalls(n),n=this.compileMatrixExpressions(n),function(e){try{return new Function("context","\n try {\n return "+n+";\n } catch (e) {\n return null;\n }\n ")(e)}catch(e){return null}}):function(){return null}}catch(e){return function(){return null}}},n.prototype.compileMatrixExpressions=function(e){var a=["PI","TRUE","FALSE","NULL","UNDEFINED","Math"],i=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"];return e.replace(/\$?\{([^}]+)\}/g,function(e,t){var n=t;return i.forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),a.forEach(function(e){var t=new RegExp("\\b"+e+"\\b","g");n=n.replace(t,"context."+e)}),"("+n+")"})},n.prototype.compileBareFunctionCalls=function(e){var n=e;return["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"].forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),n},n.prototype.compileFieldReferences=function(e){return e.replace(/\{([^{}]+)\}/g,function(e,t){return t.startsWith("\\")&&t.endsWith("\\")?e:"context['"+t.replace(/\./g,"'].[")+"']"})},n.prototype.compileInputReferences=function(e){var t=[],n=e=(e=(e=e.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g,function(e){return t.push(e),"__STRING_"+(t.length-1)+"__"})).replace(/(?<!context\[')\binput\./g,"context['input'].")).replace(/(?<!context\[')\binput\b(?!\s*[(\.])/g,"context['input']");return t.forEach(function(e,t){n=n.replace("__STRING_"+t+"__",e)}),n};var S=n;function n(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS","INCLUDES","CONTAINS","ISNAN","SUPPORTEDVALUESOF","TOSTRING","DATE","GETTIME","EVERY","SOME"],this.availableFields=new Map}a.prototype.extractFieldReferences=function(e){if(!e)return[];for(var t,n=new Set,a=e.replace(this.escapedBracePattern,""),i=/\{([^{}]+)\}/g;null!==(t=i.exec(a));){var r=t[1].trim();this.isFunctionCall(r)||this.isOperator(r)||(r=r.split(/[.\[\]]/)[0].trim())&&!this.isKeyword(r)&&n.add(r)}for(var o=/\$\{([^}]+)\}/g;null!==(t=o.exec(a));)for(var s=t[1],l=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[(\.])/g;null!==(d=l.exec(s));){var d=d[1];this.isKeyword(d)||"Math"===d||n.add(d)}return Array.from(n)},a.prototype.buildGraph=function(e){for(var t={},n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=this.extractFieldReferences(e[i]);t[i]=r}return t},a.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,d=[],c=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),d.push(t.slice(i).concat([r]))):c(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||c(n,[])}return d},a.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];i[a]&&s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},a.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},a.prototype.isOperator=function(e){return/^[+\-*/()=!<>&|]/.test(e)},a.prototype.isKeyword=function(e){return-1!==["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"].indexOf(e.toUpperCase())};var B=a;function a(){this.escapedBracePattern=/\\{.*?\\}/g}var U=function(){return(U=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},W=(i.prototype.evaluate=function(e,t,n,a){void 0===n&&(n={}),void 0===a&&(a=!1);try{if(!e||""===e.trim())return null;var i=n.timeout,r=void 0===i?5e3:i,o=n.maxDepth,s=void 0===o?10:o,l=n.locale,d=void 0===l?"en-US":l,c=n.throwOnError,u=void 0!==c&&c,p=this.getCacheKey(e,t);if(!a&&this.evaluationCache.has(p))return this.evaluationCache.get(p);var h=this.compiledFunctions.get(e),m=(h||(h=this.parser.compile(e,{timeout:r,maxDepth:s,locale:d,isCustomValidation:a}),this.compiledFunctions.set(e,h)),this.buildContext(t)),f=Date.now(),y=h(m);if(Date.now()-f>r){var g=new Error("Expression evaluation exceeded timeout of "+r+"ms");if(u)throw g;return null}return this.evaluationCache.set(p,y),y}catch(g){if(n.throwOnError)throw g;return null}},i.prototype.extractDependencies=function(e){return e?this.dependencyTracker.extractFieldReferences(e):[]},i.prototype.buildDependencyGraph=function(e){var n=this,a={};return e.forEach(function(e){var t;e.expressionValue&&(t=n.extractDependencies(e.expressionValue),a[e.name]=t)}),a},i.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,d=[],c=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),d.push(t.slice(i).concat([r]))):c(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||c(n,[])}return d},i.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},i.prototype.clearCache=function(){this.evaluationCache.clear(),this.compiledFunctions.clear()},i.prototype.getCacheKey=function(e,t){return e+":"+JSON.stringify(t)},i.prototype.buildContext=function(e){var n=new _.Internationalization,a=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return U({},e,{PI:Math.PI,TRUE:!0,FALSE:!1,NULL:null,UNDEFINED:void 0,Math:Math,SUM:function(e){return Array.isArray(e)?e.reduce(function(e,t){return Number(e)+Number(t)},0):0},AVG:function(e){return Array.isArray(e)&&0!==e.length?e.reduce(function(e,t){return Number(e)+Number(t)},0)/e.length:0},MIN:function(e){return Array.isArray(e)&&0<e.length?Math.min.apply(Math,e.map(Number)):0},MAX:function(e){return Array.isArray(e)&&0<e.length?Math.max.apply(Math,e.map(Number)):0},COUNT:function(e){return Array.isArray(e)?e.length:0},ROUND:function(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},FLOOR:Math.floor,CEIL:Math.ceil,ABS:Math.abs,SQRT:Math.sqrt,UPPER:function(e){return String(e).toUpperCase()},LOWER:function(e){return String(e).toLowerCase()},CONCAT:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(String).join("")},LENGTH:function(e){return String(e).length},TRIM:function(e){return String(e).trim()},SUBSTRING:function(e,t,n){return void 0!==n?String(e).substr(t,n):String(e).substr(t)},TODAY:function(){return a(new Date)},AGE:function(e){var e="string"==typeof e?new Date(e):e,t=new Date,n=t.getFullYear()-e.getFullYear(),a=t.getMonth()-e.getMonth();return(a<0||0==a&&t.getDate()<e.getDate())&&n--,n},DATEFORMAT:function(e,t){e="string"==typeof e?new Date(e):e;return n.getDateFormat({format:t,type:"date"})(e)},DATEDIFF:function(e,t){e="string"==typeof e?new Date(e):e,t="string"==typeof t?new Date(t):t;return Math.floor((t.getTime()-e.getTime())/864e5)},ADDDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()+Number(t)),a(e)},SUBDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()-Number(t)),a(e)}})},i);function i(){this.evaluationCache=new Map,this.compiledFunctions=new Map,this.parser=new S,this.dependencyTracker=new B}o.prototype.validate=function(e,t){var n,a=[];return e&&""!==e.trim()&&(n=this.validateSyntax(e),a.push.apply(a,n),n=this.validateFieldReferences(e,t),a.push.apply(a,n),n=this.validateFunctionCalls(e),a.push.apply(a,n),n=this.validateFieldOperations(e,t),a.push.apply(a,n)),a},o.prototype.validateFieldOperations=function(e,t){var n=[];if(Array.isArray(t)&&0!==t.length){var a=t[0];if("string"!=typeof a){var i=new Map;if(t.forEach(function(e){e&&"object"==typeof e&&e.name&&i.set(e.name,e)}),0!==i.size)for(var r=new Set,o=/(\{[^}]+\})/g,s=["-","*","/","%","^"],l=["-","*","/","%","^","+"];null!==(h=o.exec(e));){var d,c,u,p,h,m,f,y,g,v,b=h[0],x=b.slice(1,-1),C=i.get(x);C&&(b=(h=h.index)+b.length,d=e.substring(Math.max(0,h-10),h),c=e.substring(b,Math.min(e.length,b+10)),u=d.replace(/\s+$/,"").slice(-1),p=c.replace(/^\s+/,"").charAt(0),m=d.replace(/\s+$/,""),f=c.replace(/^\s+/,""),h=h-(d.length-m.length)-1,m=b+(c.length-f.length),"string"!==C.type||C.format||(u&&-1!==s.indexOf(u)&&!r.has(v=h+":"+u)&&(n.push({type:"InvalidOperation",message:"Cannot perform '"+u+"' operation on string field '{"+x+"}'"}),r.add(v)),!p)||-1===s.indexOf(p)||r.has(v=m+":"+p)||(n.push({type:"InvalidOperation",message:"Cannot perform '"+p+"' operation on string field '{"+x+"}'"}),r.add(v)),"date"!==C.format&&"date-time"!==C.format&&"time"!==C.format||(u&&-1!==l.indexOf(u)&&!r.has(v=h+":"+u)&&(n.push({type:"InvalidOperation",message:"Cannot perform '"+u+"' operation on date field '{"+x+"}'"}),r.add(v)),p&&-1!==l.indexOf(p)&&!r.has(v=m+":"+p)&&(n.push({type:"InvalidOperation",message:"Cannot perform '"+p+"' operation on date field '{"+x+"}'"}),r.add(v)),"+"===p&&(b=c.replace(/^\s+/,"").substring(1).trim(),y=/^\{[^}]+\}/.test(b)&&i.get(b.slice(1,-1))&&"number"===i.get(b.slice(1,-1)).type,g=/^\d+/.test(b),y||g||r.has(v=m+":"+p)||(n.push({type:"InvalidOperation",message:"Date field '{"+x+"}' can only be used with +number or +{numberField}, not '"+p+b.substring(0,10)+"'"}),r.add(v))),"+"===u&&(C=(f=d.replace(/\s+$/,"")).substring(0,f.length-1).trim(),y=/\{[^}]+\}$/.test(C)&&i.get(C.slice(C.lastIndexOf("{")+1,-1))&&"number"===i.get(C.slice(C.lastIndexOf("{")+1,-1)).type,g=/\d+$/.test(C),y||g||r.has(v=h+":"+u)||(n.push({type:"InvalidOperation",message:"Date field '{"+x+"}' can only be used with +number or +{numberField}"}),r.add(v)))))}}}return n},o.prototype.validateSyntax=function(e){var t=[];(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push({type:"SyntaxError",message:"Unbalanced braces in expression"});(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push({type:"SyntaxError",message:"Unbalanced parentheses in expression"});var n=(e.match(/\$\{/g)||[]).length;return(e.match(/\}/g)||[]).length<n&&t.push({type:"SyntaxError",message:"Unbalanced ${ } in expression"}),t},o.prototype.validateFieldReferences=function(e,t){var n=[];if(t&&0!==t.length)for(var a=/\{([^{}]+)\}/g,i="string"==typeof t[0]?new Set(t):new Set(t.map(function(e){return e.name}));null!==(r=a.exec(e));){var r=r[1].trim();this.isFunctionCall(r)||this.isMathExpression(r)||!(r=r.split(/[.\[\]]/)[0].trim())||-1!==this.keywords.indexOf(r.toUpperCase())||i.has(r)||n.push({type:"UndefinedField",message:"Field '"+r+"' is not defined in the form",field:r})}return n},o.prototype.validateFunctionCalls=function(e){for(var t=[],n=/(\w+)\s*\(/g;null!==(a=n.exec(e));){var a=a[1];a===a.toUpperCase()&&-1===this.supportedFunctions.indexOf(a)&&t.push({type:"InvalidFunction",message:"Unknown function: '"+a+"'. Supported functions: "+this.supportedFunctions.join(", ")})}return t},o.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},o.prototype.isMathExpression=function(e){return/[\+\-\*\/\%\=\<\>\!\&\|\^\~\s\d]/.test(e)};var ne=o;function o(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"],this.keywords=["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"]}function ae(e){return{primary:"e-primary",flat:"e-flat",information:"e-info",error:"e-danger",success:"e-success",warning:"e-warning"}[e||"primary"]||"e-primary"}function ie(e){return"submit"===e||"reset"===e?e:"button"}function re(e){return{Left:"flex-start",Right:"flex-end",Center:"center"}[e||"Left"]||"flex-start"}var oe=function(){return(oe=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},se={EMAIL:/^(?!.*\.\.)[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,URL:/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/,DATE_ISO:/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,DIGITS:/^[0-9]*$/,PHONE:/^[+]?[0-9]{9,13}$/,CREDIT_CARD:/^\d{13,16}$/};function le(e){var n,a,i=e.map(function(e){return null===e?NaN:Number(e)}),e=i.reduce(function(e,t){return e+(isNaN(t)?0:t)},0),e=Math.max(0,Math.round(100-e)),t=i.map(function(e,t){return isNaN(e)?t:-1}).filter(function(e){return 0<=e}),r=t.length;return 0===r?i.map(function(e){return Math.round(e)}):(n=Math.floor(e/r),a=e-n*r,t.forEach(function(e){var t=0<a?n+1:n;i[e]=t,a=Math.max(0,a-1)}),i.map(function(e){return isNaN(e)?0:Math.round(e)}))}function de(e,t){var n=new _.Internationalization,a=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return"date"===e.type&&(t=a(new Date(t))),"time"===e.type&&(t=(a=n.getDateFormat({format:"hh:mm a",type:"time"}))(new Date(t))),"dateTime"===e.type&&(t=(a=n.getDateFormat({format:"MM/dd/yyyy hh:mm a",type:"dateTime"}))(new Date(t))),t="dateRange"===e.type&&Array.isArray(t)?t.map(function(e){return e?a(new Date(e)):null}):t}function ce(e){switch(e){case"WebApiAdaptor":return new h.WebApiAdaptor;case"ODataV4Adaptor":return new h.ODataV4Adaptor;default:return new h.UrlAdaptor}}function ue(e,t){if(!t||null==e)return e;for(var n=e,a=0,i=t.split(/\.(?![^\[]*\])/);a<i.length;a++){var r=i[a];if(null==n)return null;var o,s=r.match(/^(\w*)\[(\d+)\]$/);n=s?(o=s[1],s=parseInt(s[2]),o?n[o]&&n[o][s]:n[s]):n[r]}return n}function pe(t,e){function n(e){e.forEach(function(e){e.name&&e.id in t&&(a[e.name]=t[e.id]),e.children&&n(e.children),e.tabItems&&e.tabItems.forEach(function(e){return e.content&&n(e.content)}),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(n)})})}var a={};return n(e),a}function he(t,e,n){if("string"!=typeof t||!/{[^}]+}/.test(t))return t;n=n?pe(e,n):e;try{var a=fe.evaluate(t,n);return null!=a?String(a):""}catch(e){return t}}function J(e,t,n){return e&&"object"==typeof e&&!Array.isArray(e)&&"lookup"===e.type&&n?n&&0<n.length?n:[]:e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type?0<t.length?t:[]:Array.isArray(e)?e:e&&"object"==typeof e&&!Array.isArray(e)&&"raw"===e.type&&Array.isArray(e.data)?e.data:[]}function me(e,t){if(e&&e.conditionalData&&Array.isArray(e.conditionalData))for(var n=0,a=e.conditionalData;n<a.length;n++){var i=a[n];if(Y.evaluateCondition(i.condition,t))return{dataSource:i.dataSource,columns:i.columns&&0<i.columns.length?i.columns:void 0}}}var fe=new W;function g(e,t){t="string"==typeof t&&t?t:"field_"+Date.now()+"_"+Math.floor(1e3*Math.random());return null==e||!(e=String(e).trim())||"__proto__"===e||"prototype"===e||"constructor"===e||(e=e.replace(/[^A-Za-z0-9_-]/g,"_"),"__proto__"===(e=100<(e=/^[A-Za-z_]/.test(e)?e:"f_"+e).length?e.slice(0,100):e))||"prototype"===e||"constructor"===e?t:e}ge.fetch=function(e,d,c,u){var p;return e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type&&e.url?(p=e,new Promise(function(t){try{var e,n,a,i={},r=(p.headers&&Array.isArray(p.headers)&&p.headers.forEach(function(e){e.key&&e.key.trim()&&(i[e.key]=e.value)}),new h.DataManager({url:p.url,adaptor:ce(p.adaptorType),headers:Object.keys(i).length?i:void 0})),o=new h.Query,s=(p.search&&p.search.enabled&&p.search.fields&&0<p.search.fields.length&&(e=p.search.key||"search",n=c?he(e,c,u):/[{}]/.test(e)?"":e,o=o.search(n,p.search.fields)),p.sort&&p.sort.enabled&&p.sort.field&&(a="descending"===p.sort.direction?"descending":"ascending",o=o.sortBy(p.sort.field,a)),p.filters&&Array.isArray(p.filters)&&0<p.filters.length&&p.filters.forEach(function(e){var t;e.field&&e.operator&&void 0!==e.value&&""!==e.value&&""!==(t=c?he(e.value,c,u):/[{}]/.test(e.value)?"":e.value)&&(o=o.where(e.field,e.operator,t))}),p.queryParams&&Object.keys(p.queryParams).forEach(function(e){o=o.addParams(e,p.queryParams[e])}),p.skip&&(o=o.skip(p.skip)),p.take&&(o=o.take(p.take)),!1),l=setTimeout(function(){s=!0,t({id:d,options:[]})},15e3);r.executeQuery(o).then(function(e){s||(clearTimeout(l),e=e.result,p.dataPath&&(e=ue(e,p.dataPath)),e=Array.isArray(e)?e:"string"==typeof e?[e]:[],t({id:d,options:e}))}).catch(function(e){s||(clearTimeout(l),t({id:d,options:[]}))})}catch(e){t({id:d,options:[]})}})):Promise.resolve({id:d,options:[]})};var ye=ge;function ge(){}s.prototype.getSelectedItems=function(){var e=this.formState?this.formState.values[this.component.id]:_.isNullOrUndefined(this.valueProp())?this.component.defaultValue:this.valueProp();return Array.isArray(e)?e:[]},s.prototype.valueProp=function(){return this._value},s.prototype.setValue=function(e){this._value=e},s.prototype.handleCheckboxChange=function(t,e){var n=this.getSelectedItems(),e=e?n.concat([t]):n.filter(function(e){return e!==t});this.formState&&this.onChangeCb(e)},Object.defineProperty(s.prototype,"sizeCssClass",{get:function(){return(this.component.cssClass||"")+("Small"===this.component.size?" e-small":"Bigger"===this.component.size?" e-bigger":"")},enumerable:!0,configurable:!0}),s.prototype.render=function(e){var i=this,r=this.component,t=r.label&&r.required?r.label+" *":r.label||"",e=e||this.target,n=document.createElement("div"),o=(n.className=("checkbox-group "+(r.cssClass||"")).trim(),n.setAttribute("role","group"),n.setAttribute("aria-label",t),n.title=r.tooltip||"",(t=r.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{}),t=(Object.keys(o).forEach(function(e){"class"!==e&&"className"!==e&&"style"!==e&&n.setAttribute(e,String(o[e]))}),"display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";gap:"+(r.gap||"8px")+";align-items:flex-start;"),s=(n.setAttribute("style",t),document.createElement("div")),t=(s.className="checkbox-group-items","display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";flex-wrap:wrap;gap:"+(r.gap||"2px")+";width:100%;"),t=(s.setAttribute("style",t),Array.isArray(r.options)?r.options:[]),l=this.getSelectedItems();return t.forEach(function(e,t){var n="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,e="string"==typeof e?e:null!=e.label?e.label:null!=e.value?e.value:String(n),a=document.createElement("input"),e=(s.appendChild(a),new q.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==l.indexOf(n),disabled:!!r.disabled,labelPosition:r.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),htmlAttributes:o,change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)}),n.appendChild(s),e&&e.appendChild(n),this.container=n,this.itemsContainer=s,n},s.prototype.refreshSelection=function(){var n=this,a=this.getSelectedItems();(Array.isArray(this.component.options)?this.component.options:["Option 1"]).forEach(function(e,t){e="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,t=n.checkboxes[t];t&&(t.checked=-1!==a.indexOf(e))})},s.prototype.destroy=function(){for(var e=0,t=this.checkboxes;e<t.length;e++){var n=t[e];try{n.destroy()}catch(e){}}this.checkboxes=[],this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.itemsContainer=null},s.prototype.setOptions=function(e){var i=this;if(this.component.options=e,this.itemsContainer){for(var t=0,n=this.checkboxes;t<n.length;t++){var a=n[t];try{a.destroy()}catch(e){}}for(this.checkboxes=[];this.itemsContainer.firstChild;)this.itemsContainer.removeChild(this.itemsContainer.firstChild);var r=this.getSelectedItems();e.forEach(function(e,t){var n="string"==typeof e?e:e.value||e.label||e.key,e="string"==typeof e?e:e.label||e.value||String(n),a=document.createElement("input"),e=(i.itemsContainer.appendChild(a),new q.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==r.indexOf(n),disabled:!!i.component.disabled,labelPosition:i.component.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)})}};var ve=s;function s(e){this.checkboxes=[],this.component=e.component,this.formState=e.formState,this.onChangeCb=e.onChange,this.optionRef=e.optionRef,this.enableRtl=e.enableRtl,this.target=e.target,this.container=null,this.itemsContainer=null,this.ref=e.ref}var be=function(){return(be=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},xe=(Ce.prototype.parseColumnValue=function(e,t){var n;return null==e||""===e?e:"number"===t?(n=parseFloat(String(e)),isNaN(n)?0:n):"boolean"!==t||"boolean"==typeof e?e:"true"===e||"1"===e||1===e||!0===e},Ce.prototype.evaluateRowExpressions=function(e,a){for(var i=this,r=be({},e),e=a.filter(function(e){return e.expression&&e.expression.toString().trim()}),o=this,t=0,n=e;t<n.length;t++)!function(t){if(!t.expression)return;try{var n={},e=(a.forEach(function(e){var t=r[e.field];n[e.field]=i.parseColumnValue(t,e.type)}),o.engine.evaluate(t.expression,n,{throwOnError:!1}));r[t.field]=e}catch(e){r[t.field]=null}}(n[t]);return r},Ce.prototype.extractCalculatedColumns=function(e){return e.filter(function(e){return e.expression&&e.expression.toString().trim()})},Ce.prototype.getEngine=function(){return this.engine},Ce);function Ce(){this.engine=new W}var we=function(){return(we=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Se=(l.prototype.validate=function(e,t,n){if(!e||""===e.trim())return!0;try{var a,i,r=we({},n,{input:t,valid:!0}),o=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*['"](.+?)['"]\s*$/);return o?(a=o[1].trim(),i=o[2],!0===this.expressionEngine.evaluate(a,r,{throwOnError:!1},!0)||i):"Invalid validation expression format"}catch(e){return"Validation expression error"}},l.prototype.extractDependencies=function(e){var t;return e?(t=(t=e.match(/valid\s*=\s*(.+)/))?t[1]:e,this.expressionEngine.extractDependencies(t).filter(function(e){return"input"!==e})):[]},l.prototype.validateConditionSyntax=function(e,t){if(!e||""===e.trim())return["Condition cannot be empty"];var n=[],a=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length,a=(a!==i&&n.push("Unbalanced parentheses ("+a+" open, "+i+" close)"),(e.match(/\{/g)||[]).length),i=(e.match(/\}/g)||[]).length;a!==i&&n.push("Unbalanced braces ("+a+" open, "+i+" close)");a=this.extractDependencies(e).filter(function(e){return-1===t.indexOf(e)});return 0<a.length&&n.push("Unknown field references: "+a.join(", ")),n},l.prototype.buildExpression=function(e,t){return"valid = "+e.trim()+" ? true : '"+t.replace(/'/g,"\\'")+"'"},l.prototype.parseExpression=function(e){e=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*'(.+)'/);return e?{condition:e[1].trim(),errorMessage:e[2].replace(/\\'/g,"'")}:null},l);function l(){this.expressionEngine=new W}var Ee=function(){return(Ee=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Te=(Object.defineProperty(d.prototype,"calculatedColumns",{get:function(){return this.gridExpressions.extractCalculatedColumns(this.columns)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"hasExpressions",{get:function(){return 0<this.calculatedColumns.length},enumerable:!0,configurable:!0}),d.prototype.buildToolbar=function(){var e=[];return this.allowAdding&&e.push("Add"),this.allowEditing&&e.push("Edit"),this.allowDeleting&&e.push("Delete"),e.push("Update","Cancel"),e},d.prototype.mapColumn=function(e){var t,n=e.validationRules?Ee({},e.validationRules):{},a=this.mapCustomValidationToSyncfusion(e);return a&&(t=e.customValidation&&e.customValidation[0]&&e.customValidation[0].expression&&(this.validationEngine.parseExpression?this.validationEngine.parseExpression(e.customValidation[0].expression).errorMessage:"Validation failed")||"Validation failed",n.required=[!0,t],n.custom=[a,t]),{field:e.field,headerText:e.headerText,type:e.type||"string",isPrimaryKey:e.isPrimaryKey||!1,width:e.width,format:"date"===e.type?e.format||"MM/dd/yyyy":e.format,editType:e.editType,allowEditing:!1!==e.allowEditing&&!e.expression,validationRules:n,edit:this.createEditParams(e)}},d.prototype.render=function(e){var n=this,t=Array.isArray(this.dataSource)?this.dataSource:[],t=(this.hasExpressions&&0<t.length?this.currentData=t.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return Ee({},e,t)}):this.currentData=t,document.createElement("div")),a=(t.className="datagrid-wrapper",t.style.width="string"==typeof this.width?this.width:this.width+"px",t.style.height="auto",document.createElement("div")),i=(a.className="datagrid-grid",t.appendChild(a),this.id&&(a.id=this.id),new r.Grid({dataSource:this.currentData,allowPaging:this.allowPaging,filterSettings:{mode:"Immediate"},pageSettings:{pageSize:this.pageSize},editSettings:{allowEditing:this.allowEditing,allowAdding:this.allowAdding,allowDeleting:this.allowDeleting,mode:"Normal"},enableRtl:this.enableRtl,locale:this.locale||"en-US",cssClass:this.cssClass,toolbar:this.buildToolbar(),actionComplete:this.handleActionComplete,height:"string"==typeof this.height?this.height:this.height+"px",width:"string"==typeof this.width?this.width:this.width+"px",allowSorting:!0,allowFiltering:this.allowFiltering,allowSelection:!0,columns:(this.columns||[]).map(function(e){return n.mapColumn(e)})}));return i.appendTo(a),this.ref(i),this.grid=i,e&&e.appendChild(t),this.wrapper=t},d.prototype.getRef=function(){var e=this;return{getGridData:function(){return e.currentData},gridRef:{current:this.grid}}},d.prototype.getGridData=function(){return this.currentData},d.prototype.setDataSource=function(e){var n=this;this.grid&&(e=Array.isArray(e)?e:[],this.hasExpressions&&0<e.length?this.currentData=e.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return Ee({},e,t)}):this.currentData=e,this.grid.dataSource=this.currentData,this.grid.refreshBatchData?this.grid.setProperties({dataSource:this.currentData},!0):this.grid.dataSource=this.currentData,this.grid.refresh)&&this.grid.refresh()},d.prototype.setColumns=function(e){this.grid&&(e&&0!==e.length?0===this.grid.columns.length&&e&&1===e.length&&(this.grid.columns=e):this.grid.columns=[],this.columns=e,this.grid.refresh)&&!this.isPreviewMode&&(this.dataSource&&Array.isArray(this.dataSource)&&0<this.dataSource.length&&!this.hasExpressions&&(this.grid.dataSource=this.dataSource),this.grid.refresh())},d.prototype.destroy=function(){if(this.grid){try{this.grid.destroy()}catch(e){}this.grid=null}this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.wrapper=null,this.gridExpressions=null,this.validationEngine=null,this.currentData=[],this.columns=[],this.dataSource=[]},d);function d(e){var l=this;this.grid=null,this.wrapper=null,this.mapCustomValidationToSyncfusion=function(s){if(s.customValidation&&0!==s.customValidation.length)return function(e){var n=l.grid&&l.grid.editModule?l.grid.editModule.formObj:null;if(n){var a={};(l.columns||[]).forEach(function(e){var t=n.getInputElement(e.field);t&&(t=t.value,a[e.field]="number"===e.type?parseInt(t,10):t)});for(var t=0,i=s.customValidation;t<i.length;t++){var r,o=i[t];if(o.expression)return r="number"===s.type?parseInt(e.value,10):e.value,!0===l.validationEngine.validate(o.expression,r,a)}}return!0}},this.createEditParams=function(t){if(l.hasExpressions){var n=l.calculatedColumns;if(n.some(function(e){return!!e.expression&&-1!==e.expression.indexOf("{"+t.field+"}")}))return{params:{change:function(){var e,o;l.grid&&l.grid.element&&(e=l.grid.element.querySelector("form"))&&e.ej2_instances&&e.ej2_instances[0]&&(o=e.ej2_instances[0],n.forEach(function(e){var t=o.getInputElement(e.field);if(t)try{var n={};l.columns.forEach(function(e){var t=o.getInputElement(e.field);t&&(n[e.field]=t.value)});var a,i,r=l.gridExpressions.evaluateRowExpressions(n,l.columns)[e.field];null!=r&&("boolean"===e.type?t.checked=!!r:"number"===e.type?(i=(a=t.closest(".e-control-wrapper"))?a.querySelector('input.e-control:not([type="hidden"])'):null)&&i.ej2_instances&&i.ej2_instances[0]?i.ej2_instances[0].value=r:t.value=r:"date"===e.type?t.ej2_instances[0].value=new Date(r):t.value=r)}catch(e){}}))}}}}},this.handleActionComplete=function(e){var t;if(l.grid)switch(e.requestType){case"save":case"delete":case"add":l.grid.dataSource&&(t=Array.isArray(l.grid.dataSource)?l.grid.dataSource:[],l.currentData=t,l.onDataChange)&&l.onDataChange(t)}},this.id=e.id,this.columns=e.columns||[],this.dataSource=Array.isArray(e.dataSource)?e.dataSource:[],this.height=null!=e.height?e.height:"200px",this.width=null!=e.width?e.width:"100%",this.locale=e.locale,this.cssClass=e.cssClass,this.pageSize=null!=e.pageSize?e.pageSize:6,this.allowPaging=!1!==e.allowPaging,this.allowAdding=!1!==e.allowAdding,this.allowEditing=!1!==e.allowEditing,this.allowDeleting=!1!==e.allowDeleting,this.allowFiltering=!0===e.allowFiltering,this.onDataChange=e.onDataChange,this.isPreviewMode=e.isPreviewMode,this.enableRtl=e.enableRtl,this.ref=e.ref,this.currentData=Array.isArray(this.dataSource)?this.dataSource:[],this.gridExpressions=new xe,this.validationEngine=new Se}r.Grid.Inject(r.Edit,r.Toolbar,r.Page,r.Resize,r.Sort,r.Filter);c.getConstraints=function(e,t,n){var a,i,r=this;return void 0===n&&(n="number"),e&&0!==e.length?(a=e.find(function(e){return!1===e.enabled}))?(i=this.resolveValue(a.minValue,{}),a=this.resolveValue(a.maxValue,{}),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:i,maxDate:a,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:i,maxTime:a}:{minValue:i,maxValue:a,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):0===(i=e.filter(function(e){return!0===e.enabled})).length||0===(a=i.map(function(e){return{min:r.resolveValue(e.minValue,t),max:r.resolveValue(e.maxValue,t)}}).filter(function(e){return void 0!==e.min||void 0!==e.max})).length?this.getEmptyConstraints(n):(e=this.getPermissiveMin(a,n),i=this.getPermissiveMax(a,n),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:e,maxDate:i,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:e,maxTime:i}:{minValue:e,maxValue:i,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):this.getEmptyConstraints(n)},c.resolveValue=function(e,t){return"number"==typeof e||"string"==typeof e?e:e&&"object"==typeof e&&e.field&&void 0!==(t=t[e.field])?t:void 0},c.getPermissiveMin=function(e,t){var a=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertToISO(e),a.convertToISO(t.min)<n))?t.min:e},void 0):"time"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertTimeTo24Hour(e),a.convertTimeTo24Hour(t.min)<n))?t.min:e},void 0):0<(t=e.map(function(e){return e.min}).filter(function(e){return void 0!==e})).length?Math.min.apply(Math,t):void 0},c.getPermissiveMax=function(e,t){var n=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertToISO(e)<n.convertToISO(t.max))?t.max:e},void 0):"time"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertTimeTo24Hour(e)<n.convertTimeTo24Hour(t.max))?t.max:e},void 0):0<(t=e.map(function(e){return e.max}).filter(function(e){return void 0!==e})).length?Math.max.apply(Math,t):void 0},c.convertToISO=function(e){var t,n,a;return e?(!e.includes("-")||10!==e.length)&&-1!==e.indexOf("/")&&(t=(a=e.split("/"))[0],n=a[1],a=a[2],t)&&n&&a?a+"-"+(t.length<2?"0"+t:t)+"-"+(n.length<2?"0"+n:n):e:""},c.convertTimeTo24Hour=function(e){var t,n,a,i;return e?(i=/PM/i.test(e),((t=/AM/i.test(e))||i)&&(a=(n=e.replace(/\s*(AM|PM)/i,"").trim().split(":"))[0],n=n[1],a)&&n?(a=parseInt(a,10),i&&12!==a?a+=12:t&&12===a&&(a=0),((i=String(a)).length<2?"0"+i:i)+":"+n):e):""},c.getEmptyConstraints=function(e){return{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},c.validateValue=function(e,t,n){if(null!=e&&""!==e)if("date"===n||"dateRange"===n){if(t.minDate){var a=this.convertToISO(t.minDate);if(this.convertToISO(e)<a)return{isValid:!1,error:"Date must be on or after "+t.minDate}}if(t.maxDate)if(this.convertToISO(t.maxDate)<this.convertToISO(e))return{isValid:!1,error:"Date must be on or before "+t.maxDate}}else if("time"===n){if(t.minTime&&e<t.minTime)return{isValid:!1,error:"Time must be on or after "+t.minTime};if(t.maxTime&&e>t.maxTime)return{isValid:!1,error:"Time must be on or before "+t.maxTime}}else{a=Number(e);if(void 0!==t.minValue)if(a<Number(t.minValue))return{isValid:!1,error:"Value must be at least "+t.minValue};if(void 0!==t.maxValue)if(Number(t.maxValue)<a)return{isValid:!1,error:"Value must be at most "+t.maxValue}}return{isValid:!0}};var Ae=c;function c(){}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},De={strict:!1,maxInputSize:5242880,defaultTextType:"textbox",inferTypeFromValue:!0,generateIds:!0,includeMetadata:!0,customTypeMap:{},validateUnknownFields:!1},Ie=(p.prototype.parse=function(e){var t=[],n=[];if("string"==typeof e){if(e.length>this.config.maxInputSize)return this.formatError(t,n,"Input exceeds maximum size of "+this.config.maxInputSize+" bytes");var a=Oe(e);if(!a.valid)return this.formatError(t,n,a.errors&&a.errors[0]||"Invalid JSON");try{e=JSON.parse(e)}catch(e){return this.formatError(t,n,"Failed to parse JSON: "+e.message)}}var a=this.detectFormat(e),i=(a.ambiguousFormats&&0<a.ambiguousFormats.length&&(n.push("Ambiguous format detected."),n.push("Using "+a.format+" format ("+("json-schema"===a.format?"properties priority":"pages priority")+")")),[]);switch(a.format){case"configured-schema":i=e.properties||[];break;case"json-schema":var r=this.parseJsonSchema(e),i=r.components;r.warnings&&n.push.apply(n,r.warnings);break;case"surveyjs":i=this.parseSurveyJS(e);break;case"openapi":i=this.parseOpenAPI(e);break;case"data-inference":0<(i=this.parseDataInference(e)).length&&n.push("Field types inferred from data; please verify");break;default:t.push("Could not determine input format")}0===i.length&&t.push("No form fields could be extracted from input");!i.some(function(e){return"button"===e.type&&"submit"===e.buttonType})&&0<i.length&&i.push({id:this.generateComponentId("button"),type:"button",label:"Submit",style:"primary",buttonType:"submit"});var o={version:e.version||"0.1.0",components:i},s=Ve(o),s=(!s.valid&&s.errors&&t.push.apply(t,s.errors),s.warnings&&n.push.apply(n,s.warnings),this.config.strict&&0<n.length&&(t.push.apply(t,n),n.length=0),Fe(o));return{success:0===t.length,schema:s,errors:t,warnings:n,metadata:{detectedFormat:a.format,confidence:a.confidence,sourceHints:a.hints}}},p.prototype.formatError=function(e,t,n){return e.push(n),{success:!1,schema:null,errors:e,warnings:t,metadata:{detectedFormat:"unknown",confidence:"low",sourceHints:[]}}},p.prototype.detectFormat=function(e){var t,n,a,i=[],r=[];return e&&"object"==typeof e?e.$schema&&"string"==typeof e.$schema&&e.$schema.includes("json-schema")?(i.push("$schema property detected"),{format:"json-schema",confidence:"high",hints:i}):(t=e.properties&&"object"==typeof e.properties,n=e.pages&&Array.isArray(e.pages),a=e.elements&&Array.isArray(e.elements),t&&n?(i.push("Multiple format patterns detected"),i.push("Selected based on priority rules"),r.push("properties format","pages format"),{format:"json-schema",confidence:"medium",hints:i,ambiguousFormats:r}):n?(i.push("pages array detected"),e.pages[0]&&e.pages[0].elements&&i.push("elements structure matched"),{format:"surveyjs",confidence:"high",hints:i}):a&&!t?(i.push("elements array at root level"),{format:"surveyjs",confidence:"medium",hints:i}):t?(i.push("properties object detected"),"object"===e.type&&i.push("type: object matched"),e.required&&Array.isArray(e.required)&&i.push("required array found"),this.hasExampleFields(e.properties)?(i.push("example fields detected (API schema pattern)"),{format:"openapi",confidence:"high",hints:i}):{format:"json-schema",confidence:"high",hints:i}):this.isDataInferenceCandidate(e)?(i.push("Simple object with primitive values"),i.push("No schema indicators found"),{format:"data-inference",confidence:"medium",hints:i}):{format:"unknown",confidence:"low",hints:["Could not identify format"]}):{format:"unknown",confidence:"low",hints:["Input is not a valid object"]}},p.prototype.hasExampleFields=function(e){if(e&&"object"==typeof e)for(var t=0,n=Object.keys(e);t<n.length;t++){var a=e[n[t]];if(a&&"example"in a)return!0}return!1},p.prototype.isDataInferenceCandidate=function(t){return!(!t||"object"!=typeof t||t.$schema||t.properties||t.pages||t.elements)&&Object.keys(t).every(function(e){e=t[e];return null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||!!Array.isArray(e)&&e.every(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e})})},p.prototype.inferComponentType=function(e,t){var t=this.inferTypeFromValue(e,t);return t.type?u({},t,{confidence:"high",method:"value-type"}):(t=this.matchFieldNamePattern(e)).type?u({},t,{confidence:"high",method:"name-pattern"}):{type:this.config.defaultTextType,confidence:"low",method:"fallback"}},p.prototype.inferTypeFromValue=function(e,t){return this.config.inferTypeFromValue?null==t?this.matchFieldNamePattern(e):"string"==typeof t?t.includes("@")&&t.includes(".")?{type:"textbox",textboxType:"email"}:/^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test(t)?{type:"textbox",textboxType:"url"}:/^\d{4}-\d{2}-\d{2}/.test(t)?{type:"date"}:"textbox"!==(e=this.matchFieldNamePattern(e)).type||e.textboxType?e:{type:this.config.defaultTextType}:"number"==typeof t?{type:"number"}:"boolean"==typeof t?{type:"checkbox"}:Array.isArray(t)?{type:"multiselect"}:{type:"textbox"}:{type:"textbox"}},p.prototype.matchFieldNamePattern=function(e){if(this.config.customTypeMap){var t=this.config.customTypeMap[e.toLowerCase()];if(t)return{type:t}}t=e.toLowerCase().replace(/[_\-\s]+/g," ");return/email|mail|e-?mail/.test(t)?{type:"textbox",textboxType:"email"}:/date|birth|birthday|dob|created|updated/.test(t)?{type:"date"}:/phone|tel|mobile|cell|cellphone|msisdn/.test(t)?{type:"textbox",textboxType:"number"}:/url|link|uri|website/.test(t)?{type:"textbox",textboxType:"url"}:/password|pwd|pass|security|secret|key|token/.test(t)?{type:"textbox",textboxType:"password"}:/\b(?:age|count|qty|quantity|amount|price|cost|salary|fee|rate|number|num)\b/.test(t)?{type:"number"}:/active|enabled|visible|deleted|archived|approved|confirmed/.test(t)?{type:"checkbox"}:/select|choice|option|type|status|category|kind/.test(t)?{type:"dropdown"}:/description|comment|note|bio|biography|about|message|content|summary|details/.test(t)?{type:"textarea"}:{type:"textbox"}},p.prototype.parseJsonSchema=function(e){var t=[],n=[];if(e.properties&&"object"==typeof e.properties)for(var a=this.flattenNestedProperties(e.properties,"",n),i=0,r=Object.keys(a);i<r.length;i++){var o=r[i],s=a[o],l=this.mapJsonSchemaType(s),d=-1!==(e.required||[]).indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return{components:t,warnings:n}},p.prototype.flattenNestedProperties=function(e,t,n){for(var a={},i=!1,r=0,o=Object.keys(e);r<o.length;r++){var s,l=o[r],d=t?t+"_"+l:l;"object"===(c=e[l]).type&&c.properties&&"object"==typeof c.properties?(i=!0,s=this.flattenNestedProperties(c.properties,d,n),Object.assign(a,s)):a[d]=c}if(i&&!t){n.push("NESTED_OBJECTS_FLATTENED: Nested objects converted to flat structure");for(var c,u=0,p=Object.keys(e);u<p.length;u++)"object"===(c=e[l=p[u]]).type&&c.properties&&this.collectFlattenedFieldNames(c.properties,l,n)}return a},p.prototype.collectFlattenedFieldNames=function(e,t,n){for(var a=0,i=Object.keys(e);a<i.length;a++){var r=i[a],o=e[r],s=t+"_"+r;n.push("Field '"+t+"."+r+"' flattened to '"+s+"'"),"object"===o.type&&o.properties&&this.collectFlattenedFieldNames(o.properties,s,n)}},p.prototype.parseSurveyJS=function(e){var t=this,n=[];return e.pages&&Array.isArray(e.pages)&&e.pages.forEach(function(e){e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))})}),!n.length&&e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))}),n},p.prototype.createComponentFromSurveyJS=function(e){var t=this.mapSurveyJSType(e.type||"text"),n={},a=(!0===e.isRequired&&(n.required=!0),e.validators&&Array.isArray(e.validators)&&e.validators.forEach(function(e){"numeric"===e.type&&(void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue)&&(n.maxValue=e.maxValue),"text"===e.type&&(void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength)&&(n.maxLength=e.maxLength)}),u({id:this.generateComponentId(t),type:t,label:e.title||e.label||this.humanizeFieldName(e.name),defaultValue:e.defaultValue,expressionValue:e.expressionValue},0<Object.keys(n).length?n:void 0));return"dropdown"!==t&&"multiselect"!==t&&"radio"!==t&&"splitButton"!==t||e.choices&&Array.isArray(e.choices)&&(a.options=e.choices),a},p.prototype.mapSurveyJSType=function(e){return{text:"textbox",email:"email",number:"number",checkbox:"checkbox",radiogroup:"radio",dropdown:"dropdown",tagbox:"multiselect",multiselect:"multiselect",rating:"number",comment:"textarea",date:"date"}[e]||"textbox"},p.prototype.parseOpenAPI=function(e){var t=[];if(e.properties&&"object"==typeof e.properties)for(var n=Object.keys(e.properties),a=e.required||[],i=0,r=n;i<r.length;i++){var o=r[i],s=e.properties[o],l=this.mapJsonSchemaType(s),d=-1!==a.indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return t},p.prototype.parseDataInference=function(e){for(var t=[],n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=e[i],o=this.inferComponentType(i,r),i={id:this.generateComponentId(o.type),type:o.type,label:this.humanizeFieldName(i),defaultValue:r,expressionValue:void 0};o.textboxType&&(i.textboxType=o.textboxType,"email"===o.textboxType?i.regex=se.EMAIL:"url"===o.textboxType&&(i.regex=se.URL)),"date"===o.type&&null!=i.defaultValue&&(o=this.formatDateTimeValue(i.defaultValue))&&(i.defaultValue=o),Array.isArray(r)&&0<r.length&&(i.options=r),t.push(i)}return t},p.prototype.createComponent=function(e,t,n,a){var i={};!0===(void 0!==t.required?t:a).required&&(i.required=!0),t.minLength&&(i.minLength=t.minLength),t.maxLength&&(i.maxLength=t.maxLength),t.minDate&&(i.minDate=t.minDate),t.maxDate&&(i.maxDate=t.maxDate),t.minTime&&(i.minTime=t.minTime),t.minValue&&(i.minValue=t.minValue),t.maxValue&&(i.maxValue=t.maxValue),t.pattern&&(i.pattern=t.pattern);a=g(t.id||this.generateComponentId(n.type),this.generateComponentId(n.type)),a=u({id:a,name:t.name,type:n.type,label:t.title||t.label||this.humanizeFieldName(e),defaultValue:t.default||t.defaultValue||void 0,expressionValue:t.expressionValue||void 0,content:t.content,buttonType:t.buttonType,textboxType:t.textboxType},0<Object.keys(i).length?i:void 0);return n.textboxType&&(a.textboxType=n.textboxType,"email"===n.textboxType?i.pattern||(i.regex="^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",i.validationMessage="Please enter a valid email address"):"url"!==n.textboxType||i.pattern||(i.regex="^(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",i.validationMessage="Please enter a valid URL")),"date"===n.type&&void 0!==a.defaultValue&&null!==a.defaultValue&&(e=this.formatDateTimeValue(a.defaultValue))&&(a.defaultValue=e),"splitButton"!==n.type&&"dropdown"!==n.type&&"multiselect"!==n.type&&"radio"!==n.type||!t.enum&&!t.options||(a.options=t.enum||t.options),a},p.prototype.parseDateFromValue=function(e){if(null!=e){if("number"==typeof e)return e<1e12?new Date(1e3*e):new Date(e);if("string"==typeof e){var e=e.trim(),t=new Date(e);if(!isNaN(t.getTime()))return t;t=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0));t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2})(?:[:](\d{2}))?)?/);if(t)return new Date(Number(t[3]),Number(t[1])-1,Number(t[2]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0))}}return null},p.prototype.formatDate=function(e){var t=e.getMonth()+1,n=e.getDate();return(t<10?"0"+t:String(t))+"/"+(n<10?"0"+n:String(n))+"/"+e.getFullYear()},p.prototype.formatDateTimeValue=function(e){var t,n=this.parseDateFromValue(e);if(n)return t=this.formatDate(n),0!==n.getHours()||0!==n.getMinutes()||/\dT\d{2}:\d{2}/.test(String(e))?""+t:t},p.prototype.mapJsonSchemaType=function(e){var t,n,a=e.type;return"string"===a?(t=(e.format||"").toString().toLowerCase(),n=((e.title||e.label||"")+" "+(e.description||"")).toLowerCase(),/email|mail|e-?mail/.test(t)||/email|mail|e-?mail/.test(n)?{type:"textbox",textboxType:"email"}:/uri|url|link|website/.test(t)||/uri|url|link|website/.test(n)?{type:"textbox",textboxType:"url"}:/phone|tel|mobile|cell|msisdn/.test(t)||/phone|tel|mobile|cell|msisdn/.test(n)?{type:"textbox",textboxType:"number"}:/password|pwd|pass|security|secret|key/.test(t)||/password|pwd|pass|security|secret|key/.test(n)?{type:"textbox",textboxType:"password"}:"date"===t||"date-time"===t||/date|birthday|dob/.test(n)?{type:"date"}:e.enum||e.options?{type:"dropdown"}:{type:this.config.defaultTextType}):"number"===a||"integer"===a?{type:"number"}:"boolean"===a?{type:"checkbox"}:"array"===a?{type:"multiselect"}:"message"===a?{type:"message"}:"button"===a?{type:"button"}:"signature"===a||"sign"===a?{type:"signature"}:"image"===a||"imageEditor"===a?{type:"imageEditor"}:"file"===a||"fileUpload"===a?{type:"fileUpload"}:"color"===a||"colorPicker"===a?{type:"colorPicker"}:"splitButton"===a?{type:"splitButton"}:{type:this.config.defaultTextType}},p.prototype.generateComponentId=function(e){return this.config.generateIds?e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random()):""},p.prototype.humanizeFieldName=function(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2")},p);function p(e){this.config=u({},De,e)}var Oe=function(e){try{return JSON.parse(e),{valid:!0}}catch(e){return{valid:!1,errors:["Invalid JSON syntax: "+e.message]}}},Ve=function(e){var t,r,n=[],a=[];return e.components?Array.isArray(e.components)||n.push('Property "components" must be an array'):n.push("Missing required property: components"),Array.isArray(e.components)&&(t=new Set,r=function(e,i){void 0===i&&(i="root"),e.id?(t.has(e.id)&&n.push("Duplicate component ID found: "+e.id),t.add(e.id)):n.push("Component at "+i+' is missing "id" property'),e.type||n.push('Component "'+(e.id||"unknown")+'" is missing "type" property'),e.children&&Array.isArray(e.children)&&e.children.forEach(function(e,t){r(e,i+".children["+t+"]")}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e,n){e.content&&Array.isArray(e.content)&&e.content.forEach(function(e,t){r(e,i+".tabItems["+n+"].content["+t+"]")})}),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e,a){Array.isArray(e)&&e.forEach(function(e,n){Array.isArray(e)&&e.forEach(function(e,t){r(e,i+".tableCells["+a+"]["+n+"]["+t+"]")})})})},e.components.forEach(function(e,t){r(e,"components["+t+"]")})),{valid:0===n.length,errors:0<n.length?n:void 0,warnings:0<a.length?a:void 0}},Fe=function(e){function n(e){var t=u({},e,{_configured:!0});return e.children&&Array.isArray(e.children)&&(t.children=e.children.map(n)),e.tabItems&&Array.isArray(e.tabItems)&&(t.tabItems=e.tabItems.map(function(e){return u({},e,{content:e.content?e.content.map(n):[]})})),e.tableCells&&Array.isArray(e.tableCells)&&(t.tableCells=e.tableCells.map(function(e){return e.map(function(e){return Array.isArray(e)?e.map(n):[]})})),t}e={version:e.version||"0.1.0",components:e.components||[]};return e.components=e.components.map(n),e},Re=["id","type","name","label","conditions","customValidation","customvalidation","_configured","widget","templateId","kind","as","visibility","options","tableCells","tabItems","children","templateData","ref"],ke=["created","destroyed","appendTo","appendToElement","append","render","addEventListener","removeEventListener","getModuleName","inject","dataBind","refresh","onPropertyChanged"];function Ne(e,t){for(var n=e||{},a={},i=0;i<t.length;i++)a[t[i]]=!0;for(var r=0;r<Re.length;r++)a[Re[r]]=!0;for(var o=0;o<ke.length;o++)a[ke[o]]=!0;var s,l=[];for(s in n)Object.prototype.hasOwnProperty.call(n,s)&&!a[s]&&"__proto__"!==s&&"constructor"!==s&&l.push(s);l.sort();for(var d={},c=0;c<l.length;c++){var u=l[c];d[u]=n[u]}return d}function Le(t,e){if(!t||!e)return 0;for(var n=Object.keys(e),a=0,i=0;i<n.length;i++){var r=n[i];try{t[r]=e[r],a++}catch(e){var o=t&&t.constructor&&t.constructor.name||"<unknown>";console.warn('[form-renderer] cannot forward schema property "'+r+'" to control of type '+o+":",e)}}return a}function K(e,t,n,a){var i=Ne(t,n);if(a&&a.length){for(var r=0;r<a.length;r++){var o=a[r];i[o.key]=o.value}var s={};return Object.keys(i).sort().forEach(function(e){s[e]=i[e]}),Le(e,s)}return Le(e,i)}m.prototype.resolveHtml=function(e){try{return this.enableHtmlSanitizer?_.SanitizeHtmlHelper.sanitize(e):e}catch(e){return""}},m.prototype.render=function(){var e=document.createElement("div");return this.id&&(e.id=this.id),e.innerHTML=this.resolveHtml(this.content),this.el=e},m.prototype.update=function(e){this.content=e,this.el&&(this.el.innerHTML=this.resolveHtml(this.content))},m.prototype.getElement=function(){return this.el},m.prototype.destroy=function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,this.content="",this.enableHtmlSanitizer=!1,this.id=void 0};var Me=m;function m(e){this.content=e.content,this.id=e.id,this.enableHtmlSanitizer=!!_.isNullOrUndefined(e.enableHtmlSanitizer)||e.enableHtmlSanitizer,this.el=e.target||null}function Z(e,t){e&&t&&e.setAttribute("id",t)}function je(r){function e(t){var e=o.validateOn||"Change",n={};return e&&"Change"!==e||(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),"Blur"===e&&(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),n}var t,o=r.component,s=r.value,l=r.onChange,a=r.onBlur,d=r.onClick,n=void 0!==(n=r.hasError)&&n,c=r.locale,i=r.formState,u=r.settings,p=r.components,h=r.enableRtl,m=r.ref,M=r.l10n,j=r.initializedGrids||new Set,f=r.target,y={floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled},g=(t=o.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{},P=(o.required&&(g["aria-required"]="true"),n?"e-error":""),v=((o.cssClass||"")+" "+P+" "+("Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"")).trim();switch(o.type){case"textbox":var b=new z.TextBox(Q({id:o.name,type:o.multiline?"hidden":o.textboxType||"text",name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",multiline:o.multiline,showClearButton:o.showClearButton,autocomplete:!1===o.autocomplete||void 0===o.autocomplete?"off":"on",readonly:o.readOnly||!1,cssClass:v,htmlAttributes:g,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),K(b,o,["name","multiline","textboxType","defaultValue","showClearButton","autocomplete","readOnly","cssClass","suffix","prefix","floatLabelType","placeholder","disabled"]),m(b),b;case"textarea":b=new z.TextArea(Q({id:o.name,name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",cols:o.cols||200,rows:o.textareaRows||4,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,maxLength:o.maxLength||255,cssClass:v,htmlAttributes:g,appendTemplate:o.suffix,prependTemplate:o.prefix,resizeMode:"Vertical"},e(function(e){return e.value||""})));return f&&b.appendTo(f),K(b,o,["name","defaultValue","cols","textareaRows","showClearButton","readOnly","maxLength","cssClass","suffix","prefix","floatLabelType","placeholder","disabled"]),m(b),b;case"number":b=""===s?void 0:s,b=new z.NumericTextBox({locale:c,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==b?b:o.defaultValue||void 0,decimals:o.decimals||2,currency:o.currency,format:o.numberFormat||"n2",step:o.step||1,min:o.minValue||void 0,max:o.maxValue||void 0,readonly:o.readOnly||!1,showClearButton:o.showClearButton||!1,cssClass:v,htmlAttributes:g,appendTemplate:o.suffix,prependTemplate:o.prefix,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),b.appendTo(f)),K(b,o,["name","defaultValue","decimals","currency","numberFormat","step","minValue","maxValue","readOnly","showClearButton","cssClass","suffix","prefix","floatLabelType","placeholder","disabled"]),m(b),b;case"checkbox":b=o.label&&o.required?o.label+" *":o.label,b=new q.CheckBox({locale:c,name:o.id,enableRtl:h,label:b,labelPosition:o.checkboxLabelPosition,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,indeterminate:o.indeterminate||!1,disabled:o.disabled,cssClass:v,htmlAttributes:g,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),K(b,o,["name","checked","indeterminate","checkboxLabelPosition","cssClass"]),m(b),b;case"checkboxGroup":var x=[],b=(ye.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(x.push.apply(x,e.options),C.setOptions(x))}).catch(function(){}),J(o.options,x)),b=0<b.length?b:o.options||["Option 1"],C=new ve({component:Q({},o,{options:b}),formState:i,value:s,enableRtl:h,onChange:function(e){return l(e)},optionRef:r.ref,target:f,ref:m});return f&&Z(f,o.name),K(C,o,["options","enableRtl","disabled","readOnly","required","checkboxLabelPosition","layoutDirection","gap","size","cssClass","htmlAttributes"]),C.render(f),C;case"radio":var b=Array.isArray(o.options)?o.options:["Option 1"],B=_.createElement("div",{id:o.name+"-group",className:"e-radio-group "+P}),U=[];return b.forEach(function(e,t){var n=e,a=_.createElement("div"),i=(B.appendChild(a),_.createElement("input",{id:o.name+"_"+t+"_"+n,attrs:{type:"radio"}})),a=(a.appendChild(i),new q.RadioButton({name:o.id,label:e,enableRtl:h,locale:c,disabled:o.disabled,value:n,htmlAttributes:g,labelPosition:o.fieldLabelPosition,checked:o.defaultValue===n||s===n,cssClass:v,change:function(e){e.value===n&&l(n)}}));a.appendTo(i),m(a,t),r.ref&&"function"==typeof r.ref&&r.ref(a,t),U.push(a),K(a,o,["name","options","disabled","defaultValue","fieldLabelPosition","cssClass","htmlAttributes"])}),f&&f.appendChild(B),U;case"dropdown":var w=[],b=(ye.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(w.push.apply(w,e.options),S.dataSource=w)}).catch(function(){}),J(o.options,w)),b=0<b.length?b:o.options||["Option 1"],S=(o.conditions&&o.conditions.choiceBasedField&&0<(b=Y.getChoiceBasedOptions(o.conditions.choiceBasedField,b,i?i.values:void 0,o.conditions.choiceBasedField.primaryFieldId)).length&&null!=s&&-1===b.indexOf(s)&&i&&(i.values[o.id]=null),new H.DropDownList(Q({id:o.name,name:o.id,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:c,enableRtl:h,cssClass:v,dataSource:b,value:void 0!==i.values[o.id]?i.values[o.id]:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",htmlAttributes:g},e(function(e){return e.value||""}))));return H.DropDownList.Inject(H.VirtualScroll),f&&S.appendTo(f),K(S,o,["name","defaultValue","showClearButton","readOnly","enableVirtualization","popupHeight","popupWidth","cssClass","htmlAttributes","floatLabelType","placeholder","disabled","fields","groupBy"]),m(S),S;case"multiselect":var E=[],b=(ye.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(E.push.apply(E,e.options),T.dataSource=E)}).catch(function(){}),J(o.options,E)),b=0<b.length?b:o.options||["Option 1"],T=new H.MultiSelect(Q({name:o.id,enableRtl:h,locale:c,floatLabelType:y.floatLabelType,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,placeholder:o.placeholder,dataSource:b,fields:{text:"text",value:"value"},showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,allowCustomValue:o.allowCustomValue||!1,addTagOnBlur:o.addTagOnBlur||!1,delimiterChar:o.delimiterChar||",",showSelectAll:o.showSelectAll||!1,mode:o.showSelectAll?"CheckBox":o.visualMode||void 0,selectAllText:o.selectAllText,unSelectAllText:o.unSelectAllText,showDropDownIcon:!1!==o.showDropDownIcon,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",cssClass:v,htmlAttributes:g},e(function(e){return e.value||""})));return H.MultiSelect.Inject(H.CheckBoxSelection,H.VirtualScroll),f&&T.appendTo(f),K(T,o,["name","defaultValue","placeholder","showClearButton","readOnly","allowCustomValue","addTagOnBlur","delimiterChar","showSelectAll","visualMode","selectAllText","unSelectAllText","showDropDownIcon","enableVirtualization","popupHeight","popupWidth","cssClass","htmlAttributes","floatLabelType","disabled"]),m(T),T;case"date":b=new G.DatePicker(Q({floatLabelType:y.floatLabelType,id:o.name,name:o.id,enableRtl:h,locale:c,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy",readOnly:o.readOnly||!1,showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,calendarMode:o.calendarMode||"Gregorian",dayHeaderFormat:o.dayHeaderFormat||"Short",depth:o.depth||"Month",start:o.start||"Month",firstDayOfWeek:o.firstDayOfWeek||0,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,cssClass:v,htmlAttributes:g},e(function(e){return e.value||""})));return G.DatePicker.Inject(G.Islamic),f&&b.appendTo(f),K(b,o,["name","defaultValue","format","readOnly","showClearButton","showTodayButton","calendarMode","dayHeaderFormat","depth","start","firstDayOfWeek","minDate","maxDate","cssClass","htmlAttributes","floatLabelType","placeholder","disabled"]),m(b),b;case"dateTime":b=new G.DateTimePicker(Q({id:o.name,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:c,enableRtl:h,name:o.id,dayHeaderFormat:o.dayHeaderFormat||"Short",value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,depth:o.depth||"Month",start:o.start||"Month",step:o.step||1,readonly:o.readOnly||!1,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,minTime:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,maxTime:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:v,htmlAttributes:g},e(function(e){return e.value||""})));return G.DateTimePicker.Inject(G.Islamic),f&&b.appendTo(f),K(b,o,["name","defaultValue","format","showClearButton","showTodayButton","dayHeaderFormat","depth","start","step","minDate","maxDate","minTime","maxTime","readOnly","cssClass","htmlAttributes","floatLabelType","placeholder","disabled"]),m(b),b;case"time":b=new G.TimePicker(Q({id:o.name,locale:c,name:o.id,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,step:o.step||30,readonly:o.readOnly||!1,min:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,max:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:v,htmlAttributes:g},e(function(e){return e.value||""})));return f&&b.appendTo(f),K(b,o,["name","defaultValue","format","showClearButton","step","minTime","maxTime","readOnly","cssClass","htmlAttributes","floatLabelType","placeholder","disabled"]),m(b),b;case"dateRange":b=new G.DateRangePicker(Q({id:o.name,locale:c,enableRtl:h,name:o.id,floatLabelType:y.floatLabelType,dayHeaderFormat:o.dayHeaderFormat||"Short",placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,depth:o.depth||"Month",start:o.start||"Month",min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,format:o.format||"MM/dd/yyyy",separator:o.separator||" - ",showClearButton:void 0!==o.showClearButton&&o.showClearButton,readonly:o.readOnly||!1,cssClass:v,htmlAttributes:g},e(function(e){return e.value||""})));return f&&b.appendTo(f),K(b,o,["name","defaultValue","format","separator","showClearButton","minDate","maxDate","readOnly","dayHeaderFormat","depth","start","cssClass","htmlAttributes","floatLabelType","placeholder","disabled"]),m(b),b;case"switch":b=new q.Switch({locale:c,enableRtl:h,value:o.defaultValue,name:o.id,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,disabled:o.disabled,onLabel:o.onLabel||"",offLabel:o.offLabel||"",cssClass:v,htmlAttributes:g,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),K(b,o,["name","defaultValue","checked","onLabel","offLabel","cssClass","htmlAttributes"]),m(b),b;case"button":b=o.buttonsGroups||o.buttons||[];if(b&&0<b.length){var A={display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.gap||"8px",justifyContent:re(o.position),width:o.width||void 0,maxWidth:"100%"},D=_.createElement("div",{id:o.name,attrs:{role:"group","aria-label":o.label||"Button Group",className:v+" "+(h?"e-rtl":"")}}),I=(Object.assign(D.style,A),[]);b.forEach(function(e,t){var n=o.name+"_"+t,a=[ae(e.style)].filter(Boolean).join(" "),i=(a+="Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"",ie(e.type)),n=_.createElement("button",{id:String(n),attrs:{name:String(n),type:i}}),i=(D.appendChild(n),new q.Button({locale:c,enableRtl:h,cssClass:a,disabled:e.disabled||!1,content:e.label||"Button "+(t+1),iconCss:e.iconCss,iconPosition:e.iconPosition}));i.appendTo(n),i.element.onclick=function(e){d&&d(e)},m(i,t),I.push(i),r.ref&&"function"==typeof r.ref&&r.ref(i,t)}),f&&f.appendChild(D);for(var O=0;O<I.length;O++)K(I[O],o,["buttonsGroups","gap","position","size","cssClass"]);return I}var A=ie(o.buttonType),b=[ae(o.style),"submit"===A?"submit-btn form-submit-type":"","reset"===A?"form-reset-type":"",o.cssClass||"e-primary","Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":""].filter(Boolean).join(" ")||"e-primary",V={display:"flex",justifyContent:re(o.position),width:o.width||"100%"},F=_.createElement("div",{id:o.name+"-container"}),V=(Object.assign(F.style,V),_.createElement("button",{id:o.name,attrs:{type:A}})),A=(F.appendChild(V),new q.Button({enableRtl:h,locale:c,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition,content:o.label}));return A.appendTo(V),m(A),A.element.onclick=function(e){d&&d(e)},f&&f.appendChild(F),K(A,o,["buttonType","style","iconCss","iconPosition","cssClass","position","size","disabled"]),A;case"splitButton":b=["primary"===o.style?"e-primary":"",(o.style,""),"information"===o.style?"e-info":"","error"===o.style?"e-danger":"","success"===o.style?"e-success":"","warning"===o.style?"e-warning":"",o.cssClass||"","Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":""].filter(Boolean).join(" ")||void 0,V={display:"flex",justifyContent:re(o.position)},F=_.createElement("div",{id:o.name+"-container",attrs:{"aria-label":"Splitbutton"}}),A=(Object.assign(F.style,V),o.options&&0<o.options.length?o.options.map(function(e,t){return{text:e,id:o.id+"_option_"+t}}):[{text:"Option 1",id:o.id+"_option_0"}]),V=_.createElement("button",{id:o.name}),A=(F.appendChild(V),new X.SplitButton({locale:c,enableRtl:h,content:o.label||"Split Button",items:A,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition||"Left",click:function(e){d&&d(Q({},e))},select:function(e){d&&d(Q({},e,{selectedItem:e.item.text}))}}));return A.appendTo(V),f&&f.appendChild(F),K(A,o,["options","style","iconCss","iconPosition","cssClass","position","disabled"]),m(A),A;case"signature":b=_.createElement("canvas",{id:o.name,className:v}),V=new z.Signature({enableRtl:h,locale:c,backgroundColor:o.backgroundColor||"",strokeColor:o.strokeColor||"",maxStrokeWidth:o.maxValue,minStrokeWidth:o.minValue,velocity:o.velocity,disabled:o.disabled,change:function(){return l(o.name)}});return f&&(V.appendTo(b),f.appendChild(b)),K(V,o,["backgroundColor","strokeColor","maxValue","minValue","velocity"]),m(V),V;case"rating":F=new z.Rating({enableRtl:h,locale:c,value:void 0!==s?s:o.defaultValue||0,disabled:o.disabled,cssClass:v,allowReset:o.allowReset,itemsCount:o.itemsCount,min:o.minValue,precision:o.precision,readOnly:o.readOnly,showTooltip:o.showRatingTooltip||!1,showLabel:o.showRatingLabel,labelPosition:o.showRatingLabel?o.ratingLabelPosition:void 0,valueChanged:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),F.appendTo(f)),K(F,o,["defaultValue","allowReset","itemsCount","minValue","precision","readOnly","showRatingTooltip","showRatingLabel","ratingLabelPosition","cssClass","labelPosition"]),m(F),F;case"colorPicker":A=new z.ColorPicker({enableRtl:h,locale:c,value:void 0!==s?s:o.defaultValue||"",disabled:o.disabled,enableOpacity:o.enableOpacity,showButtons:o.showButtons,showRecentColors:o.showRecentColors,noColor:o.showNoColor,cssClass:v,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),A.appendTo(f)),K(A,o,["defaultValue","enableOpacity","showButtons","showRecentColors","showNoColor","cssClass"]),m(A),A;case"inputMask":b=new z.MaskedTextBox(Q({id:o.name,name:o.id,enableRtl:h,floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled,locale:c,value:void 0!==s?s:o.defaultValue||"",mask:o.mask||"000-000-0000",promptChar:o.promptChar||"_",customCharacters:o.customCharacters,readOnly:o.readOnly||!1,showClearButton:!1!==o.showClearButton,cssClass:v,htmlAttributes:g,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),K(b,o,["name","defaultValue","mask","promptChar","customCharacters","readOnly","showClearButton","cssClass","htmlAttributes","suffix","prefix","floatLabelType","placeholder","disabled"]),m(b),b;case"rangeSlider":V=new z.Slider({enableRtl:h,locale:c,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:0,min:o.minValue||0,max:o.maxValue||100,step:o.step||1,cssClass:v,enabled:!o.disabled,readonly:o.readOnly,showButtons:o.showButtons,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),V.appendTo(f)),K(V,o,["defaultValue","minValue","maxValue","step","cssClass","readOnly","showButtons"]),m(V),V;case"fileUpload":F=new z.Uploader({enableRtl:h,locale:c,type:"file",enabled:!o.disabled,allowedExtensions:o.allowExtensions,asyncSettings:{saveUrl:o.saveUrl,removeUrl:o.removeUrl},buttons:o.buttons||{browse:"Choose File",clear:"Clear All",upload:"Upload All"},maxFileSize:o.maxValue,minFileSize:o.minValue,multiple:!!o.allowMultiple,showFileList:o.showFileList,htmlAttributes:g,cssClass:v,change:function(e){return l(e.file)}});return f&&(Z(f,o.name),F.appendTo(f)),K(F,o,["allowExtensions","saveUrl","removeUrl","buttons","maxValue","minValue","allowMultiple","showFileList","htmlAttributes","cssClass"]),m(F),F;case"imageEditor":A=new te.ImageEditor({locale:c,enableRtl:h,disabled:o.disabled,cssClass:v,height:(null!=o.height?o.height:"350px").toString(),width:(null!=o.width?o.width:"100%").toString(),editComplete:function(){return l(o.name)},fileOpened:function(){return l(o.name)}});return f&&(Z(f,o.name),A.appendTo(f)),K(A,o,["height","width","cssClass"]),m(A),A;case"message":var R=new ee.Message({locale:c,enableRtl:h,severity:o.severity||o.messageType||"info",variant:o.variant,content:o.content||"Message",showCloseIcon:o.showCloseIcon,showIcon:void 0!==o.showIcon&&o.showIcon||!1,cssClass:v});return f&&(Z(f,o.name),R.appendTo(f)),K(R,o,["severity","messageType","variant","content","showCloseIcon","showIcon","cssClass"]),m(R),R;case"dataGrid":var k=o,b=me(k.conditions,i&&i.values||{}),N=b?b.dataSource:void 0,V=b?b.columns:void 0,F=(N||k.dataSource,[]),W=(ye.fetch(N||k.dataSource,k.id,i&&i.values,p).then(function(e){e.id===k.id&&0<e.options.length&&(e=J(N||k.dataSource,e.options,W),L.setDataSource(e))}),[]),A=J(N||k.dataSource,F,W),b=0<A.length?A:void 0!==k.dataSource&&null!==k.dataSource?k.dataSource:[],F=V&&0<V.length?V:void 0!==k.columns&&null!==k.columns?k.columns:[],A=f||_.createElement("div",{id:k.name,className:k.cssClass}),L=(f&&Z(f,o.name),new Te({locale:c,name:k.name||"",columns:F,enableRtl:h,dataSource:void 0!==b&&0<b.length?b:s,height:null!=k.height?k.height:"200px",width:null!=k.width?k.width:"100%",pageSize:k.pageSize||6,allowPaging:!1!==k.allowPaging,allowFiltering:k.allowFiltering,allowAdding:!1!==k.allowAdding,allowEditing:!1!==k.allowEditing,allowDeleting:!1!==k.allowDeleting,onDataChange:function(e){return l(e)},cssClass:v,target:A,ref:m}));return L.render(A),!j.has(o.id)&&i&&Array.isArray(b)&&(i.values[o.id]=b,L.isInitialized=!0,j.add(o.id)),K(L,o,["dataSource","columns","conditions","height","width","pageSize","allowPaging","allowFiltering","allowAdding","allowEditing","allowDeleting","cssClass"]),"function"==typeof r.ref?r.ref(L):r.ref&&(r.ref.current=L),f||A;case"richTextEditor":V={items:["Undo","Redo","|","Bold","Italic","Underline","StrikeThrough","InlineCode","|","CreateLink","Image","CreateTable","CodeBlock","HorizontalLine","Blockquote","EmojiPicker","|","LineHeight","Formats","Alignments","|","BulletFormatList","NumberFormatList","Checklist","|","Outdent","Indent","|","FontColor","BackgroundColor","FontName","FontSize","|","LowerCase","UpperCase","SuperScript","SubScript","|","SourceCode","|"]},F=(o.enableImportFromWord&&o.enableImportFromWord.enabled&&V.items.push("ImportWord"),o.enableExportToWord&&o.enableExportToWord.enabled&&V.items.push("ExportWord"),o.enableExportToPdf&&o.enableExportToPdf.enabled&&V.items.push("ExportPdf"),V.items.push("Print"),function(e){return!!e&&e.enabled&&"string"==typeof e.serviceUrl&&""!==e.serviceUrl.trim()}),b=F(o.enableImportFromWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"")?o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"").replace(/^\/+/,"")}:void 0,A=F(o.enableExportToWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToWord?o.enableExportToWord.serviceUrl:"")?o.enableExportToWord?o.enableExportToWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToWord?o.enableExportToWord.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.docx",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,F=F(o.enableExportToPdf)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"")?o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.pdf",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,V=new $.RichTextEditor({locale:c,toolbarSettings:V,enableRtl:h,value:void 0!==s?s:o.defaultValue||"",placeholder:o.placeholder||"",enabled:!o.disabled,readonly:o.readOnly||!1,maxLength:o.maxLength||void 0,cssClass:v||void 0,height:o.height||"300px",width:o.width||"100%",htmlAttributes:g,importWord:b,exportPdf:F,exportWord:A,change:function(e){return l(e.value)}});return $.RichTextEditor.Inject($.Toolbar,$.Link,$.HtmlEditor,$.QuickToolbar,$.Image,$.Count,$.Table,$.EmojiPicker,$.PasteCleanup,$.SlashMenu,$.CodeBlock,$.ClipBoardCleanup,$.AutoFormat,$.ImportExport),V.appendTo(f),K(V,o,["enableImportFromWord","enableExportToWord","enableExportToPdf","defaultValue","placeholder","readOnly","maxLength","cssClass","height","width","htmlAttributes","toolbarSettings"]),m(V),V;default:R=new ee.Message({locale:c,enableRtl:h,severity:"Warning",content:M.getConstant("unsupportedComponent")+" : "+o.type,cssClass:v});return f&&(Z(f,o.name),R.appendTo(f)),m(R),R}}var Q=function(){return(Q=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Pe(e,t){if(t&&0!==t.length){var n=e.name;if("string"==typeof n&&0<n.length)for(var a=0,i=t;a<i.length;a++){var r=(h=i[a]).fieldName;if("string"==typeof r&&0<r.length&&r===n)return{entry:h,matchKind:"fieldName"}}var o=e.templateId;if("string"==typeof o&&0<o.length)for(var s=0,l=t;s<l.length;s++){var d=(h=l[s]).templateId;if("string"==typeof d&&0<d.length&&d===o)return{entry:h,matchKind:"templateId"}}var c=e.type;if("string"==typeof c&&0<c.length)for(var u=0,p=t;u<p.length;u++){var h,m=(h=p[u]).type;if("string"==typeof m&&0<m.length&&m===c)return{entry:h,matchKind:"type"}}}return null}Be=function(e,t){return(Be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var Be,Ue,We=function(e,t){function n(){this.constructor=e}Be(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},V=function(){return(V=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},f=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;0<=s;s--)(i=e[s])&&(o=(r<3?i(o):3<r?i(t,n,o):i(t,n))||o);return 3<r&&o&&Object.defineProperty(t,n,o),o},_e=["textbox","number","checkbox","dropdown","multiselect","date","dateTime","time","dateRange","switch","rating","colorPicker","inputMask","fileUpload"],ze={unsupportedComponent:"Unsupported Component type"},qe=(Ue=_.ChildProperty,We(v,Ue),f([_.Property(null)],v.prototype,"template",void 0),f([_.Property("")],v.prototype,"type",void 0),f([_.Property("")],v.prototype,"templateId",void 0),f([_.Property("")],v.prototype,"fieldName",void 0),v);function v(){return null!==Ue&&Ue.apply(this,arguments)||this}He=_.Component,We(b,He),(D=b).prototype.getModuleName=function(){return"form-renderer"},b.prototype.getPersistData=function(){return this.addOnPersist(["formState",JSON.stringify(this.formState)])},b.prototype.preRender=function(){_.enableRipple(!0),this.createdFired=!1,this.expressionEngine=new W},b.prototype.render=function(){var n=this;if(this.clearEngineCaches(),this.removePreviousRoot(),this.normalizeSchema(),this.element.classList.add("form-renderer-container"),this.className&&_.addClass([this.element],this.className.replace(/\s+/g," ").trim().split(" ")),this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl"),this.hasLayoutComponentsCache=this.computeHasLayoutComponents(),this.idToLabelCache=this.computeIdToLabel(),this.initialValuesCache=this.buildInitialValues(),this.buildValidationRulesAndBridge(),this.isInitialized||(this.isInitialized=!0),this.isReact&&this.portals&&this.renderReactTemplates(),this.formState&&this.initialValuesCache)for(var e=0,t=Object.keys(this.initialValuesCache);e<t.length;e++){var a=t[e],i=this.initialValuesCache[a];this.formState.values[a]||(this.formState.values[a]=i)}this.currentFormValues=V({},this.formState?this.formState.values:{}),this.initExpressionEngine(),this.buildConditionalDependencyMap();var r=_.createElement("form",{className:"form-renderer "+this.layoutClass,attrs:{role:"region","aria-label":this.processedSchemaCache.settings&&this.processedSchemaCache.settings.name||"Form"}});this.element.appendChild(r),this.inputRefs={},(this.processedSchemaCache.components||[]).forEach(function(e){var t=n.renderComponent(e);t&&(r.appendChild(t),n.refreshRenderedComponent(e,t))}),this.created&&!this.createdFired&&setTimeout(function(){0<Object.keys(n.inputRefs).length&&(n.createdFired=!0,n.trigger("created",{}))},0)},b.prototype.refreshRenderedComponent=function(e,t){var n,a=this,i=t,i="tabs"===e.type?t.querySelector("#"+e.id+".e-control.e-tab")||t:t.querySelector('[data-field-id="'+e.id+'"]')||t;"richTextEditor"===e.type?(n=(n=i.querySelector(".e-richtexteditor"))?_.getComponent(n,"richtexteditor"):null)&&n.refreshUI():"dataGrid"===e.type?(n=(n=i.querySelector(".e-control.e-toolbar"))?_.getComponent(n,"toolbar"):null)&&n.refresh():"imageEditor"===e.type?(n=(n=i.querySelector(".e-control.e-image-editor"))?_.getComponent(n,"image-editor"):null)&&n.refresh():"tabs"===e.type&&(n=_.getComponent(i,"tab"))&&n.refreshOverflow(),e.children&&e.children.forEach(function(e){return a.refreshRenderedComponent(e,t)}),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(function(e){return e.forEach(function(e){return a.refreshRenderedComponent(e,t)})})}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&e.content.forEach(function(e){return a.refreshRenderedComponent(e,t)})})},b.prototype.normalizeSchema=function(){var e=this.schema;try{if(e){var t,n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){return this.failure&&this.trigger("failure",{error:e}),void(this.processedSchemaCache={version:"1.0.0",components:[]})}n&&"object"==typeof n&&n.properties&&Array.isArray(n.layout)?this.processedSchemaCache=L(n,this.dataModel||void 0):(t=(new Ie).parse("string"==typeof e?e:JSON.stringify(e))).success&&t.schema?this.processedSchemaCache=t.schema:(this.failure&&this.trigger("failure",{error:t.errors}),this.processedSchemaCache={version:"1.0.0",components:[]})}else this.processedSchemaCache={version:"1.0.0",components:[]}}catch(e){this.failure&&this.trigger("failure",{error:e}),this.processedSchemaCache={version:"1.0.0",components:[]}}},b.prototype.computeHasLayoutComponents=function(){var p;return!!this.processedSchemaCache.components&&(p=function(e){for(var t=0,n=e;t<n.length;t++){var a=n[t];if(-1!==["table","tabs","panel","card"].indexOf(a.type))return!0;if(a.children&&p(a.children))return!0;if(a.tableCells)for(var i=0,r=a.tableCells;i<r.length;i++)for(var o=0,s=r[i];o<s.length;o++){var l=s[o];if(p(l))return!0}if(a.tabItems)for(var d=0,c=a.tabItems;d<c.length;d++){var u=c[d];if(u.content&&p(u.content))return!0}}return!1})(this.processedSchemaCache.components)},Object.defineProperty(b.prototype,"layoutClass",{get:function(){if(this.hasLayoutComponentsCache)return"";switch(this.layout){case"TwoColumn":return"twolayout";case"ThreeColumn":return"threelayout";case"FourColumn":return"fourlayout";default:return""}},enumerable:!0,configurable:!0}),b.prototype.collectAllComponents=function(e){function t(e){e.forEach(function(e){n.push(e),e.children&&0<e.children.length&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n=[];return t(e),n},b.prototype.getDataModelByName=function(){var n=this,a={},e=this.collectAllComponents(this.processedSchemaCache.components),i={};return e.forEach(function(e){i[e.id]=e}),Object.keys(this.formState.values).forEach(function(e){var t=i[e];t&&t.name&&(a[t.name]=n.formState.values[e])}),a},b.prototype.computeIdToLabel=function(){function t(e){e.forEach(function(e){e.label&&-1===["panel","table","tabs","card","button","message","splitButton"].indexOf(e.type)&&(e.name?n[e.id]=e.name:e.label&&(n[e.id]=e.label)),e.children&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n={};return t(this.processedSchemaCache.components),n},b.prototype.buildValidationRulesAndBridge=function(){function s(e,o){void 0===o&&(o=!0),e.forEach(function(p){var e,t,n,h,a,i,r,m;p&&(e={},t=o&&!1!==p.visible&&Y.isFieldVisible(p.conditions,c),n=o&&Y.isFieldHidden(p.conditions,c),t)&&!n&&(a=Y.isFieldRequired(p.conditions,c),i=Y.isFieldDisabled(p.conditions,c),r=Y.isFieldReadOnly(p.conditions,c),h=!!p.required||a,a=!!p.disabled||i,i=!!p.readOnly||r,p.customValidation&&Array.isArray(p.customValidation)&&0<p.customValidation.length&&!a&&!i&&(r=((r=p.customValidation&&p.customValidation[0]&&p.customValidation[0].expression)&&r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)?r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)[1]:void 0)||p.validationMessage||(p.label||p.id)+" is invalid",m=l,e.customValidation=[function(e){var t=e.value;if(!h||""!==t&&null!=t){for(var n={},a=(m.collectAllComponents(m.processedSchemaCache.components).forEach(function(e){e.name&&(n[e.id]=e.name)}),V({},m.currentFormValues||{})),i=0,r=Object.keys(V({},a));i<r.length;i++){var o=r[i],s=a[o],l=n[o];l&&(a[l]=s,delete a[o])}for(var d=0,c=p.customValidation;d<c.length;d++){var u=c[d];if(!m.customValidationEngine)return!0;if(!0!==m.customValidationEngine.validate(u.expression,t,a))return!1}}return!0},r]),!h||a||i||(e.required=[!0,p.validationMessage||p.label+" is required"]),!p.minLength||a||i||(e.minLength=[p.minLength,"Minimum "+p.minLength+" characters allowed"]),!p.maxLength||a||i||(e.maxLength=[p.maxLength,"Maximum "+p.maxLength+" characters allowed"]),"textbox"!==p.type||!p.textboxType||p.regex||e.regex||a||i||("email"===p.textboxType?e.regex=[se.EMAIL,p.validationMessage||"Invalid format"]:"url"===p.textboxType&&(e.regex=[se.URL,p.validationMessage||"Invalid format"])),!p.regex||a||i||(e.regex=[p.regex,p.validationMessage||"Invalid format"]),0<Object.keys(e).length&&(d[p.id]=e),p.children&&s(p.children,t&&!n),p.tableCells&&p.tableCells.forEach(function(e){return e.forEach(function(e){return s(e,t&&!n)})}),p.tabItems)&&p.tabItems.forEach(function(e){e.content&&s(e.content,t&&!n)})})}var l=this,d={},c=this.formState&&this.formState.values||{},n=(s(this.processedSchemaCache.components),this.formState?V({},this.formState.values):V({},this.initialValuesCache));if(this.formState={values:Object.assign(Object.create(null),this.initialValuesCache,n),errors:this.enablePersistence?this.formState.errors:Object.create(null)},n&&Object.keys(n).forEach(function(e){e in l.formState.values||(l.formState.values[e]=n[e])}),this.validator){try{this.validator.refresh(),this.validator.destroy()}catch(e){}this.validator=null}var a=this;this.validator=new z.FormValidator(this.element,{rules:d,locale:this.locale,ignore:"e-hidden",errorClass:"e-error",validClass:"e-valid",errorElement:"div",errorContainer:"div",customPlacement:function(e,t){var n=e.getAttribute("name");if(n){var a=document.getElementById("error-"+n);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(t),a.style.display="block"}else e.parentElement&&e.parentElement.appendChild(t)}else e.parentElement&&e.parentElement.appendChild(t)},validationComplete:function(e){if(a.syncFormStateErrors(),e&&e.inputName){var t=document.getElementById("error-"+e.inputName);if(t)if("success"===e.status){for(;t.firstChild;)t.removeChild(t.firstChild);t.style.display="none"}else"failure"===e.status&&(t.style.display="block")}},submit:function(e){a.validator&&(a.validator.validate()&&a.handleSubmitData(V({},a.formState.values)),e)&&"function"==typeof e.preventDefault&&e.preventDefault()},reset:function(){}}),n&&Object.keys(n).forEach(function(e){var t=l.validator.getInputElement(e);if(t&&void 0!==n[e]&&null!==n[e])try{t.value=String(n[e])}catch(e){}})},b.prototype.syncFormStateErrors=function(){var e={};if(this.validator)for(var t=0,n=this.validator.errorRules||[];t<n.length;t++){var a=n[t];a&&a.name&&(e[a.name]=a.message)}this.formState.errors=e},b.prototype.buildInitialValues=function(){var t=this,n={},e=this.collectAllComponents(this.processedSchemaCache.components),a=new Set;return e.forEach(function(e){if("staticHtml"!==e.type)if("dataGrid"===e.type&&(n[e.id]=Array.isArray(e.dataSource)?e.dataSource:[]),void 0!==e.defaultValue)n[e.id]=e.defaultValue;else switch(e.type){case"checkbox":case"switch":n[e.id]=!1}a.add(e.id)}),this.formState&&Object.keys(this.formState.values).filter(function(e){return!a.has(e)}).forEach(function(e){delete t.formState.values[e]}),n},b.prototype.initExpressionEngine=function(){if(this.processedSchemaCache.components&&0!==this.processedSchemaCache.components.length)try{var e=this.expressionEngine,t=this.collectAllComponents(this.processedSchemaCache.components),n=e.buildDependencyGraph(t),a=(e.detectCircularDependencies(n).length,this.expressionDependencyGraph=n,new Set);t.forEach(function(e){e.expressionValue&&a.add(e.id)}),this.computedFieldNames=a}catch(e){this.failure&&this.trigger("failure",{error:e})}},b.prototype.disposeTooltipInstance=function(e){var t=this.tooltipRefs[e]||null;if(t){try{t.destroy()}catch(e){this.trigger("failure",{error:e})}this.renderedInstances=this.renderedInstances.filter(function(e){return e!==t}),this.tooltipRefs[e]=null}},b.prototype.renderField=function(i){var r=this,o=this.formState,e=o?o.values:{};if(-1!==["panel","table","tabs","card","message","staticHtml"].indexOf(i.type))return null;var t=Y.isFieldReadOnly(i.conditions,e),n=Y.isFieldDisabled(i.conditions,e),a=Y.isFieldRequired(i.conditions,e),s=Y.getConditionalValue(i.conditions,e),t=!!i.readOnly||t,n=!!i.disabled||n,a=!!i.required||a,l=Ae.getConstraints(i.minMaxRange,e,i.type),d=("dateTime"===i.type&&(d=Ae.getConstraints(i.minMaxRange,e,"date"),e=Ae.getConstraints(i.minMaxTimeRange,e,"time"),l={minValue:void 0,maxValue:void 0,minDate:d.minDate,maxDate:d.maxDate,minTime:e.minTime,maxTime:e.maxTime}),i.labelPosition||"top"),e=i.labelWidth||"auto",c=!i.hideLabel&&!!i.label&&-1===["checkbox","button","staticHtml"].indexOf(i.type),u=!(!o||!o.errors[i.id]),p=u&&!(!o||-1===o.errors[i.id].indexOf("required")),u=u&&!(p&&!a),p=void 0!==s,h=this.conditionalValueApplied[i.id]||!1,s=(o&&(p&&!h?(o.values[i.id]=s,this.conditionalValueApplied[i.id]=!0):!p&&h&&(this.conditionalValueApplied[i.id]=!1)),_.createElement("div",{className:"form-group",attrs:{"data-field-id":i.id,"data-fr-field":i.id}})),p=_.createElement("div",{className:"field-wrapper label-"+d.toLowerCase()}),m=(c&&(h=_.createElement("label",{className:"field-label"}),-1===_e.indexOf(i.type)&&"textarea"!==i.type||h.setAttribute("for",_.isNullOrUndefined(this.element.id)?i.name:this.element.id+"-"+i.name),h.style.width="left"===d.toLowerCase()?e+"%":"auto",(S=_.createElement("span")).textContent=i.label,h.appendChild(S),a&&((c=_.createElement("span",{className:"required-asterisk"})).textContent="*",h.appendChild(c)),this.disposeTooltipInstance(i.id),i.tooltip&&((d=_.createElement("span",{className:"e-msg-icon e-icons e-circle-info tooltip-icon",attrs:{"aria-label":i.tooltip,title:i.tooltip,tabindex:"0",role:"button","aria-haspopup":"true"}})).style.cursor="pointer",d.style.display="flex",d.style.alignItems="center",d.style.justifyContent="center",d.style.flexShrink="0",h.appendChild(d),(e=new F.Tooltip({content:i.tooltip,enableRtl:this.enableRtl})).appendTo(d),this.tooltipRefs[i.id]=e,this.renderedInstances.push(e)),p.appendChild(h)),_.createElement("div",{className:"field-input"})),c=("radio"===i.type||"checkboxGroup"===i.type)&&Array.isArray(i.options)?function(e,t){e&&"number"==typeof t&&(r.inputRefs[i.name+"_"+t]=e)}:function(e){e&&(r.inputRefs[i.name]=e)},d=V({},i,{readOnly:t,disabled:n,required:a},void 0!==l.minValue&&{minValue:l.minValue},void 0!==l.maxValue&&{maxValue:l.maxValue},void 0!==l.minDate&&{minDate:l.minDate},void 0!==l.maxDate&&{maxDate:l.maxDate},void 0!==l.minTime&&{minTime:l.minTime},void 0!==l.maxTime&&{maxTime:l.maxTime}),e=-1!==_e.indexOf(i.type)?"input":"textarea"===i.type?"textarea":"div",h=_.createElement(e,{attrs:{"aria-label":i.label+" "+i.type}}),n=("radio"===i.type||"checkboxGroup"===i.type?((t=_.createElement("input")).id=_.isNullOrUndefined(this.element.id)?i.name:this.element.id+"-"+i.name,t.setAttribute("name",i.id),t.style.display="none",t.setAttribute("aria-hidden","true"),h.appendChild(t)):(h.id=_.isNullOrUndefined(this.element.id)?i.name:this.element.id+"-"+i.name,h.setAttribute("name",i.id)),m.appendChild(h),!1),a=Pe(i,this.customWidgetSettings);if(a){l=null;try{l=this.getTemplateFunction(a.entry.template)}catch(e){this.failure&&this.trigger("failure",{error:e}),l=null}if(l)try{h.parentNode&&h.parentNode.removeChild(h);var f=l({fieldData:Object.assign({},i,{id:i.name,name:i.id,type:M(i.type),widget:i.type}),value:o?o.values[i.id]:void 0},this),y=void 0;if(null==f)y=[];else if(Array.isArray(f))y=f;else if("string"==typeof f)y=[f];else if("object"!=typeof f||f.nodeType||"number"!=typeof f.length||"function"!=typeof f.item)y=[f];else{for(var g=[],v=f,b=0;b<v.length;b++)g.push(v[b]);y=g}for(var x=0,C=y;x<C.length;x++){var w=C[x];if(w&&"object"==typeof w&&w.nodeType)m.appendChild(w);else if("string"==typeof w){var S,E=this.sanitizeTemplateValue(w);for((S=_.createElement("span")).innerHTML=E;S.firstChild;)m.appendChild(S.firstChild)}else if(w&&"object"==typeof w)throw new Error('Custom widget template for "'+i.name+'" returned a framework object that the vanilla renderer cannot insert. Use the React/Angular/Vue wrapper (registered templates / portals) for JSX or platform templates.')}c(m),n=!0}catch(e){this.failure&&this.trigger("failure",{error:e}),n=!1}}if(!n){var T=je({component:d,value:o?o.values[i.id]:void 0,onChange:function(e){var t,n,a;"staticHtml"!==i.type&&("signature"===i.type&&(e=r.inputRefs[e].getSignature()),"imageEditor"===i.type&&(t=r.inputRefs[e].getImageData(),(n=document.createElement("canvas")).width=t.width,n.height=t.height,(a=n.getContext("2d"))&&a.putImageData(t,0,0),e=n.toDataURL()),"radio"!==i.type&&"checkboxGroup"!==i.type||(r.validator.getInputElement(i.id).value=e),e=de(i,e),r.formState&&o&&(r.formState.values[i.id]=e,o.values[i.id]=e),r.trigger("change",{fieldName:i.name,label:i.label||i.id,value:e,dataModel:r.getDataModelByName()}),r.afterValueChange(i.id))},formState:o,settings:this.processedSchemaCache.settings,onBlur:function(){if(o&&"staticHtml"!==i.type&&r.validator){try{r.beforeValidate(i.id),r.validator.validate(i.id)}catch(e){}r.syncFormStateErrors()}},ref:c,hasError:u,locale:this.locale,components:this.collectAllComponents(this.processedSchemaCache.components),enableRtl:this.enableRtl,target:h,l10n:this.l10n});if(Array.isArray(T))T.forEach(function(e){if(e&&"function"==typeof e.destroy)r.renderedInstances.push(e);else if(e instanceof HTMLElement)for(var t=0,n=Object.keys(r.inputRefs);t<n.length;t++){var a=n[t],a=r.inputRefs[a],i=a&&(a.element||a.target||a.hostElement&&a.hostElement());i&&(i===e||e.contains(i))&&r.renderedInstances.push(a)}});else if(T)if("function"==typeof T.destroy)this.renderedInstances.push(T);else if(T instanceof HTMLElement)for(var A=0,D=Object.keys(this.inputRefs);A<D.length;A++){var I=D[A],I=this.inputRefs[I],O=I&&(I.element||I.target||I.hostElement&&I.hostElement());O&&(O===T||T.contains(O))&&this.renderedInstances.push(I)}}e=_.createElement("div",{id:"error-"+(i.id||i.name||i.label),className:"e-error-message",attrs:{role:"alert","aria-live":"assertive"}});return e.style.display="none",u&&o&&o.errors[i.id]&&(e.textContent=o.errors[i.id],e.classList.add("e-error"),e.style.display="block"),m.appendChild(e),p.appendChild(m),s.appendChild(p),i.description&&((t=_.createElement("div",{className:"field-description",attrs:{"aria-describedby":"description-"+i.label}})).textContent=i.description,s.appendChild(t)),s},b.prototype.renderComponent=function(s){var l=this,e=this.formState,t=e?e.values:{},n=!1!==s.visible&&Y.isFieldVisible(s.conditions,t),a=Y.isFieldHidden(s.conditions,t);if(!n||a)return e&&void 0!==e.values[s.id]&&null!==e.values[s.id]&&(e.values[s.id]=null),null;if(D.PRESERVABLE_TYPES.has(s.type)&&this.preservedFields.has(s.id)){n=this.preservedFields.get(s.id);if(n)return this.preservedFields.delete(s.id),n}switch(s.type){case"panel":(C=_.createElement("fieldset",{className:"form-panel-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",s.label&&!s.hideLabel&&((y=_.createElement("legend",{className:s.hideBorders?"":"panel-legend"})).textContent=s.label,C.appendChild(y));var i=_.createElement("div",{className:"panel-content"});return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&i.appendChild(e)}),C.appendChild(i),C;case"table":for(var r=s.rows||(s.tableCells?s.tableCells.length:2),d=s.columns||(s.tableCells&&s.tableCells[0]?s.tableCells[0].length:2),c=Math.floor(12/d),u=s.columnWidths,p=u?le(u.widths):[],o=_.createElement("div",{className:"form-table-renderer "+(s.hideBorders?"":"table-border")+" "+(s.cssClass||""),attrs:{role:"group","aria-label":s.label||"Table Layout"}}),h=0;h<r;h++){for(var m=_.createElement("div",{className:"e-form-table-row"}),f=(s.hideBorders&&(m.style.display="flex",m.style.gap="1.5rem"),0);f<d;f++)!function(e){var t=s.tableCells&&s.tableCells[h]&&s.tableCells[h][e]||[],n=c,e=p[e],a=1===d?{width:"100%"}:e?{width:e+"%"}:{},i=!u||Array.isArray(u.widths)&&u.widths.every(function(e){return null===e}),r=0===h,o=_.createElement("div",{className:"e-form-table-cell "+(!e&&i?"col-"+n:"")});s.hideBorders?Object.assign(o.style,a,{padding:r?"0":"12px 0 0 0"}):Object.assign(o.style,a),t.forEach(function(e){e=l.renderComponent(e);e&&o.appendChild(e)}),m.appendChild(o)}(f);o.appendChild(m)}return o;case"tabs":var y=_.createElement("div",{className:"form-tabs-renderer "+(s.cssClass||"")}),g=_.createElement("div",{className:"e-tab"}),v=(g.id=s.id,_.createElement("div",{className:"e-tab-header"})),b=_.createElement("div",{className:"e-content"}),x=(g.appendChild(v),g.appendChild(b),y.appendChild(g),(s.tabItems||[]).forEach(function(e){var t=_.createElement("div"),t=(t.textContent=e.header,v.appendChild(t),_.createElement("div")),n=_.createElement("div",{className:"tab-content-renderer"});(e.content||[]).forEach(function(e){e=l.renderComponent(e);e&&n.appendChild(e)}),t.appendChild(n),b.appendChild(t)}),new I.Tab({enableRtl:this.enableRtl,cssClass:s.cssClass,enablePersistence:!0,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:function(e){if("undefined"==typeof window)return null;try{window.localStorage.setItem("tab"+s.id,JSON.stringify({selectedItem:e.selectedIndex}))}catch(e){}}}));return x.appendTo(g),this.renderedInstances.push(x),y;case"card":(C=_.createElement("fieldset",{className:"e-card form-card-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",C.style.padding="0";var C,g=_.createElement("div",{className:"e-card-header"}),x=_.createElement("div",{className:"e-card-header-caption"}),y=_.createElement("div",{className:"e-card-title"}),w=(y.textContent=s.cardTitle||s.label||"Card Title",x.appendChild(y),s.cardSubtitle&&((y=_.createElement("div",{className:"e-card-sub-title"})).textContent=s.cardSubtitle,x.appendChild(y)),g.appendChild(x),C.appendChild(g),_.createElement("div",{className:"e-card-content card-content"}));return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&w.appendChild(e)}),C.appendChild(w),C;case"staticHtml":y=new Me({content:s.defaultValue||"<p>HTML content</p>",id:s.id,enableHtmlSanitizer:s.enableHtmlSanitizer}),x=y.render();return this.renderedInstances.push(y),x;case"message":var S,E=_.createElement("div",{className:"form-group"}),T=((S=_.createElement("div")).id=s.name,S.setAttribute("name",s.id),E.appendChild(S),je({component:s,locale:this.locale,value:void 0,onChange:function(){},enableRtl:this.enableRtl,target:S,ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e}}));return Array.isArray(T)?T.forEach(function(e){e&&l.renderedInstances.push(e)}):T&&this.renderedInstances.push(T),E;case"button":return Pe(s,this.customWidgetSettings)?this.renderField(s):(g=Y.isFieldDisabled(s.conditions,t),C=!!s.disabled||g,E=_.createElement("div",{className:"form-group"}),(S=_.createElement("div")).id=s.name,S.setAttribute("name",s.id),E.appendChild(S),T=je({component:V({},s,{disabled:C}),value:void 0,onChange:function(){},locale:this.locale,onClick:function(e){l.buttonClick&&(t=s.buttonsGroups?e.target&&e.target.ej2_instances?e.target.ej2_instances[0].content:"":s.label||"",l.trigger("buttonClick",{fieldName:s.name,label:t,event:e}));var t=e.target;t.type&&"reset"===t.type&&((e=t.closest("form"))&&(e.querySelectorAll('input[type="checkbox"]').forEach(function(e){e.ej2_instances[0].checked=!1}),e.querySelectorAll(".e-control.e-multiselect.e-lib").forEach(function(e){e.ej2_instances[0].value=[]})),l.formState.values={},e.reset(),l.rerenderForm(),l.validator.destroy())},ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e},enableRtl:this.enableRtl,target:S}),Array.isArray(T)?T.forEach(function(e){e&&l.renderedInstances.push(e)}):T&&this.renderedInstances.push(T),E);case"splitButton":return Pe(s,this.customWidgetSettings)?this.renderField(s):(y=Y.isFieldDisabled(s.conditions,t),x=!!s.disabled||y,E=_.createElement("div",{className:"form-group"}),(S=_.createElement("div")).id=s.name,S.setAttribute("name",s.id),E.appendChild(S),T=je({component:V({},s,{disabled:x}),value:void 0,locale:this.locale,onChange:function(){},onClick:function(e){l.buttonClick&&l.trigger("buttonClick",{fieldName:s.name,label:s.label||"",event:e})},ref:function(e){e&&(l.inputRefs[s.name]=e)},enableRtl:this.enableRtl,target:S}),Array.isArray(T)?T.forEach(function(e){e&&l.renderedInstances.push(e)}):T&&this.renderedInstances.push(T),E);default:return this.renderField(s)}},b.prototype.afterValueChange=function(e){this.formState&&(this.currentFormValues=V({},this.formState.values),this.evaluateExpressions(),this.retriggerCustomValidation(),this.beforeValidate(e),this.validator.validate(e),this.syncFormStateErrors(),e)&&this.isConditionalTrigger(e)&&this.scheduleRerender(e)},b.prototype.beforeValidate=function(e){var t,n=this.element.querySelector("#"+e+"-info"),n=(n&&n.classList.contains("e-error")&&n.classList.remove("e-error"),this.getInputElementByName(e));n&&(t=(e=n.parentElement).parentElement,(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||n.classList.contains("e-input")&&e.classList.contains("e-input-group")?e:null!=t&&(t.classList.contains("e-control-wrapper")||t.classList.contains("e-wrapper"))?t:n).classList.remove("e-error"),this.validator)&&(this.validator.errorRules=[])},b.prototype.scheduleRerender=function(e){var t=this;e&&this.pendingChangedFieldIds.add(e),this.rerenderScheduled||(this.rerenderScheduled=!0,Promise.resolve().then(function(){t.rerenderScheduled=!1;var e=new Set(t.pendingChangedFieldIds);t.pendingChangedFieldIds.clear(),t.rerenderForm(e)}))},b.prototype.collectConditionFieldIds=function(e,t){if(e)if("string"==typeof e.field)t.add(e.field);else if(Array.isArray(e.rules))for(var n=0,a=e.rules;n<a.length;n++){var i=a[n];this.collectConditionFieldIds(i,t)}},b.prototype.collectDataSourceReferenceIds=function(e,n,a){if("string"==typeof e){e=e.match(/\{([^}]+)\}/g);if(e)for(var t=0,i=e;t<i.length;t++)!function(e){var t=e.slice(1,-1),e=n.find(function(e){return e.name===t});e&&e.id&&a.add(e.id)}(i[t])}},b.prototype.buildConditionalDependencyMap=function(){for(var C=new Set,w=new Map,S=this.collectAllComponents(this.processedSchemaCache.components),e=function(e){var n=new Set,t=(w.set(e.id,n),e.conditions);if(t){for(var a=0,i=["visibleWhen","hideWhen","disabledWhen","requiredWhen","readOnlyWhen","choiceBasedField","conditionalData"];a<i.length;a++){var r=i[a];t[r]&&(E.collectConditionFieldIds(t[r],C),E.collectConditionFieldIds(t[r],n))}if(Array.isArray(t.conditionalData))for(var o=0,s=t.conditionalData;o<s.length;o++){var l=s[o];if(l&&l.condition&&(E.collectConditionFieldIds(l.condition,C),E.collectConditionFieldIds(l.condition,n)),l&&Array.isArray(l.conditions))for(var d=0,c=l.conditions;d<c.length;d++){var u=c[d];E.collectConditionFieldIds(u,C),E.collectConditionFieldIds(u,n)}}t.setValueWhen&&t.setValueWhen.condition&&(E.collectConditionFieldIds(t.setValueWhen.condition,C),E.collectConditionFieldIds(t.setValueWhen.condition,n)),t.choiceBasedField&&"string"==typeof t.choiceBasedField.primaryFieldId&&(C.add(t.choiceBasedField.primaryFieldId),n.add(t.choiceBasedField.primaryFieldId))}function p(e){var t;e&&!0===e.enabled&&((t=function(e){e&&"object"==typeof e&&"string"==typeof e.field&&(C.add(e.field),n.add(e.field))})(e.minValue),t(e.maxValue))}var h=e.minMaxRange;if(Array.isArray(h))for(var m=0,f=h;m<f.length;m++)p(f[m]);h=e.minMaxTimeRange;if(Array.isArray(h))for(var y=0,g=h;y<g.length;y++)p(g[y]);h=e.dataSource;if("dataGrid"===e.type&&h&&"url"===h.type&&(h.search&&"string"==typeof h.search.key&&(E.collectDataSourceReferenceIds(h.search.key,S,C),E.collectDataSourceReferenceIds(h.search.key,S,n)),Array.isArray(h.filters)))for(var v=0,b=h.filters;v<b.length;v++){var x=b[v];"string"==typeof x.value&&(E.collectDataSourceReferenceIds(x.value,S,C),E.collectDataSourceReferenceIds(x.value,S,n))}},E=this,t=0,n=S;t<n.length;t++)e(n[t]);this.conditionalTriggerFieldIds=C,this.consumerDependencyMap=w},b.prototype.isConditionalTrigger=function(e){return this.conditionalTriggerFieldIds.has(e)},b.prototype.getScrollParent=function(){for(var e=this.element.parentElement;e;){var t=window.getComputedStyle(e),n=t.overflowY,t=t.overflowX,n=("auto"===n||"scroll"===n||"overlay"===n)&&e.scrollHeight>e.clientHeight,t=("auto"===t||"scroll"===t||"overlay"===t)&&e.scrollWidth>e.clientWidth;if(n||t)return e;e=e.parentElement}return null},b.prototype.rerenderForm=function(e){var n=this,i=e||new Set,e=document.activeElement,t=e&&e.getAttribute?e.getAttribute("name"):null,a=null,r=null;if(t&&e&&void 0!==e.selectionStart)try{a=e.selectionStart,r=e.selectionEnd}catch(e){}for(var o,e=this.element.scrollTop,s=this.element.scrollLeft,l=window.scrollX,d=window.scrollY,c=this.getScrollParent(),u=c?c.scrollTop:0,p=c?c.scrollLeft:0,h=(this.preservedFields.clear(),this.collectAllComponents(this.processedSchemaCache.components)),m=this,f=0,y=h;f<y.length;f++)!function(e){var t,n,a;!D.PRESERVABLE_TYPES.has(e.type)||(t=m.consumerDependencyMap.get(e.id),n=!1,t&&i.forEach(function(e){t.has(e)&&(n=!0)}),n)||(a=m.element.querySelector('[data-field-id="'+e.id+'"]'))&&a.parentElement&&(a.parentElement.removeChild(a),m.preservedFields.set(e.id,a))}(y[f]);this.refreshing=!0,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyRenderedExcludingPreserved(),this.removePreviousRoot(),this.validator&&this.validator.destroy(),this.render(),this.refreshing=!1;try{this.element.scrollTop=e,this.element.scrollLeft=s,c&&(c.scrollTop=u,c.scrollLeft=p),window.scrollTo(l,d)}catch(e){}if(t){h=this.getInputElementByName(t);if(h&&"function"==typeof h.focus)try{if(h.focus(),null!==a&&null!==r&&"function"==typeof h.setSelectionRange)try{h.setSelectionRange(a,r)}catch(e){}}catch(e){}}0<this.preservedFields.size&&(o=[],this.preservedFields.forEach(function(e,t){if(n.element.contains(e)||document.body.contains(e))o.push(t);else{n.destroyPreservedSubtree(e);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}n.preservedFields.delete(t)}}),o.forEach(function(e){return n.preservedFields.delete(e)}))},b.prototype.removePreviousRoot=function(){if(this.element)for(;0<this.element.childNodes.length;)this.element.removeChild(this.element.firstChild)},b.prototype.destroyRenderedInstance=function(e){if(e&&"function"==typeof e.destroy){var t=e;if(!(t.isDestroyed||t.destroyed||t.disposed)){var n=e.element||e.target||(e.hostElement&&"function"==typeof e.hostElement?e.hostElement():void 0);try{t.isDestroyed=!0,t.destroyed=!0,t.disposed=!0,e.destroy()}catch(e){console.warn("FormRenderer: failed to destroy child instance.",e)}finally{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}}}}},b.prototype.destroyRenderedExcludingPreserved=function(){for(var n=[],a=Array.from(this.preservedFields.values()),i=this,e=0,t=this.renderedInstances;e<t.length;e++)!function(e){var t=e&&(e.element||e.target||e.hostElement&&e.hostElement());!!t&&a.some(function(e){return e===t||e.contains(t)})?n.push(e):i.destroyRenderedInstance(e)}(t[e]);this.renderedInstances=n;for(var r=Object.keys(this.inputRefs),o=this,s=0,l=r;s<l.length;s++)!function(e){var t=o.inputRefs[e],n=t&&(t.element||t.target||t.hostElement&&t.hostElement());!!n&&a.some(function(e){return e===n||e.contains(n)})||delete o.inputRefs[e]}(l[s]);this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set},b.prototype.destroyPreservedSubtree=function(e){for(var t=[],n=0,a=this.renderedInstances;n<a.length;n++){var i=a[n],r=i&&(i.element||i.target||i.hostElement&&i.hostElement());r&&(r===e||e.contains(r))?this.destroyRenderedInstance(i):t.push(i)}this.renderedInstances=t},b.prototype.getInputElementByName=function(e){e=this.element.querySelector('[name="'+e+'"]');if(!e)return null;if(!e.classList.contains("e-control")){var t=e.parentElement?e.parentElement.querySelector(".e-control"):null;if(t)return t}return e},b.prototype.evaluateExpressions=function(){if(this.formState&&this.expressionEngine&&!this.expressionEvaluationInProgress)try{this.expressionEvaluationInProgress=!0;for(var p=this.expressionEngine,e=this.expressionDependencyGraph,h=this.formState.values||{},m=this.collectAllComponents(this.processedSchemaCache.components),t=this.previousFormValues,f=this.computedFieldNames,y={},n=(m.forEach(function(e){e.name&&(y[e.id]=e.name)}),{}),a=Object.keys(h),i=0,r=a;i<r.length;i++){var o=r[i],s=h[o];(v=y[o])&&(n[v]=s)}for(var l=V({},t),d=(Object.assign(t,n),new Set),c=Object.keys(n),u=0,g=c;u<g.length;u++)!function(t){var e=Object.keys(y).find(function(e){return y[e]===t});e&&n[t]!==l[t]&&!f.has(e)&&d.add(t)}(v=g[u]);if(0!==d.size){for(var v,b=p.getTopologicalOrder(e),x=this,C=0,w=b;C<w.length;C++)!function(t){var e=m.find(function(e){return e.name===t});if(e&&e.expressionValue){f.add(e.id);try{if(!1!==e.visible&&Y.isFieldVisible(e.conditions,h)){for(var n,a={},i=Object.keys(h),r=0,o=i;r<o.length;r++){var s=o[r],l=h[s],d=y[s];d&&(a[d]=l)}if(null!=(u="string"==typeof(u=p.evaluate(e.expressionValue,a))&&-1!==u.indexOf("undefined")?u.replace(/undefined/g,""):u)&&""!==u)switch(e.type){case"number":var c=Number(u),u=isNaN(c)?0:c;break;case"checkbox":case"switch":u=Boolean(u);break;case"textbox":case"textarea":u=String(u);break;case"dateRange":case"checkboxGroup":case"multiselect":break;default:u=String(u)}null!=u&&u!==h[e.id]&&x.formState&&(x.formState.values[e.id]=u,x.validator)&&(n=x.getInputElementByName(e.id))&&x.syncValueToInput(n,e.id,u)}}catch(e){x.failure&&x.trigger("failure",{error:e})}}}(v=w[C]);Object.assign(t,n)}}finally{this.expressionEvaluationInProgress=!1}},b.prototype.retriggerCustomValidation=function(){var t=this;if(this.formState&&this.customValidationEngine)try{var a,i=this.collectAllComponents(this.processedSchemaCache.components),n=this.formState.values||{},r=this.previousFormValues,o=new Set;Object.keys(n).forEach(function(e){n[e]!==r[e]&&o.add(e)}),0!==o.size&&(a=new Set,o.forEach(function(t){var e=i.find(function(e){return e.id===t});e&&e.customValidation&&Array.isArray(e.customValidation)&&a.add(t)}),i.forEach(function(n){n.customValidation&&Array.isArray(n.customValidation)&&n.customValidation.forEach(function(e){t.customValidationEngine.extractDependencies(e.expression).forEach(function(t){var e=i.find(function(e){return e.id===t||e.name===t});e&&o.has(e.id)&&a.add(n.id)})})}),this.previousFormValues=V({},n))}catch(e){this.failure&&this.trigger("failure",{error:e})}},b.prototype.handleSubmitData=function(e){for(var t=this.formState,n=!(!t||!t.errors)&&0===Object.keys(t.errors).length,a={},i=t?t.values:{},r=new Set(["button","message","panel","table","tabs"]),t=this.collectAllComponents(this.processedSchemaCache.components||[]),o=new Set(t.filter(function(e){return r.has(e.type)}).map(function(e){return e.id})),s=new Set(t.filter(function(e){return!1===e.visible||!(!e.conditions||!e.conditions.visibleWhen||Y.isFieldVisible(e.conditions,i))||!!(e.conditions&&e.conditions.hideWhen&&Y.isFieldHidden(e.conditions,i))}).map(function(e){return e.id})),l=new Set(t.filter(function(e){return!!e.disabled||!(!e.conditions||!e.conditions.disabledWhen)&&Y.isFieldDisabled(e.conditions,i)}).map(function(e){return e.id})),d=0,c=Object.keys(e);d<c.length;d++){var u=c[d],p=e[u];if(o.has(u)||s.has(u)||l.has(u))return;a[this.idToLabelCache[u]||u]=p}this.submit&&this.trigger("submit",{data:a,isValid:n})},b.prototype.getComponent=function(e){return this.inputRefs[e]||null},b.prototype.setFieldValue=function(t,e){var n,a=this.collectAllComponents(this.processedSchemaCache.components||[]).find(function(e){return e.name===t});a&&(this.formState&&(this.formState.values[a.id]=e),(n=this.getInputElementByName(a.id))&&this.syncValueToInput(n,a.id,e),this.afterValueChange(a.id))},b.prototype.syncValueToInput=function(e,t,n){if(e)try{var a=e instanceof HTMLInputElement?e:null,i=!!a&&("checkbox"===a.type||"radio"===a.type),r=e.ej2_instances&&e.ej2_instances[0];if(r)i&&void 0!==r.checked?"radio"===a.type&&void 0!==r.value?r.checked=String(n)===String(r.value):r.checked=D.coerceChecked(n):void 0!==r.value&&(r.value=n);else if(e instanceof HTMLSelectElement){var o=null==n?"":String(n);if(e.value=o,e.value!==o&&0<e.options.length)for(var s=0;s<e.options.length;s++)if(e.options[s].text===o){e.value=e.options[s].value;break}}else if(a&&"radio"===a.type)for(var l=this.element.querySelectorAll('input[type="radio"][name="'+t+'"]'),s=0;s<l.length;s++)l[s].checked=String(n)===l[s].value;else i?a.checked=D.coerceChecked(n):void 0!==e.value&&(e.value=null==n?"":String(n))}catch(e){}},b.coerceChecked=function(e){return"boolean"==typeof e?e:"number"==typeof e?0!==e:"string"==typeof e?""!==e&&"false"!==e&&"0"!==e:!!e},b.prototype.onPropertyChanged=function(e,t){var n=!1;e.schema!==t.schema&&(n=!0),e.dataModel!==t.dataModel&&(n=!0),e.locale!==t.locale&&(n=!0),e.enableRtl!==t.enableRtl&&(n=!0),e.layout!==t.layout&&(n=!0),(n=e.customWidgetSettings!==t.customWidgetSettings?!0:n)&&((this.isReact||this.isAngular)&&this.clearTemplate(),this.refreshing=!0,this.destroyRendered(),this.removePreviousRoot(),this.isInitialized=!1,this.render(),this.refreshing=!1)},b.prototype.destroyRendered=function(){var t=this;if(this.validator){try{this.validator.destroy()}catch(e){this.trigger("failure",{error:e})}this.validator=null}this.renderedInstances.forEach(function(e){t.destroyRenderedInstance(e)}),this.renderedInstances=[],this.removePreviousRoot(),this.inputRefs={},this.tooltipRefs={},this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set,this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.pendingChangedFieldIds=new Set},b.prototype.clearPersistedTabSelections=function(){if("undefined"==typeof window)return null;try{var e=this.processedSchemaCache&&this.processedSchemaCache.components?this.processedSchemaCache.components:[];this.collectAllComponents(e).forEach(function(e){"tabs"===e.type&&e.id&&window.localStorage.removeItem("tab"+e.id)})}catch(e){}},b.prototype.getTemplateFunction=function(t){var n=null;try{n="string"==typeof t&&-1!==t.indexOf("#")&&document.querySelectorAll(t).length?_.compile(this.sanitizeTemplateValue(document.querySelector(t).innerHTML.trim())):"string"==typeof t?_.compile(this.sanitizeTemplateValue(t)):_.compile(t)}catch(e){n=_.compile(t)}return n},b.prototype.sanitizeTemplateValue=function(e){if(this.enableHtmlSanitizer&&"string"==typeof e)try{return _.SanitizeHtmlHelper.sanitize(e)}catch(e){}return e},b.prototype.destroy=function(){(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyRendered(),this.formState={values:{},errors:{}},this.expressionEngine=null,this.customValidationEngine=null,this.clearEngineCaches(),this.clearPersistedTabSelections(),this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.conditionalTriggerFieldIds=new Set,He.prototype.destroy.call(this)},b.prototype.clearEngineCaches=function(){if(this.expressionEngine)try{this.expressionEngine.clearCache()}catch(e){}if(this.customValidationEngine){var e=this.customValidationEngine.expressionEngine;if(e&&"function"==typeof e.clearCache)try{e.clearCache()}catch(e){}}},b.PRESERVABLE_TYPES=new Set(["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"]),f([_.Property(null)],b.prototype,"schema",void 0),f([_.Property(null)],b.prototype,"dataModel",void 0),f([_.Property("SingleColumn")],b.prototype,"layout",void 0),f([_.Property("")],b.prototype,"className",void 0),f([_.Collection([],qe)],b.prototype,"customWidgetSettings",void 0),f([_.Property(!1)],b.prototype,"enableHtmlSanitizer",void 0),f([_.Event()],b.prototype,"submit",void 0),f([_.Event()],b.prototype,"change",void 0),f([_.Event()],b.prototype,"buttonClick",void 0),f([_.Event()],b.prototype,"failure",void 0),f([_.Event()],b.prototype,"created",void 0);var He,D,We=D=f([_.NotifyPropertyChanges],b);function b(e,t){e=He.call(this,e,t)||this;return e.processedSchemaCache={version:"1.0.0",components:[]},e.l10n=new _.L10n("form-renderer",ze,e.locale),e.formState={values:Object.create(null),errors:Object.create(null)},e.validator=null,e.inputRefs={},e.conditionalValueApplied={},e.expressionEngine=null,e.expressionDependencyGraph={},e.expressionEvaluationInProgress=!1,e.previousFormValues={},e.computedFieldNames=new Set,e.customValidationEngine=new Se,e.currentFormValues={},e.isInitialized=!1,e.hasLayoutComponentsCache=!1,e.idToLabelCache={},e.initialValuesCache={},e.renderedInstances=[],e.tooltipRefs={},e.createdFired=!1,e.rerenderScheduled=!1,e.conditionalTriggerFieldIds=new Set,e.preservedFields=new Map,e.consumerDependencyMap=new Map,e.pendingChangedFieldIds=new Set,e}(f=e.FormLayout||(e.FormLayout={})).SingleColumn="SingleColumn",f.TwoColumn="TwoColumn",f.ThreeColumn="ThreeColumn",f.FourColumn="FourColumn";Object.defineProperty(e,"DataManager",{enumerable:!0,get:function(){return h.DataManager}}),Object.defineProperty(e,"Query",{enumerable:!0,get:function(){return h.Query}}),e.CheckboxGroup=ve,e.ConditionalRuleEngine=Y,e.CustomValidationEngine=Se,e.CustomWidgetSetting=qe,e.DataGridComponent=Te,e.DependencyTracker=B,e.EJ2_LIFECYCLE_KEYS=ke,e.ExpressionEngine=W,e.ExpressionParser=S,e.ExpressionValidator=ne,e.FORM_COMPONENT_TYPES=["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"],e.FormRenderer=We,e.GridExpressions=xe,e.MinMaxRuleEngine=Ae,e.OptionFetcher=ye,e.RESERVED_RENDERER_KEYS=Re,e.StaticHtmlRenderer=Me,e.UI_TYPE_TO_SEMANTIC_TYPE=k,e.UniversalJsonParser=Ie,e.VALIDATION_REGEX=se,e.applyExtraProps=Le,e.collectAvailableFieldNames=function(e){function n(e){e.forEach(function(e){var t;e.name&&-1===["panel","table","tabs","card","message","button","splitButton","staticHtml"].indexOf(e.type)&&(t=k[e.type])&&a.push(oe({name:e.name,type:t.type},t.format&&{format:t.format})),e.children&&n(e.children),e.tabItems&&e.tabItems.forEach(function(e){e.content&&n(e.content)}),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(n)})})}var a=[];return n(e),a},e.convertComponentsToDataSchema=function(e){for(var t={},n=new Set,a=e.slice();0<a.length;){var i=a.shift(),r=k[i.type];if(null===r){if(i.children&&i.children.length&&a.unshift.apply(a,i.children),i.tabItems&&i.tabItems.length)for(var o=0,s=i.tabItems;o<s.length;o++)(b=s[o]).content&&b.content.length&&a.unshift.apply(a,b.content);if(i.tableCells&&i.tableCells.length)for(var l=0,d=i.tableCells;l<d.length;l++)for(var c=0,u=d[l];c<u.length;c++)(E=u[c]).length&&a.unshift.apply(a,E)}else if(n.has(i.id)){if(i.children&&i.children.length&&a.unshift.apply(a,i.children),i.tabItems&&i.tabItems.length)for(var p=0,h=i.tabItems;p<h.length;p++)(b=h[p]).content&&b.content.length&&a.unshift.apply(a,b.content);if(i.tableCells&&i.tableCells.length)for(var m=0,f=i.tableCells;m<f.length;m++)for(var y=0,g=f[m];y<g.length;y++)(E=g[y]).length&&a.unshift.apply(a,E)}else{n.add(i.id);var v=R(O(i.label||i.id,i.id),new Set(Object.keys(t)),i.id),r=N(i,r||{type:"any"});if(t[v]=r,i.children&&i.children.length&&a.unshift.apply(a,i.children),i.tabItems&&i.tabItems.length)for(var b,x=0,C=i.tabItems;x<C.length;x++)(b=C[x]).content&&b.content.length&&a.unshift.apply(a,b.content);if(i.tableCells&&i.tableCells.length)for(var w=0,S=i.tableCells;w<S.length;w++)for(var E,T=0,A=S[w];T<A.length;T++)(E=A[T]).length&&a.unshift.apply(a,E)}}return{version:"1.0",properties:t}},e.defaultLocale=ze,e.exportFormSchema=function(e){return JSON.stringify(e,null,2)},e.extractAllDescendantIds=function(e){var i=[];function r(e){for(var t=0,n=e;t<n.length;t++){var a=n[t];i.push(a.id),a.children&&Array.isArray(a.children)&&r(a.children),a.tableCells&&Array.isArray(a.tableCells)&&a.tableCells.forEach(function(e){Array.isArray(e)&&e.forEach(function(e){Array.isArray(e)&&r(e)})}),a.tabItems&&Array.isArray(a.tabItems)&&a.tabItems.forEach(function(e){e.content&&Array.isArray(e.content)&&r(e.content)})}}return e.children&&Array.isArray(e.children)&&r(e.children),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e){Array.isArray(e)&&e.forEach(function(e){Array.isArray(e)&&r(e)})}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e){e.content&&Array.isArray(e.content)&&r(e.content)}),i},e.extractDataFromPath=ue,e.extractFieldIdsFromLayout=P,e.formatDateValues=de,e.forwardExtras=K,e.generateId=T,e.generateName=x,e.getAdaptorInstance=ce,e.getComponentFromSchema=function(h,e){var m;return h&&e?(m=function(e){for(var t=0,n=e;t<n.length;t++){var a=n[t];if(a.id===h||a.name===h)return a;if(a.children)if(u=m(a.children))return u;if(a.tableCells)for(var i=0,r=a.tableCells;i<r.length;i++)for(var o=0,s=r[i];o<s.length;o++){var l=s[o];if(u=m(l))return u}if(a.tabItems)for(var d=0,c=a.tabItems;d<c.length;d++){var u,p=c[d];if(p.content)if(u=m(p.content))return u}}return null})(e.components||[]):null},e.getCurrentMode=function(){var e;if("undefined"!=typeof window)return"developer"===(e=new URLSearchParams(window.location.search).get("mode"))?"Developer":"simple"===e?"Simple":void 0},e.inferTypeFromWidget=M,e.inferWidgetFromType=A,e.labelToFieldKey=O,e.makeUniqueFieldKey=R,e.mapButtonStyleToClass=ae,e.mapPositionToJustifyContent=re,e.matchFieldWithIDPreservation=j,e.mergeSchema=L,e.mergeWithIDRemapping=function(e,t){for(var n=new Map,a=0,i=Object.keys(e.properties);a<i.length;a++){var r=i[a],o=j(c=e.properties[r],t);n.set(r,o.existingId||T(O(c.label||""))),o.newDataId,o.existingId}for(var s={},l=0,d=Object.keys(e.properties);l<d.length;l++){var r=d[l],c=e.properties[r],u=n.get(r)||r;s[u]=E({},c,{id:u})}for(var p,h,m=P(t.layout),f=Object.keys(s).filter(function(e){return!m.has(e)}),y=Object.keys(t.properties).map(function(e){return t.properties[e]}).some(function(e){return"button"===e.widget}),f=f.filter(function(e){e=s[e];return"button"!==e.type||"submit"!==e.buttonType||!y}),g=function a(e,i){return e.map(function(e){var t,n;return"field"===e.type?(t=e,n=i.get(t.propertyId)||t.propertyId,E({},t,{propertyId:n})):"table"===e.type?E({},t=e,{cells:t.cells.map(function(e){return e.map(function(e){return E({},e,{children:a(e.children,i)})})})}):"panel"===e.type?E({},n=e,{children:a(n.children,i)}):"tabs"===e.type?E({},t=e,{tabs:t.tabs.map(function(e){return E({},e,{children:a(e.children,i)})})}):"card"===e.type?E({},n=e,{children:a(n.children,i)}):e})}(t.layout,n),v={},b=0,x=Object.keys(t.properties);b<x.length;b++){var C=x[b],w=t.properties[C];v[C]=E({},w,{_configured:void 0===w._configured||w._configured})}0<f.length&&(p=(p=g[g.length-1])&&"field"===p.type&&v[p.propertyId]&&"button"===v[p.propertyId].widget,h=[],f.forEach(function(e){var t=s[e],n=void 0!==t.options&&0<t.options.length,n=A(t.type,t.format,n),t={widget:n,label:t.label,_configured:!0};"button"===n&&(t.isPrimary=!0,t.name="defaultFormSubmit",t.cssClass="e-primary"),v[e]=t,h.push({type:"field",propertyId:e})}),g=p?g.slice(0,-1).concat(h,[g[g.length-1]]):g.concat(h));var S={};return Object.keys(s).forEach(function(e){var t=s[e],n=v[e];S[e]=E({},t,n,{widget:n&&n.widget||A(t.type,t.format,void 0!==t.options)})}),L(E({version:e.version,properties:S,layout:g},e.settings?{settings:e.settings}:{}))},e.navigateTo=function(t){if("undefined"!=typeof window)try{var e=new URL("/demo"+t,window.location.origin);window.location.href=e.toString()}catch(e){window.location.href="/demo"+t}},e.pickUnmappedSchemaProps=Ne,e.renderFormField=je,e.resolveButtonType=ie,e.resolveConditionalData=me,e.resolveFieldBinding=he,e.resolveOptions=J,e.sanitizeFormSchema=Fe,e.sanitizeId=g,e.splitSchema=function(e){for(var c={},u={},t=[],p=new Set,h=new Set,m=function(e){for(var t=new Set,n=e.slice();n.length;){var a=n.pop();t.add(a.id),a.children&&n.push.apply(n,a.children),a.tabItems&&a.tabItems.forEach(function(e){e.content&&n.push.apply(n,e.content)}),a.tableCells&&a.tableCells.forEach(function(e){e.forEach(function(e){return n.push.apply(n,e)})})}return t}(e.components),f=e.components.map(function(e){return{component:e,layoutParent:t}}),n=function(){var t,n,a,e,i,r=f.shift(),o=r.component,r=r.layoutParent,s=(o.conditions&&(l=!(d={}),o.conditions.visibleWhen&&(s=y(o.conditions.visibleWhen,m))&&(d.visibleWhen=s,l=!0),o.conditions.hideWhen&&(s=y(o.conditions.hideWhen,m))&&(d.hideWhen=s,l=!0),o.conditions.readOnlyWhen&&(s=y(o.conditions.readOnlyWhen,m))&&(d.readOnlyWhen=s,l=!0),o.conditions.disabledWhen&&(s=y(o.conditions.disabledWhen,m))&&(d.disabledWhen=s,l=!0),o.conditions.requiredWhen&&(s=y(o.conditions.requiredWhen,m))&&(d.requiredWhen=s,l=!0),o.conditions.setValueWhen&&(s=y(o.conditions.setValueWhen.condition,m))&&void 0!==o.conditions.setValueWhen.value&&""!==o.conditions.setValueWhen.value&&(d.setValueWhen={condition:s,value:o.conditions.setValueWhen.value},l=!0),o.conditions&&o.conditions.choiceBasedField&&(s=o.conditions.choiceBasedField).primaryFieldId&&m.has(s.primaryFieldId)&&(d.choiceBasedField=s,l=!0),o.conditions.conditionalData&&Array.isArray(o.conditions.conditionalData)&&0<(s=o.conditions.conditionalData.map(function(e){var t=y(e.condition,m);return t&&e.dataSource?{condition:t,dataSource:e.dataSource,columns:e.columns,includeColumns:e.includeColumns}:null}).filter(function(e){return null!=e})).length&&(d.conditionalData=s,l=!0),o.conditions=l?d:void 0),k[o.type]);if("table"===o.type)return e=g(o.id,T("table")),t=E({type:"table",id:e,name:o.name,label:o.label,cssClass:o.cssClass,hideBorders:o.hideBorders,rows:o.tableCells&&o.tableCells.length||0,cols:o.tableCells&&o.tableCells[0]&&o.tableCells[0].length||0,cells:[],columnWidths:o.columnWidths},o.conditions?{conditions:o.conditions}:{}),o.tableCells&&o.tableCells.forEach(function(e,a){var i=[];e.forEach(function(e,t){var n=[];e.slice().reverse().forEach(function(e){f.unshift({component:e,layoutParent:n})}),i.push({row:a,col:t,children:n})}),t.cells.push(i)}),r.push(t),"continue";if("panel"===o.type)return e=g(o.id,T("panel")),n=E({type:"panel",id:e,name:o.name,label:o.label,cssClass:o.cssClass,hideBorders:o.hideBorders,hideLabel:o.hideLabel,children:[]},o.conditions?{conditions:o.conditions}:{}),(o.children||[]).slice().reverse().forEach(function(e){f.unshift({component:e,layoutParent:n.children})}),r.push(n),"continue";if("tabs"===o.type)return e=g(o.id,T("tabs")),a=E({type:"tabs",name:o.name,id:e,label:o.label,cssClass:o.cssClass,tabOptions:o.tabOptions,tabs:[]},o.conditions?{conditions:o.conditions}:{}),o.tabItems&&o.tabItems.forEach(function(e){var t=[];(e.content||[]).slice().reverse().forEach(function(e){f.unshift({component:e,layoutParent:t})}),a.tabs.push({header:e.header,children:t})}),r.push(a),"continue";if("card"===o.type)return e=g(o.id,T("card")),i=E({type:"card",id:e,name:o.name,label:o.label,cssClass:o.cssClass,hideLabel:o.hideLabel,cardTitle:o.cardTitle,cardSubtitle:o.cardSubtitle,children:[]},o.conditions?{conditions:o.conditions}:{}),(o.children||[]).slice().reverse().forEach(function(e){f.unshift({component:e,layoutParent:i.children})}),r.push(i),"continue";if(h.has(o.id))return"continue";h.add(o.id);var l=R(O(o.label||o.id,o.id),p,o.id),d=(p.add(l),N(o,s||{type:"any"}));c[l]=d,u[l]=function(t){var n={widget:t.type},a=new Set(["id","type","label","format","defaultValue","required","options","name","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);{var e;Object.keys(t).forEach(function(e){a.has(e)||"id"===e||"type"===e||(n[e]=t[e])}),"dataGrid"===t.type&&n.columns&&Array.isArray(n.columns)&&(e=["field","headerText","type","width","format","editType","validationRules","allowEditing","expression","isPrimaryKey","customValidation"],n.columns=n.columns.map(function(t){var n={};return e.forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n}))}return n}(o),r.push({type:"field",propertyId:l})};0<f.length;)n();var a={},i=(Object.keys(c).forEach(function(e){var t=c[e],n=u[e];a[e]=E({},t,n,{widget:n&&n.widget||A(t.type,t.format,void 0!==t.options)})}),e.settings?E({},e.settings):{});return E({version:e.version,properties:function(e){for(var t={},n=0,a=Object.keys(e||{});n<a.length;n++){var i=a[n],r=e[i],r=E({},r);r&&void 0!==r._configured&&delete r._configured,t[i]=r}return t}(a),layout:t},0<Object.keys(i).length?{settings:i}:{})},e.splitWidths=le,e.validateFormSchema=Ve,e.validateJSON=Oe,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-form-renderer.umd.min.js.map
|