@sankhyalabs/ezui 1.1.64 → 1.1.68
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/cjs/ez-button_16.cjs.entry.js +44 -52
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -9
- package/dist/cjs/ez-popover.cjs.entry.js +10 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +6 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +45 -41
- package/dist/collection/components/ez-button/ez-button.js +2 -2
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +4 -4
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -8
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +2 -2
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +6 -6
- package/dist/collection/components/ez-icon/ez-icon.css +3 -1
- package/dist/collection/components/ez-icon/ez-icon.js +5 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +7 -7
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popover/ez-popover.js +26 -1
- package/dist/collection/components/ez-search/ez-search.js +3 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +11 -35
- package/dist/collection/components/ez-time-input/ez-time-input.js +8 -8
- package/dist/custom-elements/index.js +77 -76
- package/dist/esm/ez-button_16.entry.js +44 -52
- package/dist/esm/ez-number-input.entry.js +9 -9
- package/dist/esm/ez-popover.entry.js +11 -2
- package/dist/esm/ez-time-input.entry.js +6 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-d8a47f23.entry.js → p-74e4415e.entry.js} +1 -1
- package/dist/ezui/p-7d066b1c.entry.js +1 -0
- package/dist/ezui/p-ee5058c1.entry.js +1 -0
- package/dist/ezui/{p-7f528c19.entry.js → p-f7d7fb7f.entry.js} +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -1
- package/dist/types/components/ez-icon/ez-icon.d.ts +6 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +1 -1
- package/dist/types/components/ez-popover/ez-popover.d.ts +6 -0
- package/dist/types/components/ez-search/ez-search.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +1 -1
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -5
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +1 -1
- package/dist/types/components.d.ts +32 -24
- package/package.json +2 -1
- package/dist/ezui/p-171bdc12.entry.js +0 -1
- package/dist/ezui/p-46275da0.entry.js +0 -1
|
@@ -114,7 +114,7 @@ export namespace Components {
|
|
|
114
114
|
/**
|
|
115
115
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
116
116
|
*/
|
|
117
|
-
"
|
|
117
|
+
"errorMessage": string;
|
|
118
118
|
/**
|
|
119
119
|
* Label é o título do campo
|
|
120
120
|
*/
|
|
@@ -149,7 +149,7 @@ export namespace Components {
|
|
|
149
149
|
/**
|
|
150
150
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
151
151
|
*/
|
|
152
|
-
"
|
|
152
|
+
"errorMessage": string;
|
|
153
153
|
/**
|
|
154
154
|
* Label é o título do campo
|
|
155
155
|
*/
|
|
@@ -203,7 +203,13 @@ export namespace Components {
|
|
|
203
203
|
"validate": () => Promise<boolean>;
|
|
204
204
|
}
|
|
205
205
|
interface EzIcon {
|
|
206
|
+
/**
|
|
207
|
+
* Path da imagem
|
|
208
|
+
*/
|
|
206
209
|
"href": string;
|
|
210
|
+
/**
|
|
211
|
+
* Tamanho do icone
|
|
212
|
+
*/
|
|
207
213
|
"size": string;
|
|
208
214
|
}
|
|
209
215
|
interface EzLabelChip {
|
|
@@ -262,7 +268,7 @@ export namespace Components {
|
|
|
262
268
|
/**
|
|
263
269
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
264
270
|
*/
|
|
265
|
-
"
|
|
271
|
+
"errorMessage": string;
|
|
266
272
|
/**
|
|
267
273
|
* Opção de configurar a transformação de string to number entre formatação pt-BR e en-US (formatação de ENTRADA e SAÍDA do componente: pt-BR="###.###,##" en-US="###,###.##"; Default: "pt-BR") Qualquer outro valor que não seja "en-US", adotará a formatação "pt-BR" Não é case sensitive
|
|
268
274
|
*/
|
|
@@ -312,7 +318,7 @@ export namespace Components {
|
|
|
312
318
|
/**
|
|
313
319
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
314
320
|
*/
|
|
315
|
-
"
|
|
321
|
+
"errorMessage": string;
|
|
316
322
|
/**
|
|
317
323
|
* Label é o título do campo
|
|
318
324
|
*/
|
|
@@ -398,7 +404,7 @@ export namespace Components {
|
|
|
398
404
|
/**
|
|
399
405
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
400
406
|
*/
|
|
401
|
-
"
|
|
407
|
+
"errorMessage": string;
|
|
402
408
|
/**
|
|
403
409
|
* Label é o título do campo
|
|
404
410
|
*/
|
|
@@ -433,7 +439,7 @@ export namespace Components {
|
|
|
433
439
|
/**
|
|
434
440
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
435
441
|
*/
|
|
436
|
-
"
|
|
442
|
+
"errorMessage": string;
|
|
437
443
|
/**
|
|
438
444
|
* Label é o título do campo
|
|
439
445
|
*/
|
|
@@ -467,7 +473,7 @@ export namespace Components {
|
|
|
467
473
|
/**
|
|
468
474
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
469
475
|
*/
|
|
470
|
-
"
|
|
476
|
+
"errorMessage": string;
|
|
471
477
|
/**
|
|
472
478
|
* Label é o título do campo
|
|
473
479
|
*/
|
|
@@ -480,10 +486,6 @@ export namespace Components {
|
|
|
480
486
|
* Aplica uma máscara no conteúdo conforme um o padrão estabelecido
|
|
481
487
|
*/
|
|
482
488
|
"mask": string;
|
|
483
|
-
/**
|
|
484
|
-
* Faz com que o componente só aceite números
|
|
485
|
-
*/
|
|
486
|
-
"onlynumber": boolean;
|
|
487
489
|
/**
|
|
488
490
|
* Restringe o que o usuário pode digitar. Cada caractere digitado será testado e deve estar contido nessa string ou será descartado.
|
|
489
491
|
*/
|
|
@@ -509,7 +511,7 @@ export namespace Components {
|
|
|
509
511
|
/**
|
|
510
512
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
511
513
|
*/
|
|
512
|
-
"
|
|
514
|
+
"errorMessage": string;
|
|
513
515
|
/**
|
|
514
516
|
* Label é o título do campo
|
|
515
517
|
*/
|
|
@@ -874,7 +876,7 @@ declare namespace LocalJSX {
|
|
|
874
876
|
/**
|
|
875
877
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
876
878
|
*/
|
|
877
|
-
"
|
|
879
|
+
"errorMessage"?: string;
|
|
878
880
|
/**
|
|
879
881
|
* Label é o título do campo
|
|
880
882
|
*/
|
|
@@ -913,7 +915,7 @@ declare namespace LocalJSX {
|
|
|
913
915
|
/**
|
|
914
916
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
915
917
|
*/
|
|
916
|
-
"
|
|
918
|
+
"errorMessage"?: string;
|
|
917
919
|
/**
|
|
918
920
|
* Label é o título do campo
|
|
919
921
|
*/
|
|
@@ -974,7 +976,13 @@ declare namespace LocalJSX {
|
|
|
974
976
|
"slavemode"?: boolean;
|
|
975
977
|
}
|
|
976
978
|
interface EzIcon {
|
|
979
|
+
/**
|
|
980
|
+
* Path da imagem
|
|
981
|
+
*/
|
|
977
982
|
"href"?: string;
|
|
983
|
+
/**
|
|
984
|
+
* Tamanho do icone
|
|
985
|
+
*/
|
|
978
986
|
"size"?: string;
|
|
979
987
|
}
|
|
980
988
|
interface EzLabelChip {
|
|
@@ -1037,7 +1045,7 @@ declare namespace LocalJSX {
|
|
|
1037
1045
|
/**
|
|
1038
1046
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1039
1047
|
*/
|
|
1040
|
-
"
|
|
1048
|
+
"errorMessage"?: string;
|
|
1041
1049
|
/**
|
|
1042
1050
|
* Opção de configurar a transformação de string to number entre formatação pt-BR e en-US (formatação de ENTRADA e SAÍDA do componente: pt-BR="###.###,##" en-US="###,###.##"; Default: "pt-BR") Qualquer outro valor que não seja "en-US", adotará a formatação "pt-BR" Não é case sensitive
|
|
1043
1051
|
*/
|
|
@@ -1079,7 +1087,7 @@ declare namespace LocalJSX {
|
|
|
1079
1087
|
/**
|
|
1080
1088
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1081
1089
|
*/
|
|
1082
|
-
"
|
|
1090
|
+
"errorMessage"?: string;
|
|
1083
1091
|
/**
|
|
1084
1092
|
* Label é o título do campo
|
|
1085
1093
|
*/
|
|
@@ -1122,6 +1130,10 @@ declare namespace LocalJSX {
|
|
|
1122
1130
|
* Offset left do popover em relação ao componente pai
|
|
1123
1131
|
*/
|
|
1124
1132
|
"left"?: string;
|
|
1133
|
+
/**
|
|
1134
|
+
* Evento disparado ao exibir/ocultar o componente.
|
|
1135
|
+
*/
|
|
1136
|
+
"onEzVisibilityChange"?: (event: CustomEvent<boolean>) => void;
|
|
1125
1137
|
/**
|
|
1126
1138
|
* Offset right do popover em relação ao componente pai
|
|
1127
1139
|
*/
|
|
@@ -1161,7 +1173,7 @@ declare namespace LocalJSX {
|
|
|
1161
1173
|
/**
|
|
1162
1174
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1163
1175
|
*/
|
|
1164
|
-
"
|
|
1176
|
+
"errorMessage"?: string;
|
|
1165
1177
|
/**
|
|
1166
1178
|
* Label é o título do campo
|
|
1167
1179
|
*/
|
|
@@ -1208,7 +1220,7 @@ declare namespace LocalJSX {
|
|
|
1208
1220
|
/**
|
|
1209
1221
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1210
1222
|
*/
|
|
1211
|
-
"
|
|
1223
|
+
"errorMessage"?: string;
|
|
1212
1224
|
/**
|
|
1213
1225
|
* Label é o título do campo
|
|
1214
1226
|
*/
|
|
@@ -1238,7 +1250,7 @@ declare namespace LocalJSX {
|
|
|
1238
1250
|
/**
|
|
1239
1251
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1240
1252
|
*/
|
|
1241
|
-
"
|
|
1253
|
+
"errorMessage"?: string;
|
|
1242
1254
|
/**
|
|
1243
1255
|
* Label é o título do campo
|
|
1244
1256
|
*/
|
|
@@ -1255,10 +1267,6 @@ declare namespace LocalJSX {
|
|
|
1255
1267
|
* Um evento disparado quando o estado do componente é alterado (onEzChange).
|
|
1256
1268
|
*/
|
|
1257
1269
|
"onEzChange"?: (event: CustomEvent<string>) => void;
|
|
1258
|
-
/**
|
|
1259
|
-
* Faz com que o componente só aceite números
|
|
1260
|
-
*/
|
|
1261
|
-
"onlynumber"?: boolean;
|
|
1262
1270
|
/**
|
|
1263
1271
|
* Restringe o que o usuário pode digitar. Cada caractere digitado será testado e deve estar contido nessa string ou será descartado.
|
|
1264
1272
|
*/
|
|
@@ -1276,7 +1284,7 @@ declare namespace LocalJSX {
|
|
|
1276
1284
|
/**
|
|
1277
1285
|
* Quando há um problema de validação, serve como orientação ao usuário
|
|
1278
1286
|
*/
|
|
1279
|
-
"
|
|
1287
|
+
"errorMessage"?: string;
|
|
1280
1288
|
/**
|
|
1281
1289
|
* Label é o título do campo
|
|
1282
1290
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/ezui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.68",
|
|
4
4
|
"description": "Biblioteca de componentes Sankhya.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/custom-elements/index.js",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"blob": "^0.1.0",
|
|
54
54
|
"blob-polyfill": "^6.0.20211015",
|
|
55
55
|
"http-server": "^0.12.3",
|
|
56
|
+
"jsdom": "^19.0.0",
|
|
56
57
|
"lodash": "^4.17.21",
|
|
57
58
|
"redux": "^4.1.2",
|
|
58
59
|
"redux-thunk": "^2.4.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as o}from"./p-762ac7a0.js";import"./p-9dfccb16.js";import{F as h}from"./p-ddd0ef12.js";let e=class{constructor(i){t(this,i),this._firstRender=!0,this.autoclose=!0,this.top="0px",this.left="0px",this.bottom="0px",this.right="0px",this.boxwidth="fit-content"}async updatePosition(t=this.top,i=this.left,s=this.bottom,o=this.right){h.updateFloatPosition(this._box,this._container,{autoClose:this.autoclose,top:t,left:i,bottom:s,right:o,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))})}async show(t=this.top,i=this.left,s=this.bottom,o=this.right){this._floatingID=h.float(this._box,this._container,{autoClose:this.autoclose,top:t,left:i,bottom:s,right:o,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))}),this.isOpened=!0}async hide(){void 0!==this._floatingID&&(h.close(this._floatingID),this._floatingID=void 0,this.isOpened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return i(s,null,i("section",{ref:t=>this._container=t},i("div",{class:"box "+("fit-content"===this.boxwidth?"box--fit-content":"box--full-width"),ref:t=>this._box=t},i("slot",null))))}get _host(){return o(this)}};e.style=":host{--pop__box--border-radius:var(--border--radius-medium, 12px);--pop__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--more-visible, 1);display:flex;flex-direction:column;height:fit-content;background-color:transparent;border-radius:var(--pop__box--border-radius);box-shadow:var(--pop__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";export{e as ez_popover}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as registerInstance,h,c as createEvent,f as forceUpdate,H as Host,g as getElement}from"./p-762ac7a0.js";import{N as NumberUtils,M as MaskFormatter}from"./p-9dfccb16.js";import{F as FloatingManager}from"./p-ddd0ef12.js";const ezButtonCss=":host{--bt--min-width:100px;--bt--height:42px;--bt__icon--width:18px;--bt__inline__icon--padding:12px;--bt--padding-top:var(--space--medium, 12px);--bt--padding-bottom:var(--space--medium, 12px);--bt--padding-right:var(--space--large, 24px);--bt--padding-left:var(--space--large, 24px);--bt--color:var(--text--inverted, #FFF);--bt--font-size:var(--text--medium, 14px);--bt--font-family:var(--font-pattern, Arial);--bt--font-weight:var(--text-weight--large);--bt--background-color:var(--color--primary, #c0c0c0);--bt--border-radius:var(--border--radius-large, 12px);--bt--border:none;--bt--hover--background-color:var(--color--primary-700, var(--bt--background-color));--bt--disabled-color:var(--text--disable);--bt--disabled--background-color:var(--color--disable-primary);--bt--focus--border:var(--bt--border);--bt--focus--box-shadow:none}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--bt--min-width);height:var(--bt--height);font-family:var(--bt--font-family);font-size:var(--bt--font-size);font-weight:var(--bt--font-weight);padding:var(--bt--padding-top) var(--bt--padding-right) var(--bt--padding-bottom) var(--bt--padding-left);border-radius:var(--bt--border-radius);background-color:var(--bt--background-color);color:var(--bt--color);fill:var(--bt--color);border:var(--bt--border)}button:hover{background-color:var(--bt--hover--background-color)}button:focus{outline:none;border:var(--bt--focus--border);box-shadow:var(--bt--focus--box-shadow)}button:disabled{background-color:var(--bt--disabled--background-color);color:var(--bt--disabled-color);fill:var(--bt--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px}a{font-family:var(--bt--font-family);font-size:var(--bt--font-size);font-weight:var(--bt--font-weight);cursor:pointer;display:flex;align-items:center;justify-content:center}";let EzButton=class{constructor(t){registerInstance(this,t),this.enabled=!0,this.mode="regular"}handleSlotChange(t){const e=t.target,i=e.assignedElements()[0];"link"==this.mode&&(i.style.display="inline","leftIcon"==e.name?i.style.paddingRight="var(--bt__inline__icon--padding)":"rightIcon"==e.name&&(i.style.paddingLeft="var(--bt__inline__icon--padding)"))}render(){return"icon"==this.mode?h("button",{class:"icon",type:"button",disabled:!this.enabled},h("ez-icon",{class:"icon",href:this.image,size:"large",onClick:t=>{this.enabled||t.stopPropagation()}})):"link"==this.mode?h("a",null,h("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,h("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}})):h("button",{type:"button",disabled:!this.enabled},h("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,h("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}))}};EzButton.style=ezButtonCss;class DateUtils{static clearTime(t,e=!0){const i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0);return e?DateUtils.adjustDLST(i):i}static strToDate(t,e=!0,i=!1){let r;if(r=i?/^(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(t):/^(3[01]|[1-2]\d|0[1-9]|[1-9])[^\d]?(1[0-2]|0[1-9]|[1-9])[^\d]?(\d{2}|\d{4})(?:\s(\d{1,2}):(\d{1,2}):?(\d{0,2}))?$/.exec(t),!r)return;var a=i?1:Number(r[1]),o=Number(r[i?1:2]),n=Number(r[i?2:3]),s=Number(r[i?3:4]||0),l=Number(r[i?4:5]||0),c=Number(r[i?5:6]||0);n<100&&(n+=n<30?2e3:1900);let d=new Date(n,o-1,a,s,l,c,0);return!0!==e||i||0!=s||(d=DateUtils.adjustDLST(d)),d}static adjustDLST(t){return 23==t.getHours()?new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,1,0,0,0):t}}const ezCalendarCss=':host{--cal--font-family:var(--font-pattern, Arial);--cal--color:var(--title--primary, #626e82);--cal--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--cal__body--background-color:var(--background--xlight, #FFF);--cal__body--padding:var(--space--medium, 12px);--cal__body--border-radius:var(--border--radius-medium, 12px);--cal__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--cal__header-line--stroke:2px;--cal__header-line--color:var(--color--strokes, #C0C0C0);--cal__nav-btn--fill:var(--text--primary, #008561);--cal__nav-btn--hover--fill:var(--color--primary, #350404);--cal__nav-btn--width:10px;--cal__nav-btn--height:16px;--cal__nav-btn--previous-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--cal__nav-btn--next-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');--cal__cell--margin:0px var(--space--small, 12px);--cal__cell--width:var(--space--large, 24px);--cal__cell--padding:var(--space--extra-small, 3px) 0px;--cal__cell--border-radius:var(--border--radius-small, 6px);--cal__cell--over--background-color:var(--color--strokes, #C0C0C0);--cal__cell--outset--color:var(--color--strokes, #C0C0C0);--cal__cell--selected--background-color:var(--color--primary, #008561);--cal__cell--selected--color:var(--color--inverted, #FFF);--cal__btn-today--color:var(--color--primary);--cal__btn-today--hover--background-color:var(--color--strokes, #C0C0C0);--cal__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--cal__body--background-color);padding:var(--cal__body--padding);border-radius:var(--cal__body--border-radius);box-shadow:var(--cal__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow);border-bottom:solid var(--cal__header-line--stroke) var(--cal__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:\'\';display:flex;background-color:var(--cal__nav-btn--fill);width:var(--cal__nav-btn--width);height:var(--cal__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--cal__nav-btn--previous-image);mask-image:var(--cal__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--cal__nav-btn--next-image);mask-image:var(--cal__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--cal__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow);padding:var(--cal__cell--padding);margin:var(--cal__cell--margin);min-width:var(--cal__cell--width);border-radius:var(--cal__cell--border-radius)}.calendar__cell:hover{background-color:var(--cal__cell--over--background-color)}.calendar__cell--secondary{color:var(--cal__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--cal--font-family);color:var(--cal--color);text-shadow:var(--cal--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--cal__cell--selected--background-color);color:var(--cal__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--cal--font-family);text-shadow:var(--cal--text-shadow);color:var(--cal__btn-today--color);border-radius:var(--cal__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--cal__btn-today--hover--background-color)}';let EzCalendar=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this._firstRender=!0,this._todayLabel="Hoje",this._weekDayLabels=["D","S","T","Q","Q","S","S"],this._monthLabels=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],this.value=new Date,this.floating=!1}async show(t,e,i,r){this.floating&&(this._floatingID=FloatingManager.float(this._box,this._container,{autoClose:!0,top:t,left:e,bottom:i,right:r}),window.requestAnimationFrame((()=>{this._box.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}async fitVertical(t,e){const i=this._container.getBoundingClientRect().bottom+this._calendarHeight;(window.innerHeight||document.documentElement.clientHeight)>i?this.show(t+"px",void 0,"unset"):this.show("unset",void 0,e+"px")}async hide(){void 0!==this._floatingID&&(FloatingManager.close(this._floatingID),this._floatingID=void 0)}valueChanged(){this.value&&(this._currentPosition.setTime(this.value.getTime()),this._currentPosition.setDate(1))}getMonthLabel(){return this._monthLabels[this._currentPosition.getMonth()]+" "+this._currentPosition.getFullYear()}isSelectedDate(t){return!!this.value&&this.value.getDate()==t.getDate()&&this.value.getMonth()==t.getMonth()&&this.value.getFullYear()==t.getFullYear()}changeMonth(t){this._currentPosition.setMonth(this._currentPosition.getMonth()+t),forceUpdate(this)}selectDate(t){this.value=t,this.ezChange.emit()}componentDidRender(){this.floating&&this._firstRender&&(this._calendarHeight=this._box.clientHeight,this._box.remove(),this._firstRender=!1)}render(){null==this._currentPosition&&(this._currentPosition=new Date,this._currentPosition.setTime(this.value.getTime()),this._currentPosition.setDate(1));const t=new Date;return t.setTime(this._currentPosition.getTime()),t.setDate(1-t.getDay()),h("section",{ref:t=>this._container=t},h("div",{class:"calendar",ref:t=>this._box=t},h("div",{class:"calendar__header"},h("button",{class:"calendar__btn-previous",onClick:()=>this.changeMonth(-1)}),h("label",{class:"calendar__lbl-month"},this.getMonthLabel()),h("button",{class:"calendar__btn-next",onClick:()=>this.changeMonth(1)})),h("div",{class:"calendar__body"},h("div",{class:"calendar__line"},this._weekDayLabels.map((t=>h("div",{class:"calendar__cell calendar__cell--unselectable"},t)))),[0,7,14,21,28,35].map((e=>h("div",{class:"calendar__line"},[0,1,2,3,4,5,6].map((i=>{const r=new Date;r.setTime(t.getTime()),r.setDate(r.getDate()+e+i);let a="calendar__cell";return this._currentPosition.getMonth()!=r.getMonth()?a+=" calendar__cell--secondary":this.isSelectedDate(r)&&(a+=" calendar__cell--selected"),h("div",{class:a,onClick:()=>this.selectDate(r)},r.getDate())})))))),h("div",{class:"calendar__footer"},h("button",{class:"calendar__btn-today",onClick:()=>this.selectDate(new Date)},this._todayLabel))))}static get watchers(){return{value:["valueChanged"]}}};EzCalendar.style=ezCalendarCss;const ezCheckCss=':host{--chk--box--width:18px;--chk--box--height:18px;--chk--width:calc(var(--chk--box--width) + 14px);--chk--height:calc(var(--chk--box--width) + 14px);--chk--border-radius:var(--border--radius-small);--chk--checked--background-color:var(--color--primary-200);--chk--focus--background-color:var(--color--strokes, #FFFFFF);--chk--hover--background-color:var(--background--medium);--chk--checked--disabled--background-color:var(--color--disable-secondary);--chk--border:var(--border--medium) var(--title--primary);--chk--disabled--border:var(--border--medium) var(--color--strokes);--chk--checked--border:var(--border--medium) var(--color--primary);--chk--checked--hover--background-color:var(--color--primary-200);--chk--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--chk--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--chk--check--background-color:var(--color--primary);--chk--check--disabled--background-color:var(--color--strokes);--swt--slider--width:34px;--swt--slider--height:14px;--swt--pin--width:20px;--swt--pin--height:20px;--swt--focus--width:32px;--swt--focus--height:32px;--swt--background-color:var(--color--strokes);--swt--disabled--background-color:var(--color--disable-secondary);--swt--checked--background-color:var(--color--primary-300);--swt--pin--background-color:var(--background--xlight);--swt--pin--disabled--background-color:var(--color--disable-secondary);--swt--pin--checked--background-color:var(--color--primary);--swt--pin--checked--disabled--background-color:#E8F7F4;--swt--pin--focus--background-color:var(--text--disable);--swt--pin--checked--focus--background-color:var(--color--primary);--chk--label--font-size:var(--text--medium, 14px);--chk--label--font-family:var(--font-pattern, Arial);--chk--label--color:var(--title--primary, #000);--chk--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--chk--width);height:var(--chk--height)}input.regularMode:enabled:hover{background-color:var(--chk--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--chk--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:"";display:block;width:var(--chk--box--width);height:var(--chk--box--height);border-radius:var(--chk--border-radius);border:var(--chk--border)}input.regularMode:disabled::before{border:var(--chk--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--chk--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--chk--checked--focus--background-color)}input.regularMode:checked::before{border:var(--chk--checked--border);background-color:var(--chk--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--chk--disabled--border);background-color:var(--chk--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:"";background-color:var(--chk--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--chk--check--image);mask-image:var(--chk--check--image)}input.regularMode:checked:disabled::after{background-color:var(--chk--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--swt--slider--width);height:var(--swt--slider--height);background-color:var(--swt--background-color)}input.switchMode:disabled{background-color:var(--swt--disabled--background-color)}input.switchMode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--swt--pin--width);height:var(--swt--pin--height);background-color:var(--swt--pin--background-color)}input.switchMode:disabled::after{background-color:var(--swt--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--swt--checked--background-color)}input.switchMode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--swt--focus--width);height:var(--swt--focus--height);top:calc((var(--swt--slider--height) - var(--swt--focus--height)) / 2);left:calc((var(--swt--pin--width) - var(--swt--focus--width))/2);background-color:var(--swt--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--swt--pin--checked--focus--background-color);transform:translateX(calc(var(--swt--slider--width) - var(--swt--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--swt--slider--width) - var(--swt--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--swt--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--swt--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--chk--label--color);text-shadow:var(--text-shadow);font-size:var(--chk--label--font-size);font-family:var(--chk--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--chk--label--disabled--color)}';let EzCheck=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0,this.mode="regular"}adjustMode(){"switch"===this.mode?(this._inputElem.classList.remove("regularMode"),this._inputElem.classList.add("switchMode")):(this._inputElem.classList.remove("switchMode"),this._inputElem.classList.add("regularMode"))}async getMode(){return this.mode}async setFocus(){this._inputElem.focus()}componentDidLoad(){this.adjustMode()}changeValue(){this.value=!this.value,this.ezChange.emit()}getLabelClasses(){let t="label";return this.enabled||(t+=" label--disabled"),t}render(){return h(Host,null,h("input",{type:"checkbox",class:"regularMode",checked:!0===this.value,onChange:()=>{this.changeValue()},disabled:!this.enabled,ref:t=>this._inputElem=t}),this.label?h("label",{class:this.getLabelClasses(),onClick:()=>{this.changeValue()},title:this.label},this.label):null)}static get watchers(){return{mode:["adjustMode"]}}};EzCheck.style=ezCheckCss;const ezCollapsibleBoxCss=':host{--collapsible-box--height:42px;--collapsible-box--font-size:var(--title--medium, 14px);--collapsible-box--font-family:var(--font-pattern, Arial);--collapsible-box--font-weight:var(--text-weight--large, 600);--collapsible-box--color:var(--title--primary);--collapsible-box__btn--image--xsmall:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="12px" width="7.5px"><path d="M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z"/></svg>\');--collapsible-box__btn--image--small:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="14px" width="8.68px"><path d="M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z"/></svg>\');--collapsible-box__btn--image--medium:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');--collapsible-box__btn--image--large:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="18px" width="11.25px"><path d="M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z"/></svg>\');--collapsible-box__btn--image--xlarge:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="20px" width="12.5px"><path d="M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z"/></svg>\');--collapsible-box__btn--fill:var(--collapsible-box--color);--collapsible-box__btn--width:10px;--collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:\'\';display:flex;background-color:var(--collapsible-box__btn--fill);width:var(--collapsible-box__btn--width);height:var(--collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--collapsible-box__btn--image--xsmall);mask-image:var(--collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--collapsible-box__btn--image--small);mask-image:var(--collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--collapsible-box__btn--image--medium);mask-image:var(--collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--collapsible-box__btn--image--large);mask-image:var(--collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--collapsible-box__btn--image--xlarge);mask-image:var(--collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}';let EzCollapsibleBox=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.value=!1,this.headersize="small",this.iconplacement="left"}observeValue(){this.ezChange.emit()}async showHide(){this.value=!this.value}render(){return h(Host,null,"right"==this.iconplacement?h("div",{class:"collapsible-box__title"},h("label",{class:("right"==this.iconplacement?"collapsible-box__label--icon-right ":"collapsible-box__label ")+(this.headersize?"font--"+this.headersize:""),onClick:()=>this.showHide(),title:this.label},this.label),h("button",{class:this.value?"collapsible-box__btn collapsible-box__btn--collapsed collapsible-box__btn--"+this.headersize:"collapsible-box__btn collapsible-box__btn--"+this.headersize,onClick:()=>this.showHide()})):h("div",{class:"collapsible-box__title"},h("button",{class:this.value?"collapsible-box__btn collapsible-box__btn--collapsed collapsible-box__btn--"+this.headersize:"collapsible-box__btn collapsible-box__btn--"+this.headersize,onClick:()=>this.showHide()}),h("label",{class:("right"==this.iconplacement?"collapsible-box__label--icon-right ":"collapsible-box__label ")+(this.headersize?"font--"+this.headersize:""),onClick:()=>this.showHide(),title:this.label},this.label)),this.value?null:h("slot",null))}static get watchers(){return{value:["observeValue"]}}};EzCollapsibleBox.style=ezCollapsibleBoxCss;const ezComboBoxCss=':host{--cx--height:42px;--cx--width:100%;--cx__icon--width:48px;--cx--border-radius:var(--border--radius-medium, 12px);--cx--border-radius-small:var(--border--radius-small, 6px);--cx--font-size:var(--text--medium, 14px);--cx--font-family:var(--font-pattern, Arial);--cx--font-weight--large:var(--text-weight--large, 500);--cx--font-weight--medium:var(--text-weight--medium, 400);--cx--background-color--xlight:var(--background--xlight, #fff);--cx__input--background-color:var(--background--medium, #e0e0e0);--cx__input--border:var(--border--medium, 2px solid);--cx__input--border-color:var(--cx__input--background-color);--cx__input--focus--border-color:var(--color--primary, #008561);--cx__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--cx__input--disabled--color:var(--text--disable, #AFB6C0);--cx__input--error--border-color:#CC2936;--cx__label--color:var(--title--primary, #919191);--cx__list-text--primary:var(--text--primary, #626e82);--cx__list-height:calc(var(--cx--font-size) + var(--cx--space--medium));--cx--drop-down__image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="16px"><path d="M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z"/></svg>\');--cx--search__image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="22px" width="22px"><path d="m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z"/></svg>\');--cx--space--medium:var(--space--medium, 12px);--cx--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--cx--width)}ez-text-input{--it__input--background-color:var(--cx__input--background-color, #FFFFFF);--it__input--border-color:var(--cx__input--border-color, #DCE0E8)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--cx--background-color--xlight);padding:var(--cx--space--small);border-radius:var(--cx--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--cx__list-height) + 2*var(--cx--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--cx--border-radius-small);padding:0 var(--cx--space--small);list-style-type:none;min-height:var(--cx__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--cx__list-text--primary);font-weight:var(--cx--font-weight--large);font-family:var(--cx--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--cx__list-text--primary);font-weight:var(--cx--font-weight--large);font-family:var(--cx--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--background--medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:16px;height:16px;-webkit-mask-image:var(--cx--drop-down__image);mask-image:var(--cx--drop-down__image)}.btn-open-options:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-options:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:22px;height:22px;-webkit-mask-image:var(--cx--search__image);mask-image:var(--cx--search__image)}.btn-open-search:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-search:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}';let EzComboBox=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0,this.showselectedvalue=!1,this.showoptionvalue=!1}internalUpdate(){this._inputElement&&(this._inputElement.value=this.getText()),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}getText(){let t="";const e=this.getSelectedOption();return e&&(t=this.showselectedvalue?`${e.value} - ${e.label}`:e.label),t}getSelectedOption(){return"string"==typeof this.value||this.value instanceof String?this._visibleOptions.find((t=>t.value===this.value)):this.value}updateVisibleOptions(){let t=this._source||[];if(!this.searchmode&&this._criteria){const e=this._criteria.toUpperCase();t=t.filter((t=>t.label.toLocaleUpperCase().indexOf(e)>-1))}this._visibleOptions=[{value:null,label:""}].concat(t)}buildItem(t,e){return h("li",{class:e===this._preSelection?"item preselected":"item",id:`item_${t.value}`,onMouseDown:()=>this.selectOption(t),onMouseOver:()=>this._preSelection=void 0},h("span",{class:"item--label",title:t.label},t.label),this.showoptionvalue?h("span",{class:"item--value",title:t.value},t.value):null)}showOptions(){this.enabled&&(this._floatingID=FloatingManager.float(this._optionsList,this._listContainer,{autoClose:!0,top:this.errormessage?"0px":"-17px"}),window.requestAnimationFrame((()=>{this._optionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&FloatingManager.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&FloatingManager.isFloating(this._floatingID)}nextOption(){this.searchmode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(t,e){window.requestAnimationFrame((()=>{const i=this._optionsList.querySelector(`li#item_${t.value}`);if(i){const t=i.parentElement,r=t.getBoundingClientRect(),a=i.getBoundingClientRect();e&&a.bottom>r.bottom?t.scrollTop=a.top:!e&&a.top<r.top&&(t.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection&&(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0)}selectOption(t){if(this.getSelectedOption()!==t){const e=(null==t?void 0:t.value)?t:null;this.value=e,this.ezChange.emit(e)}else this.internalUpdate()}updateSource(t){t instanceof Promise?(t.then((t=>this.updateSource(t))),this.updateVisibleOptions()):(this._source=t,this.updateVisibleOptions())}loadOptions(t,e=""){this._criteria=e,this.updateSource(this.optionloader?this.optionloader({mode:t,argument:e}):this.options)}cancelPreselection(){!this._inputElement.value&&this.value?this.selectOption(null):this.internalUpdate()}componentWillLoad(){if(void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let e=t.innerText,i=t.getAttribute("value");i||(i=e),this.options.push({label:e,value:i}),t.hidden=!0}))}this.searchmode?this.updateSource([]):this.loadOptions("PRELOAD")}componentDidRender(){void 0===this._floatingID&&this._optionsList.remove()}onTextInputChangeHandler(t){this._criteria||(this._inputElement.value=t.data);const e=t.target.value;this._criteria=e,this._criteria&&(this.searchmode?(this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions("PREDICTIVE",e)}),200)):this.updateVisibleOptions(),this.showOptions())}onTextInputClickHandler(){this.searchmode||this.showOptions()}keyDownHandler(t){switch(t.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection()}t.stopPropagation()}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){return h(Host,null,h("ez-text-input",{ref:t=>this._inputElement=t,enabled:this.enabled,onInput:t=>this.onTextInputChangeHandler(t),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onEzChange:t=>t.stopPropagation(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,value:this.getText(),errormessage:this.errormessage},h("button",this.searchmode?{disabled:!this.enabled,tabindex:-1,class:"btn-open-search",onClick:()=>{this.loadOptions("ADVANCED")},slot:"leftIcon"}:{disabled:!this.enabled,tabindex:-1,class:"btn-open-options",slot:"rightIcon",onClick:()=>this.showOptions()})),h("section",{class:"list-container",ref:t=>this._listContainer=t},h("div",{class:"options-list",ref:t=>this._optionsList=t},this._visibleOptions.map(((t,e)=>this.buildItem(t,e))))))}get el(){return getElement(this)}static get watchers(){return{value:["internalUpdate"]}}};EzComboBox.style=ezComboBoxCss;const ezDateInputCss=':host{display:block;width:100%;--it__input--background-color:var(--background--medium, #e0e0e0);--it__input--border-color:var(--it__input--background-color);--di__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.text-input{--it__input--background-color:inherit;--it__input--border-color:inherit}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--di__calendar-image);mask-image:var(--di__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}';let EzDateInput=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errormessage=this.errormessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}changeValue(t){t=null==t?null:DateUtils.clearTime(t),this._textInput.errormessage="",this.getTextValue(t)!==this.getTextValue(this.value)&&(this.value=t,this.ezChange.emit())}showCalendar(){this.parseDate(),this._calendar.value=this.value,this._calendar.fitVertical(this._textInput.errormessage?0:-17,this._elem.clientHeight)}hideCalendar(){this.changeValue(this._calendar.value),this._calendar.hide()}parseDate(){const t=this._textInput.value,e=DateUtils.strToDate(t);e||!t?this.changeValue(this.value===e?this.value:e):this._textInput.errormessage="O valor digitado não é uma data válida"}getTextValue(t){return t?new Intl.DateTimeFormat("pt-BR").format(t):null}render(){return h(Host,null,h("ez-text-input",{class:"text-input",ref:t=>this._textInput=t,onBlur:()=>this.parseDate(),onKeyDown:t=>{"H"!==t.key&&"h"!==t.key||this.changeValue(new Date)},label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:"0123456789/",enabled:this.enabled,errormessage:this.errormessage},h("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>this.showCalendar(),slot:"leftIcon"})),h("ez-calendar",{onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},floating:!0,ref:t=>this._calendar=t}))}get _elem(){return getElement(this)}static get watchers(){return{label:["setLabel"],errormessage:["setErrorMessage"],value:["applyValueToInput"]}}};function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ownKeys(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(i),!0).forEach((function(e){_defineProperty(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function formatProdErrorMessage(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}EzDateInput.style=ezDateInputCss;var $$observable="function"==typeof Symbol&&Symbol.observable||"@@observable",randomString=function(){return Math.random().toString(36).substring(7).split("").join(".")},ActionTypes={INIT:"@@redux/INIT"+randomString(),REPLACE:"@@redux/REPLACE"+randomString(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+randomString()}};function isPlainObject(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function createStore(t,e,i){var r;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(formatProdErrorMessage(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(formatProdErrorMessage(1));return i(createStore)(t,e)}if("function"!=typeof t)throw new Error(formatProdErrorMessage(2));var a=t,o=e,n=[],s=n,l=!1;function c(){s===n&&(s=n.slice())}function d(){if(l)throw new Error(formatProdErrorMessage(3));return o}function h(t){if("function"!=typeof t)throw new Error(formatProdErrorMessage(4));if(l)throw new Error(formatProdErrorMessage(5));var e=!0;return c(),s.push(t),function(){if(e){if(l)throw new Error(formatProdErrorMessage(6));e=!1,c();var i=s.indexOf(t);s.splice(i,1),n=null}}}function u(t){if(!isPlainObject(t))throw new Error(formatProdErrorMessage(7));if(void 0===t.type)throw new Error(formatProdErrorMessage(8));if(l)throw new Error(formatProdErrorMessage(9));try{l=!0,o=a(o,t)}finally{l=!1}for(var e=n=s,i=0;i<e.length;i++)(0,e[i])();return t}function b(t){if("function"!=typeof t)throw new Error(formatProdErrorMessage(10));a=t,u({type:ActionTypes.REPLACE})}function p(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(formatProdErrorMessage(11));function i(){t.next&&t.next(d())}return i(),{unsubscribe:e(i)}}})[$$observable]=function(){return this},t}return u({type:ActionTypes.INIT}),(r={dispatch:u,subscribe:h,getState:d,replaceReducer:b})[$$observable]=p,r}function assertReducerShape(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ActionTypes.INIT}))throw new Error(formatProdErrorMessage(12));if(void 0===i(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()}))throw new Error(formatProdErrorMessage(13))}))}function combineReducers(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++){var a=e[r];"function"==typeof t[a]&&(i[a]=t[a])}var o,n=Object.keys(i);try{assertReducerShape(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var r=!1,a={},s=0;s<n.length;s++){var l=n[s],c=t[l],d=(0,i[l])(c,e);if(void 0===d)throw new Error(formatProdErrorMessage(14));a[l]=d,r=r||d!==c}return(r=r||n.length!==Object.keys(t).length)?a:t}}function compose(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function applyMiddleware(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),r=function(){throw new Error(formatProdErrorMessage(15))},a={getState:i.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(a)}));return r=compose.apply(void 0,o)(i.dispatch),_objectSpread2(_objectSpread2({},i),{},{dispatch:r})}}}function createThunkMiddleware(t){return function(e){var i=e.dispatch,r=e.getState;return function(e){return function(a){return"function"==typeof a?a(i,r,t):e(a)}}}}var thunk=createThunkMiddleware();function changeFieldValue$1(t,e,i,r){return{type:"FORM/CHANGEFIELD",payload:{dataUnit:t,recordId:e,fieldName:i,value:r}}}function changeTab$1(t,e){return{type:"FORM/CHANGETAB",payload:{formId:t,index:e}}}function clearEdition$1(t,e){return{type:"FORM/CLEAREDITION",payload:{dataUnit:t,recordsLimit:e}}}function collapseExpandGroup(t,e){return{type:"FORM/COLLAPSEGROUP",payload:{collapseId:t,collapsed:e}}}function previousRecord(t){return{type:"FORM/NAVIGATE",payload:{dataUnit:t,limit:0,backward:!0}}}function nextRecord(t,e){return{type:"FORM/NAVIGATE",payload:{dataUnit:t,limit:e,backward:!1}}}function insertRecord$1(t,e){return{type:"FORM/INSERT",payload:{dataUnit:t,insertionIndex:e}}}function formLoad(){return{type:"FORM/LOAD"}}function dataLoading$1(t){return{type:"FORM/DATALOADING",payload:{dataUnit:t}}}function savingChanges$1(t){return{type:"FORM/SAVINGCHANGES",payload:{dataUnit:t}}}function dataLoaded$1(t){return{type:"FORM/DATALOADED",payload:{dataUnit:t}}}function changesSaved$1(t){return{type:"FORM/CHANGESSAVED",payload:{dataUnit:t}}}function removingRecord$1(t){return{type:"FORM/REMOVINGRECORD",payload:{dataUnit:t}}}function recordRemoved$1(t){return{type:"FORM/RECORDREMOVED",payload:{dataUnit:t}}}function invalidField$1(t,e,i,r,a,o,n){return{type:"FORM/INVALIDFIELD",payload:{tabController:t,tabIndex:e,dataUnit:i,recordId:a,recordIndex:r,fieldName:o,errorMessage:n}}}function showHideNavigationButtons(t,e){return{type:"FORM/SHOWHIDENAVBTN",payload:{buttonName:t,status:e}}}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e,i){return t(i={path:e,exports:{},require:function(){return commonjsRequire()}},i.exports),i.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}thunk.withExtraArgument=createThunkMiddleware;var actions=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionCreators=e.ActionTypes=void 0;var i={UNDO:"@@redux-undo/UNDO",REDO:"@@redux-undo/REDO",JUMP_TO_FUTURE:"@@redux-undo/JUMP_TO_FUTURE",JUMP_TO_PAST:"@@redux-undo/JUMP_TO_PAST",JUMP:"@@redux-undo/JUMP",CLEAR_HISTORY:"@@redux-undo/CLEAR_HISTORY"};e.ActionTypes=i,e.ActionCreators={undo:function(){return{type:i.UNDO}},redo:function(){return{type:i.REDO}},jumpToFuture:function(t){return{type:i.JUMP_TO_FUTURE,index:t}},jumpToPast:function(t){return{type:i.JUMP_TO_PAST,index:t}},jump:function(t){return{type:i.JUMP,index:t}},clearHistory:function(){return{type:i.CLEAR_HISTORY}}}})),helpers=createCommonjsModule((function(t,e){function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(t)?t:"string"==typeof t?[t]:e}Object.defineProperty(e,"__esModule",{value:!0}),e.parseActions=i,e.isHistory=function(t){return void 0!==t.present&&void 0!==t.future&&void 0!==t.past&&Array.isArray(t.future)&&Array.isArray(t.past)},e.includeAction=function(t){var e=i(t);return function(t){return e.indexOf(t.type)>=0}},e.excludeAction=function(t){var e=i(t);return function(t){return e.indexOf(t.type)<0}},e.combineFilters=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return e.reduce((function(t,e){return function(i,r,a){return t(i,r,a)&&e(i,r,a)}}),(function(){return!0}))},e.groupByActionTypes=function(t){var e=i(t);return function(t){return e.indexOf(t.type)>=0?t.type:null}},e.newHistory=function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{past:t,present:e,future:i,group:r,_latestUnfiltered:e,index:t.length,limit:t.length+i.length+1}}})),debug=createCommonjsModule((function(t,e){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var r,a;Object.defineProperty(e,"__esModule",{value:!0}),e.set=function(t){r=t},e.start=function(t,e){a={header:[],prev:[],action:[],next:[],msgs:[]},r&&(console.group?(a.header=["%credux-undo","font-style: italic","action",t.type],a.action=l("action",n,t),a.prev=l("prev history",o,e)):(a.header=["redux-undo action",t.type],a.action=["action",t],a.prev=["prev history",e]))},e.end=function(t){var e,o,n,c,d,h,u,b,p,g,v,f,m,x,_;r&&(a.next=console.group?l("next history",s,t):["next history",t],v=a.header,f=a.prev,m=a.next,x=a.action,_=a.msgs,console.group?((e=console).groupCollapsed.apply(e,i(v)),(o=console).log.apply(o,i(f)),(n=console).log.apply(n,i(x)),(c=console).log.apply(c,i(m)),(d=console).log.apply(d,i(_)),console.groupEnd()):((h=console).log.apply(h,i(v)),(u=console).log.apply(u,i(f)),(b=console).log.apply(b,i(x)),(p=console).log.apply(p,i(m)),(g=console).log.apply(g,i(_))))},e.log=function(){if(r){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a.msgs=a.msgs.concat([].concat(e,["\n"]))}};var o="#9E9E9E",n="#03A9F4",s="#4CAF50";function l(t,e,i){return["%c".concat(t),"color: ".concat(e,"; font-weight: bold"),i]}})),reducer=createCommonjsModule((function(t,e){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.set(e.debug);var i,a=n({limit:void 0,filter:function(){return!0},groupBy:function(){return null},undoType:actions.ActionTypes.UNDO,redoType:actions.ActionTypes.REDO,jumpToPastType:actions.ActionTypes.JUMP_TO_PAST,jumpToFutureType:actions.ActionTypes.JUMP_TO_FUTURE,jumpType:actions.ActionTypes.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1},e,{initTypes:(0,helpers.parseActions)(e.initTypes,["@@redux-undo/INIT"]),clearHistoryType:(0,helpers.parseActions)(e.clearHistoryType,[actions.ActionTypes.CLEAR_HISTORY])}),o=a.neverSkipReducer?function(e,i){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return n({},e,{present:t.apply(void 0,[e.present,i].concat(a))})}:function(t){return t};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.start(n,e);for(var s,l=e,g=arguments.length,v=new Array(g>2?g-2:0),f=2;f<g;f++)v[f-2]=arguments[f];if(!i){if(r.log("history is uninitialized"),void 0===e){var m={type:"@@redux-undo/CREATE_HISTORY"},x=t.apply(void 0,[e,m].concat(v));return l=c(x,a.ignoreInitialState),r.log("do not set initialState on probe actions"),r.end(l),l}(0,helpers.isHistory)(e)?(l=i=a.ignoreInitialState?e:(0,helpers.newHistory)(e.past,e.present,e.future),r.log("initialHistory initialized: initialState is a history",i)):(l=i=c(e,a.ignoreInitialState),r.log("initialHistory initialized: initialState is not a history",i))}switch(n.type){case void 0:return l;case a.undoType:return s=b(l,-1),r.log("perform undo"),r.end(s),o.apply(void 0,[s,n].concat(v));case a.redoType:return s=b(l,1),r.log("perform redo"),r.end(s),o.apply(void 0,[s,n].concat(v));case a.jumpToPastType:return s=u(l,n.index),r.log("perform jumpToPast to ".concat(n.index)),r.end(s),o.apply(void 0,[s,n].concat(v));case a.jumpToFutureType:return s=h(l,n.index),r.log("perform jumpToFuture to ".concat(n.index)),r.end(s),o.apply(void 0,[s,n].concat(v));case a.jumpType:return s=b(l,n.index),r.log("perform jump to ".concat(n.index)),r.end(s),o.apply(void 0,[s,n].concat(v));case p(n.type,a.clearHistoryType):return s=c(l.present,a.ignoreInitialState),r.log("perform clearHistory"),r.end(s),o.apply(void 0,[s,n].concat(v));default:if(s=t.apply(void 0,[l.present,n].concat(v)),a.initTypes.some((function(t){return t===n.type})))return r.log("reset history due to init action"),r.end(i),i;if(l._latestUnfiltered===s)return l;var _="function"==typeof a.filter&&!a.filter(n,s,l);if(_){var w=(0,helpers.newHistory)(l.past,s,l.future,l.group);return a.syncFilter||(w._latestUnfiltered=l._latestUnfiltered),r.log("filter ignored action, not storing it in past"),r.end(w),w}var y=a.groupBy(n,s,l);if(null!=y&&y===l.group){var k=(0,helpers.newHistory)(l.past,s,l.future,l.group);return r.log("groupBy grouped the action with the previous action"),r.end(k),k}return l=d(l,s,a.limit,y),r.log("inserted new state into history"),r.end(l),l}}};var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=o?Object.getOwnPropertyDescriptor(t,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=t[n]}return r.default=t,e&&e.set(t,r),r}(debug);function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function n(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(t,e){var i=(0,helpers.newHistory)([],t,[]);return e&&(i._latestUnfiltered=null),i}function d(t,e,i,a){var o=t.past.length+1;r.log("inserting",e),r.log("new free: ",i-o);var n=t._latestUnfiltered,s=t.past.slice(i&&i<=o?1:0),c=null!=n?[].concat(l(s),[n]):s;return(0,helpers.newHistory)(c,e,[],a)}function h(t,e){if(e<0||e>=t.future.length)return t;var i=t.future,r=t._latestUnfiltered,a=[].concat(l(t.past),[r],l(i.slice(0,e))),o=i[e],n=i.slice(e+1);return(0,helpers.newHistory)(a,o,n)}function u(t,e){if(e<0||e>=t.past.length)return t;var i=t.past,r=t.future,a=t._latestUnfiltered,o=i.slice(0,e),n=[].concat(l(i.slice(e+1)),[a],l(r));return(0,helpers.newHistory)(o,i[e],n)}function b(t,e){return e>0?h(t,e-1):e<0?u(t,t.past.length+e):t}function p(t,e){return e.indexOf(t)>-1?t:!t}})),lib=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ActionTypes",{enumerable:!0,get:function(){return actions.ActionTypes}}),Object.defineProperty(e,"ActionCreators",{enumerable:!0,get:function(){return actions.ActionCreators}}),Object.defineProperty(e,"parseActions",{enumerable:!0,get:function(){return helpers.parseActions}}),Object.defineProperty(e,"isHistory",{enumerable:!0,get:function(){return helpers.isHistory}}),Object.defineProperty(e,"includeAction",{enumerable:!0,get:function(){return helpers.includeAction}}),Object.defineProperty(e,"excludeAction",{enumerable:!0,get:function(){return helpers.excludeAction}}),Object.defineProperty(e,"combineFilters",{enumerable:!0,get:function(){return helpers.combineFilters}}),Object.defineProperty(e,"groupByActionTypes",{enumerable:!0,get:function(){return helpers.groupByActionTypes}}),Object.defineProperty(e,"newHistory",{enumerable:!0,get:function(){return helpers.newHistory}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.default}});var i,r=(i=reducer)&&i.__esModule?i:{default:i}}));const undoable=getDefaultExportFromCjs(lib),inicialHistState={currentTabIndex:{},currentRecordIndex:{},changes:{},collapsedGroups:{},newRecordIndex:{}},inicialNonHistState={dataLoading:{},invalidFields:{},visibleButtons:{previousVisible:!0,nextVisible:!0,addVisible:!0,removeVisible:!0,saveVisible:!0,cancelVisible:!0,reloadVisible:!1}};function formReducer(t=inicialHistState,e){switch(e.type){case"FORM/COLLAPSEGROUP":return collapseGroup(t,e.payload);case"FORM/CHANGETAB":return changeTab(t,e.payload.formId,e.payload.index);case"FORM/NAVIGATE":return navigate(t,e.payload);case"FORM/INSERT":return insertRecord(t,e.payload);case"FORM/CHANGEFIELD":return changeFieldValue(t,e.payload);case"FORM/CLEAREDITION":return clearEdition(t,e.payload);case"FORM/INVALIDFIELD":return navigateToInvalid(t,e.payload);default:return t}}function formNonHistoricReducer(t=inicialNonHistState,e){switch(e.type){case"FORM/DATALOADING":return dataLoading(t,e.payload);case"FORM/DATALOADED":return dataLoaded(t,e.payload);case"FORM/SAVINGCHANGES":return savingChanges(t,e.payload);case"FORM/CHANGESSAVED":return changesSaved(t,e.payload);case"FORM/REMOVINGRECORD":return removingRecord(t,e.payload);case"FORM/RECORDREMOVED":return recordRemoved(t,e.payload);case"FORM/INVALIDFIELD":return invalidField(t,e.payload);case"FORM/CLEAREDITION":return clearAllInvalidFields(t,e.payload);case"FORM/CHANGEFIELD":return clearInvalidField(t,e.payload);case"FORM/SHOWHIDENAVBTN":return showHideNavBtn(t,e.payload);default:return t}}function collapseGroup(t,{collapseId:e,collapsed:i}){const r=Object.assign({},t.collapsedGroups);return i?r[e]=!0:delete r[e],Object.assign(Object.assign({},t),{collapsedGroups:r})}function changeTab(t,e,i){const r=Object.assign({},t.currentTabIndex);return r[e]=i,Object.assign(Object.assign({},t),{currentTabIndex:r})}function navigate(t,{dataUnit:e,limit:i,backward:r}){const a=Object.assign({},t.currentRecordIndex)[e]||0;return gotoIndex(t,e,r?Math.max(i,a-1):Math.min(i,a+1))}function gotoIndex(t,e,i){const r=Object.assign({},t.currentRecordIndex);return r[e]=i,Object.assign(Object.assign({},t),{currentRecordIndex:r})}function insertRecord(t,{dataUnit:e,insertionIndex:i}){const r=Object.assign({},t.currentRecordIndex),a=Object.assign({},t.newRecordIndex);return r[e]=i,a[e]=(t.newRecordIndex[e]||0)+1,Object.assign(Object.assign({},t),{currentRecordIndex:r,newRecordIndex:a})}function changeFieldValue(t,{dataUnit:e,recordId:i,fieldName:r,value:a}){const o=Object.assign({},t.changes),n=Object.assign({},o[e]),s=Object.assign({},n[i]);s[r]=a,n[i]=s,o[e]=n;const l=Object.assign({},t.invalidFields),c=Object.assign({},l[e]),d=Object.assign({},c[i]);return delete d[r],c[i]=d,l[e]=c,Object.assign(Object.assign({},t),{changes:o,invalidFields:l,invalidFieldSelected:void 0})}function clearEdition(t,{dataUnit:e,recordsLimit:i}){const r=Object.assign({},t.changes),a=Object.assign({},t.newRecordIndex),o=Object.assign({},t.currentRecordIndex);return delete r[e],delete a[e],o[e]=Math.min(i,o[e]||0),Object.assign(Object.assign({},t),{changes:r,newRecordIndex:a,currentRecordIndex:o})}function navigateToInvalid(t,e){let i=Object.assign({},t);return void 0===i.invalidFieldSelected&&(i.invalidFieldSelected=!0,i=gotoIndex(i,e.dataUnit,e.recordIndex),i=changeTab(i,e.tabController,e.tabIndex)),i}function dataLoading(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return i[e]=!0,Object.assign(Object.assign({},t),{dataLoading:i})}function dataLoaded(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return delete i[e],Object.assign(Object.assign({},t),{dataLoading:i})}function savingChanges(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return i[e]=!0,Object.assign(Object.assign({},t),{dataLoading:i})}function changesSaved(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return delete i[e],Object.assign(Object.assign({},t),{dataLoading:i})}function removingRecord(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return i[e]=!0,Object.assign(Object.assign({},t),{dataLoading:i})}function recordRemoved(t,{dataUnit:e}){const i=Object.assign({},t.dataLoading);return delete i[e],Object.assign(Object.assign({},t),{dataLoading:i})}function invalidField(t,{dataUnit:e,recordId:i,fieldName:r,errorMessage:a}){const o=Object.assign({},t.invalidFields),n=Object.assign({},o[e]),s=Object.assign({},n[i]);return s[r]=a,n[i]=s,o[e]=n,Object.assign(Object.assign({},t),{invalidFields:o})}function clearAllInvalidFields(t,{dataUnit:e}){const i=Object.assign({},t.invalidFields);return delete i[e],Object.assign(Object.assign({},t),{invalidFields:i})}function clearInvalidField(t,{dataUnit:e,recordId:i,fieldName:r}){const a=Object.assign({},t.invalidFields),o=Object.assign({},a[e]),n=Object.assign({},o[i]);return delete n[r],o[i]=n,a[e]=o,Object.assign(Object.assign({},t),{invalidFields:a})}function showHideNavBtn(t,{buttonName:e,status:i}){const r=Object.assign({},t.visibleButtons);return r[e]=i,Object.assign(Object.assign({},t),{visibleButtons:r})}class Application{static async showDialog(t,e,i=null,r,a=!1){return new Promise((o=>{let n=document.querySelector("ez-dialog");n||(n=document.createElement("ez-dialog"),window.document.body.appendChild(n)),n.show(t,e,a,r,i).then((t=>o(t)))}))}static async alert(t,e,i=null){return Application.showDialog(t,e,i,!1,!1)}static async error(t,e,i=null){return Application.showDialog(t,e,i,!1,!0)}static async confirm(t,e,i=null,r=!1){return Application.showDialog(t,e,i,!0,r)}static async info(t){let e=document.querySelector("ez-toast");e||(e=document.createElement("ez-toast"),window.document.body.appendChild(e)),e.message=t,e.fadeTime=4e3,e.show()}}function removeHandler(t){Application.confirm("Exclusão de registro","Tem certeza que deseja Remover?",null,!0).then((e=>{e&&t.remove()}))}function saveHandler(t){setTimeout((()=>{t.save()}),50)}const NavigationBar=({dataUnit:t,buttonProps:e,enabled:i})=>e.previousVisible||e.nextVisible||e.addVisible||e.removeVisible||e.saveVisible||e.cancelVisible||e.reloadVisible?h("div",{class:"col col--sd-12 align--right"},e.previousVisible?h("ez-button",{key:t.name+"_previous",title:"Registro anterior",mode:"icon",enabled:i&&t.hasPrevious(),onClick:()=>t.previous(),image:"/themes/default/images/icons/actions-sprite.svg#previous-circle-inverted",class:"button--secondary margin-right--medium"}):null,e.nextVisible?h("ez-button",{key:t.name+"_next",title:"Próximo registro",mode:"icon",enabled:i&&t.hasNext(),onClick:()=>t.next(),image:"/themes/default/images/icons/actions-sprite.svg#next-circle-inverted",class:"button--secondary margin-right--medium"}):null,e.removeVisible?h("ez-button",{key:t.name+"_remove",label:"Remover",enabled:i&&t.hasCurrentRecord(),onClick:()=>removeHandler(t),image:"/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted",class:"button--secondary margin-right--medium"}):null,e.addVisible?h("ez-button",{key:t.name+"_add",label:"Adicionar",enabled:i,onClick:()=>t.insert(),class:"button--secondary margin-right--medium"}):null,e.reloadVisible?h("ez-button",{key:t.name+"_reload",title:"Recarregar",enabled:i,mode:"icon",onClick:()=>t.load(),image:"/themes/default/images/icons/actions-sprite.svg#rotate",class:"button--secondary margin-right--medium"}):null,e.cancelVisible?h("ez-button",{key:t.name+"_cancel",label:"Cancelar",enabled:i&&t.hasChanges(),onClick:()=>t.cancel(),class:"button--secondary margin-right--medium"}):null,e.saveVisible?h("ez-button",{key:t.name+"_save",label:"Salvar",enabled:i&&t.hasChanges(),onClick:()=>saveHandler(t),class:"button--primary margin-right--medium"}):null):null,selectCurrentTab=(t,e)=>t.hist.present.currentTabIndex[e]||0,selectIsCollapsedFieldSet=(t,e)=>t.hist.present.collapsedGroups[e],selectRecordChanges=(t,e,i)=>{const r=selectDataUnitChanges(t,e);return r?r[i]:void 0},selectDataUnitChanges=(t,e)=>t.hist.present.changes[e],selectCurrentRecordIndex=(t,e)=>t.hist.present.currentRecordIndex[e]||0,selectNewRecordIndex=(t,e)=>t.hist.present.newRecordIndex[e]||0,selectLoadingData=(t,e)=>t.nonhist.dataLoading[e],selectErrorMessage=(t,e,i,r)=>((t.nonhist.invalidFields[e]||{})[i]||{})[r]||"",selectVisibleButtons=t=>t.nonhist.visibleButtons;class DataUnit{constructor(t,e,i="1",r=null){this.name=t,this.unitLabel=e,this.cardinality=i,this._children=[],this._fields=new Map,this._requiredFields=[],null!=r&&(r._children.push(this),this.parentDU=r,this.parentDUName=r.name)}set store(t){this._store=t}set fields(t){t&&t.forEach((t=>this.addFieldMetadata(t)))}addFieldMetadata(t){this._fields.set(t.name,t),t.required&&this._requiredFields.push(t)}getFieldMetadata(t){if(this._fields)return this._fields.get(t)}get requiredFields(){return this._requiredFields}isLoading(){return selectLoadingData(this._store.getState(),this.name)}hasChanges(){const t=this._store.getState();return void 0!==selectDataUnitChanges(t,this.name)||selectNewRecordIndex(t,this.name)>0}hasNext(){return selectCurrentRecordIndex(this._store.getState(),this.name)<this.records.length-1}hasPrevious(){return selectCurrentRecordIndex(this._store.getState(),this.name)>0}hasCurrentRecord(){return null!=this.getCurrentRecord()}previous(){this._store.dispatch(previousRecord(this.name))}next(){this._store.dispatch(nextRecord(this.name,this.records.length))}getValue(t){const e=this.getCurrentRecord();if(!e)return;const i=this.getRecordChanges(e);return i&&void 0!==i[t]?i[t]:e[t]||null}getErrorMessage(t){const e=this.getCurrentRecord();return selectErrorMessage(this._store.getState(),this.name,null==e?void 0:e.record__id,t)}changeValue(t,e){0==this.records.length&&this.insert(),this._changeDeboucing&&window.clearTimeout(this._changeDeboucing),this._changeDeboucing=window.setTimeout((()=>{const i=this.getCurrentRecord();this._store.dispatch(changeFieldValue$1(this.name,i.record__id,t,e))}),100)}cancel(){this.records=this.records.filter((t=>!t.record__id.startsWith("NEW_"))),this._store.dispatch(clearEdition$1(this.name,this.records.length-1))}insert(){const t=this.records.length,e={record__id:"NEW_"+(selectNewRecordIndex(this._store.getState(),this.name)+1)};this.bindToParent(e),this.records.push(e),this._store.dispatch(insertRecord$1(this.name,t))}buildChange(t){const e=selectDataUnitChanges(this._store.getState(),this.name);let i;e&&(i=e[t.record__id]);let r=[];if(this._children.forEach((e=>{r=r.concat(e.getSubChanges(t.record__id))})),i||r.length>0){const e={__data__unit:this.name,__record__id:t.record__id,__sub__changes:r};return i&&Object.keys(i).forEach((t=>{e[t]=i[t]})),e}}getSubChanges(t){const e=[];return this._records&&this._records.filter((e=>e.parent__record__id===t)).forEach((t=>{const i=this.buildChange(t);i&&e.push(i)})),e}getChangesToSave(){let t=[];return this._records&&this._records.forEach((e=>{const i=this.buildChange(e);i&&t.push(i)})),t}save(){if(!this.validateRecords("SAVE"))return;let t;this._store.dispatch(savingChanges$1(this.name)),this.saveExecutor&&(t=this.saveExecutor(this.getChangesToSave())),t instanceof Promise?t.then((t=>this.processSaveResult(t))).catch((t=>{this._store.dispatch(dataLoaded$1(this.name)),Application.error("Falha ao tentar salvar",t)})):this.processSaveResult(t)}load(){let t;this._store.dispatch(dataLoading$1(this.name)),this.loadExecutor&&(t=this.loadExecutor({dataUnit:this.name})),t instanceof Promise?t.then((t=>this.processLoadResult(t))):this.processLoadResult(t)}remove(){const t=selectCurrentRecordIndex(this._store.getState(),this.name);let e;if(this._store.dispatch(removingRecord$1(this.name)),this.removeExecutor){const t=this.getCurrentRecord();e=this.removeExecutor({dataUnit:this.name,recordId:t.record__id,record:t})}else e=!0;e&&(e instanceof Promise?e.then((e=>this.processRemoveResult(e,t))):this.processRemoveResult(e,t))}processSaveResult(t){t&&(t instanceof Array?t.forEach((t=>this.processSaveResult(t))):t.__data__unit===this.name&&"1"===this.cardinality&&(this.records=[this.buildRecordFromSaveResult(this.records[0],t)])),this._store.dispatch(clearEdition$1(this.name,this.records.length-1)),this._store.dispatch(changesSaved$1(this.name))}buildRecordFromSaveResult(t,e){const i=t?Object.assign({},t):{record__id:""};return Object.keys(e).forEach((t=>{t.startsWith("__")||(i[t]=e[t])})),i}processLoadResult(t){this.records=t,this._store.dispatch(clearEdition$1(this.name,this.records.length-1)),this._store.dispatch(dataLoaded$1(this.name))}processRemoveResult(t,e){t&&(this.records.splice(e,1),this._store.dispatch(clearEdition$1(this.name,this.records.length-1))),this._store.dispatch(recordRemoved$1(this.name))}set records(t){this._records=t,this.parentDU&&this._records.forEach((t=>this.bindToParent(t)))}bindToParent(t){if(this.parentDU){const e=this.parentDU.getCurrentRecord();e&&(t.parent__record__id=e.record__id)}}get records(){return this._records||(this._records=[]),this._records}getCurrentRecord(){const t=selectCurrentRecordIndex(this._store.getState(),this.name);return this.records[t]}getRecordChanges(t){return void 0===t&&(t=this.getCurrentRecord()),t?selectRecordChanges(this._store.getState(),this.name,t.record__id):void 0}validateRecords(t="UNKNOWN"){if(!this.recordsValidator)return!0;const e=selectDataUnitChanges(this._store.getState(),this.name),i=[];this.records.forEach(((t,r)=>{const a=e?e[t.record__id]:void 0;a&&i.push(Object.assign(Object.assign(Object.assign({},t),a),{record__index:r,record__changedfields:Object.keys(a)}))}));const r=this.recordsValidator.validateRecords(this,i,t);return r.message&&Application.info(r.message),r.isValid}}var DependencyType;function scrollToView(t,e){t&&window.requestAnimationFrame((()=>e.scrollIntoView()))}!function(t){t.SEARCHING="SEARCHING",t.REQUIREMENT="REQUIREMENT",t.VISIBILITY="REQUIREMENT"}(DependencyType||(DependencyType={}));const Field=({dataUnit:t,field:e,forceScroll:i,enabled:r})=>{const{name:a,form:o}=e,{label:n,userInterface:s,properties:l,required:c,dependencies:d,readOnly:u}=t.getFieldMetadata(a),b=t.getValue(a)||null,p=t.isLoading(),g=c?`* ${n} (obrigatório)`:n,v=t.getErrorMessage(a),f=`${t.name}-${a}`,m=r&&!u,x=e=>{t.changeValue(a,e)};switch(s){case"LONGTEXT":return h("div",{class:"col col--sd-12 padding--small"},p?h("place-holder",null):h("ez-text-area",{value:b||"",label:g,onEzChange:t=>x(t.target.value),errormessage:v,ref:t=>scrollToView(i,t),key:f,enabled:m}));case"CHECKBOX":case"SWITCH":return h("div",{class:"col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large"},p?h("place-holder",null):h("ez-check",{value:b,label:n,enabled:m,mode:"CHECKBOX"===s?"regular":"switch",onEzChange:t=>x(t.target.value),ref:t=>scrollToView(i,t),key:f}));case"OPTIONSELECTOR":const e=l?JSON.parse(getProp(l,"options")):{},r=Object.keys(e).map((t=>({value:t,label:e[t]})));return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},p?h("place-holder",null):h("ez-combo-box",{value:b,label:g,enabled:m,onEzChange:t=>x(t.target.value),errormessage:v,ref:t=>scrollToView(i,t),key:f,options:r}));case"SEARCH":const c={__MAIN_FORM:o,__DATA_UNIT:t.name,__FIELD_NAME:a};l.forEach((({name:t,value:e})=>{c[t]=e}));let u=[];return null==d||d.forEach((e=>{var i;if(e.type===DependencyType.SEARCHING&&(null===(i=e.masterFields)||void 0===i?void 0:i.length)>0){let i={expression:e.expression,paramNames:[...e.masterFields],paramResolver:e=>t.getValue(e)};u.push(i)}})),u.length>0&&(c.CRITERIA=u),h("div",{class:"col col--sd-12 col--tb-3 padding--small"},p?h("place-holder",null):h("ez-search",{value:b,label:g,enabled:m,onEzChange:t=>x(t.target.value),errormessage:v,optionloader:t=>{if(o)return o.loadSearch(t,c)},ref:t=>scrollToView(i,t),key:f}));case"FILE":const _=getProp(l,"URL"),w=getProp(l,"HEADERS"),y=w?JSON.parse(w):{},k=Number(getProp(l,"maxfiles")||0);return h("div",{class:"col col--sd-12 padding--small"},p?h("place-holder",null):h("ez-upload",{value:b,label:g,enabled:m,onEzChange:t=>x(t.detail),urlupload:_,requestheaders:y,maxfiles:k}));case"DATE":return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},p?h("place-holder",null):h("ez-date-input",{value:b?DateUtils.clearTime(b):null,label:g,enabled:m,onEzChange:t=>x(t.target.value),errormessage:v,ref:t=>scrollToView(i,t),key:f}));case"DECIMALNUMBER":case"INTEGERNUMBER":let E=0,C=0;return"DECIMALNUMBER"===s&&(E=Number(getProp(l,"precision")||2),C=Number(getProp(l,"prettyprecision")||E)),h("div",{class:"col col--sd-12 col--tb-3 padding--small"},p?h("place-holder",null):h("ez-numeric-input",{value:b||null,label:g,enabled:m,onEzChange:t=>x(t.target.value),errormessage:v,precision:E,prettyprecision:C,ref:t=>scrollToView(i,t),key:f}));default:return h("div",{class:"col col--sd-12 col--tb-3 padding--small"},p?h("place-holder",null):h("ez-text-input",{value:b,label:g,enabled:m,loading:p,onInput:t=>x(t.target.value),errormessage:v,ref:t=>scrollToView(i,t),key:f}))}};function getProp(t,e){var i;return t?null===(i=t.find((t=>t.name===e)))||void 0===i?void 0:i.value:null}const FieldSet=({store:t,formName:e,source:i,dataUnit:r,enabled:a})=>{const{label:o,fields:n}=i,s=e+o;let l,c=selectIsCollapsedFieldSet(t.getState(),e+o);return i.fields.forEach((t=>{if(void 0===l){const e=r.getErrorMessage(t.name);null!=e&&""!==e&&(l=t.name)}})),l&&(c=!1),h("div",{class:"col col--sd-12 padding--small"},h("div",{class:"row margin-top--large"},h("div",{class:"col col--sd-12 align--middle padding-horizontal--medium"},h("ez-collapsible-box",{value:c,label:o,onEzChange:()=>t.dispatch(collapseExpandGroup(s,!c))}),c?null:h("div",{class:"col col--sd-12"},n.map((t=>h(Field,{enabled:a,field:t,dataUnit:r,forceScroll:l===t.name})))))))};function buildFormItem(t,e,i,r,a){if("fields"in t)return h(FieldSet,{enabled:a,source:t,store:i,formName:e,dataUnit:r});const o=r.getErrorMessage(t.name);return h(Field,{enabled:a,field:t,dataUnit:r,forceScroll:null!=o&&""!==o})}const FormSheet=({store:t,parentName:e,source:i,parentDataUnit:r,dataUnitBuilder:a,enabled:o})=>{const n=selectCurrentTab(t.getState(),e),s=i.length>1?i.map((t=>h("ez-tab",{label:t.label,tabKey:t.name}))):null,{subForms:l,items:c,name:d}=i[n],u=a(i[n].dataUnit,r);i[n].dataUnit=u;const b=l&&l.length>0,p=u||r;let g=selectVisibleButtons(t.getState());return"1"===p.cardinality&&(g.addVisible=!1,g.removeVisible=!1,g.nextVisible=!1,g.previousVisible=!1),h("div",{class:"form-sheet"},s?h("ez-tabselector",{selectedindex:n,selectedtab:d,onChange:i=>{t.dispatch(changeTab$1(e,i.target.selectedindex))}},s):null,u?h(NavigationBar,{enabled:o,dataUnit:u,buttonProps:g}):null,h("div",{class:"tab__container"},c?c.map((e=>buildFormItem(e,d,t,p,o))):null,b?h(FormSheet,{enabled:o,store:t,source:l,parentName:d,parentDataUnit:p,dataUnitBuilder:a}):null))},ezFormCss="ez-form{display:flex;flex-direction:column;width:100%}.form-sheet{display:flex;width:100%;flex-wrap:wrap;position:relative}.tab__container{display:flex;width:100%;flex-wrap:wrap;position:relative}";let EzForm=class{constructor(t){registerInstance(this,t),this.enabled=!0,this.loading=!1,this._dataUnits=new Map,this._duSources=new Map,this._tabPositionByField=new Map,this._duToLoad=[]}cleanPreparedMetadata(){this._preparedMetadata=void 0}async validate(){for(let t=0;t<this._duSources.size;t++){const e=Array.from(this._duSources.keys())[t];let i=this._dataUnits.get(e);if(void 0===i){const t=this._duSources.get(e);i=this.buildDataUnit(t,t.parentDUName)}if(!i.validateRecords())return!1}return!0}async getChanges(){let t=[];for(let e=0;e<this._dataUnits.size;e++){const i=Array.from(this._dataUnits.values())[e];if(!i.parentDU){const e=i.getChangesToSave();e&&(t=t.concat(e))}}return t}async changeFieldValue(t,e,i){const r=this._dataUnits.get(t);r&&r.changeValue(e,i)}validateRecords(t,e,i){const r={isValid:!0,message:""};if(this.ignoresavevalidation&&"SAVE"===i)return r;const a=e=>{t.requiredFields.forEach((i=>{if((t=>!t.readOnly&&"SWITCH"!==t.userInterface&&"CHECKBOX"!==t.userInterface)(i)){const a=e.record__index,o=e[i.name];if(null==o||""===o){const o=this._tabPositionByField.get(t.name+i.name);this._store.dispatch(invalidField$1(o.tabName,o.index,t.name,a,e.record__id,i.name,"Essa informação é obrigatória")),r.isValid=!1,r.message="Há pelo menos um campo obrigatório não preenchido."}}}))};if(0===t.records.length)a({});else{let i={};e.forEach((t=>{a(t),i[t.record__id]=!0})),t.records.forEach((t=>{i[t.record__id]||a(t)}))}return r}loadMDFromExecutor(t){const e=this.parseExecutor(this.metadataexecutor);if(e){const i=e();i&&(i instanceof Promise?i.then((e=>{t(e)})):t(i))}}loadMDFromElement(t){const e=[];Array.from(this._host.children).forEach((t=>{"FORM-METADATA"===t.tagName&&e.push(t.metadata)})),t(e.length>0?e:null)}updateMetadata(t){if(t){const e=(t,i,r,a)=>{var o;i.items.forEach((e=>{if("fields"in e)e.fields.forEach((e=>{e.form=this,this._tabPositionByField.set(t+e.name,{tabName:r,index:a})}));else{const i=e;i.form=this,this._tabPositionByField.set(t+i.name,{tabName:r,index:a})}})),null===(o=i.subForms)||void 0===o||o.forEach(((r,a)=>{const o=r.dataUnit;o&&(this._duSources.set(o.name,o),o.parentDUName=t),e(o?o.name:t,r,i.name,a)}))};this._preparedMetadata=t.map(((t,i)=>{const r=t.dataUnit;t.autoLoad&&this._duToLoad.push(r),this.decorateDU(r);const a=r.name;return this._duSources.set(a,r),e(a,t,"__MAIN__FORM__",i),t})),this._store.dispatch(formLoad())}}parseExecutor(executor){return executor?executor instanceof Function?executor:eval(executor):null}componentWillRender(){if(void 0===this._store){const t=combineReducers({hist:undoable(formReducer),nonhist:formNonHistoricReducer});this._store=createStore(t,applyMiddleware(thunk)),this._store.subscribe((()=>{forceUpdate(this)})),this.slavemode&&(this._store.dispatch(showHideNavigationButtons("saveVisible",!1)),this._store.dispatch(showHideNavigationButtons("cancelVisible",!1)),this._store.dispatch(showHideNavigationButtons("reloadVisible",!1)))}void 0===this._preparedMetadata&&(this.metadata?this.updateMetadata(this.metadata):(this.loadMDFromElement((t=>this.updateMetadata(t))),this._preparedMetadata||this.loadMDFromExecutor((t=>this.updateMetadata(t)))))}componentDidRender(){this._duToLoad.forEach((t=>t.load())),this._duToLoad=[]}loadSearch(t,e){const i=this.parseExecutor(this.fieldsearchexecutor);return i?i(t,e):[{value:0,label:"Sem resultados"}]}buildDataUnit(t,e){if(t){const{name:i,unitLabel:r,records:a,cardinality:o,fields:n}=t;if(!(t instanceof DataUnit)){let s;s=e instanceof DataUnit?e:this._dataUnits.get(e),(t=new DataUnit(i,r,o,s)).fields=n,this._dataUnits.set(t.name,t),a&&(t.records=a)}this.decorateDU(t)}return t}decorateDU(t){t.store=this._store,t.loadExecutor=this.parseExecutor(this.loadexecutor),t.saveExecutor=this.parseExecutor(this.saveexecutor),t.removeExecutor=this.parseExecutor(this.removeexecutor),t.recordsValidator=this}render(){return this.loading?h("place-holder",null):this._preparedMetadata?h(FormSheet,{enabled:this.enabled,store:this._store,source:this._preparedMetadata,parentName:"__MAIN__FORM__",dataUnitBuilder:(t,e)=>this.buildDataUnit(t,e)}):null}static get assetsDirs(){return["assets"]}get _host(){return getElement(this)}static get watchers(){return{metadata:["cleanPreparedMetadata"]}}};EzForm.style=ezFormCss;const ezIconCss=":host{display:block;overflow:hidden;position:relative}svg{display:flex;justify-content:center;align-items:center;fill:var(--color--icon)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}";let EzIcon=class{constructor(t){registerInstance(this,t),this.size="medium"}isSprite(){return this.href&&this.href.indexOf("#")>-1}render(){return h(Host,null,this.isSprite()?h("svg",{class:this.size,role:"img"},h("use",{xlinkHref:this.href})):h("img",{class:this.size,src:this.href}))}};EzIcon.style=ezIconCss;const ezNumericInputCss=":host{display:block;width:100%;--it__input--background-color:var(--background--medium, #e0e0e0);--it__input--border-color:var(--it__input--background-color)}.text-input{--it__input--background-color:inherit;--it__input--border-color:inherit}";let EzNumericInput=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errormessage=this.errormessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}changeValue(t){this._textInput.errormessage="",t!==this.value&&(this.value=t,this.ezChange.emit())}parseNumber(){const t=this._textInput.value?NumberUtils.stringToNumber(this._textInput.value):null;null!=t&&isNaN(t)?this._textInput.errormessage="O valor digitado não é um número válido":this.changeValue(t)}getTextValue(t){return t?this.precision>0?NumberUtils.format(t.toString(),Number(this.precision),Number(this.prettyprecision)):t.toString():null}render(){return h("ez-text-input",{class:"text-input",ref:t=>this._textInput=t,onBlur:()=>this.parseNumber(),label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errormessage:this.errormessage})}static get watchers(){return{label:["setLabel"],errormessage:["setErrorMessage"],value:["applyValueToInput"]}}};EzNumericInput.style=ezNumericInputCss;const ezSearchCss=":host{width:100%}";let EzSearch=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.showPopup=createEvent(this,"showPopup",7),this.enabled=!0,this.showselectedvalue=!0,this.showoptionvalue=!0}updateValue(){this._comboElement&&(this._comboElement.value=this.value)}onComboChange(t){t.stopPropagation(),this.value=t.detail,this.ezChange.emit(t.detail)}render(){return h("ez-combo-box",{ref:t=>this._comboElement=t,value:this.value,label:this.label,enabled:this.enabled,errormessage:this.errormessage,optionloader:this.optionloader,searchmode:!0,onEzChange:t=>this.onComboChange(t),showselectedvalue:this.showselectedvalue,showoptionvalue:this.showoptionvalue})}static get watchers(){return{value:["updateValue"]}}};EzSearch.style=ezSearchCss;const ezTabselectorCss='@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;margin-bottom:var(--space--large, 24px);--tab--backward-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--tab--forward-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, "Sora, Algerian");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:"";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5);}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tab--forward-image);mask-image:var(--tab--forward-image)}.backward-button::after{-webkit-mask-image:var(--tab--backward-image);mask-image:var(--tab--backward-image)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}';let EzTabselector=class{constructor(t){registerInstance(this,t),this.change=createEvent(this,"change",7),this.setFoucusedParam=t=>{if("Enter"===t.key)this.selectedindex=this.foucusedindex,this.foucusedindex=void 0,this.selectedtab=this._processedTabs[this.selectedindex].tabKey,this.handleTabClick(this.selectedtab,parseInt(this.selectedindex)),t.preventDefault(),this.setFocusedTab(this.selectedindex);else if("ArrowLeft"===t.key||"ArrowRight"===t.key){let e;if("ArrowLeft"===t.key)e=!1;else{if("ArrowRight"!==t.key)return;e=!0}this.foucusedindex=void 0===this.foucusedindex?!1===e?void 0!==this.selectedindex?(parseInt(this.selectedindex)-1).toString():void 0:void 0!==this.selectedindex?(parseInt(this.selectedindex)+1).toString():void 0:!1===e?(parseInt(this.foucusedindex)-1).toString():(parseInt(this.foucusedindex)+1).toString(),parseInt(this.foucusedindex)<0?this.foucusedindex="0":parseInt(this.foucusedindex)>this._processedTabs.length-1&&(this.foucusedindex=(this._processedTabs.length-1).toString()),this.setFoucusedBtn(!0,this.foucusedindex),this.setFocusedTab(this.foucusedindex),this.change.emit()}else"Tab"!==t.key&&"Escape"!==t.key||(this.foucusedindex=void 0,this.selectedtab=this._processedTabs[this.selectedindex].tabKey,this.handleTabClick(this.selectedtab,parseInt(this.selectedindex)),t.preventDefault(),this.setFocusedTab(this.selectedindex))}}handleTabClick(t,e){this.selectedindex=e.toString(),this.foucusedindex=void 0,this.selectedtab=t,this.change.emit(),this.setFoucusedBtn(!1,this.selectedindex)}componentWillRender(){this._processedTabs||(this._processedTabs=[],this.tabs&&this.tabs.split(",").forEach((t=>{t=t.trim(),this._processedTabs.push(new Tab(t,t))})),this._hostElem.querySelectorAll("ez-tab").forEach((t=>{const e=t.getAttribute("tabKey"),i=t.getAttribute("label"),r=new Tab(i,e),a=t.firstChild;a&&(a.setAttribute("slot","tab"+this._processedTabs.length),this._hostElem.appendChild(a)),this._processedTabs.push(r)})))}handleSlotChange(t){const e=t.target.assignedElements()[0];e&&(e.style.marginLeft="6px")}scrollBackward(){const t=this._scrollContainer;t&&(t.scrollLeft-=t.clientWidth)}scrollFoward(){const t=this._scrollContainer;if(t){let e=null;t.querySelectorAll(".tab").forEach((i=>{i.getBoundingClientRect().right<t.clientWidth&&(e=i)})),t.scrollLeft=e.offsetLeft+e.offsetWidth}}componentDidRender(){this.updateScroll()}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:e,clientWidth:i,scrollLeft:r}=t,a=e-i-Math.ceil(r);this._startHidden=t.scrollLeft>0,this._endHidden=a>0,this._startHidden?this._backwardButton.classList.remove("hidden"):this._backwardButton.classList.add("hidden"),this._endHidden?this._forwardButton.classList.remove("hidden"):this._forwardButton.classList.add("hidden");const o=["","startHidden","endHidden","midle"],n=o[Number(this._startHidden)|Number(this._endHidden)<<1];o.forEach((e=>{e!==n&&t.classList.contains(e)&&t.classList.remove(e)})),n&&!t.classList.contains(n)&&t.classList.add(n)}}domScrollHandler(){window.clearTimeout(this._scrollCallBack),this._scrollCallBack=window.setTimeout((()=>{this.updateScroll()}),200)}setFocusedTab(t){window.clearTimeout(this._scrollCallBackTeste),this._scrollCallBackTeste=window.setTimeout((()=>{const e=this._scrollContainer.querySelector(`#tab${t}`);console.log("tabtoscroll => ID",`#tab${this.selectedindex}`),console.log("tabtoscroll",e),e.scrollIntoView()}),200)}getTextWidth(t){void 0===this._textMesurement&&(this._textMesurement=this._hostElem.shadowRoot.ownerDocument.createElement("canvas"));const e=this._textMesurement.getContext("2d");return e.font="14px Sora, Algerian",Math.min(220,24+e.measureText(t).width)+"px"}setFoucusedBtn(t,e){this._scrollContainer.querySelectorAll(".tab").forEach((i=>{i.classList.remove("is-focused"),i.id==="tab"+e&&t&&i.classList.add("is-focused")}))}render(){return h(Host,null,h("button",{class:"backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),h("div",{class:"scroll",ref:t=>this._scrollContainer=t,onScroll:()=>this.domScrollHandler(),onKeyDown:t=>this.setFoucusedParam(t)},this._processedTabs.map(((t,e)=>{const i={"min-width":this.getTextWidth(t.label)},r="tab"+e,a=e===parseInt(this.selectedindex)||this.selectedtab&&t.tabKey===this.selectedtab;return a&&(this.selectedtab=t.tabKey,this.selectedindex=e.toString()),h("button",{id:r,class:"tab"+(a?" is-active":""),onClick:()=>this.handleTabClick(t.tabKey,e),style:i},h("span",{class:"tab-label",title:t.label},t.label),h("slot",{name:r,onSlotchange:t=>{this.handleSlotChange(t)}}))}))),h("button",{class:"forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return getElement(this)}};class Tab{constructor(t,e){this.label=t,this.tabKey=e}}EzTabselector.style=ezTabselectorCss;const ezTextAreaCss=":host{--ta--width:100%;--ta--border-radius:var(--border--radius-medium, 12px);--ta--font-size:var(--text--medium, 14px);--ta--font-family:var(--font-pattern, Arial);--ta--font-weight:var(--text-weight--large, 500);--ta--color:var(--title--primary, #000);--ta__input--background-color:var(--background--medium, #e0e0e0);--ta__input--border:var(--border--medium, 2px solid);--ta__input--border-color:var(--ta__input--background-color);--ta__input--focus--border-color:var(--color--primary, #008561);--ta__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ta__input--disabled--color:var(--text--disable, #AFB6C0);--ta__input--error--border-color:#CC2936;--ta__message_box--font-size:var(--text--small, 12px);--ta__message_box--info--color:var(--color--success, #22085d);--ta__message_box--error--color:var(--color--error, #FF0000);--ta__label--floating--top:6px;--ta__label--padding-top:12px;--ta__label--padding-left:14px;--ta__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ta--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--ta--font-family);font-size:var(--ta--font-size);color:var(--ta--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--ta__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--ta--border-radius);border:var(--ta__input--border);border-color:var(--ta__input--border-color);background-color:var(--ta__input--background-color)}.textarea--focus{border-color:var(--ta__input--focus--border-color)}.textarea.hasError{color:var(--ta--color);border-color:var(--ta__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ta--font-family);font-size:var(--ta__message_box--font-size);color:var(--ta__message_box--info--color)}.hasError{color:var(--ta__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ta__label--padding-right));left:var(--ta--space--medium);font-family:var(--ta--font-family);font-size:var(--ta--font-size);font-weight:var(--ta--font-weight);color:var(--ta--color);top:var(--ta__label--padding-top);left:var(--ta__label--padding-left);padding-right:var(--ta__label--padding-right)}.textarea__label--floated{font-family:var(--ta--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ta__label--floating--top)}.textarea__label--disabled{color:var(--ta__input--disabled--color)}";let EzTextArea=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0,this.rows=4}showError(){"string"==typeof this.errormessage&&""!==this.errormessage?(this._container.classList.add("hasError"),this._messageBoxElem.classList.add("hasError")):(this._container.classList.remove("hasError"),this._messageBoxElem.classList.remove("hasError"))}updateInputValue(){this._inputElem.value=this.value,this.handleChange(),this.adjustFloatingLabel(),this.ezChange.emit(this.value)}adjustFloatingLabel(){if(this.label){const t=this.value&&this.value.toString().length>0,e=this._labelElem.classList.contains("textarea__label--floated");t||this.isFocused()?e||this._labelElem.classList.add("textarea__label--floated"):e&&this._labelElem.classList.remove("textarea__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){this.adjustFloatingLabel(),this._container&&this._container.classList.contains("textarea--focus")&&this._container.classList.remove("textarea--focus")}handleChange(){this.value=this._inputElem.value}handleFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("textarea__label--floated")&&this._labelElem.classList.add("textarea__label--floated"),this._container&&!this._container.classList.contains("textarea--focus")&&this._container.classList.add("textarea--focus")}componentDidLoad(){this.showError(),this.adjustFloatingLabel()}render(){return h(Host,null,h("div",{class:"textarea",ref:t=>this._container=t},this.label?h("label",{ref:t=>this._labelElem=t,class:this.enabled?"textarea__label":"textarea__label textarea__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,h("textarea",{onFocus:()=>this.handleFocus(),ref:t=>this._inputElem=t,value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()},onKeyDown:t=>t.stopPropagation(),rows:this.rows})),h("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errormessage},this.errormessage))}get _hostElement(){return getElement(this)}static get watchers(){return{errormessage:["showError"],value:["updateInputValue"]}}};function isValidNumber(t){return t&&/^-?\d*[.,]?\d*$/.test(t)}EzTextArea.style=ezTextAreaCss;const ezTextInputCss=":host{--it--height:42px;--it--width:100%;--it__icon--width:48px;--it--border-radius:var(--border--radius-medium, 12px);--it--font-size:var(--text--medium, 14px);--it--font-family:var(--font-pattern, Arial);--it--font-weight:var(--text-weight--large, 500);--it--color:var(--title--primary, #000);--it__input--background-color:var(--background--medium, #e0e0e0);--it__input--border:var(--border--medium, 2px solid);--it__input--border-color:var(--it__input--background-color);--it__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--it__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--it__input--disabled--color:var(--text--disable, #AFB6C0);--it__input--error--border-color:#CC2936;--it__message_box--font-size:var(--text--small, 12px);--it__message_box--info--color:var(--color--success, #22085d);--it__message_box--error--color:var(--color--error, #FF0000);--it__label--floating--top:6px;--it__label--padding-top:12px;--it__label--padding-left:14px;--it__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--it--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--it--height);border-radius:var(--it--border-radius);font-family:var(--it--font-family);font-size:var(--it--font-size);border:var(--it__input--border);border-color:var(--it__input--border-color);background-color:var(--it__input--background-color);color:var(--it--color)}input:disabled{background-color:var(--it__input--disabled--background-color);color:var(--it__input--disabled--color)}input:focus{outline:none;border-color:var(--it__input--focus--border-color)}input.icon--left{padding-left:var(--it__icon--width)}input.icon--right{padding-right:var(--it__icon--width)}input.hasError{color:var(--it--color);border-color:var(--it__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--it--font-family);font-size:var(--it__message_box--font-size);color:var(--it__message_box--info--color)}.hasError{color:var(--it__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--it__label--padding-right));left:var(--it--space--medium);font-family:var(--it--font-family);font-size:var(--it--font-size);font-weight:var(--it--font-weight);color:var(--it--color);top:var(--it__label--padding-top);left:var(--it__label--padding-left);padding-right:var(--it__label--padding-right)}.input__label--floated{font-family:var(--it--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--it__label--floating--top)}.input__label--disabled{color:var(--it__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--it__icon--width) + 2px);width:calc(100% - var(--it__icon--width))}.input__label--right{right:var(--it__icon--width);width:calc(100% - var(--it__icon--width))}.input__label--left.input__label--right{left:calc(var(--it__icon--width) + 2px);width:calc(100% - var(--it__icon--width) * 2)}.input--with--label{padding-bottom:0}";let EzTextInput=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this.enabled=!0}showError(){"string"==typeof this.errormessage&&""!==this.errormessage?(this._inputElem.classList.add("hasError"),this._messageBoxElem.classList.add("hasError")):(this._inputElem.classList.remove("hasError"),this._messageBoxElem.classList.remove("hasError"))}prepareMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new MaskFormatter(this.mask):this._maskFormatter.mask=this.mask)}updateInputValue(){this._inputElem&&(this._inputElem.value=this.value),this.handleChange(),this.ezChange.emit(),this.adjustFloatingLabel()}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,e=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?e||this._labelElem.classList.add("input__label--floated"):e&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errormessage=t.message}this.value=this._inputElem.value,this.adjustFloatingLabel()}isValidValue(t){return this.onlynumber?""==t||isValidNumber(t):!this.restrict||Array.from(t).reduce(((t,e)=>t&&this.restrict.indexOf(e)>-1),!0)}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=void 0===this._lastValidValue?"":this._lastValidValue,this.value=this._inputElem.value}handleSlotChange(t){const e=t.target,i=e.assignedElements()[0];i&&(i.style.position="absolute",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.overflow="hidden",i.style.top="0px",i.style.width="var(--it__icon--width)",i.style.height="var(--it--height)","leftIcon"==e.name?(i.style.left="0px",i.style.borderRadius="var(--it--border-radius) 0 0 var(--it--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left")):"rightIcon"==e.name&&(i.style.right="0px",i.style.borderRadius="0 var(--it--border-radius) var(--it--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"))),this.showError()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated")}componentDidLoad(){this.onlynumber&&this._inputElem.classList.add("text--right"),this.showError(),this.prepareMask(),this.adjustFloatingLabel()}componentWillLoad(){if(this.prepareMask(),this.value){if(this._maskFormatter)try{this.value=this._maskFormatter.format(this.value)}catch(t){this.errormessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}render(){return h(Host,null,h("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label?h("label",{ref:t=>this._labelElem=t,class:this.enabled?"input__label":"input__label input__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,h("input",{onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:"text",value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),h("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),h("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errormessage},this.errormessage))}get _hostElement(){return getElement(this)}static get watchers(){return{errormessage:["showError"],mask:["prepareMask"],value:["updateInputValue"]}}};EzTextInput.style=ezTextInputCss;class RemoteFile{constructor(t){this.file=t,this.size=t.size,this.name=t.name}abortUpload(){this._uploadingXhr&&(this._aborted=!0,this._uploadingXhr.abort(),this._uploadingXhr=void 0)}isUploading(){return void 0!==this._uploadingXhr}async upload(t,e,i){return new Promise(((r,a)=>{const o=new XMLHttpRequest;this._uploadingXhr=o,this._aborted=!1,this.progress=0,o.upload.onprogress=t=>{const e=t.loaded,r=t.total;this.progress=~~(e/r*100),i(this,e,r)},o.onreadystatechange=()=>{if(4==o.readyState){this._uploadingXhr=void 0;const t=o.status;this._aborted||(0===t?a("Servidor indisponível"):t>=500?a("Erro inesperado no servidor"):t>=400&&a("Operação não permitida"));const e=o.response;e&&r(JSON.parse(e))}},o.ontimeout=()=>{a("Tempo limite de transferência atingido.")};const n=new FormData;n.append("ARQUIVO",this.file,this.file.name),o.open("POST",t,!0),e&&e.forEach(((t,e)=>o.setRequestHeader(e,t))),o.send(n)}))}async delete(t,e,i){return new Promise(((r,a)=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{4==o.readyState&&(0===o.status?a("Servidor indisponível"):o.status>=500?a("Erro inesperado no servidor"):o.status>=400&&a("Operação não permitida"),r(!0))},o.ontimeout=()=>{a("Tempo limite de remoção atingido.")},o.open("DELETE",e,!0),i&&i.forEach(((t,e)=>o.setRequestHeader(e,t))),o.send(JSON.stringify(t))}))}}const ezUploadCss=':host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);--iu__btn__cancel-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="8x" width="8px"><path d="M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z"/></svg>\');--iu__file-icon-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="11x" width="9px"><path d="M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z"/></svg>\');display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:"Sora", "Algerian";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--iu__btn__cancel-image);mask-image:var(--iu__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--iu--font-family);font-size:var(--text--extra-small);font-weight:var(--iu--font-weight);color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:\'\';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';let EzUpload=class{constructor(t){registerInstance(this,t),this.ezChange=createEvent(this,"ezChange",7),this._filePointers=new Map,this.enabled=!0}changeValue(t){t!==this._updatingValue&&(this._filePointers.forEach((t=>{this.isRemoteFile(t)&&t.abortUpload()})),this._filePointers=new Map,this.updateFilePointers()),this._updatingValue=void 0}updateFilePointers(){this.value&&this.value.forEach((t=>this._filePointers.set(t.name,t)))}normalizeRequestHeaders(){if(this._requestHeaders=new Map,"string"==typeof this.requestheaders)try{this.requestheaders=JSON.parse(this.requestheaders)}catch(t){this.requestheaders=void 0}for(var t in this.requestheaders)this._requestHeaders.set(t,this.requestheaders[t])}async addFiles(t){if(this.maxfiles>0){let e=this._filePointers.size;if(t.forEach((t=>{this._filePointers.has(t.name)||e++})),e>this.maxfiles)return void this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`)}Array.prototype.forEach.call(t,this.addFile.bind(this))}async addFile(t){const e=this._filePointers.get(t.name);e?Application.confirm("Substituir arquivo",`Já existe um arquivo chamado "${t.name}". Deseja substituí-lo?`).then((i=>{i&&(this.isRemoteFile(e)&&e.abortUpload(),this.doAddFile(t))})):this.doAddFile(t)}async doAddFile(t){if(this.validateFile(t)){const e=new RemoteFile(t);this._filePointers.set(t.name,e),e.upload(this.urlupload,this._requestHeaders,(t=>this.updateFeedback(t))).then((t=>t.forEach((t=>this.finishUpload(t))))).catch((t=>this.showError(t))),forceUpdate(this)}}finishUpload(t){this._filePointers.set(t.name,t),this.updateValue()}updateValue(){this._updatingValue=[],this._filePointers.forEach((t=>{this.isRemoteFile(t)||this._updatingValue.push(t)})),this.value=this._updatingValue,this.ezChange.emit(this.value)}buildProgressId(t){return`PROGRESS_${t.name.replace(/[^a-z0-9_]/gi,"_")}_${t.file.lastModified}`}updateFeedback(t){window.requestAnimationFrame((()=>{if(this._host){const e=this._host.shadowRoot.querySelector("#"+this.buildProgressId(t));e&&(e.value=t.progress)}}))}validateFile(t){return!this._filePointers.has(t.name)&&this.maxfiles>0&&this._filePointers.size>=this.maxfiles?(this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`),!1):0===t.size?(this.showError(`Erro de permissão: O arquivo "${t.name}" não pode ser enviado.`),!1):this.urlupload?!(this.maxfilesize>=0&&t.size>this.maxfilesize&&(this.showError("O tamanho máximo dos arquivos é de "+this.formatBytes(this.maxfilesize)),1)):(this.showError("Endereço de upload não informado"),!1)}showError(t){Application.alert("Enviando arquivo",t)}formatBytes(t,e=1){if(0===t)return"0 Bytes";const i=e<0?0:e,r=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,r)).toFixed(i))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}onFileInputChange(t){this.addFiles(Array.from(t.target.files)),this._fileInput.value=""}isRemoteFile(t){return"file"in t}removeFromList(t){this._filePointers.delete(t),this.updateValue()}removeFile(t){const e=this._filePointers.get(t);if(this.isRemoteFile(e))e.abortUpload(),this.removeFromList(t);else if(this.urldelete){const i=new RemoteFile(null);this._filePointers.set(e.name,i),i.delete(e,this.urldelete,null).then((()=>this.removeFromList(t))).catch((t=>this.showError(t)))}else this.removeFromList(t)}openFilesDialog(){this.enabled&&this._fileInput.click()}componentDidLoad(){this.enabled&&this._dropZone&&window.FileList&&window.File&&(this._dropZone.addEventListener("dragover",(t=>{t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy",this._dropZone.style.background="#c2dbff"})),this._dropZone.addEventListener("drop",(t=>{t.stopPropagation(),t.preventDefault(),this.addFiles(Array.from(t.dataTransfer.files)),this._dropZone.style.background=""})),this._dropZone.addEventListener("dragleave",(()=>{this._dropZone.style.background=""})))}componentWillRender(){this.value&&this._filePointers.size<this.value.length&&this.updateFilePointers()}render(){return h("div",{ref:t=>this._dropZone=t,class:this.evalDisabledClass("iu","background--disabled")},h("div",{class:"iu__container",onClick:()=>this.openFilesDialog()},h("div",{class:"iu_header"},this.label?h("label",{class:this.evalDisabledClass("iu__label","text--disabled"),title:this.label},this.label):null,h("div",{class:this.evalDisabledClass("iu__icon-label","mouse-pointer--disabled")},h("button",{class:"iu__file-icon",disabled:!this.enabled}),h("div",{class:this.evalDisabledClass("text text--center text--medium text--primary","text--disabled")},this.enabled?"Arraste e solte ou clique para adicionar arquivos":"Somente leitura"))),this.buildFooter()),h("input",{ref:t=>this._fileInput=t,onChange:t=>this.onFileInputChange(t),type:"file",multiple:!0,hidden:!0}))}buildFooter(){if(0===this._filePointers.size)return null;const t=[];return this._filePointers.forEach((e=>t.push(this.buildFileItem(e)))),h("div",{class:"iu__footer"},t)}buildFileItem(t){const e=t.name,i=Number(t.progress),r=t.downloadURL,a=`${e} (${this.formatBytes(t.size)})`;return h("div",{class:"iu__item",key:e,onClick:t=>t.stopPropagation()},h("div",{class:"iu__item-label modificador"},h("div",{title:a,class:"col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle"},r?h("a",{href:r,download:!0},a):a)),isNaN(i)?null:h("div",{class:"col col--sd-4 col--stretch align--middle"},h("progress",{id:this.buildProgressId(t),value:i,max:"100"})),this.enabled?h("div",{class:"col col--stretch align--middle"},h("button",{class:"btn-cancel ",onClick:()=>this.removeFile(e)})):null)}evalDisabledClass(t,e){return this.enabled?t:`${t} ${e}`}get _host(){return getElement(this)}static get watchers(){return{value:["changeValue"],requestheaders:["normalizeRequestHeaders"]}}};EzUpload.style=ezUploadCss;let FormMetadata=class{constructor(t){registerInstance(this,t)}buildField(t){let e=t.getAttribute("label"),i=t.getAttribute("name")||e,r=t.getAttribute("ui")||"SHORTTEXT",a=[];if("OPTIONSELECTOR"===r){e||(e="Selecione uma das opções:");const i={};Array.from(t.getElementsByTagName("OPTION")).forEach(((t,e)=>{const r=t.getAttribute("value")||e;i[r]=t.textContent})),a.push({name:"options",value:JSON.stringify(i)})}else if("FILE"===r){const e=t.querySelector("URL"),i=t.querySelectorAll("HEADERS>HEADER");if(e&&a.push({name:"URL",value:e.textContent}),i&&i.length>0){const t={};i.forEach((e=>{t[e.getAttribute("name")]=e.textContent})),a.push({name:"HEADERS",value:JSON.stringify(t)})}this.addPropertyIfExists(a,t,"maxfiles")}else e||(e=t.textContent),this.addPropertyIfExists(a,t,"precision"),this.addPropertyIfExists(a,t,"prettyprecision");return{name:i,userInterface:r,label:e,defaultValue:t.getAttribute("defaultValue"),required:"true"===t.getAttribute("required"),readOnly:"true"===t.getAttribute("readonly"),properties:a}}addPropertyIfExists(t,e,i){const r=e.getAttribute(i);r&&t.push({name:i,value:r})}buildFieldSet(t,e){return{label:e.getAttribute("label"),fields:Array.from(e.getElementsByTagName("FIELD")).map((e=>{const i=this.buildField(e);return t.addFieldMetadata(i),{name:i.name}}))}}fromElements(t,e,i,r,a){const o={name:i||e,dataUnit:r,label:e,autoLoad:a};return Array.from(t).forEach((t=>{switch(t.tagName.toUpperCase()){case"FIELD":o.items||(o.items=[]);const e=this.buildField(t);r.addFieldMetadata(e),o.items.push({name:e.name});break;case"FIELD-SET":o.items||(o.items=[]),o.items.push(this.buildFieldSet(r,t));break;case"SUB-FORM":o.subForms||(o.subForms=[]);const i=t.getAttribute("label")||"Subform "+(o.subForms.length+1),a=t.getAttribute("name")||i,n=t.getAttribute("dataunit");let s;s=n?new DataUnit(n,t.hasAttribute("many")?"N":"1"):r,o.subForms.push(this.fromElements(t.children,i,a,s,"true"===t.getAttribute("autoload")))}})),o}connectedCallback(){this.dataunit||(this.dataunit="dataunit_"+(this.name||this.label||(new Date).getTime()));const t=new DataUnit(this.dataunit,this.many?"N":"1");this.metadata=this.fromElements(this._host.children,this.label,this.name,t,this.autoload)}render(){return h(Host,null)}get _host(){return getElement(this)}};const placeHolderCss=":host{display:flex;width:100%;height:42px;border-radius:12px;background:var(--background--medium);background-image:linear-gradient(to right, var(--background--medium) 0%, var(--background--strong) 20%, var(--background--medium) 40%, var(--background--medium) 100%);background-repeat:no-repeat;background-size:800px 1000px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeholderShimmer;animation-timing-function:linear}@keyframes placeholderShimmer{0%{background-position:-800px 0}100%{background-position:800px 0}}";let PlaceHolder=class{constructor(t){registerInstance(this,t)}render(){return h(Host,null)}};PlaceHolder.style=placeHolderCss;export{EzButton as ez_button,EzCalendar as ez_calendar,EzCheck as ez_check,EzCollapsibleBox as ez_collapsible_box,EzComboBox as ez_combo_box,EzDateInput as ez_date_input,EzForm as ez_form,EzIcon as ez_icon,EzNumericInput as ez_numeric_input,EzSearch as ez_search,EzTabselector as ez_tabselector,EzTextArea as ez_text_area,EzTextInput as ez_text_input,EzUpload as ez_upload,FormMetadata as form_metadata,PlaceHolder as place_holder}
|