eservices-core 1.3.210 → 1.3.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eservices-core.cjs.js +6 -6
- package/dist/eservices-core.es.js +641 -636
- package/dist/eservices-core.umd.js +6 -6
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
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}.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: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_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}.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;color:#4f4f4f}.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{text-align:right}.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-primary{color:var(--primary)}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.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}.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}.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-498c4f00]{padding:18px;text-align:start}.widget-table__head-label[data-v-498c4f00]{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-cf143196]{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-cf143196]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cf143196]: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-9db5d417]{display:flex;gap:4px}.widget-head-cell-order[data-v-9db5d417]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-9db5d417]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-9db5d417]{padding:7px}.widget-head-cell-order-icon[data-v-9db5d417]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-9db5d417]{transform:rotate(180deg)}.widget-filter-item-container[data-v-5b9128bc]{position:relative}.widget-filter-item-arrow[data-v-5b9128bc]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-5b9128bc]{font-weight:700}.widget-filter-item[data-v-5b9128bc]{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-5b9128bc]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-5b9128bc]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-5b9128bc]{transition:.2s}.widget-table-panel-filter[data-v-f1534314]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
"use strict";var Ze=e=>{throw TypeError(e)};var et=(e,n,t)=>n.has(e)||Ze("Cannot "+t);var tt=(e,n,t)=>(et(e,n,"read from private field"),t?t.call(e):n.get(e)),nt=(e,n,t)=>n.has(e)?Ze("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),
|
|
3
|
-
* eservices-core v1.3.
|
|
2
|
+
"use strict";var Ze=e=>{throw TypeError(e)};var et=(e,n,t)=>n.has(e)||Ze("Cannot "+t);var tt=(e,n,t)=>(et(e,n,"read from private field"),t?t.call(e):n.get(e)),nt=(e,n,t)=>n.has(e)?Ze("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Le=(e,n,t,o)=>(et(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);/*!
|
|
3
|
+
* eservices-core v1.3.211
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),Ve=require("vue-router"),F=require("jenesius-vue-form"),Kt=require("date-and-time"),Se=require("debug"),
|
|
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 K=N;const Qt="Please try again later or submit a feedback if problem doesn't go.";function Zt(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return Qt}})}function ae(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw K.ApiNotAvailable()}).then(t=>Zt(t).then(o=>{if(!t.ok)throw o;return o}))}class en{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 en;class tn{static invite(n,t,o){return ae("/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 ae("/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 ae("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class nn{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 ie{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${ie.url()}/calculator/${n}`)}static calculate(n,t){return ae(`/${ie.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]):K.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 ae(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return ae(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const rn={class:"widget-table__head-cell"},on={class:"widget-table__head-label margin_0 text_overflow"},vt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("th",rn,[r.createElementVNode("span",on,r.toDisplayString(n.label),1)]))}}),an={class:"widget-table__head"},sn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>I.componentTableHeadCell||vt),(n,t)=>(r.openBlock(),r.createElementBlock("tr",an,[(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))]))}}),W=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},ln=W(sn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function ge(e){return Me(e.name)}function cn(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 un(e,n){return cn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),F.utils.getPropFromObject(n,o))}),e}function $e(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Ue(e,n){const t=ge(e);if(typeof e.value=="string")return un(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=$e(e.unitValue)(o)),e.unit&&(o=$e(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Te(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Tt(typeof o=="string"?o:null);break}case"money":{o=Ct(o);break}case"DateTime":{o=Te(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 fn=1,dn=5e3,pn="static-folder",yt="request-error",wt="Distinguisher",A={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",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:wt};function Ie(e){return[A.CORE_DEBUG_LABEL,e].join(":")}const gn={class:"widget-filter-text flex gap_20"},mn=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,u)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",gn,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Q)("Apply")),1)]),_:1})])}}}),hn=W(mn,[["__scopeId","data-v-800b3803"]]),vn={class:"widget-filter-enum"},yn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=Re(t.fieldMetadata.entity),a=c=>(t.values||[]).includes(c),l=n;function u(c){const f=t.values||[];return f.includes(c)?l("update:values",f.filter(g=>g!==c)):l("update:values",[...f,c])}async function s(){var g;if(!((g=t.fieldMetadata)!=null&&g.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;l("readProcess","start"),o.value=await ce(t.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(l("readProcess","end"),d.map(v=>({label:v[c],value:v[f]}))))}return r.watch(()=>i.value,s,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",vn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,g=>(r.openBlock(),r.createBlock(r.unref(F.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>u(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))]))}}),wn=W(yn,[["__scopeId","data-v-cf143196"]]),I={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:hn,Entity:wn}};function bn(e){for(let n in e)I[n]=e[n]}const En={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))}},le=W(En,[["__scopeId","data-v-8a72b45f"]]),kn=Se(Ie("setup-list-row"));function Tn(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=Ue(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 u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(F.FormField,{type:"single-checkbox",modelValue:n.selected})),l(rt.bind(null,t,!0));break}case"select":{c.push(r.h(F.FormField,{type:"single-radio",modelValue:n.selected})),l(rt.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const g=r.h(Ve.RouterLink,{to:f});c.push(g),u("widget-table-cell_link")}}catch(f){kn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(le,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(le,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),I.listCellHandler&&I.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:l,context:t}),s.push(r.h("td",a,c)),s}function rt(e,n){e.emit("select",n)}function We(e,n){return()=>{try{return Tn(e,n)}catch(t){return console.warn(t),null}}}const Cn={props:{values:Object,config:Object,selected:Boolean},setup:We},An=["colspan"],ot=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,An)],512))}}),Sn={class:"widget-table"},it="update:selectedRows",In="update:activeRow",bt=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 d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function l(d){return t.useMockField?dt(d):d}function u(d,v=!0){if(!t.selectedRows)return;if(!v)return o(it,t.selectedRows.includes(d)?[]:[d]);const h=[...t.selectedRows],T=h.indexOf(d);return T===-1?h.push(d):h.splice(T,1),o(it,h)}function s(d){o(In,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>t.shortcut?t.config.filter(d=>d.name?!!t.array.find(h=>![null,""].includes(Ue(d,h))):!0):t.config),g=r.computed(()=>t.useMockField?t.array.filter(dt):t.array);return(d,v)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Sn,[r.createElementVNode("thead",null,[r.createVNode(ln,{config:f.value,onOrder:v[0]||(v[0]=h=>d.$emit("order",h))},{default:r.withCtx(h=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||vt),r.normalizeProps(r.guardReactiveProps(h)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(h,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createVNode(Cn,{config:f.value,values:h,selected:d.selectedRows.includes(l(h)),onSelect:b=>u(l(h),b),onActivate:b=>s(l(h)),class:r.normalizeClass(d.classCallback?d.classCallback(h):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===l(h)?(r.openBlock(),r.createBlock(ot,{key:0,component:a.value,"row-length":d.config.length,values:h,onClose:v[1]||(v[1]=b=>o("update:activeRow",null)),onSave:c,"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(ot,{key:0,component:a.value,"row-length":f.value.length,onClose:v[2]||(v[2]=h=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Nn=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))}}),fe=W(Nn,[["__scopeId","data-v-0ef9ae88"]]),Rn={class:"widget-button"},Ln=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Rn,[n.wait?(r.openBlock(),r.createBlock(fe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),On=W(Ln,[["__scopeId","data-v-450dc564"]]),xn={class:"widget-multi-button-wrap position_relative cursor_pointer"},$n={class:"widget-multi-button-body grid"},Fn=["onClick"],Bn={class:"widget-multi-button-side-wrap"},Dn=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,u)=>(r.openBlock(),r.createElementBlock("div",xn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",$n,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,Fn))),128))]),r.createElementVNode("div",Bn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(fe),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(le),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Pn=W(Dn,[["__scopeId","data-v-d43a76ce"]]),Vn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Mn={class:"text_md"},Un=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Vn,[r.createVNode(fe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Mn,r.toDisplayString(n.label),1)]))}}),Wn=["alt","src"],jn=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,Wn))}}),qn={props:{config:Array,values:Object,selected:Boolean},setup:We},Gn=W(qn,[["__scopeId","data-v-344a8cc1"]]),zn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Hn={class:"widget-list-head-cell"},Xn=zn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Yn=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",Hn,[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(le),{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),Xn])]))}}),Jn=W(Yn,[["__scopeId","data-v-bf495d6a"]]),Kn=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 c(h,T){let b=-1;do b++,T-=h[b];while(T>0&&b<h.length);return b}function f(h,T){let b=0;for(;T>0&&T>h[b]&&b<h.length;)T-=h[b],b++;return console.log(T,b),b>0?b:0}function g(h){try{a.value.style.insetInlineStart=h+"px"}catch(T){console.log(T)}}function d(h){try{a.value.style.width=h+"px",a.value.style.minWidth=h+"px",a.value.style.maxWidth=h+"px"}catch(T){console.log(T)}}function v(h){return h===null?!1:h.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(T){var j;function b(S){return S.screenX+w-B}const m=i.value,y=[...m.children].filter(S=>S.localName==="th"),w=((j=m.offsetParent)==null?void 0:j.scrollLeft)||0,C=y.map(S=>S.clientWidth),$=v(T.target),B=m.getBoundingClientRect().left,E=b(T),p=c(C,E),k=C.slice(0,p).reduce((S,D)=>S+D,0),_=E-k,R=m.offsetWidth,V=y[p].clientWidth;if(t.config[p].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",C),console.log("max width",R),console.log("Start Position",E),console.log("Position From",p),console.log("Start Position",p),console.log("Global offset (Отступ самой таблицы от края экрана)",B),console.log("Del",_),console.groupEnd(),a.value.innerText=y[p].textContent||"",a.value.style.display="grid",a.value.style.width=V+"px",a.value.style.cursor="grabbing",g(k),d(V),document.addEventListener("pointermove",Y,{passive:!0}),document.addEventListener("pointerup",oe);function oe(S){if(console.group("END"),document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",oe),$&&(t.config[p].width=a.value.style.width,t.config[p].minWidth=a.value.style.width,t.config[p].maxWidth=a.value.style.width,l(t.config)),!$){const D=S.screenX+w-B;console.log("ENP Position",D);const Z=f(C,D);if(console.log(p,"->",Z),Z!==p){const de=t.config[p],Le=t.config;Le.splice(p,1),Le.splice(Z,0,de),l(Le)}else{const de=t.config[p].name;u(de)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Y(S){if($){const de=b(S)-E+V;d(de);return}let D=S.screenX+w-B-_;D<0&&(D=0),D+V>R&&(D=R-V),g(D)}})});function l(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void s([c]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([c,f==="asc"?"desc":"asc"])}function s(c){o("update:order",c)}return(c,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(c.config,(g,d)=>(r.openBlock(),r.createBlock(Jn,r.mergeProps({key:g,ref_for:!0},g,{onOrder:v=>u(g.name),onSelect:f[0]||(f[0]=v=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),Qn=W(Kn,[["__scopeId","data-v-ccffc6bd"]]),Zn={class:"widget-list"},er={class:"widget-list-body position_relative"},tr=50,nr=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,c=!0){if(t.selectedRows)if(!c)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],g=f.indexOf(s);g===-1?f.push(s):f==null||f.splice(g,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 u(s){if(!s)return;const c=s.target;c.scrollTop+c.clientHeight+tr>c.scrollHeight&&o("scrollEnd")}return(s,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",Zn,[r.createElementVNode("thead",null,[r.createVNode(Qn,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",er,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,g)=>{var d;return r.openBlock(),r.createBlock(Gn,{key:g,class:"widget-list-row",values:f,config:s.config,selected:(d=s.selectedRows)==null?void 0:d.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 rr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const n=e,t=Re(),o=Je(),i=r.computed(()=>{var T,b;const d=s.value,v=c(d),h={type:v,disabled:!((T=u.value)!=null&&T.canSet),label:n.label};return d&&Object.assign(h,{suffix:v==="number"?d.valueUnit:void 0,required:l.includes(v||"")?!1:d.required,label:n.label||d.displayName}),Object.assign(h,((b=I.fieldParamsHandler)==null?void 0:b.call(I,d,u.value,h))||{}),h}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const d=t.value.fieldsByName[n.name];if(d)return d});function c(d){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:g}=je();return r.watch(()=>f.value,d=>d?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(d,v)=>f.value?(r.openBlock(),r.createBlock(r.unref(F.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function or(e){return Array.isArray(e)&&(e==null?void 0:e[1])||A.DEFAULT_ORDER_DIR}const ir=["fill"],ar=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),sr=[ar],lr=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},sr,8,ir))}}),cr={class:"widget-fast-table-head-cell-td"},ur={class:"widget-head-cell-label"},fr={key:0,class:"widget-head-cell-order"},dr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const n=e,t=r.computed(()=>Me(n.name));return r.computed(()=>or(n.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",cr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=l=>o.$emit("order",o.name))},[r.createElementVNode("span",ur,r.toDisplayString(o.label),1),t.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",fr,[r.createVNode(lr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Et=W(dr,[["__scopeId","data-v-9db5d417"]]),pr=["fill"],gr=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),mr=[gr],hr=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},mr,8,pr))}}),vr={class:"widget-filter-item-popup"},yr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=I.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const v=t.filterItem;return v.entity?"Entity":v.type?v.type:null});function u(v){s.value=v==="start"}const s=r.ref(!1),c=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let g=null;function d(v=!f.value){f.value=v,!f.value&&g?(g(),g=null):a.value&&(g=F.utils.clickOutside(a.value,d.bind(null,!1)))}return(v,h)=>{var T;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:h[0]||(h[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(v.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(fe,{key:0})):(r.openBlock(),r.createBlock(hr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",vr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((T=r.unref(i))==null?void 0:T[l.value]),{key:0,"field-metadata":v.filterItem,values:v.values,"onUpdate:values":h[1]||(h[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),kt=W(yr,[["__scopeId","data-v-5b9128bc"]]),wr={class:"widget-table-panel-filter flex"},br=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",wr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,s)=>{var c;return r.openBlock(),r.createBlock(kt,{key:s,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(ge)(u)],"onUpdate:values":f=>i(r.unref(ge)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Er=W(br,[["__scopeId","data-v-f1534314"]]),kr={class:"es-grid es-gap-15"},Tr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},_r={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},Cr=r.createElementVNode("span",null,"Loading...",-1),Ar={class:"widget-fast-table-tools es-flex es-gap-15"},Sr={class:""},Ir=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e,o=Ve.useRouter(),i=r.ref([]),a=r.ref(null),l=r.ref(null),u=r.ref(null),s=F.Form.getParentForm();Re(t.entity);const{state:c,update:f}=Je(t.entity,{masterEntities:t.masterEntities||[]}),g=(t.actions||[]).map(p=>Lt(p)),d=r.computed(()=>a.value?Ht(t.entity,a.value.config):[]),v=r.computed(()=>{var p;return((p=a.value)==null?void 0:p.displayItem)||Ye.inline}),h=r.computed(()=>{var p;return((p=a.value)==null?void 0:p.newItem)||v.value}),T=Ee(async()=>{try{await m.call(),await f()}catch(p){const{message:k}=qe(p);l.value=k}});s instanceof F.Form&&s.subscribe({read:T.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{b.call(),T.call()});const b=Ee(async function(){const k=t.entity;a.value=await St(k,t.mark)}),m=Ee(async function(){var _,R,V;const k=t.entity;l.value=null,b.promise&&await b.promise,i.value=(await ce(k,{customFilters:((_=a.value)==null?void 0:_.customFilters)||[],fields:_t(d.value).join(" "),order:((R=a.value)==null?void 0:R.order)||[],filter:x.and(x(E.value),x(t.binding||{}),x(((V=a.value)==null?void 0:V.prefilters)||{}))})).map(ti)});async function y(p){var _;if(p===null)return u.value=null;const k=p==null?void 0:p.Id;if(!k&&((_=a.value)!=null&&_.linkNew))return o.push(a.value.linkNew);if(v.value==="form")return o.push(Xe(t.entity,k));if(v.value==="inline")return u.value=p||A.LIST_ACTIVE_NEW;v.value==="modal"?(await ne.promptModal("form",{entity:t.entity,id:k}),await m.call()):u.value=A.LIST_ACTIVE_NEW}const{controller:w}=je();r.watch(()=>c.value,p=>{p&&(p.canRead?w.show():w.hide())},{immediate:!0}),r.onUnmounted(()=>w.remove());const C=[{icon:"reload",label:"Reload",callback(){T.call()}}];let $=[me.on("affected-entity",p=>{p.name===t.entity&&m.call()}),me.on("display-entity",async p=>{p.name===t.entity&&(m.promise&&await m.promise,u.value=i.value.find(k=>k.Id===p.id)||null)})];r.onUnmounted(()=>$.map(p=>p()));function B(p){var Y;function k(j){return Array.isArray(j)?k(j[0]):typeof j!="string"?null:j}const _=k(p);if(!_)return;const R=((Y=a.value)==null?void 0:Y.order)||[];(j=>{if(a.value)return a.value.order=j,!0})(R[0]!==_?[_,"asc"]:R[1]==="desc"?[]:[_,"desc"])&&m.call()}const E=r.ref({});return r.watch(()=>E.value,()=>m.call()),n({listSettings:a,array:i,config:d}),(p,k)=>{var V,oe,Y,j;const _=r.resolveComponent("widget-button"),R=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",kr,[(V=a.value)!=null&&V.label&&!p.hideLabel?(r.openBlock(),r.createElementBlock("p",Tr,r.toDisplayString((oe=a.value)==null?void 0:oe.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(T).wait||r.unref(b).wait||r.unref(m).wait?(r.openBlock(),r.createElementBlock("div",_r,[r.createVNode(r.unref(fe),{color:"var(--color-primary)"}),Cr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Ar,[h.value==="form"||(Y=r.unref(c))!=null&&Y.canCreate?(r.openBlock(),r.createBlock(_,{key:0,callback:y,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(g).filter(S=>!!S.value),S=>{var D;return r.openBlock(),r.createBlock(_,{callback:(D=S.value)==null?void 0:D.callback,type:"primary"},{default:r.withCtx(()=>{var Z;return[r.createTextVNode(r.toDisplayString((Z=S.value)==null?void 0:Z.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(C,S=>r.createVNode(_,{onClick:()=>S.callback,callback:S.callback},{default:r.withCtx(()=>[r.createVNode(le,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(S.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(S.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Sr,[r.createVNode(Er,{entity:p.entity,"filters-config":((j=a.value)==null?void 0:j.filters)||[],filters:E.value,"onUpdate:filters":k[0]||(k[0]=S=>E.value=S)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(bt),{config:d.value,array:i.value,"active-row":u.value,"onUpdate:activeRow":y,onOrder:B,class:"table"},{"head-cell":r.withCtx(S=>{var D;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]?p.$slots["head-cell"]:Et),r.mergeProps({label:S.label},S,{onOrder:B,order:((D=a.value)==null?void 0:D.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var S;return[r.createVNode(R,{entity:p.entity,id:(S=u.value)==null?void 0:S.Id,"master-entities":p.masterEntities||void 0,binding:p.binding,onFormUpdate:k[1]||(k[1]=()=>{u.value=null,r.unref(m).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function Tt(e){return Te(e,"YYYY/MM/DD HH:mm:ss")}function Te(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return Kt.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function Ee(e){function n(...o){if(t.wait)return Promise.reject("The process has already started.");t.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{t.wait=!1,t.promise=null});return t.promise=i,i}const t=r.reactive({wait:!1,call:n,promise:null});return t}function qe(e){return typeof e=="string"?ve(e):Nr(e)?ve(e.message,e.children||e.details||[]):Rr(e)?ve(e.title,[e.detail||""]):ve(A.DEFAULT_ERROR_MESSAGE)}function Nr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Rr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function ve(e,n=[]){return{message:e,children:n}}function M(e="error"){return function(n){const{message:t,children:o}=qe(n);Ke.add(e,t,{children:o})}}function ce(e,n={}){return O().emit("entity:read",{...n,entity:e})}function Ge(e,n){return O().emit("entity:update",{...n,entity:e})}function _t(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ct(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 Lr(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 Or(){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 U(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 $r(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function Fr(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Br=Se(Ie("pretty-value-field-by-entity"));function Dr(e,n,t){try{const o=Ce.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 Br('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const ee=Se(Ie("use-socket"));function O(){return Vr}function Pr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Vr=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()},dn*2);const m=new Uint8Array(1);m[0]=fn,n.send(m)}setInterval(()=>{Array.from(o).forEach(m=>{b(m)&&(ee("Handler for event %s requestId %d was expired",m.event,m.requestId),m.requestId?s({requestId:m.requestId,event:yt,data:{message:K.RequestTookToLong().message}}):o.delete(m))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&c()},A.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(m){const y=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,m.event,m.requestId),y.forEach(w=>{const C=m.requestId;(w.requestId&&w.requestId===C||!w.requestId&&w.event===m.event)&&(ee("Find appropriated handler: %d, event: %s",e,w.event),w.callback(m.data,m),w.once&&(o.delete(w),ee("Handler was removed by *once* params was passed. %o",w)))})}function c(){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(m){ee("Connection to server was stopped: %d %s",m.code,m.reason),Array.from(o).forEach(y=>{y.guaranteedAnswer&&y.serializeString&&a.add(y.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(m=>{f(m),a.delete(m)})},n.onerror=function(m){console.warn(m)},n.onmessage=m=>{var y;try{if(Pr(m.data)){l();return}const w=JSON.parse(m.data);if(!At(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(y=w==null?void 0:w.data)!=null&&y.refresh&&location.reload(),s(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}function f(m){n.send(m)}function g(m,y){T({event:m,callback:y})}function d(m,y){T({event:m,callback:y,once:!0})}function v(){return n&&(n==null?void 0:n.readyState)===1}function h(m,y,w){const C=++e,$=JSON.stringify({requestId:C,event:m,data:y,contextId:G.contextId,url:I.socketURLHandler?I.socketURLHandler():window.location.href});return v()?f($):(a.add($),ee("Socket is not connected. Message was send to save-queue")),new Promise((B,E)=>{T({event:m,requestId:C,once:!0,guaranteedAnswer:!0,serializeString:$,callback:(p,k)=>{if(ee("Promise was resolve with next data:",p),Mr(k))return void E(p);w&&w(p,k),B(p)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(m){const y={timeToLive:0,...m,created:new Date().getTime()};o.add(y)}function b(m){return m.timeToLive===0||typeof m.timeToLive!="number"?!1:new Date().getTime()-m.created>m.timeToLive}return{get socket(){return n},on:g,once:d,emit:h,initialization(m){t=m},getDevInfo:u}}(),Mr=e=>!!At(e)&&e.event===yt,At=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function St(e,n){return O().emit("list-setting:read",{entity:e,mark:n})}function Ur(e,n){return O().emit("metadata-field:treat",{entity:e,fieldName:n})}function It(e,n){return O().emit("entity:create",{...n,entity:e})}function Nt(e,n){return O().emit("entity:delete",{...n,entity:e})}function Wr(e,n){return O().emit("usage-context:read",{...n,entity:e})}function Rt(e={}){return O().emit("tool:read",e)}function jr(){return O().emit("metadata-list:read",{})}function Lt(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 u=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function qr(e){return O().emit("history:read",e)}function Gr(e,n){return O().emit("entity:count",{...n,entity:e})}function zr(e){return`/${pn}/${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=Hr;ue.replaceRecordOperation=Xr;function Hr(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function Xr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function Yr(e={}){return O().emit("tool:execute",e)}const Jr=Se(Ie("wrap-tool-response"));function Ot(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=Zr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=to),e.handleCloseForm===void 0&&(e.handleCloseForm=no),e.handleValidationResult===void 0&&(e.handleValidationResult=eo),{...n,label:n.title,callback(){var i;const t=typeof e.values=="function"?e.values(n,e):e.values,o=()=>Yr({name:n.name,values:t,usageContext:n.usageContext}).then(async a=>{var l,u;if(!Kr(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const s of e.handlers)await s(n,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(l=a.validationEffect)==null?void 0:l.results)!=null&&u.length)&&e.handleValidationResult(n,a.validationEffect,e),new Error(a.message);return a.message&&Ke.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(s=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,n,s,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),a}).catch(M("error"));return(i=e.overrides)!=null&&i[n.name]?e.overrides[n.name](n,e):n.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!n.confirmation||!e.handleConfirmation?o():e.handleConfirmation(n,o)}}}function Kr(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function Qr(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 Zr(e,n){const t=Qr(e.confirmation);if(!ne.getComponentFromStore(A.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ne.promptModal(A.MODAL_CONFIRM,{message:t}))return n()}function eo(e,n){const t=A.MODAL_VALIDATION_EFFECT;if(!ne.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ne.pushModal(t,n)})}function to(e,n,t){var s;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(Jr("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof F.Form&&c.dependencies.forEach(g=>i(g,f)))}me.emit("affected-entity",n);const{router:a,form:l}=t,u=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){me.emit("display-entity",{id:u,name:n.name}),I.getEntityLink&&a.push(I.getEntityLink(n.name,u));return}i(l,n.name)}function no(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}let te={};function Q(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 at(t,n);const o=F.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?at(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function at(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}Q.setGlobalVocabulary=function(e){te=e};Q.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Q.bind({vocabulary:F.utils.getPropFromObject(te,n.toLowerCase())})};Q.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(te,e)),Q.bind({vocabulary:e})};function ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},L={},Be={exports:{}},re={};function xt(){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 oo(e,n,t){}function io(e,n,t){}var ao=/javascript\s*\:/img;function so(e,n){return ao.test(n)?"":n}re.whiteList=xt();re.getDefaultWhiteList=xt;re.onAttr=oo;re.onIgnoreAttr=io;re.safeAttrValue=so;var lo={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=lo;function co(e,n){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function u(){if(!o){var f=pe.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var d=pe.trim(f.slice(0,g)),v=pe.trim(f.slice(g+1));if(d){var h=n(i,l.length,d,v,f);h&&(l+=h+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||u():s===`
|
|
7
|
-
`&&u()}return pe.trim(l)}var uo=co,ye=re,fo=uo;function st(e){return e==null}function po(e){var n={};for(var t in e)n[t]=e[t];return n}function $t(e){e=po(e||{}),e.whiteList=e.whiteList||ye.whiteList,e.onAttr=e.onAttr||ye.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ye.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ye.safeAttrValue,this.options=e}$t.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,u=fo(e,function(s,c,f,g,d){var v=o[f],h=!1;if(v===!0?h=v:typeof v=="function"?h=v(g):v instanceof RegExp&&(h=v.test(g)),h!==!0&&(h=!1),g=l(f,g),!!g){var T={position:c,sourcePosition:s,source:d,isWhite:h};if(h){var b=i(f,g,T);return st(b)?f+":"+g:b}else{var b=a(f,g,T);if(!st(b))return b}}});return u};var go=$t;(function(e,n){var t=re,o=go;function i(l,u){var s=new o(u);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)})(Be,Be.exports);var ze=Be.exports,He={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}},mo=ze.FilterCSS,ho=ze.getDefaultWhiteList,_e=He;function Ft(){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 Bt=new mo;function vo(e,n,t){}function yo(e,n,t){}function wo(e,n,t){}function bo(e,n,t){}function Dt(e){return e.replace(ko,"<").replace(To,">")}function Eo(e,n,t,o){if(t=jt(t),n==="href"||n==="src"){if(t=_e.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(we.lastIndex=0,we.test(t))return""}else if(n==="style"){if(lt.lastIndex=0,lt.test(t)||(ct.lastIndex=0,ct.test(t)&&(we.lastIndex=0,we.test(t))))return"";o!==!1&&(o=o||Bt,t=o.process(t))}return t=qt(t),t}var ko=/</g,To=/>/g,_o=/"/g,Co=/"/g,Ao=/&#([a-zA-Z0-9]*);?/gim,So=/:?/gim,Io=/&newline;?/gim,we=/((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,lt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ct=/u\s*r\s*l\s*\(.*/gi;function Pt(e){return e.replace(_o,""")}function Vt(e){return e.replace(Co,'"')}function Mt(e){return e.replace(Ao,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Ut(e){return e.replace(So,":").replace(Io," ")}function Wt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return _e.trim(n)}function jt(e){return e=Vt(e),e=Mt(e),e=Ut(e),e=Wt(e),e}function qt(e){return e=Pt(e),e=Dt(e),e}function No(){return""}function Ro(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:_e.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,u,s){if(o(l))if(s.isClosing){var c="[/removed]",f=s.position+c.length;return i.push([a!==!1?a:s.position,f]),a=!1,c}else return a||(a=s.position),"[removed]";else return n(l,u,s)},remove:function(l){var u="",s=0;return _e.forEach(i,function(c){u+=l.slice(s,c[0]),s=c[1]}),u+=l.slice(s),u}}}function Lo(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 Oo(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("")}L.whiteList=Ft();L.getDefaultWhiteList=Ft;L.onTag=vo;L.onIgnoreTag=yo;L.onTagAttr=wo;L.onIgnoreTagAttr=bo;L.safeAttrValue=Eo;L.escapeHtml=Dt;L.escapeQuote=Pt;L.unescapeQuote=Vt;L.escapeHtmlEntities=Mt;L.escapeDangerHtml5Entities=Ut;L.clearNonPrintableCharacter=Wt;L.friendlyAttrValue=jt;L.escapeAttrValue=qt;L.onIgnoreTagStripAll=No;L.StripTagBody=Ro;L.stripCommentTag=Lo;L.stripBlankChar=Oo;L.attributeWrapSign='"';L.cssFilter=Bt;L.getDefaultCSSWhiteList=ho;var Ne={},J=He;function xo(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 $o(e){return e.slice(0,2)==="</"}function Fo(e,n,t){var o="",i=0,a=!1,l=!1,u=0,s=e.length,c="",f="";e:for(u=0;u<s;u++){var g=e.charAt(u);if(a===!1){if(g==="<"){a=u;continue}}else if(l===!1){if(g==="<"){o+=t(e.slice(i,u)),a=u,i=u;continue}if(g===">"||u===s-1){o+=t(e.slice(i,a)),f=e.slice(a,u+1),c=xo(f),o+=n(a,o.length,c,f,$o(f)),i=u+1,a=!1;continue}if(g==='"'||g==="'")for(var d=1,v=e.charAt(u-d);v.trim()===""||v==="=";){if(v==="="){l=g;continue e}v=e.charAt(u-++d)}}else if(g===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Bo=/[^a-zA-Z0-9\\_:.-]/gim;function Do(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function u(d,v){if(d=J.trim(d),d=d.replace(Bo,"").toLowerCase(),!(d.length<1)){var h=n(d,v||"");h&&i.push(h)}}for(var s=0;s<l;s++){var c=e.charAt(s),f,g;if(a===!1&&c==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:Vo(e,s+1);continue}if(a!==!1&&s===o){if(g=e.indexOf(c,s+1),g===-1)break;f=J.trim(e.slice(o+1,g)),u(a,f),a=!1,s=g,t=s+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=Po(e,s),g===-1){f=J.trim(e.slice(t,s)),u(f),a=!1,t=s+1;continue}else{s=g-1;continue}else if(g=Mo(e,s-1),g===-1){f=J.trim(e.slice(t,s)),f=ut(f),u(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?u(e.slice(t)):u(a,ut(J.trim(e.slice(t))))),J.trim(i.join(" "))}function Po(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function Vo(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function Mo(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function Uo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ut(e){return Uo(e)?e.substr(1,e.length-2):e}Ne.parseTag=Fo;Ne.parseAttr=Do;var Wo=ze.FilterCSS,q=L,Gt=Ne,jo=Gt.parseTag,qo=Gt.parseAttr,ke=He;function be(e){return e==null}function Go(e){var n=ke.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=ke.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=ke.trim(e.slice(0,-1))),{html:e,closing:t}}function zo(e){var n={};for(var t in e)n[t]=e[t];return n}function Ho(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 zt(e){e=zo(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=q.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=Ho(e.whiteList||e.allowList):e.whiteList=q.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":q.attributeWrapSign,e.onTag=e.onTag||q.onTag,e.onTagAttr=e.onTagAttr||q.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||q.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||q.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||q.safeAttrValue,e.escapeHtml=e.escapeHtml||q.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Wo(e.css))}zt.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,u=t.onIgnoreTagAttr,s=t.safeAttrValue,c=t.escapeHtml,f=n.attributeWrapSign,g=n.cssFilter;t.stripBlankChar&&(e=q.stripBlankChar(e)),t.allowCommentTag||(e=q.stripCommentTag(e));var d=!1;t.stripIgnoreTagBody&&(d=q.StripTagBody(t.stripIgnoreTagBody,a),a=d.onIgnoreTag);var v=jo(e,function(h,T,b,m,y){var w={sourcePosition:h,position:T,isClosing:y,isWhite:Object.prototype.hasOwnProperty.call(o,b)},C=i(b,m,w);if(!be(C))return C;if(w.isWhite){if(w.isClosing)return"</"+b+">";var $=Go(m),B=o[b],E=qo($.html,function(p,k){var _=ke.indexOf(B,p)!==-1,R=l(b,p,k,_);return be(R)?_?(k=s(b,p,k,g),k?p+"="+f+k+f:p):(R=u(b,p,k,_),be(R)?void 0:R):R});return m="<"+b,E&&(m+=" "+E),$.closing&&(m+=" /"),m+=">",m}else return C=a(b,m,w),be(C)?c(m):C},c);return d&&(v=d.remove(v)),v};var Xo=zt;(function(e,n){var t=L,o=Ne,i=Xo;function a(u,s){var c=new i(s);return c.process(u)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var u in t)n[u]=t[u];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)})(Fe,Fe.exports);var Yo=Fe.exports;const Jo=ro(Yo);function Ko(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>'),Jo(e)}function Qo(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function Zo(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 Xe(e,n){return`/forms/${e}/${n}`}function Ht(e,n,t){const o=Q.getScope(e.toLowerCase());return n.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>ne.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{ne.openModal("form",{entity:ft(i,a),id:a[ge(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const l=i.name[0],u=a[l];return u?Xe(ft(i,a),u):null},i.value=(a,l)=>l[i.name[1]]),ei(i,i.type,i.presentation),I.listConvertCellConfigHandler&&I.listConvertCellConfigHandler(e,i),i))}function ei(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const ft=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function dt(e){return typeof e!="object"||e===null?null:e[A.TABLE_MOCK_FIELD]}function ti(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[A.TABLE_MOCK_FIELD]=n):e[A.TABLE_MOCK_FIELD]=e.Id,e)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ni(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function ri(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function Xt(e,n){e()&&(await n(),await Xt(e,n))}function oi(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(E=>c(E,i.value))),l=r.reactive([]);let u=0;const s=r.ref(!1);let c=(t==null?void 0:t.filterSearchFn)||((E,p)=>ri(E,p));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function g(){const E=C();return typeof E.limit!="number"&&(E.limit=100),E.offset=u,(t.request||ce)(e,E).then(k=>(u+=k.length,k))}function d(E,p){var _;return typeof E.Version=="number"?E.Version:(_=l.find(R=>R.Id===p))==null?void 0:_.Version}function v(E,p){const k=l.findIndex(_=>_.Id===E);if(k===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(k,1,p)}function h(E){const p=l.findIndex(k=>k.Id===E);if(p===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(p,1)}async function T(E,p){try{const k=C(),_=d(p,E);delete p.Version,await Ge(e,{id:E,values:p,version:_,masterEntities:f()});const R=await ce(e,{fields:k.fields||"",id:E});v(E,R)}catch(k){M()(k)}}async function b(E,p={}){try{const k=C(),_=d(p,E);delete p.Version,await Nt(e,{id:E,version:_,masterEntities:f()}),h(E)}catch(k){M()(k)}}async function m(E){try{await It(e,{values:E,masterEntities:f()}),await $()}catch(p){M()(p)}}let y;async function w(){s.value=!0;try{y!=null&&y.signal&&!y.signal.aborted&&y.abort();let E=y=new AbortController,p=0;const _=C().limit||0;if(i.value&&!_){console.warn("Using textSearch assumes the use of limit.");return}await Xt(()=>(_>0?p<_:!0)&&!o&&!E.signal.aborted,async()=>{const R=await g();E.signal.aborted||(l.push(...R),p+=R.filter(V=>c(V,i.value)).length,(R.length<_||_===0)&&(o=!0))})}catch(E){M()(E)}s.value=!1}function C(){return typeof n=="function"?n():n}async function $(){try{u=0,o=!1,l.splice(0,l.length),await w()}catch(E){M()(E)}}function B(){if(y)return y.abort();s.value=!1}return{array:l,updateById:T,next:w,reload:$,wait:s,create:m,deleteById:b,textSearch:i,filteredArray:a,abort:B}}function ii(){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 ai(e,n,t){return O().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function si(e,n,t){return O().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function li(e,n){return O().emit("communication-message:create",{communicationId:e,text:n})}function ci(e){return O().emit("communication-message:read",{communicationId:e})}function ui(e){const n=F.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>ci(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 K.EntityWithoutName(e);return ce(e.name,o)}).then(Qe).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 K.EntityWithoutName(e);return Ge(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 Re(e){if(!e)return r.inject(A.PROVIDE_NAME_METADATA);Ce.initEntity(e);const n=r.computed(()=>Ce.state[e]);return r.provide(A.PROVIDE_NAME_METADATA,n),n}function Je(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 Wr(e,di(n||{}))}}}function di(e){return typeof e=="function"?e():e}function pi(e){if(!e)return r.inject(A.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Ot(e,l))),i={actions:o,update:a};r.provide(A.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return Rt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(u=>t.splice(0,0,...u)).catch(M("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function gi(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function mi(e,n={}){const t=r.reactive([]),o=s=>{const c=r.unref(e);if(s===void 0){t.length===0?c.forEach(a):c.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 c=t.findIndex(f=>f===s);c!==-1&&t.splice(c,1)},u=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,u,a,l]}function hi(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 xe{static async getStartConfig(n,t){return O().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return O().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return O().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function vi(e){return e.statusName===P.Completed}function yi(e){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(e.statusName)}function wi(e){return e.statusName===P.ValidationError}function bi(e){return e.statusName===P.Undefined}function Ei(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),u=r.computed(()=>g(i,l.value)),s=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(y=>g(i,y)));function g(y,w){return y.find(C=>C.name===w)||null}async function d(y){var w;if(bi(y)){await t.onDisplayDataSet(y);return}if(!(yi(y)&&!await t.onDisplayDataSet(y))){if(wi(y))return void t.onValidation(y.validationResults);T(y),await r.nextTick();{const C=((w=g(i,l.value))==null?void 0:w.fields)||[];if([P.FinalStep,P.NextStep,P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(y.statusName)&&(!C.length||ki(C,t.presets)))return m(t.presets||{})}vi(y)&&t.onCompleted(y)}}async function v(){try{await h(),await b()}catch(y){M("error")(y)}}function h(){return a.value="Loading process information.",xe.getStartConfig(n,e).then(y=>(s.value={label:y.processTitle,info:y.processInfo,icon:y.processIcon},i=y.steps.map(w=>{const C=w.frontendEntity.rootObject,$=Object.fromEntries(w.frontendEntity.objectTypes.map(B=>[B.name,B.properties]));return{label:w.title,name:w.stepName,number:w.number,rootObjectName:C,objectTypes:$,fields:$[C],buttonCaption:w.buttonCaption}}))).finally(()=>{a.value=!1})}function T(y){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation,P.NextStep,P.Completed,P.FinalStep].includes(y.statusName)?(o=y.token,l.value=y.nextStepName):console.log("Saving is not completed:",y),y}function b(){return a.value="Starting process",xe.startProcess(n,e).then(d).catch(M("error")).finally(()=>{a.value=null})}function m(y={}){const w=l.value;return!o||!w?Promise.reject("Not step or token."):(a.value="Waiting for result...",xe.runStep(n,e,w,o,y).then(d).then(C=>(c[c.length-1]!==w&&c.push(w),C)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:v,loading:a,currentStepConfig:u,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:s,next:m}}function ki(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}const Ke=new class{constructor(){this.store=r.reactive([])}add(n,t,o={}){const i=Ti(o),a=new De(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 Ti(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 Ae=class Ae{constructor(n,t,o,i,a){this.type=n,this.message=t,this.timeout=o,this.children=i,this.click=a,this.id=Ae.cardId++}};Ae.cardId=1;let De=Ae;/*!
|
|
5
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),Ve=require("vue-router"),F=require("jenesius-vue-form"),Kt=require("date-and-time"),Se=require("debug"),re=require("jenesius-vue-modal"),N=class N extends Error{constructor(n,t=null){super(),this.message=n,this.details=t,this.id=N.ID++}static ParentFormNotFound(){return new N("Can't found parent form.")}static UndefinedNameOfCompositeFormController(n){return new N("Composite object name is undefined",n)}static EntityWithoutName(n){return new N("'Entity doesn't have a name",n)}static NotResolvedNameEventEmitter(n){return new N(`'${n}' is not a valid Event emitter name`)}static FormIsNotValidated(n){return new N("Form is not validated",n)}static ListWorkerIsRunningOrEnd(n){return new N("List data request is running or already done",n)}static ObjectIdNotNumber(n){return new N(`${n} (id) is not a number`)}static UndefinedErrorId(n,t){return N.ApiNotAvailable()}static ApiError(n){return new N("Request error",n)}static ApiNotAvailable(){return new N(`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?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 Z=N;const Qt="Please try again later or submit a feedback if problem doesn't go.";function Zt(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return Qt}})}function le(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=>Zt(t).then(o=>{if(!t.ok)throw o;return o}))}class en{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 en;class tn{static invite(n,t,o){return le("/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 le("/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 le("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class nn{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 se{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${se.url()}/calculator/${n}`)}static calculate(n,t){return le(`/${se.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 le(`/${se.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return le(`/${se.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const rn={class:"widget-table__head-cell"},on={class:"widget-table__head-label margin_0 text_overflow"},vt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("th",rn,[r.createElementVNode("span",on,r.toDisplayString(n.label),1)]))}}),an={class:"widget-table__head"},sn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>I.componentTableHeadCell||vt),(n,t)=>(r.openBlock(),r.createElementBlock("tr",an,[(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))]))}}),W=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},ln=W(sn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function ge(e){return Me(e.name)}function cn(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 un(e,n){return cn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),F.utils.getPropFromObject(n,o))}),e}function Be(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Ue(e,n){const t=ge(e);if(typeof e.value=="string")return un(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=Be(e.unitValue)(o)),e.unit&&(o=Be(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Te(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Tt(typeof o=="string"?o:null);break}case"money":{o=_t(o);break}case"DateTime":{o=Te(typeof o=="string"?o:null,e.format||I.dateTimeFormat);break}}return e.formatter&&(o=de(e.formatter).exec(o,n)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const fn=1,dn=5e3,pn="static-folder",yt="request-error",wt="Distinguisher",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",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:wt};function Ie(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const gn={class:"widget-filter-text flex gap_20"},mn=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,u)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",gn,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),hn=W(mn,[["__scopeId","data-v-800b3803"]]),vn={class:"widget-filter-enum"},yn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=Re(t.fieldMetadata.entity),a=c=>(t.values||[]).includes(c),l=n;function u(c){const f=t.values||[];return f.includes(c)?l("update:values",f.filter(p=>p!==c)):l("update:values",[...f,c])}async function s(){var p;if(!((p=t.fieldMetadata)!=null&&p.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;l("readProcess","start"),o.value=await fe(t.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(l("readProcess","end"),d.map(v=>({label:v[c],value:v[f]}))))}return r.watch(()=>i.value,s,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",vn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,p=>(r.openBlock(),r.createBlock(r.unref(F.FormField),{class:"widget-filter-enum-item",key:p.value,onClick:()=>u(p.value),type:"single-checkbox","model-value":a(p.value),label:p.label},null,8,["onClick","model-value","label"]))),128))]))}}),wn=W(yn,[["__scopeId","data-v-cf143196"]]),I={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:hn,Entity:wn}};function bn(e){for(let n in e)I[n]=e[n]}const En={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))}},ue=W(En,[["__scopeId","data-v-8a72b45f"]]),kn=Se(Ie("setup-list-row"));function Tn(e,n){const t=e.config.map(o=>Cn(o,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function Cn(e,n,t){const o=n.values;let i=Ue(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 u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(F.FormField,{type:"single-checkbox",modelValue:n.selected})),l(rt.bind(null,t,!0));break}case"select":{c.push(r.h(F.FormField,{type:"single-radio",modelValue:n.selected})),l(rt.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const p=r.h(Ve.RouterLink,{to:f});c.push(p),u("widget-table-cell_link")}}catch(f){kn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(ue,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(ue,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),I.listCellHandler&&I.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:l,context:t}),s.push(r.h("td",a,c)),s}function rt(e,n){e.emit("select",n)}function We(e,n){return()=>{try{return Tn(e,n)}catch(t){return console.warn(t),null}}}const _n={props:{values:Object,config:Object,selected:Boolean},setup:We},An=["colspan"],ot=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,An)],512))}}),Sn={class:"widget-table"},it="update:selectedRows",In="update:activeRow",bt=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 d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function l(d){return t.useMockField?dt(d):d}function u(d,v=!0){if(!t.selectedRows)return;if(!v)return o(it,t.selectedRows.includes(d)?[]:[d]);const m=[...t.selectedRows],T=m.indexOf(d);return T===-1?m.push(d):m.splice(T,1),o(it,m)}function s(d){o(In,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>t.shortcut?t.config.filter(d=>d.name?!!t.array.find(m=>![null,""].includes(Ue(d,m))):!0):t.config),p=r.computed(()=>t.useMockField?t.array.filter(dt):t.array);return(d,v)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Sn,[r.createElementVNode("thead",null,[r.createVNode(ln,{config:f.value,onOrder:v[0]||(v[0]=m=>d.$emit("order",m))},{default:r.withCtx(m=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||vt),r.normalizeProps(r.guardReactiveProps(m)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,(m,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createVNode(_n,{config:f.value,values:m,selected:d.selectedRows.includes(l(m)),onSelect:b=>u(l(m),b),onActivate:b=>s(l(m)),class:r.normalizeClass(d.classCallback?d.classCallback(m):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===l(m)?(r.openBlock(),r.createBlock(ot,{key:0,component:a.value,"row-length":d.config.length,values:m,onClose:v[1]||(v[1]=b=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(S).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(ot,{key:0,component:a.value,"row-length":f.value.length,onClose:v[2]||(v[2]=m=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Nn=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))}}),oe=W(Nn,[["__scopeId","data-v-0ef9ae88"]]),Rn={class:"widget-button"},On=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Rn,[n.wait?(r.openBlock(),r.createBlock(oe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),Ln=W(On,[["__scopeId","data-v-450dc564"]]),xn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Bn={class:"widget-multi-button-body grid"},$n=["onClick"],Fn={class:"widget-multi-button-side-wrap"},Dn=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,u)=>(r.openBlock(),r.createElementBlock("div",xn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Bn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,$n))),128))]),r.createElementVNode("div",Fn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(oe),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(ue),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Pn=W(Dn,[["__scopeId","data-v-d43a76ce"]]),Vn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Mn={class:"text_md"},Un=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Vn,[r.createVNode(oe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Mn,r.toDisplayString(n.label),1)]))}}),Wn=["alt","src"],jn=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,Wn))}}),qn={props:{config:Array,values:Object,selected:Boolean},setup:We},Gn=W(qn,[["__scopeId","data-v-344a8cc1"]]),zn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Hn={class:"widget-list-head-cell"},Xn=zn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Yn=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",Hn,[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(ue),{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),Xn])]))}}),Jn=W(Yn,[["__scopeId","data-v-bf495d6a"]]),Kn=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 c(m,T){let b=-1;do b++,T-=m[b];while(T>0&&b<m.length);return b}function f(m,T){let b=0;for(;T>0&&T>m[b]&&b<m.length;)T-=m[b],b++;return console.log(T,b),b>0?b:0}function p(m){try{a.value.style.insetInlineStart=m+"px"}catch(T){console.log(T)}}function d(m){try{a.value.style.width=m+"px",a.value.style.minWidth=m+"px",a.value.style.maxWidth=m+"px"}catch(T){console.log(T)}}function v(m){return m===null?!1:m.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(T){var J;function b(L){return L.screenX+w-D}const g=i.value,y=[...g.children].filter(L=>L.localName==="th"),w=((J=g.offsetParent)==null?void 0:J.scrollLeft)||0,_=y.map(L=>L.clientWidth),$=v(T.target),D=g.getBoundingClientRect().left,E=b(T),k=c(_,E),h=_.slice(0,k).reduce((L,O)=>L+O,0),C=E-h,A=g.offsetWidth,P=y[k].clientWidth;if(t.config[k].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",_),console.log("max width",A),console.log("Start Position",E),console.log("Position From",k),console.log("Start Position",k),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",C),console.groupEnd(),a.value.innerText=y[k].textContent||"",a.value.style.display="grid",a.value.style.width=P+"px",a.value.style.cursor="grabbing",p(h),d(P),document.addEventListener("pointermove",ae,{passive:!0}),document.addEventListener("pointerup",X);function X(L){if(console.group("END"),document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",X),$&&(t.config[k].width=a.value.style.width,t.config[k].minWidth=a.value.style.width,t.config[k].maxWidth=a.value.style.width,l(t.config)),!$){const O=L.screenX+w-D;console.log("ENP Position",O);const G=f(_,O);if(console.log(k,"->",G),G!==k){const K=t.config[k],Oe=t.config;Oe.splice(k,1),Oe.splice(G,0,K),l(Oe)}else{const K=t.config[k].name;u(K)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ae(L){if($){const K=b(L)-E+P;d(K);return}let O=L.screenX+w-D-C;O<0&&(O=0),O+P>A&&(O=A-P),p(O)}})});function l(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void s([c]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([c,f==="asc"?"desc":"asc"])}function s(c){o("update:order",c)}return(c,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(c.config,(p,d)=>(r.openBlock(),r.createBlock(Jn,r.mergeProps({key:p,ref_for:!0},p,{onOrder:v=>u(p.name),onSelect:f[0]||(f[0]=v=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),Qn=W(Kn,[["__scopeId","data-v-ccffc6bd"]]),Zn={class:"widget-list"},er={class:"widget-list-body position_relative"},tr=50,nr=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,c=!0){if(t.selectedRows)if(!c)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],p=f.indexOf(s);p===-1?f.push(s):f==null||f.splice(p,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 u(s){if(!s)return;const c=s.target;c.scrollTop+c.clientHeight+tr>c.scrollHeight&&o("scrollEnd")}return(s,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",Zn,[r.createElementVNode("thead",null,[r.createVNode(Qn,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",er,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,p)=>{var d;return r.openBlock(),r.createBlock(Gn,{key:p,class:"widget-list-row",values:f,config:s.config,selected:(d=s.selectedRows)==null?void 0:d.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(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 rr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const n=e,t=Re(),o=Je(),i=r.computed(()=>{var T,b;const d=s.value,v=c(d),m={type:v,disabled:!((T=u.value)!=null&&T.canSet),label:n.label};return d&&Object.assign(m,{suffix:v==="number"?d.valueUnit:void 0,required:l.includes(v||"")?!1:d.required,label:n.label||d.displayName}),Object.assign(m,((b=I.fieldParamsHandler)==null?void 0:b.call(I,d,u.value,m))||{}),m}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const d=t.value.fieldsByName[n.name];if(d)return d});function c(d){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:p}=je();return r.watch(()=>f.value,d=>d?p.show():p.hide(),{immediate:!0}),r.onUnmounted(()=>p.remove()),(d,v)=>f.value?(r.openBlock(),r.createBlock(r.unref(F.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function or(e){return Array.isArray(e)&&(e==null?void 0:e[1])||S.DEFAULT_ORDER_DIR}const ir=["fill"],ar=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),sr=[ar],lr=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},sr,8,ir))}}),cr={class:"widget-fast-table-head-cell-td"},ur={class:"widget-head-cell-label"},fr={key:0,class:"widget-head-cell-order"},dr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const n=e,t=r.computed(()=>Me(n.name));return r.computed(()=>or(n.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",cr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=l=>o.$emit("order",o.name))},[r.createElementVNode("span",ur,r.toDisplayString(o.label),1),t.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",fr,[r.createVNode(lr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Et=W(dr,[["__scopeId","data-v-9db5d417"]]),pr=["fill"],gr=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),mr=[gr],hr=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},mr,8,pr))}}),vr={class:"widget-filter-item-popup"},yr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=I.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const v=t.filterItem;return v.entity?"Entity":v.type?v.type:null});function u(v){s.value=v==="start"}const s=r.ref(!1),c=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let p=null;function d(v=!f.value){f.value=v,!f.value&&p?(p(),p=null):a.value&&(p=F.utils.clickOutside(a.value,d.bind(null,!1)))}return(v,m)=>{var T;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:m[0]||(m[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(v.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(oe,{key:0})):(r.openBlock(),r.createBlock(hr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",vr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((T=r.unref(i))==null?void 0:T[l.value]),{key:0,"field-metadata":v.filterItem,values:v.values,"onUpdate:values":m[1]||(m[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),kt=W(yr,[["__scopeId","data-v-5b9128bc"]]),wr={class:"widget-table-panel-filter flex"},br=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",wr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,s)=>{var c;return r.openBlock(),r.createBlock(kt,{key:s,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(ge)(u)],"onUpdate:values":f=>i(r.unref(ge)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Er=W(br,[["__scopeId","data-v-f1534314"]]),kr={class:"es-grid es-gap-15"},Tr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Cr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},_r=r.createElementVNode("span",null,"Loading...",-1),Ar={class:"widget-fast-table-tools es-flex es-gap-15"},Sr={class:""},Ir=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e,o=Ve.useRouter(),i=r.ref([]),a=r.ref(null),l=r.ref(null),u=r.ref(null),s=F.Form.getParentForm();Re(t.entity);const{state:c,update:f}=Je(t.entity,{masterEntities:t.masterEntities||[]}),p=(t.actions||[]).map(h=>Ot(h)),d=r.computed(()=>a.value?Ht(t.entity,a.value.config):[]),v=r.computed(()=>{var h;return((h=a.value)==null?void 0:h.displayItem)||Ye.inline}),m=r.computed(()=>{var h;return((h=a.value)==null?void 0:h.newItem)||v.value}),T=Ee(async()=>{try{await g.call(),await f()}catch(h){const{message:C}=qe(h);l.value=C}});s instanceof F.Form&&s.subscribe({read:T.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{b.call(),T.call()});const b=Ee(async function(){const C=t.entity;a.value=await St(C,t.mark)}),g=Ee(async function(){var A,P,X;const C=t.entity;l.value=null,b.promise&&await b.promise,i.value=(await fe(C,{customFilters:((A=a.value)==null?void 0:A.customFilters)||[],fields:Ct(d.value).join(" "),order:((P=a.value)==null?void 0:P.order)||[],filter:B.and(B(E.value),B(t.binding||{}),B(((X=a.value)==null?void 0:X.prefilters)||{}))})).map(ti)});async function y(h){var A;if(h===null)return u.value=null;const C=h==null?void 0:h.Id;if(!C&&((A=a.value)!=null&&A.linkNew))return o.push(a.value.linkNew);if(v.value==="form")return o.push(Xe(t.entity,C));if(v.value==="inline")return u.value=h||S.LIST_ACTIVE_NEW;v.value==="modal"?(await re.promptModal("form",{entity:t.entity,id:C}),await g.call()):u.value=S.LIST_ACTIVE_NEW}const{controller:w}=je();r.watch(()=>c.value,h=>{h&&(h.canRead?w.show():w.hide())},{immediate:!0}),r.onUnmounted(()=>w.remove());const _={icon:"reload",label:"Reload",callback(){T.call()}};let $=[me.on("affected-entity",h=>{h.name===t.entity&&g.call()}),me.on("display-entity",async h=>{h.name===t.entity&&(g.promise&&await g.promise,u.value=i.value.find(C=>C.Id===h.id)||null)})];r.onUnmounted(()=>$.map(h=>h()));function D(h){var J;function C(L){return Array.isArray(L)?C(L[0]):typeof L!="string"?null:L}const A=C(h);if(!A)return;const P=((J=a.value)==null?void 0:J.order)||[];(L=>{if(a.value)return a.value.order=L,!0})(P[0]!==A?[A,"asc"]:P[1]==="desc"?[]:[A,"desc"])&&g.call()}const E=r.ref({});r.watch(()=>E.value,()=>g.call()),n({listSettings:a,array:i,config:d});const k=r.computed(()=>T.wait||b.wait||g.wait);return(h,C)=>{var X,ae,J,L;const A=r.resolveComponent("widget-button"),P=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",kr,[(X=a.value)!=null&&X.label&&!h.hideLabel?(r.openBlock(),r.createElementBlock("p",Tr,r.toDisplayString((ae=a.value)==null?void 0:ae.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(T).wait||r.unref(b).wait||r.unref(g).wait?(r.openBlock(),r.createElementBlock("div",Cr,[r.createVNode(r.unref(oe),{color:"var(--color-primary)"}),_r])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Ar,[m.value==="form"||(J=r.unref(c))!=null&&J.canCreate?(r.openBlock(),r.createBlock(A,{key:0,callback:y,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(p).filter(O=>!!O.value),O=>{var G;return r.openBlock(),r.createBlock(A,{callback:(G=O.value)==null?void 0:G.callback,type:"primary"},{default:r.withCtx(()=>{var K;return[r.createTextVNode(r.toDisplayString((K=O.value)==null?void 0:K.label),1)]}),_:2},1032,["callback"])}),256)),r.createVNode(A,{onClick:C[0]||(C[0]=()=>_.callback()),callback:_.callback},{default:r.withCtx(()=>[k.value?(r.openBlock(),r.createBlock(r.unref(oe),{key:0,color:"var(--color-primary)"})):(r.openBlock(),r.createBlock(ue,{key:1},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(_.icon),1)]),_:1})),r.createElementVNode("span",null,r.toDisplayString(_.label),1)]),_:1},8,["callback"])]),r.createElementVNode("div",Sr,[r.createVNode(Er,{entity:h.entity,"filters-config":((L=a.value)==null?void 0:L.filters)||[],filters:E.value,"onUpdate:filters":C[1]||(C[1]=O=>E.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(bt),{config:d.value,array:i.value,"active-row":u.value,"onUpdate:activeRow":y,onOrder:D,class:"table"},{"head-cell":r.withCtx(O=>{var G;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.$slots["head-cell"]?h.$slots["head-cell"]:Et),r.mergeProps({label:O.label},O,{onOrder:D,order:((G=a.value)==null?void 0:G.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(P,{entity:h.entity,id:(O=u.value)==null?void 0:O.Id,"master-entities":h.masterEntities||void 0,binding:h.binding,onFormUpdate:C[2]||(C[2]=()=>{u.value=null,r.unref(g).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function Tt(e){return Te(e,"YYYY/MM/DD HH:mm:ss")}function Te(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return Kt.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function Ee(e){function n(...o){if(t.wait)return Promise.reject("The process has already started.");t.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{t.wait=!1,t.promise=null});return t.promise=i,i}const t=r.reactive({wait:!1,call:n,promise:null});return t}function qe(e){return typeof e=="string"?ve(e):Nr(e)?ve(e.message,e.children||e.details||[]):Rr(e)?ve(e.title,[e.detail||""]):ve(S.DEFAULT_ERROR_MESSAGE)}function Nr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Rr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function ve(e,n=[]){return{message:e,children:n}}function M(e="error"){return function(n){const{message:t,children:o}=qe(n);Ke.add(e,t,{children:o})}}function fe(e,n={}){return x().emit("entity:read",{...n,entity:e})}function Ge(e,n){return x().emit("entity:update",{...n,entity:e})}function Ct(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function _t(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 Or(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 Lr(){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 S.DEFAULT_ERROR_MESSAGE}})}function U(e,n={}){return q.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=q.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=>xr(t).then(o=>{if(!t.ok)throw o;return o}))}function Br(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function $r(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Fr=Se(Ie("pretty-value-field-by-entity"));function Dr(e,n,t){try{const o=_e.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 Fr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const te=Se(Ie("use-socket"));function x(){return Vr}function Pr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Vr=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()},dn*2);const g=new Uint8Array(1);g[0]=fn,n.send(g)}setInterval(()=>{Array.from(o).forEach(g=>{b(g)&&(te("Handler for event %s requestId %d was expired",g.event,g.requestId),g.requestId?s({requestId:g.requestId,event:yt,data:{message:Z.RequestTookToLong().message}}):o.delete(g))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&c()},S.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(g){const y=[...o.values()];te("Handlers array length is %d. Response event: %s. Request id: %d",o.size,g.event,g.requestId),y.forEach(w=>{const _=g.requestId;(w.requestId&&w.requestId===_||!w.requestId&&w.event===g.event)&&(te("Find appropriated handler: %d, event: %s",e,w.event),w.callback(g.data,g),w.once&&(o.delete(w),te("Handler was removed by *once* params was passed. %o",w)))})}function c(){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(g){te("Connection to server was stopped: %d %s",g.code,g.reason),Array.from(o).forEach(y=>{y.guaranteedAnswer&&y.serializeString&&a.add(y.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(g=>{f(g),a.delete(g)})},n.onerror=function(g){console.warn(g)},n.onmessage=g=>{var y;try{if(Pr(g.data)){l();return}const w=JSON.parse(g.data);if(!At(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(y=w==null?void 0:w.data)!=null&&y.refresh&&location.reload(),s(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}function f(g){n.send(g)}function p(g,y){T({event:g,callback:y})}function d(g,y){T({event:g,callback:y,once:!0})}function v(){return n&&(n==null?void 0:n.readyState)===1}function m(g,y,w){const _=++e,$=JSON.stringify({requestId:_,event:g,data:y,contextId:q.contextId,url:I.socketURLHandler?I.socketURLHandler():window.location.href});return v()?f($):(a.add($),te("Socket is not connected. Message was send to save-queue")),new Promise((D,E)=>{T({event:g,requestId:_,once:!0,guaranteedAnswer:!0,serializeString:$,callback:(k,h)=>{if(te("Promise was resolve with next data:",k),Mr(h))return void E(k);w&&w(k,h),D(k)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(g){const y={timeToLive:0,...g,created:new Date().getTime()};o.add(y)}function b(g){return g.timeToLive===0||typeof g.timeToLive!="number"?!1:new Date().getTime()-g.created>g.timeToLive}return{get socket(){return n},on:p,once:d,emit:m,initialization(g){t=g},getDevInfo:u}}(),Mr=e=>!!At(e)&&e.event===yt,At=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function St(e,n){return x().emit("list-setting:read",{entity:e,mark:n})}function Ur(e,n){return x().emit("metadata-field:treat",{entity:e,fieldName:n})}function It(e,n){return x().emit("entity:create",{...n,entity:e})}function Nt(e,n){return x().emit("entity:delete",{...n,entity:e})}function Wr(e,n){return x().emit("usage-context:read",{...n,entity:e})}function Rt(e={}){return x().emit("tool:read",e)}function jr(){return x().emit("metadata-list:read",{})}function Ot(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 u=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function qr(e){return x().emit("history:read",e)}function Gr(e,n){return x().emit("entity:count",{...n,entity:e})}function zr(e){return`/${pn}/${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=Hr;de.replaceRecordOperation=Xr;function Hr(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function Xr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function Yr(e={}){return x().emit("tool:execute",e)}const Jr=Se(Ie("wrap-tool-response"));function Lt(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=Zr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=to),e.handleCloseForm===void 0&&(e.handleCloseForm=no),e.handleValidationResult===void 0&&(e.handleValidationResult=eo),{...n,label:n.title,callback(){var i;const t=typeof e.values=="function"?e.values(n,e):e.values,o=()=>Yr({name:n.name,values:t,usageContext:n.usageContext}).then(async a=>{var l,u;if(!Kr(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const s of e.handlers)await s(n,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(l=a.validationEffect)==null?void 0:l.results)!=null&&u.length)&&e.handleValidationResult(n,a.validationEffect,e),new Error(a.message);return a.message&&Ke.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(s=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,n,s,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),a}).catch(M("error"));return(i=e.overrides)!=null&&i[n.name]?e.overrides[n.name](n,e):n.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!n.confirmation||!e.handleConfirmation?o():e.handleConfirmation(n,o)}}}function Kr(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function Qr(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 Zr(e,n){const t=Qr(e.confirmation);if(!re.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(S.MODAL_CONFIRM,{message:t}))return n()}function eo(e,n){const t=S.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(t,n)})}function to(e,n,t){var s;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(Jr("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof F.Form&&c.dependencies.forEach(p=>i(p,f)))}me.emit("affected-entity",n);const{router:a,form:l}=t,u=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){me.emit("display-entity",{id:u,name:n.name}),I.getEntityLink&&a.push(I.getEntityLink(n.name,u));return}i(l,n.name)}function no(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}let ne={};function ee(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)||ne,e);if(typeof t=="string")return at(t,n);const o=F.utils.getPropFromObject(ne==null?void 0:ne.root,e);return typeof o=="string"?at(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function at(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}ee.setGlobalVocabulary=function(e){ne=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:F.utils.getPropFromObject(ne,n.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(ne,e)),ee.bind({vocabulary:e})};function ro(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $e={exports:{}},R={},Fe={exports:{}},ie={};function xt(){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 oo(e,n,t){}function io(e,n,t){}var ao=/javascript\s*\:/img;function so(e,n){return ao.test(n)?"":n}ie.whiteList=xt();ie.getDefaultWhiteList=xt;ie.onAttr=oo;ie.onIgnoreAttr=io;ie.safeAttrValue=so;var lo={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=lo;function co(e,n){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function u(){if(!o){var f=pe.trim(e.slice(i,a)),p=f.indexOf(":");if(p!==-1){var d=pe.trim(f.slice(0,p)),v=pe.trim(f.slice(p+1));if(d){var m=n(i,l.length,d,v,f);m&&(l+=m+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||u():s===`
|
|
7
|
+
`&&u()}return pe.trim(l)}var uo=co,ye=ie,fo=uo;function st(e){return e==null}function po(e){var n={};for(var t in e)n[t]=e[t];return n}function Bt(e){e=po(e||{}),e.whiteList=e.whiteList||ye.whiteList,e.onAttr=e.onAttr||ye.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ye.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ye.safeAttrValue,this.options=e}Bt.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,u=fo(e,function(s,c,f,p,d){var v=o[f],m=!1;if(v===!0?m=v:typeof v=="function"?m=v(p):v instanceof RegExp&&(m=v.test(p)),m!==!0&&(m=!1),p=l(f,p),!!p){var T={position:c,sourcePosition:s,source:d,isWhite:m};if(m){var b=i(f,p,T);return st(b)?f+":"+p:b}else{var b=a(f,p,T);if(!st(b))return b}}});return u};var go=Bt;(function(e,n){var t=ie,o=go;function i(l,u){var s=new o(u);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)})(Fe,Fe.exports);var ze=Fe.exports,He={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}},mo=ze.FilterCSS,ho=ze.getDefaultWhiteList,Ce=He;function $t(){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 Ft=new mo;function vo(e,n,t){}function yo(e,n,t){}function wo(e,n,t){}function bo(e,n,t){}function Dt(e){return e.replace(ko,"<").replace(To,">")}function Eo(e,n,t,o){if(t=jt(t),n==="href"||n==="src"){if(t=Ce.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(we.lastIndex=0,we.test(t))return""}else if(n==="style"){if(lt.lastIndex=0,lt.test(t)||(ct.lastIndex=0,ct.test(t)&&(we.lastIndex=0,we.test(t))))return"";o!==!1&&(o=o||Ft,t=o.process(t))}return t=qt(t),t}var ko=/</g,To=/>/g,Co=/"/g,_o=/"/g,Ao=/&#([a-zA-Z0-9]*);?/gim,So=/:?/gim,Io=/&newline;?/gim,we=/((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,lt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ct=/u\s*r\s*l\s*\(.*/gi;function Pt(e){return e.replace(Co,""")}function Vt(e){return e.replace(_o,'"')}function Mt(e){return e.replace(Ao,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Ut(e){return e.replace(So,":").replace(Io," ")}function Wt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return Ce.trim(n)}function jt(e){return e=Vt(e),e=Mt(e),e=Ut(e),e=Wt(e),e}function qt(e){return e=Pt(e),e=Dt(e),e}function No(){return""}function Ro(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:Ce.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,u,s){if(o(l))if(s.isClosing){var c="[/removed]",f=s.position+c.length;return i.push([a!==!1?a:s.position,f]),a=!1,c}else return a||(a=s.position),"[removed]";else return n(l,u,s)},remove:function(l){var u="",s=0;return Ce.forEach(i,function(c){u+=l.slice(s,c[0]),s=c[1]}),u+=l.slice(s),u}}}function Oo(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 Lo(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("")}R.whiteList=$t();R.getDefaultWhiteList=$t;R.onTag=vo;R.onIgnoreTag=yo;R.onTagAttr=wo;R.onIgnoreTagAttr=bo;R.safeAttrValue=Eo;R.escapeHtml=Dt;R.escapeQuote=Pt;R.unescapeQuote=Vt;R.escapeHtmlEntities=Mt;R.escapeDangerHtml5Entities=Ut;R.clearNonPrintableCharacter=Wt;R.friendlyAttrValue=jt;R.escapeAttrValue=qt;R.onIgnoreTagStripAll=No;R.StripTagBody=Ro;R.stripCommentTag=Oo;R.stripBlankChar=Lo;R.attributeWrapSign='"';R.cssFilter=Ft;R.getDefaultCSSWhiteList=ho;var Ne={},Q=He;function xo(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 Bo(e){return e.slice(0,2)==="</"}function $o(e,n,t){var o="",i=0,a=!1,l=!1,u=0,s=e.length,c="",f="";e:for(u=0;u<s;u++){var p=e.charAt(u);if(a===!1){if(p==="<"){a=u;continue}}else if(l===!1){if(p==="<"){o+=t(e.slice(i,u)),a=u,i=u;continue}if(p===">"||u===s-1){o+=t(e.slice(i,a)),f=e.slice(a,u+1),c=xo(f),o+=n(a,o.length,c,f,Bo(f)),i=u+1,a=!1;continue}if(p==='"'||p==="'")for(var d=1,v=e.charAt(u-d);v.trim()===""||v==="=";){if(v==="="){l=p;continue e}v=e.charAt(u-++d)}}else if(p===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Fo=/[^a-zA-Z0-9\\_:.-]/gim;function Do(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function u(d,v){if(d=Q.trim(d),d=d.replace(Fo,"").toLowerCase(),!(d.length<1)){var m=n(d,v||"");m&&i.push(m)}}for(var s=0;s<l;s++){var c=e.charAt(s),f,p;if(a===!1&&c==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:Vo(e,s+1);continue}if(a!==!1&&s===o){if(p=e.indexOf(c,s+1),p===-1)break;f=Q.trim(e.slice(o+1,p)),u(a,f),a=!1,s=p,t=s+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(p=Po(e,s),p===-1){f=Q.trim(e.slice(t,s)),u(f),a=!1,t=s+1;continue}else{s=p-1;continue}else if(p=Mo(e,s-1),p===-1){f=Q.trim(e.slice(t,s)),f=ut(f),u(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?u(e.slice(t)):u(a,ut(Q.trim(e.slice(t))))),Q.trim(i.join(" "))}function Po(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function Vo(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function Mo(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function Uo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ut(e){return Uo(e)?e.substr(1,e.length-2):e}Ne.parseTag=$o;Ne.parseAttr=Do;var Wo=ze.FilterCSS,j=R,Gt=Ne,jo=Gt.parseTag,qo=Gt.parseAttr,ke=He;function be(e){return e==null}function Go(e){var n=ke.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=ke.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=ke.trim(e.slice(0,-1))),{html:e,closing:t}}function zo(e){var n={};for(var t in e)n[t]=e[t];return n}function Ho(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 zt(e){e=zo(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=j.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=Ho(e.whiteList||e.allowList):e.whiteList=j.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":j.attributeWrapSign,e.onTag=e.onTag||j.onTag,e.onTagAttr=e.onTagAttr||j.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||j.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||j.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||j.safeAttrValue,e.escapeHtml=e.escapeHtml||j.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Wo(e.css))}zt.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,u=t.onIgnoreTagAttr,s=t.safeAttrValue,c=t.escapeHtml,f=n.attributeWrapSign,p=n.cssFilter;t.stripBlankChar&&(e=j.stripBlankChar(e)),t.allowCommentTag||(e=j.stripCommentTag(e));var d=!1;t.stripIgnoreTagBody&&(d=j.StripTagBody(t.stripIgnoreTagBody,a),a=d.onIgnoreTag);var v=jo(e,function(m,T,b,g,y){var w={sourcePosition:m,position:T,isClosing:y,isWhite:Object.prototype.hasOwnProperty.call(o,b)},_=i(b,g,w);if(!be(_))return _;if(w.isWhite){if(w.isClosing)return"</"+b+">";var $=Go(g),D=o[b],E=qo($.html,function(k,h){var C=ke.indexOf(D,k)!==-1,A=l(b,k,h,C);return be(A)?C?(h=s(b,k,h,p),h?k+"="+f+h+f:k):(A=u(b,k,h,C),be(A)?void 0:A):A});return g="<"+b,E&&(g+=" "+E),$.closing&&(g+=" /"),g+=">",g}else return _=a(b,g,w),be(_)?c(g):_},c);return d&&(v=d.remove(v)),v};var Xo=zt;(function(e,n){var t=R,o=Ne,i=Xo;function a(u,s){var c=new i(s);return c.process(u)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var u in t)n[u]=t[u];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)})($e,$e.exports);var Yo=$e.exports;const Jo=ro(Yo);function Ko(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>'),Jo(e)}function Qo(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function Zo(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 Xe(e,n){return`/forms/${e}/${n}`}function Ht(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=a=>re.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{re.openModal("form",{entity:ft(i,a),id:a[ge(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const l=i.name[0],u=a[l];return u?Xe(ft(i,a),u):null},i.value=(a,l)=>l[i.name[1]]),ei(i,i.type,i.presentation),I.listConvertCellConfigHandler&&I.listConvertCellConfigHandler(e,i),i))}function ei(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const ft=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function dt(e){return typeof e!="object"||e===null?null:e[S.TABLE_MOCK_FIELD]}function ti(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)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ni(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function ri(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function Xt(e,n){e()&&(await n(),await Xt(e,n))}function oi(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(E=>c(E,i.value))),l=r.reactive([]);let u=0;const s=r.ref(!1);let c=(t==null?void 0:t.filterSearchFn)||((E,k)=>ri(E,k));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function p(){const E=_();return typeof E.limit!="number"&&(E.limit=100),E.offset=u,(t.request||fe)(e,E).then(h=>(u+=h.length,h))}function d(E,k){var C;return typeof E.Version=="number"?E.Version:(C=l.find(A=>A.Id===k))==null?void 0:C.Version}function v(E,k){const h=l.findIndex(C=>C.Id===E);if(h===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(h,1,k)}function m(E){const k=l.findIndex(h=>h.Id===E);if(k===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(k,1)}async function T(E,k){try{const h=_(),C=d(k,E);delete k.Version,await Ge(e,{id:E,values:k,version:C,masterEntities:f()});const A=await fe(e,{fields:h.fields||"",id:E});v(E,A)}catch(h){M()(h)}}async function b(E,k={}){try{const h=_(),C=d(k,E);delete k.Version,await Nt(e,{id:E,version:C,masterEntities:f()}),m(E)}catch(h){M()(h)}}async function g(E){try{await It(e,{values:E,masterEntities:f()}),await $()}catch(k){M()(k)}}let y;async function w(){s.value=!0;try{y!=null&&y.signal&&!y.signal.aborted&&y.abort();let E=y=new AbortController,k=0;const C=_().limit||0;if(i.value&&!C){console.warn("Using textSearch assumes the use of limit.");return}await Xt(()=>(C>0?k<C:!0)&&!o&&!E.signal.aborted,async()=>{const A=await p();E.signal.aborted||(l.push(...A),k+=A.filter(P=>c(P,i.value)).length,(A.length<C||C===0)&&(o=!0))})}catch(E){M()(E)}s.value=!1}function _(){return typeof n=="function"?n():n}async function $(){try{u=0,o=!1,l.splice(0,l.length),await w()}catch(E){M()(E)}}function D(){if(y)return y.abort();s.value=!1}return{array:l,updateById:T,next:w,reload:$,wait:s,create:g,deleteById:b,textSearch:i,filteredArray:a,abort:D}}function ii(){function e(){return{organizations:q.organizations,currentContextId:q.contextId,person:q.person,context:q.context,contextType:q.contextType,userId:q.userId}}const n=r.reactive(e());return q.onupdateContext(()=>{Object.assign(n,e())}),n}function ai(e,n,t){return x().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function si(e,n,t){return x().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function li(e,n){return x().emit("communication-message:create",{communicationId:e,text:n})}function ci(e){return x().emit("communication-message:read",{communicationId:e})}function ui(e){const n=F.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>ci(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 fe(e.name,o)}).then(Qe).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 Ge(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 Re(e){if(!e)return r.inject(S.PROVIDE_NAME_METADATA);_e.initEntity(e);const n=r.computed(()=>_e.state[e]);return r.provide(S.PROVIDE_NAME_METADATA,n),n}function Je(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 Wr(e,di(n||{}))}}}function di(e){return typeof e=="function"?e():e}function pi(e){if(!e)return r.inject(S.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Lt(e,l))),i={actions:o,update:a};r.provide(S.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return Rt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(u=>t.splice(0,0,...u)).catch(M("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function gi(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function mi(e,n={}){const t=r.reactive([]),o=s=>{const c=r.unref(e);if(s===void 0){t.length===0?c.forEach(a):c.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 c=t.findIndex(f=>f===s);c!==-1&&t.splice(c,1)},u=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,u,a,l]}function hi(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 xe{static async getStartConfig(n,t){return x().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return x().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return x().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function vi(e){return e.statusName===V.Completed}function yi(e){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(e.statusName)}function wi(e){return e.statusName===V.ValidationError}function bi(e){return e.statusName===V.Undefined}function Ei(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),u=r.computed(()=>p(i,l.value)),s=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(y=>p(i,y)));function p(y,w){return y.find(_=>_.name===w)||null}async function d(y){var w;if(bi(y)){await t.onDisplayDataSet(y);return}if(!(yi(y)&&!await t.onDisplayDataSet(y))){if(wi(y))return void t.onValidation(y.validationResults);T(y),await r.nextTick();{const _=((w=p(i,l.value))==null?void 0:w.fields)||[];if([V.FinalStep,V.NextStep,V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(y.statusName)&&(!_.length||ki(_,t.presets)))return g(t.presets||{})}vi(y)&&t.onCompleted(y)}}async function v(){try{await m(),await b()}catch(y){M("error")(y)}}function m(){return a.value="Loading process information.",xe.getStartConfig(n,e).then(y=>(s.value={label:y.processTitle,info:y.processInfo,icon:y.processIcon},i=y.steps.map(w=>{const _=w.frontendEntity.rootObject,$=Object.fromEntries(w.frontendEntity.objectTypes.map(D=>[D.name,D.properties]));return{label:w.title,name:w.stepName,number:w.number,rootObjectName:_,objectTypes:$,fields:$[_],buttonCaption:w.buttonCaption}}))).finally(()=>{a.value=!1})}function T(y){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation,V.NextStep,V.Completed,V.FinalStep].includes(y.statusName)?(o=y.token,l.value=y.nextStepName):console.log("Saving is not completed:",y),y}function b(){return a.value="Starting process",xe.startProcess(n,e).then(d).catch(M("error")).finally(()=>{a.value=null})}function g(y={}){const w=l.value;return!o||!w?Promise.reject("Not step or token."):(a.value="Waiting for result...",xe.runStep(n,e,w,o,y).then(d).then(_=>(c[c.length-1]!==w&&c.push(w),_)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:v,loading:a,currentStepConfig:u,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:s,next:g}}function ki(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}const Ke=new class{constructor(){this.store=r.reactive([])}add(n,t,o={}){const i=Ti(o),a=new De(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 Ti(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 Ae=class Ae{constructor(n,t,o,i,a){this.type=n,this.message=t,this.timeout=o,this.children=i,this.click=a,this.id=Ae.cardId++}};Ae.cardId=1;let De=Ae;/*!
|
|
8
8
|
* jenesius-event-emitter v1.0.2
|
|
9
9
|
* (c) 2022 Jenesius
|
|
10
10
|
* @license MIT
|
|
11
|
-
*/const pt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},gt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},mt=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},ht=function(){this.events={}};class X{constructor(){this.events={}}on(n,t){return pt.call(this,n,t)}emit(n,t){return gt.call(this,n,t)}off(n,t){return mt.call(this,n,t)}cleanEvents(){ht.call(this)}static on(n,t){return pt.call(X,n,t)}static emit(n,t){return gt.call(X,n,t)}static off(n,t){return mt.call(X,n,t)}static cleanEvents(){ht.call(X)}}X.events={};class _i extends X{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return li(this.id,n)}static checkAndGenerate(n,t,o){return si(n,t,o).then(i=>i.length===0?ai(n,t,o):i[0])}}function Ci(){return O().emit("client:read",{})}var se;const H=class H extends X{constructor(){super(...arguments);nt(this,se);this.type="front",this.organizations=[],Oe(this,se,!1)}set language(t){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}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){Oe(this,se,t),this.emit(H.EVENT_READY_UPDATE,t)}get ready(){return tt(this,se)}onReady(t){return this.on(H.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(H.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(t),localStorage.setItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(H.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.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){M()(t)}}restoreCurrentContext(){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 Ci()}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}}};se=new WeakMap,H.DEFAULT_LANGUAGE="en",H.EVENT_CONTEXT_UPDATE="event:context-update",H.EVENT_READY_UPDATE="event:ready-update";let Pe=H;function Ai(e){return O().emit("metadata:read",{entity:e})}const Ce=function(){const n=r.reactive({}),t=new Map;function o(u){return n[u]}async function i(u){if(t.has(u)&&await t.get(u),n[u])return;const s=await a(u);l(u,s)}function a(u){const s=Ai(u).finally(()=>{t.delete(u)});return t.set(u,s),s}function l(u,s){n[u]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Si extends X{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 U(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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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){return U(`${I.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:o})})}}class Ii{static readHistoryById(n,t){return U(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ni{static getConfiguration(){return U("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await U(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ri{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return U(`/open-api/internationalization/language/${n}`)}}class Li{static async upload(n,t){const o=new FormData;return o.append("file",n),U(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var Yt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Yt||{}),Jt=(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))(Jt||{});function Oi(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(Oi(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 he(e){return typeof e=="string"?`'${e}'`:`${e}`}x.includes=function(n,t){return`@${n} Contains ${he(t)}`};x.beginWith=function(n,t){return`@${n} BeginWith ${he(t)}`};x.notEq=function(n,t){return`@${n} nq ${he(t)}`};x.eq=function(n,t){return Array.isArray(t)?x.in(n,t):`@${n} eq ${he(t)}`};x.in=function(n,t){const o=t.map(he).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 Qe(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=Qe(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||{});const G=new Pe,me=new Si;exports.ApplicationStatus=Jt;exports.Communication=_i;exports.CoreError=K;exports.DisplayListRow=Ye;exports.EventBus=me;exports.Filter=x;exports.Manager=G;exports.MetadataStore=Ce;exports.NotificationSystem=Ke;exports.OBJECT_TYPE_NAME_FIELD=wt;exports.RecordOperation=Yt;exports.WidgetButton=On;exports.WidgetFastTable=Ir;exports.WidgetFastTableHeadCell=Et;exports.WidgetField=rr;exports.WidgetIcon=le;exports.WidgetImage=jn;exports.WidgetList=nr;exports.WidgetLoader=Un;exports.WidgetMultiButton=Pn;exports.WidgetSpinner=fe;exports.WidgetTable=bt;exports.WidgetTablePanelFilterItem=kt;exports.asyncProcess=Ee;exports.authService=z;exports.billingService=ie;exports.catchUniversal=M;exports.config=bn;exports.configuration=I;exports.constants=A;exports.convertDDToDMS=Zo;exports.convertDMSToDD=Qo;exports.convertListConfig=Ht;exports.debounce=$r;exports.documentsService=nn;exports.fileService=Li;exports.formatter=ue;exports.getCellName=ge;exports.getCellValue=Ue;exports.getEntityLink=Xe;exports.getNamesFromListConfig=_t;exports.getUnitValue=$e;exports.groupArrayByField=Lr;exports.historyService=Ii;exports.injectAction=Lt;exports.internationalizationService=Ri;exports.invitationService=tn;exports.openService=Ni;exports.parseError=qe;exports.parseTextByMarkdown=Ko;exports.prettyDate=Te;exports.prettyDateWithTime=Tt;exports.prettyMoney=Ct;exports.prettyValueFieldByEntity=Dr;exports.request=U;exports.setupListRow=We;exports.staticLink=zr;exports.t=Q;exports.throttle=Fr;exports.universalEntityCount=Gr;exports.universalEntityCreate=It;exports.universalEntityDelete=Nt;exports.universalEntityRead=ce;exports.universalEntityUpdate=Ge;exports.universalHistoryRead=qr;exports.universalListSettingRead=St;exports.universalMetadataFieldTreat=Ur;exports.universalMetadataListRead=jr;exports.universalToolRead=Rt;exports.useActions=pi;exports.useCommunication=ui;exports.useEnter=gi;exports.useFormEntity=fi;exports.useListActiveRow=ni;exports.useListEntity=oi;exports.useListSearch=hi;exports.useListSelect=mi;exports.useManagerState=ii;exports.useMetadata=Re;exports.useSocket=O;exports.useUsageContext=Je;exports.useVisibleItem=je;exports.useWizard=Ei;exports.uuidv4=Or;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=Ot;
|
|
11
|
+
*/const pt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},gt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},mt=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},ht=function(){this.events={}};class Y{constructor(){this.events={}}on(n,t){return pt.call(this,n,t)}emit(n,t){return gt.call(this,n,t)}off(n,t){return mt.call(this,n,t)}cleanEvents(){ht.call(this)}static on(n,t){return pt.call(Y,n,t)}static emit(n,t){return gt.call(Y,n,t)}static off(n,t){return mt.call(Y,n,t)}static cleanEvents(){ht.call(Y)}}Y.events={};class Ci extends Y{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return li(this.id,n)}static checkAndGenerate(n,t,o){return si(n,t,o).then(i=>i.length===0?ai(n,t,o):i[0])}}function _i(){return x().emit("client:read",{})}var ce;const H=class H extends Y{constructor(){super(...arguments);nt(this,ce);this.type="front",this.organizations=[],Le(this,ce,!1)}set language(t){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}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){Le(this,ce,t),this.emit(H.EVENT_READY_UPDATE,t)}get ready(){return tt(this,ce)}onReady(t){return this.on(H.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(H.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(t),localStorage.setItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(H.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.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){M()(t)}}restoreCurrentContext(){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 _i()}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}}};ce=new WeakMap,H.DEFAULT_LANGUAGE="en",H.EVENT_CONTEXT_UPDATE="event:context-update",H.EVENT_READY_UPDATE="event:ready-update";let Pe=H;function Ai(e){return x().emit("metadata:read",{entity:e})}const _e=function(){const n=r.reactive({}),t=new Map;function o(u){return n[u]}async function i(u){if(t.has(u)&&await t.get(u),n[u])return;const s=await a(u);l(u,s)}function a(u){const s=Ai(u).finally(()=>{t.delete(u)});return t.set(u,s),s}function l(u,s){n[u]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Si 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 U(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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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){return U(`${I.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:o})})}}class Ii{static readHistoryById(n,t){return U(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ni{static getConfiguration(){return U("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await U(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ri{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return U(`/open-api/internationalization/language/${n}`)}}class Oi{static async upload(n,t){const o=new FormData;return o.append("file",n),U(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var Yt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Yt||{}),Jt=(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))(Jt||{});function Li(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function B(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(Li(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(B.is(t,o)),n)},[]).join(" and ")}function he(e){return typeof e=="string"?`'${e}'`:`${e}`}B.includes=function(n,t){return`@${n} Contains ${he(t)}`};B.beginWith=function(n,t){return`@${n} BeginWith ${he(t)}`};B.notEq=function(n,t){return`@${n} nq ${he(t)}`};B.eq=function(n,t){return Array.isArray(t)?B.in(n,t):`@${n} eq ${he(t)}`};B.in=function(n,t){const o=t.map(he).join(", ");return`@${n} in (${o})`};B.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":B.and(...t.map(o=>B.notEq(n,o)))};B.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(B.wrap).join(" and ")};B.wrap=function(n){return`(${n})`};B.is=function(n,t){return`@${n} is ${t}`};B.or=function(...n){return n.join(" or ")};function Qe(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=Qe(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||{});const q=new Pe,me=new Si;exports.ApplicationStatus=Jt;exports.Communication=Ci;exports.CoreError=Z;exports.DisplayListRow=Ye;exports.EventBus=me;exports.Filter=B;exports.Manager=q;exports.MetadataStore=_e;exports.NotificationSystem=Ke;exports.OBJECT_TYPE_NAME_FIELD=wt;exports.RecordOperation=Yt;exports.WidgetButton=Ln;exports.WidgetFastTable=Ir;exports.WidgetFastTableHeadCell=Et;exports.WidgetField=rr;exports.WidgetIcon=ue;exports.WidgetImage=jn;exports.WidgetList=nr;exports.WidgetLoader=Un;exports.WidgetMultiButton=Pn;exports.WidgetSpinner=oe;exports.WidgetTable=bt;exports.WidgetTablePanelFilterItem=kt;exports.asyncProcess=Ee;exports.authService=z;exports.billingService=se;exports.catchUniversal=M;exports.config=bn;exports.configuration=I;exports.constants=S;exports.convertDDToDMS=Zo;exports.convertDMSToDD=Qo;exports.convertListConfig=Ht;exports.debounce=Br;exports.documentsService=nn;exports.fileService=Oi;exports.formatter=de;exports.getCellName=ge;exports.getCellValue=Ue;exports.getEntityLink=Xe;exports.getNamesFromListConfig=Ct;exports.getUnitValue=Be;exports.groupArrayByField=Or;exports.historyService=Ii;exports.injectAction=Ot;exports.internationalizationService=Ri;exports.invitationService=tn;exports.openService=Ni;exports.parseError=qe;exports.parseTextByMarkdown=Ko;exports.prettyDate=Te;exports.prettyDateWithTime=Tt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Dr;exports.request=U;exports.setupListRow=We;exports.staticLink=zr;exports.t=ee;exports.throttle=$r;exports.universalEntityCount=Gr;exports.universalEntityCreate=It;exports.universalEntityDelete=Nt;exports.universalEntityRead=fe;exports.universalEntityUpdate=Ge;exports.universalHistoryRead=qr;exports.universalListSettingRead=St;exports.universalMetadataFieldTreat=Ur;exports.universalMetadataListRead=jr;exports.universalToolRead=Rt;exports.useActions=pi;exports.useCommunication=ui;exports.useEnter=gi;exports.useFormEntity=fi;exports.useListActiveRow=ni;exports.useListEntity=oi;exports.useListSearch=hi;exports.useListSelect=mi;exports.useManagerState=ii;exports.useMetadata=Re;exports.useSocket=x;exports.useUsageContext=Je;exports.useVisibleItem=je;exports.useWizard=Ei;exports.uuidv4=Lr;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=Lt;
|
|
12
12
|
//# sourceMappingURL=eservices-core.cjs.js.map
|