eservices-core 1.3.255 → 1.3.257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.justify-content-center{justify-content:center}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow,.flex-grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_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}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number,.widget-table-cell_money{text-align:end}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-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}.flex,.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.gap-10{gap:10px}.gap-15{gap:15px}.gap-5{gap:5px}.gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.padding-bottom-10{padding-bottom:10px}.padding-10{padding:10px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-aa18d6fa]{padding:18px;text-align:start}.widget-table__head-label[data-v-aa18d6fa]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cd8043dd]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cd8043dd]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cd8043dd]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-d131e64e]{display:flex;gap:4px}.widget-head-cell-order[data-v-d131e64e]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-d131e64e]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-d131e64e]{padding:7px}.widget-head-cell-order-icon[data-v-d131e64e]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-d131e64e]{transform:rotate(180deg)}.widget-filter-item-container[data-v-e52e165e]{position:relative}.widget-filter-item-arrow[data-v-e52e165e]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-e52e165e]{font-weight:700}.widget-filter-item[data-v-e52e165e]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-e52e165e]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-e52e165e]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-e52e165e]{transition:.2s}.widget-table-panel-filter[data-v-89e1fa2d]{justify-content:end;background-color:var(--color-primary)}.widget-fast-table-tools[data-v-3a74319d]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- "use strict";var lt=e=>{throw TypeError(e)};var ct=(e,n,t)=>n.has(e)||lt("Cannot "+t);var $e=(e,n,t)=>(ct(e,n,"read from private field"),t?t.call(e):n.get(e)),Pe=(e,n,t)=>n.has(e)?lt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ee=(e,n,t,o)=>(ct(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);/*!
3
- * eservices-core v1.3.255
2
+ "use strict";var st=e=>{throw TypeError(e)};var lt=(e,n,t)=>n.has(e)||st("Cannot "+t);var $e=(e,n,t)=>(lt(e,n,"read from private field"),t?t.call(e):n.get(e)),Pe=(e,n,t)=>n.has(e)?st("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),Ee=(e,n,t,o)=>(lt(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);/*!
3
+ * eservices-core v1.3.257
4
4
  * (c) 2024 ESERVICES
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),F=require("jenesius-vue-form"),oe=require("vue-router"),sn=require("date-and-time"),Re=require("debug"),H=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 Q=N;const ln="Please try again later or submit a feedback if problem doesn't go.";function cn(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return ln}})}function ce(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Q.ApiNotAvailable()}).then(t=>cn(t).then(o=>{if(!t.ok)throw o;return o}))}class un{constructor(){this.public=!1,this.errors=new Proxy([],{set:(n,t,o)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),n[t]=o,!0)}),window._journal=this}get error(){return{add:(...n)=>{this.errors.push(n)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new un;class fn{static invite(n,t,o){return ce("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:n,personKey:t,relatedRoleCode:o})})}static accept(n,t){return ce("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!0})})}static decline(n,t){return ce("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class dn{static getRequiredDocuments(n,t,o){const i=new URLSearchParams({entity:n,primaryKey:t,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class le{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${le.url()}/calculator/${n}`)}static calculate(n,t){return ce(`/${le.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:n,values:t})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(n){function t(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:n.name,label:n.title,required:n.required,type:t(n)}}static createOnlinePayment(n,t){return ce(`/${le.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return ce(`/${le.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const pn={class:"widget-table__head-cell"},mn={key:1,class:"widget-table__head-label margin_0 text_overflow"},kt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:n}){const t=n;function o(){t("select")}return(i,a)=>(r.openBlock(),r.createElementBlock("th",pn,[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,onClick:o})):(r.openBlock(),r.createElementBlock("span",mn,r.toDisplayString(i.label),1))]))}}),gn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>kt),(n,t)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,o=>r.renderSlot(n.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},yn=U(hn,[["__scopeId","data-v-aa18d6fa"]]);function ze(e){return Array.isArray(e)?ze(e[0]):typeof e!="string"?null:e}function ie(e){return ze(e.name)}function vn(e){const n=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),t=[];let o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function wn(e,n){return vn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),F.utils.getPropFromObject(n,o))}),e}function je(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Oe(e,n){const t=ie(e);if(typeof e.value=="string")return wn(e.value,n);let o=t?F.utils.getPropFromObject(n,t):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,n);if(e.value===null)return null;switch(e.unitValue&&(o=je(e.unitValue)(o)),e.unit&&(o=je(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Se(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Rt(typeof o=="string"?o:null);break}case"money":{o=Ft(o);break}case"DateTime":{o=Se(typeof o=="string"?o:null,e.format||A.dateTimeFormat);break}}return e.formatter&&(o=de(e.formatter).exec(o,n)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const bn=1,En=5e3,Cn="static-folder",_t="request-error",Tt="EntityTypeName",kn="REFERENCE_CHANGES",T={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",MODAL_BATCH_VALUES:"batch-values",MODAL_ENTITY:"form-entity",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:Tt,FIELD_NAME_REFERENCE_CHANGES:kn,PATH_RESOLVER_ENTITY:"resolver"};function Fe(e){return[T.CORE_DEBUG_LABEL,e].join(":")}const _n={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>t.values,l=>{if(typeof l!="string")return i.value="";i.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",_n,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),An=U(Tn,[["__scopeId","data-v-800b3803"]]),Sn={class:"widget-filter-enum"},In={class:"flex gap-10 padding-10"},Nn=r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=xe(t.filterMetadata.entity),a=f=>(t.values||[]).includes(f),l=n;function c(f){const v=t.values||[];return v.includes(f)?l("update:values",v.filter(m=>m!==f)):l("update:values",[...v,f])}const s=fe(async()=>{o.value=await ae(t.baseEntity,{fields:t.filterMetadata.name.join(" "),order:[t.filterMetadata.name[1],"asc"],distinct:!0,filter:D(t.filters)}).then(f=>f.map(v=>({label:v[t.filterMetadata.name[1]],value:v[t.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,f=>{l("readProcess",f?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(f,v)=>{const m=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Sn,[r.createElementVNode("div",In,[r.createVNode(m,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:v[0]||(v[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(m,{label:"Clear",onClick:u})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,h=>(r.openBlock(),r.createBlock(r.unref(F.FormField),{class:"widget-filter-enum-item",key:h.value,onClick:()=>c(h.value),type:"single-checkbox","model-value":a(h.value),label:h.label},null,8,["onClick","model-value","label"]))),128))])}}}),Ln=U(Nn,[["__scopeId","data-v-cd8043dd"]]),ge=r.reactive({});function Rn(){ut(),setInterval(ut,50)}function At(){return ge}function ut(){const e={};Object.entries(localStorage).forEach(([n,t])=>{e[n]=!0,ge[n]!==t&&(ge[n]=t)}),Object.keys(ge).forEach(n=>{e[n]||delete ge[n]})}const A={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:An,Entity:Ln},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function On(e){Rn();for(let n in e)A[n]=e[n]}const Fn={props:{name:String},setup(e,n){let t="unknown";try{t=n.slots.default()[0].children}catch{t=e.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>r.h(A.iconTag,{class:A.iconHandler?A.iconHandler(t):`icon icon-${t}`},A.iconHandlerText(t))}},he=U(Fn,[["__scopeId","data-v-8a72b45f"]]),Bn=Re(Fe("setup-list-row"));function xn(e,n){const t=e.config.map(o=>Dn(o,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function Dn(e,n,t){const o=n.values;let i=Oe(e,o);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(f){a.onClick.push(()=>f(o,e,t))}function c(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],u=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{u.push(r.h(F.FormField,{type:"single-checkbox",modelValue:n.selected})),l(ft.bind(null,t,!0));break}case"select":{u.push(r.h(F.FormField,{type:"single-radio",modelValue:n.selected})),l(ft.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const v=r.h(oe.RouterLink,{to:f});u.push(v),c("widget-table-cell_link")}}catch(f){Bn("Can't add router link",f)}if(e.href&&(u.push(r.h("a",{href:e.href(o),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&u.push(r.h(he,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&u.push(r.h(he,{name:f}))}return e.class&&(typeof e.class=="function"?c(e.class(o)):c(e.class)),A.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),A.listCellHandler(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),A.arrayListCellHandlers&&A.arrayListCellHandlers.forEach(f=>f(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),s.push(r.h("td",a,u)),s}function ft(e,n){e.emit("select",n)}function Xe(e,n){return()=>{try{return xn(e,n)}catch(t){return console.warn(t),null}}}const $n={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Pn=["colspan"],dt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:n}){const t=n,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=l=>t("close")),onSave:a[1]||(a[1]=l=>t("save",l))}),null,16,["values","new"]))],8,Pn)],512))}}),Vn={class:"widget-table"},Ve="update:selectedRows",Mn="update:activeRow",St=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 h;return(h=i==null?void 0:i.default)==null?void 0:h.call(i)[0]});function l(){const w=t.selectedRows.length!==0?[]:[...t.array];o(Ve,w)}function c(h){return t.useMockField?vt(h):h}function s(h,w=!0){if(!t.selectedRows)return;if(!w)return o(Ve,t.selectedRows.includes(h)?[]:[h]);const d=[...t.selectedRows],y=d.indexOf(h);return y===-1?d.push(h):d.splice(y,1),o(Ve,d)}function u(h){o(Mn,h)}function f(h){o("save",h),o("update:activeRow",null)}const v=r.computed(()=>t.shortcut?t.config.filter(h=>h.name?!!t.array.find(d=>![null,""].includes(Oe(h,d))):!0):t.config),m=r.computed(()=>t.useMockField?t.array.filter(vt):t.array);return(h,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Vn,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:v.value,onOrder:w[0]||(w[0]=d=>h.$emit("order",d))},{default:r.withCtx(d=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.$slots["head-cell"]||kt),r.mergeProps(d,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(d,y)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:y},[r.createVNode($n,{config:v.value,values:d,selected:h.selectedRows.includes(c(d)),onSelect:g=>s(c(d),g),onActivate:g=>u(c(d)),class:r.normalizeClass(h.classCallback?h.classCallback(d):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&h.activeRow===c(d)?(r.openBlock(),r.createBlock(dt,{key:0,component:a.value,"row-length":h.config.length,values:d,onClose:w[1]||(w[1]=g=>o("update:activeRow",null)),onSave:f,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),h.activeRow===r.unref(T).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(dt,{key:0,component:a.value,"row-length":v.value.length,onClose:w[2]||(w[2]=d=>o("update:activeRow",null)),onSave:f,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),jn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${n.color}`})},null,4))}}),we=U(jn,[["__scopeId","data-v-0ef9ae88"]]),Un={class:"widget-button"},Wn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Un,[n.wait?(r.openBlock(),r.createBlock(we,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),qn=U(Wn,[["__scopeId","data-v-450dc564"]]),Hn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Gn={class:"widget-multi-button-body grid"},zn=["onClick"],Xn={class:"widget-multi-button-side-wrap"},Yn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"04895bf1":o.value}));const n=e,t=r.reactive({active:!1,wait:!1}),o=r.computed(()=>n.array.length+(n.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function a(l=!t.active){t.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Gn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,u)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,zn))),128))]),r.createElementVNode("div",Xn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(we),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(he),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Kn=U(Yn,[["__scopeId","data-v-d43a76ce"]]),Jn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Qn={class:"text_md"},Ye=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Jn,[r.createVNode(we,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Qn,r.toDisplayString(n.label),1)]))}}),Zn=["alt","src"],er=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const n=e,t=r.ref();return r.onMounted(()=>{t.value&&(t.value.src=n.src),t.value.onerror=function(){n.default&&(t.value.src=n.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:t,src:o.src||o.$props.default},null,8,Zn))}}),tr={props:{config:Array,values:Object,selected:Boolean},setup:Xe},nr=U(tr,[["__scopeId","data-v-344a8cc1"]]),rr=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),or={class:"widget-list-head-cell"},ir=rr(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ar=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:n}){const t=e,o=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",or,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(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(he),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),ir])]))}}),sr=U(ar,[["__scopeId","data-v-bf495d6a"]]),lr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:n}){const t=e,o=n,i=r.ref(),a=r.ref();r.onMounted(()=>{function u(w,d){let y=-1;do y++,d-=w[y];while(d>0&&y<w.length);return y}function f(w,d){let y=0;for(;d>0&&d>w[y]&&y<w.length;)d-=w[y],y++;return console.log(d,y),y>0?y:0}function v(w){try{a.value.style.insetInlineStart=w+"px"}catch(d){console.log(d)}}function m(w){try{a.value.style.width=w+"px",a.value.style.minWidth=w+"px",a.value.style.maxWidth=w+"px"}catch(d){console.log(d)}}function h(w){return w===null?!1:w.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(d){var x;function y($){return $.screenX+b-P}const g=i.value,p=[...g.children].filter($=>$.localName==="th"),b=((x=g.offsetParent)==null?void 0:x.scrollLeft)||0,k=p.map($=>$.clientWidth),B=h(d.target),P=g.getBoundingClientRect().left,E=y(d),C=u(k,E),S=k.slice(0,C).reduce(($,W)=>$+W,0),O=E-S,_=g.offsetWidth,I=p[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",d.screenX),console.log("Widths",k),console.log("max width",_),console.log("Start Position",E),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",P),console.log("Del",O),console.groupEnd(),a.value.innerText=p[C].textContent||"",a.value.style.display="grid",a.value.style.width=I+"px",a.value.style.cursor="grabbing",v(S),m(I),document.addEventListener("pointermove",ee,{passive:!0}),document.addEventListener("pointerup",V);function V($){if(console.group("END"),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",V),B&&(t.config[C].width=a.value.style.width,t.config[C].minWidth=a.value.style.width,t.config[C].maxWidth=a.value.style.width,l(t.config)),!B){const W=$.screenX+b-P;console.log("ENP Position",W);const te=f(k,W);if(console.log(C,"->",te),te!==C){const pe=t.config[C],De=t.config;De.splice(C,1),De.splice(te,0,pe),l(De)}else{const pe=t.config[C].name;c(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ee($){if(B){const pe=y($)-E+I;m(pe);return}let W=$.screenX+b-P-O;W<0&&(W=0),W+I>_&&(W=_-I),v(W)}})});function l(u){o("update:config",u)}function c(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(v,m)=>(r.openBlock(),r.createBlock(sr,r.mergeProps({key:v,ref_for:!0},v,{onOrder:h=>c(v.name),onSelect:f[0]||(f[0]=h=>o("select")),order:u.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),cr=U(lr,[["__scopeId","data-v-ccffc6bd"]]),ur={class:"widget-list"},fr={class:"widget-list-body position_relative"},dr=50,pr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:n}){const t=e,o=n;function i(s,u=!0){if(t.selectedRows)if(!u)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],v=f.indexOf(s);v===-1?f.push(s):f==null||f.splice(v,1),l(f)}}function a(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return l([...t.array]);l([])}function l(s){o("update:selectedRows",s)}function c(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+dr>u.scrollHeight&&o("scrollEnd")}return(s,u)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",ur,[r.createElementVNode("thead",null,[r.createVNode(cr,{onSelect:u[0]||(u[0]=f=>a()),"onUpdate:order":u[1]||(u[1]=f=>o("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,v)=>{var m;return r.openBlock(),r.createBlock(nr,{key:v,class:"widget-list-row",values:f,config:s.config,selected:(m=s.selectedRows)==null?void 0:m.includes(f),onSelect:h=>i(f,h)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ke(){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(T.VISIBLE_ITEM_PROVIDE_NAME,{show(l){t[l]=!0},hide(l){t[l]=!1},remove(l){delete t[l]}});const o=r.inject(T.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(n)},hide(){o==null||o.hide(n)},remove(){o==null||o.remove(n)}},visibleItems:t}}const mr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const n=e,t=xe(),o=ot(),i=r.computed(()=>{var d,y,g;const m=s.value,h=u(m),w={type:h,disabled:n.usageContext?!((d=c.value)!=null&&d.canSet):!1,label:n.label};return h==="Decimal"&&((g=(y=m==null?void 0:m.presentationType)==null?void 0:y.toLowerCase)==null?void 0:g.call(y))==="money"&&(w.money=!0),m&&Object.assign(w,{suffix:h==="number"?m.valueUnit:void 0,required:l.includes(h||"")?!1:m.required,label:n.label||m.displayName}),Array.isArray(A.arrayFieldParamsHandlers)&&A.arrayFieldParamsHandlers.forEach(p=>Object.assign(w,p(m,c.value,w))),w}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var m;return(m=o==null?void 0:o.value)==null?void 0:m.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const m=t.value.fieldsByName[n.name];if(m)return m});function u(m){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(m){if(m.type==="Reference"||m.type==="Owned")return m.referencedEntity;if(m.dataType==="Boolean")return"single-checkbox";if(m.dataType==="DateTime")return"date";if(m.dataType==="Integer"||m.dataType==="Decimal")return"number";if(m.dataType==="List")return m.aggregatedEntity;if(a.includes(m.presentationType))return"textarea";if(m.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var m;return n.usageContext?((m=c.value)==null?void 0:m.canGet)===!0:!0}),{controller:v}=Ke();return r.watch(()=>f.value,m=>m?v.show():v.hide(),{immediate:!0}),r.onUnmounted(()=>v.remove()),(m,h)=>f.value?(r.openBlock(),r.createBlock(r.unref(F.FormField),r.mergeProps({key:0},{...m.$attrs,...i.value},{name:m.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function gr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||T.DEFAULT_ORDER_DIR}const hr=["fill"],yr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),vr=[yr],wr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},vr,8,hr))}}),br={class:"widget-fast-table-head-cell-td"},Er={key:1,class:"widget-head-cell-label"},Cr={key:2,class:"widget-head-cell-order"},kr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:n}){const t=e,o=r.computed(()=>ze(t.name));r.computed(()=>gr(t.order));const i=n;function a(){i("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",br,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=u=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",Er,r.toDisplayString(l.label),1)),o.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",Cr,[r.createVNode(wr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),It=U(kr,[["__scopeId","data-v-d131e64e"]]),_r=["fill"],Tr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Ar=[Tr],Sr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},Ar,8,_r))}}),Ir={class:"widget-filter-item-popup"},Nr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=A.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const h=t.filterItem;return h.entity?"Entity":h.type?h.type:null});function c(h){s.value=h==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let v=null;function m(h=!f.value){f.value=h,!f.value&&v?(v(),v=null):a.value&&(v=F.utils.clickOutside(a.value,m.bind(null,!1)))}return(h,w)=>{var d;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":u.value}]),onClick:w[0]||(w[0]=()=>m())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(h.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(we,{key:0})):(r.openBlock(),r.createBlock(Sr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Ir,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((d=r.unref(i))==null?void 0:d[l.value]),{key:0,"filter-metadata":h.filterItem,values:h.values,filters:h.filters,"base-entity":h.entity,"onUpdate:values":w[1]||(w[1]=y=>o("update:values",y)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Nt=U(Nr,[["__scopeId","data-v-e52e165e"]]),Lr={class:"widget-table-panel-filter flex"},Rr=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",Lr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var u;return r.openBlock(),r.createBlock(Nt,{key:s,entity:a.entity,"filter-item":c,values:(u=a.filters)==null?void 0:u[r.unref(ie)(c)],filters:a.filters,"onUpdate:values":f=>i(r.unref(ie)(c),f)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Or=U(Rr,[["__scopeId","data-v-89e1fa2d"]]),Fr={class:"widget-fast-table-tools"},Br=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:n}){const t=e,o=oe.useRouter(),i=n,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>i("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(m=>m.name),c=r.inject(T.PROVIDE_NAME_ACTIONS,[]);function s(m){return{...m,label:m.label||"Batch update",callback:async()=>{const h=await H.promptModal(T.MODAL_BATCH_VALUES,{entity:t.metadata.name,availableFields:m.availableFields||[]}),w=t.metadata.fieldNameForIdentification,d=(t.selectedRows||[]).map(y=>({primaryKey:y[w],version:t.metadata.versioned?y.Version:void 0}));await Vt(t.metadata.name,{values:h,elements:d}),i("reload")}}}const u=r.computed(()=>{var w;const m=((w=c==null?void 0:c.actions)==null?void 0:w.value)||[];return Array.isArray(t.tools)?(t.tools,t.tools.reduce((d,y)=>{if(y.name==="*")d.push(...a);else if(l.includes(y.name)){const g=a.find(p=>p.name===y.name);g&&d.push(g)}else if(y.name==="redirect"){const g={...y,label:y.label,callback:()=>o.push(y.to)};d.push(g)}else if(y.name==="batch-update"&&!y.override)d.push(s(y));else{y.override&&m.find(p=>p.name===y.override)&&y.name==="batch-update"&&d.push(s(y));const g=m.find(p=>p.name===y.name);g&&d.push({name:y.name,label:g.title,icon:y.icon,buttonStyle:y.buttonStyle,callback:()=>Promise.resolve().then(()=>{f[y.name]=!0}).then(()=>v(g)).finally(()=>{f[y.name]=!1})})}return d},[])):[]}),f=r.reactive({});function v(m){var d;const h=(d=m.action.parameters.find(y=>y.dataTypeName==="IntegerArray"))==null?void 0:d.name,w={};return h&&(w[h]=t.selectedRows.map(y=>{if(!(typeof y=="object"&&y!==null))return null;const g=t.metadata.fieldNameForIdentification;return g===void 0?null:y[g]})),m.callback(w)}return(m,h)=>{const w=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,d=>(r.openBlock(),r.createBlock(w,{label:d.label,title:d.name,icon:d.icon,type:d.buttonStyle,loading:d.name==="reload"?m.loading:f[d.name],onClick:d.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(m.$slots,"default",{},void 0,!0)])}}}),xr=U(Br,[["__scopeId","data-v-3a74319d"]]);function Dr(e){const n=At(),t=oe.useRouter(),o=r.reactive({entity:null,mark:null,settings:null});function i(p){const b={...u.value,...p};a(b)}function a(p){{const b=p.prefilters;b&&(Object.keys(b).forEach(k=>{var B,P;Array.isArray(b[k])&&b[k].length===0&&o.settings&&!((P=(B=o.settings)==null?void 0:B.prefilters)!=null&&P[k])&&delete b[k]}),F.utils.isEmptyObject(b)&&delete p.prefilters)}localStorage.setItem(s(o.entity,o.mark),JSON.stringify(p))}function l(){return o.entity?JSON.parse(localStorage[s(o.entity,o.mark)]||"{}"):null}function c(p,b){o.entity=p,o.mark=b,v.call()}function s(p,b){return"list-configuration:"+p+(b?"-"+b:"")}const u=r.computed(()=>o.entity?JSON.parse(n[s(o.entity,o.mark)]||"{}"):null),f=r.computed(()=>o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]),v=fe(async function(){if(!o.entity)return;const b=await xt(o.entity,o.mark);o.settings=Object.freeze(b)}),m=r.computed(()=>{var k;const p=u.value.order||{},b=((k=o.settings)==null?void 0:k.prefilters)||{};return p||b||[]}),h=r.computed(()=>{var k;const p=u.value.prefilters||{};return{...((k=o.settings)==null?void 0:k.prefilters)||{},...p}}),w=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.filters)||[]}),d=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.label)||null}),y=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.tools)||[]}),g=r.computed(()=>!F.utils.isEmptyObject(u.value));return{state:o,get customFilters(){return o.settings.customFilters||[]},set:c,get:l,configuration:u,update:i,computedPrefilter:h,computedFiltersConfiguration:w,get cellConfig(){return o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]},get prefilters(){var p;return((p=l())==null?void 0:p.prefilters)||o.settings.prefilters||{}},get order(){var p;return((p=l())==null?void 0:p.order)||[]},clean(){localStorage.removeItem(s(o.entity,o.mark))},cellConfiguration:f,computedLabel:d,computedTools:y,computedHasLocalConfiguration:g,computedOrder:m,get displayModeForNew(){return o.settings.displayModeForNew||"inline"}}}const $r={class:"es-grid es-gap-15"},Pr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Vr={class:""},Mr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e,o=oe.useRouter(),i=r.ref([]),a=r.ref(null),l=r.computed(()=>a.value===T.LIST_ACTIVE_NEW?a.value:a.value?a.value[2]:null);function c(_,I,V){a.value=[_,I,V]}function s(){switch(E.displayModeForNew){case"modal":return H.openModal(T.MODAL_ENTITY,{entity:t.entity});case"form":return o.push(rt(t.entity));case"inline":return a.value=T.LIST_ACTIVE_NEW}}const u=r.ref(null),f=F.Form.getParentForm(),v=r.ref([]),m=xe(t.entity),{state:h,update:w}=ot(t.entity,{masterEntities:t.masterEntities||[]}),d=fe(async()=>{try{await g.call(),await w()}catch(_){const{message:I}=Je(_);u.value=I}});f instanceof F.Form&&f.subscribe({read:d.call.bind(null),name:t.entity,type:"table"}),r.watch(()=>t.mark,()=>{E.set(t.entity,t.mark)});function y(){return D.and(D(E.prefilters),D(t.binding||{}))}const g=fe(async function(){const I=t.entity;u.value=null,v.value=[];const V=(await ae(I,{customFilters:E.customFilters,fields:Ze(C.value).join(" "),order:E.order,filter:y()})).map(wi);i.value=V}),{controller:p}=Ke();r.watch(()=>h.value,_=>{_&&(_.canRead?p.show():p.hide())},{immediate:!0});let b=[ye.on("affected-entity",_=>{_.name===t.entity&&g.call()}),ye.on("display-entity",async _=>{_.name===t.entity&&(g.promise&&await g.promise,c(_.name,_.id,i.value.find(I=>I[m.value.fieldNameForIdentification]===_.id)))})];r.onUnmounted(()=>{b.map(_=>_()),p.remove()});function k(_){function I(x){return Array.isArray(x)?I(x[0]):typeof x!="string"?null:x}const V=I(_);if(!V)return;const ee=E.order;B("order",ee[0]!==V?[V,"asc"]:ee[1]==="desc"?[]:[V,"desc"])}function B(_,I){E.update({[_]:I}),g.call()}const P=r.computed(()=>d.wait),E=Dr(c),C=E.cellConfiguration;E.set(t.entity,t.mark),r.watch(()=>E.state.settings,d.call);const S=r.computed(()=>E.state.settings);n({listSettings:S,array:i,config:C});function O(){H.openModal(T.MODAL_LIST_DOWNLOAD,{entity:t.entity,cellConfig:E.cellConfig,order:E.order,prefilters:y(),customFilters:E.customFilters})}return(_,I)=>{const V=r.resolveComponent("widget-button"),ee=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",$r,[r.unref(E).computedLabel.value&&!_.hideLabel?(r.openBlock(),r.createElementBlock("p",Pr,r.toDisplayString(r.unref(E).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(m)?(r.openBlock(),r.createBlock(xr,{key:1,metadata:r.unref(m),tools:r.unref(E).computedTools.value,loading:P.value,"selected-rows":v.value||[],onReload:r.unref(d).call,onExport:O},{default:r.withCtx(()=>{var x;return[r.createVNode(V,{onClick:s,type:"primary",label:"Add New"}),(x=r.unref(h))!=null&&x.canCreate?(r.openBlock(),r.createBlock(V,{key:0,onClick:I[0]||(I[0]=$=>a.value=r.unref(T).LIST_ACTIVE_NEW),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(E).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(V,{key:1,onClick:r.unref(E).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:1},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",Vr,[r.createVNode(Or,{entity:_.entity,"filters-config":r.unref(E).computedFiltersConfiguration.value,filters:r.unref(E).computedPrefilter.value,"onUpdate:filters":I[1]||(I[1]=x=>B("prefilters",x))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(St),{config:r.unref(C),array:i.value,"active-row":l.value,"onUpdate:activeRow":I[3]||(I[3]=x=>a.value=null),onOrder:k,class:"table",selectedRows:v.value,"onUpdate:selectedRows":I[4]||(I[4]=x=>v.value=x)},{"head-cell":r.withCtx(x=>{var $,W,te;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_.$slots["head-cell"]?_.$slots["head-cell"]:It),r.mergeProps({label:x.label},x,{onOrder:k,order:r.unref(E).computedOrder.value,type:x.type,"is-full-selected":(($=v.value)==null?void 0:$.length)===((W=i.value)==null?void 0:W.length)&&((te=i.value)==null?void 0:te.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>{var x,$;return[r.createVNode(ee,{entity:(x=a.value)==null?void 0:x[0],"primary-key":($=a.value)==null?void 0:$[1],"master-entities":_.masterEntities||void 0,binding:_.binding,onFormUpdate:I[2]||(I[2]=()=>{a.value=null,r.unref(g).call()})},null,8,["entity","primary-key","master-entities","binding"])]}),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Lt(e,n={},t={}){const o=r.inject(T.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:n,a=typeof n=="string"?t:n;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(u=>u.name===i);return c?{...c,...a}:null})}const jr=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const n=e,t=Lt(n.name,n.overrideParams||{}),o=r.computed(()=>{if(t.value)return fe(t.value.callback)});return(i,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(t)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(t).label,loading:((c=o.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,u;return(u=(s=o.value)==null?void 0:s.call)==null?void 0:u.call(s,i.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),Ur=r.defineComponent({__name:"WidgetResolverEntity",setup(e){const n=oe.useRouter(),t=oe.useRoute();function o(){const i=t.params.entity,a=t.params.primaryKey;console.log(i,a),et(i,a).then(l=>n.replace(rt(l,a))).catch(l=>{j("error")(l),n.back()})}return r.onMounted(o),(i,a)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(Ye,{label:"Loading..."})]))}}),Wr=r.defineComponent({__name:"modal-list-download",props:{entity:{},cellConfig:{},prefilters:{},order:{},customFilters:{}},setup(e){const n=e,t=r.computed(()=>o.finished?"Download CSV":`Download ${o.count} records.`),{state:o,downloadFile:i,reject:a,start:l}=rn({entity:n.entity,config:n.cellConfig,prefilters:n.prefilters,order:n.order,customFilters:n.customFilters});return H.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>o.finished,()=>{i(),H.popModal()}),(c,s)=>{const u=r.resolveComponent("widget-button"),f=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(f,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=v=>{r.unref(i)(),r.unref(H.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(Ye,{label:"Loading"})])]),_:1})}}});function Rt(e){return Se(e,"YYYY/MM/DD HH:mm:ss")}function Se(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return sn.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function fe(e){function n(...o){if(t.loading)return Promise.reject("The process has already started.");t.loading=!0,t.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{t.wait=!1,t.loading=!1,t.promise=null});return t.promise=i,i}const t=r.reactive({wait:!1,loading:!1,call:n,promise:null});return t}function Je(e){return typeof e=="string"?Ce(e):qr(e)?Ce(e.message,e.children||e.details||[]):Hr(e)?Ce(e.title,[e.detail||""]):Ce(T.DEFAULT_ERROR_MESSAGE)}function qr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Hr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Ce(e,n=[]){return{message:e,children:n}}function j(e="error"){return function(n){const{message:t,children:o}=Je(n);it.add(e,t,{children:o})}}function ae(e,n={}){const t=L();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:read",{entity:e,...n})}function Ot(e){return!!(e.id||e.primaryKey)}function Qe(e,n){const t=L();return Ot(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:update",{...n,entity:e})}function Ze(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ft(e,n=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(n,"0"),o[1].length>n&&(o[1]=o[1].substring(0,n)),o.join(".")}function Gr(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 zr(){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 T.DEFAULT_ERROR_MESSAGE}})}function q(e,n={}){return z.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=z.contextId),n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.reload():t).catch(()=>{throw new Error(T.DEFAULT_ERROR_MESSAGE)}).then(t=>Xr(t).then(o=>{if(!t.ok)throw o;return o}))}function Yr(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function Kr(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Jr=Re(Fe("pretty-value-field-by-entity"));function Qr(e,n,t){try{const o=Ne.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[n];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${n}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(o){return Jr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const ne=Re(Fe("use-socket"));function L(){return eo}function Zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const eo=function(){let e=1,n,t;const o=new Set;let i=0;const a=new Set;function l(){if(n)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{n.close()},En*2);const g=new Uint8Array(1);g[0]=bn,n.send(g)}setInterval(()=>{Array.from(o).forEach(g=>{y(g)&&(ne("Handler for event %s requestId %d was expired",g.event,g.requestId),g.requestId?s({requestId:g.requestId,event:_t,data:{message:Q.RequestTookToLong().message}}):o.delete(g))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&u()},T.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(g){const p=[...o.values()];ne("Handlers array length is %d. Response event: %s. Request id: %d",o.size,g.event,g.requestId),p.forEach(b=>{const k=g.requestId;(b.requestId&&b.requestId===k||!b.requestId&&b.event===g.event)&&(ne("Find appropriated handler: %d, event: %s",e,b.event),b.callback(g.data,g),b.once&&(o.delete(b),ne("Handler was removed by *once* params was passed. %o",b)))})}function u(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),n=new WebSocket(t),n.onclose=function(g){ne("Connection to server was stopped: %d %s",g.code,g.reason),Array.from(o).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(g=>{f(g),a.delete(g)})},n.onerror=function(g){console.warn(g)},n.onmessage=g=>{var p;try{if(Zr(g.data)){l();return}const b=JSON.parse(g.data);if(!Bt(b)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(b);return}(p=b==null?void 0:b.data)!=null&&p.refresh&&location.reload(),s(b)}catch(b){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(b)}}}function f(g){n.send(g)}function v(g,p){d({event:g,callback:p})}function m(g,p){d({event:g,callback:p,once:!0})}function h(){return n&&(n==null?void 0:n.readyState)===1}function w(g,p,b){const k=++e,B=JSON.stringify({requestId:k,event:g,data:p,contextId:z.contextId,url:A.socketURLHandler?A.socketURLHandler():window.location.href});return h()?f(B):(a.add(B),ne("Socket is not connected. Message was send to save-queue")),new Promise((P,E)=>{d({event:g,requestId:k,once:!0,guaranteedAnswer:!0,serializeString:B,callback:(C,S)=>{if(ne("Promise was resolve with next data:",C),to(S))return void E(C);b&&b(C,S),P(C)},timeToLive:T.TIME_TO_LIVE_SOCKET_REQUEST})})}function d(g){const p={timeToLive:0,...g,created:new Date().getTime()};o.add(p)}function y(g){return g.timeToLive===0||typeof g.timeToLive!="number"?!1:new Date().getTime()-g.created>g.timeToLive}return{get socket(){return n},on:v,once:m,emit:w,initialization(g){t=g},getDevInfo:c}}(),to=e=>!!Bt(e)&&e.event===_t,Bt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function xt(e,n){return L().emit("list-setting:read",{entity:e,mark:n})}function no(e,n){return L().emit("metadata-field:treat",{entity:e,fieldName:n})}function Dt(e,n){return L().emit("entity:create",{...n,entity:e})}function $t(e,n){return L().emit("entity:delete",{...n,entity:e})}function ro(e,n){return L().emit("usage-context:read",{...n,entity:e})}function Pt(e={}){return L().emit("tool:read",e)}function oo(){return L().emit("metadata-list:read",{})}function Vt(e,n){return L().emit("batch:update",{...n,entity:e})}function et(e,n){return L().emit("entity:resolve",{primaryKey:n,entity:e})}function io(e){return L().emit("history:read",e)}function ao(e,n){return L().emit("entity:count",{...n,entity:e})}function so(e){return`/${Cn}/${e}`}function de(e){return{exec(n,t){switch(e.name){case"replace-boolean":return de.replaceBoolean(n,e.values);case"replace-record-operation":return de.replaceRecordOperation(n)}}}}de.replaceBoolean=lo;de.replaceRecordOperation=co;function lo(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function co(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function uo(e={}){return L().emit("tool:execute",e)}const fo=Re(Fe("wrap-tool-response"));function Mt(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=go),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=yo),e.handleCloseForm===void 0&&(e.handleCloseForm=vo),e.handleValidationResult===void 0&&(e.handleValidationResult=ho),{...n,label:n.title,async callback(t={}){var l;const o=typeof e.values=="function"?e.values(n,e):e.values;let i={};n.action.targetName==="Record"&&o.hasOwnProperty("Id")&&(i.Id=o.Id,delete o.Id);const a=()=>uo({name:n.name,values:{...o,...t},primaryKeys:i,usageContext:n.usageContext}).then(async c=>{var s,u;if(!po(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const f of e.handlers)await f(n,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((u=(s=c.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(n,c.validationEffect,e),new Error(c.message);return c.message&&it.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(f=>{var v;return(v=e.handleAffectedEntity)==null?void 0:v.call(e,n,f,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),c}).catch(j("error"));if((l=e.overrides)!=null&&l[n.name])return e.overrides[n.name](n,e);if(n.paramDialog){const c=await wo(n,e);if(c===null)return;t=Object.assign(t,c||{})}return n.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!n.confirmation||!e.handleConfirmation||n.paramDialog?a():e.handleConfirmation(n,a)}}}function po(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function mo(e){const n="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?n:typeof e=="string"?e:n}async function go(e,n){const t=mo(e.confirmation);if(!H.getComponentFromStore(T.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await H.promptModal(T.MODAL_CONFIRM,{message:t}))return n()}function ho(e,n){const t=T.MODAL_VALIDATION_EFFECT;if(!H.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{H.pushModal(t,n)})}function yo(e,n,t){var s;function o(u){return u!==null&&typeof u=="object"&&typeof u.read=="function"}function i(u,f){u&&(fo("Affected Entity %s. Find form with name %s.",f,u.name),u.name===f&&o(u)&&u.read(),u instanceof F.Form&&u.dependencies.forEach(v=>i(v,f)))}ye.emit("affected-entity",n);const{router:a,form:l}=t,c=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){ye.emit("display-entity",{id:c,name:n.name}),A.getEntityLink&&a.push(A.getEntityLink(n.name,c));return}i(l,n.name)}function vo(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}function wo(e,n){var t;if((t=e.paramDialog)!=null&&t.name)return H.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:n})}let re={};function Z(e,...n){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let t=F.utils.getPropFromObject((this==null?void 0:this.vocabulary)||re,e);if(typeof t=="string")return pt(t,n);const o=F.utils.getPropFromObject(re==null?void 0:re.root,e);return typeof o=="string"?pt(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function pt(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}Z.setGlobalVocabulary=function(e){re=e};Z.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:F.utils.getPropFromObject(re,n.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(re,e)),Z.bind({vocabulary:e})};function bo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ue={exports:{}},R={},We={exports:{}},se={};function jt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function Eo(e,n,t){}function Co(e,n,t){}var ko=/javascript\s*\:/img;function _o(e,n){return ko.test(n)?"":n}se.whiteList=jt();se.getDefaultWhiteList=jt;se.onAttr=Eo;se.onIgnoreAttr=Co;se.safeAttrValue=_o;var To={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},me=To;function Ao(e,n){e=me.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function c(){if(!o){var f=me.trim(e.slice(i,a)),v=f.indexOf(":");if(v!==-1){var m=me.trim(f.slice(0,v)),h=me.trim(f.slice(v+1));if(m){var w=n(i,l.length,m,h,f);w&&(l+=w+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var u=e.indexOf("*/",a+2);if(u===-1)break;a=u+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||c():s===`
7
- `&&c()}return me.trim(l)}var So=Ao,ke=se,Io=So;function mt(e){return e==null}function No(e){var n={};for(var t in e)n[t]=e[t];return n}function Ut(e){e=No(e||{}),e.whiteList=e.whiteList||ke.whiteList,e.onAttr=e.onAttr||ke.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ke.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ke.safeAttrValue,this.options=e}Ut.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onAttr,a=t.onIgnoreAttr,l=t.safeAttrValue,c=Io(e,function(s,u,f,v,m){var h=o[f],w=!1;if(h===!0?w=h:typeof h=="function"?w=h(v):h instanceof RegExp&&(w=h.test(v)),w!==!0&&(w=!1),v=l(f,v),!!v){var d={position:u,sourcePosition:s,source:m,isWhite:w};if(w){var y=i(f,v,d);return mt(y)?f+":"+v:y}else{var y=a(f,v,d);if(!mt(y))return y}}});return c};var Lo=Ut;(function(e,n){var t=se,o=Lo;function i(l,c){var s=new o(c);return s.process(l)}n=e.exports=i,n.FilterCSS=o;for(var a in t)n[a]=t[a];typeof window<"u"&&(window.filterCSS=e.exports)})(We,We.exports);var tt=We.exports,nt={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var n=/\s|\n|\t/,t=n.exec(e);return t?t.index:-1}},Ro=tt.FilterCSS,Oo=tt.getDefaultWhiteList,Ie=nt;function Wt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qt=new Ro;function Fo(e,n,t){}function Bo(e,n,t){}function xo(e,n,t){}function Do(e,n,t){}function Ht(e){return e.replace(Po,"&lt;").replace(Vo,"&gt;")}function $o(e,n,t,o){if(t=Jt(t),n==="href"||n==="src"){if(t=Ie.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return""}else if(n==="background"){if(_e.lastIndex=0,_e.test(t))return""}else if(n==="style"){if(gt.lastIndex=0,gt.test(t)||(ht.lastIndex=0,ht.test(t)&&(_e.lastIndex=0,_e.test(t))))return"";o!==!1&&(o=o||qt,t=o.process(t))}return t=Qt(t),t}var Po=/</g,Vo=/>/g,Mo=/"/g,jo=/&quot;/g,Uo=/&#([a-zA-Z0-9]*);?/gim,Wo=/&colon;?/gim,qo=/&newline;?/gim,_e=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,gt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ht=/u\s*r\s*l\s*\(.*/gi;function Gt(e){return e.replace(Mo,"&quot;")}function zt(e){return e.replace(jo,'"')}function Xt(e){return e.replace(Uo,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Yt(e){return e.replace(Wo,":").replace(qo," ")}function Kt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return Ie.trim(n)}function Jt(e){return e=zt(e),e=Xt(e),e=Yt(e),e=Kt(e),e}function Qt(e){return e=Gt(e),e=Ht(e),e}function Ho(){return""}function Go(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:Ie.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",f=s.position+u.length;return i.push([a!==!1?a:s.position,f]),a=!1,u}else return a||(a=s.position),"[removed]";else return n(l,c,s)},remove:function(l){var c="",s=0;return Ie.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function zo(e){for(var n="",t=0;t<e.length;){var o=e.indexOf("<!--",t);if(o===-1){n+=e.slice(t);break}n+=e.slice(t,o);var i=e.indexOf("-->",o);if(i===-1)break;t=i+3}return n}function Xo(e){var n=e.split("");return n=n.filter(function(t){var o=t.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),n.join("")}R.whiteList=Wt();R.getDefaultWhiteList=Wt;R.onTag=Fo;R.onIgnoreTag=Bo;R.onTagAttr=xo;R.onIgnoreTagAttr=Do;R.safeAttrValue=$o;R.escapeHtml=Ht;R.escapeQuote=Gt;R.unescapeQuote=zt;R.escapeHtmlEntities=Xt;R.escapeDangerHtml5Entities=Yt;R.clearNonPrintableCharacter=Kt;R.friendlyAttrValue=Jt;R.escapeAttrValue=Qt;R.onIgnoreTagStripAll=Ho;R.StripTagBody=Go;R.stripCommentTag=zo;R.stripBlankChar=Xo;R.attributeWrapSign='"';R.cssFilter=qt;R.getDefaultCSSWhiteList=Oo;var Be={},J=nt;function Yo(e){var n=J.spaceIndex(e),t;return n===-1?t=e.slice(1,-1):t=e.slice(1,n+1),t=J.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function Ko(e){return e.slice(0,2)==="</"}function Jo(e,n,t){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",f="";e:for(c=0;c<s;c++){var v=e.charAt(c);if(a===!1){if(v==="<"){a=c;continue}}else if(l===!1){if(v==="<"){o+=t(e.slice(i,c)),a=c,i=c;continue}if(v===">"||c===s-1){o+=t(e.slice(i,a)),f=e.slice(a,c+1),u=Yo(f),o+=n(a,o.length,u,f,Ko(f)),i=c+1,a=!1;continue}if(v==='"'||v==="'")for(var m=1,h=e.charAt(c-m);h.trim()===""||h==="=";){if(h==="="){l=v;continue e}h=e.charAt(c-++m)}}else if(v===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Qo=/[^a-zA-Z0-9\\_:.-]/gim;function Zo(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function c(m,h){if(m=J.trim(m),m=m.replace(Qo,"").toLowerCase(),!(m.length<1)){var w=n(m,h||"");w&&i.push(w)}}for(var s=0;s<l;s++){var u=e.charAt(s),f,v;if(a===!1&&u==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:ti(e,s+1);continue}if(a!==!1&&s===o){if(v=e.indexOf(u,s+1),v===-1)break;f=J.trim(e.slice(o+1,v)),c(a,f),a=!1,s=v,t=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(v=ei(e,s),v===-1){f=J.trim(e.slice(t,s)),c(f),a=!1,t=s+1;continue}else{s=v-1;continue}else if(v=ni(e,s-1),v===-1){f=J.trim(e.slice(t,s)),f=yt(f),c(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?c(e.slice(t)):c(a,yt(J.trim(e.slice(t))))),J.trim(i.join(" "))}function ei(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ti(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function ni(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ri(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function yt(e){return ri(e)?e.substr(1,e.length-2):e}Be.parseTag=Jo;Be.parseAttr=Zo;var oi=tt.FilterCSS,G=R,Zt=Be,ii=Zt.parseTag,ai=Zt.parseAttr,Ae=nt;function Te(e){return e==null}function si(e){var n=Ae.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ae.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=Ae.trim(e.slice(0,-1))),{html:e,closing:t}}function li(e){var n={};for(var t in e)n[t]=e[t];return n}function ci(e){var n={};for(var t in e)Array.isArray(e[t])?n[t.toLowerCase()]=e[t].map(function(o){return o.toLowerCase()}):n[t.toLowerCase()]=e[t];return n}function en(e){e=li(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=G.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ci(e.whiteList||e.allowList):e.whiteList=G.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":G.attributeWrapSign,e.onTag=e.onTag||G.onTag,e.onTagAttr=e.onTagAttr||G.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||G.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||G.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||G.safeAttrValue,e.escapeHtml=e.escapeHtml||G.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new oi(e.css))}en.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onTag,a=t.onIgnoreTag,l=t.onTagAttr,c=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,f=n.attributeWrapSign,v=n.cssFilter;t.stripBlankChar&&(e=G.stripBlankChar(e)),t.allowCommentTag||(e=G.stripCommentTag(e));var m=!1;t.stripIgnoreTagBody&&(m=G.StripTagBody(t.stripIgnoreTagBody,a),a=m.onIgnoreTag);var h=ii(e,function(w,d,y,g,p){var b={sourcePosition:w,position:d,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(o,y)},k=i(y,g,b);if(!Te(k))return k;if(b.isWhite){if(b.isClosing)return"</"+y+">";var B=si(g),P=o[y],E=ai(B.html,function(C,S){var O=Ae.indexOf(P,C)!==-1,_=l(y,C,S,O);return Te(_)?O?(S=s(y,C,S,v),S?C+"="+f+S+f:C):(_=c(y,C,S,O),Te(_)?void 0:_):_});return g="<"+y,E&&(g+=" "+E),B.closing&&(g+=" /"),g+=">",g}else return k=a(y,g,b),Te(k)?u(g):k},u);return m&&(h=m.remove(h)),h};var ui=en;(function(e,n){var t=R,o=Be,i=ui;function a(c,s){var u=new i(s);return u.process(c)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var c in t)n[c]=t[c];for(var s in o)n[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(Ue,Ue.exports);var fi=Ue.exports;const di=bo(fi);function pi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),di(e)}function mi(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function gi(e,n){const t={dir:e<0?n==="long"?"W":"S":n==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`}function rt(e,n){const t=["forms",e];return n&&t.push(n),"/"+t.join("/")}function hi(e,n){return"/"+[T.PATH_RESOLVER_ENTITY,e,n].join("/")}function qe(e,n,t){const o=Z.getScope(e.toLowerCase());return n.map(i=>{typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=l=>H.openModal("modal-history",{id:l.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History");const a=i.displayMode;if(a){const l=async c=>{try{const s=c[ie(i)];return[await et(vi(i,c),s),s]}catch{return[]}};a&&(a==="form"?i.link=c=>hi(i.entity,c[ie(i)]):i.onClick=async c=>{const[s,u]=await l(c);if(!s||!u)return null;switch(i.displayMode){case"modal":return H.openModal(T.MODAL_ENTITY,{entity:s,primaryKey:u});case"inline":return t.activate(s,u,c)}}),i.class="widget-table-cell_link cursor_pointer",i.value=(c,s)=>s[i.name[1]]}return yi(i,i.type,i.presentation),A.listConvertCellConfigHandler&&A.listConvertCellConfigHandler(e,i),i})}function yi(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const vi=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function vt(e){return typeof e!="object"||e===null?null:e[T.TABLE_MOCK_FIELD]}function wi(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[T.TABLE_MOCK_FIELD]=n):e[T.TABLE_MOCK_FIELD]=e.Id,e)}function bi(e){if(!Array.isArray(A.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");A.arrayListCellHandlers.push(e)}function Ei(e,n){const t=ie(e);return t?F.utils.getPropFromObject(n,t):null}function Ci(e){if(!Array.isArray(A.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");A.arrayFieldParamsHandlers.push(e)}const ki={addListCellHandler:bi,getCellModelValue:Ei,addFieldParamsHandler:Ci};var tn=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(tn||{});function _i(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function Ti(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function nn(e,n){e()&&(await n(),await nn(e,n))}function Ai(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(E=>u(E,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(t==null?void 0:t.filterSearchFn)||((E,C)=>Ti(E,C));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function v(){const E=k();return typeof E.limit!="number"&&(E.limit=100),E.offset=c,(t.request||ae)(e,E).then(S=>(c+=S.length,S))}function m(E,C){var O;return typeof E.Version=="number"?E.Version:(O=l.find(_=>_.Id===C))==null?void 0:O.Version}function h(E,C){const S=l.findIndex(O=>O.Id===E);if(S===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(S,1,C)}function w(E){const C=l.findIndex(S=>S.Id===E);if(C===-1)throw new Error(`Can't found item with Id ${E}`);l.splice(C,1)}async function d(E,C){try{const S=k(),O=m(C,E);delete C.Version,await Qe(e,{id:E,values:C,version:O,masterEntities:f()});const _=await ae(e,{fields:S.fields||"",id:E});h(E,_)}catch(S){j()(S)}}async function y(E,C={}){try{const S=k(),O=m(C,E);delete C.Version,await $t(e,{id:E,version:O,masterEntities:f()}),w(E)}catch(S){j()(S)}}async function g(E){try{await Dt(e,{values:E,masterEntities:f()}),await B()}catch(C){j()(C)}}let p;async function b(){s.value=!0;try{p!=null&&p.signal&&!p.signal.aborted&&p.abort();let E=p=new AbortController,C=0;const O=k().limit||0;if(i.value&&!O){console.warn("Using textSearch assumes the use of limit.");return}await nn(()=>(O>0?C<O:!0)&&!o&&!E.signal.aborted,async()=>{const _=await v();E.signal.aborted||(l.push(..._),C+=_.filter(I=>u(I,i.value)).length,(_.length<O||O===0)&&(o=!0))})}catch(E){j()(E)}s.value=!1}function k(){return typeof n=="function"?n():n}async function B(){try{c=0,o=!1,l.splice(0,l.length),await b()}catch(E){j()(E)}}function P(){if(p)return p.abort();s.value=!1}return{array:l,updateById:d,next:b,reload:B,wait:s,create:g,deleteById:y,textSearch:i,filteredArray:a,abort:P}}function Si(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const n=r.reactive(e());return z.onupdateContext(()=>{Object.assign(n,e())}),n}function Ii(e,n,t){return L().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function Ni(e,n,t){return L().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function Li(e,n){return L().emit("communication-message:create",{communicationId:e,text:n})}function Ri(e){return L().emit("communication-message:read",{communicationId:e})}function Oi(e){const n=F.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>Ri(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 Q.EntityWithoutName(e);return ae(e.name,o)}).then(st).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(j())},e.save=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Qe(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw j()(i),i})};function t(){return typeof n=="function"?n():n}}function xe(e){if(!e)return r.inject(T.PROVIDE_NAME_METADATA);Ne.initEntity(e);const n=r.computed(()=>Ne.state[e]);return r.provide(T.PROVIDE_NAME_METADATA,n),n}function ot(e,n={}){if(!e)return r.inject(T.PROVIDE_NAME_USAGE_CONTEXT);const t=r.ref(null);return r.provide(T.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await ro(e,Bi(n||{}))}}}function Bi(e){return typeof e=="function"?e():e}function xi(e){if(!e)return r.inject(T.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Mt(e,l))),i={actions:o,update:a};r.provide(T.PROVIDE_NAME_ACTIONS,i),e.router=oe.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return Pt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>t.splice(0,0,...c)).catch(j("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function Di(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function $i(e,n={}){const t=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){t.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>t.includes(s),a=s=>{n.handleSelect&&!n.handleSelect(s)||i(s)||t.push(s)},l=s=>{const u=t.findIndex(f=>f===s);u!==-1&&t.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,c,a,l]}function Pi(e){const n=r.ref(""),t=r.computed(()=>{const o=n.value.toLowerCase();return r.unref(e).filter(i=>n.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:n,searchArray:t}}class Me{static async getStartConfig(n,t){return L().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return L().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return L().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function Vi(e){return e.statusName===M.Completed}function Mi(e){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation].includes(e.statusName)}function ji(e){return e.statusName===M.ValidationError}function Ui(e){return e.statusName===M.Undefined}function Wi(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>v(i,l.value)),s=r.ref(null),u=r.reactive([]),f=r.computed(()=>u.map(p=>v(i,p)));function v(p,b){return p.find(k=>k.name===b)||null}async function m(p){var b;if(Ui(p)){await t.onDisplayDataSet(p);return}if(!(Mi(p)&&!await t.onDisplayDataSet(p))){if(ji(p))return void t.onValidation(p.validationResults);d(p),await r.nextTick();{const k=((b=v(i,l.value))==null?void 0:b.fields)||[];if([M.FinalStep,M.NextStep,M.FinalStepWithConfirmation,M.NextStepWithConfirmation].includes(p.statusName)&&(!k.length||qi(k,t.presets)))return g(t.presets||{})}Vi(p)&&t.onCompleted(p)}}async function h(){try{await w(),await y()}catch(p){j("error")(p)}}function w(){return a.value="Loading process information.",Me.getStartConfig(n,e).then(p=>(s.value={label:p.processTitle,info:p.processInfo,icon:p.processIcon},i=p.steps.map(b=>{const k=b.frontendEntity.rootObject,B=Object.fromEntries(b.frontendEntity.objectTypes.map(P=>[P.name,P.properties]));return{label:b.title,name:b.stepName,number:b.number,rootObjectName:k,objectTypes:B,fields:B[k],buttonCaption:b.buttonCaption}}))).finally(()=>{a.value=!1})}function d(p){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation,M.NextStep,M.Completed,M.FinalStep].includes(p.statusName)?(o=p.token,l.value=p.nextStepName):console.log("Saving is not completed:",p),p}function y(){return a.value="Starting process",Me.startProcess(n,e).then(m).catch(j("error")).finally(()=>{a.value=null})}function g(p={}){const b=l.value;return!o||!b?Promise.reject("Not step or token."):(a.value="Waiting for result...",Me.runStep(n,e,b,o,p).then(m).then(k=>(u[u.length-1]!==b&&u.push(b),k)).catch(j("error")).finally(()=>{a.value=!1}))}return{initialize:h,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:u,processInfo:s,next:g}}function qi(e,n){for(let t=0;t<e.length;t++){const o=e[t];if(!F.utils.getPropFromObject(n,o.name))return!1}return!0}function Hi(e,n){const t=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,n||{});return{name:t,arguments:o}}function Gi(e){return e.limit||(e.limit=150),e}function rn(e,n={}){const{limit:t}=Gi(n),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(d=>f(d.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function f(d){d===null&&(d=""),d===void 0&&(d="-");let y=typeof d!="string"?String(d):d;return y=y.replace(/"/g,'""'),y.search(/("|,|\n)/g)>=0&&(y='"'+y+'"'),y}function v(){return ae(a,{fields:Ze(l).join(" "),limit:t,offset:u.offset,order:i,filter:typeof o=="string"?o:D(o||{}),customFilters:c.map(d=>{var y;return Hi(d,(y=n.customFiltersData)==null?void 0:y[typeof d=="string"?d:d.name])})}).then(d=>(u.offset+=t,d))}function m(){const d="data:text/csv;charset=utf-8,"+s.join(`\r
8
- `),y=encodeURI(d),g=document.createElement("a");g.setAttribute("href",y),g.setAttribute("download",`${a}.csv`),document.body.appendChild(g),g.click()}function h(){u.rejected=!0}async function w(){return v().then(d=>{const y=d.map(g=>l.map(p=>f(Oe(p,g))).join(","));return s.push(...y),u.count=s.length,d.length}).then(d=>{if(d!==t&&(u.finished=!0),d===t&&!u.rejected)return w()})}return{downloadFile:m,reject:h,state:u,start:w}}const it=new class{constructor(){this.store=r.reactive([])}add(n,t,o={}){const i=zi(o),a=new He(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 zi(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 Le=class Le{constructor(n,t,o,i,a){this.type=n,this.message=t,this.timeout=o,this.children=i,this.click=a,this.id=Le.cardId++}};Le.cardId=1;let He=Le;/*!
5
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),F=require("jenesius-vue-form"),ne=require("vue-router"),sn=require("date-and-time"),Re=require("debug"),q=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 Q=N;const ln="Please try again later or submit a feedback if problem doesn't go.";function cn(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return ln}})}function se(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Q.ApiNotAvailable()}).then(t=>cn(t).then(o=>{if(!t.ok)throw o;return o}))}class un{constructor(){this.public=!1,this.errors=new Proxy([],{set:(n,t,o)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),n[t]=o,!0)}),window._journal=this}get error(){return{add:(...n)=>{this.errors.push(n)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new un;class fn{static invite(n,t,o){return se("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:n,personKey:t,relatedRoleCode:o})})}static accept(n,t){return se("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!0})})}static decline(n,t){return se("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class dn{static getRequiredDocuments(n,t,o){const i=new URLSearchParams({entity:n,primaryKey:t,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ae{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${ae.url()}/calculator/${n}`)}static calculate(n,t){return se(`/${ae.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:n,values:t})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(n){function t(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:n.name,label:n.title,required:n.required,type:t(n)}}static createOnlinePayment(n,t){return se(`/${ae.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return se(`/${ae.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const pn={class:"widget-table__head-cell"},mn={key:1,class:"widget-table__head-label margin_0 text_overflow"},Ct=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:n}){const t=n;function o(){t("select")}return(i,a)=>(r.openBlock(),r.createElementBlock("th",pn,[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,onClick:o})):(r.openBlock(),r.createElementBlock("span",mn,r.toDisplayString(i.label),1))]))}}),gn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>Ct),(n,t)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,o=>r.renderSlot(n.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),M=(e,n)=>{const t=e.__vccOpts||e;for(const[o,i]of n)t[o]=i;return t},yn=M(hn,[["__scopeId","data-v-aa18d6fa"]]);function ze(e){return Array.isArray(e)?ze(e[0]):typeof e!="string"?null:e}function re(e){return ze(e.name)}function vn(e){const n=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),t=[];let o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function bn(e,n){return vn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),F.utils.getPropFromObject(n,o))}),e}function je(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Oe(e,n){const t=re(e);if(typeof e.value=="string")return bn(e.value,n);let o=t?F.utils.getPropFromObject(n,t):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,n);if(e.value===null)return null;switch(e.unitValue&&(o=je(e.unitValue)(o)),e.unit&&(o=je(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Se(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Nt(typeof o=="string"?o:null);break}case"money":{o=Ot(o);break}case"DateTime":{o=Se(typeof o=="string"?o:null,e.format||I.dateTimeFormat);break}}return e.formatter&&(o=ue(e.formatter).exec(o,n)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,En=5e3,Cn="static-folder",kt="request-error",_t="EntityTypeName",kn="REFERENCE_CHANGES",S={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",MODAL_BATCH_VALUES:"batch-values",MODAL_ENTITY:"form-entity",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:_t,FIELD_NAME_REFERENCE_CHANGES:kn,PATH_RESOLVER_ENTITY:"resolver"};function Fe(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const _n={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>t.values,l=>{if(typeof l!="string")return i.value="";i.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",_n,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),An=M(Tn,[["__scopeId","data-v-800b3803"]]),Sn={class:"widget-filter-enum"},In={class:"flex gap-10 padding-10"},Ln=r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,o=r.ref([]),i=xe(t.filterMetadata.entity),a=f=>(t.values||[]).includes(f),l=n;function c(f){const v=t.values||[];return v.includes(f)?l("update:values",v.filter(m=>m!==f)):l("update:values",[...v,f])}const s=ce(async()=>{o.value=await oe(t.baseEntity,{fields:t.filterMetadata.name.join(" "),order:[t.filterMetadata.name[1],"asc"],distinct:!0,filter:x(t.filters)}).then(f=>f.map(v=>({label:v[t.filterMetadata.name[1]],value:v[t.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,f=>{l("readProcess",f?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(f,v)=>{const m=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Sn,[r.createElementVNode("div",In,[r.createVNode(m,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:v[0]||(v[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(m,{label:"Clear",onClick:u})]),(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:()=>c(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))])}}}),Nn=M(Ln,[["__scopeId","data-v-cd8043dd"]]),me=r.reactive({});function Rn(){ct(),setInterval(ct,50)}function Tt(){return me}function ct(){const e={};Object.entries(localStorage).forEach(([n,t])=>{e[n]=!0,me[n]!==t&&(me[n]=t)}),Object.keys(me).forEach(n=>{e[n]||delete me[n]})}const I={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:An,Entity:Nn},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function On(e){Rn();for(let n in e)I[n]=e[n]}const Fn={props:{name:String},setup(e,n){let t="unknown";try{t=n.slots.default()[0].children}catch{t=e.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>r.h(I.iconTag,{class:I.iconHandler?I.iconHandler(t):`icon icon-${t}`},I.iconHandlerText(t))}},ge=M(Fn,[["__scopeId","data-v-8a72b45f"]]),Bn=Re(Fe("setup-list-row"));function xn(e,n){const t=e.config.map(o=>Dn(o,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function Dn(e,n,t){const o=n.values;let i=Oe(e,o);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(f){a.onClick.push(()=>f(o,e,t))}function c(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],u=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{u.push(r.h(F.FormField,{type:"single-checkbox",modelValue:n.selected})),l(ut.bind(null,t,!0));break}case"select":{u.push(r.h(F.FormField,{type:"single-radio",modelValue:n.selected})),l(ut.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const v=r.h(ne.RouterLink,{to:f});u.push(v),c("widget-table-cell_link")}}catch(f){Bn("Can't add router link",f)}if(e.href&&(u.push(r.h("a",{href:e.href(o),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&u.push(r.h(ge,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&u.push(r.h(ge,{name:f}))}return e.class&&(typeof e.class=="function"?c(e.class(o)):c(e.class)),I.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),I.listCellHandler(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),I.arrayListCellHandlers&&I.arrayListCellHandlers.forEach(f=>f(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:t})),s.push(r.h("td",a,u)),s}function ut(e,n){e.emit("select",n)}function Xe(e,n){return()=>{try{return xn(e,n)}catch(t){return console.warn(t),null}}}const $n={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Pn=["colspan"],ft=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:n}){const t=n,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=l=>t("close")),onSave:a[1]||(a[1]=l=>t("save",l))}),null,16,["values","new"]))],8,Pn)],512))}}),Vn={class:"widget-table"},Ve="update:selectedRows",Mn="update:activeRow",At=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:n}){const t=e,o=n,i=r.useSlots(),a=r.computed(()=>{var g;return(g=i==null?void 0:i.default)==null?void 0:g.call(i)[0]});function l(){const b=t.selectedRows.length!==0?[]:[...t.array];o(Ve,b)}function c(g){return t.useMockField?yt(g):g}function s(g,b=!0){if(!t.selectedRows)return;if(!b)return o(Ve,t.selectedRows.includes(g)?[]:[g]);const d=[...t.selectedRows],h=d.indexOf(g);return h===-1?d.push(g):d.splice(h,1),o(Ve,d)}function u(g){o(Mn,g)}function f(g){o("save",g),o("update:activeRow",null)}const v=r.computed(()=>t.shortcut?t.config.filter(g=>g.name?!!t.array.find(d=>![null,""].includes(Oe(g,d))):!0):t.config),m=r.computed(()=>t.useMockField?t.array.filter(yt):t.array);return(g,b)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Vn,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:v.value,onOrder:b[0]||(b[0]=d=>g.$emit("order",d))},{default:r.withCtx(d=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]||Ct),r.mergeProps(d,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(d,h)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:h},[r.createVNode($n,{config:v.value,values:d,selected:g.selectedRows.includes(c(d)),onSelect:y=>s(c(d),y),onActivate:y=>u(c(d)),class:r.normalizeClass(g.classCallback?g.classCallback(d):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&g.activeRow===c(d)?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":g.config.length,values:d,onClose:b[1]||(b[1]=y=>o("update:activeRow",null)),onSave:f,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),g.activeRow===r.unref(S).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":v.value.length,onClose:b[2]||(b[2]=d=>o("update:activeRow",null)),onSave:f,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),jn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${n.color}`})},null,4))}}),ve=M(jn,[["__scopeId","data-v-0ef9ae88"]]),Un={class:"widget-button"},Wn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Un,[n.wait?(r.openBlock(),r.createBlock(ve,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),qn=M(Wn,[["__scopeId","data-v-450dc564"]]),Hn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Gn={class:"widget-multi-button-body grid"},zn=["onClick"],Xn={class:"widget-multi-button-side-wrap"},Yn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"04895bf1":o.value}));const n=e,t=r.reactive({active:!1,wait:!1}),o=r.computed(()=>n.array.length+(n.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function a(l=!t.active){t.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Gn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,u)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:f=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,zn))),128))]),r.createElementVNode("div",Xn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(ve),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Kn=M(Yn,[["__scopeId","data-v-d43a76ce"]]),Jn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Qn={class:"text_md"},Ye=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",Jn,[r.createVNode(ve,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Qn,r.toDisplayString(n.label),1)]))}}),Zn=["alt","src"],er=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const n=e,t=r.ref();return r.onMounted(()=>{t.value&&(t.value.src=n.src),t.value.onerror=function(){n.default&&(t.value.src=n.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:t,src:o.src||o.$props.default},null,8,Zn))}}),tr={props:{config:Array,values:Object,selected:Boolean},setup:Xe},nr=M(tr,[["__scopeId","data-v-344a8cc1"]]),rr=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),or={class:"widget-list-head-cell"},ir=rr(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ar=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:n}){const t=e,o=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",or,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(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(ge),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),ir])]))}}),sr=M(ar,[["__scopeId","data-v-bf495d6a"]]),lr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:n}){const t=e,o=n,i=r.ref(),a=r.ref();r.onMounted(()=>{function u(b,d){let h=-1;do h++,d-=b[h];while(d>0&&h<b.length);return h}function f(b,d){let h=0;for(;d>0&&d>b[h]&&h<b.length;)d-=b[h],h++;return console.log(d,h),h>0?h:0}function v(b){try{a.value.style.insetInlineStart=b+"px"}catch(d){console.log(d)}}function m(b){try{a.value.style.width=b+"px",a.value.style.minWidth=b+"px",a.value.style.maxWidth=b+"px"}catch(d){console.log(d)}}function g(b){return b===null?!1:b.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(d){var fe;function h($){return $.screenX+w-D}const y=i.value,p=[...y.children].filter($=>$.localName==="th"),w=((fe=y.offsetParent)==null?void 0:fe.scrollLeft)||0,T=p.map($=>$.clientWidth),A=g(d.target),D=y.getBoundingClientRect().left,k=h(d),C=u(T,k),E=T.slice(0,C).reduce(($,G)=>$+G,0),_=k-E,L=y.offsetWidth,U=p[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",d.screenX),console.log("Widths",T),console.log("max width",L),console.log("Start Position",k),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",_),console.groupEnd(),a.value.innerText=p[C].textContent||"",a.value.style.display="grid",a.value.style.width=U+"px",a.value.style.cursor="grabbing",v(E),m(U),document.addEventListener("pointermove",Y,{passive:!0}),document.addEventListener("pointerup",B);function B($){if(console.group("END"),document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",B),A&&(t.config[C].width=a.value.style.width,t.config[C].minWidth=a.value.style.width,t.config[C].maxWidth=a.value.style.width,l(t.config)),!A){const G=$.screenX+w-D;console.log("ENP Position",G);const we=f(T,G);if(console.log(C,"->",we),we!==C){const de=t.config[C],De=t.config;De.splice(C,1),De.splice(we,0,de),l(De)}else{const de=t.config[C].name;c(de)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Y($){if(A){const de=h($)-k+U;m(de);return}let G=$.screenX+w-D-_;G<0&&(G=0),G+U>L&&(G=L-U),v(G)}})});function l(u){o("update:config",u)}function c(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(v,m)=>(r.openBlock(),r.createBlock(sr,r.mergeProps({key:v,ref_for:!0},v,{onOrder:g=>c(v.name),onSelect:f[0]||(f[0]=g=>o("select")),order:u.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),cr=M(lr,[["__scopeId","data-v-ccffc6bd"]]),ur={class:"widget-list"},fr={class:"widget-list-body position_relative"},dr=50,pr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:n}){const t=e,o=n;function i(s,u=!0){if(t.selectedRows)if(!u)l(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],v=f.indexOf(s);v===-1?f.push(s):f==null||f.splice(v,1),l(f)}}function a(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return l([...t.array]);l([])}function l(s){o("update:selectedRows",s)}function c(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+dr>u.scrollHeight&&o("scrollEnd")}return(s,u)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",ur,[r.createElementVNode("thead",null,[r.createVNode(cr,{onSelect:u[0]||(u[0]=f=>a()),"onUpdate:order":u[1]||(u[1]=f=>o("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>o("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(f,v)=>{var m;return r.openBlock(),r.createBlock(nr,{key:v,class:"widget-list-row",values:f,config:s.config,selected:(m=s.selectedRows)==null?void 0:m.includes(f),onSelect:g=>i(f,g)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ke(){var a;const e=r.computed(()=>Object.keys(t).length===0||Object.values(t).includes(!0)),n=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!n)throw"Undefined instance. Please check it.";const t=r.reactive({});r.provide(S.VISIBLE_ITEM_PROVIDE_NAME,{show(l){t[l]=!0},hide(l){t[l]=!1},remove(l){delete t[l]}});const o=r.inject(S.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(n)},hide(){o==null||o.hide(n)},remove(){o==null||o.remove(n)}},visibleItems:t}}const mr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const n=e,t=xe(),o=rt(),i=r.computed(()=>{var d,h,y;const m=s.value,g=u(m),b={type:g,disabled:n.usageContext?!((d=c.value)!=null&&d.canSet):!1,label:n.label};return g==="Decimal"&&((y=(h=m==null?void 0:m.presentationType)==null?void 0:h.toLowerCase)==null?void 0:y.call(h))==="money"&&(b.money=!0),m&&Object.assign(b,{suffix:g==="number"?m.valueUnit:void 0,required:l.includes(g||"")?!1:m.required,label:n.label||m.displayName}),Array.isArray(I.arrayFieldParamsHandlers)&&I.arrayFieldParamsHandlers.forEach(p=>Object.assign(b,p(m,c.value,b))),b}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var m;return(m=o==null?void 0:o.value)==null?void 0:m.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const m=t.value.fieldsByName[n.name];if(m)return m});function u(m){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(m){if(m.type==="Reference"||m.type==="Owned")return m.referencedEntity;if(m.dataType==="Boolean")return"single-checkbox";if(m.dataType==="DateTime")return"date";if(m.dataType==="Integer"||m.dataType==="Decimal")return"number";if(m.dataType==="List")return m.aggregatedEntity;if(a.includes(m.presentationType))return"textarea";if(m.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var m;return n.usageContext?((m=c.value)==null?void 0:m.canGet)===!0:!0}),{controller:v}=Ke();return r.watch(()=>f.value,m=>m?v.show():v.hide(),{immediate:!0}),r.onUnmounted(()=>v.remove()),(m,g)=>f.value?(r.openBlock(),r.createBlock(r.unref(F.FormField),r.mergeProps({key:0},{...m.$attrs,...i.value},{name:m.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function gr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||S.DEFAULT_ORDER_DIR}const hr=["fill"],yr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),vr=[yr],br=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},vr,8,hr))}}),wr={class:"widget-fast-table-head-cell-td"},Er={key:1,class:"widget-head-cell-label"},Cr={key:2,class:"widget-head-cell-order"},kr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:n}){const t=e,o=r.computed(()=>ze(t.name));r.computed(()=>gr(t.order));const i=n;function a(){i("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",wr,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=u=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",Er,r.toDisplayString(l.label),1)),o.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",Cr,[r.createVNode(br,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),St=M(kr,[["__scopeId","data-v-d131e64e"]]),_r=["fill"],Tr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Ar=[Tr],Sr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},Ar,8,_r))}}),Ir={class:"widget-filter-item-popup"},Lr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,o=n,i=I.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const g=t.filterItem;return g.entity?"Entity":g.type?g.type:null});function c(g){s.value=g==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),f=r.ref(!1);let v=null;function m(g=!f.value){f.value=g,!f.value&&v?(v(),v=null):a.value&&(v=F.utils.clickOutside(a.value,m.bind(null,!1)))}return(g,b)=>{var d;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":u.value}]),onClick:b[0]||(b[0]=()=>m())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(g.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(ve,{key:0})):(r.openBlock(),r.createBlock(Sr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Ir,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((d=r.unref(i))==null?void 0:d[l.value]),{key:0,"filter-metadata":g.filterItem,values:g.values,filters:g.filters,"base-entity":g.entity,"onUpdate:values":b[1]||(b[1]=h=>o("update:values",h)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),It=M(Lr,[["__scopeId","data-v-e52e165e"]]),Nr={class:"widget-table-panel-filter flex"},Rr=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",Nr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var u;return r.openBlock(),r.createBlock(It,{key:s,entity:a.entity,"filter-item":c,values:(u=a.filters)==null?void 0:u[r.unref(re)(c)],filters:a.filters,"onUpdate:values":f=>i(r.unref(re)(c),f)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Or=M(Rr,[["__scopeId","data-v-89e1fa2d"]]),Fr={class:"widget-fast-table-tools"},Br=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:n}){const t=e,o=ne.useRouter(),i=n,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>i("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(m=>m.name),c=r.inject(S.PROVIDE_NAME_ACTIONS,[]);function s(m){return{...m,label:m.label||"Batch update",callback:async()=>{const g=await q.promptModal(S.MODAL_BATCH_VALUES,{entity:t.metadata.name,availableFields:m.availableFields||[]}),b=t.metadata.fieldNameForIdentification,d=(t.selectedRows||[]).map(h=>({primaryKey:h[b],version:t.metadata.versioned?h.Version:void 0}));await Pt(t.metadata.name,{values:g,elements:d}),i("reload")}}}const u=r.computed(()=>{var b;const m=((b=c==null?void 0:c.actions)==null?void 0:b.value)||[];return Array.isArray(t.tools)?(t.tools,t.tools.reduce((d,h)=>{if(h.name==="*")d.push(...a);else if(l.includes(h.name)){const y=a.find(p=>p.name===h.name);y&&d.push(y)}else if(h.name==="redirect"){const y={...h,label:h.label,callback:()=>o.push(h.to)};d.push(y)}else if(h.name==="batch-update"&&!h.override)d.push(s(h));else{h.override&&m.find(p=>p.name===h.override)&&h.name==="batch-update"&&d.push(s(h));const y=m.find(p=>p.name===h.name);y&&d.push({name:h.name,label:y.title,icon:h.icon,buttonStyle:h.buttonStyle,callback:()=>Promise.resolve().then(()=>{f[h.name]=!0}).then(()=>v(y)).finally(()=>{f[h.name]=!1})})}return d},[])):[]}),f=r.reactive({});function v(m){var d;const g=(d=m.action.parameters.find(h=>h.dataTypeName==="IntegerArray"))==null?void 0:d.name,b={};return g&&(b[g]=t.selectedRows.map(h=>{if(!(typeof h=="object"&&h!==null))return null;const y=t.metadata.fieldNameForIdentification;return y===void 0?null:h[y]})),m.callback(b)}return(m,g)=>{const b=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,d=>(r.openBlock(),r.createBlock(b,{label:d.label,title:d.name,icon:d.icon,type:d.buttonStyle,loading:d.name==="reload"?m.loading:f[d.name],onClick:d.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(m.$slots,"default",{},void 0,!0)])}}}),xr=M(Br,[["__scopeId","data-v-3a74319d"]]);function Dr(e){const n=Tt(),t=ne.useRouter(),o=r.reactive({entity:null,mark:null,settings:null});function i(p){const w={...u.value,...p};a(w)}function a(p){{const w=p.prefilters;w&&(Object.keys(w).forEach(T=>{var A,D;Array.isArray(w[T])&&w[T].length===0&&o.settings&&!((D=(A=o.settings)==null?void 0:A.prefilters)!=null&&D[T])&&delete w[T]}),F.utils.isEmptyObject(w)&&delete p.prefilters)}localStorage.setItem(s(o.entity,o.mark),JSON.stringify(p))}function l(){return o.entity?JSON.parse(localStorage[s(o.entity,o.mark)]||"{}"):null}function c(p,w){o.entity=p,o.mark=w,v.call()}function s(p,w){return"list-configuration:"+p+(w?"-"+w:"")}const u=r.computed(()=>o.entity?JSON.parse(n[s(o.entity,o.mark)]||"{}"):null),f=r.computed(()=>o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]),v=ce(async function(){if(!o.entity)return;const w=await Bt(o.entity,o.mark);o.settings=Object.freeze(w)}),m=r.computed(()=>{var T;const p=u.value.order||{},w=((T=o.settings)==null?void 0:T.prefilters)||{};return p||w||[]}),g=r.computed(()=>{var T;const p=u.value.prefilters||{};return{...((T=o.settings)==null?void 0:T.prefilters)||{},...p}}),b=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.filters)||[]}),d=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.label)||null}),h=r.computed(()=>{var p;return((p=o.settings)==null?void 0:p.tools)||[]}),y=r.computed(()=>!F.utils.isEmptyObject(u.value));return{state:o,get customFilters(){return o.settings.customFilters||[]},set:c,get:l,configuration:u,update:i,computedPrefilter:g,computedFiltersConfiguration:b,get cellConfig(){return o.settings?qe(o.entity,o.settings.config,{router:t,activate:e}):[]},get prefilters(){var p;return((p=l())==null?void 0:p.prefilters)||o.settings.prefilters||{}},get order(){var p;return((p=l())==null?void 0:p.order)||[]},clean(){localStorage.removeItem(s(o.entity,o.mark))},cellConfiguration:f,computedLabel:d,computedTools:h,computedHasLocalConfiguration:y,computedOrder:m,get displayModeForNew(){return o.settings.displayModeForNew||"inline"}}}const $r={class:"es-grid es-gap-15"},Pr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Vr={class:""},Mr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e;ne.useRouter();const o=r.ref([]),i=r.ref(null),a=r.computed(()=>i.value===S.LIST_ACTIVE_NEW?i.value:i.value?i.value[2]:null);function l(E,_,L){i.value=[E,_,L]}const c=r.ref(null),s=F.Form.getParentForm(),u=r.ref([]),f=xe(t.entity),{state:v,update:m}=rt(t.entity,{masterEntities:t.masterEntities||[]}),g=ce(async()=>{try{await d.call(),await m()}catch(E){const{message:_}=Je(E);c.value=_}});s instanceof F.Form&&s.subscribe({read:g.call.bind(null),name:t.entity,type:"table"}),r.watch(()=>t.mark,()=>{A.set(t.entity,t.mark)});function b(){return x.and(x(A.prefilters),x(t.binding||{}))}const d=ce(async function(){const _=t.entity;c.value=null,u.value=[];const L=(await oe(_,{customFilters:A.customFilters,fields:Ze(D.value).join(" "),order:A.order,filter:b()})).map(wi);o.value=L}),{controller:h}=Ke();r.watch(()=>v.value,E=>{E&&(E.canRead?h.show():h.hide())},{immediate:!0});let y=[he.on("affected-entity",E=>{E.name===t.entity&&d.call()}),he.on("display-entity",async E=>{E.name===t.entity&&(d.promise&&await d.promise,l(E.name,E.id,o.value.find(_=>_[f.value.fieldNameForIdentification]===E.id)))})];r.onUnmounted(()=>{y.map(E=>E()),h.remove()});function p(E){function _(B){return Array.isArray(B)?_(B[0]):typeof B!="string"?null:B}const L=_(E);if(!L)return;const U=A.order;w("order",U[0]!==L?[L,"asc"]:U[1]==="desc"?[]:[L,"desc"])}function w(E,_){A.update({[E]:_}),d.call()}const T=r.computed(()=>g.wait),A=Dr(l),D=A.cellConfiguration;A.set(t.entity,t.mark),r.watch(()=>A.state.settings,g.call);const k=r.computed(()=>A.state.settings);n({listSettings:k,array:o,config:D});function C(){q.openModal(S.MODAL_LIST_DOWNLOAD,{entity:t.entity,cellConfig:A.cellConfig,order:A.order,prefilters:b(),customFilters:A.customFilters})}return(E,_)=>{const L=r.resolveComponent("widget-button"),U=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",$r,[r.unref(A).computedLabel.value&&!E.hideLabel?(r.openBlock(),r.createElementBlock("p",Pr,r.toDisplayString(r.unref(A).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(f)?(r.openBlock(),r.createBlock(xr,{key:1,metadata:r.unref(f),tools:r.unref(A).computedTools.value,loading:T.value,"selected-rows":u.value||[],onReload:r.unref(g).call,onExport:C},{default:r.withCtx(()=>{var B;return[(B=r.unref(v))!=null&&B.canCreate?(r.openBlock(),r.createBlock(L,{key:0,onClick:_[0]||(_[0]=Y=>i.value=r.unref(S).LIST_ACTIVE_NEW),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(A).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(L,{key:1,onClick:r.unref(A).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:1},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",Vr,[r.createVNode(Or,{entity:E.entity,"filters-config":r.unref(A).computedFiltersConfiguration.value,filters:r.unref(A).computedPrefilter.value,"onUpdate:filters":_[1]||(_[1]=B=>w("prefilters",B))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(At),{config:r.unref(D),array:o.value,"active-row":a.value,"onUpdate:activeRow":_[3]||(_[3]=B=>i.value=null),onOrder:p,class:"table",selectedRows:u.value,"onUpdate:selectedRows":_[4]||(_[4]=B=>u.value=B)},{"head-cell":r.withCtx(B=>{var Y,fe,$;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(E.$slots["head-cell"]?E.$slots["head-cell"]:St),r.mergeProps({label:B.label},B,{onOrder:p,order:r.unref(A).computedOrder.value,type:B.type,"is-full-selected":((Y=u.value)==null?void 0:Y.length)===((fe=o.value)==null?void 0:fe.length)&&(($=o.value)==null?void 0:$.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>{var B,Y;return[r.createVNode(U,{entity:(B=i.value)==null?void 0:B[0],"primary-key":(Y=i.value)==null?void 0:Y[1],"master-entities":E.masterEntities||void 0,binding:E.binding,onFormUpdate:_[2]||(_[2]=()=>{i.value=null,r.unref(d).call()})},null,8,["entity","primary-key","master-entities","binding"])]}),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Lt(e,n={},t={}){const o=r.inject(S.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:n,a=typeof n=="string"?t:n;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(u=>u.name===i);return c?{...c,...a}:null})}const jr=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const n=e,t=Lt(n.name,n.overrideParams||{}),o=r.computed(()=>{if(t.value)return ce(t.value.callback)});return(i,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(t)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(t).label,loading:((c=o.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,u;return(u=(s=o.value)==null?void 0:s.call)==null?void 0:u.call(s,i.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),Ur=r.defineComponent({__name:"WidgetResolverEntity",setup(e){const n=ne.useRouter(),t=ne.useRoute();function o(){const i=t.params.entity,a=t.params.primaryKey;console.log(i,a),et(i,a).then(l=>n.replace(en(l,a))).catch(l=>{V("error")(l),n.back()})}return r.onMounted(o),(i,a)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(Ye,{label:"Loading..."})]))}}),Wr=r.defineComponent({__name:"modal-list-download",props:{entity:{},cellConfig:{},prefilters:{},order:{},customFilters:{}},setup(e){const n=e,t=r.computed(()=>o.finished?"Download CSV":`Download ${o.count} records.`),{state:o,downloadFile:i,reject:a,start:l}=rn({entity:n.entity,config:n.cellConfig,prefilters:n.prefilters,order:n.order,customFilters:n.customFilters});return q.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>o.finished,()=>{i(),q.popModal()}),(c,s)=>{const u=r.resolveComponent("widget-button"),f=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(f,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=v=>{r.unref(i)(),r.unref(q.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(Ye,{label:"Loading"})])]),_:1})}}});function Nt(e){return Se(e,"YYYY/MM/DD HH:mm:ss")}function Se(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return sn.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function ce(e){function n(...o){if(t.loading)return Promise.reject("The process has already started.");t.loading=!0,t.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{t.wait=!1,t.loading=!1,t.promise=null});return t.promise=i,i}const t=r.reactive({wait:!1,loading:!1,call:n,promise:null});return t}function Je(e){return typeof e=="string"?Ce(e):qr(e)?Ce(e.message,e.children||e.details||[]):Hr(e)?Ce(e.title,[e.detail||""]):Ce(S.DEFAULT_ERROR_MESSAGE)}function qr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Hr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Ce(e,n=[]){return{message:e,children:n}}function V(e="error"){return function(n){const{message:t,children:o}=Je(n);ot.add(e,t,{children:o})}}function oe(e,n={}){const t=R();return Rt(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:read",{entity:e,...n})}function Rt(e){return!!(e.id||e.primaryKey)}function Qe(e,n){const t=R();return Rt(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:update",{...n,entity:e})}function Ze(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ot(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 Gr(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 zr(){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 j(e,n={}){return H.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=H.contextId),n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.reload():t).catch(()=>{throw new Error(S.DEFAULT_ERROR_MESSAGE)}).then(t=>Xr(t).then(o=>{if(!t.ok)throw o;return o}))}function Yr(e,n=1e3){let t=0;return(...o)=>{clearTimeout(t),t=window.setTimeout(()=>e(...o),n)}}function Kr(e,n){let t=!1;return(...o)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...o)}}const Jr=Re(Fe("pretty-value-field-by-entity"));function Qr(e,n,t){try{const o=Le.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[n];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${n}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(o){return Jr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,n,t),t}}const ee=Re(Fe("use-socket"));function R(){return eo}function Zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const eo=function(){let e=1,n,t;const o=new Set;let i=0;const a=new Set;function l(){if(n)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{n.close()},En*2);const y=new Uint8Array(1);y[0]=wn,n.send(y)}setInterval(()=>{Array.from(o).forEach(y=>{h(y)&&(ee("Handler for event %s requestId %d was expired",y.event,y.requestId),y.requestId?s({requestId:y.requestId,event:kt,data:{message:Q.RequestTookToLong().message}}):o.delete(y))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&u()},S.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:n}}function s(y){const p=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,y.event,y.requestId),p.forEach(w=>{const T=y.requestId;(w.requestId&&w.requestId===T||!w.requestId&&w.event===y.event)&&(ee("Find appropriated handler: %d, event: %s",e,w.event),w.callback(y.data,y),w.once&&(o.delete(w),ee("Handler was removed by *once* params was passed. %o",w)))})}function u(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),n=new WebSocket(t),n.onclose=function(y){ee("Connection to server was stopped: %d %s",y.code,y.reason),Array.from(o).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(y=>{f(y),a.delete(y)})},n.onerror=function(y){console.warn(y)},n.onmessage=y=>{var p;try{if(Zr(y.data)){l();return}const w=JSON.parse(y.data);if(!Ft(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(p=w==null?void 0:w.data)!=null&&p.refresh&&location.reload(),s(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}function f(y){n.send(y)}function v(y,p){d({event:y,callback:p})}function m(y,p){d({event:y,callback:p,once:!0})}function g(){return n&&(n==null?void 0:n.readyState)===1}function b(y,p,w){const T=++e,A=JSON.stringify({requestId:T,event:y,data:p,contextId:H.contextId,url:I.socketURLHandler?I.socketURLHandler():window.location.href});return g()?f(A):(a.add(A),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,k)=>{d({event:y,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:A,callback:(C,E)=>{if(ee("Promise was resolve with next data:",C),to(E))return void k(C);w&&w(C,E),D(C)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function d(y){const p={timeToLive:0,...y,created:new Date().getTime()};o.add(p)}function h(y){return y.timeToLive===0||typeof y.timeToLive!="number"?!1:new Date().getTime()-y.created>y.timeToLive}return{get socket(){return n},on:v,once:m,emit:b,initialization(y){t=y},getDevInfo:c}}(),to=e=>!!Ft(e)&&e.event===kt,Ft=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Bt(e,n){return R().emit("list-setting:read",{entity:e,mark:n})}function no(e,n){return R().emit("metadata-field:treat",{entity:e,fieldName:n})}function xt(e,n){return R().emit("entity:create",{...n,entity:e})}function Dt(e,n){return R().emit("entity:delete",{...n,entity:e})}function ro(e,n){return R().emit("usage-context:read",{...n,entity:e})}function $t(e={}){return R().emit("tool:read",e)}function oo(){return R().emit("metadata-list:read",{})}function Pt(e,n){return R().emit("batch:update",{...n,entity:e})}function et(e,n){return R().emit("entity:resolve",{primaryKey:n,entity:e})}function io(e){return R().emit("history:read",e)}function ao(e,n){return R().emit("entity:count",{...n,entity:e})}function so(e){return`/${Cn}/${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=lo;ue.replaceRecordOperation=co;function lo(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function co(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function uo(e={}){return R().emit("tool:execute",e)}const fo=Re(Fe("wrap-tool-response"));function Vt(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=go),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=yo),e.handleCloseForm===void 0&&(e.handleCloseForm=vo),e.handleValidationResult===void 0&&(e.handleValidationResult=ho),{...n,label:n.title,async callback(t={}){var l;const o=typeof e.values=="function"?e.values(n,e):e.values;let i={};n.action.targetName==="Record"&&o.hasOwnProperty("Id")&&(i.Id=o.Id,delete o.Id);const a=()=>uo({name:n.name,values:{...o,...t},primaryKeys:i,usageContext:n.usageContext}).then(async c=>{var s,u;if(!po(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const f of e.handlers)await f(n,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((u=(s=c.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(n,c.validationEffect,e),new Error(c.message);return c.message&&ot.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(f=>{var v;return(v=e.handleAffectedEntity)==null?void 0:v.call(e,n,f,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),c}).catch(V("error"));if((l=e.overrides)!=null&&l[n.name])return e.overrides[n.name](n,e);if(n.paramDialog){const c=await bo(n,e);if(c===null)return;t=Object.assign(t,c||{})}return n.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!n.confirmation||!e.handleConfirmation||n.paramDialog?a():e.handleConfirmation(n,a)}}}function po(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function mo(e){const n="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?n:typeof e=="string"?e:n}async function go(e,n){const t=mo(e.confirmation);if(!q.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await q.promptModal(S.MODAL_CONFIRM,{message:t}))return n()}function ho(e,n){const t=S.MODAL_VALIDATION_EFFECT;if(!q.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{q.pushModal(t,n)})}function yo(e,n,t){var s;function o(u){return u!==null&&typeof u=="object"&&typeof u.read=="function"}function i(u,f){u&&(fo("Affected Entity %s. Find form with name %s.",f,u.name),u.name===f&&o(u)&&u.read(),u instanceof F.Form&&u.dependencies.forEach(v=>i(v,f)))}he.emit("affected-entity",n);const{router:a,form:l}=t,c=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){he.emit("display-entity",{id:c,name:n.name}),I.getEntityLink&&a.push(I.getEntityLink(n.name,c));return}i(l,n.name)}function vo(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}function bo(e,n){var t;if((t=e.paramDialog)!=null&&t.name)return q.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:n})}let te={};function Z(e,...n){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let t=F.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof t=="string")return dt(t,n);const o=F.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?dt(o,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function dt(e,n){return n.forEach((t,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),t)}),e}Z.setGlobalVocabulary=function(e){te=e};Z.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:F.utils.getPropFromObject(te,n.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ue={exports:{}},O={},We={exports:{}},ie={};function Mt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function Eo(e,n,t){}function Co(e,n,t){}var ko=/javascript\s*\:/img;function _o(e,n){return ko.test(n)?"":n}ie.whiteList=Mt();ie.getDefaultWhiteList=Mt;ie.onAttr=Eo;ie.onIgnoreAttr=Co;ie.safeAttrValue=_o;var To={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},pe=To;function Ao(e,n){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,o=!1,i=0,a=0,l="";function c(){if(!o){var f=pe.trim(e.slice(i,a)),v=f.indexOf(":");if(v!==-1){var m=pe.trim(f.slice(0,v)),g=pe.trim(f.slice(v+1));if(m){var b=n(i,l.length,m,g,f);b&&(l+=b+"; ")}}}i=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var u=e.indexOf("*/",a+2);if(u===-1)break;a=u+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||c():s===`
7
+ `&&c()}return pe.trim(l)}var So=Ao,ke=ie,Io=So;function pt(e){return e==null}function Lo(e){var n={};for(var t in e)n[t]=e[t];return n}function jt(e){e=Lo(e||{}),e.whiteList=e.whiteList||ke.whiteList,e.onAttr=e.onAttr||ke.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ke.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ke.safeAttrValue,this.options=e}jt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var n=this,t=n.options,o=t.whiteList,i=t.onAttr,a=t.onIgnoreAttr,l=t.safeAttrValue,c=Io(e,function(s,u,f,v,m){var g=o[f],b=!1;if(g===!0?b=g:typeof g=="function"?b=g(v):g instanceof RegExp&&(b=g.test(v)),b!==!0&&(b=!1),v=l(f,v),!!v){var d={position:u,sourcePosition:s,source:m,isWhite:b};if(b){var h=i(f,v,d);return pt(h)?f+":"+v:h}else{var h=a(f,v,d);if(!pt(h))return h}}});return c};var No=jt;(function(e,n){var t=ie,o=No;function i(l,c){var s=new o(c);return s.process(l)}n=e.exports=i,n.FilterCSS=o;for(var a in t)n[a]=t[a];typeof window<"u"&&(window.filterCSS=e.exports)})(We,We.exports);var tt=We.exports,nt={indexOf:function(e,n){var t,o;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,o=e.length;t<o;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var o,i;if(Array.prototype.forEach)return e.forEach(n,t);for(o=0,i=e.length;o<i;o++)n.call(t,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var n=/\s|\n|\t/,t=n.exec(e);return t?t.index:-1}},Ro=tt.FilterCSS,Oo=tt.getDefaultWhiteList,Ie=nt;function Ut(){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 Wt=new Ro;function Fo(e,n,t){}function Bo(e,n,t){}function xo(e,n,t){}function Do(e,n,t){}function qt(e){return e.replace(Po,"&lt;").replace(Vo,"&gt;")}function $o(e,n,t,o){if(t=Kt(t),n==="href"||n==="src"){if(t=Ie.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return""}else if(n==="background"){if(_e.lastIndex=0,_e.test(t))return""}else if(n==="style"){if(mt.lastIndex=0,mt.test(t)||(gt.lastIndex=0,gt.test(t)&&(_e.lastIndex=0,_e.test(t))))return"";o!==!1&&(o=o||Wt,t=o.process(t))}return t=Jt(t),t}var Po=/</g,Vo=/>/g,Mo=/"/g,jo=/&quot;/g,Uo=/&#([a-zA-Z0-9]*);?/gim,Wo=/&colon;?/gim,qo=/&newline;?/gim,_e=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,mt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,gt=/u\s*r\s*l\s*\(.*/gi;function Ht(e){return e.replace(Mo,"&quot;")}function Gt(e){return e.replace(jo,'"')}function zt(e){return e.replace(Uo,function(t,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Xt(e){return e.replace(Wo,":").replace(qo," ")}function Yt(e){for(var n="",t=0,o=e.length;t<o;t++)n+=e.charCodeAt(t)<32?" ":e.charAt(t);return Ie.trim(n)}function Kt(e){return e=Gt(e),e=zt(e),e=Xt(e),e=Yt(e),e}function Jt(e){return e=Ht(e),e=qt(e),e}function Ho(){return""}function Go(e,n){typeof n!="function"&&(n=function(){});var t=!Array.isArray(e);function o(l){return t?!0:Ie.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",f=s.position+u.length;return i.push([a!==!1?a:s.position,f]),a=!1,u}else return a||(a=s.position),"[removed]";else return n(l,c,s)},remove:function(l){var c="",s=0;return Ie.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function zo(e){for(var n="",t=0;t<e.length;){var o=e.indexOf("<!--",t);if(o===-1){n+=e.slice(t);break}n+=e.slice(t,o);var i=e.indexOf("-->",o);if(i===-1)break;t=i+3}return n}function Xo(e){var n=e.split("");return n=n.filter(function(t){var o=t.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),n.join("")}O.whiteList=Ut();O.getDefaultWhiteList=Ut;O.onTag=Fo;O.onIgnoreTag=Bo;O.onTagAttr=xo;O.onIgnoreTagAttr=Do;O.safeAttrValue=$o;O.escapeHtml=qt;O.escapeQuote=Ht;O.unescapeQuote=Gt;O.escapeHtmlEntities=zt;O.escapeDangerHtml5Entities=Xt;O.clearNonPrintableCharacter=Yt;O.friendlyAttrValue=Kt;O.escapeAttrValue=Jt;O.onIgnoreTagStripAll=Ho;O.StripTagBody=Go;O.stripCommentTag=zo;O.stripBlankChar=Xo;O.attributeWrapSign='"';O.cssFilter=Wt;O.getDefaultCSSWhiteList=Oo;var Be={},J=nt;function Yo(e){var n=J.spaceIndex(e),t;return n===-1?t=e.slice(1,-1):t=e.slice(1,n+1),t=J.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function Ko(e){return e.slice(0,2)==="</"}function Jo(e,n,t){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",f="";e:for(c=0;c<s;c++){var v=e.charAt(c);if(a===!1){if(v==="<"){a=c;continue}}else if(l===!1){if(v==="<"){o+=t(e.slice(i,c)),a=c,i=c;continue}if(v===">"||c===s-1){o+=t(e.slice(i,a)),f=e.slice(a,c+1),u=Yo(f),o+=n(a,o.length,u,f,Ko(f)),i=c+1,a=!1;continue}if(v==='"'||v==="'")for(var m=1,g=e.charAt(c-m);g.trim()===""||g==="=";){if(g==="="){l=v;continue e}g=e.charAt(c-++m)}}else if(v===l){l=!1;continue}}return i<s&&(o+=t(e.substr(i))),o}var Qo=/[^a-zA-Z0-9\\_:.-]/gim;function Zo(e,n){var t=0,o=0,i=[],a=!1,l=e.length;function c(m,g){if(m=J.trim(m),m=m.replace(Qo,"").toLowerCase(),!(m.length<1)){var b=n(m,g||"");b&&i.push(b)}}for(var s=0;s<l;s++){var u=e.charAt(s),f,v;if(a===!1&&u==="="){a=e.slice(t,s),t=s+1,o=e.charAt(t)==='"'||e.charAt(t)==="'"?t:ti(e,s+1);continue}if(a!==!1&&s===o){if(v=e.indexOf(u,s+1),v===-1)break;f=J.trim(e.slice(o+1,v)),c(a,f),a=!1,s=v,t=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(v=ei(e,s),v===-1){f=J.trim(e.slice(t,s)),c(f),a=!1,t=s+1;continue}else{s=v-1;continue}else if(v=ni(e,s-1),v===-1){f=J.trim(e.slice(t,s)),f=ht(f),c(a,f),a=!1,t=s+1;continue}else continue}return t<e.length&&(a===!1?c(e.slice(t)):c(a,ht(J.trim(e.slice(t))))),J.trim(i.join(" "))}function ei(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ti(e,n){for(;n<e.length;n++){var t=e[n];if(t!==" ")return t==="'"||t==='"'?n:-1}}function ni(e,n){for(;n>0;n--){var t=e[n];if(t!==" ")return t==="="?n:-1}}function ri(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ht(e){return ri(e)?e.substr(1,e.length-2):e}Be.parseTag=Jo;Be.parseAttr=Zo;var oi=tt.FilterCSS,W=O,Qt=Be,ii=Qt.parseTag,ai=Qt.parseAttr,Ae=nt;function Te(e){return e==null}function si(e){var n=Ae.spaceIndex(e);if(n===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ae.trim(e.slice(n+1,-1));var t=e[e.length-1]==="/";return t&&(e=Ae.trim(e.slice(0,-1))),{html:e,closing:t}}function li(e){var n={};for(var t in e)n[t]=e[t];return n}function ci(e){var n={};for(var t in e)Array.isArray(e[t])?n[t.toLowerCase()]=e[t].map(function(o){return o.toLowerCase()}):n[t.toLowerCase()]=e[t];return n}function Zt(e){e=li(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=W.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ci(e.whiteList||e.allowList):e.whiteList=W.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":W.attributeWrapSign,e.onTag=e.onTag||W.onTag,e.onTagAttr=e.onTagAttr||W.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||W.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||W.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||W.safeAttrValue,e.escapeHtml=e.escapeHtml||W.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new oi(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,c=t.onIgnoreTagAttr,s=t.safeAttrValue,u=t.escapeHtml,f=n.attributeWrapSign,v=n.cssFilter;t.stripBlankChar&&(e=W.stripBlankChar(e)),t.allowCommentTag||(e=W.stripCommentTag(e));var m=!1;t.stripIgnoreTagBody&&(m=W.StripTagBody(t.stripIgnoreTagBody,a),a=m.onIgnoreTag);var g=ii(e,function(b,d,h,y,p){var w={sourcePosition:b,position:d,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(o,h)},T=i(h,y,w);if(!Te(T))return T;if(w.isWhite){if(w.isClosing)return"</"+h+">";var A=si(y),D=o[h],k=ai(A.html,function(C,E){var _=Ae.indexOf(D,C)!==-1,L=l(h,C,E,_);return Te(L)?_?(E=s(h,C,E,v),E?C+"="+f+E+f:C):(L=c(h,C,E,_),Te(L)?void 0:L):L});return y="<"+h,k&&(y+=" "+k),A.closing&&(y+=" /"),y+=">",y}else return T=a(h,y,w),Te(T)?u(y):T},u);return m&&(g=m.remove(g)),g};var ui=Zt;(function(e,n){var t=O,o=Be,i=ui;function a(c,s){var u=new i(s);return u.process(c)}n=e.exports=a,n.filterXSS=a,n.FilterXSS=i,function(){for(var c in t)n[c]=t[c];for(var s in o)n[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(Ue,Ue.exports);var fi=Ue.exports;const di=wo(fi);function pi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),di(e)}function mi(e,n,t,o){let i=e+n/60+t/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function gi(e,n){const t={dir:e<0?n==="long"?"W":"S":n==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`}function en(e,n){const t=["forms",e];return n&&t.push(n),"/"+t.join("/")}function hi(e,n){return"/"+[S.PATH_RESOLVER_ENTITY,e,n].join("/")}function yi(){return`/${S.PATH_RESOLVER_ENTITY}/:entity/:primaryKey`}function qe(e,n,t){const o=Z.getScope(e.toLowerCase());return n.map(i=>{typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=l=>q.openModal("modal-history",{id:l.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History");const a=i.displayMode;if(a){const l=async c=>{try{const s=c[re(i)];return[await et(bi(i,c),s),s]}catch{return[]}};a&&(a==="form"?i.link=c=>{const s=c[re(i)];return s?hi(i.entity,s):null}:i.onClick=async c=>{const[s,u]=await l(c);if(!s||!u)return null;switch(i.displayMode){case"modal":return q.openModal(S.MODAL_ENTITY,{entity:s,primaryKey:u});case"inline":return t.activate(s,u,c)}}),i.class="widget-table-cell_link cursor_pointer",i.value=(c,s)=>s[i.name[1]]}return vi(i,i.type,i.presentation),I.listConvertCellConfigHandler&&I.listConvertCellConfigHandler(e,i),i})}function vi(e,n,t){switch(n){case"Decimal":{t==="Money"&&(e.type="money");break}}return e}const bi=(e,n)=>e.useObjectTypeName?n[e.name[2]]:e.entity?e.entity:null;function yt(e){return typeof e!="object"||e===null?null:e[S.TABLE_MOCK_FIELD]}function wi(e,n){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof n=="string"||typeof n=="number"||typeof n=="function"?(typeof n=="function"&&(n=n(e)),e[S.TABLE_MOCK_FIELD]=n):e[S.TABLE_MOCK_FIELD]=e.Id,e)}function Ei(e){if(!Array.isArray(I.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");I.arrayListCellHandlers.push(e)}function Ci(e,n){const t=re(e);return t?F.utils.getPropFromObject(n,t):null}function ki(e){if(!Array.isArray(I.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");I.arrayFieldParamsHandlers.push(e)}const _i={addListCellHandler:Ei,getCellModelValue:Ci,addFieldParamsHandler:ki};var tn=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(tn||{});function Ti(){const e=r.ref(null);function n(t){e.value=t}return{activeRow:e,activateRow:n}}function Ai(e,n){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(n)}async function nn(e,n){e()&&(await n(),await nn(e,n))}function Si(e,n,t={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(k=>u(k,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(t==null?void 0:t.filterSearchFn)||((k,C)=>Ai(k,C));function f(){return t.masterEntities?typeof t.masterEntities=="function"?t.masterEntities():t.masterEntities:[]}function v(){const k=T();return typeof k.limit!="number"&&(k.limit=100),k.offset=c,(t.request||oe)(e,k).then(E=>(c+=E.length,E))}function m(k,C){var _;return typeof k.Version=="number"?k.Version:(_=l.find(L=>L.Id===C))==null?void 0:_.Version}function g(k,C){const E=l.findIndex(_=>_.Id===k);if(E===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(E,1,C)}function b(k){const C=l.findIndex(E=>E.Id===k);if(C===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(C,1)}async function d(k,C){try{const E=T(),_=m(C,k);delete C.Version,await Qe(e,{id:k,values:C,version:_,masterEntities:f()});const L=await oe(e,{fields:E.fields||"",id:k});g(k,L)}catch(E){V()(E)}}async function h(k,C={}){try{const E=T(),_=m(C,k);delete C.Version,await Dt(e,{id:k,version:_,masterEntities:f()}),b(k)}catch(E){V()(E)}}async function y(k){try{await xt(e,{values:k,masterEntities:f()}),await A()}catch(C){V()(C)}}let p;async function w(){s.value=!0;try{p!=null&&p.signal&&!p.signal.aborted&&p.abort();let k=p=new AbortController,C=0;const _=T().limit||0;if(i.value&&!_){console.warn("Using textSearch assumes the use of limit.");return}await nn(()=>(_>0?C<_:!0)&&!o&&!k.signal.aborted,async()=>{const L=await v();k.signal.aborted||(l.push(...L),C+=L.filter(U=>u(U,i.value)).length,(L.length<_||_===0)&&(o=!0))})}catch(k){V()(k)}s.value=!1}function T(){return typeof n=="function"?n():n}async function A(){try{c=0,o=!1,l.splice(0,l.length),await w()}catch(k){V()(k)}}function D(){if(p)return p.abort();s.value=!1}return{array:l,updateById:d,next:w,reload:A,wait:s,create:y,deleteById:h,textSearch:i,filteredArray:a,abort:D}}function Ii(){function e(){return{organizations:H.organizations,currentContextId:H.contextId,person:H.person,context:H.context,contextType:H.contextType,userId:H.userId}}const n=r.reactive(e());return H.onupdateContext(()=>{Object.assign(n,e())}),n}function Li(e,n,t){return R().emit("communication:create",{entityName:e,entityCatalogId:n,targetCode:t})}function Ni(e,n,t){return R().emit("communication:read",{entityName:e,entityCatalogId:n,targetCode:t})}function Ri(e,n){return R().emit("communication-message:create",{communicationId:e,text:n})}function Oi(e){return R().emit("communication-message:read",{communicationId:e})}function Fi(e){const n=F.Form.getParentForm(),t=r.reactive([]);return n&&n.subscribe(e),e.read=()=>Oi(e.id).then(o=>(t.splice(0,t.length,...o),o)),{array:t}}function Bi(e,n){e.read=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return oe(e.name,o)}).then(at).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(V())},e.save=()=>{const o=t();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Qe(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw V()(i),i})};function t(){return typeof n=="function"?n():n}}function xe(e){if(!e)return r.inject(S.PROVIDE_NAME_METADATA);Le.initEntity(e);const n=r.computed(()=>Le.state[e]);return r.provide(S.PROVIDE_NAME_METADATA,n),n}function rt(e,n={}){if(!e)return r.inject(S.PROVIDE_NAME_USAGE_CONTEXT);const t=r.ref(null);return r.provide(S.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await ro(e,xi(n||{}))}}}function xi(e){return typeof e=="function"?e():e}function Di(e){if(!e)return r.inject(S.PROVIDE_NAME_ACTIONS);const n=r.ref(!1),t=r.reactive([]),o=r.computed(()=>t.map(l=>Vt(e,l))),i={actions:o,update:a};r.provide(S.PROVIDE_NAME_ACTIONS,i),e.router=ne.useRouter();function a(){if(n.value)return;n.value=!0,t.splice(0,t.length);const l=e==null?void 0:e.form;return $t({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>t.splice(0,0,...c)).catch(V("error")).finally(()=>n.value=!1)}return{actions:o,update:a,loading:r.readonly(n)}}function $i(e){function n(t){t.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)})}function Pi(e,n={}){const t=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){t.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>t.includes(s),a=s=>{n.handleSelect&&!n.handleSelect(s)||i(s)||t.push(s)},l=s=>{const u=t.findIndex(f=>f===s);u!==-1&&t.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return t.length===s.length&&s.length!==0});return[t,o,c,a,l]}function Vi(e){const n=r.ref(""),t=r.computed(()=>{const o=n.value.toLowerCase();return r.unref(e).filter(i=>n.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:n,searchArray:t}}class Me{static async getStartConfig(n,t){return R().emit("wizard:configuration",{process:n,entity:t})}static async startProcess(n,t){return R().emit("wizard:start",{process:n,entity:t})}static async runStep(n,t,o,i,a){return R().emit("wizard:step",{process:n,entity:t,stepName:o,token:i,values:a})}}function Mi(e){return e.statusName===P.Completed}function ji(e){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(e.statusName)}function Ui(e){return e.statusName===P.ValidationError}function Wi(e){return e.statusName===P.Undefined}function qi(e,n,t){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>v(i,l.value)),s=r.ref(null),u=r.reactive([]),f=r.computed(()=>u.map(p=>v(i,p)));function v(p,w){return p.find(T=>T.name===w)||null}async function m(p){var w;if(Wi(p)){await t.onDisplayDataSet(p);return}if(!(ji(p)&&!await t.onDisplayDataSet(p))){if(Ui(p))return void t.onValidation(p.validationResults);d(p),await r.nextTick();{const T=((w=v(i,l.value))==null?void 0:w.fields)||[];if([P.FinalStep,P.NextStep,P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(p.statusName)&&(!T.length||Hi(T,t.presets)))return y(t.presets||{})}Mi(p)&&t.onCompleted(p)}}async function g(){try{await b(),await h()}catch(p){V("error")(p)}}function b(){return a.value="Loading process information.",Me.getStartConfig(n,e).then(p=>(s.value={label:p.processTitle,info:p.processInfo,icon:p.processIcon},i=p.steps.map(w=>{const T=w.frontendEntity.rootObject,A=Object.fromEntries(w.frontendEntity.objectTypes.map(D=>[D.name,D.properties]));return{label:w.title,name:w.stepName,number:w.number,rootObjectName:T,objectTypes:A,fields:A[T],buttonCaption:w.buttonCaption}}))).finally(()=>{a.value=!1})}function d(p){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation,P.NextStep,P.Completed,P.FinalStep].includes(p.statusName)?(o=p.token,l.value=p.nextStepName):console.log("Saving is not completed:",p),p}function h(){return a.value="Starting process",Me.startProcess(n,e).then(m).catch(V("error")).finally(()=>{a.value=null})}function y(p={}){const w=l.value;return!o||!w?Promise.reject("Not step or token."):(a.value="Waiting for result...",Me.runStep(n,e,w,o,p).then(m).then(T=>(u[u.length-1]!==w&&u.push(w),T)).catch(V("error")).finally(()=>{a.value=!1}))}return{initialize:g,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:u,processInfo:s,next:y}}function Hi(e,n){for(let t=0;t<e.length;t++){const o=e[t];if(!F.utils.getPropFromObject(n,o.name))return!1}return!0}function Gi(e,n){const t=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,n||{});return{name:t,arguments:o}}function zi(e){return e.limit||(e.limit=150),e}function rn(e,n={}){const{limit:t}=zi(n),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(d=>f(d.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function f(d){d===null&&(d=""),d===void 0&&(d="-");let h=typeof d!="string"?String(d):d;return h=h.replace(/"/g,'""'),h.search(/("|,|\n)/g)>=0&&(h='"'+h+'"'),h}function v(){return oe(a,{fields:Ze(l).join(" "),limit:t,offset:u.offset,order:i,filter:typeof o=="string"?o:x(o||{}),customFilters:c.map(d=>{var h;return Gi(d,(h=n.customFiltersData)==null?void 0:h[typeof d=="string"?d:d.name])})}).then(d=>(u.offset+=t,d))}function m(){const d="data:text/csv;charset=utf-8,"+s.join(`\r
8
+ `),h=encodeURI(d),y=document.createElement("a");y.setAttribute("href",h),y.setAttribute("download",`${a}.csv`),document.body.appendChild(y),y.click()}function g(){u.rejected=!0}async function b(){return v().then(d=>{const h=d.map(y=>l.map(p=>f(Oe(p,y))).join(","));return s.push(...h),u.count=s.length,d.length}).then(d=>{if(d!==t&&(u.finished=!0),d===t&&!u.rejected)return b()})}return{downloadFile:m,reject:g,state:u,start:b}}const ot=new class{constructor(){this.store=r.reactive([])}add(n,t,o={}){const i=Xi(o),a=new He(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 Xi(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 Ne=class Ne{constructor(n,t,o,i,a){this.type=n,this.message=t,this.timeout=o,this.children=i,this.click=a,this.id=Ne.cardId++}};Ne.cardId=1;let He=Ne;/*!
9
9
  * jenesius-event-emitter v1.0.2
10
10
  * (c) 2022 Jenesius
11
11
  * @license MIT
12
- */const wt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},bt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},Et=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},Ct=function(){this.events={}};class K{constructor(){this.events={}}on(n,t){return wt.call(this,n,t)}emit(n,t){return bt.call(this,n,t)}off(n,t){return Et.call(this,n,t)}cleanEvents(){Ct.call(this)}static on(n,t){return wt.call(K,n,t)}static emit(n,t){return bt.call(K,n,t)}static off(n,t){return Et.call(K,n,t)}static cleanEvents(){Ct.call(K)}}K.events={};class Xi extends K{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return Li(this.id,n)}static checkAndGenerate(n,t,o){return Ni(n,t,o).then(i=>i.length===0?Ii(n,t,o):i[0])}}function Yi(){return L().emit("client:read",{})}class at extends Error{static ConstContextCannotBeChanged(){return new at("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ve,ue;const Y=class Y extends K{constructor(){super(...arguments);Pe(this,ve);Pe(this,ue);this.isConstContext=!1,this.type="front",this.organizations=[],Ee(this,ue,!1)}set language(t){localStorage.setItem(T.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(T.LOCALSTORAGE_LANGUAGE_KEY)||Y.DEFAULT_LANGUAGE}get contextId(){return $e(this,ve)}set contextId(t){if(this.isConstContext)throw at.ConstContextCannotBeChanged();Ee(this,ve,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Ee(this,ue,t),this.emit(Y.EVENT_READY_UPDATE,t)}get ready(){return $e(this,ue)}onReady(t){return this.on(Y.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(Y.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=t,localStorage.setItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(Y.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){j()(t)}}restoreCurrentContext(){var o,i;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number"||((i=this.customer)==null?void 0:i.constContextId)===null)return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const t=Number.parseInt(localStorage.getItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Yi()}validateContextId(t){var o;try{return((o=this.person)==null?void 0:o.id)==t?!0:!!this.organizations.find(i=>i.id===t)}catch{return!1}}};ve=new WeakMap,ue=new WeakMap,Y.DEFAULT_LANGUAGE="en",Y.EVENT_CONTEXT_UPDATE="event:context-update",Y.EVENT_READY_UPDATE="event:ready-update";let Ge=Y;function Ki(e){return L().emit("metadata:read",{entity:e})}const Ne=function(){const n=r.reactive({}),t=new Map;function o(c){return n[c]}async function i(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Ki(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Ji extends K{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class X{static login(n){return q(A.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:A.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return X.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return q(`${A.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return X.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return X.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return X.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return q(`${A.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(X.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return q(`${A.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,o,i){return q(`${A.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(n,t,o,i){return q(`${A.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static finishAccessRecovery(n,t,o,i){return q(`${A.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:i})})}}class Qi{static readHistoryById(n,t){return q(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Zi{static getConfiguration(){return q("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await q(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ea{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return q(`/open-api/internationalization/language/${n}`)}}class ta{static async upload(n,t){const o=new FormData;return o.append("file",n),q(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var on=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(on||{}),an=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(an||{});function na(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function D(e){return Object.keys(e).reduce((n,t)=>{const o=e[t];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&n.push(`@${t} in (${i})`),n}if(na(o)){let i=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&n.push(`@${t} ge ${i(o.start)}`),o.end&&n.push(`@${t} le ${i(o.end)}`),n}return typeof o=="number"||typeof o=="boolean"?(n.push(`@${t} eq ${o}`),n):typeof o=="string"?(o.length!==0&&n.push(`@${t} eq '${o}'`),n):(o===null&&n.push(D.is(t,o)),n)},[]).join(" and ")}function be(e){return typeof e=="string"?`'${e}'`:`${e}`}D.includes=function(n,t){return`@${n} Contains ${be(t)}`};D.beginWith=function(n,t){return`@${n} BeginWith ${be(t)}`};D.notEq=function(n,t){return`@${n} nq ${be(t)}`};D.eq=function(n,t){return Array.isArray(t)?D.in(n,t):`@${n} eq ${be(t)}`};D.in=function(n,t){const o=t.map(be).join(", ");return`@${n} in (${o})`};D.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":D.and(...t.map(o=>D.notEq(n,o)))};D.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(D.wrap).join(" and ")};D.wrap=function(n){return`(${n})`};D.is=function(n,t){return`@${n} is ${t}`};D.or=function(...n){return n.join(" or ")};function st(e){return Object.keys(e).reduce((n,t)=>{let o=e[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=st(o)),n[i]=o,n},{})}var M=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(M||{});const z=new Ge,ye=new Ji;exports.ApplicationStatus=an;exports.Communication=Xi;exports.CoreError=Q;exports.DisplayListRow=tn;exports.EventBus=ye;exports.Filter=D;exports.Manager=z;exports.MetadataStore=Ne;exports.ModalListDownload=Wr;exports.NotificationSystem=it;exports.OBJECT_TYPE_NAME_FIELD=Tt;exports.RecordOperation=on;exports.WidgetAction=jr;exports.WidgetButton=qn;exports.WidgetFastTable=Mr;exports.WidgetFastTableHeadCell=It;exports.WidgetField=mr;exports.WidgetIcon=he;exports.WidgetImage=er;exports.WidgetList=pr;exports.WidgetLoader=Ye;exports.WidgetMultiButton=Kn;exports.WidgetResolverEntity=Ur;exports.WidgetSpinner=we;exports.WidgetTable=St;exports.WidgetTablePanelFilterItem=Nt;exports.asyncProcess=fe;exports.authService=X;exports.billingService=le;exports.catchUniversal=j;exports.config=On;exports.configuration=A;exports.constants=T;exports.convertDDToDMS=gi;exports.convertDMSToDD=mi;exports.convertListConfig=qe;exports.coreUtils=ki;exports.debounce=Yr;exports.documentsService=dn;exports.fileService=ta;exports.formatter=de;exports.getCellName=ie;exports.getCellValue=Oe;exports.getEntityLink=rt;exports.getNamesFromListConfig=Ze;exports.getUnitValue=je;exports.groupArrayByField=Gr;exports.historyService=Qi;exports.injectAction=Lt;exports.internationalizationService=ea;exports.invitationService=fn;exports.openService=Zi;exports.parseError=Je;exports.parseTextByMarkdown=pi;exports.prettyDate=Se;exports.prettyDateWithTime=Rt;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Qr;exports.request=q;exports.setupListRow=Xe;exports.staticLink=so;exports.t=Z;exports.throttle=Kr;exports.universalBatchUpdate=Vt;exports.universalEntityCount=ao;exports.universalEntityCreate=Dt;exports.universalEntityDelete=$t;exports.universalEntityRead=ae;exports.universalEntityUpdate=Qe;exports.universalHistoryRead=io;exports.universalListSettingRead=xt;exports.universalMetadataFieldTreat=no;exports.universalMetadataListRead=oo;exports.universalResolveEntityName=et;exports.universalToolRead=Pt;exports.useActions=xi;exports.useCommunication=Oi;exports.useEnter=Di;exports.useFormEntity=Fi;exports.useListActiveRow=_i;exports.useListDownload=rn;exports.useListEntity=Ai;exports.useListSearch=Pi;exports.useListSelect=$i;exports.useLocalStorage=At;exports.useManagerState=Si;exports.useMetadata=xe;exports.useSocket=L;exports.useUsageContext=ot;exports.useVisibleItem=Ke;exports.useWizard=Wi;exports.uuidv4=zr;exports.valuesToUpperCase=st;exports.wrapToolResponse=Mt;
12
+ */const vt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},bt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},wt=function(e,n){const t=this.events[e];if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1)},Et=function(){this.events={}};class K{constructor(){this.events={}}on(n,t){return vt.call(this,n,t)}emit(n,t){return bt.call(this,n,t)}off(n,t){return wt.call(this,n,t)}cleanEvents(){Et.call(this)}static on(n,t){return vt.call(K,n,t)}static emit(n,t){return bt.call(K,n,t)}static off(n,t){return wt.call(K,n,t)}static cleanEvents(){Et.call(K)}}K.events={};class Yi extends K{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return Ri(this.id,n)}static checkAndGenerate(n,t,o){return Ni(n,t,o).then(i=>i.length===0?Li(n,t,o):i[0])}}function Ki(){return R().emit("client:read",{})}class it extends Error{static ConstContextCannotBeChanged(){return new it("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ye,le;const X=class X extends K{constructor(){super(...arguments);Pe(this,ye);Pe(this,le);this.isConstContext=!1,this.type="front",this.organizations=[],Ee(this,le,!1)}set language(t){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextId(){return $e(this,ye)}set contextId(t){if(this.isConstContext)throw it.ConstContextCannotBeChanged();Ee(this,ye,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Ee(this,le,t),this.emit(X.EVENT_READY_UPDATE,t)}get ready(){return $e(this,le)}onReady(t){return this.on(X.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(X.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=t,localStorage.setItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(X.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){V()(t)}}restoreCurrentContext(){var o,i;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number"||((i=this.customer)==null?void 0:i.constContextId)===null)return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const t=Number.parseInt(localStorage.getItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Ki()}validateContextId(t){var o;try{return((o=this.person)==null?void 0:o.id)==t?!0:!!this.organizations.find(i=>i.id===t)}catch{return!1}}};ye=new WeakMap,le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Ge=X;function Ji(e){return R().emit("metadata:read",{entity:e})}const Le=function(){const n=r.reactive({}),t=new Map;function o(c){return n[c]}async function i(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Ji(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:i,get:o,loadingFlags:t}}();class Qi extends K{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class z{static login(n){return j(I.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:I.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return z.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return z.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return j(`${I.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return z.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return z.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return z.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return j(`${I.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(z.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return j(`${I.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:o,Code:i})})}static finishAccessRecovery(n,t,o,i){return j(`${I.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:o,ConfirmedPassword:i})})}}class Zi{static readHistoryById(n,t){return j(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ea{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await j(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ta{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return j(`/open-api/internationalization/language/${n}`)}}class na{static async upload(n,t){const o=new FormData;return o.append("file",n),j(`/close-api/files?entityName=${t}`,{method:"POST",body:o}).then(i=>(i.filename=n.name,i))}}var on=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(on||{}),an=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(an||{});function ra(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(ra(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 be(e){return typeof e=="string"?`'${e}'`:`${e}`}x.includes=function(n,t){return`@${n} Contains ${be(t)}`};x.beginWith=function(n,t){return`@${n} BeginWith ${be(t)}`};x.notEq=function(n,t){return`@${n} nq ${be(t)}`};x.eq=function(n,t){return Array.isArray(t)?x.in(n,t):`@${n} eq ${be(t)}`};x.in=function(n,t){const o=t.map(be).join(", ");return`@${n} in (${o})`};x.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":x.and(...t.map(o=>x.notEq(n,o)))};x.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(x.wrap).join(" and ")};x.wrap=function(n){return`(${n})`};x.is=function(n,t){return`@${n} is ${t}`};x.or=function(...n){return n.join(" or ")};function at(e){return Object.keys(e).reduce((n,t)=>{let o=e[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=at(o)),n[i]=o,n},{})}var P=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(P||{});function oa(e){return typeof e!="string"?!1:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}const H=new Ge,he=new Qi;exports.ApplicationStatus=an;exports.Communication=Yi;exports.CoreError=Q;exports.DisplayListRow=tn;exports.EventBus=he;exports.Filter=x;exports.Manager=H;exports.MetadataStore=Le;exports.ModalListDownload=Wr;exports.NotificationSystem=ot;exports.OBJECT_TYPE_NAME_FIELD=_t;exports.RecordOperation=on;exports.WidgetAction=jr;exports.WidgetButton=qn;exports.WidgetFastTable=Mr;exports.WidgetFastTableHeadCell=St;exports.WidgetField=mr;exports.WidgetIcon=ge;exports.WidgetImage=er;exports.WidgetList=pr;exports.WidgetLoader=Ye;exports.WidgetMultiButton=Kn;exports.WidgetResolverEntity=Ur;exports.WidgetSpinner=ve;exports.WidgetTable=At;exports.WidgetTablePanelFilterItem=It;exports.asyncProcess=ce;exports.authService=z;exports.billingService=ae;exports.catchUniversal=V;exports.config=On;exports.configuration=I;exports.constants=S;exports.convertDDToDMS=gi;exports.convertDMSToDD=mi;exports.convertListConfig=qe;exports.coreUtils=_i;exports.debounce=Yr;exports.documentsService=dn;exports.fileService=na;exports.formatter=ue;exports.getCellName=re;exports.getCellValue=Oe;exports.getEntityLink=en;exports.getNamesFromListConfig=Ze;exports.getPathForResolveRouter=yi;exports.getUnitValue=je;exports.groupArrayByField=Gr;exports.historyService=Zi;exports.injectAction=Lt;exports.internationalizationService=ta;exports.invitationService=fn;exports.isUUID=oa;exports.openService=ea;exports.parseError=Je;exports.parseTextByMarkdown=pi;exports.prettyDate=Se;exports.prettyDateWithTime=Nt;exports.prettyMoney=Ot;exports.prettyValueFieldByEntity=Qr;exports.request=j;exports.setupListRow=Xe;exports.staticLink=so;exports.t=Z;exports.throttle=Kr;exports.universalBatchUpdate=Pt;exports.universalEntityCount=ao;exports.universalEntityCreate=xt;exports.universalEntityDelete=Dt;exports.universalEntityRead=oe;exports.universalEntityUpdate=Qe;exports.universalHistoryRead=io;exports.universalListSettingRead=Bt;exports.universalMetadataFieldTreat=no;exports.universalMetadataListRead=oo;exports.universalResolveEntityName=et;exports.universalToolRead=$t;exports.useActions=Di;exports.useCommunication=Fi;exports.useEnter=$i;exports.useFormEntity=Bi;exports.useListActiveRow=Ti;exports.useListDownload=rn;exports.useListEntity=Si;exports.useListSearch=Vi;exports.useListSelect=Pi;exports.useLocalStorage=Tt;exports.useManagerState=Ii;exports.useMetadata=xe;exports.useSocket=R;exports.useUsageContext=rt;exports.useVisibleItem=Ke;exports.useWizard=qi;exports.uuidv4=zr;exports.valuesToUpperCase=at;exports.wrapToolResponse=Vt;
13
13
  //# sourceMappingURL=eservices-core.cjs.js.map