eservices-core 1.3.263 → 1.3.265
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.justify-content-center{justify-content:center}.user-select-none{-webkit-user-select:none;user-select:none}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow,.flex-grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color-light{color:var(--color-light)}.color-primary{color:var(--color-primary)}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.transition-fast{transition:.1s}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number,.widget-table-cell_money{text-align:end}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.flex,.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.gap-10{gap:10px}.gap-15{gap:15px}.gap-5{gap:5px}.gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.padding-bottom-10{padding-bottom:10px}.padding-10{padding:10px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-aa18d6fa]{padding:18px;text-align:start}.widget-table__head-label[data-v-aa18d6fa]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cd8043dd]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cd8043dd]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cd8043dd]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-d131e64e]{display:flex;gap:4px}.widget-head-cell-order[data-v-d131e64e]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-d131e64e]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-d131e64e]{padding:7px}.widget-head-cell-order-icon[data-v-d131e64e]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-d131e64e]{transform:rotate(180deg)}.widget-filter-item-container[data-v-e52e165e]{position:relative}.widget-filter-item-arrow[data-v-e52e165e]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-e52e165e]{font-weight:700}.widget-filter-item[data-v-e52e165e]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-e52e165e]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-e52e165e]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-e52e165e]{transition:.2s}.widget-table-panel-filter[data-v-89e1fa2d]{justify-content:end;background-color:var(--color-primary)}.widget-fast-table-tools[data-v-3a74319d]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
"use strict";var
|
|
3
|
-
* eservices-core v1.3.
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.justify-content-center{justify-content:center}.user-select-none{-webkit-user-select:none;user-select:none}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow,.flex-grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color-light{color:var(--color-light)}.color-primary{color:var(--color-primary)}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.transition-fast{transition:.1s}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number,.widget-table-cell_money{text-align:end}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.flex,.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.gap-10{gap:10px}.gap-15{gap:15px}.gap-5{gap:5px}.gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.padding-bottom-10{padding-bottom:10px}.padding-10{padding:10px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-aa18d6fa]{padding:18px;text-align:start}.widget-table__head-label[data-v-aa18d6fa]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cd8043dd]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cd8043dd]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cd8043dd]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-d131e64e]{display:flex;gap:4px}.widget-head-cell-order[data-v-d131e64e]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-d131e64e]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-d131e64e]{padding:7px}.widget-head-cell-order-icon[data-v-d131e64e]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-d131e64e]{transform:rotate(180deg)}.widget-filter-item-container[data-v-e52e165e]{position:relative}.widget-filter-item-arrow[data-v-e52e165e]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-e52e165e]{font-weight:700}.widget-filter-item[data-v-e52e165e]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-e52e165e]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-e52e165e]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-e52e165e]{transition:.2s}.widget-table-panel-filter[data-v-89e1fa2d]{justify-content:end;background-color:var(--color-primary)}.widget-fast-table-tools[data-v-0070862b]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
"use strict";var lt=e=>{throw TypeError(e)};var ct=(e,n,t)=>n.has(e)||lt("Cannot "+t);var Pe=(e,n,t)=>(ct(e,n,"read from private field"),t?t.call(e):n.get(e)),Ve=(e,n,t)=>n.has(e)?lt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ee=(e,n,t,o)=>(ct(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);/*!
|
|
3
|
+
* eservices-core v1.3.265
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),
|
|
6
|
-
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(n,t){return!n&&!t?N.ApiNotAvailable():new N(n||"Authorization Error",t)}static ApiResponseParseFailed(){return N.ApiNotAvailable()}static MissingIdInValuesEntity(n){return new N("Object doesn't have id",n)}static ObjectWithIdNotFound(n,t){return new N(`Can't find object with id: ${n}`,t)}static ObjectWithoutConnectToPresentArray(n,t){return new N("Object is not found.",{object:n,array:t})}static EntityWithoutId(n){return new N("Entity doesn't have id.",n)}static NotFoundedTableIndex(n,t){return new N(`Can't find the element with tableIndex ${n}`,t)}static UndefinedError(n,t=[]){return new N(n,t)}static TableArrayAlreadyIncludeProvidedIndexValue(n,t,o){return new N(`Array already includes the element with value ${n}`,{array:t,table:o})}static MetadataEntityIsNotAvailable(n){return new N(`Metadata for the ${n} is not currently available.`)}static RequestTookToLong(){return new N("The request took too long to complete. Try again later.")}};N.ID=0;let Q=N;const cn="Please try again later or submit a feedback if problem doesn't go.";function un(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return cn}})}function se(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Q.ApiNotAvailable()}).then(t=>un(t).then(o=>{if(!t.ok)throw o;return o}))}class fn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(n,t,o)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),n[t]=o,!0)}),window._journal=this}get error(){return{add:(...n)=>{this.errors.push(n)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new fn;class dn{static invite(n,t,o){return se("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:n,personKey:t,relatedRoleCode:o})})}static accept(n,t){return se("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!0})})}static decline(n,t){return se("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class pn{static getRequiredDocuments(n,t,o){const i=new URLSearchParams({entity:n,primaryKey:t,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ae{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${ae.url()}/calculator/${n}`)}static calculate(n,t){return se(`/${ae.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:n,values:t})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(n){function t(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:n.name,label:n.title,required:n.required,type:t(n)}}static createOnlinePayment(n,t){return se(`/${ae.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return se(`/${ae.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const gn={class:"widget-table__head-cell"},mn={key:1,class:"widget-table__head-label margin_0 text_overflow"},Ct=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:n}){const t=n;function o(){t("select")}return(i,a)=>(r.openBlock(),r.createElementBlock("th",gn,[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,onClick:o})):(r.openBlock(),r.createElementBlock("span",mn,r.toDisplayString(i.label),1))]))}}),hn={class:"widget-table__head"},yn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>Ct),(n,t)=>(r.openBlock(),r.createElementBlock("tr",hn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,o=>r.renderSlot(n.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),M=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},vn=M(yn,[["__scopeId","data-v-aa18d6fa"]]);function ze(e){return Array.isArray(e)?ze(e[0]):typeof e!="string"?null:e}function re(e){return ze(e.name)}function wn(e){const n=new RegExp(/\$\{([a-zA-Z0-9_.]+)}/,"g"),t=[];let o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function bn(e,n){return wn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),F.utils.getPropFromObject(n,o))}),e}function je(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Oe(e,n){const t=re(e);if(typeof e.value=="string")return bn(e.value,n);let o=t?F.utils.getPropFromObject(n,t):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,n);if(e.value===null)return null;switch(e.unitValue&&(o=je(e.unitValue)(o)),e.unit&&(o=je(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Se(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Nt(typeof o=="string"?o:null);break}case"money":{o=Ft(o);break}case"DateTime":{o=Se(typeof o=="string"?o:null,e.format||I.dateTimeFormat);break}}return e.formatter&&(o=ue(e.formatter).exec(o,n)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const En=1,Cn=5e3,kn="static-folder",kt="request-error",_t="EntityTypeName",_n="REFERENCE_CHANGES",S={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",MODAL_BATCH_VALUES:"batch-values",MODAL_ENTITY:"form-entity",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:_t,FIELD_NAME_REFERENCE_CHANGES:_n,PATH_RESOLVER_ENTITY:"resolver"};function Fe(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const Tn={class:"widget-filter-text flex gap_20"},An=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>t.values,l=>{if(typeof l!="string")return i.value="";i.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Tn,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),Sn=M(An,[["__scopeId","data-v-800b3803"]]),In={class:"widget-filter-enum"},Ln={class:"flex gap-10 padding-10"},Nn=r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=xe(t.filterMetadata.entity),a=f=>(t.values||[]).includes(f),l=n;function c(f){const v=t.values||[];return v.includes(f)?l("update:values",v.filter(g=>g!==f)):l("update:values",[...v,f])}const s=ce(async()=>{o.value=await oe(t.baseEntity,{fields:t.filterMetadata.name.join(" "),order:[t.filterMetadata.name[1],"asc"],distinct:!0,filter:x(t.filters)}).then(f=>f.map(v=>({label:v[t.filterMetadata.name[1]],value:v[t.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,f=>{l("readProcess",f?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(f,v)=>{const g=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",In,[r.createElementVNode("div",Ln,[r.createVNode(g,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:v[0]||(v[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(g,{label:"Clear",onClick:u})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createBlock(r.unref(F.FormField),{class:"widget-filter-enum-item",key:m.value,onClick:()=>c(m.value),type:"single-checkbox","model-value":a(m.value),label:m.label},null,8,["onClick","model-value","label"]))),128))])}}}),Rn=M(Nn,[["__scopeId","data-v-cd8043dd"]]),ge=r.reactive({});function On(){ct(),setInterval(ct,50)}function Tt(){return ge}function ct(){const e={};Object.entries(localStorage).forEach(([n,t])=>{e[n]=!0,ge[n]!==t&&(ge[n]=t)}),Object.keys(ge).forEach(n=>{e[n]||delete ge[n]})}const I={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:Sn,Entity:Rn},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function Fn(e){On();for(let n in e)I[n]=e[n]}const Bn={props:{name:String},setup(e,n){let t="unknown";try{t=n.slots.default()[0].children}catch{t=e.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>r.h(I.iconTag,{class:I.iconHandler?I.iconHandler(t):`icon icon-${t}`},I.iconHandlerText(t))}},me=M(Bn,[["__scopeId","data-v-8a72b45f"]]),xn=Re(Fe("setup-list-row"));function Dn(e,n){const t=e.config.map(o=>$n(o,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function $n(e,n,t){const o=n.values;let i=Oe(e,o);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(f){a.onClick.push(()=>f(o,e,t))}function c(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],u=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{u.push(r.h(F.FormField,{type:"single-checkbox",modelValue:n.selected})),l(ut.bind(null,t,!0));break}case"select":{u.push(r.h(F.FormField,{type:"single-radio",modelValue:n.selected})),l(ut.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const v=r.h(ne.RouterLink,{to:f});u.push(v),c("widget-table-cell_link")}}catch(f){xn("Can't add router link",f)}if(e.href&&(u.push(r.h("a",{href:e.href(o),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&u.push(r.h(me,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&u.push(r.h(me,{name:f}))}return e.class&&(typeof e.class=="function"?c(e.class(o)):c(e.class)),I.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),I.listCellHandler(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),I.arrayListCellHandlers&&I.arrayListCellHandlers.forEach(f=>f(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),s.push(r.h("td",a,u)),s}function ut(e,n){e.emit("select",n)}function Xe(e,n){return()=>{try{return Dn(e,n)}catch(t){return console.warn(t),null}}}const Pn={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Vn=["colspan"],ft=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:n}){const t=n,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=l=>t("close")),onSave:a[1]||(a[1]=l=>t("save",l))}),null,16,["values","new"]))],8,Vn)],512))}}),Mn={class:"widget-table"},Ve="update:selectedRows",jn="update:activeRow",At=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:n}){const t=e,o=n,i=r.useSlots(),a=r.computed(()=>{var m;return(m=i==null?void 0:i.default)==null?void 0:m.call(i)[0]});function l(){const w=t.selectedRows.length!==0?[]:[...t.array];o(Ve,w)}function c(m){return t.useMockField?yt(m):m}function s(m,w=!0){if(!t.selectedRows)return;if(!w)return o(Ve,t.selectedRows.includes(m)?[]:[m]);const d=[...t.selectedRows],h=d.indexOf(m);return h===-1?d.push(m):d.splice(h,1),o(Ve,d)}function u(m){o(jn,m)}function f(m){o("save",m),o("update:activeRow",null)}const v=r.computed(()=>t.shortcut?t.config.filter(m=>m.name?!!t.array.find(d=>![null,""].includes(Oe(m,d))):!0):t.config),g=r.computed(()=>t.useMockField?t.array.filter(yt):t.array);return(m,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Mn,[r.createElementVNode("thead",null,[r.createVNode(vn,{config:v.value,onOrder:w[0]||(w[0]=d=>m.$emit("order",d))},{default:r.withCtx(d=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.$slots["head-cell"]||Ct),r.mergeProps(d,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(d,h)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:h},[r.createVNode(Pn,{config:v.value,values:d,selected:m.selectedRows.includes(c(d)),onSelect:y=>s(c(d),y),onActivate:y=>u(c(d)),class:r.normalizeClass(m.classCallback?m.classCallback(d):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&m.activeRow===c(d)?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":m.config.length,values:d,onClose:w[1]||(w[1]=y=>o("update:activeRow",null)),onSave:f,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),m.activeRow===r.unref(S).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":v.value.length,onClose:w[2]||(w[2]=d=>o("update:activeRow",null)),onSave:f,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Un=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${n.color}`})},null,4))}}),ve=M(Un,[["__scopeId","data-v-0ef9ae88"]]),Wn={class:"widget-button"},qn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Wn,[n.wait?(r.openBlock(),r.createBlock(ve,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),Hn=M(qn,[["__scopeId","data-v-450dc564"]]),Gn={class:"widget-multi-button-wrap position_relative cursor_pointer"},zn={class:"widget-multi-button-body grid"},Xn=["onClick"],Kn={class:"widget-multi-button-side-wrap"},Yn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"04895bf1":o.value}));const n=e,t=r.reactive({active:!1,wait:!1}),o=r.computed(()=>n.array.length+(n.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function a(l=!t.active){t.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",Gn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",zn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,u)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,Xn))),128))]),r.createElementVNode("div",Kn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(ve),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(me),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Jn=M(Yn,[["__scopeId","data-v-d43a76ce"]]),Qn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Zn={class:"text_md"},Ke=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Qn,[r.createVNode(ve,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Zn,r.toDisplayString(n.label),1)]))}}),er=["alt","src"],tr=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const n=e,t=r.ref();return r.onMounted(()=>{t.value&&(t.value.src=n.src),t.value.onerror=function(){n.default&&(t.value.src=n.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:t,src:o.src||o.$props.default},null,8,er))}}),nr={props:{config:Array,values:Object,selected:Boolean},setup:Xe},rr=M(nr,[["__scopeId","data-v-344a8cc1"]]),or=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),ir={class:"widget-list-head-cell"},ar=or(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),sr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:n}){const t=e,o=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",ir,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(l=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=l=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(me),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),ar])]))}}),lr=M(sr,[["__scopeId","data-v-bf495d6a"]]),cr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:n}){const t=e,o=n,i=r.ref(),a=r.ref();r.onMounted(()=>{function u(w,d){let h=-1;do h++,d-=w[h];while(d>0&&h<w.length);return h}function f(w,d){let h=0;for(;d>0&&d>w[h]&&h<w.length;)d-=w[h],h++;return console.log(d,h),h>0?h:0}function v(w){try{a.value.style.insetInlineStart=w+"px"}catch(d){console.log(d)}}function g(w){try{a.value.style.width=w+"px",a.value.style.minWidth=w+"px",a.value.style.maxWidth=w+"px"}catch(d){console.log(d)}}function m(w){return w===null?!1:w.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(d){var fe;function h($){return $.screenX+b-D}const y=i.value,p=[...y.children].filter($=>$.localName==="th"),b=((fe=y.offsetParent)==null?void 0:fe.scrollLeft)||0,k=p.map($=>$.clientWidth),A=m(d.target),D=y.getBoundingClientRect().left,_=h(d),C=u(k,_),E=k.slice(0,C).reduce(($,G)=>$+G,0),T=_-E,L=y.offsetWidth,U=p[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",d.screenX),console.log("Widths",k),console.log("max width",L),console.log("Start Position",_),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",T),console.groupEnd(),a.value.innerText=p[C].textContent||"",a.value.style.display="grid",a.value.style.width=U+"px",a.value.style.cursor="grabbing",v(E),g(U),document.addEventListener("pointermove",K,{passive:!0}),document.addEventListener("pointerup",B);function B($){if(console.group("END"),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",B),A&&(t.config[C].width=a.value.style.width,t.config[C].minWidth=a.value.style.width,t.config[C].maxWidth=a.value.style.width,l(t.config)),!A){const G=$.screenX+b-D;console.log("ENP Position",G);const be=f(k,G);if(console.log(C,"->",be),be!==C){const de=t.config[C],De=t.config;De.splice(C,1),De.splice(be,0,de),l(De)}else{const de=t.config[C].name;c(de)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function K($){if(A){const de=h($)-_+U;g(de);return}let G=$.screenX+b-D-T;G<0&&(G=0),G+U>L&&(G=L-U),v(G)}})});function l(u){o("update:config",u)}function c(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(v,g)=>(r.openBlock(),r.createBlock(lr,r.mergeProps({key:v,ref_for:!0},v,{onOrder:m=>c(v.name),onSelect:f[0]||(f[0]=m=>o("select")),order:u.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ur=M(cr,[["__scopeId","data-v-ccffc6bd"]]),fr={class:"widget-list"},dr={class:"widget-list-body position_relative"},pr=50,gr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:n}){const t=e,o=n;function i(s,u=!0){if(t.selectedRows)if(!u)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],v=f.indexOf(s);v===-1?f.push(s):f==null||f.splice(v,1),l(f)}}function a(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return l([...t.array]);l([])}function l(s){o("update:selectedRows",s)}function c(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+pr>u.scrollHeight&&o("scrollEnd")}return(s,u)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",fr,[r.createElementVNode("thead",null,[r.createVNode(ur,{onSelect:u[0]||(u[0]=f=>a()),"onUpdate:order":u[1]||(u[1]=f=>o("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",dr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,v)=>{var g;return r.openBlock(),r.createBlock(rr,{key:v,class:"widget-list-row",values:f,config:s.config,selected:(g=s.selectedRows)==null?void 0:g.includes(f),onSelect:m=>i(f,m)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ye(){var a;const e=r.computed(()=>Object.keys(t).length===0||Object.values(t).includes(!0)),n=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!n)throw"Undefined instance. Please check it.";const t=r.reactive({});r.provide(S.VISIBLE_ITEM_PROVIDE_NAME,{show(l){t[l]=!0},hide(l){t[l]=!1},remove(l){delete t[l]}});const o=r.inject(S.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(n)},hide(){o==null||o.hide(n)},remove(){o==null||o.remove(n)}},visibleItems:t}}const mr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const n=e,t=xe(),o=rt(),i=r.computed(()=>{var d,h,y;const g=s.value,m=u(g),w={type:m,disabled:n.usageContext?!((d=c.value)!=null&&d.canSet):!1,label:n.label};return m==="Decimal"&&((y=(h=g==null?void 0:g.presentationType)==null?void 0:h.toLowerCase)==null?void 0:y.call(h))==="money"&&(w.money=!0),g&&Object.assign(w,{suffix:m==="number"?g.valueUnit:void 0,required:l.includes(m||"")?!1:g.required,label:n.label||g.displayName}),Array.isArray(I.arrayFieldParamsHandlers)&&I.arrayFieldParamsHandlers.forEach(p=>Object.assign(w,p(g,c.value,w))),w}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var g;return(g=o==null?void 0:o.value)==null?void 0:g.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const g=t.value.fieldsByName[n.name];if(g)return g});function u(g){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(g){if(g.type==="Reference"||g.type==="Owned")return g.referencedEntity;if(g.dataType==="Boolean")return"single-checkbox";if(g.dataType==="DateTime")return"date";if(g.dataType==="Integer"||g.dataType==="Decimal")return"number";if(g.dataType==="List")return g.aggregatedEntity;if(a.includes(g.presentationType))return"textarea";if(g.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var g;return n.usageContext?((g=c.value)==null?void 0:g.canGet)===!0:!0}),{controller:v}=Ye();return r.watch(()=>f.value,g=>g?v.show():v.hide(),{immediate:!0}),r.onUnmounted(()=>v.remove()),(g,m)=>f.value?(r.openBlock(),r.createBlock(r.unref(F.FormField),r.mergeProps({key:0},{...g.$attrs,...i.value},{name:g.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function hr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||S.DEFAULT_ORDER_DIR}const yr=["fill"],vr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),wr=[vr],br=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},wr,8,yr))}}),Er={class:"widget-fast-table-head-cell-td"},Cr={key:1,class:"widget-head-cell-label"},kr={key:2,class:"widget-head-cell-order"},_r=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:n}){const t=e,o=r.computed(()=>ze(t.name));r.computed(()=>hr(t.order));const i=n;function a(){i("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",Er,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=u=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",Cr,r.toDisplayString(l.label),1)),o.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",kr,[r.createVNode(br,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),St=M(_r,[["__scopeId","data-v-d131e64e"]]),Tr=["fill"],Ar=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Sr=[Ar],Ir=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},Sr,8,Tr))}}),Lr={class:"widget-filter-item-popup"},Nr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=I.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const m=t.filterItem;return m.entity?"Entity":m.type?m.type:null});function c(m){s.value=m==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let v=null;function g(m=!f.value){f.value=m,!f.value&&v?(v(),v=null):a.value&&(v=F.utils.clickOutside(a.value,g.bind(null,!1)))}return(m,w)=>{var d;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":u.value}]),onClick:w[0]||(w[0]=()=>g())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(m.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(ve,{key:0})):(r.openBlock(),r.createBlock(Ir,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Lr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((d=r.unref(i))==null?void 0:d[l.value]),{key:0,"filter-metadata":m.filterItem,values:m.values,filters:m.filters,"base-entity":m.entity,"onUpdate:values":w[1]||(w[1]=h=>o("update:values",h)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),It=M(Nr,[["__scopeId","data-v-e52e165e"]]),Rr={class:"widget-table-panel-filter flex"},Or=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:n}){const t=e,o=n;function i(a,l){o("update:filters",{...t.filters,[a]:l})}return(a,l)=>(r.openBlock(),r.createElementBlock("div",Rr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var u;return r.openBlock(),r.createBlock(It,{key:s,entity:a.entity,"filter-item":c,values:(u=a.filters)==null?void 0:u[r.unref(re)(c)],filters:a.filters,"onUpdate:values":f=>i(r.unref(re)(c),f)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Fr=M(Or,[["__scopeId","data-v-89e1fa2d"]]),Br={class:"widget-fast-table-tools"},xr=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:n}){const t=e,o=ne.useRouter(),i=n,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>i("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(g=>g.name),c=r.inject(S.PROVIDE_NAME_ACTIONS,[]);function s(g){return{...g,label:g.label||"Batch update",callback:async()=>{const m=await q.promptModal(S.MODAL_BATCH_VALUES,{entity:t.metadata.name,availableFields:g.availableFields||[]}),w=t.metadata.fieldNameForIdentification,d=(t.selectedRows||[]).map(h=>({primaryKey:h[w],version:t.metadata.versioned?h.Version:void 0}));await Vt(t.metadata.name,{values:m,elements:d}),i("reload")}}}const u=r.computed(()=>{var w;const g=((w=c==null?void 0:c.actions)==null?void 0:w.value)||[];return Array.isArray(t.tools)?(t.tools,t.tools.reduce((d,h)=>{if(h.name==="*")d.push(...a);else if(l.includes(h.name)){const y=a.find(p=>p.name===h.name);y&&d.push(y)}else if(h.name==="redirect"){const y={...h,label:h.label,callback:()=>o.push(h.to)};d.push(y)}else if(h.name==="batch-update"&&!h.override)d.push(s(h));else{h.override&&g.find(p=>p.name===h.override)&&h.name==="batch-update"&&d.push(s(h));const y=g.find(p=>p.name===h.name);y&&d.push({name:h.name,label:y.title,icon:h.icon,buttonStyle:h.buttonStyle,callback:()=>Promise.resolve().then(()=>{f[h.name]=!0}).then(()=>v(y)).finally(()=>{f[h.name]=!1})})}return d},[])):[]}),f=r.reactive({});function v(g){var d;const m=(d=g.action.parameters.find(h=>h.dataTypeName==="IntegerArray"))==null?void 0:d.name,w={};return m&&(w[m]=t.selectedRows.map(h=>{if(!(typeof h=="object"&&h!==null))return null;const y=t.metadata.fieldNameForIdentification;return y===void 0?null:h[y]})),g.callback(w)}return(g,m)=>{const w=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Br,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,d=>(r.openBlock(),r.createBlock(w,{label:d.label,title:d.name,icon:d.icon,type:d.buttonStyle,loading:d.name==="reload"?g.loading:f[d.name],onClick:d.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(g.$slots,"default",{},void 0,!0)])}}}),Dr=M(xr,[["__scopeId","data-v-3a74319d"]]);function $r(e){const n=Tt(),t=ne.useRouter(),o=r.reactive({entity:null,mark:null,settings:null});function i(p){const b={...u.value,...p};a(b)}function a(p){{const b=p.prefilters;b&&(Object.keys(b).forEach(k=>{var A,D;Array.isArray(b[k])&&b[k].length===0&&o.settings&&!((D=(A=o.settings)==null?void 0:A.prefilters)!=null&&D[k])&&delete b[k]}),F.utils.isEmptyObject(b)&&delete p.prefilters)}localStorage.setItem(s(o.entity,o.mark),JSON.stringify(p))}function l(){return o.entity?JSON.parse(localStorage[s(o.entity,o.mark)]||"{}"):null}function c(p,b){o.entity=p,o.mark=b,v.call()}function s(p,b){return"list-configuration:"+p+(b?"-"+b:"")}const u=r.computed(()=>o.entity?JSON.parse(n[s(o.entity,o.mark)]||"{}"):null),f=r.computed(()=>o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]),v=ce(async function(){if(!o.entity)return;const b=await xt(o.entity,o.mark);o.settings=Object.freeze(b)}),g=r.computed(()=>{var k;const p=u.value.order||{},b=((k=o.settings)==null?void 0:k.prefilters)||{};return p||b||[]}),m=r.computed(()=>{var k;const p=u.value.prefilters||{};return{...((k=o.settings)==null?void 0:k.prefilters)||{},...p}}),w=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.filters)||[]}),d=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.label)||null}),h=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.tools)||[]}),y=r.computed(()=>!F.utils.isEmptyObject(u.value));return{state:o,get customFilters(){return o.settings.customFilters||[]},set:c,get:l,configuration:u,update:i,computedPrefilter:m,computedFiltersConfiguration:w,get cellConfig(){return o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]},get prefilters(){var p;return((p=l())==null?void 0:p.prefilters)||o.settings.prefilters||{}},get order(){var p;return((p=l())==null?void 0:p.order)||[]},clean(){localStorage.removeItem(s(o.entity,o.mark))},cellConfiguration:f,computedLabel:d,computedTools:h,computedHasLocalConfiguration:y,computedOrder:g,get displayModeForNew(){return o.settings.displayModeForNew||"inline"}}}const Pr={class:"es-grid es-gap-15"},Vr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Mr={class:""},jr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e;ne.useRouter();const o=r.ref([]),i=r.ref(null),a=r.computed(()=>i.value===S.LIST_ACTIVE_NEW?i.value:i.value?i.value[2]:null);function l(E,T,L){i.value=[E,T,L]}const c=r.ref(null),s=F.Form.getParentForm(),u=r.ref([]),f=xe(t.entity),{state:v,update:g}=rt(t.entity,{masterEntities:t.masterEntities||[]}),m=ce(async()=>{try{await d.call(),await g()}catch(E){const{message:T}=Je(E);c.value=T}});s instanceof F.Form&&s.subscribe({read:m.call.bind(null),name:t.entity,type:"table"}),r.watch(()=>t.mark,()=>{A.set(t.entity,t.mark)});function w(){return x.and(x(A.prefilters),x(t.binding||{}))}const d=ce(async function(){const T=t.entity;c.value=null,u.value=[];const L=(await oe(T,{customFilters:A.customFilters,fields:Ze(D.value).join(" "),order:A.order,filter:w()})).map(Ei);o.value=L}),{controller:h}=Ye();r.watch(()=>v.value,E=>{E&&(E.canRead?h.show():h.hide())},{immediate:!0});let y=[he.on("affected-entity",E=>{E.name===t.entity&&d.call()}),he.on("display-entity",async E=>{E.name===t.entity&&(d.promise&&await d.promise,l(E.name,E.id,o.value.find(T=>T[f.value.fieldNameForIdentification]===E.id)))})];r.onUnmounted(()=>{y.map(E=>E()),h.remove()});function p(E){function T(B){return Array.isArray(B)?T(B[0]):typeof B!="string"?null:B}const L=T(E);if(!L)return;const U=A.order;b("order",U[0]!==L?[L,"asc"]:U[1]==="desc"?[]:[L,"desc"])}function b(E,T){A.update({[E]:T}),d.call()}const k=r.computed(()=>m.wait),A=$r(l),D=A.cellConfiguration;A.set(t.entity,t.mark),r.watch(()=>A.state.settings,m.call);const _=r.computed(()=>A.state.settings);n({listSettings:_,array:o,config:D});function C(){q.openModal(S.MODAL_LIST_DOWNLOAD,{entity:t.entity,cellConfig:A.cellConfig,order:A.order,prefilters:w(),customFilters:A.customFilters})}return(E,T)=>{const L=r.resolveComponent("widget-button"),U=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Pr,[r.unref(A).computedLabel.value&&!E.hideLabel?(r.openBlock(),r.createElementBlock("p",Vr,r.toDisplayString(r.unref(A).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(f)?(r.openBlock(),r.createBlock(Dr,{key:1,metadata:r.unref(f),tools:r.unref(A).computedTools.value,loading:k.value,"selected-rows":u.value||[],onReload:r.unref(m).call,onExport:C},{default:r.withCtx(()=>{var B;return[(B=r.unref(v))!=null&&B.canCreate?(r.openBlock(),r.createBlock(L,{key:0,onClick:T[0]||(T[0]=K=>i.value=r.unref(S).LIST_ACTIVE_NEW),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(A).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(L,{key:1,onClick:r.unref(A).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:1},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",Mr,[r.createVNode(Fr,{entity:E.entity,"filters-config":r.unref(A).computedFiltersConfiguration.value,filters:r.unref(A).computedPrefilter.value,"onUpdate:filters":T[1]||(T[1]=B=>b("prefilters",B))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(At),{config:r.unref(D),array:o.value,"active-row":a.value,"onUpdate:activeRow":T[3]||(T[3]=B=>i.value=null),onOrder:p,class:"table",selectedRows:u.value,"onUpdate:selectedRows":T[4]||(T[4]=B=>u.value=B)},{"head-cell":r.withCtx(B=>{var K,fe,$;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(E.$slots["head-cell"]?E.$slots["head-cell"]:St),r.mergeProps({label:B.label},B,{onOrder:p,order:r.unref(A).computedOrder.value,type:B.type,"is-full-selected":((K=u.value)==null?void 0:K.length)===((fe=o.value)==null?void 0:fe.length)&&(($=o.value)==null?void 0:$.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>{var B,K;return[r.createVNode(U,{entity:(B=i.value)==null?void 0:B[0],"primary-key":(K=i.value)==null?void 0:K[1],"master-entities":E.masterEntities||void 0,binding:E.binding,onFormUpdate:T[2]||(T[2]=()=>{i.value=null,r.unref(d).call()})},null,8,["entity","primary-key","master-entities","binding"])]}),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Lt(e,n={},t={}){const o=r.inject(S.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:n,a=typeof n=="string"?t:n;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(u=>u.name===i);return c?{...c,...a}:null})}const Ur=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const n=e,t=Lt(n.name,n.overrideParams||{}),o=r.computed(()=>{if(t.value)return ce(t.value.callback)});return(i,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(t)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(t).label,loading:((c=o.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,u;return(u=(s=o.value)==null?void 0:s.call)==null?void 0:u.call(s,i.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),Wr=r.defineComponent({__name:"WidgetResolverEntity",setup(e){const n=ne.useRouter(),t=ne.useRoute();function o(){const i=t.params.entity,a=t.params.primaryKey;et(i,a).then(l=>n.replace(tn(l,a))).catch(l=>{V("error")(l),n.back()})}return r.onMounted(o),(i,a)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(Ke,{label:"Loading..."})]))}}),qr=r.defineComponent({__name:"modal-list-download",props:{entity:{},cellConfig:{},prefilters:{},order:{},customFilters:{}},setup(e){const n=e,t=r.computed(()=>o.finished?"Download CSV":`Download ${o.count} records.`),{state:o,downloadFile:i,reject:a,start:l}=on({entity:n.entity,config:n.cellConfig,prefilters:n.prefilters,order:n.order,customFilters:n.customFilters});return q.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>o.finished,()=>{i(),q.popModal()}),(c,s)=>{const u=r.resolveComponent("widget-button"),f=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(f,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=v=>{r.unref(i)(),r.unref(q.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(Ke,{label:"Loading"})])]),_:1})}}});function Nt(e){return Se(e,"YYYY/MM/DD HH:mm:ss")}function Se(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return ln.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function ce(e){function n(i){o.status=i}function t(...i){if(o.loading)return Promise.reject("The process has already started.");o.loading=!0,o.wait=!0;const a=Promise.resolve().then(()=>n(1)).then(()=>e(...i)).then(l=>(n(3),l)).catch(l=>{throw n(2),l}).finally(()=>{o.wait=!1,o.loading=!1,o.promise=null});return o.promise=a,a}const o=r.reactive({status:0,wait:!1,loading:!1,call:t,promise:null});return o}var Rt=(e=>(e[e.init=0]="init",e[e.loading=1]="loading",e[e.error=2]="error",e[e.done=3]="done",e))(Rt||{});function Je(e){return typeof e=="string"?Ce(e):Hr(e)?Ce(e.message,e.children||e.details||[]):Gr(e)?Ce(e.title,[e.detail||""]):Ce(S.DEFAULT_ERROR_MESSAGE)}function Hr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Gr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Ce(e,n=[]){return{message:e,children:n}}function V(e="error"){return function(n){const{message:t,children:o}=Je(n);ot.add(e,t,{children:o})}}function oe(e,n={}){const t=R();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:read",{entity:e,...n})}function Ot(e){return!!(e.id||e.primaryKey)}function Qe(e,n){const t=R();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:update",{...n,entity:e})}function Ze(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ft(e,n=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(n,"0"),o[1].length>n&&(o[1]=o[1].substring(0,n)),o.join(".")}function zr(e,n){const t=new Map;return e.forEach(o=>{var a;const i=n(o);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(o)}),t}function Xr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Kr(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return S.DEFAULT_ERROR_MESSAGE}})}function j(e,n={}){return H.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=H.contextId),n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.reload():t).catch(()=>{throw new Error(S.DEFAULT_ERROR_MESSAGE)}).then(t=>Kr(t).then(o=>{if(!t.ok)throw o;return o}))}function Yr(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function Jr(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Qr=Re(Fe("pretty-value-field-by-entity"));function Zr(e,n,t){try{const o=Le.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[n];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${n}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(o){return Qr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const ee=Re(Fe("use-socket"));function R(){return to}function eo(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const to=function(){let e=1,n,t;const o=new Set;let i=0;const a=new Set;function l(){if(n)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{n.close()},Cn*2);const y=new Uint8Array(1);y[0]=En,n.send(y)}setInterval(()=>{Array.from(o).forEach(y=>{h(y)&&(ee("Handler for event %s requestId %d was expired",y.event,y.requestId),y.requestId?s({requestId:y.requestId,event:kt,data:{message:Q.RequestTookToLong().message}}):o.delete(y))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&u()},S.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(y){const p=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,y.event,y.requestId),p.forEach(b=>{const k=y.requestId;(b.requestId&&b.requestId===k||!b.requestId&&b.event===y.event)&&(ee("Find appropriated handler: %d, event: %s",e,b.event),b.callback(y.data,y),b.once&&(o.delete(b),ee("Handler was removed by *once* params was passed. %o",b)))})}function u(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),n=new WebSocket(t),n.onclose=function(y){ee("Connection to server was stopped: %d %s",y.code,y.reason),Array.from(o).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(y=>{f(y),a.delete(y)})},n.onerror=function(y){console.warn(y)},n.onmessage=y=>{var p;try{if(eo(y.data)){l();return}const b=JSON.parse(y.data);if(!Bt(b)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(b);return}b.event==="progress"&&o.forEach(k=>{k.event===b.data.for.event&&k.requestId===b.data.for.requestId&&(console.log("UPDATE TIME"),k.timeToLive=new Date().getTime()-k.created+S.TIME_TO_LIVE_SOCKET_REQUEST)}),(p=b==null?void 0:b.data)!=null&&p.refresh&&location.reload(),s(b)}catch(b){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(b)}}}function f(y){n.send(y)}function v(y,p){d({event:y,callback:p})}function g(y,p){d({event:y,callback:p,once:!0})}function m(){return n&&(n==null?void 0:n.readyState)===1}function w(y,p,b){const k=++e,A=JSON.stringify({requestId:k,event:y,data:p,contextId:H.contextId,url:I.socketURLHandler?I.socketURLHandler():window.location.href});return m()?f(A):(a.add(A),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,_)=>{d({event:y,requestId:k,once:!0,guaranteedAnswer:!0,serializeString:A,callback:(C,E)=>{if(ee("Promise was resolve with next data:",C),no(E))return void _(C);b&&b(C,E),D(C)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function d(y){const p={timeToLive:0,...y,created:new Date().getTime()};o.add(p)}function h(y){return y.timeToLive===0||typeof y.timeToLive!="number"?!1:new Date().getTime()-y.created>y.timeToLive}return{get socket(){return n},on:v,once:g,emit:w,initialization(y){t=y},getDevInfo:c}}(),no=e=>!!Bt(e)&&e.event===kt,Bt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function xt(e,n){return R().emit("list-setting:read",{entity:e,mark:n})}function ro(e,n){return R().emit("metadata-field:treat",{entity:e,fieldName:n})}function Dt(e,n){return R().emit("entity:create",{...n,entity:e})}function $t(e,n){return R().emit("entity:delete",{...n,entity:e})}function oo(e,n){return R().emit("usage-context:read",{...n,entity:e})}function Pt(e={}){return R().emit("tool:read",e)}function io(){return R().emit("metadata-list:read",{})}function Vt(e,n){return R().emit("batch:update",{...n,entity:e})}function et(e,n){return R().emit("entity:resolve",{primaryKey:n,entity:e})}function ao(e){return R().emit("history:read",e)}function so(e,n){return R().emit("entity:count",{...n,entity:e})}function lo(e){return`/${kn}/${e}`}function ue(e){return{exec(n,t){switch(e.name){case"replace-boolean":return ue.replaceBoolean(n,e.values);case"replace-record-operation":return ue.replaceRecordOperation(n)}}}}ue.replaceBoolean=co;ue.replaceRecordOperation=uo;function co(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function uo(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function fo(e={}){return R().emit("tool:execute",e)}const po=Re(Fe("wrap-tool-response"));function Mt(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=ho),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=vo),e.handleCloseForm===void 0&&(e.handleCloseForm=wo),e.handleValidationResult===void 0&&(e.handleValidationResult=yo),{...n,label:n.title,async callback(t={}){var l;const o=typeof e.values=="function"?e.values(n,e):e.values;let i={};n.action.targetName==="Record"&&o.hasOwnProperty("Id")&&(i.Id=o.Id,delete o.Id);const a=()=>fo({name:n.name,values:{...o,...t},primaryKeys:i,usageContext:n.usageContext}).then(async c=>{var s,u;if(!go(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const f of e.handlers)await f(n,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((u=(s=c.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(n,c.validationEffect,e),new Error(c.message);return c.message&&ot.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(f=>{var v;return(v=e.handleAffectedEntity)==null?void 0:v.call(e,n,f,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),c}).catch(V("error"));if((l=e.overrides)!=null&&l[n.name])return e.overrides[n.name](n,e);if(n.paramDialog){const c=await bo(n,e);if(c===null)return;t=Object.assign(t,c||{})}return n.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!n.confirmation||!e.handleConfirmation||n.paramDialog?a():e.handleConfirmation(n,a)}}}function go(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function mo(e){const n="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?n:typeof e=="string"?e:n}async function ho(e,n){const t=mo(e.confirmation);if(!q.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await q.promptModal(S.MODAL_CONFIRM,{message:t}))return n()}function yo(e,n){const t=S.MODAL_VALIDATION_EFFECT;if(!q.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{q.pushModal(t,n)})}function vo(e,n,t){var s;function o(u){return u!==null&&typeof u=="object"&&typeof u.read=="function"}function i(u,f){u&&(po("Affected Entity %s. Find form with name %s.",f,u.name),u.name===f&&o(u)&&u.read(),u instanceof F.Form&&u.dependencies.forEach(v=>i(v,f)))}he.emit("affected-entity",n);const{router:a,form:l}=t,c=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){he.emit("display-entity",{id:c,name:n.name}),I.getEntityLink&&a.push(I.getEntityLink(n.name,c));return}i(l,n.name)}function wo(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}function bo(e,n){var t;if((t=e.paramDialog)!=null&&t.name)return q.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:n})}let te={};function Z(e,...n){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let t=F.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof t=="string")return dt(t,n);const o=F.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?dt(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function dt(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}Z.setGlobalVocabulary=function(e){te=e};Z.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:F.utils.getPropFromObject(te,n.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function Eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ue={exports:{}},O={},We={exports:{}},ie={};function jt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function Co(e,n,t){}function ko(e,n,t){}var _o=/javascript\s*\:/img;function To(e,n){return _o.test(n)?"":n}ie.whiteList=jt();ie.getDefaultWhiteList=jt;ie.onAttr=Co;ie.onIgnoreAttr=ko;ie.safeAttrValue=To;var Ao={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},pe=Ao;function So(e,n){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function c(){if(!o){var f=pe.trim(e.slice(i,a)),v=f.indexOf(":");if(v!==-1){var g=pe.trim(f.slice(0,v)),m=pe.trim(f.slice(v+1));if(g){var w=n(i,l.length,g,m,f);w&&(l+=w+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var u=e.indexOf("*/",a+2);if(u===-1)break;a=u+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||c():s===`
|
|
7
|
-
`&&c()}return pe.trim(l)}var Io=So,ke=ie,Lo=Io;function pt(e){return e==null}function No(e){var n={};for(var t in e)n[t]=e[t];return n}function Ut(e){e=No(e||{}),e.whiteList=e.whiteList||ke.whiteList,e.onAttr=e.onAttr||ke.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ke.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ke.safeAttrValue,this.options=e}Ut.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onAttr,a=t.onIgnoreAttr,l=t.safeAttrValue,c=Lo(e,function(s,u,f,v,g){var m=o[f],w=!1;if(m===!0?w=m:typeof m=="function"?w=m(v):m instanceof RegExp&&(w=m.test(v)),w!==!0&&(w=!1),v=l(f,v),!!v){var d={position:u,sourcePosition:s,source:g,isWhite:w};if(w){var h=i(f,v,d);return pt(h)?f+":"+v:h}else{var h=a(f,v,d);if(!pt(h))return h}}});return c};var Ro=Ut;(function(e,n){var t=ie,o=Ro;function i(l,c){var s=new o(c);return s.process(l)}n=e.exports=i,n.FilterCSS=o;for(var a in t)n[a]=t[a];typeof window<"u"&&(window.filterCSS=e.exports)})(We,We.exports);var tt=We.exports,nt={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var n=/\s|\n|\t/,t=n.exec(e);return t?t.index:-1}},Oo=tt.FilterCSS,Fo=tt.getDefaultWhiteList,Ie=nt;function Wt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qt=new Oo;function Bo(e,n,t){}function xo(e,n,t){}function Do(e,n,t){}function $o(e,n,t){}function Ht(e){return e.replace(Vo,"<").replace(Mo,">")}function Po(e,n,t,o){if(t=Jt(t),n==="href"||n==="src"){if(t=Ie.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return""}else if(n==="background"){if(_e.lastIndex=0,_e.test(t))return""}else if(n==="style"){if(gt.lastIndex=0,gt.test(t)||(mt.lastIndex=0,mt.test(t)&&(_e.lastIndex=0,_e.test(t))))return"";o!==!1&&(o=o||qt,t=o.process(t))}return t=Qt(t),t}var Vo=/</g,Mo=/>/g,jo=/"/g,Uo=/"/g,Wo=/&#([a-zA-Z0-9]*);?/gim,qo=/:?/gim,Ho=/&newline;?/gim,_e=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,gt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,mt=/u\s*r\s*l\s*\(.*/gi;function Gt(e){return e.replace(jo,""")}function zt(e){return e.replace(Uo,'"')}function Xt(e){return e.replace(Wo,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Kt(e){return e.replace(qo,":").replace(Ho," ")}function Yt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return Ie.trim(n)}function Jt(e){return e=zt(e),e=Xt(e),e=Kt(e),e=Yt(e),e}function Qt(e){return e=Gt(e),e=Ht(e),e}function Go(){return""}function zo(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:Ie.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",f=s.position+u.length;return i.push([a!==!1?a:s.position,f]),a=!1,u}else return a||(a=s.position),"[removed]";else return n(l,c,s)},remove:function(l){var c="",s=0;return Ie.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function Xo(e){for(var n="",t=0;t<e.length;){var o=e.indexOf("<!--",t);if(o===-1){n+=e.slice(t);break}n+=e.slice(t,o);var i=e.indexOf("-->",o);if(i===-1)break;t=i+3}return n}function Ko(e){var n=e.split("");return n=n.filter(function(t){var o=t.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),n.join("")}O.whiteList=Wt();O.getDefaultWhiteList=Wt;O.onTag=Bo;O.onIgnoreTag=xo;O.onTagAttr=Do;O.onIgnoreTagAttr=$o;O.safeAttrValue=Po;O.escapeHtml=Ht;O.escapeQuote=Gt;O.unescapeQuote=zt;O.escapeHtmlEntities=Xt;O.escapeDangerHtml5Entities=Kt;O.clearNonPrintableCharacter=Yt;O.friendlyAttrValue=Jt;O.escapeAttrValue=Qt;O.onIgnoreTagStripAll=Go;O.StripTagBody=zo;O.stripCommentTag=Xo;O.stripBlankChar=Ko;O.attributeWrapSign='"';O.cssFilter=qt;O.getDefaultCSSWhiteList=Fo;var Be={},J=nt;function Yo(e){var n=J.spaceIndex(e),t;return n===-1?t=e.slice(1,-1):t=e.slice(1,n+1),t=J.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function Jo(e){return e.slice(0,2)==="</"}function Qo(e,n,t){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",f="";e:for(c=0;c<s;c++){var v=e.charAt(c);if(a===!1){if(v==="<"){a=c;continue}}else if(l===!1){if(v==="<"){o+=t(e.slice(i,c)),a=c,i=c;continue}if(v===">"||c===s-1){o+=t(e.slice(i,a)),f=e.slice(a,c+1),u=Yo(f),o+=n(a,o.length,u,f,Jo(f)),i=c+1,a=!1;continue}if(v==='"'||v==="'")for(var g=1,m=e.charAt(c-g);m.trim()===""||m==="=";){if(m==="="){l=v;continue e}m=e.charAt(c-++g)}}else if(v===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Zo=/[^a-zA-Z0-9\\_:.-]/gim;function ei(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function c(g,m){if(g=J.trim(g),g=g.replace(Zo,"").toLowerCase(),!(g.length<1)){var w=n(g,m||"");w&&i.push(w)}}for(var s=0;s<l;s++){var u=e.charAt(s),f,v;if(a===!1&&u==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:ni(e,s+1);continue}if(a!==!1&&s===o){if(v=e.indexOf(u,s+1),v===-1)break;f=J.trim(e.slice(o+1,v)),c(a,f),a=!1,s=v,t=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(v=ti(e,s),v===-1){f=J.trim(e.slice(t,s)),c(f),a=!1,t=s+1;continue}else{s=v-1;continue}else if(v=ri(e,s-1),v===-1){f=J.trim(e.slice(t,s)),f=ht(f),c(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?c(e.slice(t)):c(a,ht(J.trim(e.slice(t))))),J.trim(i.join(" "))}function ti(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ni(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function ri(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function oi(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ht(e){return oi(e)?e.substr(1,e.length-2):e}Be.parseTag=Qo;Be.parseAttr=ei;var ii=tt.FilterCSS,W=O,Zt=Be,ai=Zt.parseTag,si=Zt.parseAttr,Ae=nt;function Te(e){return e==null}function li(e){var n=Ae.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ae.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=Ae.trim(e.slice(0,-1))),{html:e,closing:t}}function ci(e){var n={};for(var t in e)n[t]=e[t];return n}function ui(e){var n={};for(var t in e)Array.isArray(e[t])?n[t.toLowerCase()]=e[t].map(function(o){return o.toLowerCase()}):n[t.toLowerCase()]=e[t];return n}function en(e){e=ci(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=W.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ui(e.whiteList||e.allowList):e.whiteList=W.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":W.attributeWrapSign,e.onTag=e.onTag||W.onTag,e.onTagAttr=e.onTagAttr||W.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||W.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||W.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||W.safeAttrValue,e.escapeHtml=e.escapeHtml||W.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new ii(e.css))}en.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onTag,a=t.onIgnoreTag,l=t.onTagAttr,c=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,f=n.attributeWrapSign,v=n.cssFilter;t.stripBlankChar&&(e=W.stripBlankChar(e)),t.allowCommentTag||(e=W.stripCommentTag(e));var g=!1;t.stripIgnoreTagBody&&(g=W.StripTagBody(t.stripIgnoreTagBody,a),a=g.onIgnoreTag);var m=ai(e,function(w,d,h,y,p){var b={sourcePosition:w,position:d,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(o,h)},k=i(h,y,b);if(!Te(k))return k;if(b.isWhite){if(b.isClosing)return"</"+h+">";var A=li(y),D=o[h],_=si(A.html,function(C,E){var T=Ae.indexOf(D,C)!==-1,L=l(h,C,E,T);return Te(L)?T?(E=s(h,C,E,v),E?C+"="+f+E+f:C):(L=c(h,C,E,T),Te(L)?void 0:L):L});return y="<"+h,_&&(y+=" "+_),A.closing&&(y+=" /"),y+=">",y}else return k=a(h,y,b),Te(k)?u(y):k},u);return g&&(m=g.remove(m)),m};var fi=en;(function(e,n){var t=O,o=Be,i=fi;function a(c,s){var u=new i(s);return u.process(c)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var c in t)n[c]=t[c];for(var s in o)n[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(Ue,Ue.exports);var di=Ue.exports;const pi=Eo(di);function gi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),pi(e)}function mi(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function hi(e,n){const t={dir:e<0?n==="long"?"W":"S":n==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`}function tn(e,n){const t=["forms",e];return n&&t.push(n),"/"+t.join("/")}function yi(e,n){return"/"+[S.PATH_RESOLVER_ENTITY,e,n].join("/")}function vi(){return`/${S.PATH_RESOLVER_ENTITY}/:entity/:primaryKey`}function qe(e,n,t){const o=Z.getScope(e.toLowerCase());return n.map(i=>{typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=l=>q.openModal("modal-history",{id:l.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History");const a=i.displayMode;if(a){const l=async c=>{try{const s=c[re(i)];return[await et(bi(i,c),s),s]}catch{return[]}};a&&(a==="form"?i.link=c=>{const s=c[re(i)];return s?yi(i.entity,s):null}:i.onClick=async c=>{const[s,u]=await l(c);if(!s||!u)return null;switch(i.displayMode){case"modal":return q.openModal(S.MODAL_ENTITY,{entity:s,primaryKey:u});case"inline":return t.activate(s,u,c)}}),i.class="widget-table-cell_link cursor_pointer",typeof i.value!="string"&&(i.value=(c,s)=>s[i.name[1]])}return wi(i,i.type,i.presentation),I.listConvertCellConfigHandler&&I.listConvertCellConfigHandler(e,i),i})}function wi(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const bi=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function yt(e){return typeof e!="object"||e===null?null:e[S.TABLE_MOCK_FIELD]}function Ei(e,n){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof n=="string"||typeof n=="number"||typeof n=="function"?(typeof n=="function"&&(n=n(e)),e[S.TABLE_MOCK_FIELD]=n):e[S.TABLE_MOCK_FIELD]=e.Id,e)}function Ci(e){if(!Array.isArray(I.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");I.arrayListCellHandlers.push(e)}function ki(e,n){const t=re(e);return t?F.utils.getPropFromObject(n,t):null}function _i(e){if(!Array.isArray(I.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");I.arrayFieldParamsHandlers.push(e)}const Ti={addListCellHandler:Ci,getCellModelValue:ki,addFieldParamsHandler:_i};var nn=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(nn||{});function Ai(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function Si(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function rn(e,n){e()&&(await n(),await rn(e,n))}function Ii(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(_=>u(_,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(t==null?void 0:t.filterSearchFn)||((_,C)=>Si(_,C));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function v(){const _=k();return typeof _.limit!="number"&&(_.limit=100),_.offset=c,(t.request||oe)(e,_).then(E=>(c+=E.length,E))}function g(_,C){var T;return typeof _.Version=="number"?_.Version:(T=l.find(L=>L.Id===C))==null?void 0:T.Version}function m(_,C){const E=l.findIndex(T=>T.Id===_);if(E===-1)throw new Error(`Can't found item with Id ${_}`);l.splice(E,1,C)}function w(_){const C=l.findIndex(E=>E.Id===_);if(C===-1)throw new Error(`Can't found item with Id ${_}`);l.splice(C,1)}async function d(_,C){try{const E=k(),T=g(C,_);delete C.Version,await Qe(e,{id:_,values:C,version:T,masterEntities:f()});const L=await oe(e,{fields:E.fields||"",id:_});m(_,L)}catch(E){V()(E)}}async function h(_,C={}){try{const E=k(),T=g(C,_);delete C.Version,await $t(e,{id:_,version:T,masterEntities:f()}),w(_)}catch(E){V()(E)}}async function y(_){try{await Dt(e,{values:_,masterEntities:f()}),await A()}catch(C){V()(C)}}let p;async function b(){s.value=!0;try{p!=null&&p.signal&&!p.signal.aborted&&p.abort();let _=p=new AbortController,C=0;const T=k().limit||0;if(i.value&&!T){console.warn("Using textSearch assumes the use of limit.");return}await rn(()=>(T>0?C<T:!0)&&!o&&!_.signal.aborted,async()=>{const L=await v();_.signal.aborted||(l.push(...L),C+=L.filter(U=>u(U,i.value)).length,(L.length<T||T===0)&&(o=!0))})}catch(_){V()(_)}s.value=!1}function k(){return typeof n=="function"?n():n}async function A(){try{c=0,o=!1,l.splice(0,l.length),await b()}catch(_){V()(_)}}function D(){if(p)return p.abort();s.value=!1}return{array:l,updateById:d,next:b,reload:A,wait:s,create:y,deleteById:h,textSearch:i,filteredArray:a,abort:D}}function Li(){function e(){return{organizations:H.organizations,currentContextId:H.contextId,person:H.person,context:H.context,contextType:H.contextType,userId:H.userId}}const n=r.reactive(e());return H.onupdateContext(()=>{Object.assign(n,e())}),n}function Ni(e,n,t){return R().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function Ri(e,n,t){return R().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function Oi(e,n){return R().emit("communication-message:create",{communicationId:e,text:n})}function Fi(e){return R().emit("communication-message:read",{communicationId:e})}function Bi(e){const n=F.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>Fi(e.id).then(o=>(t.splice(0,t.length,...o),o)),{array:t}}function xi(e,n){e.read=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return oe(e.name,o)}).then(at).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(V())},e.save=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Qe(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw V()(i),i})};function t(){return typeof n=="function"?n():n}}function xe(e){if(!e)return r.inject(S.PROVIDE_NAME_METADATA);Le.initEntity(e);const n=r.computed(()=>Le.state[e]);return r.provide(S.PROVIDE_NAME_METADATA,n),n}function rt(e,n={}){if(!e)return r.inject(S.PROVIDE_NAME_USAGE_CONTEXT);const t=r.ref(null);return r.provide(S.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await oo(e,Di(n||{}))}}}function Di(e){return typeof e=="function"?e():e}function $i(e){if(!e)return r.inject(S.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Mt(e,l))),i={actions:o,update:a};r.provide(S.PROVIDE_NAME_ACTIONS,i),e.router=ne.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return Pt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>t.splice(0,0,...c)).catch(V("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function Pi(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function Vi(e,n={}){const t=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){t.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>t.includes(s),a=s=>{n.handleSelect&&!n.handleSelect(s)||i(s)||t.push(s)},l=s=>{const u=t.findIndex(f=>f===s);u!==-1&&t.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,c,a,l]}function Mi(e){const n=r.ref(""),t=r.computed(()=>{const o=n.value.toLowerCase();return r.unref(e).filter(i=>n.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:n,searchArray:t}}class Me{static async getStartConfig(n,t){return R().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return R().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return R().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function ji(e){return e.statusName===P.Completed}function Ui(e){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(e.statusName)}function Wi(e){return e.statusName===P.ValidationError}function qi(e){return e.statusName===P.Undefined}function Hi(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>v(i,l.value)),s=r.ref(null),u=r.reactive([]),f=r.computed(()=>u.map(p=>v(i,p)));function v(p,b){return p.find(k=>k.name===b)||null}async function g(p){var b;if(qi(p)){await t.onDisplayDataSet(p);return}if(!(Ui(p)&&!await t.onDisplayDataSet(p))){if(Wi(p))return void t.onValidation(p.validationResults);d(p),await r.nextTick();{const k=((b=v(i,l.value))==null?void 0:b.fields)||[];if([P.FinalStep,P.NextStep,P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(p.statusName)&&(!k.length||Gi(k,t.presets)))return y(t.presets||{})}ji(p)&&t.onCompleted(p)}}async function m(){try{await w(),await h()}catch(p){V("error")(p)}}function w(){return a.value="Loading process information.",Me.getStartConfig(n,e).then(p=>(s.value={label:p.processTitle,info:p.processInfo,icon:p.processIcon},i=p.steps.map(b=>{const k=b.frontendEntity.rootObject,A=Object.fromEntries(b.frontendEntity.objectTypes.map(D=>[D.name,D.properties]));return{label:b.title,name:b.stepName,number:b.number,rootObjectName:k,objectTypes:A,fields:A[k],buttonCaption:b.buttonCaption}}))).finally(()=>{a.value=!1})}function d(p){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation,P.NextStep,P.Completed,P.FinalStep].includes(p.statusName)?(o=p.token,l.value=p.nextStepName):console.log("Saving is not completed:",p),p}function h(){return a.value="Starting process",Me.startProcess(n,e).then(g).catch(V("error")).finally(()=>{a.value=null})}function y(p={}){const b=l.value;return!o||!b?Promise.reject("Not step or token."):(a.value="Waiting for result...",Me.runStep(n,e,b,o,p).then(g).then(k=>(u[u.length-1]!==b&&u.push(b),k)).catch(V("error")).finally(()=>{a.value=!1}))}return{initialize:m,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:u,processInfo:s,next:y}}function Gi(e,n){for(let t=0;t<e.length;t++){const o=e[t];if(!F.utils.getPropFromObject(n,o.name))return!1}return!0}function zi(e,n){const t=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,n||{});return{name:t,arguments:o}}function Xi(e){return e.limit||(e.limit=150),e}function on(e,n={}){const{limit:t}=Xi(n),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(d=>f(d.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function f(d){d===null&&(d=""),d===void 0&&(d="-");let h=typeof d!="string"?String(d):d;return h=h.replace(/"/g,'""'),h.search(/("|,|\n)/g)>=0&&(h='"'+h+'"'),h}function v(){return oe(a,{fields:Ze(l).join(" "),limit:t,offset:u.offset,order:i,filter:typeof o=="string"?o:x(o||{}),customFilters:c.map(d=>{var h;return zi(d,(h=n.customFiltersData)==null?void 0:h[typeof d=="string"?d:d.name])})}).then(d=>(u.offset+=t,d))}function g(){const d="data:text/csv;charset=utf-8,"+s.join(`\r
|
|
8
|
-
`),
|
|
5
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),B=require("jenesius-vue-form"),oe=require("vue-router"),sn=require("date-and-time"),Le=require("debug"),H=require("jenesius-vue-modal"),R=class R extends Error{constructor(n,t=null){super(),this.message=n,this.details=t,this.id=R.ID++}static ParentFormNotFound(){return new R("Can't found parent form.")}static UndefinedNameOfCompositeFormController(n){return new R("Composite object name is undefined",n)}static EntityWithoutName(n){return new R("'Entity doesn't have a name",n)}static NotResolvedNameEventEmitter(n){return new R(`'${n}' is not a valid Event emitter name`)}static FormIsNotValidated(n){return new R("Form is not validated",n)}static ListWorkerIsRunningOrEnd(n){return new R("List data request is running or already done",n)}static ObjectIdNotNumber(n){return new R(`${n} (id) is not a number`)}static UndefinedErrorId(n,t){return R.ApiNotAvailable()}static ApiError(n){return new R("Request error",n)}static ApiNotAvailable(){return new R(`Sorry, we experience difficulties here.
|
|
6
|
+
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(n,t){return!n&&!t?R.ApiNotAvailable():new R(n||"Authorization Error",t)}static ApiResponseParseFailed(){return R.ApiNotAvailable()}static MissingIdInValuesEntity(n){return new R("Object doesn't have id",n)}static ObjectWithIdNotFound(n,t){return new R(`Can't find object with id: ${n}`,t)}static ObjectWithoutConnectToPresentArray(n,t){return new R("Object is not found.",{object:n,array:t})}static EntityWithoutId(n){return new R("Entity doesn't have id.",n)}static NotFoundedTableIndex(n,t){return new R(`Can't find the element with tableIndex ${n}`,t)}static UndefinedError(n,t=[]){return new R(n,t)}static TableArrayAlreadyIncludeProvidedIndexValue(n,t,o){return new R(`Array already includes the element with value ${n}`,{array:t,table:o})}static MetadataEntityIsNotAvailable(n){return new R(`Metadata for the ${n} is not currently available.`)}static RequestTookToLong(){return new R("The request took too long to complete. Try again later.")}};R.ID=0;let Z=R;const ln="Please try again later or submit a feedback if problem doesn't go.";function cn(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return ln}})}function ce(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Z.ApiNotAvailable()}).then(t=>cn(t).then(o=>{if(!t.ok)throw o;return o}))}class un{constructor(){this.public=!1,this.errors=new Proxy([],{set:(n,t,o)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),n[t]=o,!0)}),window._journal=this}get error(){return{add:(...n)=>{this.errors.push(n)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new un;class fn{static invite(n,t,o){return ce("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:n,personKey:t,relatedRoleCode:o})})}static accept(n,t){return ce("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!0})})}static decline(n,t){return ce("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class dn{static getRequiredDocuments(n,t,o){const i=new URLSearchParams({entity:n,primaryKey:t,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class le{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${le.url()}/calculator/${n}`)}static calculate(n,t){return ce(`/${le.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:n,values:t})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Z.ApiNotAvailable()})}static parseMetadataField(n){function t(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:n.name,label:n.title,required:n.required,type:t(n)}}static createOnlinePayment(n,t){return ce(`/${le.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return ce(`/${le.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const pn={class:"widget-table__head-cell"},mn={key:1,class:"widget-table__head-label margin_0 text_overflow"},Ct=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:n}){const t=n;function o(){t("select")}return(i,a)=>(r.openBlock(),r.createElementBlock("th",pn,[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(B.FormField),{key:0,onClick:o})):(r.openBlock(),r.createElementBlock("span",mn,r.toDisplayString(i.label),1))]))}}),gn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>Ct),(n,t)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,o=>r.renderSlot(n.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},yn=U(hn,[["__scopeId","data-v-aa18d6fa"]]);function Xe(e){return Array.isArray(e)?Xe(e[0]):typeof e!="string"?null:e}function ie(e){return Xe(e.name)}function vn(e){const n=new RegExp(/\$\{([a-zA-Z0-9_.]+)}/,"g"),t=[];let o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function wn(e,n){return vn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),B.utils.getPropFromObject(n,o))}),e}function Ue(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Oe(e,n){const t=ie(e);if(typeof e.value=="string")return wn(e.value,n);let o=t?B.utils.getPropFromObject(n,t):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,n);if(e.value===null)return null;switch(e.unitValue&&(o=Ue(e.unitValue)(o)),e.unit&&(o=Ue(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Se(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Rt(typeof o=="string"?o:null);break}case"money":{o=Ft(o);break}case"DateTime":{o=Se(typeof o=="string"?o:null,e.format||S.dateTimeFormat);break}}return e.formatter&&(o=de(e.formatter).exec(o,n)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const bn=1,En=5e3,Cn="static-folder",kt="request-error",_t="EntityTypeName",kn="REFERENCE_CHANGES",A={LIST_ACTIVE_NEW:-1,DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",MODAL_BATCH_VALUES:"batch-values",MODAL_ENTITY:"form-entity",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:_t,FIELD_NAME_REFERENCE_CHANGES:kn,PATH_RESOLVER_ENTITY:"resolver"};function Fe(e){return[A.CORE_DEBUG_LABEL,e].join(":")}const _n={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>t.values,l=>{if(typeof l!="string")return i.value="";i.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",_n,[r.createVNode(r.unref(B.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),An=U(Tn,[["__scopeId","data-v-800b3803"]]),Sn={class:"widget-filter-enum"},In={class:"flex gap-10 padding-10"},Nn=r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=De(t.filterMetadata.entity),a=f=>(t.values||[]).includes(f),l=n;function c(f){const d=t.values||[];return d.includes(f)?l("update:values",d.filter(p=>p!==f)):l("update:values",[...d,f])}const s=fe(async()=>{o.value=await ae(t.baseEntity,{fields:t.filterMetadata.name.join(" "),order:[t.filterMetadata.name[1],"asc"],distinct:!0,filter:$(t.filters)}).then(f=>f.map(d=>({label:d[t.filterMetadata.name[1]],value:d[t.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,f=>{l("readProcess",f?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(f,d)=>{const p=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Sn,[r.createElementVNode("div",In,[r.createVNode(p,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:d[0]||(d[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(p,{label:"Clear",onClick:u})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,v=>(r.openBlock(),r.createBlock(r.unref(B.FormField),{class:"widget-filter-enum-item",key:v.value,onClick:()=>c(v.value),type:"single-checkbox","model-value":a(v.value),label:v.label},null,8,["onClick","model-value","label"]))),128))])}}}),Rn=U(Nn,[["__scopeId","data-v-cd8043dd"]]),ge=r.reactive({});function Ln(){ut(),setInterval(ut,50)}function Tt(){return ge}function ut(){const e={};Object.entries(localStorage).forEach(([n,t])=>{e[n]=!0,ge[n]!==t&&(ge[n]=t)}),Object.keys(ge).forEach(n=>{e[n]||delete ge[n]})}const S={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:An,Entity:Rn},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function On(e){Ln();for(let n in e)S[n]=e[n]}const Fn={props:{name:String},setup(e,n){let t="unknown";try{t=n.slots.default()[0].children}catch{t=e.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>r.h(S.iconTag,{class:S.iconHandler?S.iconHandler(t):`icon icon-${t}`},S.iconHandlerText(t))}},he=U(Fn,[["__scopeId","data-v-8a72b45f"]]),Bn=Le(Fe("setup-list-row"));function Dn(e,n){const t=e.config.map(o=>xn(o,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function xn(e,n,t){const o=n.values;let i=Oe(e,o);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(f){a.onClick.push(()=>f(o,e,t))}function c(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],u=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{u.push(r.h(B.FormField,{type:"single-checkbox",modelValue:n.selected})),l(ft.bind(null,t,!0));break}case"select":{u.push(r.h(B.FormField,{type:"single-radio",modelValue:n.selected})),l(ft.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const d=r.h(oe.RouterLink,{to:f});u.push(d),c("widget-table-cell_link")}}catch(f){Bn("Can't add router link",f)}if(e.href&&(u.push(r.h("a",{href:e.href(o),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&u.push(r.h(he,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&u.push(r.h(he,{name:f}))}return e.class&&(typeof e.class=="function"?c(e.class(o)):c(e.class)),S.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),S.listCellHandler(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),S.arrayListCellHandlers&&S.arrayListCellHandlers.forEach(f=>f(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),s.push(r.h("td",a,u)),s}function ft(e,n){e.emit("select",n)}function Ye(e,n){return()=>{try{return Dn(e,n)}catch(t){return console.warn(t),null}}}const $n={props:{values:Object,config:Object,selected:Boolean},setup:Ye},Pn=["colspan"],dt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:n}){const t=n,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=l=>t("close")),onSave:a[1]||(a[1]=l=>t("save",l))}),null,16,["values","new"]))],8,Pn)],512))}}),Vn={class:"widget-table"},Me="update:selectedRows",Mn="update:activeRow",At=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:n}){const t=e,o=n,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function l(){const p=t.selectedRows.length!==0?[]:[...t.array];o(Me,p)}function c(d,p=!0){if(!t.selectedRows)return;if(!p)return o(Me,t.selectedRows.includes(d)?[]:[d]);const v=[...t.selectedRows],w=v.indexOf(d);return w===-1?v.push(d):v.splice(w,1),o(Me,v)}function s(d){o(Mn,d)}function u(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>t.shortcut?t.config.filter(d=>d.name?!!t.array.find(v=>![null,""].includes(Oe(d,v))):!0):t.config);return(d,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Vn,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:f.value,onOrder:p[0]||(p[0]=v=>d.$emit("order",v))},{default:r.withCtx(v=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||Ct),r.mergeProps(v,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.array,(v,w)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:w},[r.createVNode($n,{config:f.value,values:v,selected:d.selectedRows.includes(v),onSelect:y=>c(v,y),onActivate:y=>s(w),class:r.normalizeClass(d.classCallback?d.classCallback(v):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===w?(r.openBlock(),r.createBlock(dt,{key:0,component:a.value,"row-length":d.config.length,values:v,onClose:p[1]||(p[1]=y=>o("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(A).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(dt,{key:0,component:a.value,"row-length":f.value.length,onClose:p[2]||(p[2]=v=>o("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),jn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${n.color}`})},null,4))}}),we=U(jn,[["__scopeId","data-v-0ef9ae88"]]),Un={class:"widget-button"},Wn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Un,[n.wait?(r.openBlock(),r.createBlock(we,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),qn=U(Wn,[["__scopeId","data-v-450dc564"]]),Hn={class:"widget-multi-button-wrap position_relative cursor_pointer"},zn={class:"widget-multi-button-body grid"},Gn=["onClick"],Xn={class:"widget-multi-button-side-wrap"},Yn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"04895bf1":o.value}));const n=e,t=r.reactive({active:!1,wait:!1}),o=r.computed(()=>n.array.length+(n.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function a(l=!t.active){t.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",zn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,u)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,Gn))),128))]),r.createElementVNode("div",Xn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(we),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(he),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Kn=U(Yn,[["__scopeId","data-v-d43a76ce"]]),Jn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Qn={class:"text_md"},Ke=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Jn,[r.createVNode(we,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Qn,r.toDisplayString(n.label),1)]))}}),Zn=["alt","src"],er=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const n=e,t=r.ref();return r.onMounted(()=>{t.value&&(t.value.src=n.src),t.value.onerror=function(){n.default&&(t.value.src=n.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:t,src:o.src||o.$props.default},null,8,Zn))}}),tr={props:{config:Array,values:Object,selected:Boolean},setup:Ye},nr=U(tr,[["__scopeId","data-v-344a8cc1"]]),rr=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),or={class:"widget-list-head-cell"},ir=rr(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ar=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:n}){const t=e,o=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",or,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(B.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(l=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=l=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(he),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),ir])]))}}),sr=U(ar,[["__scopeId","data-v-bf495d6a"]]),lr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:n}){const t=e,o=n,i=r.ref(),a=r.ref();r.onMounted(()=>{function u(w,y){let g=-1;do g++,y-=w[g];while(y>0&&g<w.length);return g}function f(w,y){let g=0;for(;y>0&&y>w[g]&&g<w.length;)y-=w[g],g++;return console.log(y,g),g>0?g:0}function d(w){try{a.value.style.insetInlineStart=w+"px"}catch(y){console.log(y)}}function p(w){try{a.value.style.width=w+"px",a.value.style.minWidth=w+"px",a.value.style.maxWidth=w+"px"}catch(y){console.log(y)}}function v(w){return w===null?!1:w.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(y){var D;function g(P){return P.screenX+b-T}const h=i.value,m=[...h.children].filter(P=>P.localName==="th"),b=((D=h.offsetParent)==null?void 0:D.scrollLeft)||0,E=m.map(P=>P.clientWidth),x=v(y.target),T=h.getBoundingClientRect().left,k=g(y),C=u(E,k),I=E.slice(0,C).reduce((P,W)=>P+W,0),F=k-I,_=h.offsetWidth,N=m[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",y.screenX),console.log("Widths",E),console.log("max width",_),console.log("Start Position",k),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",T),console.log("Del",F),console.groupEnd(),a.value.innerText=m[C].textContent||"",a.value.style.display="grid",a.value.style.width=N+"px",a.value.style.cursor="grabbing",d(I),p(N),document.addEventListener("pointermove",K,{passive:!0}),document.addEventListener("pointerup",j);function j(P){if(console.group("END"),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",j),x&&(t.config[C].width=a.value.style.width,t.config[C].minWidth=a.value.style.width,t.config[C].maxWidth=a.value.style.width,l(t.config)),!x){const W=P.screenX+b-T;console.log("ENP Position",W);const te=f(E,W);if(console.log(C,"->",te),te!==C){const pe=t.config[C],$e=t.config;$e.splice(C,1),$e.splice(te,0,pe),l($e)}else{const pe=t.config[C].name;c(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function K(P){if(x){const pe=g(P)-k+N;p(pe);return}let W=P.screenX+b-T-F;W<0&&(W=0),W+N>_&&(W=_-N),d(W)}})});function l(u){o("update:config",u)}function c(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(d,p)=>(r.openBlock(),r.createBlock(sr,r.mergeProps({key:d,ref_for:!0},d,{onOrder:v=>c(d.name),onSelect:f[0]||(f[0]=v=>o("select")),order:u.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),cr=U(lr,[["__scopeId","data-v-ccffc6bd"]]),ur={class:"widget-list"},fr={class:"widget-list-body position_relative"},dr=50,pr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:n}){const t=e,o=n;function i(s,u=!0){if(t.selectedRows)if(!u)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],d=f.indexOf(s);d===-1?f.push(s):f==null||f.splice(d,1),l(f)}}function a(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return l([...t.array]);l([])}function l(s){o("update:selectedRows",s)}function c(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+dr>u.scrollHeight&&o("scrollEnd")}return(s,u)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",ur,[r.createElementVNode("thead",null,[r.createVNode(cr,{onSelect:u[0]||(u[0]=f=>a()),"onUpdate:order":u[1]||(u[1]=f=>o("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,d)=>{var p;return r.openBlock(),r.createBlock(nr,{key:d,class:"widget-list-row",values:f,config:s.config,selected:(p=s.selectedRows)==null?void 0:p.includes(f),onSelect:v=>i(f,v)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Je(){var a;const e=r.computed(()=>Object.keys(t).length===0||Object.values(t).includes(!0)),n=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!n)throw"Undefined instance. Please check it.";const t=r.reactive({});r.provide(A.VISIBLE_ITEM_PROVIDE_NAME,{show(l){t[l]=!0},hide(l){t[l]=!1},remove(l){delete t[l]}});const o=r.inject(A.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(n)},hide(){o==null||o.hide(n)},remove(){o==null||o.remove(n)}},visibleItems:t}}const mr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const n=e,t=De(),o=it(),i=r.computed(()=>{var y,g,h;const p=s.value,v=u(p),w={type:v,disabled:n.usageContext?!((y=c.value)!=null&&y.canSet):!1,label:n.label};return v==="Decimal"&&((h=(g=p==null?void 0:p.presentationType)==null?void 0:g.toLowerCase)==null?void 0:h.call(g))==="money"&&(w.money=!0),p&&Object.assign(w,{suffix:v==="number"?p.valueUnit:void 0,required:l.includes(v||"")?!1:p.required,label:n.label||p.displayName}),Array.isArray(S.arrayFieldParamsHandlers)&&S.arrayFieldParamsHandlers.forEach(m=>Object.assign(w,m(p,c.value,w))),w}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var p;return(p=o==null?void 0:o.value)==null?void 0:p.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const p=t.value.fieldsByName[n.name];if(p)return p});function u(p){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(p){if(p.type==="Reference"||p.type==="Owned")return p.referencedEntity;if(p.dataType==="Boolean")return"single-checkbox";if(p.dataType==="DateTime")return"date";if(p.dataType==="Integer"||p.dataType==="Decimal")return"number";if(p.dataType==="List")return p.aggregatedEntity;if(a.includes(p.presentationType))return"textarea";if(p.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var p;return n.usageContext?((p=c.value)==null?void 0:p.canGet)===!0:!0}),{controller:d}=Je();return r.watch(()=>f.value,p=>p?d.show():d.hide(),{immediate:!0}),r.onUnmounted(()=>d.remove()),(p,v)=>f.value?(r.openBlock(),r.createBlock(r.unref(B.FormField),r.mergeProps({key:0},{...p.$attrs,...i.value},{name:p.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function gr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||A.DEFAULT_ORDER_DIR}const hr=["fill"],yr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),vr=[yr],wr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},vr,8,hr))}}),br={class:"widget-fast-table-head-cell-td"},Er={key:1,class:"widget-head-cell-label"},Cr={key:2,class:"widget-head-cell-order"},kr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:n}){const t=e,o=r.computed(()=>Xe(t.name));r.computed(()=>gr(t.order));const i=n;function a(){i("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",br,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=u=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(B.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",Er,r.toDisplayString(l.label),1)),o.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",Cr,[r.createVNode(wr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),St=U(kr,[["__scopeId","data-v-d131e64e"]]),_r=["fill"],Tr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Ar=[Tr],Sr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},Ar,8,_r))}}),Ir={class:"widget-filter-item-popup"},Nr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=S.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const v=t.filterItem;return v.entity?"Entity":v.type?v.type:null});function c(v){s.value=v==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let d=null;function p(v=!f.value){f.value=v,!f.value&&d?(d(),d=null):a.value&&(d=B.utils.clickOutside(a.value,p.bind(null,!1)))}return(v,w)=>{var y;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":u.value}]),onClick:w[0]||(w[0]=()=>p())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(v.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(we,{key:0})):(r.openBlock(),r.createBlock(Sr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Ir,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((y=r.unref(i))==null?void 0:y[l.value]),{key:0,"filter-metadata":v.filterItem,values:v.values,filters:v.filters,"base-entity":v.entity,"onUpdate:values":w[1]||(w[1]=g=>o("update:values",g)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),It=U(Nr,[["__scopeId","data-v-e52e165e"]]),Rr={class:"widget-table-panel-filter flex"},Lr=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:n}){const t=e,o=n;function i(a,l){o("update:filters",{...t.filters,[a]:l})}return(a,l)=>(r.openBlock(),r.createElementBlock("div",Rr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var u;return r.openBlock(),r.createBlock(It,{key:s,entity:a.entity,"filter-item":c,values:(u=a.filters)==null?void 0:u[r.unref(ie)(c)],filters:a.filters,"onUpdate:values":f=>i(r.unref(ie)(c),f)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Or=U(Lr,[["__scopeId","data-v-89e1fa2d"]]),Fr={class:"widget-fast-table-tools"},Br=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:n}){const t=e,o=oe.useRouter(),i=n,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>i("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(p=>p.name),c=r.inject(A.PROVIDE_NAME_ACTIONS,[]);function s(p){return{...p,label:p.label||"Batch update",callback:async()=>{if(t.selectedRows.length===0)return xe.add("error","Kindly select at least one record to update");const v=await H.promptModal(A.MODAL_BATCH_VALUES,{entity:t.metadata.name,availableFields:p.availableFields||[]}),w=t.metadata.fieldNameForIdentification,y=(t.selectedRows||[]).map(g=>({primaryKey:g[w],version:t.metadata.versioned?g.Version:void 0}));await Vt(t.metadata.name,{values:v,elements:y}),i("reload")}}}const u=r.computed(()=>{var w;const p=((w=c==null?void 0:c.actions)==null?void 0:w.value)||[];return Array.isArray(t.tools)?(t.tools,t.tools.reduce((y,g)=>{if(g.name==="*")y.push(...a);else if(l.includes(g.name)){const h=a.find(m=>m.name===g.name);h&&y.push(h)}else if(g.name==="redirect"){const h={...g,label:g.label,callback:()=>o.push(g.to)};y.push(h)}else if(g.name==="batch-update"&&!g.override)y.push(s(g));else{g.override&&p.find(m=>m.name===g.override)&&g.name==="batch-update"&&y.push(s(g));const h=p.find(m=>m.name===g.name);h&&y.push({name:g.name,label:h.title,icon:g.icon,buttonStyle:g.buttonStyle,callback:()=>Promise.resolve().then(()=>{f[g.name]=!0}).then(()=>d(h)).finally(()=>{f[g.name]=!1})})}return y},[])):[]}),f=r.reactive({});function d(p){var y;const v=(y=p.action.parameters.find(g=>g.dataTypeName==="IntegerArray"))==null?void 0:y.name,w={};return v&&(w[v]=t.selectedRows.map(g=>{if(!(typeof g=="object"&&g!==null))return null;const h=t.metadata.fieldNameForIdentification;return h===void 0?null:g[h]})),p.callback(w)}return(p,v)=>{const w=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,y=>(r.openBlock(),r.createBlock(w,{label:y.label,title:y.name,icon:y.icon,type:y.buttonStyle,loading:y.name==="reload"?p.loading:f[y.name],onClick:y.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(p.$slots,"default",{},void 0,!0)])}}}),Dr=U(Br,[["__scopeId","data-v-0070862b"]]);function xr(e){const n=Tt(),t=oe.useRouter(),o=r.reactive({entity:null,mark:null,settings:null});function i(m){const b={...u.value,...m};a(b)}function a(m){{const b=m.prefilters;b&&(Object.keys(b).forEach(E=>{var x,T;Array.isArray(b[E])&&b[E].length===0&&o.settings&&!((T=(x=o.settings)==null?void 0:x.prefilters)!=null&&T[E])&&delete b[E]}),B.utils.isEmptyObject(b)&&delete m.prefilters)}localStorage.setItem(s(o.entity,o.mark),JSON.stringify(m))}function l(){return o.entity?JSON.parse(localStorage[s(o.entity,o.mark)]||"{}"):null}function c(m,b){o.entity=m,o.mark=b,d.call()}function s(m,b){return"list-configuration:"+m+(b?"-"+b:"")}const u=r.computed(()=>o.entity?JSON.parse(n[s(o.entity,o.mark)]||"{}"):null),f=r.computed(()=>o.settings?He(o.entity,o.settings.config,{router:t,activate:e}):[]),d=fe(async function(){if(!o.entity)return;const b=await Dt(o.entity,o.mark);o.settings=Object.freeze(b)}),p=r.computed(()=>{var E;const m=u.value.order||{},b=((E=o.settings)==null?void 0:E.prefilters)||{};return m||b||[]}),v=r.computed(()=>{var E;const m=u.value.prefilters||{};return{...((E=o.settings)==null?void 0:E.prefilters)||{},...m}}),w=r.computed(()=>{var m;return((m=o.settings)==null?void 0:m.filters)||[]}),y=r.computed(()=>{var m;return((m=o.settings)==null?void 0:m.label)||null}),g=r.computed(()=>{var m;return((m=o.settings)==null?void 0:m.tools)||[]}),h=r.computed(()=>!B.utils.isEmptyObject(u.value));return{state:o,get customFilters(){return o.settings.customFilters||[]},set:c,get:l,configuration:u,update:i,computedPrefilter:v,computedFiltersConfiguration:w,get cellConfig(){return o.settings?He(o.entity,o.settings.config,{router:t,activate:e}):[]},get prefilters(){var m;return((m=l())==null?void 0:m.prefilters)||o.settings.prefilters||{}},get order(){var m;return((m=l())==null?void 0:m.order)||[]},clean(){localStorage.removeItem(s(o.entity,o.mark))},cellConfiguration:f,computedLabel:y,computedTools:g,computedHasLocalConfiguration:h,computedOrder:p,get displayModeForNew(){return o.settings.displayModeForNew||"inline"}}}const $r={class:"es-grid es-gap-15"},Pr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Vr={class:""},Mr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e,o=oe.useRouter(),i=r.ref([]),a=r.ref(null),l=r.computed(()=>a.value?i.value.indexOf(a.value[2]):null);function c(_,N,j){a.value=[_,N,j]}const s=r.ref(null),u=B.Form.getParentForm(),f=r.ref([]),d=De(t.entity),{state:p,update:v}=it(t.entity,{masterEntities:t.masterEntities||[]}),w=fe(async()=>{try{await g.call(),await v()}catch(_){const{message:N}=Qe(_);s.value=N}});u instanceof B.Form&&u.subscribe({read:w.call.bind(null),name:t.entity,type:"table"}),r.watch(()=>t.mark,()=>{T.set(t.entity,t.mark)});function y(){return $.and($(T.prefilters),$(t.binding||{}))}const g=fe(async function(){const N=t.entity;s.value=null,f.value=[];const j=await ae(N,{customFilters:T.customFilters,fields:et(k.value).join(" "),order:T.order,filter:y()});i.value=Object.freeze(j.map(K=>Object.freeze(K)))}),{controller:h}=Je();r.watch(()=>p.value,_=>{_&&(_.canRead?h.show():h.hide())},{immediate:!0});let m=[ye.on("affected-entity",_=>{_.name===t.entity&&g.call()}),ye.on("display-entity",async _=>{_.name===t.entity&&(g.promise&&await g.promise,c(_.name,_.id,i.value.find(N=>N[d.value.fieldNameForIdentification]===_.id)))})];r.onUnmounted(()=>{m.map(_=>_()),h.remove()});function b(_){function N(D){return Array.isArray(D)?N(D[0]):typeof D!="string"?null:D}const j=N(_);if(!j)return;const K=T.order;E("order",K[0]!==j?[j,"asc"]:K[1]==="desc"?[]:[j,"desc"])}function E(_,N){T.update({[_]:N}),g.call()}const x=r.computed(()=>w.wait),T=xr(c),k=T.cellConfiguration;T.set(t.entity,t.mark),r.watch(()=>T.state.settings,w.call);const C=r.computed(()=>T.state.settings);n({listSettings:C,array:i,config:k});function I(){H.openModal(A.MODAL_LIST_DOWNLOAD,{entity:t.entity,cellConfig:T.cellConfig,order:T.order,prefilters:y(),customFilters:T.customFilters})}function F(){switch(T.displayModeForNew){case"modal":return H.openModal(A.MODAL_ENTITY,{entity:t.entity});case"form":return o.push(ot(t.entity));case"inline":return a.value=[t.entity]}}return(_,N)=>{const j=r.resolveComponent("widget-button"),K=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",$r,[r.unref(T).computedLabel.value&&!_.hideLabel?(r.openBlock(),r.createElementBlock("p",Pr,r.toDisplayString(r.unref(T).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(d)?(r.openBlock(),r.createBlock(Dr,{key:1,metadata:r.unref(d),tools:r.unref(T).computedTools.value,loading:x.value,"selected-rows":f.value||[],onReload:r.unref(w).call,onExport:I},{default:r.withCtx(()=>{var D;return[r.renderSlot(_.$slots,"tools"),(D=r.unref(p))!=null&&D.canCreate?(r.openBlock(),r.createBlock(j,{key:0,onClick:F,type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(T).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(j,{key:1,onClick:r.unref(T).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:3},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",Vr,[r.createVNode(Or,{entity:_.entity,"filters-config":r.unref(T).computedFiltersConfiguration.value,filters:r.unref(T).computedPrefilter.value,"onUpdate:filters":N[0]||(N[0]=D=>E("prefilters",D))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(At),{config:r.unref(k),array:i.value,"active-row":l.value,"onUpdate:activeRow":N[2]||(N[2]=D=>a.value=null),onOrder:b,class:"table",selectedRows:f.value,"onUpdate:selectedRows":N[3]||(N[3]=D=>f.value=D)},{"head-cell":r.withCtx(D=>{var P,W,te;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_.$slots["head-cell"]?_.$slots["head-cell"]:St),r.mergeProps({label:D.label},D,{onOrder:b,order:r.unref(T).computedOrder.value,type:D.type,"is-full-selected":((P=f.value)==null?void 0:P.length)===((W=i.value)==null?void 0:W.length)&&((te=i.value)==null?void 0:te.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>{var D,P;return[r.createVNode(K,{entity:(D=a.value)==null?void 0:D[0],"primary-key":((P=a.value)==null?void 0:P[1])||null,"master-entities":_.masterEntities||void 0,binding:_.binding,onFormUpdate:N[1]||(N[1]=()=>{a.value=null,r.unref(g).call()})},null,8,["entity","primary-key","master-entities","binding"])]}),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Nt(e,n={},t={}){const o=r.inject(A.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:n,a=typeof n=="string"?t:n;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(u=>u.name===i);return c?{...c,...a}:null})}const jr=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const n=e,t=Nt(n.name,n.overrideParams||{}),o=r.computed(()=>{if(t.value)return fe(t.value.callback)});return(i,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(t)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(t).label,loading:((c=o.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,u;return(u=(s=o.value)==null?void 0:s.call)==null?void 0:u.call(s,i.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),Ur=r.defineComponent({__name:"WidgetResolverEntity",setup(e){const n=oe.useRouter(),t=oe.useRoute();function o(){const i=t.params.entity,a=t.params.primaryKey;tt(i,a).then(l=>n.replace(ot(l,a))).catch(l=>{M("error")(l),n.back()})}return r.onMounted(o),(i,a)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(Ke,{label:"Loading..."})]))}}),Wr=r.defineComponent({__name:"modal-list-download",props:{entity:{},cellConfig:{},prefilters:{},order:{},customFilters:{}},setup(e){const n=e,t=r.computed(()=>o.finished?"Download CSV":`Download ${o.count} records.`),{state:o,downloadFile:i,reject:a,start:l}=rn({entity:n.entity,config:n.cellConfig,prefilters:n.prefilters,order:n.order,customFilters:n.customFilters});return H.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>o.finished,()=>{i(),H.popModal()}),(c,s)=>{const u=r.resolveComponent("widget-button"),f=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(f,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=d=>{r.unref(i)(),r.unref(H.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(Ke,{label:"Loading"})])]),_:1})}}});function Rt(e){return Se(e,"YYYY/MM/DD HH:mm:ss")}function Se(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return sn.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function fe(e){function n(i){o.status=i}function t(...i){if(o.loading)return Promise.reject("The process has already started.");o.loading=!0,o.wait=!0;const a=Promise.resolve().then(()=>n(1)).then(()=>e(...i)).then(l=>(n(3),l)).catch(l=>{throw n(2),l}).finally(()=>{o.wait=!1,o.loading=!1,o.promise=null});return o.promise=a,a}const o=r.reactive({status:0,wait:!1,loading:!1,call:t,promise:null});return o}var Lt=(e=>(e[e.init=0]="init",e[e.loading=1]="loading",e[e.error=2]="error",e[e.done=3]="done",e))(Lt||{});function Qe(e){return typeof e=="string"?Ce(e):qr(e)?Ce(e.message,e.children||e.details||[]):Hr(e)?Ce(e.title,[e.detail||""]):Ce(A.DEFAULT_ERROR_MESSAGE)}function qr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Hr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Ce(e,n=[]){return{message:e,children:n}}function M(e="error"){return function(n){const{message:t,children:o}=Qe(n);xe.add(e,t,{children:o})}}function ae(e,n={}){const t=L();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:read",{entity:e,...n})}function Ot(e){return!!(e.id||e.primaryKey)}function Ze(e,n){const t=L();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:update",{...n,entity:e})}function et(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ft(e,n=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(n,"0"),o[1].length>n&&(o[1]=o[1].substring(0,n)),o.join(".")}function zr(e,n){const t=new Map;return e.forEach(o=>{var a;const i=n(o);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(o)}),t}function Gr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Xr(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function q(e,n={}){return G.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=G.contextId),n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.reload():t).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(t=>Xr(t).then(o=>{if(!t.ok)throw o;return o}))}function Yr(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function Kr(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Jr=Le(Fe("pretty-value-field-by-entity"));function Qr(e,n,t){try{const o=Ne.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[n];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${n}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(o){return Jr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const ne=Le(Fe("use-socket"));function L(){return eo}function Zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const eo=function(){let e=1,n,t;const o=new Set;let i=0;const a=new Set;function l(){if(n)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{n.close()},En*2);const h=new Uint8Array(1);h[0]=bn,n.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{g(h)&&(ne("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?s({requestId:h.requestId,event:kt,data:{message:Z.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&u()},A.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(h){const m=[...o.values()];ne("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),m.forEach(b=>{const E=h.requestId;(b.requestId&&b.requestId===E||!b.requestId&&b.event===h.event)&&(ne("Find appropriated handler: %d, event: %s",e,b.event),b.callback(h.data,h),b.once&&(o.delete(b),ne("Handler was removed by *once* params was passed. %o",b)))})}function u(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),n=new WebSocket(t),n.onclose=function(h){ne("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(m=>{m.guaranteedAnswer&&m.serializeString&&a.add(m.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},n.onerror=function(h){console.warn(h)},n.onmessage=h=>{var m;try{if(Zr(h.data)){l();return}const b=JSON.parse(h.data);if(!Bt(b)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(b);return}b.event==="progress"&&o.forEach(E=>{E.event===b.data.for.event&&E.requestId===b.data.for.requestId&&(console.log("UPDATE TIME"),E.timeToLive=new Date().getTime()-E.created+A.TIME_TO_LIVE_SOCKET_REQUEST)}),(m=b==null?void 0:b.data)!=null&&m.refresh&&location.reload(),s(b)}catch(b){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(b)}}}function f(h){n.send(h)}function d(h,m){y({event:h,callback:m})}function p(h,m){y({event:h,callback:m,once:!0})}function v(){return n&&(n==null?void 0:n.readyState)===1}function w(h,m,b){const E=++e,x=JSON.stringify({requestId:E,event:h,data:m,contextId:G.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return v()?f(x):(a.add(x),ne("Socket is not connected. Message was send to save-queue")),new Promise((T,k)=>{y({event:h,requestId:E,once:!0,guaranteedAnswer:!0,serializeString:x,callback:(C,I)=>{if(ne("Promise was resolve with next data:",C),to(I))return void k(C);b&&b(C,I),T(C)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function y(h){const m={timeToLive:0,...h,created:new Date().getTime()};o.add(m)}function g(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return n},on:d,once:p,emit:w,initialization(h){t=h},getDevInfo:c}}(),to=e=>!!Bt(e)&&e.event===kt,Bt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Dt(e,n){return L().emit("list-setting:read",{entity:e,mark:n})}function no(e,n){return L().emit("metadata-field:treat",{entity:e,fieldName:n})}function xt(e,n){return L().emit("entity:create",{...n,entity:e})}function $t(e,n){return L().emit("entity:delete",{...n,entity:e})}function ro(e,n){return L().emit("usage-context:read",{...n,entity:e})}function Pt(e={}){return L().emit("tool:read",e)}function oo(){return L().emit("metadata-list:read",{})}function Vt(e,n){return L().emit("batch:update",{...n,entity:e})}function tt(e,n){return L().emit("entity:resolve",{primaryKey:n,entity:e})}function io(e){return L().emit("history:read",e)}function ao(e,n){return L().emit("entity:count",{...n,entity:e})}function so(e){return`/${Cn}/${e}`}function de(e){return{exec(n,t){switch(e.name){case"replace-boolean":return de.replaceBoolean(n,e.values);case"replace-record-operation":return de.replaceRecordOperation(n)}}}}de.replaceBoolean=lo;de.replaceRecordOperation=co;function lo(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function co(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function uo(e={}){return L().emit("tool:execute",e)}const fo=Le(Fe("wrap-tool-response"));function Mt(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=go),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=yo),e.handleCloseForm===void 0&&(e.handleCloseForm=vo),e.handleValidationResult===void 0&&(e.handleValidationResult=ho),{...n,label:n.title,async callback(t={}){var l;const o=typeof e.values=="function"?e.values(n,e):e.values;let i={};n.action.targetName==="Record"&&o.hasOwnProperty("Id")&&(i.Id=o.Id,delete o.Id);const a=()=>uo({name:n.name,values:{...o,...t},primaryKeys:i,usageContext:n.usageContext}).then(async c=>{var s,u;if(!po(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const f of e.handlers)await f(n,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((u=(s=c.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(n,c.validationEffect,e),new Error(c.message);return c.message&&xe.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(f=>{var d;return(d=e.handleAffectedEntity)==null?void 0:d.call(e,n,f,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),c}).catch(M("error"));if((l=e.overrides)!=null&&l[n.name])return e.overrides[n.name](n,e);if(n.paramDialog){const c=await wo(n,e);if(c===null)return;t=Object.assign(t,c||{})}return n.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!n.confirmation||!e.handleConfirmation||n.paramDialog?a():e.handleConfirmation(n,a)}}}function po(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function mo(e){const n="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?n:typeof e=="string"?e:n}async function go(e,n){const t=mo(e.confirmation);if(!H.getComponentFromStore(A.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await H.promptModal(A.MODAL_CONFIRM,{message:t}))return n()}function ho(e,n){const t=A.MODAL_VALIDATION_EFFECT;if(!H.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{H.pushModal(t,n)})}function yo(e,n,t){var s;function o(u){return u!==null&&typeof u=="object"&&typeof u.read=="function"}function i(u,f){u&&(fo("Affected Entity %s. Find form with name %s.",f,u.name),u.name===f&&o(u)&&u.read(),u instanceof B.Form&&u.dependencies.forEach(d=>i(d,f)))}ye.emit("affected-entity",n);const{router:a,form:l}=t,c=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){ye.emit("display-entity",{id:c,name:n.name}),S.getEntityLink&&a.push(S.getEntityLink(n.name,c));return}i(l,n.name)}function vo(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}function wo(e,n){var t;if((t=e.paramDialog)!=null&&t.name)return H.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:n})}let re={};function ee(e,...n){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let t=B.utils.getPropFromObject((this==null?void 0:this.vocabulary)||re,e);if(typeof t=="string")return pt(t,n);const o=B.utils.getPropFromObject(re==null?void 0:re.root,e);return typeof o=="string"?pt(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function pt(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}ee.setGlobalVocabulary=function(e){re=e};ee.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:B.utils.getPropFromObject(re,n.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=B.utils.getPropFromObject(re,e)),ee.bind({vocabulary:e})};function bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},O={},qe={exports:{}},se={};function jt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function Eo(e,n,t){}function Co(e,n,t){}var ko=/javascript\s*\:/img;function _o(e,n){return ko.test(n)?"":n}se.whiteList=jt();se.getDefaultWhiteList=jt;se.onAttr=Eo;se.onIgnoreAttr=Co;se.safeAttrValue=_o;var To={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},me=To;function Ao(e,n){e=me.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function c(){if(!o){var f=me.trim(e.slice(i,a)),d=f.indexOf(":");if(d!==-1){var p=me.trim(f.slice(0,d)),v=me.trim(f.slice(d+1));if(p){var w=n(i,l.length,p,v,f);w&&(l+=w+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var u=e.indexOf("*/",a+2);if(u===-1)break;a=u+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||c():s===`
|
|
7
|
+
`&&c()}return me.trim(l)}var So=Ao,ke=se,Io=So;function mt(e){return e==null}function No(e){var n={};for(var t in e)n[t]=e[t];return n}function Ut(e){e=No(e||{}),e.whiteList=e.whiteList||ke.whiteList,e.onAttr=e.onAttr||ke.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ke.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ke.safeAttrValue,this.options=e}Ut.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onAttr,a=t.onIgnoreAttr,l=t.safeAttrValue,c=Io(e,function(s,u,f,d,p){var v=o[f],w=!1;if(v===!0?w=v:typeof v=="function"?w=v(d):v instanceof RegExp&&(w=v.test(d)),w!==!0&&(w=!1),d=l(f,d),!!d){var y={position:u,sourcePosition:s,source:p,isWhite:w};if(w){var g=i(f,d,y);return mt(g)?f+":"+d:g}else{var g=a(f,d,y);if(!mt(g))return g}}});return c};var Ro=Ut;(function(e,n){var t=se,o=Ro;function i(l,c){var s=new o(c);return s.process(l)}n=e.exports=i,n.FilterCSS=o;for(var a in t)n[a]=t[a];typeof window<"u"&&(window.filterCSS=e.exports)})(qe,qe.exports);var nt=qe.exports,rt={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var n=/\s|\n|\t/,t=n.exec(e);return t?t.index:-1}},Lo=nt.FilterCSS,Oo=nt.getDefaultWhiteList,Ie=rt;function Wt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qt=new Lo;function Fo(e,n,t){}function Bo(e,n,t){}function Do(e,n,t){}function xo(e,n,t){}function Ht(e){return e.replace(Po,"<").replace(Vo,">")}function $o(e,n,t,o){if(t=Jt(t),n==="href"||n==="src"){if(t=Ie.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return""}else if(n==="background"){if(_e.lastIndex=0,_e.test(t))return""}else if(n==="style"){if(gt.lastIndex=0,gt.test(t)||(ht.lastIndex=0,ht.test(t)&&(_e.lastIndex=0,_e.test(t))))return"";o!==!1&&(o=o||qt,t=o.process(t))}return t=Qt(t),t}var Po=/</g,Vo=/>/g,Mo=/"/g,jo=/"/g,Uo=/&#([a-zA-Z0-9]*);?/gim,Wo=/:?/gim,qo=/&newline;?/gim,_e=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,gt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ht=/u\s*r\s*l\s*\(.*/gi;function zt(e){return e.replace(Mo,""")}function Gt(e){return e.replace(jo,'"')}function Xt(e){return e.replace(Uo,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Yt(e){return e.replace(Wo,":").replace(qo," ")}function Kt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return Ie.trim(n)}function Jt(e){return e=Gt(e),e=Xt(e),e=Yt(e),e=Kt(e),e}function Qt(e){return e=zt(e),e=Ht(e),e}function Ho(){return""}function zo(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:Ie.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",f=s.position+u.length;return i.push([a!==!1?a:s.position,f]),a=!1,u}else return a||(a=s.position),"[removed]";else return n(l,c,s)},remove:function(l){var c="",s=0;return Ie.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function Go(e){for(var n="",t=0;t<e.length;){var o=e.indexOf("<!--",t);if(o===-1){n+=e.slice(t);break}n+=e.slice(t,o);var i=e.indexOf("-->",o);if(i===-1)break;t=i+3}return n}function Xo(e){var n=e.split("");return n=n.filter(function(t){var o=t.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),n.join("")}O.whiteList=Wt();O.getDefaultWhiteList=Wt;O.onTag=Fo;O.onIgnoreTag=Bo;O.onTagAttr=Do;O.onIgnoreTagAttr=xo;O.safeAttrValue=$o;O.escapeHtml=Ht;O.escapeQuote=zt;O.unescapeQuote=Gt;O.escapeHtmlEntities=Xt;O.escapeDangerHtml5Entities=Yt;O.clearNonPrintableCharacter=Kt;O.friendlyAttrValue=Jt;O.escapeAttrValue=Qt;O.onIgnoreTagStripAll=Ho;O.StripTagBody=zo;O.stripCommentTag=Go;O.stripBlankChar=Xo;O.attributeWrapSign='"';O.cssFilter=qt;O.getDefaultCSSWhiteList=Oo;var Be={},Q=rt;function Yo(e){var n=Q.spaceIndex(e),t;return n===-1?t=e.slice(1,-1):t=e.slice(1,n+1),t=Q.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function Ko(e){return e.slice(0,2)==="</"}function Jo(e,n,t){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",f="";e:for(c=0;c<s;c++){var d=e.charAt(c);if(a===!1){if(d==="<"){a=c;continue}}else if(l===!1){if(d==="<"){o+=t(e.slice(i,c)),a=c,i=c;continue}if(d===">"||c===s-1){o+=t(e.slice(i,a)),f=e.slice(a,c+1),u=Yo(f),o+=n(a,o.length,u,f,Ko(f)),i=c+1,a=!1;continue}if(d==='"'||d==="'")for(var p=1,v=e.charAt(c-p);v.trim()===""||v==="=";){if(v==="="){l=d;continue e}v=e.charAt(c-++p)}}else if(d===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Qo=/[^a-zA-Z0-9\\_:.-]/gim;function Zo(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function c(p,v){if(p=Q.trim(p),p=p.replace(Qo,"").toLowerCase(),!(p.length<1)){var w=n(p,v||"");w&&i.push(w)}}for(var s=0;s<l;s++){var u=e.charAt(s),f,d;if(a===!1&&u==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:ti(e,s+1);continue}if(a!==!1&&s===o){if(d=e.indexOf(u,s+1),d===-1)break;f=Q.trim(e.slice(o+1,d)),c(a,f),a=!1,s=d,t=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(d=ei(e,s),d===-1){f=Q.trim(e.slice(t,s)),c(f),a=!1,t=s+1;continue}else{s=d-1;continue}else if(d=ni(e,s-1),d===-1){f=Q.trim(e.slice(t,s)),f=yt(f),c(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?c(e.slice(t)):c(a,yt(Q.trim(e.slice(t))))),Q.trim(i.join(" "))}function ei(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ti(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function ni(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ri(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function yt(e){return ri(e)?e.substr(1,e.length-2):e}Be.parseTag=Jo;Be.parseAttr=Zo;var oi=nt.FilterCSS,z=O,Zt=Be,ii=Zt.parseTag,ai=Zt.parseAttr,Ae=rt;function Te(e){return e==null}function si(e){var n=Ae.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ae.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=Ae.trim(e.slice(0,-1))),{html:e,closing:t}}function li(e){var n={};for(var t in e)n[t]=e[t];return n}function ci(e){var n={};for(var t in e)Array.isArray(e[t])?n[t.toLowerCase()]=e[t].map(function(o){return o.toLowerCase()}):n[t.toLowerCase()]=e[t];return n}function en(e){e=li(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=z.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ci(e.whiteList||e.allowList):e.whiteList=z.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":z.attributeWrapSign,e.onTag=e.onTag||z.onTag,e.onTagAttr=e.onTagAttr||z.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||z.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||z.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||z.safeAttrValue,e.escapeHtml=e.escapeHtml||z.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new oi(e.css))}en.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onTag,a=t.onIgnoreTag,l=t.onTagAttr,c=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,f=n.attributeWrapSign,d=n.cssFilter;t.stripBlankChar&&(e=z.stripBlankChar(e)),t.allowCommentTag||(e=z.stripCommentTag(e));var p=!1;t.stripIgnoreTagBody&&(p=z.StripTagBody(t.stripIgnoreTagBody,a),a=p.onIgnoreTag);var v=ii(e,function(w,y,g,h,m){var b={sourcePosition:w,position:y,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(o,g)},E=i(g,h,b);if(!Te(E))return E;if(b.isWhite){if(b.isClosing)return"</"+g+">";var x=si(h),T=o[g],k=ai(x.html,function(C,I){var F=Ae.indexOf(T,C)!==-1,_=l(g,C,I,F);return Te(_)?F?(I=s(g,C,I,d),I?C+"="+f+I+f:C):(_=c(g,C,I,F),Te(_)?void 0:_):_});return h="<"+g,k&&(h+=" "+k),x.closing&&(h+=" /"),h+=">",h}else return E=a(g,h,b),Te(E)?u(h):E},u);return p&&(v=p.remove(v)),v};var ui=en;(function(e,n){var t=O,o=Be,i=ui;function a(c,s){var u=new i(s);return u.process(c)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var c in t)n[c]=t[c];for(var s in o)n[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(We,We.exports);var fi=We.exports;const di=bo(fi);function pi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),di(e)}function mi(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function gi(e,n){const t={dir:e<0?n==="long"?"W":"S":n==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`}function ot(e,n){const t=["forms",e];return n&&t.push(n),"/"+t.join("/")}function hi(e,n){return"/"+[A.PATH_RESOLVER_ENTITY,e,n].join("/")}function yi(){return`/${A.PATH_RESOLVER_ENTITY}/:entity/:primaryKey`}function He(e,n,t){const o=ee.getScope(e.toLowerCase());return n.map(i=>{typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=l=>H.openModal("modal-history",{id:l.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History");const a=i.displayMode;if(a){const l=async c=>{try{const s=c[ie(i)];return[await tt(wi(i,c),s),s]}catch{return[]}};a&&(a==="form"?i.link=c=>{const s=c[ie(i)];return s?hi(i.entity,s):null}:i.onClick=async c=>{const[s,u]=await l(c);if(!s||!u)return null;switch(i.displayMode){case"modal":return H.openModal(A.MODAL_ENTITY,{entity:s,primaryKey:u});case"inline":return t.activate(s,u,c)}}),i.class="widget-table-cell_link cursor_pointer",typeof i.value!="string"&&(i.value=(c,s)=>s[i.name[1]])}return vi(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i})}function vi(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const wi=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function bi(e){if(!Array.isArray(S.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayListCellHandlers.push(e)}function Ei(e,n){const t=ie(e);return t?B.utils.getPropFromObject(n,t):null}function Ci(e){if(!Array.isArray(S.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayFieldParamsHandlers.push(e)}const ki={addListCellHandler:bi,getCellModelValue:Ei,addFieldParamsHandler:Ci};var tn=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(tn||{});function _i(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function Ti(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function nn(e,n){e()&&(await n(),await nn(e,n))}function Ai(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(k=>u(k,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(t==null?void 0:t.filterSearchFn)||((k,C)=>Ti(k,C));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function d(){const k=E();return typeof k.limit!="number"&&(k.limit=100),k.offset=c,(t.request||ae)(e,k).then(I=>(c+=I.length,I))}function p(k,C){var F;return typeof k.Version=="number"?k.Version:(F=l.find(_=>_.Id===C))==null?void 0:F.Version}function v(k,C){const I=l.findIndex(F=>F.Id===k);if(I===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(I,1,C)}function w(k){const C=l.findIndex(I=>I.Id===k);if(C===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(C,1)}async function y(k,C){try{const I=E(),F=p(C,k);delete C.Version,await Ze(e,{id:k,values:C,version:F,masterEntities:f()});const _=await ae(e,{fields:I.fields||"",id:k});v(k,_)}catch(I){M()(I)}}async function g(k,C={}){try{const I=E(),F=p(C,k);delete C.Version,await $t(e,{id:k,version:F,masterEntities:f()}),w(k)}catch(I){M()(I)}}async function h(k){try{await xt(e,{values:k,masterEntities:f()}),await x()}catch(C){M()(C)}}let m;async function b(){s.value=!0;try{m!=null&&m.signal&&!m.signal.aborted&&m.abort();let k=m=new AbortController,C=0;const F=E().limit||0;if(i.value&&!F){console.warn("Using textSearch assumes the use of limit.");return}await nn(()=>(F>0?C<F:!0)&&!o&&!k.signal.aborted,async()=>{const _=await d();k.signal.aborted||(l.push(..._),C+=_.filter(N=>u(N,i.value)).length,(_.length<F||F===0)&&(o=!0))})}catch(k){M()(k)}s.value=!1}function E(){return typeof n=="function"?n():n}async function x(){try{c=0,o=!1,l.splice(0,l.length),await b()}catch(k){M()(k)}}function T(){if(m)return m.abort();s.value=!1}return{array:l,updateById:y,next:b,reload:x,wait:s,create:h,deleteById:g,textSearch:i,filteredArray:a,abort:T}}function Si(){function e(){return{organizations:G.organizations,currentContextId:G.contextId,person:G.person,context:G.context,contextType:G.contextType,userId:G.userId}}const n=r.reactive(e());return G.onupdateContext(()=>{Object.assign(n,e())}),n}function Ii(e,n,t){return L().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function Ni(e,n,t){return L().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function Ri(e,n){return L().emit("communication-message:create",{communicationId:e,text:n})}function Li(e){return L().emit("communication-message:read",{communicationId:e})}function Oi(e){const n=B.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>Li(e.id).then(o=>(t.splice(0,t.length,...o),o)),{array:t}}function Fi(e,n){e.read=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ae(e.name,o)}).then(st).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(M())},e.save=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return Ze(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw M()(i),i})};function t(){return typeof n=="function"?n():n}}function De(e){if(!e)return r.inject(A.PROVIDE_NAME_METADATA);Ne.initEntity(e);const n=r.computed(()=>Ne.state[e]);return r.provide(A.PROVIDE_NAME_METADATA,n),n}function it(e,n={}){if(!e)return r.inject(A.PROVIDE_NAME_USAGE_CONTEXT);const t=r.ref(null);return r.provide(A.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await ro(e,Bi(n||{}))}}}function Bi(e){return typeof e=="function"?e():e}function Di(e){if(!e)return r.inject(A.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Mt(e,l))),i={actions:o,update:a};r.provide(A.PROVIDE_NAME_ACTIONS,i),e.router=oe.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return Pt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>t.splice(0,0,...c)).catch(M("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function xi(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function $i(e,n={}){const t=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){t.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>t.includes(s),a=s=>{n.handleSelect&&!n.handleSelect(s)||i(s)||t.push(s)},l=s=>{const u=t.findIndex(f=>f===s);u!==-1&&t.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,c,a,l]}function Pi(e){const n=r.ref(""),t=r.computed(()=>{const o=n.value.toLowerCase();return r.unref(e).filter(i=>n.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:n,searchArray:t}}class je{static async getStartConfig(n,t){return L().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return L().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return L().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function Vi(e){return e.statusName===V.Completed}function Mi(e){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(e.statusName)}function ji(e){return e.statusName===V.ValidationError}function Ui(e){return e.statusName===V.Undefined}function Wi(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>d(i,l.value)),s=r.ref(null),u=r.reactive([]),f=r.computed(()=>u.map(m=>d(i,m)));function d(m,b){return m.find(E=>E.name===b)||null}async function p(m){var b;if(Ui(m)){await t.onDisplayDataSet(m);return}if(!(Mi(m)&&!await t.onDisplayDataSet(m))){if(ji(m))return void t.onValidation(m.validationResults);y(m),await r.nextTick();{const E=((b=d(i,l.value))==null?void 0:b.fields)||[];if([V.FinalStep,V.NextStep,V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(m.statusName)&&(!E.length||qi(E,t.presets)))return h(t.presets||{})}Vi(m)&&t.onCompleted(m)}}async function v(){try{await w(),await g()}catch(m){M("error")(m)}}function w(){return a.value="Loading process information.",je.getStartConfig(n,e).then(m=>(s.value={label:m.processTitle,info:m.processInfo,icon:m.processIcon},i=m.steps.map(b=>{const E=b.frontendEntity.rootObject,x=Object.fromEntries(b.frontendEntity.objectTypes.map(T=>[T.name,T.properties]));return{label:b.title,name:b.stepName,number:b.number,rootObjectName:E,objectTypes:x,fields:x[E],buttonCaption:b.buttonCaption}}))).finally(()=>{a.value=!1})}function y(m){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation,V.NextStep,V.Completed,V.FinalStep].includes(m.statusName)?(o=m.token,l.value=m.nextStepName):console.log("Saving is not completed:",m),m}function g(){return a.value="Starting process",je.startProcess(n,e).then(p).catch(M("error")).finally(()=>{a.value=null})}function h(m={}){const b=l.value;return!o||!b?Promise.reject("Not step or token."):(a.value="Waiting for result...",je.runStep(n,e,b,o,m).then(p).then(E=>(u[u.length-1]!==b&&u.push(b),E)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:v,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:u,processInfo:s,next:h}}function qi(e,n){for(let t=0;t<e.length;t++){const o=e[t];if(!B.utils.getPropFromObject(n,o.name))return!1}return!0}function Hi(e,n){const t=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,n||{});return{name:t,arguments:o}}function zi(e){return e.limit||(e.limit=150),e}function rn(e,n={}){const{limit:t}=zi(n),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(y=>f(y.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function f(y){y===null&&(y=""),y===void 0&&(y="-");let g=typeof y!="string"?String(y):y;return g=g.replace(/"/g,'""'),g.search(/("|,|\n)/g)>=0&&(g='"'+g+'"'),g}function d(){return ae(a,{fields:et(l).join(" "),limit:t,offset:u.offset,order:i,filter:typeof o=="string"?o:$(o||{}),customFilters:c.map(y=>{var g;return Hi(y,(g=n.customFiltersData)==null?void 0:g[typeof y=="string"?y:y.name])})}).then(y=>(u.offset+=t,y))}function p(){const y="data:text/csv;charset=utf-8,"+s.join(`\r
|
|
8
|
+
`),g=encodeURI(y),h=document.createElement("a");h.setAttribute("href",g),h.setAttribute("download",`${a}.csv`),document.body.appendChild(h),h.click()}function v(){u.rejected=!0}async function w(){return d().then(y=>{const g=y.map(h=>l.map(m=>f(Oe(m,h))).join(","));return s.push(...g),u.count=s.length,y.length}).then(y=>{if(y!==t&&(u.finished=!0),y===t&&!u.rejected)return w()})}return{downloadFile:p,reject:v,state:u,start:w}}const xe=new class{constructor(){this.store=r.reactive([])}add(n,t,o={}){const i=Gi(o),a=new ze(n,t,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(n){const t=this.store.findIndex(o=>o.id===n);if(t===-1)return!1;this.store.splice(t,1)}};function Gi(e){function n(o){return!!o&&typeof o=="object"}const t={timeout:10,click:()=>null,children:[]};return n(e)?{timeout:e.timeout||t.timeout,click:e.click||t.click,children:e.children||t.children}:t}const Re=class Re{constructor(n,t,o,i,a){this.type=n,this.message=t,this.timeout=o,this.children=i,this.click=a,this.id=Re.cardId++}};Re.cardId=1;let ze=Re;/*!
|
|
9
9
|
* jenesius-event-emitter v1.0.2
|
|
10
10
|
* (c) 2022 Jenesius
|
|
11
11
|
* @license MIT
|
|
12
|
-
*/const vt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},wt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},bt=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},Et=function(){this.events={}};class Y{constructor(){this.events={}}on(n,t){return vt.call(this,n,t)}emit(n,t){return wt.call(this,n,t)}off(n,t){return bt.call(this,n,t)}cleanEvents(){Et.call(this)}static on(n,t){return vt.call(Y,n,t)}static emit(n,t){return wt.call(Y,n,t)}static off(n,t){return bt.call(Y,n,t)}static cleanEvents(){Et.call(Y)}}Y.events={};class Yi extends Y{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return Oi(this.id,n)}static checkAndGenerate(n,t,o){return Ri(n,t,o).then(i=>i.length===0?Ni(n,t,o):i[0])}}function Ji(){return R().emit("client:read",{})}class it extends Error{static ConstContextCannotBeChanged(){return new it("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ye,le;const X=class X extends Y{constructor(){super(...arguments);Pe(this,ye);Pe(this,le);this.isConstContext=!1,this.type="front",this.organizations=[],Ee(this,le,!1)}set language(t){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextId(){return $e(this,ye)}set contextId(t){if(this.isConstContext)throw it.ConstContextCannotBeChanged();Ee(this,ye,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Ee(this,le,t),this.emit(X.EVENT_READY_UPDATE,t)}get ready(){return $e(this,le)}onReady(t){return this.on(X.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(X.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=t,localStorage.setItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(X.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){V()(t)}}restoreCurrentContext(){var o,i;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number"||((i=this.customer)==null?void 0:i.constContextId)===null)return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const t=Number.parseInt(localStorage.getItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Ji()}validateContextId(t){var o;try{return((o=this.person)==null?void 0:o.id)==t?!0:!!this.organizations.find(i=>i.id===t)}catch{return!1}}};ye=new WeakMap,le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Ge=X;function Qi(e){return R().emit("metadata:read",{entity:e})}const Le=function(){const n=r.reactive({}),t=new Map;function o(c){return n[c]}async function i(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Qi(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Zi extends Y{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class z{static login(n){return j(I.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:I.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return z.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return z.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return j(`${I.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return z.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return z.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return z.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return j(`${I.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(z.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return j(`${I.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static finishAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:i})})}}class ea{static readHistoryById(n,t){return j(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ta{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await j(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class na{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return j(`/open-api/internationalization/language/${n}`)}}class ra{static async upload(n,t){const o=new FormData;return o.append("file",n),j(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var an=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(an||{}),sn=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(sn||{});function oa(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function x(e){return Object.keys(e).reduce((n,t)=>{const o=e[t];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&n.push(`@${t} in (${i})`),n}if(oa(o)){let i=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&n.push(`@${t} ge ${i(o.start)}`),o.end&&n.push(`@${t} le ${i(o.end)}`),n}return typeof o=="number"||typeof o=="boolean"?(n.push(`@${t} eq ${o}`),n):typeof o=="string"?(o.length!==0&&n.push(`@${t} eq '${o}'`),n):(o===null&&n.push(x.is(t,o)),n)},[]).join(" and ")}function we(e){return typeof e=="string"?`'${e}'`:`${e}`}x.includes=function(n,t){return`@${n} Contains ${we(t)}`};x.beginWith=function(n,t){return`@${n} BeginWith ${we(t)}`};x.notEq=function(n,t){return`@${n} nq ${we(t)}`};x.eq=function(n,t){return Array.isArray(t)?x.in(n,t):`@${n} eq ${we(t)}`};x.in=function(n,t){const o=t.map(we).join(", ");return`@${n} in (${o})`};x.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":x.and(...t.map(o=>x.notEq(n,o)))};x.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(x.wrap).join(" and ")};x.wrap=function(n){return`(${n})`};x.is=function(n,t){return`@${n} is ${t}`};x.or=function(...n){return n.join(" or ")};function at(e){return Object.keys(e).reduce((n,t)=>{let o=e[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=at(o)),n[i]=o,n},{})}var P=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(P||{});function ia(e){return typeof e!="string"?!1:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}const H=new Ge,he=new Zi;exports.ApplicationStatus=sn;exports.AsyncProcessStatus=Rt;exports.Communication=Yi;exports.CoreError=Q;exports.DisplayListRow=nn;exports.EventBus=he;exports.Filter=x;exports.Manager=H;exports.MetadataStore=Le;exports.ModalListDownload=qr;exports.NotificationSystem=ot;exports.OBJECT_TYPE_NAME_FIELD=_t;exports.RecordOperation=an;exports.WidgetAction=Ur;exports.WidgetButton=Hn;exports.WidgetFastTable=jr;exports.WidgetFastTableHeadCell=St;exports.WidgetField=mr;exports.WidgetIcon=me;exports.WidgetImage=tr;exports.WidgetList=gr;exports.WidgetLoader=Ke;exports.WidgetMultiButton=Jn;exports.WidgetResolverEntity=Wr;exports.WidgetSpinner=ve;exports.WidgetTable=At;exports.WidgetTablePanelFilterItem=It;exports.asyncProcess=ce;exports.authService=z;exports.billingService=ae;exports.catchUniversal=V;exports.config=Fn;exports.configuration=I;exports.constants=S;exports.convertDDToDMS=hi;exports.convertDMSToDD=mi;exports.convertListConfig=qe;exports.coreUtils=Ti;exports.debounce=Yr;exports.documentsService=pn;exports.fileService=ra;exports.formatter=ue;exports.getCellName=re;exports.getCellValue=Oe;exports.getEntityLink=tn;exports.getNamesFromListConfig=Ze;exports.getPathForResolveRouter=vi;exports.getUnitValue=je;exports.groupArrayByField=zr;exports.historyService=ea;exports.injectAction=Lt;exports.internationalizationService=na;exports.invitationService=dn;exports.isUUID=ia;exports.openService=ta;exports.parseError=Je;exports.parseTextByMarkdown=gi;exports.prettyDate=Se;exports.prettyDateWithTime=Nt;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Zr;exports.request=j;exports.setupListRow=Xe;exports.staticLink=lo;exports.t=Z;exports.throttle=Jr;exports.universalBatchUpdate=Vt;exports.universalEntityCount=so;exports.universalEntityCreate=Dt;exports.universalEntityDelete=$t;exports.universalEntityRead=oe;exports.universalEntityResolve=et;exports.universalEntityUpdate=Qe;exports.universalHistoryRead=ao;exports.universalListSettingRead=xt;exports.universalMetadataFieldTreat=ro;exports.universalMetadataListRead=io;exports.universalToolRead=Pt;exports.useActions=$i;exports.useCommunication=Bi;exports.useEnter=Pi;exports.useFormEntity=xi;exports.useListActiveRow=Ai;exports.useListDownload=on;exports.useListEntity=Ii;exports.useListSearch=Mi;exports.useListSelect=Vi;exports.useLocalStorage=Tt;exports.useManagerState=Li;exports.useMetadata=xe;exports.useSocket=R;exports.useUsageContext=rt;exports.useVisibleItem=Ye;exports.useWizard=Hi;exports.uuidv4=Xr;exports.valuesToUpperCase=at;exports.wrapToolResponse=Mt;
|
|
12
|
+
*/const vt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},wt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},bt=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},Et=function(){this.events={}};class J{constructor(){this.events={}}on(n,t){return vt.call(this,n,t)}emit(n,t){return wt.call(this,n,t)}off(n,t){return bt.call(this,n,t)}cleanEvents(){Et.call(this)}static on(n,t){return vt.call(J,n,t)}static emit(n,t){return wt.call(J,n,t)}static off(n,t){return bt.call(J,n,t)}static cleanEvents(){Et.call(J)}}J.events={};class Xi extends J{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return Ri(this.id,n)}static checkAndGenerate(n,t,o){return Ni(n,t,o).then(i=>i.length===0?Ii(n,t,o):i[0])}}function Yi(){return L().emit("client:read",{})}class at extends Error{static ConstContextCannotBeChanged(){return new at("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ve,ue;const Y=class Y extends J{constructor(){super(...arguments);Ve(this,ve);Ve(this,ue);this.isConstContext=!1,this.type="front",this.organizations=[],Ee(this,ue,!1)}set language(t){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||Y.DEFAULT_LANGUAGE}get contextId(){return Pe(this,ve)}set contextId(t){if(this.isConstContext)throw at.ConstContextCannotBeChanged();Ee(this,ve,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Ee(this,ue,t),this.emit(Y.EVENT_READY_UPDATE,t)}get ready(){return Pe(this,ue)}onReady(t){return this.on(Y.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(Y.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=t,localStorage.setItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(Y.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){M()(t)}}restoreCurrentContext(){var o,i;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number"||((i=this.customer)==null?void 0:i.constContextId)===null)return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const t=Number.parseInt(localStorage.getItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Yi()}validateContextId(t){var o;try{return((o=this.person)==null?void 0:o.id)==t?!0:!!this.organizations.find(i=>i.id===t)}catch{return!1}}};ve=new WeakMap,ue=new WeakMap,Y.DEFAULT_LANGUAGE="en",Y.EVENT_CONTEXT_UPDATE="event:context-update",Y.EVENT_READY_UPDATE="event:ready-update";let Ge=Y;function Ki(e){return L().emit("metadata:read",{entity:e})}const Ne=function(){const n=r.reactive({}),t=new Map;function o(c){return n[c]}async function i(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Ki(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Ji extends J{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class X{static login(n){return q(S.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:S.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return X.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return q(`${S.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return X.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return X.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return X.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return q(`${S.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(X.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return q(`${S.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,o,i){return q(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(n,t,o,i){return q(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static finishAccessRecovery(n,t,o,i){return q(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:i})})}}class Qi{static readHistoryById(n,t){return q(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Zi{static getConfiguration(){return q("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await q(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ea{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return q(`/open-api/internationalization/language/${n}`)}}class ta{static async upload(n,t){const o=new FormData;return o.append("file",n),q(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var on=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(on||{}),an=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(an||{});function na(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function $(e){return Object.keys(e).reduce((n,t)=>{const o=e[t];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&n.push(`@${t} in (${i})`),n}if(na(o)){let i=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&n.push(`@${t} ge ${i(o.start)}`),o.end&&n.push(`@${t} le ${i(o.end)}`),n}return typeof o=="number"||typeof o=="boolean"?(n.push(`@${t} eq ${o}`),n):typeof o=="string"?(o.length!==0&&n.push(`@${t} eq '${o}'`),n):(o===null&&n.push($.is(t,o)),n)},[]).join(" and ")}function be(e){return typeof e=="string"?`'${e}'`:`${e}`}$.includes=function(n,t){return`@${n} Contains ${be(t)}`};$.beginWith=function(n,t){return`@${n} BeginWith ${be(t)}`};$.notEq=function(n,t){return`@${n} nq ${be(t)}`};$.eq=function(n,t){return Array.isArray(t)?$.in(n,t):`@${n} eq ${be(t)}`};$.in=function(n,t){const o=t.map(be).join(", ");return`@${n} in (${o})`};$.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":$.and(...t.map(o=>$.notEq(n,o)))};$.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map($.wrap).join(" and ")};$.wrap=function(n){return`(${n})`};$.is=function(n,t){return`@${n} is ${t}`};$.or=function(...n){return n.join(" or ")};function st(e){return Object.keys(e).reduce((n,t)=>{let o=e[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=st(o)),n[i]=o,n},{})}var V=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(V||{});function ra(e){return typeof e!="string"?!1:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}const G=new Ge,ye=new Ji;exports.ApplicationStatus=an;exports.AsyncProcessStatus=Lt;exports.Communication=Xi;exports.CoreError=Z;exports.DisplayListRow=tn;exports.EventBus=ye;exports.Filter=$;exports.Manager=G;exports.MetadataStore=Ne;exports.ModalListDownload=Wr;exports.NotificationSystem=xe;exports.OBJECT_TYPE_NAME_FIELD=_t;exports.RecordOperation=on;exports.WidgetAction=jr;exports.WidgetButton=qn;exports.WidgetFastTable=Mr;exports.WidgetFastTableHeadCell=St;exports.WidgetField=mr;exports.WidgetIcon=he;exports.WidgetImage=er;exports.WidgetList=pr;exports.WidgetLoader=Ke;exports.WidgetMultiButton=Kn;exports.WidgetResolverEntity=Ur;exports.WidgetSpinner=we;exports.WidgetTable=At;exports.WidgetTablePanelFilterItem=It;exports.asyncProcess=fe;exports.authService=X;exports.billingService=le;exports.catchUniversal=M;exports.config=On;exports.configuration=S;exports.constants=A;exports.convertDDToDMS=gi;exports.convertDMSToDD=mi;exports.convertListConfig=He;exports.coreUtils=ki;exports.debounce=Yr;exports.documentsService=dn;exports.fileService=ta;exports.formatter=de;exports.getCellName=ie;exports.getCellValue=Oe;exports.getEntityLink=ot;exports.getNamesFromListConfig=et;exports.getPathForResolveRouter=yi;exports.getUnitValue=Ue;exports.groupArrayByField=zr;exports.historyService=Qi;exports.injectAction=Nt;exports.internationalizationService=ea;exports.invitationService=fn;exports.isUUID=ra;exports.openService=Zi;exports.parseError=Qe;exports.parseTextByMarkdown=pi;exports.prettyDate=Se;exports.prettyDateWithTime=Rt;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Qr;exports.request=q;exports.setupListRow=Ye;exports.staticLink=so;exports.t=ee;exports.throttle=Kr;exports.universalBatchUpdate=Vt;exports.universalEntityCount=ao;exports.universalEntityCreate=xt;exports.universalEntityDelete=$t;exports.universalEntityRead=ae;exports.universalEntityResolve=tt;exports.universalEntityUpdate=Ze;exports.universalHistoryRead=io;exports.universalListSettingRead=Dt;exports.universalMetadataFieldTreat=no;exports.universalMetadataListRead=oo;exports.universalToolRead=Pt;exports.useActions=Di;exports.useCommunication=Oi;exports.useEnter=xi;exports.useFormEntity=Fi;exports.useListActiveRow=_i;exports.useListDownload=rn;exports.useListEntity=Ai;exports.useListSearch=Pi;exports.useListSelect=$i;exports.useLocalStorage=Tt;exports.useManagerState=Si;exports.useMetadata=De;exports.useSocket=L;exports.useUsageContext=it;exports.useVisibleItem=Je;exports.useWizard=Wi;exports.uuidv4=Gr;exports.valuesToUpperCase=st;exports.wrapToolResponse=Mt;
|
|
13
13
|
//# sourceMappingURL=eservices-core.cjs.js.map
|