eservices-core 1.3.62 → 1.3.63

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,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{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-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{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-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]: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}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  "use strict";/*!
3
- * eservices-core v1.3.62
3
+ * eservices-core v1.3.63
4
4
  * (c) 2023 ESERVICES
5
- */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("jenesius-vue-form"),Ot=require("vue-router"),Ve=require("debug"),Rt=require("date-and-time");function Lt(n,e){return!!n&&n===e||"password is not equal"}function ot(n){return Number(n.replace(/[^0-9.]/g,""))}function $t(n,e=null){let r=String(ot(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Pt=Object.freeze(Object.defineProperty({__proto__:null,numeric:ot,prettyNumeric:$t,validPassword:Lt},Symbol.toStringTag,{value:"Module"})),Dt={inputs:Pt};function Se(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?Se(n[r],e.substr(t+1)):void 0}return n[e]}function be(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function st(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const at=class w extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=w.ID++}static ParentFormNotFound(){return new w("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new w("Composite object name is undefined",e)}static EntityWithoutName(e){return new w("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new w(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new w("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new w("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new w(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return w.ApiNotAvailable()}static ApiError(e){return new w("Request error",e)}static ApiNotAvailable(){return new w(`Sorry, we experience difficulties here.
6
- Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?w.ApiNotAvailable():new w(e||"Authorization Error",t)}static ApiResponseParseFailed(){return w.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new w("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new w(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new w("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new w("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new w(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new w(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new w(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new w(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new w("The request took too long to complete. Try again later.")}};at.ID=0;let x=at;const xt="Please try again later or submit a feedback if problem doesn't go.";class ct{static getClientData(){return g("/close-api/client-content")}static getNavigation(){return g("/close-api/client/navigation")}}const Bt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new Vt(e,t,i,r||[],s);return this.store.push(u),i&&setTimeout(this.remove.bind(this,u.id),i*1e3),u}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},lt=class ut{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=ut.cardId++}};lt.cardId=1;let Vt=lt;/*!
5
+ */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("jenesius-vue-form"),Ot=require("vue-router"),Ve=require("debug"),Rt=require("date-and-time");function Lt(n,e){return!!n&&n===e||"password is not equal"}function ot(n){return Number(n.replace(/[^0-9.]/g,""))}function $t(n,e=null){let r=String(ot(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Pt=Object.freeze(Object.defineProperty({__proto__:null,numeric:ot,prettyNumeric:$t,validPassword:Lt},Symbol.toStringTag,{value:"Module"})),Dt={inputs:Pt};function Se(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?Se(n[r],e.substr(t+1)):void 0}return n[e]}function be(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function st(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const at=class v extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=v.ID++}static ParentFormNotFound(){return new v("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new v("Composite object name is undefined",e)}static EntityWithoutName(e){return new v("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new v(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new v("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new v("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new v(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return v.ApiNotAvailable()}static ApiError(e){return new v("Request error",e)}static ApiNotAvailable(){return new v(`Sorry, we experience difficulties here.
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?v.ApiNotAvailable():new v(e||"Authorization Error",t)}static ApiResponseParseFailed(){return v.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new v("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new v(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new v("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new v("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new v(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new v(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new v(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new v(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new v("The request took too long to complete. Try again later.")}};at.ID=0;let x=at;const xt="Please try again later or submit a feedback if problem doesn't go.";class ct{static getClientData(){return g("/close-api/client-content")}static getNavigation(){return g("/close-api/client/navigation")}}const Bt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new Vt(e,t,i,r||[],s);return this.store.push(u),i&&setTimeout(this.remove.bind(this,u.id),i*1e3),u}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},lt=class ut{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=ut.cardId++}};lt.cardId=1;let Vt=lt;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Ye=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Je=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},He=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Xe=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ye.call(this,e,t)}emit(e,t){return Je.call(this,e,t)}off(e,t){return He.call(this,e,t)}cleanEvents(){Xe.call(this)}static on(e,t){return Ye.call(D,e,t)}static emit(e,t){return Je.call(D,e,t)}static off(e,t){return He.call(D,e,t)}static cleanEvents(){Xe.call(D)}}D.events={};var dt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},fe=(n,e,t)=>(dt(n,e,"read from private field"),t?t.call(n):e.get(n)),Le=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},$e=(n,e,t,r)=>(dt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ne,pe,he;const Y=class N extends D{constructor(){super(...arguments),Le(this,ne,void 0),Le(this,pe,"front"),this.organizations=[],Le(this,he,!1)}set language(e){localStorage.setItem(N.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)||N.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){$e(this,ne,e)}get router(){if(!fe(this,ne))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return fe(this,ne)}set type(e){$e(this,pe,e)}get type(){return fe(this,pe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){$e(this,he,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return fe(this,he)}onReady(e){return this.on(N.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(N.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(N.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(N.CURRENT_CONTEXT_KEY,String(e)),this.emit(N.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(N.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Bt.add("error",x.ApiNotAvailable().message)}}loadCustomerData(){return ct.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};ne=new WeakMap;pe=new WeakMap;he=new WeakMap;Y.DEFAULT_LANGUAGE="en";Y.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";Y.EVENT_CONTEXT_UPDATE="event:context-update";Y.EVENT_READY_UPDATE="event:ready-update";Y.EVENT_DATA_UPDATE="event:data-update";Y.CURRENT_CONTEXT_KEY="CurrentContext";let Ut=Y;const Qe=new Ut;function Mt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return xt}})}function g(n,e={}){return Qe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Qe.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw x.ApiNotAvailable()}).then(t=>Mt(t).then(r=>{if(!t.ok)throw r;return r}))}class ke{constructor(){}static parseNamesFromListConfig(e){let t=ke.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),u=i.substring(s+1),c=i.substring(0,s);c in r||(r[c]={}),t(r[c],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ft{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const ft=new Ft;function pt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ue(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ue(r)),e[i]=r,e},{})}function Wt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt={Request:g,clickOutside:be,getPropFromObject:Se,runPromiseQueue:st,GraphQL:ke,firstChapterToLowerCase:pt,valuesToUpperCase:Ue,prettyMoney:Wt},qt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ke,Journal:ft,Request:g,clickOutside:be,default:jt,firstChapterToLowerCase:pt,getPropFromObject:Se,runPromiseQueue:st,valuesToUpperCase:Ue},Symbol.toStringTag,{value:"Module"}));function ht(n,e=""){for(let t in n){if(typeof n[t]=="object"){ht(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const M={};function Gt(n){for(let e in n)M[e]=n[e];n.styles&&ht(n.styles),ft.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const zt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Kt{static readHistoryById(e,t){return g(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const u=s.changes.map(c=>({...c,oldValue:c.originalValue,name:c.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class Yt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return g(`/open-api/internationalization/language/${e}`)}}let K={};function Q(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||K,n);if(typeof t=="string")return Ze(t,e);const r=I.utils.getPropFromObject(K==null?void 0:K.root,n);return typeof r=="string"?Ze(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function Ze(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Q.setGlobalVocabulary=function(n){K=n};Q.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Q.bind({vocabulary:I.utils.getPropFromObject(K,e.toLowerCase())})};Q.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(K,n)),Q.bind({vocabulary:n})};const Jt=function(){let n=!1;const e=[];function t(){return n}function r(l,d){t()&&console[l](...d),e.push(d)}function i(...l){r("log",l)}function s(...l){r("warn",l)}function u(...l){r("error",l)}function c(l=!0){n=l}return{info:i,warn:s,history:e,display:c,error:u}}();function Ht(){return Jt}class C{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw x.AuthServiceError(e.title,t)}static login(e){return g(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(C.parseError)}static registration(e){return e.AppName=M.applicationName,g(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(C.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return C.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return g(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError)}static startLoginProcess(e){return C.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return C.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return C.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return g(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError).then(C.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Xt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Qt="masterId",Zt="masterEntity";function De(n,e){if(!Array.isArray(e))return;if(Xt(e))return t(e);e.forEach(t);function t(r){n.append(Zt,r[0]),n.append(Qt,r[1].toString())}}class ae{static async anonymousGetList(e){return await g(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([c,l="desc"])=>`@${c} ${l}`).join(",");t("order",u)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=ae.getSearchParamsForEntityListRead(t||{});return await g(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ae.getSearchParamsForEntityListRead(t||{});return g(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return De(i,r==null?void 0:r.masterEntities),g(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return g(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return g(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return De(s,i==null?void 0:i.masterEntities),g(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return ae.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return g(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const gt=class re{static async create(e){return g(re.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return g(re.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return g(`${re.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return g(`${re.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};gt.url="/close-api/communications";let en=gt;function et(n){return{...n,createdEntities:n.createdEntites}}const yt=class ge{static async getStartConfig(e,t){return g([ge.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return g([ge.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(et)}static async runStep(e,t,r,i,s){return g([ge.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(et)}};yt.url="/close-api/views/process-wizard";let ye=yt;class tn{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class nn{static invite(e,t,r){return g("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Me{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return g(Me.url+e,{method:"POST",body:JSON.stringify(t)})}}class rn{static getConfiguration(){return g("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const on={class:"widget-table__head"},sn={class:"widget-table__head-label margin_0 text_overflow"},an=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",on,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",sn,o.toDisplayString(r.label),1)]))),128))]))}});const F=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},cn=F(an,[["__scopeId","data-v-25198f4a"]]);function mt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=mt(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Fe(n){return["eservices-core",n].join(":")}function wt(n){return We(n,"YYYY/MM/DD HH:mm:ss")}function We(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Rt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ln={props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},ce=F(ln,[["__scopeId","data-v-e287c8d9"]]),un=Ve(Fe("setup-list-row"));function dn(n,e){const t=n.config.map(r=>fn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function fn(n,e,t){const r=e.values;let i=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(h){s.onClick.push(()=>h(r))}function c(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const l=[],d=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(c(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=We(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=wt(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{d.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),u(tt.bind(null,t,!0));break}case"select":{d.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),u(tt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const h=n.link(r);if(h){const _=o.h(Ot.RouterLink,{to:h});d.push(_),c("widget-table-cell_link")}}catch(h){un("Can't add router link",h)}if(n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&d.push(o.h(ce,{name:n.icon})),typeof n.icon=="function")){const h=n.icon(r);h!==null&&d.push(o.h(ce,{name:h}))}return n.class&&(typeof n.class=="function"?c(n.class(r)):c(n.class)),l.push(o.h("td",s,d)),l}function tt(n,e){n.emit("select",e)}function vt(n,e){return()=>{try{return dn(n,e)}catch(t){return console.warn(t),null}}}const pn={props:{values:Object,config:Object,selected:Boolean},setup:vt},hn=["colspan"],nt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,hn)],512))}}),b={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},gn={class:"widget-table"},rt="update:selectedRows",yn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,l=!0){if(!t.selectedRows)return;if(!l)return e(rt,t.selectedRows.includes(c)?[]:[c]);const d=[...t.selectedRows],h=d.indexOf(c);return h===-1?d.push(c):d.splice(h,1),e(rt,d)}function u(c){e("save",c),e("update:activeRow",null)}return(c,l)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",gn,[o.createVNode(cn,{config:c.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:h},[o.createVNode(pn,{config:c.config,values:d,selected:c.selectedRows.includes(d),onSelect:_=>s(d,_),class:o.normalizeClass(c.classCallback?c.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===d?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,values:d,onClose:l[0]||(l[0]=_=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(b).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,onClose:l[1]||(l[1]=d=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),mn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=F(mn,[["__scopeId","data-v-0ef9ae88"]]),En={class:"widget-button"},wn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",En,[e.wait?(o.openBlock(),o.createBlock(Ae,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const vn=F(wn,[["__scopeId","data-v-450dc564"]]),_n={class:"widget-multi-button-wrap position_relative cursor_pointer"},Tn={class:"widget-multi-button-body grid"},Cn=["onClick"],Sn={class:"widget-multi-button-side-wrap"},bn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function s(u=!t.active){t.active=u}return(u,c)=>(o.openBlock(),o.createElementBlock("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Tn,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=l=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(l,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:h=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,Cn))),128))]),o.createElementVNode("div",Sn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=l=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const kn=F(bn,[["__scopeId","data-v-a8d711d1"]]),An={class:"widget-loader flex flex-align_center gap_10 padding_15"},Nn={class:"text_md"},In=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",An,[o.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Nn,o.toDisplayString(e.label),1)]))}}),On=["alt","src"],Rn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,On))}}),Ln={props:{config:Array,values:Object,selected:Boolean},setup:vt};const $n=F(Ln,[["__scopeId","data-v-344a8cc1"]]),Pn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Dn={class:"widget-list-head-cell"},xn=Pn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Bn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Dn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(I.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ce),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),xn])]))}});const Vn=F(Bn,[["__scopeId","data-v-bf495d6a"]]),Un=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function l(E,v){let f=-1;do f++,v-=E[f];while(v>0&&f<E.length);return f}function d(E,v){let f=0;for(;v>0&&v>E[f]&&f<E.length;)v-=E[f],f++;return console.log(v,f),f>0?f:0}function h(E){try{i.value.style.insetInlineStart=E+"px"}catch(v){console.log(v)}}function _(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(v){console.log(v)}}function O(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(v){var Ke;function f(A){return A.screenX+p-S}const m=r.value,a=[...m.children].filter(A=>A.localName==="th"),p=((Ke=m.offsetParent)==null?void 0:Ke.scrollLeft)||0,y=a.map(A=>A.clientWidth),$=O(v.target),S=m.getBoundingClientRect().left,J=f(v),T=l(y,J),W=y.slice(0,T).reduce((A,P)=>A+P,0),Z=J-W,Oe=m.offsetWidth,ee=a[T].clientWidth;if(t.config[T].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",v.screenX),console.log("Widths",y),console.log("max width",Oe),console.log("Start Position",J),console.log("Position From",T),console.log("Start Position",T),console.log("Global offset (Отступ самой таблицы от края экрана)",S),console.log("Del",Z),console.groupEnd(),i.value.innerText=a[T].textContent||"",i.value.style.display="grid",i.value.style.width=ee+"px",i.value.style.cursor="grabbing",h(W),_(ee),document.addEventListener("pointermove",ze,{passive:!0}),document.addEventListener("pointerup",Ge);function Ge(A){if(console.group("END"),document.removeEventListener("pointermove",ze),document.removeEventListener("pointerup",Ge),$&&(t.config[T].width=i.value.style.width,t.config[T].minWidth=i.value.style.width,t.config[T].maxWidth=i.value.style.width,s(t.config)),!$){const P=A.screenX+p-S;console.log("ENP Position",P);const de=d(y,P);if(console.log(T,"->",de),de!==T){const te=t.config[T],Re=t.config;Re.splice(T,1),Re.splice(de,0,te),s(Re)}else{const te=t.config[T].name;u(te)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ze(A){if($){const te=f(A)-J+ee;_(te);return}let P=A.screenX+p-S-Z;P<0&&(P=0),P+ee>Oe&&(P=Oe-ee),h(P)}})});function s(l){e("update:config",l)}function u(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(t.order.length===0||t.order[0]!==l)return void c([l]);const d=t.order.length===1||t.order[1]==="asc"?"asc":"desc";c([l,d==="asc"?"desc":"asc"])}function c(l){e("update:order",l)}return(l,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.config,(h,_)=>(o.openBlock(),o.createBlock(Vn,o.mergeProps({key:h},h,{onOrder:O=>u(h.name),onSelect:d[0]||(d[0]=O=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Mn=F(Un,[["__scopeId","data-v-ccffc6bd"]]),Fn={class:"widget-list"},Wn={class:"widget-list-body position_relative"},jn=50,qn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(c,l=!0){if(t.selectedRows)if(!l)s(t.selectedRows.includes(c)?[]:[c]);else{const d=[...t.selectedRows],h=d.indexOf(c);h===-1?d.push(c):d==null||d.splice(h,1),s(d)}}function i(){var c;if(((c=t.selectedRows)==null?void 0:c.length)!==t.array.length)return s([...t.array]);s([])}function s(c){e("update:selectedRows",c)}function u(c){if(!c)return;const l=c.target;l.scrollTop+l.clientHeight+jn>l.scrollHeight&&e("scrollEnd")}return(c,l)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Fn,[o.createElementVNode("thead",null,[o.createVNode(Mn,{onSelect:l[0]||(l[0]=d=>i()),"onUpdate:order":l[1]||(l[1]=d=>e("update:order",d)),"onUpdate:config":l[2]||(l[2]=d=>e("update:config",d)),config:c.config,order:c.order},null,8,["config","order"])]),o.createElementVNode("tbody",Wn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(d,h)=>{var _;return o.openBlock(),o.createBlock($n,{key:h,class:"widget-list-row",values:d,config:c.config,selected:(_=c.selectedRows)==null?void 0:_.includes(d),onSelect:O=>r(d,O)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Gn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function _e(n){return typeof n=="string"?Pe(n):zn(n)?Pe(n.message):Pe(b.DEFAULT_ERROR_MESSAGE)}function zn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Pe(n){return{message:n}}function U(n="error"){return function(e){const{message:t}=_e(e);Ce.add(n,t)}}function Te(n,e={}){return k().emit("entity:read",{...e,entity:n})}function je(n,e){return k().emit("entity:update",{...e,entity:n})}function Kn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function qe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=qe(r)),e[i]=r,e},{})}function Yn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Jn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Hn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return b.DEFAULT_ERROR_MESSAGE}})}function Tt(n,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(b.DEFAULT_ERROR_MESSAGE)}).then(t=>Hn(t).then(r=>{if(!t.ok)throw r;return r}))}function Xn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Qn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Zn=Ve(Fe("pretty-value-field-by-entity"));function er(n,e,t){try{const r=xe.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Zn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}const tr=1,nr=5e3,j=Ve(Fe("use-socket"));function k(){return ir}function rr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const ir=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},nr*2);const a=new Uint8Array(1);a[0]=tr,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{m(a)&&(j("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?l({requestId:a.requestId,event:"request-error",data:{message:x.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},b.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(a){const p=[...r.values()];j("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(y=>{const $=a.requestId;(y.requestId&&y.requestId===$||!y.requestId&&y.event===a.event)&&(j("Find appropriated handler: %d, event: %s",n,y.event),y.callback(a.data,a),y.once&&(r.delete(y),j("Handler was removed by *once* params was passed. %o",y)))})}function d(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(a){j("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{h(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(rr(a.data)){u();return}const y=JSON.parse(a.data);if(!Ct(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(p=y==null?void 0:y.data)!=null&&p.refresh&&location.reload(),l(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function h(a){e.send(a)}function _(a,p){f({event:a,callback:p})}function O(a,p){f({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function v(a,p,y){const $=++n,S=JSON.stringify({requestId:$,event:a,data:p,contextId:R.contextId,url:window.location.href});return E()?h(S):(s.add(S),j("Socket is not connected. Message was send to save-queue")),new Promise((J,T)=>{f({event:a,requestId:$,once:!0,guaranteedAnswer:!0,serializeString:S,callback:(W,Z)=>{if(j("Promise was resolve with next data:",W),or(Z))return void T(W);y&&y(W,Z),J(W)},timeToLive:b.TIME_TO_LIVE_SOCKET_REQUEST})})}function f(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function m(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:_,once:O,emit:v,initialization(a){t=a},getDevInfo:c}}(),or=n=>!!Ct(n)&&n.event==="request-error",Ct=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function sr(n,e){return k().emit("list-setting:read",{entity:n,mark:e})}function ar(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function St(n,e){return k().emit("entity:create",{...e,entity:n})}function bt(n,e){return k().emit("entity:delete",{...e,entity:n})}function cr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function lr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const f=E();return i.value=!0,typeof f.limit!="number"&&(f.limit=100),f.offset=r,Te(n,f).then(m=>(r+=m.length,m)).finally(()=>{i.value=!1})}function u(f,m){var p;if(typeof f.Version=="number")return f.Version;const a=(p=t.find(y=>y.Id===m))==null?void 0:p.Version;if(a===void 0)throw new Error("Object without version.");return a}function c(f,m){const a=t.findIndex(p=>p.Id===f);if(a===-1)throw new Error(`Can't found item with Id ${f}`);t.splice(a,1,m)}function l(f){const m=t.findIndex(a=>a.Id===f);if(m===-1)throw new Error(`Can't found item with Id ${f}`);t.splice(m,1)}async function d(f,m){try{const a=E(),p=u(m,f);delete m.Version,await je(n,{id:f,values:m,version:p});const y=await Te(n,{fields:a.fields||"",id:f});c(f,y)}catch(a){U()(a)}}async function h(f,m){try{const a=E(),p=u(m,f);delete m.Version,await bt(n,{id:f,version:p}),l(f)}catch(a){U()(a)}}async function _(f){try{await St(n,{values:f}),await v()}catch(m){U()(m)}}async function O(){try{const f=await s();t.push(...f)}catch(f){U()(f)}}function E(){return typeof e=="function"?e():e}async function v(){try{r=0;const f=await s();t.splice(0,t.length,...f)}catch(f){U()(f)}}return{array:t,updateById:d,next:O,reload:v,wait:i,create:_,deleteById:h}}function ur(){function n(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=o.reactive(n());return R.onupdateContext(()=>{Object.assign(e,n())}),e}function dr(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function pr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function hr(n){return k().emit("communication-message:read",{communicationId:n})}function gr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>hr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function yr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return Te(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(U())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw U()(i),i})};function t(){return typeof e=="function"?e():e}}function mr(n,e){return k().emit("metadata:read",{...e,entity:n})}class le{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[le.getKey(e,t)]=r}get(e,t={}){return this.state[le.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return mr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:Er(t.masterEntities)};return JSON.stringify(r)}}function Er(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:wr(n)?[n]:n}function wr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function vr(n,e={}){if(!n)return o.inject(b.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?xe.getByKey(t.value):null);o.provide(b.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=le.getKey(n,it(e||{}))}const s=function(){return i(),xe.update(n,it(e||{}))};return i(),{state:r,update:s}}function it(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=_r(r),s=new Tr(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function _r(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const kt=class At{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=At.cardId++}};kt.cardId=1;let Tr=kt;class Cr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return pr(this.id,e)}static checkAndGenerate(e,t,r){return fr(e,t,r).then(i=>i.length===0?dr(e,t,r):i[0])}}function Sr(){return k().emit("client:read",{})}var Nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},br=(n,e,t)=>(Nt(n,e,"read from private field"),t?t.call(n):e.get(n)),kr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ar=(n,e,t,r)=>(Nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),me;const Ne=class H extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],kr(this,me,!1)}set language(e){localStorage.setItem(b.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(b.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ar(this,me,e),this.emit(H.EVENT_READY_UPDATE,e)}get ready(){return br(this,me)}onReady(e){return this.on(H.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(H.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(H.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){U()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Sr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};me=new WeakMap;Ne.DEFAULT_LANGUAGE="en";Ne.EVENT_CONTEXT_UPDATE="event:context-update";Ne.EVENT_READY_UPDATE="event:ready-update";let Nr=Ne;function Ir(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function L(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Ir(r)){let i=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(L.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}L.includes=function(e,t){return`@${e} Contains ${ue(t)}`};L.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`};L.notEq=function(e,t){return`@${e} nq ${ue(t)}`};L.eq=function(e,t){return Array.isArray(t)?L.in(e,t):`@${e} eq ${ue(t)}`};L.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`};L.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")};L.is=function(e,t){return`@${e} is ${t}`};L.or=function(...e){return e.join(" or ")};const R=new Nr,xe=new le;class Or{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return De(i,r),Tt([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Rr(n,e="images"){return`/static-folder/${e}/${n}`}class Lr{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return g(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):x.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return g(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return g(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var It=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(It(n,e,"read from private field"),t?t.call(n):e.get(n)),q=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},G=(n,e,t,r)=>(It(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,ie,we,ve,oe,se,Be;const z="_______LIST_______ROW_______INDEX________NAME_______",Ie=class V extends D{constructor(e){super(),this.LIST_ROW_KEY=1,q(this,Ee,void 0),this.array=[],q(this,ie,[]),q(this,we,[]),q(this,ve,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(V.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(V.EVENT_FILTERS_UPDATE,t),!0)})),q(this,oe,!1),q(this,se,(...t)=>Promise),q(this,Be,()=>{}),G(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,ie,e.config)}set config(e){G(this,ie,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,we)}set order(e){G(this,we,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,ve)}set filters(e){Pr(B(this,ve),e)}set wait(e){G(this,oe,e),this.emit(I.Form.EVENT_WAIT,B(this,oe))}get wait(){return B(this,oe)}get primaryKeys(){return B(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[z]===e)}indexByKey(e){return this.array.findIndex(t=>t[z]===e)}static getKey(e){return e[z]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,z)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(V.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(V.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(V.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[z]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,z)}set read(e){G(this,se,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,se).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){G(this,se,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,Be).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[z]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=V.getCellName(e),i=(()=>{let s=r?Se(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};Ee=new WeakMap;ie=new WeakMap;we=new WeakMap;ve=new WeakMap;oe=new WeakMap;se=new WeakMap;Be=new WeakMap;Ie.EVENT_DATA="list-data: update";Ie.EVENT_CONFIG_UPDATE="list-config:update";Ie.EVENT_ORDER_UPDATE="list-order:update";Ie.EVENT_FILTERS_UPDATE="list-filters:update";function $r(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Pr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Dr(n){const e=o.reactive([]);function t(c){return e.includes(c)}function r(c){t(c)||e.push(c)}function i(c){const l=e.findIndex(d=>d===c);l!==-1&&e.splice(l,1)}function s(c){const l=o.unref(n);if(c===void 0){e.length===0?l.forEach(r):l.forEach(i);return}t(c)?i(c):r(c)}const u=o.computed(()=>{const c=o.unref(n);return e.length===c.length&&c.length!==0});return[e,s,u,r,i]}function xr(n){return n.statusName==="Completed"}function Br(n){return n.statusName==="FinalStepWithConfirmation"}function Vr(n){return n.statusName==="ValidationError"}function Ur(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const c=o.ref(null);function l(){c.value=s.find(a=>a.name===u)||null}function d(){var a;return u?((a=s.find(p=>p.name===u))==null?void 0:a.fields)||[]:[]}function h(a){if(l(),Vr(a))return void t.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!d().length||Mr(d(),t.presets)))return m(t.presets||{});xr(a)&&t.onCompleted(a),Br(a)&&t.onConfirmation(a)}async function _(){try{await O(),await f()}catch(a){const{message:p}=_e(a);Ce.add("error",p)}}function O(){return i.wait="Loading process information.",ye.getStartConfig(e,n).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((y,$)=>($.properties.forEach(S=>{y.push({name:S.name,label:S.title,type:S.refEntityName||S.dataType})}),y),[])}))}).then(a=>(i.wait=!1,a))}function E(a){return u=a.nextStepName,r=a.token,a}function v(a){const p=_e(a);Ce.add("error",p.message)}function f(){return i.wait="Starting process",ye.startProcess(e,n).then(E).then(h).catch(v).finally(()=>{i.wait=null})}function m(a={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ye.runStep(e,n,u,r,a).then(E).then(h).catch(v).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:o.readonly(c),next:m}}function Mr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Fr="close-api/proxy/Equipment/Search";class Wr{static search(e,t,r,i,s){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),s&&(u.append("limit",String(s.limit)),u.append("offset",String(s.offset)));const c=`/${Fr}?${u.toString()}`;return g(c,{method:"GET",headers:{"Content-Type":"application/json"}})}}const jr={clickOutside:be,staticLink:Rr},qr={usage:Dt,utils:qt,config:Gt,types:zt};exports.Communication=Cr;exports.CoreError=x;exports.Filter=L;exports.Manager=R;exports.NotificationSystem=Ce;exports.WidgetButton=vn;exports.WidgetIcon=ce;exports.WidgetImage=Rn;exports.WidgetList=qn;exports.WidgetLoader=In;exports.WidgetMultiButton=kn;exports.WidgetSpinner=Ae;exports.WidgetTable=yn;exports.actionService=Or;exports.asyncProcess=Gn;exports.authService=C;exports.billingService=X;exports.catchUniversal=U;exports.clickOutside=be;exports.clientService=ct;exports.communicationService=en;exports.constants=b;exports.dataService=ae;exports.debounce=Xn;exports.default=qr;exports.documentsService=Lr;exports.equipmentService=Wr;exports.fileService=tn;exports.getCellName=mt;exports.getCellValue=Et;exports.getNamesFromListConfig=Kn;exports.groupArrayByField=Yn;exports.historyService=Kt;exports.internationalizationService=Yt;exports.invitationService=nn;exports.openService=rn;exports.parseError=_e;exports.prettyDate=We;exports.prettyDateWithTime=wt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=er;exports.processWizardService=ye;exports.request=Tt;exports.ruleValidationService=Me;exports.t=Q;exports.throttle=Qn;exports.universalEntityCreate=St;exports.universalEntityDelete=bt;exports.universalEntityRead=Te;exports.universalEntityUpdate=je;exports.universalListSettingRead=sr;exports.universalMetadataFieldTreat=ar;exports.useCommunication=gr;exports.useFormEntity=yr;exports.useListActiveRow=cr;exports.useListEntity=lr;exports.useListSearch=$r;exports.useListSelect=Dr;exports.useLogger=Ht;exports.useManagerState=ur;exports.useMetadata=vr;exports.useSocket=k;exports.useWizard=Ur;exports.utils=jr;exports.uuidv4=Jn;exports.valuesToUpperCase=qe;
10
+ */const Ye=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Je=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},He=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Xe=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ye.call(this,e,t)}emit(e,t){return Je.call(this,e,t)}off(e,t){return He.call(this,e,t)}cleanEvents(){Xe.call(this)}static on(e,t){return Ye.call(D,e,t)}static emit(e,t){return Je.call(D,e,t)}static off(e,t){return He.call(D,e,t)}static cleanEvents(){Xe.call(D)}}D.events={};var dt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},fe=(n,e,t)=>(dt(n,e,"read from private field"),t?t.call(n):e.get(n)),Le=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},$e=(n,e,t,r)=>(dt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ne,pe,he;const Y=class N extends D{constructor(){super(...arguments),Le(this,ne,void 0),Le(this,pe,"front"),this.organizations=[],Le(this,he,!1)}set language(e){localStorage.setItem(N.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)||N.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){$e(this,ne,e)}get router(){if(!fe(this,ne))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return fe(this,ne)}set type(e){$e(this,pe,e)}get type(){return fe(this,pe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){$e(this,he,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return fe(this,he)}onReady(e){return this.on(N.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(N.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(N.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(N.CURRENT_CONTEXT_KEY,String(e)),this.emit(N.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(N.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Bt.add("error",x.ApiNotAvailable().message)}}loadCustomerData(){return ct.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};ne=new WeakMap;pe=new WeakMap;he=new WeakMap;Y.DEFAULT_LANGUAGE="en";Y.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";Y.EVENT_CONTEXT_UPDATE="event:context-update";Y.EVENT_READY_UPDATE="event:ready-update";Y.EVENT_DATA_UPDATE="event:data-update";Y.CURRENT_CONTEXT_KEY="CurrentContext";let Ut=Y;const Qe=new Ut;function Ft(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return xt}})}function g(n,e={}){return Qe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Qe.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw x.ApiNotAvailable()}).then(t=>Ft(t).then(r=>{if(!t.ok)throw r;return r}))}class ke{constructor(){}static parseNamesFromListConfig(e){let t=ke.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),u=i.substring(s+1),c=i.substring(0,s);c in r||(r[c]={}),t(r[c],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Mt{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const ft=new Mt;function pt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ue(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ue(r)),e[i]=r,e},{})}function Wt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt={Request:g,clickOutside:be,getPropFromObject:Se,runPromiseQueue:st,GraphQL:ke,firstChapterToLowerCase:pt,valuesToUpperCase:Ue,prettyMoney:Wt},qt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ke,Journal:ft,Request:g,clickOutside:be,default:jt,firstChapterToLowerCase:pt,getPropFromObject:Se,runPromiseQueue:st,valuesToUpperCase:Ue},Symbol.toStringTag,{value:"Module"}));function ht(n,e=""){for(let t in n){if(typeof n[t]=="object"){ht(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const F={};function Gt(n){for(let e in n)F[e]=n[e];n.styles&&ht(n.styles),ft.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=F}const zt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Kt{static readHistoryById(e,t){return g(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const u=s.changes.map(c=>({...c,oldValue:c.originalValue,name:c.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class Yt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return g(`/open-api/internationalization/language/${e}`)}}let K={};function Q(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||K,n);if(typeof t=="string")return Ze(t,e);const r=I.utils.getPropFromObject(K==null?void 0:K.root,n);return typeof r=="string"?Ze(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function Ze(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Q.setGlobalVocabulary=function(n){K=n};Q.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Q.bind({vocabulary:I.utils.getPropFromObject(K,e.toLowerCase())})};Q.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(K,n)),Q.bind({vocabulary:n})};const Jt=function(){let n=!1;const e=[];function t(){return n}function r(l,d){t()&&console[l](...d),e.push(d)}function i(...l){r("log",l)}function s(...l){r("warn",l)}function u(...l){r("error",l)}function c(l=!0){n=l}return{info:i,warn:s,history:e,display:c,error:u}}();function Ht(){return Jt}class C{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw x.AuthServiceError(e.title,t)}static login(e){return g(F.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:F.applicationName})}).catch(C.parseError)}static registration(e){return e.AppName=F.applicationName,g(F.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(C.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return C.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return g(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError)}static startLoginProcess(e){return C.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return C.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return C.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return g(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError).then(C.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Xt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Qt="masterId",Zt="masterEntity";function De(n,e){if(!Array.isArray(e))return;if(Xt(e))return t(e);e.forEach(t);function t(r){n.append(Zt,r[0]),n.append(Qt,r[1].toString())}}class ae{static async anonymousGetList(e){return await g(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([c,l="desc"])=>`@${c} ${l}`).join(",");t("order",u)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=ae.getSearchParamsForEntityListRead(t||{});return await g(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ae.getSearchParamsForEntityListRead(t||{});return g(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return De(i,r==null?void 0:r.masterEntities),g(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return g(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return g(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return De(s,i==null?void 0:i.masterEntities),g(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return ae.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return g(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const gt=class re{static async create(e){return g(re.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return g(re.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return g(`${re.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return g(`${re.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};gt.url="/close-api/communications";let en=gt;function et(n){return{...n,createdEntities:n.createdEntites}}const yt=class ge{static async getStartConfig(e,t){return g([ge.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return g([ge.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(et)}static async runStep(e,t,r,i,s){return g([ge.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(et)}};yt.url="/close-api/views/process-wizard";let ye=yt;class tn{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class nn{static invite(e,t,r){return g("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Fe{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return g(Fe.url+e,{method:"POST",body:JSON.stringify(t)})}}class rn{static getConfiguration(){return g("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const on={class:"widget-table__head"},sn={class:"widget-table__head-label margin_0 text_overflow"},an=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",on,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",sn,o.toDisplayString(r.label),1)]))),128))]))}});const M=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},cn=M(an,[["__scopeId","data-v-25198f4a"]]);function mt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=mt(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Me(n){return["eservices-core",n].join(":")}function vt(n){return We(n,"YYYY/MM/DD HH:mm:ss")}function We(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Rt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ln={props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},ce=M(ln,[["__scopeId","data-v-e287c8d9"]]),un=Ve(Me("setup-list-row"));function dn(n,e){const t=n.config.map(r=>fn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function fn(n,e,t){const r=e.values;let i=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(h){s.onClick.push(()=>h(r))}function c(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const l=[],d=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(c(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=We(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=vt(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{d.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),u(tt.bind(null,t,!0));break}case"select":{d.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),u(tt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const h=n.link(r);if(h){const _=o.h(Ot.RouterLink,{to:h});d.push(_),c("widget-table-cell_link")}}catch(h){un("Can't add router link",h)}if(n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&d.push(o.h(ce,{name:n.icon})),typeof n.icon=="function")){const h=n.icon(r);h!==null&&d.push(o.h(ce,{name:h}))}return n.class&&(typeof n.class=="function"?c(n.class(r)):c(n.class)),l.push(o.h("td",s,d)),l}function tt(n,e){n.emit("select",e)}function wt(n,e){return()=>{try{return dn(n,e)}catch(t){return console.warn(t),null}}}const pn={props:{values:Object,config:Object,selected:Boolean},setup:wt},hn=["colspan"],nt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,hn)],512))}}),b={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},gn={class:"widget-table"},rt="update:selectedRows",yn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,l=!0){if(!t.selectedRows)return;if(!l)return e(rt,t.selectedRows.includes(c)?[]:[c]);const d=[...t.selectedRows],h=d.indexOf(c);return h===-1?d.push(c):d.splice(h,1),e(rt,d)}function u(c){e("save",c),e("update:activeRow",null)}return(c,l)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",gn,[o.createVNode(cn,{config:c.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:h},[o.createVNode(pn,{config:c.config,values:d,selected:c.selectedRows.includes(d),onSelect:_=>s(d,_),class:o.normalizeClass(c.classCallback?c.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===d?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,values:d,onClose:l[0]||(l[0]=_=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(b).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,onClose:l[1]||(l[1]=d=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),mn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=M(mn,[["__scopeId","data-v-0ef9ae88"]]),En={class:"widget-button"},vn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",En,[e.wait?(o.openBlock(),o.createBlock(Ae,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const wn=M(vn,[["__scopeId","data-v-450dc564"]]),_n={class:"widget-multi-button-wrap position_relative cursor_pointer"},Tn={class:"widget-multi-button-body grid"},Cn=["onClick"],Sn={class:"widget-multi-button-side-wrap"},bn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function s(u=!t.active){t.active=u}return(u,c)=>(o.openBlock(),o.createElementBlock("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Tn,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=l=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(l,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:h=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,Cn))),128))]),o.createElementVNode("div",Sn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=l=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const kn=M(bn,[["__scopeId","data-v-a8d711d1"]]),An={class:"widget-loader flex flex-align_center gap_10 padding_15"},Nn={class:"text_md"},In=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",An,[o.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Nn,o.toDisplayString(e.label),1)]))}}),On=["alt","src"],Rn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,On))}}),Ln={props:{config:Array,values:Object,selected:Boolean},setup:wt};const $n=M(Ln,[["__scopeId","data-v-344a8cc1"]]),Pn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Dn={class:"widget-list-head-cell"},xn=Pn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Bn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Dn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(I.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ce),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),xn])]))}});const Vn=M(Bn,[["__scopeId","data-v-bf495d6a"]]),Un=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function l(E,w){let f=-1;do f++,w-=E[f];while(w>0&&f<E.length);return f}function d(E,w){let f=0;for(;w>0&&w>E[f]&&f<E.length;)w-=E[f],f++;return console.log(w,f),f>0?f:0}function h(E){try{i.value.style.insetInlineStart=E+"px"}catch(w){console.log(w)}}function _(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(w){console.log(w)}}function O(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(w){var Ke;function f(A){return A.screenX+p-S}const m=r.value,a=[...m.children].filter(A=>A.localName==="th"),p=((Ke=m.offsetParent)==null?void 0:Ke.scrollLeft)||0,y=a.map(A=>A.clientWidth),$=O(w.target),S=m.getBoundingClientRect().left,J=f(w),T=l(y,J),W=y.slice(0,T).reduce((A,P)=>A+P,0),Z=J-W,Oe=m.offsetWidth,ee=a[T].clientWidth;if(t.config[T].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",w.screenX),console.log("Widths",y),console.log("max width",Oe),console.log("Start Position",J),console.log("Position From",T),console.log("Start Position",T),console.log("Global offset (Отступ самой таблицы от края экрана)",S),console.log("Del",Z),console.groupEnd(),i.value.innerText=a[T].textContent||"",i.value.style.display="grid",i.value.style.width=ee+"px",i.value.style.cursor="grabbing",h(W),_(ee),document.addEventListener("pointermove",ze,{passive:!0}),document.addEventListener("pointerup",Ge);function Ge(A){if(console.group("END"),document.removeEventListener("pointermove",ze),document.removeEventListener("pointerup",Ge),$&&(t.config[T].width=i.value.style.width,t.config[T].minWidth=i.value.style.width,t.config[T].maxWidth=i.value.style.width,s(t.config)),!$){const P=A.screenX+p-S;console.log("ENP Position",P);const de=d(y,P);if(console.log(T,"->",de),de!==T){const te=t.config[T],Re=t.config;Re.splice(T,1),Re.splice(de,0,te),s(Re)}else{const te=t.config[T].name;u(te)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ze(A){if($){const te=f(A)-J+ee;_(te);return}let P=A.screenX+p-S-Z;P<0&&(P=0),P+ee>Oe&&(P=Oe-ee),h(P)}})});function s(l){e("update:config",l)}function u(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(t.order.length===0||t.order[0]!==l)return void c([l]);const d=t.order.length===1||t.order[1]==="asc"?"asc":"desc";c([l,d==="asc"?"desc":"asc"])}function c(l){e("update:order",l)}return(l,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.config,(h,_)=>(o.openBlock(),o.createBlock(Vn,o.mergeProps({key:h},h,{onOrder:O=>u(h.name),onSelect:d[0]||(d[0]=O=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Fn=M(Un,[["__scopeId","data-v-ccffc6bd"]]),Mn={class:"widget-list"},Wn={class:"widget-list-body position_relative"},jn=50,qn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(c,l=!0){if(t.selectedRows)if(!l)s(t.selectedRows.includes(c)?[]:[c]);else{const d=[...t.selectedRows],h=d.indexOf(c);h===-1?d.push(c):d==null||d.splice(h,1),s(d)}}function i(){var c;if(((c=t.selectedRows)==null?void 0:c.length)!==t.array.length)return s([...t.array]);s([])}function s(c){e("update:selectedRows",c)}function u(c){if(!c)return;const l=c.target;l.scrollTop+l.clientHeight+jn>l.scrollHeight&&e("scrollEnd")}return(c,l)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Mn,[o.createElementVNode("thead",null,[o.createVNode(Fn,{onSelect:l[0]||(l[0]=d=>i()),"onUpdate:order":l[1]||(l[1]=d=>e("update:order",d)),"onUpdate:config":l[2]||(l[2]=d=>e("update:config",d)),config:c.config,order:c.order},null,8,["config","order"])]),o.createElementVNode("tbody",Wn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(d,h)=>{var _;return o.openBlock(),o.createBlock($n,{key:h,class:"widget-list-row",values:d,config:c.config,selected:(_=c.selectedRows)==null?void 0:_.includes(d),onSelect:O=>r(d,O)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Gn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function _e(n){return typeof n=="string"?Pe(n):zn(n)?Pe(n.message):Pe(b.DEFAULT_ERROR_MESSAGE)}function zn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Pe(n){return{message:n}}function U(n="error"){return function(e){const{message:t}=_e(e);Ce.add(n,t)}}function Te(n,e={}){return k().emit("entity:read",{...e,entity:n})}function je(n,e){return k().emit("entity:update",{...e,entity:n})}function Kn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function qe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=qe(r)),e[i]=r,e},{})}function Yn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Jn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Hn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return b.DEFAULT_ERROR_MESSAGE}})}function Tt(n,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(b.DEFAULT_ERROR_MESSAGE)}).then(t=>Hn(t).then(r=>{if(!t.ok)throw r;return r}))}function Xn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Qn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Zn=Ve(Me("pretty-value-field-by-entity"));function er(n,e,t){try{const r=xe.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Zn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}const tr=1,nr=5e3,j=Ve(Me("use-socket"));function k(){return ir}function rr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const ir=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},nr*2);const a=new Uint8Array(1);a[0]=tr,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{m(a)&&(j("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?l({requestId:a.requestId,event:"request-error",data:{message:x.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},b.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(a){const p=[...r.values()];j("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(y=>{const $=a.requestId;(y.requestId&&y.requestId===$||!y.requestId&&y.event===a.event)&&(j("Find appropriated handler: %d, event: %s",n,y.event),y.callback(a.data,a),y.once&&(r.delete(y),j("Handler was removed by *once* params was passed. %o",y)))})}function d(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(a){j("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{h(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(rr(a.data)){u();return}const y=JSON.parse(a.data);if(!Ct(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(p=y==null?void 0:y.data)!=null&&p.refresh&&location.reload(),l(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function h(a){e.send(a)}function _(a,p){f({event:a,callback:p})}function O(a,p){f({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function w(a,p,y){const $=++n,S=JSON.stringify({requestId:$,event:a,data:p,contextId:R.contextId,url:window.location.href});return E()?h(S):(s.add(S),j("Socket is not connected. Message was send to save-queue")),new Promise((J,T)=>{f({event:a,requestId:$,once:!0,guaranteedAnswer:!0,serializeString:S,callback:(W,Z)=>{if(j("Promise was resolve with next data:",W),or(Z))return void T(W);y&&y(W,Z),J(W)},timeToLive:b.TIME_TO_LIVE_SOCKET_REQUEST})})}function f(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function m(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:_,once:O,emit:w,initialization(a){t=a},getDevInfo:c}}(),or=n=>!!Ct(n)&&n.event==="request-error",Ct=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function sr(n,e){return k().emit("list-setting:read",{entity:n,mark:e})}function ar(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function St(n,e){return k().emit("entity:create",{...e,entity:n})}function bt(n,e){return k().emit("entity:delete",{...e,entity:n})}function cr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function lr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const f=E();return i.value=!0,typeof f.limit!="number"&&(f.limit=100),f.offset=r,Te(n,f).then(m=>(r+=m.length,m)).finally(()=>{i.value=!1})}function u(f,m){var p;return typeof f.Version=="number"?f.Version:(p=t.find(y=>y.Id===m))==null?void 0:p.Version}function c(f,m){const a=t.findIndex(p=>p.Id===f);if(a===-1)throw new Error(`Can't found item with Id ${f}`);t.splice(a,1,m)}function l(f){const m=t.findIndex(a=>a.Id===f);if(m===-1)throw new Error(`Can't found item with Id ${f}`);t.splice(m,1)}async function d(f,m){try{const a=E(),p=u(m,f);delete m.Version,await je(n,{id:f,values:m,version:p});const y=await Te(n,{fields:a.fields||"",id:f});c(f,y)}catch(a){U()(a)}}async function h(f,m){try{const a=E(),p=u(m,f);delete m.Version,await bt(n,{id:f,version:p}),l(f)}catch(a){U()(a)}}async function _(f){try{await St(n,{values:f}),await w()}catch(m){U()(m)}}async function O(){try{const f=await s();t.push(...f)}catch(f){U()(f)}}function E(){return typeof e=="function"?e():e}async function w(){try{r=0;const f=await s();t.splice(0,t.length,...f)}catch(f){U()(f)}}return{array:t,updateById:d,next:O,reload:w,wait:i,create:_,deleteById:h}}function ur(){function n(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=o.reactive(n());return R.onupdateContext(()=>{Object.assign(e,n())}),e}function dr(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function pr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function hr(n){return k().emit("communication-message:read",{communicationId:n})}function gr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>hr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function yr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return Te(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(U())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw U()(i),i})};function t(){return typeof e=="function"?e():e}}function mr(n,e){return k().emit("metadata:read",{...e,entity:n})}class le{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[le.getKey(e,t)]=r}get(e,t={}){return this.state[le.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return mr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:Er(t.masterEntities)};return JSON.stringify(r)}}function Er(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:vr(n)?[n]:n}function vr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function wr(n,e={}){if(!n)return o.inject(b.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?xe.getByKey(t.value):null);o.provide(b.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=le.getKey(n,it(e||{}))}const s=function(){return i(),xe.update(n,it(e||{}))};return i(),{state:r,update:s}}function it(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=_r(r),s=new Tr(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function _r(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const kt=class At{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=At.cardId++}};kt.cardId=1;let Tr=kt;class Cr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return pr(this.id,e)}static checkAndGenerate(e,t,r){return fr(e,t,r).then(i=>i.length===0?dr(e,t,r):i[0])}}function Sr(){return k().emit("client:read",{})}var Nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},br=(n,e,t)=>(Nt(n,e,"read from private field"),t?t.call(n):e.get(n)),kr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ar=(n,e,t,r)=>(Nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),me;const Ne=class H extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],kr(this,me,!1)}set language(e){localStorage.setItem(b.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(b.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ar(this,me,e),this.emit(H.EVENT_READY_UPDATE,e)}get ready(){return br(this,me)}onReady(e){return this.on(H.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(H.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(H.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){U()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Sr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};me=new WeakMap;Ne.DEFAULT_LANGUAGE="en";Ne.EVENT_CONTEXT_UPDATE="event:context-update";Ne.EVENT_READY_UPDATE="event:ready-update";let Nr=Ne;function Ir(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function L(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Ir(r)){let i=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(L.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}L.includes=function(e,t){return`@${e} Contains ${ue(t)}`};L.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`};L.notEq=function(e,t){return`@${e} nq ${ue(t)}`};L.eq=function(e,t){return Array.isArray(t)?L.in(e,t):`@${e} eq ${ue(t)}`};L.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`};L.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")};L.is=function(e,t){return`@${e} is ${t}`};L.or=function(...e){return e.join(" or ")};const R=new Nr,xe=new le;class Or{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return De(i,r),Tt([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Rr(n,e="images"){return`/static-folder/${e}/${n}`}class Lr{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return g(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):x.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return g(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return g(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var It=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(It(n,e,"read from private field"),t?t.call(n):e.get(n)),q=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},G=(n,e,t,r)=>(It(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,ie,ve,we,oe,se,Be;const z="_______LIST_______ROW_______INDEX________NAME_______",Ie=class V extends D{constructor(e){super(),this.LIST_ROW_KEY=1,q(this,Ee,void 0),this.array=[],q(this,ie,[]),q(this,ve,[]),q(this,we,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(V.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(V.EVENT_FILTERS_UPDATE,t),!0)})),q(this,oe,!1),q(this,se,(...t)=>Promise),q(this,Be,()=>{}),G(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,ie,e.config)}set config(e){G(this,ie,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,ve)}set order(e){G(this,ve,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,we)}set filters(e){Pr(B(this,we),e)}set wait(e){G(this,oe,e),this.emit(I.Form.EVENT_WAIT,B(this,oe))}get wait(){return B(this,oe)}get primaryKeys(){return B(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[z]===e)}indexByKey(e){return this.array.findIndex(t=>t[z]===e)}static getKey(e){return e[z]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,z)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(V.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(V.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(V.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[z]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,z)}set read(e){G(this,se,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,se).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){G(this,se,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,Be).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[z]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=V.getCellName(e),i=(()=>{let s=r?Se(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};Ee=new WeakMap;ie=new WeakMap;ve=new WeakMap;we=new WeakMap;oe=new WeakMap;se=new WeakMap;Be=new WeakMap;Ie.EVENT_DATA="list-data: update";Ie.EVENT_CONFIG_UPDATE="list-config:update";Ie.EVENT_ORDER_UPDATE="list-order:update";Ie.EVENT_FILTERS_UPDATE="list-filters:update";function $r(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Pr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Dr(n){const e=o.reactive([]);function t(c){return e.includes(c)}function r(c){t(c)||e.push(c)}function i(c){const l=e.findIndex(d=>d===c);l!==-1&&e.splice(l,1)}function s(c){const l=o.unref(n);if(c===void 0){e.length===0?l.forEach(r):l.forEach(i);return}t(c)?i(c):r(c)}const u=o.computed(()=>{const c=o.unref(n);return e.length===c.length&&c.length!==0});return[e,s,u,r,i]}function xr(n){return n.statusName==="Completed"}function Br(n){return n.statusName==="FinalStepWithConfirmation"}function Vr(n){return n.statusName==="ValidationError"}function Ur(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const c=o.ref(null);function l(){c.value=s.find(a=>a.name===u)||null}function d(){var a;return u?((a=s.find(p=>p.name===u))==null?void 0:a.fields)||[]:[]}function h(a){if(l(),Vr(a))return void t.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!d().length||Fr(d(),t.presets)))return m(t.presets||{});xr(a)&&t.onCompleted(a),Br(a)&&t.onConfirmation(a)}async function _(){try{await O(),await f()}catch(a){const{message:p}=_e(a);Ce.add("error",p)}}function O(){return i.wait="Loading process information.",ye.getStartConfig(e,n).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((y,$)=>($.properties.forEach(S=>{y.push({name:S.name,label:S.title,type:S.refEntityName||S.dataType})}),y),[])}))}).then(a=>(i.wait=!1,a))}function E(a){return u=a.nextStepName,r=a.token,a}function w(a){const p=_e(a);Ce.add("error",p.message)}function f(){return i.wait="Starting process",ye.startProcess(e,n).then(E).then(h).catch(w).finally(()=>{i.wait=null})}function m(a={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ye.runStep(e,n,u,r,a).then(E).then(h).catch(w).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:o.readonly(c),next:m}}function Fr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Mr="close-api/proxy/Equipment/Search";class Wr{static search(e,t,r,i,s){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),s&&(u.append("limit",String(s.limit)),u.append("offset",String(s.offset)));const c=`/${Mr}?${u.toString()}`;return g(c,{method:"GET",headers:{"Content-Type":"application/json"}})}}const jr={clickOutside:be,staticLink:Rr},qr={usage:Dt,utils:qt,config:Gt,types:zt};exports.Communication=Cr;exports.CoreError=x;exports.Filter=L;exports.Manager=R;exports.NotificationSystem=Ce;exports.WidgetButton=wn;exports.WidgetIcon=ce;exports.WidgetImage=Rn;exports.WidgetList=qn;exports.WidgetLoader=In;exports.WidgetMultiButton=kn;exports.WidgetSpinner=Ae;exports.WidgetTable=yn;exports.actionService=Or;exports.asyncProcess=Gn;exports.authService=C;exports.billingService=X;exports.catchUniversal=U;exports.clickOutside=be;exports.clientService=ct;exports.communicationService=en;exports.constants=b;exports.dataService=ae;exports.debounce=Xn;exports.default=qr;exports.documentsService=Lr;exports.equipmentService=Wr;exports.fileService=tn;exports.getCellName=mt;exports.getCellValue=Et;exports.getNamesFromListConfig=Kn;exports.groupArrayByField=Yn;exports.historyService=Kt;exports.internationalizationService=Yt;exports.invitationService=nn;exports.openService=rn;exports.parseError=_e;exports.prettyDate=We;exports.prettyDateWithTime=vt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=er;exports.processWizardService=ye;exports.request=Tt;exports.ruleValidationService=Fe;exports.t=Q;exports.throttle=Qn;exports.universalEntityCreate=St;exports.universalEntityDelete=bt;exports.universalEntityRead=Te;exports.universalEntityUpdate=je;exports.universalListSettingRead=sr;exports.universalMetadataFieldTreat=ar;exports.useCommunication=gr;exports.useFormEntity=yr;exports.useListActiveRow=cr;exports.useListEntity=lr;exports.useListSearch=$r;exports.useListSelect=Dr;exports.useLogger=Ht;exports.useManagerState=ur;exports.useMetadata=wr;exports.useSocket=k;exports.useWizard=Ur;exports.utils=jr;exports.uuidv4=Jn;exports.valuesToUpperCase=qe;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{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-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{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-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]: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}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { reactive as W, defineComponent as L, openBlock as y, createElementBlock as v, Fragment as oe, renderList as Ee, createElementVNode as S, toDisplayString as ye, h as R, ref as G, onMounted as Qe, createBlock as M, resolveDynamicComponent as Gt, mergeProps as wt, useSlots as Bt, computed as _e, createVNode as Re, normalizeClass as Le, createCommentVNode as se, unref as z, normalizeStyle as Et, renderSlot as Kt, useCssVars as zt, withCtx as _t, createTextVNode as vt, withModifiers as Yt, pushScopeId as Jt, popScopeId as Ht, inject as Xt, provide as Qt, readonly as Zt } from "vue";
2
+ import { reactive as j, defineComponent as L, openBlock as y, createElementBlock as v, Fragment as oe, renderList as Ee, createElementVNode as S, toDisplayString as ye, h as R, ref as G, onMounted as Qe, createBlock as M, resolveDynamicComponent as Gt, mergeProps as wt, useSlots as Bt, computed as _e, createVNode as Re, normalizeClass as Le, createCommentVNode as se, unref as z, normalizeStyle as Et, renderSlot as Kt, useCssVars as zt, withCtx as _t, createTextVNode as vt, withModifiers as Yt, pushScopeId as Jt, popScopeId as Ht, inject as Xt, provide as Qt, readonly as Zt } from "vue";
3
3
  import { utils as te, FormField as Be, Form as Tt } from "jenesius-vue-form";
4
4
  import { RouterLink as en } from "vue-router";
5
5
  import Ze from "debug";
6
6
  import tn from "date-and-time";
7
7
  /*!
8
- * eservices-core v1.3.62
8
+ * eservices-core v1.3.63
9
9
  * (c) 2023 ESERVICES
10
10
  */
11
11
  function nn(n, e) {
@@ -158,7 +158,7 @@ class cn {
158
158
  }
159
159
  const ln = new class {
160
160
  constructor() {
161
- this.store = W([]);
161
+ this.store = j([]);
162
162
  }
163
163
  /**
164
164
  * @description Метод используется для добавления новых уведомлений. Принимает два обязательных поля type и message,
@@ -1290,7 +1290,7 @@ const Pn = {
1290
1290
  }, null, 4));
1291
1291
  }
1292
1292
  });
1293
- const rt = /* @__PURE__ */ Y(Un, [["__scopeId", "data-v-0ef9ae88"]]), Mn = { class: "widget-button" }, jn = /* @__PURE__ */ L({
1293
+ const rt = /* @__PURE__ */ Y(Un, [["__scopeId", "data-v-0ef9ae88"]]), Mn = { class: "widget-button" }, Wn = /* @__PURE__ */ L({
1294
1294
  __name: "widget-button",
1295
1295
  props: {
1296
1296
  wait: { type: Boolean }
@@ -1305,7 +1305,7 @@ const rt = /* @__PURE__ */ Y(Un, [["__scopeId", "data-v-0ef9ae88"]]), Mn = { cla
1305
1305
  ]));
1306
1306
  }
1307
1307
  });
1308
- const ei = /* @__PURE__ */ Y(jn, [["__scopeId", "data-v-450dc564"]]), Wn = { class: "widget-multi-button-wrap position_relative cursor_pointer" }, Vn = { class: "widget-multi-button-body grid" }, Fn = ["onClick"], qn = { class: "widget-multi-button-side-wrap" }, Gn = /* @__PURE__ */ L({
1308
+ const ei = /* @__PURE__ */ Y(Wn, [["__scopeId", "data-v-450dc564"]]), jn = { class: "widget-multi-button-wrap position_relative cursor_pointer" }, Vn = { class: "widget-multi-button-body grid" }, Fn = ["onClick"], qn = { class: "widget-multi-button-side-wrap" }, Gn = /* @__PURE__ */ L({
1309
1309
  __name: "widget-multi-button",
1310
1310
  props: {
1311
1311
  label: {},
@@ -1316,7 +1316,7 @@ const ei = /* @__PURE__ */ Y(jn, [["__scopeId", "data-v-450dc564"]]), Wn = { cla
1316
1316
  zt((l) => ({
1317
1317
  "7025434e": r.value
1318
1318
  }));
1319
- const t = W({
1319
+ const t = j({
1320
1320
  active: !1,
1321
1321
  wait: !1
1322
1322
  }), r = _e(() => e.array.length + (e.label ? 1 : 0));
@@ -1329,7 +1329,7 @@ const ei = /* @__PURE__ */ Y(jn, [["__scopeId", "data-v-450dc564"]]), Wn = { cla
1329
1329
  function o(l = !t.active) {
1330
1330
  t.active = l;
1331
1331
  }
1332
- return (l, a) => (y(), v("div", Wn, [
1332
+ return (l, a) => (y(), v("div", jn, [
1333
1333
  S("div", {
1334
1334
  class: Le(["overflow_hidden radius_20 widget-multi-button grid", t.active ? "widget-multi-button_active" : null])
1335
1335
  }, [
@@ -1502,18 +1502,18 @@ const er = /* @__PURE__ */ Y(Zn, [["__scopeId", "data-v-bf495d6a"]]), tr = /* @_
1502
1502
  function d(N) {
1503
1503
  return N.screenX + f - b;
1504
1504
  }
1505
- const m = r.value, s = [...m.children].filter((N) => N.localName === "th"), f = ((st = m.offsetParent) == null ? void 0 : st.scrollLeft) || 0, g = s.map((N) => N.clientWidth), P = $(_.target), b = m.getBoundingClientRect().left, re = d(_), C = c(g, re), J = g.slice(0, C).reduce((N, x) => N + x, 0), ae = re - J, je = m.offsetWidth, ce = s[C].clientWidth;
1505
+ const m = r.value, s = [...m.children].filter((N) => N.localName === "th"), f = ((st = m.offsetParent) == null ? void 0 : st.scrollLeft) || 0, g = s.map((N) => N.clientWidth), P = $(_.target), b = m.getBoundingClientRect().left, re = d(_), C = c(g, re), J = g.slice(0, C).reduce((N, x) => N + x, 0), ae = re - J, We = m.offsetWidth, ce = s[C].clientWidth;
1506
1506
  if (t.config[C].type === "multi-select")
1507
1507
  return;
1508
- console.group("START"), console.log(), console.log("Start screenX", _.screenX), console.log("Widths", g), console.log("max width", je), console.log("Start Position", re), console.log("Position From", C), console.log("Start Position", C), console.log("Global offset (Отступ самой таблицы от края экрана)", b), console.log("Del", ae), console.groupEnd(), i.value.innerText = s[C].textContent || "", i.value.style.display = "grid", i.value.style.width = ce + "px", i.value.style.cursor = "grabbing", p(J), T(ce), document.addEventListener("pointermove", ot, { passive: !0 }), document.addEventListener("pointerup", it);
1508
+ console.group("START"), console.log(), console.log("Start screenX", _.screenX), console.log("Widths", g), console.log("max width", We), console.log("Start Position", re), console.log("Position From", C), console.log("Start Position", C), console.log("Global offset (Отступ самой таблицы от края экрана)", b), console.log("Del", ae), console.groupEnd(), i.value.innerText = s[C].textContent || "", i.value.style.display = "grid", i.value.style.width = ce + "px", i.value.style.cursor = "grabbing", p(J), T(ce), document.addEventListener("pointermove", ot, { passive: !0 }), document.addEventListener("pointerup", it);
1509
1509
  function it(N) {
1510
1510
  if (console.group("END"), document.removeEventListener("pointermove", ot), document.removeEventListener("pointerup", it), P && (t.config[C].width = i.value.style.width, t.config[C].minWidth = i.value.style.width, t.config[C].maxWidth = i.value.style.width, o(t.config)), !P) {
1511
1511
  const x = N.screenX + f - b;
1512
1512
  console.log("ENP Position", x);
1513
1513
  const Te = u(g, x);
1514
1514
  if (console.log(C, "->", Te), Te !== C) {
1515
- const le = t.config[C], We = t.config;
1516
- We.splice(C, 1), We.splice(Te, 0, le), o(We);
1515
+ const le = t.config[C], je = t.config;
1516
+ je.splice(C, 1), je.splice(Te, 0, le), o(je);
1517
1517
  } else {
1518
1518
  const le = t.config[C].name;
1519
1519
  l(le);
@@ -1528,7 +1528,7 @@ const er = /* @__PURE__ */ Y(Zn, [["__scopeId", "data-v-bf495d6a"]]), tr = /* @_
1528
1528
  return;
1529
1529
  }
1530
1530
  let x = N.screenX + f - b - ae;
1531
- x < 0 && (x = 0), x + ce > je && (x = je - ce), p(x);
1531
+ x < 0 && (x = 0), x + ce > We && (x = We - ce), p(x);
1532
1532
  }
1533
1533
  });
1534
1534
  });
@@ -1641,7 +1641,7 @@ function oi(n) {
1641
1641
  t.wait = !1;
1642
1642
  }));
1643
1643
  }
1644
- const t = W({
1644
+ const t = j({
1645
1645
  wait: !1,
1646
1646
  call: e
1647
1647
  });
@@ -1825,7 +1825,7 @@ const hr = function() {
1825
1825
  return;
1826
1826
  }
1827
1827
  const g = JSON.parse(s.data);
1828
- if (!jt(g)) {
1828
+ if (!Wt(g)) {
1829
1829
  console.warn("Data is %cnot correct %csocket answer.", "color: red", "color: black"), console.log(g);
1830
1830
  return;
1831
1831
  }
@@ -1894,7 +1894,7 @@ const hr = function() {
1894
1894
  },
1895
1895
  getDevInfo: a
1896
1896
  };
1897
- }(), gr = (n) => !!jt(n) && n.event === "request-error", jt = (n) => typeof n == "object" && n !== null && "event" in n && typeof n.event == "string" && "requestId" in n && typeof n.requestId == "number" && "data" in n;
1897
+ }(), gr = (n) => !!Wt(n) && n.event === "request-error", Wt = (n) => typeof n == "object" && n !== null && "event" in n && typeof n.event == "string" && "requestId" in n && typeof n.requestId == "number" && "data" in n;
1898
1898
  function fi(n, e) {
1899
1899
  return k().emit("list-setting:read", {
1900
1900
  entity: n,
@@ -1930,7 +1930,7 @@ function hi() {
1930
1930
  };
1931
1931
  }
1932
1932
  function gi(n, e) {
1933
- const t = W([]);
1933
+ const t = j([]);
1934
1934
  let r = 0;
1935
1935
  const i = G(!1);
1936
1936
  function o() {
@@ -1943,12 +1943,7 @@ function gi(n, e) {
1943
1943
  }
1944
1944
  function l(d, m) {
1945
1945
  var f;
1946
- if (typeof d.Version == "number")
1947
- return d.Version;
1948
- const s = (f = t.find((g) => g.Id === m)) == null ? void 0 : f.Version;
1949
- if (s === void 0)
1950
- throw new Error("Object without version.");
1951
- return s;
1946
+ return typeof d.Version == "number" ? d.Version : (f = t.find((g) => g.Id === m)) == null ? void 0 : f.Version;
1952
1947
  }
1953
1948
  function a(d, m) {
1954
1949
  const s = t.findIndex((f) => f.Id === d);
@@ -2031,7 +2026,7 @@ function yi() {
2031
2026
  userId: D.userId
2032
2027
  };
2033
2028
  }
2034
- const e = W(n());
2029
+ const e = j(n());
2035
2030
  return D.onupdateContext(() => {
2036
2031
  Object.assign(e, n());
2037
2032
  }), e;
@@ -2049,7 +2044,7 @@ function vr(n) {
2049
2044
  return k().emit("communication-message:read", { communicationId: n });
2050
2045
  }
2051
2046
  function mi(n) {
2052
- const e = Tt.getParentForm(), t = W([]);
2047
+ const e = Tt.getParentForm(), t = j([]);
2053
2048
  return e && e.subscribe(n), n.read = () => vr(n.id).then((r) => (t.splice(0, t.length, ...r), r)), {
2054
2049
  array: t
2055
2050
  };
@@ -2090,7 +2085,7 @@ function Tr(n, e) {
2090
2085
  }
2091
2086
  class we {
2092
2087
  constructor() {
2093
- this.state = W({});
2088
+ this.state = j({});
2094
2089
  }
2095
2090
  /**
2096
2091
  * @description Устанавливает значение метаданных в хранилище. Используется только внутри самого хранилища, т.к.
@@ -2155,7 +2150,7 @@ function mt(n) {
2155
2150
  }
2156
2151
  const Je = new class {
2157
2152
  constructor() {
2158
- this.store = W([]);
2153
+ this.store = j([]);
2159
2154
  }
2160
2155
  /**
2161
2156
  * @description Метод используется для добавления новых уведомлений.
@@ -2193,13 +2188,13 @@ function br(n) {
2193
2188
  children: n.children || t.children
2194
2189
  } : t;
2195
2190
  }
2196
- const Wt = class Vt {
2191
+ const jt = class Vt {
2197
2192
  constructor(e, t, r, i, o) {
2198
2193
  this.type = e, this.message = t, this.timeout = r, this.children = i, this.click = o, this.id = Vt.cardId++;
2199
2194
  }
2200
2195
  };
2201
- Wt.cardId = 1;
2202
- let Ar = Wt;
2196
+ jt.cardId = 1;
2197
+ let Ar = jt;
2203
2198
  class vi extends U {
2204
2199
  constructor(e) {
2205
2200
  super(), this.name = "Communication", this.read = () => {
@@ -2328,7 +2323,7 @@ let $r = Ue;
2328
2323
  function Rr(n) {
2329
2324
  return typeof n != "object" || n === null ? !1 : !!(n.hasOwnProperty("start") || n.hasOwnProperty("end"));
2330
2325
  }
2331
- function j(n) {
2326
+ function W(n) {
2332
2327
  return Object.keys(n).reduce((e, t) => {
2333
2328
  const r = n[t];
2334
2329
  if (Array.isArray(r)) {
@@ -2342,35 +2337,35 @@ function j(n) {
2342
2337
  };
2343
2338
  return r.start && e.push(`@${t} ge ${i(r.start)}`), r.end && e.push(`@${t} le ${i(r.end)}`), e;
2344
2339
  }
2345
- return typeof r == "number" ? (e.push(`@${t} eq ${r}`), e) : typeof r == "string" ? (r.length !== 0 && e.push(`@${t} eq '${r}'`), e) : (r === null && e.push(j.is(t, r)), e);
2340
+ return typeof r == "number" ? (e.push(`@${t} eq ${r}`), e) : typeof r == "string" ? (r.length !== 0 && e.push(`@${t} eq '${r}'`), e) : (r === null && e.push(W.is(t, r)), e);
2346
2341
  }, []).join(" and ");
2347
2342
  }
2348
2343
  function ve(n) {
2349
2344
  return typeof n == "string" ? `'${n}'` : `${n}`;
2350
2345
  }
2351
- j.includes = function(e, t) {
2346
+ W.includes = function(e, t) {
2352
2347
  return `@${e} Contains ${ve(t)}`;
2353
2348
  };
2354
- j.beginWith = function(e, t) {
2349
+ W.beginWith = function(e, t) {
2355
2350
  return `@${e} BeginWith ${ve(t)}`;
2356
2351
  };
2357
- j.notEq = function(e, t) {
2352
+ W.notEq = function(e, t) {
2358
2353
  return `@${e} nq ${ve(t)}`;
2359
2354
  };
2360
- j.eq = function(e, t) {
2361
- return Array.isArray(t) ? j.in(e, t) : `@${e} eq ${ve(t)}`;
2355
+ W.eq = function(e, t) {
2356
+ return Array.isArray(t) ? W.in(e, t) : `@${e} eq ${ve(t)}`;
2362
2357
  };
2363
- j.in = function(e, t) {
2358
+ W.in = function(e, t) {
2364
2359
  const r = t.map(ve).join(", ");
2365
2360
  return `@${e} in (${r})`;
2366
2361
  };
2367
- j.and = function(...e) {
2362
+ W.and = function(...e) {
2368
2363
  return e.filter((t) => typeof t != "string" || t.trim().length === 0 ? !1 : t).map((t) => `(${t})`).join(" and ");
2369
2364
  };
2370
- j.is = function(e, t) {
2365
+ W.is = function(e, t) {
2371
2366
  return `@${e} is ${t}`;
2372
2367
  };
2373
- j.or = function(...e) {
2368
+ W.or = function(...e) {
2374
2369
  return e.join(" or ");
2375
2370
  };
2376
2371
  const D = new $r(), He = new we();
@@ -2684,7 +2679,7 @@ function Pr(n, e) {
2684
2679
  });
2685
2680
  }
2686
2681
  function bi(n) {
2687
- const e = W([]);
2682
+ const e = j([]);
2688
2683
  function t(a) {
2689
2684
  return e.includes(a);
2690
2685
  }
@@ -2720,7 +2715,7 @@ function Ur(n) {
2720
2715
  }
2721
2716
  function Ai(n, e, t) {
2722
2717
  let r = null;
2723
- const i = W({
2718
+ const i = j({
2724
2719
  wait: null
2725
2720
  });
2726
2721
  let o = [], l = null;
@@ -2795,12 +2790,12 @@ function Mr(n, e) {
2795
2790
  }
2796
2791
  return !0;
2797
2792
  }
2798
- const jr = "close-api/proxy/Equipment/Search";
2793
+ const Wr = "close-api/proxy/Equipment/Search";
2799
2794
  class Ni {
2800
2795
  static search(e, t, r, i, o) {
2801
2796
  const l = new URLSearchParams();
2802
2797
  l.append("pattern", e || ""), t && l.append("categoryId", t), r && l.append("useType", String(r)), i && l.append("statusCode", i), o && (l.append("limit", String(o.limit)), l.append("offset", String(o.offset)));
2803
- const a = `/${jr}?${l.toString()}`;
2798
+ const a = `/${Wr}?${l.toString()}`;
2804
2799
  return h(a, {
2805
2800
  method: "GET",
2806
2801
  headers: {
@@ -2821,7 +2816,7 @@ const Ii = {
2821
2816
  export {
2822
2817
  vi as Communication,
2823
2818
  q as CoreError,
2824
- j as Filter,
2819
+ W as Filter,
2825
2820
  D as Manager,
2826
2821
  Je as NotificationSystem,
2827
2822
  ei as WidgetButton,
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{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-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{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-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]: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}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("debug"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","debug","date-and-time"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l["eservices-core"]={},l.Vue,l.JenesiusVueForm,l.VueRouter,l.Debug,l.DateAndTime))})(this,function(l,o,I,Rt,Re,$t){"use strict";/*!
3
- * eservices-core v1.3.62
3
+ * eservices-core v1.3.63
4
4
  * (c) 2023 ESERVICES
5
5
  */function Lt(n,e){return!!n&&n===e||"password is not equal"}function ze(n){return Number(n.replace(/[^0-9.]/g,""))}function Pt(n,e=null){let r=String(ze(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Dt={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:ze,prettyNumeric:Pt,validPassword:Lt},Symbol.toStringTag,{value:"Module"}))};function fe(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?fe(n[r],e.substr(t+1)):void 0}return n[e]}function pe(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ke(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const Ye=class _ extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=_.ID++}static ParentFormNotFound(){return new _("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new _("Composite object name is undefined",e)}static EntityWithoutName(e){return new _("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new _(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new _("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new _("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new _(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return _.ApiNotAvailable()}static ApiError(e){return new _("Request error",e)}static ApiNotAvailable(){return new _(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?_.ApiNotAvailable():new _(e||"Authorization Error",t)}static ApiResponseParseFailed(){return _.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new _("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new _(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new _("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new _("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new _(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new _(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new _(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new _(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new _("The request took too long to complete. Try again later.")}};Ye.ID=0;let P=Ye;const Bt="Please try again later or submit a feedback if problem doesn't go.";class Je{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const Ut=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const d=new Vt(e,t,i,r||[],s);return this.store.push(d),i&&setTimeout(this.remove.bind(this,d.id),i*1e3),d}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},He=class vt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=vt.cardId++}};He.cardId=1;let Vt=He;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Xe=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Qe=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Ze=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},et=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Xe.call(this,e,t)}emit(e,t){return Qe.call(this,e,t)}off(e,t){return Ze.call(this,e,t)}cleanEvents(){et.call(this)}static on(e,t){return Xe.call(D,e,t)}static emit(e,t){return Qe.call(D,e,t)}static off(e,t){return Ze.call(D,e,t)}static cleanEvents(){et.call(D)}}D.events={};var tt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},he=(n,e,t)=>(tt(n,e,"read from private field"),t?t.call(n):e.get(n)),$e=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Le=(n,e,t,r)=>(tt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ee,ge,ye;const j=class O extends D{constructor(){super(...arguments),$e(this,ee,void 0),$e(this,ge,"front"),this.organizations=[],$e(this,ye,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Le(this,ee,e)}get router(){if(!he(this,ee))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return he(this,ee)}set type(e){Le(this,ge,e)}get type(){return he(this,ge)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Le(this,ye,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return he(this,ye)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Ut.add("error",P.ApiNotAvailable().message)}}loadCustomerData(){return Je.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};ee=new WeakMap,ge=new WeakMap,ye=new WeakMap,j.DEFAULT_LANGUAGE="en",j.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",j.EVENT_CONTEXT_UPDATE="event:context-update",j.EVENT_READY_UPDATE="event:ready-update",j.EVENT_DATA_UPDATE="event:data-update",j.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=j;const nt=new Mt;function Wt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Bt}})}function y(n,e={}){return nt.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=nt.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw P.ApiNotAvailable()}).then(t=>Wt(t).then(r=>{if(!t.ok)throw r;return r}))}class me{constructor(){}static parseNamesFromListConfig(e){let t=me.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let d in i)typeof i[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(i[d])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),d=i.substring(s+1),c=i.substring(0,s);c in r||(r[c]={}),t(r[c],d)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ft{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const rt=new Ft;function it(n){return n&&n[0].toLowerCase()+n.slice(1)}function Pe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Pe(r)),e[i]=r,e},{})}function qt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:me,Journal:rt,Request:y,clickOutside:pe,default:{Request:y,clickOutside:pe,getPropFromObject:fe,runPromiseQueue:Ke,GraphQL:me,firstChapterToLowerCase:it,valuesToUpperCase:Pe,prettyMoney:qt},firstChapterToLowerCase:it,getPropFromObject:fe,runPromiseQueue:Ke,valuesToUpperCase:Pe},Symbol.toStringTag,{value:"Module"}));function ot(n,e=""){for(let t in n){if(typeof n[t]=="object"){ot(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const F={};function Gt(n){for(let e in n)F[e]=n[e];n.styles&&ot(n.styles),rt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=F}const xt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),xr="";class zt{static readHistoryById(e,t){return y(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const d=s.changes.map(c=>({...c,oldValue:c.originalValue,name:c.fieldName}));return{...s,changes:d}});return{...r,history:i}})}}class Kt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let G={};function H(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,n);if(typeof t=="string")return st(t,e);const r=I.utils.getPropFromObject(G==null?void 0:G.root,n);return typeof r=="string"?st(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function st(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}H.setGlobalVocabulary=function(n){G=n},H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:I.utils.getPropFromObject(G,e.toLowerCase())})},H.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(G,n)),H.bind({vocabulary:n})};const Yt=function(){let n=!1;const e=[];function t(){return n}function r(u,f){t()&&console[u](...f),e.push(f)}function i(...u){r("log",u)}function s(...u){r("warn",u)}function d(...u){r("error",u)}function c(u=!0){n=u}return{info:i,warn:s,history:e,display:c,error:d}}();function Jt(){return Yt}class k{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw P.AuthServiceError(e.title,t)}static login(e){return y(F.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:F.applicationName})}).catch(k.parseError)}static registration(e){return e.AppName=F.applicationName,y(F.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(k.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw P.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return k.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError)}static startLoginProcess(e){return k.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return k.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return k.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError).then(k.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw P.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Ht(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Xt="masterId",Qt="masterEntity";function De(n,e){if(!Array.isArray(e))return;if(Ht(e))return t(e);e.forEach(t);function t(r){n.append(Qt,r[0]),n.append(Xt,r[1].toString())}}class te{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const d=(Array.isArray(i)?[i]:Object.entries(i)).map(([c,u="desc"])=>`@${c} ${u}`).join(",");t("order",d)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=te.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=te.getSearchParamsForEntityListRead(t||{});return y(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return De(i,r==null?void 0:r.masterEntities),y(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return y(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return y(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return De(s,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return te.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return y(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const at=class de{static async create(e){return y(de.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return y(de.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${de.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${de.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};at.url="/close-api/communications";let Zt=at;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Oe{static async getStartConfig(e,t){return y([Oe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Oe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,s){return y([Oe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(ct)}};lt.url="/close-api/views/process-wizard";let Ee=lt;class en{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class tn{static invite(e,t,r){return y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Be{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Be.url+e,{method:"POST",body:JSON.stringify(t)})}}class nn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const rn={class:"widget-table__head"},on={class:"widget-table__head-label margin_0 text_overflow"},sn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",rn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",on,o.toDisplayString(r.label),1)]))),128))]))}}),zr="",q=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},an=q(sn,[["__scopeId","data-v-25198f4a"]]);function ut(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function dt(n,e){const t=ut(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ue(n){return["eservices-core",n].join(":")}function ft(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return $t.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const Kr="",ne=q({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),cn=Re(Ue("setup-list-row"));function ln(n,e){const t=n.config.map(r=>un(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function un(n,e,t){const r=e.values;let i=dt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(g){s.onClick.push(()=>g(r))}function c(g){Array.isArray(g)?s.class.push(...g):s.class.push(g)}const u=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(c(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ve(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const g=n.link(r);if(g){const C=o.h(Rt.RouterLink,{to:g});f.push(C),c("widget-table-cell_link")}}catch(g){cn("Can't add router link",g)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(ne,{name:n.icon})),typeof n.icon=="function")){const g=n.icon(r);g!==null&&f.push(o.h(ne,{name:g}))}return n.class&&(typeof n.class=="function"?c(n.class(r)):c(n.class)),u.push(o.h("td",s,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return ln(n,e)}catch(t){return console.warn(t),null}}}const dn={props:{values:Object,config:Object,selected:Boolean},setup:ht},fn=["colspan"],gt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,fn)],512))}}),b={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},pn={class:"widget-table"},yt="update:selectedRows",hn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(c)?[]:[c]);const f=[...t.selectedRows],g=f.indexOf(c);return g===-1?f.push(c):f.splice(g,1),e(yt,f)}function d(c){e("save",c),e("update:activeRow",null)}return(c,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",pn,[o.createVNode(an,{config:c.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(dn,{config:c.config,values:f,selected:c.selectedRows.includes(f),onSelect:C=>s(f,C),class:o.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":c.config.length,values:f,onClose:u[0]||(u[0]=C=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(b).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":c.config.length,onClose:u[1]||(u[1]=f=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),gn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Jr="",we=q(gn,[["__scopeId","data-v-0ef9ae88"]]),yn={class:"widget-button"},mn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",yn,[e.wait?(o.openBlock(),o.createBlock(we,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Hr="",En=q(mn,[["__scopeId","data-v-450dc564"]]),wn={class:"widget-multi-button-wrap position_relative cursor_pointer"},_n={class:"widget-multi-button-body grid"},Tn=["onClick"],Cn={class:"widget-multi-button-side-wrap"},Sn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function s(d=!t.active){t.active=d}return(d,c)=>(o.openBlock(),o.createElementBlock("div",wn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",_n,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=u=>s())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(u,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:g=>{i(u.callback),s(!1)}},o.toDisplayString(u.label),9,Tn))),128))]),o.createElementVNode("div",Cn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=u=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(we),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(ne),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Xr="",kn=q(Sn,[["__scopeId","data-v-a8d711d1"]]),bn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},Nn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",bn,[o.createVNode(we,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),In=["alt","src"],vn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,In))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:ht},Qr="",Rn=q(On,[["__scopeId","data-v-344a8cc1"]]),$n=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Ln={class:"widget-list-head-cell"},Pn=$n(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Dn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Ln,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(I.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ne),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Pn])]))}}),Zr="",Bn=q(Dn,[["__scopeId","data-v-bf495d6a"]]),Un=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function u(w,T){let p=-1;do p++,T-=w[p];while(T>0&&p<w.length);return p}function f(w,T){let p=0;for(;T>0&&T>w[p]&&p<w.length;)T-=w[p],p++;return console.log(T,p),p>0?p:0}function g(w){try{i.value.style.insetInlineStart=w+"px"}catch(T){console.log(T)}}function C(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(T){console.log(T)}}function L(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(T){var It;function p(v){return v.screenX+h-N}const E=r.value,a=[...E.children].filter(v=>v.localName==="th"),h=((It=E.offsetParent)==null?void 0:It.scrollLeft)||0,m=a.map(v=>v.clientWidth),B=L(T.target),N=E.getBoundingClientRect().left,Q=p(T),S=u(m,Q),J=m.slice(0,S).reduce((v,U)=>v+U,0),ce=Q-J,Ge=E.offsetWidth,le=a[S].clientWidth;if(t.config[S].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",m),console.log("max width",Ge),console.log("Start Position",Q),console.log("Position From",S),console.log("Start Position",S),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",ce),console.groupEnd(),i.value.innerText=a[S].textContent||"",i.value.style.display="grid",i.value.style.width=le+"px",i.value.style.cursor="grabbing",g(J),C(le),document.addEventListener("pointermove",Nt,{passive:!0}),document.addEventListener("pointerup",At);function At(v){if(console.group("END"),document.removeEventListener("pointermove",Nt),document.removeEventListener("pointerup",At),B&&(t.config[S].width=i.value.style.width,t.config[S].minWidth=i.value.style.width,t.config[S].maxWidth=i.value.style.width,s(t.config)),!B){const U=v.screenX+h-N;console.log("ENP Position",U);const ve=f(m,U);if(console.log(S,"->",ve),ve!==S){const ue=t.config[S],xe=t.config;xe.splice(S,1),xe.splice(ve,0,ue),s(xe)}else{const ue=t.config[S].name;d(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Nt(v){if(B){const ue=p(v)-Q+le;C(ue);return}let U=v.screenX+h-N-ce;U<0&&(U=0),U+le>Ge&&(U=Ge-le),g(U)}})});function s(u){e("update:config",u)}function d(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 c([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";c([u,f==="asc"?"desc":"asc"])}function c(u){e("update:order",u)}return(u,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.config,(g,C)=>(o.openBlock(),o.createBlock(Bn,o.mergeProps({key:g},g,{onOrder:L=>d(g.name),onSelect:f[0]||(f[0]=L=>e("select")),order:u.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),ei="",Vn=q(Un,[["__scopeId","data-v-ccffc6bd"]]),Mn={class:"widget-list"},Wn={class:"widget-list-body position_relative"},Fn=50,qn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(c,u=!0){if(t.selectedRows)if(!u)s(t.selectedRows.includes(c)?[]:[c]);else{const f=[...t.selectedRows],g=f.indexOf(c);g===-1?f.push(c):f==null||f.splice(g,1),s(f)}}function i(){var c;if(((c=t.selectedRows)==null?void 0:c.length)!==t.array.length)return s([...t.array]);s([])}function s(c){e("update:selectedRows",c)}function d(c){if(!c)return;const u=c.target;u.scrollTop+u.clientHeight+Fn>u.scrollHeight&&e("scrollEnd")}return(c,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Mn,[o.createElementVNode("thead",null,[o.createVNode(Vn,{onSelect:u[0]||(u[0]=f=>i()),"onUpdate:order":u[1]||(u[1]=f=>e("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>e("update:config",f)),config:c.config,order:c.order},null,8,["config","order"])]),o.createElementVNode("tbody",Wn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,g)=>{var C;return o.openBlock(),o.createBlock(Rn,{key:g,class:"widget-list-row",values:f,config:c.config,selected:(C=c.selectedRows)==null?void 0:C.includes(f),onSelect:L=>r(f,L)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function jn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function _e(n){return typeof n=="string"?Me(n):Gn(n)?Me(n.message):Me(b.DEFAULT_ERROR_MESSAGE)}function Gn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Me(n){return{message:n}}function V(n="error"){return function(e){const{message:t}=_e(e);Ce.add(n,t)}}function Te(n,e={}){return A().emit("entity:read",{...e,entity:n})}function We(n,e){return A().emit("entity:update",{...e,entity:n})}function xn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function Fe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Fe(r)),e[i]=r,e},{})}function zn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Kn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Yn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return b.DEFAULT_ERROR_MESSAGE}})}function Et(n,e={}){return $.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=$.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(b.DEFAULT_ERROR_MESSAGE)}).then(t=>Yn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Hn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Xn=Re(Ue("pretty-value-field-by-entity"));function Qn(n,e,t){try{const r=qe.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Xn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}const Zn=1,er=5e3,x=Re(Ue("use-socket"));function A(){return nr}function tr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const nr=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},er*2);const a=new Uint8Array(1);a[0]=Zn,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{E(a)&&(x("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?u({requestId:a.requestId,event:"request-error",data:{message:P.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},b.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function u(a){const h=[...r.values()];x("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),h.forEach(m=>{const B=a.requestId;(m.requestId&&m.requestId===B||!m.requestId&&m.event===a.event)&&(x("Find appropriated handler: %d, event: %s",n,m.event),m.callback(a.data,a),m.once&&(r.delete(m),x("Handler was removed by *once* params was passed. %o",m)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(a){x("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&s.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{g(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var h;try{if(tr(a.data)){d();return}const m=JSON.parse(a.data);if(!wt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}(h=m==null?void 0:m.data)!=null&&h.refresh&&location.reload(),u(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function g(a){e.send(a)}function C(a,h){p({event:a,callback:h})}function L(a,h){p({event:a,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function T(a,h,m){const B=++n,N=JSON.stringify({requestId:B,event:a,data:h,contextId:$.contextId,url:window.location.href});return w()?g(N):(s.add(N),x("Socket is not connected. Message was send to save-queue")),new Promise((Q,S)=>{p({event:a,requestId:B,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(J,ce)=>{if(x("Promise was resolve with next data:",J),rr(ce))return void S(J);m&&m(J,ce),Q(J)},timeToLive:b.TIME_TO_LIVE_SOCKET_REQUEST})})}function p(a){const h={timeToLive:0,...a,created:new Date().getTime()};r.add(h)}function E(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:L,emit:T,initialization(a){t=a},getDevInfo:c}}(),rr=n=>!!wt(n)&&n.event==="request-error",wt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ir(n,e){return A().emit("list-setting:read",{entity:n,mark:e})}function or(n,e){return A().emit("metadata-field:treat",{entity:n,fieldName:e})}function _t(n,e){return A().emit("entity:create",{...e,entity:n})}function Tt(n,e){return A().emit("entity:delete",{...e,entity:n})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function ar(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const p=w();return i.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=r,Te(n,p).then(E=>(r+=E.length,E)).finally(()=>{i.value=!1})}function d(p,E){var h;if(typeof p.Version=="number")return p.Version;const a=(h=t.find(m=>m.Id===E))==null?void 0:h.Version;if(a===void 0)throw new Error("Object without version.");return a}function c(p,E){const a=t.findIndex(h=>h.Id===p);if(a===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(a,1,E)}function u(p){const E=t.findIndex(a=>a.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(E,1)}async function f(p,E){try{const a=w(),h=d(E,p);delete E.Version,await We(n,{id:p,values:E,version:h});const m=await Te(n,{fields:a.fields||"",id:p});c(p,m)}catch(a){V()(a)}}async function g(p,E){try{const a=w(),h=d(E,p);delete E.Version,await Tt(n,{id:p,version:h}),u(p)}catch(a){V()(a)}}async function C(p){try{await _t(n,{values:p}),await T()}catch(E){V()(E)}}async function L(){try{const p=await s();t.push(...p)}catch(p){V()(p)}}function w(){return typeof e=="function"?e():e}async function T(){try{r=0;const p=await s();t.splice(0,t.length,...p)}catch(p){V()(p)}}return{array:t,updateById:f,next:L,reload:T,wait:i,create:C,deleteById:g}}function cr(){function n(){return{organizations:$.organizations,currentContextId:$.contextId,person:$.person,context:$.context,contextType:$.contextType,userId:$.userId}}const e=o.reactive(n());return $.onupdateContext(()=>{Object.assign(e,n())}),e}function lr(n,e,t){return A().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ur(n,e,t){return A().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function dr(n,e){return A().emit("communication-message:create",{communicationId:n,text:e})}function fr(n){return A().emit("communication-message:read",{communicationId:n})}function pr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>fr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function hr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw P.EntityWithoutName(n);return Te(n.name,r)}).then(Fe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(V())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw P.EntityWithoutName(n);return We(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw V()(i),i})};function t(){return typeof e=="function"?e():e}}function gr(n,e){return A().emit("metadata:read",{...e,entity:n})}class re{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[re.getKey(e,t)]=r}get(e,t={}){return this.state[re.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return gr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:yr(t.masterEntities)};return JSON.stringify(r)}}function yr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:mr(n)?[n]:n}function mr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function Er(n,e={}){if(!n)return o.inject(b.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?qe.getByKey(t.value):null);o.provide(b.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=re.getKey(n,Ct(e||{}))}const s=function(){return i(),qe.update(n,Ct(e||{}))};return i(),{state:r,update:s}}function Ct(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=wr(r),s=new _r(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function wr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const St=class Ot{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Ot.cardId++}};St.cardId=1;let _r=St;class Tr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return dr(this.id,e)}static checkAndGenerate(e,t,r){return ur(e,t,r).then(i=>i.length===0?lr(e,t,r):i[0])}}function Cr(){return A().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Sr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),kr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},br=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Se;const ke=class Z extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],kr(this,Se,!1)}set language(e){localStorage.setItem(b.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(b.LOCALSTORAGE_LANGUAGE_KEY)||Z.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){br(this,Se,e),this.emit(Z.EVENT_READY_UPDATE,e)}get ready(){return Sr(this,Se)}onReady(e){return this.on(Z.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(Z.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(Z.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){V()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Cr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Se=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let Ar=ke;function Nr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function R(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Nr(r)){let i=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(R.is(t,r)),e)},[]).join(" and ")}function ie(n){return typeof n=="string"?`'${n}'`:`${n}`}R.includes=function(e,t){return`@${e} Contains ${ie(t)}`},R.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},R.notEq=function(e,t){return`@${e} nq ${ie(t)}`},R.eq=function(e,t){return Array.isArray(t)?R.in(e,t):`@${e} eq ${ie(t)}`},R.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},R.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},R.is=function(e,t){return`@${e} is ${t}`},R.or=function(...e){return e.join(" or ")};const $=new Ar,qe=new re;class Ir{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return De(i,r),Et([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function vr(n,e="images"){return`/static-folder/${e}/${n}`}class Or{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):P.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return y(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},M=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},K=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,oe,Ae,Ne,se,ae,je;const Y="_______LIST_______ROW_______INDEX________NAME_______",Ie=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,be,void 0),this.array=[],z(this,oe,[]),z(this,Ae,[]),z(this,Ne,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),z(this,se,!1),z(this,ae,(...t)=>Promise),z(this,je,()=>{}),K(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&K(this,oe,e.config)}set config(e){K(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return M(this,oe)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return M(this,Ae)}set order(e){K(this,Ae,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return M(this,Ne)}set filters(e){$r(M(this,Ne),e)}set wait(e){K(this,se,e),this.emit(I.Form.EVENT_WAIT,M(this,se))}get wait(){return M(this,se)}get primaryKeys(){return M(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){K(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=M(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){K(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>M(this,je).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[Y]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=W.getCellName(e),i=(()=>{let s=r?fe(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};be=new WeakMap,oe=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,se=new WeakMap,ae=new WeakMap,je=new WeakMap,Ie.EVENT_DATA="list-data: update",Ie.EVENT_CONFIG_UPDATE="list-config:update",Ie.EVENT_ORDER_UPDATE="list-order:update",Ie.EVENT_FILTERS_UPDATE="list-filters:update";function Rr(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function $r(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Lr(n){const e=o.reactive([]);function t(c){return e.includes(c)}function r(c){t(c)||e.push(c)}function i(c){const u=e.findIndex(f=>f===c);u!==-1&&e.splice(u,1)}function s(c){const u=o.unref(n);if(c===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(c)?i(c):r(c)}const d=o.computed(()=>{const c=o.unref(n);return e.length===c.length&&c.length!==0});return[e,s,d,r,i]}function Pr(n){return n.statusName==="Completed"}function Dr(n){return n.statusName==="FinalStepWithConfirmation"}function Br(n){return n.statusName==="ValidationError"}function Ur(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const c=o.ref(null);function u(){c.value=s.find(a=>a.name===d)||null}function f(){var a;return d?((a=s.find(h=>h.name===d))==null?void 0:a.fields)||[]:[]}function g(a){if(u(),Br(a))return void t.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Vr(f(),t.presets)))return E(t.presets||{});Pr(a)&&t.onCompleted(a),Dr(a)&&t.onConfirmation(a)}async function C(){try{await L(),await p()}catch(a){const{message:h}=_e(a);Ce.add("error",h)}}function L(){return i.wait="Loading process information.",Ee.getStartConfig(e,n).then(a=>{s=a.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((m,B)=>(B.properties.forEach(N=>{m.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),m),[])}))}).then(a=>(i.wait=!1,a))}function w(a){return d=a.nextStepName,r=a.token,a}function T(a){const h=_e(a);Ce.add("error",h.message)}function p(){return i.wait="Starting process",Ee.startProcess(e,n).then(w).then(g).catch(T).finally(()=>{i.wait=null})}function E(a={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Expect the result",Ee.runStep(e,n,d,r,a).then(w).then(g).catch(T).finally(()=>{i.wait=!1}))}return{initialize:C,state:i,currentStepConfig:o.readonly(c),next:E}}function Vr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Mr="close-api/proxy/Equipment/Search";class Wr{static search(e,t,r,i,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const c=`/${Mr}?${d.toString()}`;return y(c,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Fr={clickOutside:pe,staticLink:vr},qr={usage:Dt,utils:jt,config:Gt,types:xt};l.Communication=Tr,l.CoreError=P,l.Filter=R,l.Manager=$,l.NotificationSystem=Ce,l.WidgetButton=En,l.WidgetIcon=ne,l.WidgetImage=vn,l.WidgetList=qn,l.WidgetLoader=Nn,l.WidgetMultiButton=kn,l.WidgetSpinner=we,l.WidgetTable=hn,l.actionService=Ir,l.asyncProcess=jn,l.authService=k,l.billingService=X,l.catchUniversal=V,l.clickOutside=pe,l.clientService=Je,l.communicationService=Zt,l.constants=b,l.dataService=te,l.debounce=Jn,l.default=qr,l.documentsService=Or,l.equipmentService=Wr,l.fileService=en,l.getCellName=ut,l.getCellValue=dt,l.getNamesFromListConfig=xn,l.groupArrayByField=zn,l.historyService=zt,l.internationalizationService=Kt,l.invitationService=tn,l.openService=nn,l.parseError=_e,l.prettyDate=Ve,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Qn,l.processWizardService=Ee,l.request=Et,l.ruleValidationService=Be,l.t=H,l.throttle=Hn,l.universalEntityCreate=_t,l.universalEntityDelete=Tt,l.universalEntityRead=Te,l.universalEntityUpdate=We,l.universalListSettingRead=ir,l.universalMetadataFieldTreat=or,l.useCommunication=pr,l.useFormEntity=hr,l.useListActiveRow=sr,l.useListEntity=ar,l.useListSearch=Rr,l.useListSelect=Lr,l.useLogger=Jt,l.useManagerState=cr,l.useMetadata=Er,l.useSocket=A,l.useWizard=Ur,l.utils=Fr,l.uuidv4=Kn,l.valuesToUpperCase=Fe,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */const Xe=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Qe=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Ze=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},et=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Xe.call(this,e,t)}emit(e,t){return Qe.call(this,e,t)}off(e,t){return Ze.call(this,e,t)}cleanEvents(){et.call(this)}static on(e,t){return Xe.call(D,e,t)}static emit(e,t){return Qe.call(D,e,t)}static off(e,t){return Ze.call(D,e,t)}static cleanEvents(){et.call(D)}}D.events={};var tt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},he=(n,e,t)=>(tt(n,e,"read from private field"),t?t.call(n):e.get(n)),$e=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Le=(n,e,t,r)=>(tt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ee,ge,ye;const j=class O extends D{constructor(){super(...arguments),$e(this,ee,void 0),$e(this,ge,"front"),this.organizations=[],$e(this,ye,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Le(this,ee,e)}get router(){if(!he(this,ee))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return he(this,ee)}set type(e){Le(this,ge,e)}get type(){return he(this,ge)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Le(this,ye,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return he(this,ye)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Ut.add("error",P.ApiNotAvailable().message)}}loadCustomerData(){return Je.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};ee=new WeakMap,ge=new WeakMap,ye=new WeakMap,j.DEFAULT_LANGUAGE="en",j.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",j.EVENT_CONTEXT_UPDATE="event:context-update",j.EVENT_READY_UPDATE="event:ready-update",j.EVENT_DATA_UPDATE="event:data-update",j.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=j;const nt=new Mt;function Wt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Bt}})}function y(n,e={}){return nt.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=nt.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw P.ApiNotAvailable()}).then(t=>Wt(t).then(r=>{if(!t.ok)throw r;return r}))}class me{constructor(){}static parseNamesFromListConfig(e){let t=me.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let d in i)typeof i[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(i[d])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),d=i.substring(s+1),c=i.substring(0,s);c in r||(r[c]={}),t(r[c],d)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ft{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const rt=new Ft;function it(n){return n&&n[0].toLowerCase()+n.slice(1)}function Pe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Pe(r)),e[i]=r,e},{})}function qt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:me,Journal:rt,Request:y,clickOutside:pe,default:{Request:y,clickOutside:pe,getPropFromObject:fe,runPromiseQueue:Ke,GraphQL:me,firstChapterToLowerCase:it,valuesToUpperCase:Pe,prettyMoney:qt},firstChapterToLowerCase:it,getPropFromObject:fe,runPromiseQueue:Ke,valuesToUpperCase:Pe},Symbol.toStringTag,{value:"Module"}));function ot(n,e=""){for(let t in n){if(typeof n[t]=="object"){ot(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const F={};function Gt(n){for(let e in n)F[e]=n[e];n.styles&&ot(n.styles),rt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=F}const xt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),xr="";class zt{static readHistoryById(e,t){return y(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const d=s.changes.map(c=>({...c,oldValue:c.originalValue,name:c.fieldName}));return{...s,changes:d}});return{...r,history:i}})}}class Kt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let G={};function H(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,n);if(typeof t=="string")return st(t,e);const r=I.utils.getPropFromObject(G==null?void 0:G.root,n);return typeof r=="string"?st(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function st(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}H.setGlobalVocabulary=function(n){G=n},H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:I.utils.getPropFromObject(G,e.toLowerCase())})},H.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(G,n)),H.bind({vocabulary:n})};const Yt=function(){let n=!1;const e=[];function t(){return n}function r(u,f){t()&&console[u](...f),e.push(f)}function i(...u){r("log",u)}function s(...u){r("warn",u)}function d(...u){r("error",u)}function c(u=!0){n=u}return{info:i,warn:s,history:e,display:c,error:d}}();function Jt(){return Yt}class k{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw P.AuthServiceError(e.title,t)}static login(e){return y(F.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:F.applicationName})}).catch(k.parseError)}static registration(e){return e.AppName=F.applicationName,y(F.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(k.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw P.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return k.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError)}static startLoginProcess(e){return k.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return k.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return k.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError).then(k.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw P.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Ht(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Xt="masterId",Qt="masterEntity";function De(n,e){if(!Array.isArray(e))return;if(Ht(e))return t(e);e.forEach(t);function t(r){n.append(Qt,r[0]),n.append(Xt,r[1].toString())}}class te{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const d=(Array.isArray(i)?[i]:Object.entries(i)).map(([c,u="desc"])=>`@${c} ${u}`).join(",");t("order",d)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=te.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=te.getSearchParamsForEntityListRead(t||{});return y(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return De(i,r==null?void 0:r.masterEntities),y(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return y(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return y(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return De(s,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return te.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return y(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const at=class de{static async create(e){return y(de.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return y(de.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${de.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${de.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};at.url="/close-api/communications";let Zt=at;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Oe{static async getStartConfig(e,t){return y([Oe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Oe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,s){return y([Oe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(ct)}};lt.url="/close-api/views/process-wizard";let Ee=lt;class en{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class tn{static invite(e,t,r){return y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Be{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Be.url+e,{method:"POST",body:JSON.stringify(t)})}}class nn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const rn={class:"widget-table__head"},on={class:"widget-table__head-label margin_0 text_overflow"},sn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",rn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",on,o.toDisplayString(r.label),1)]))),128))]))}}),zr="",q=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},an=q(sn,[["__scopeId","data-v-25198f4a"]]);function ut(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function dt(n,e){const t=ut(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ue(n){return["eservices-core",n].join(":")}function ft(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return $t.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const Kr="",ne=q({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),cn=Re(Ue("setup-list-row"));function ln(n,e){const t=n.config.map(r=>un(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function un(n,e,t){const r=e.values;let i=dt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(g){s.onClick.push(()=>g(r))}function c(g){Array.isArray(g)?s.class.push(...g):s.class.push(g)}const u=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(c(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ve(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const g=n.link(r);if(g){const C=o.h(Rt.RouterLink,{to:g});f.push(C),c("widget-table-cell_link")}}catch(g){cn("Can't add router link",g)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(ne,{name:n.icon})),typeof n.icon=="function")){const g=n.icon(r);g!==null&&f.push(o.h(ne,{name:g}))}return n.class&&(typeof n.class=="function"?c(n.class(r)):c(n.class)),u.push(o.h("td",s,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return ln(n,e)}catch(t){return console.warn(t),null}}}const dn={props:{values:Object,config:Object,selected:Boolean},setup:ht},fn=["colspan"],gt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,fn)],512))}}),b={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},pn={class:"widget-table"},yt="update:selectedRows",hn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(c)?[]:[c]);const f=[...t.selectedRows],g=f.indexOf(c);return g===-1?f.push(c):f.splice(g,1),e(yt,f)}function d(c){e("save",c),e("update:activeRow",null)}return(c,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",pn,[o.createVNode(an,{config:c.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(dn,{config:c.config,values:f,selected:c.selectedRows.includes(f),onSelect:C=>s(f,C),class:o.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":c.config.length,values:f,onClose:u[0]||(u[0]=C=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(b).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":c.config.length,onClose:u[1]||(u[1]=f=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),gn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Jr="",we=q(gn,[["__scopeId","data-v-0ef9ae88"]]),yn={class:"widget-button"},mn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",yn,[e.wait?(o.openBlock(),o.createBlock(we,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Hr="",En=q(mn,[["__scopeId","data-v-450dc564"]]),wn={class:"widget-multi-button-wrap position_relative cursor_pointer"},_n={class:"widget-multi-button-body grid"},Tn=["onClick"],Cn={class:"widget-multi-button-side-wrap"},Sn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function s(d=!t.active){t.active=d}return(d,c)=>(o.openBlock(),o.createElementBlock("div",wn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",_n,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=u=>s())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(u,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:g=>{i(u.callback),s(!1)}},o.toDisplayString(u.label),9,Tn))),128))]),o.createElementVNode("div",Cn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=u=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(we),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(ne),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Xr="",kn=q(Sn,[["__scopeId","data-v-a8d711d1"]]),bn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},Nn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",bn,[o.createVNode(we,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),In=["alt","src"],vn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,In))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:ht},Qr="",Rn=q(On,[["__scopeId","data-v-344a8cc1"]]),$n=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Ln={class:"widget-list-head-cell"},Pn=$n(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Dn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Ln,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(I.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ne),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Pn])]))}}),Zr="",Bn=q(Dn,[["__scopeId","data-v-bf495d6a"]]),Un=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function u(w,T){let p=-1;do p++,T-=w[p];while(T>0&&p<w.length);return p}function f(w,T){let p=0;for(;T>0&&T>w[p]&&p<w.length;)T-=w[p],p++;return console.log(T,p),p>0?p:0}function g(w){try{i.value.style.insetInlineStart=w+"px"}catch(T){console.log(T)}}function C(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(T){console.log(T)}}function L(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(T){var It;function p(v){return v.screenX+h-N}const E=r.value,a=[...E.children].filter(v=>v.localName==="th"),h=((It=E.offsetParent)==null?void 0:It.scrollLeft)||0,m=a.map(v=>v.clientWidth),B=L(T.target),N=E.getBoundingClientRect().left,Q=p(T),S=u(m,Q),J=m.slice(0,S).reduce((v,U)=>v+U,0),ce=Q-J,Ge=E.offsetWidth,le=a[S].clientWidth;if(t.config[S].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",m),console.log("max width",Ge),console.log("Start Position",Q),console.log("Position From",S),console.log("Start Position",S),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",ce),console.groupEnd(),i.value.innerText=a[S].textContent||"",i.value.style.display="grid",i.value.style.width=le+"px",i.value.style.cursor="grabbing",g(J),C(le),document.addEventListener("pointermove",Nt,{passive:!0}),document.addEventListener("pointerup",At);function At(v){if(console.group("END"),document.removeEventListener("pointermove",Nt),document.removeEventListener("pointerup",At),B&&(t.config[S].width=i.value.style.width,t.config[S].minWidth=i.value.style.width,t.config[S].maxWidth=i.value.style.width,s(t.config)),!B){const U=v.screenX+h-N;console.log("ENP Position",U);const ve=f(m,U);if(console.log(S,"->",ve),ve!==S){const ue=t.config[S],xe=t.config;xe.splice(S,1),xe.splice(ve,0,ue),s(xe)}else{const ue=t.config[S].name;d(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Nt(v){if(B){const ue=p(v)-Q+le;C(ue);return}let U=v.screenX+h-N-ce;U<0&&(U=0),U+le>Ge&&(U=Ge-le),g(U)}})});function s(u){e("update:config",u)}function d(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 c([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";c([u,f==="asc"?"desc":"asc"])}function c(u){e("update:order",u)}return(u,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.config,(g,C)=>(o.openBlock(),o.createBlock(Bn,o.mergeProps({key:g},g,{onOrder:L=>d(g.name),onSelect:f[0]||(f[0]=L=>e("select")),order:u.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),ei="",Vn=q(Un,[["__scopeId","data-v-ccffc6bd"]]),Mn={class:"widget-list"},Wn={class:"widget-list-body position_relative"},Fn=50,qn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(c,u=!0){if(t.selectedRows)if(!u)s(t.selectedRows.includes(c)?[]:[c]);else{const f=[...t.selectedRows],g=f.indexOf(c);g===-1?f.push(c):f==null||f.splice(g,1),s(f)}}function i(){var c;if(((c=t.selectedRows)==null?void 0:c.length)!==t.array.length)return s([...t.array]);s([])}function s(c){e("update:selectedRows",c)}function d(c){if(!c)return;const u=c.target;u.scrollTop+u.clientHeight+Fn>u.scrollHeight&&e("scrollEnd")}return(c,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Mn,[o.createElementVNode("thead",null,[o.createVNode(Vn,{onSelect:u[0]||(u[0]=f=>i()),"onUpdate:order":u[1]||(u[1]=f=>e("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>e("update:config",f)),config:c.config,order:c.order},null,8,["config","order"])]),o.createElementVNode("tbody",Wn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,g)=>{var C;return o.openBlock(),o.createBlock(Rn,{key:g,class:"widget-list-row",values:f,config:c.config,selected:(C=c.selectedRows)==null?void 0:C.includes(f),onSelect:L=>r(f,L)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function jn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function _e(n){return typeof n=="string"?Me(n):Gn(n)?Me(n.message):Me(b.DEFAULT_ERROR_MESSAGE)}function Gn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Me(n){return{message:n}}function V(n="error"){return function(e){const{message:t}=_e(e);Ce.add(n,t)}}function Te(n,e={}){return A().emit("entity:read",{...e,entity:n})}function We(n,e){return A().emit("entity:update",{...e,entity:n})}function xn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function Fe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Fe(r)),e[i]=r,e},{})}function zn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Kn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Yn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return b.DEFAULT_ERROR_MESSAGE}})}function Et(n,e={}){return $.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=$.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(b.DEFAULT_ERROR_MESSAGE)}).then(t=>Yn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Hn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Xn=Re(Ue("pretty-value-field-by-entity"));function Qn(n,e,t){try{const r=qe.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Xn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}const Zn=1,er=5e3,x=Re(Ue("use-socket"));function A(){return nr}function tr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const nr=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},er*2);const a=new Uint8Array(1);a[0]=Zn,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{E(a)&&(x("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?u({requestId:a.requestId,event:"request-error",data:{message:P.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},b.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function u(a){const h=[...r.values()];x("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),h.forEach(m=>{const B=a.requestId;(m.requestId&&m.requestId===B||!m.requestId&&m.event===a.event)&&(x("Find appropriated handler: %d, event: %s",n,m.event),m.callback(a.data,a),m.once&&(r.delete(m),x("Handler was removed by *once* params was passed. %o",m)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(a){x("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&s.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{g(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var h;try{if(tr(a.data)){d();return}const m=JSON.parse(a.data);if(!wt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}(h=m==null?void 0:m.data)!=null&&h.refresh&&location.reload(),u(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function g(a){e.send(a)}function C(a,h){p({event:a,callback:h})}function L(a,h){p({event:a,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function T(a,h,m){const B=++n,N=JSON.stringify({requestId:B,event:a,data:h,contextId:$.contextId,url:window.location.href});return w()?g(N):(s.add(N),x("Socket is not connected. Message was send to save-queue")),new Promise((Q,S)=>{p({event:a,requestId:B,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(J,ce)=>{if(x("Promise was resolve with next data:",J),rr(ce))return void S(J);m&&m(J,ce),Q(J)},timeToLive:b.TIME_TO_LIVE_SOCKET_REQUEST})})}function p(a){const h={timeToLive:0,...a,created:new Date().getTime()};r.add(h)}function E(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:L,emit:T,initialization(a){t=a},getDevInfo:c}}(),rr=n=>!!wt(n)&&n.event==="request-error",wt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ir(n,e){return A().emit("list-setting:read",{entity:n,mark:e})}function or(n,e){return A().emit("metadata-field:treat",{entity:n,fieldName:e})}function _t(n,e){return A().emit("entity:create",{...e,entity:n})}function Tt(n,e){return A().emit("entity:delete",{...e,entity:n})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function ar(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const p=w();return i.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=r,Te(n,p).then(E=>(r+=E.length,E)).finally(()=>{i.value=!1})}function d(p,E){var h;return typeof p.Version=="number"?p.Version:(h=t.find(m=>m.Id===E))==null?void 0:h.Version}function c(p,E){const a=t.findIndex(h=>h.Id===p);if(a===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(a,1,E)}function u(p){const E=t.findIndex(a=>a.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(E,1)}async function f(p,E){try{const a=w(),h=d(E,p);delete E.Version,await We(n,{id:p,values:E,version:h});const m=await Te(n,{fields:a.fields||"",id:p});c(p,m)}catch(a){V()(a)}}async function g(p,E){try{const a=w(),h=d(E,p);delete E.Version,await Tt(n,{id:p,version:h}),u(p)}catch(a){V()(a)}}async function C(p){try{await _t(n,{values:p}),await T()}catch(E){V()(E)}}async function L(){try{const p=await s();t.push(...p)}catch(p){V()(p)}}function w(){return typeof e=="function"?e():e}async function T(){try{r=0;const p=await s();t.splice(0,t.length,...p)}catch(p){V()(p)}}return{array:t,updateById:f,next:L,reload:T,wait:i,create:C,deleteById:g}}function cr(){function n(){return{organizations:$.organizations,currentContextId:$.contextId,person:$.person,context:$.context,contextType:$.contextType,userId:$.userId}}const e=o.reactive(n());return $.onupdateContext(()=>{Object.assign(e,n())}),e}function lr(n,e,t){return A().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ur(n,e,t){return A().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function dr(n,e){return A().emit("communication-message:create",{communicationId:n,text:e})}function fr(n){return A().emit("communication-message:read",{communicationId:n})}function pr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>fr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function hr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw P.EntityWithoutName(n);return Te(n.name,r)}).then(Fe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(V())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw P.EntityWithoutName(n);return We(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw V()(i),i})};function t(){return typeof e=="function"?e():e}}function gr(n,e){return A().emit("metadata:read",{...e,entity:n})}class re{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[re.getKey(e,t)]=r}get(e,t={}){return this.state[re.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return gr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:yr(t.masterEntities)};return JSON.stringify(r)}}function yr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:mr(n)?[n]:n}function mr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function Er(n,e={}){if(!n)return o.inject(b.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?qe.getByKey(t.value):null);o.provide(b.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=re.getKey(n,Ct(e||{}))}const s=function(){return i(),qe.update(n,Ct(e||{}))};return i(),{state:r,update:s}}function Ct(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=wr(r),s=new _r(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function wr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const St=class Ot{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Ot.cardId++}};St.cardId=1;let _r=St;class Tr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return dr(this.id,e)}static checkAndGenerate(e,t,r){return ur(e,t,r).then(i=>i.length===0?lr(e,t,r):i[0])}}function Cr(){return A().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Sr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),kr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},br=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Se;const ke=class Z extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],kr(this,Se,!1)}set language(e){localStorage.setItem(b.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(b.LOCALSTORAGE_LANGUAGE_KEY)||Z.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){br(this,Se,e),this.emit(Z.EVENT_READY_UPDATE,e)}get ready(){return Sr(this,Se)}onReady(e){return this.on(Z.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(Z.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(Z.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){V()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(b.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Cr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Se=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let Ar=ke;function Nr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function R(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Nr(r)){let i=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(R.is(t,r)),e)},[]).join(" and ")}function ie(n){return typeof n=="string"?`'${n}'`:`${n}`}R.includes=function(e,t){return`@${e} Contains ${ie(t)}`},R.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},R.notEq=function(e,t){return`@${e} nq ${ie(t)}`},R.eq=function(e,t){return Array.isArray(t)?R.in(e,t):`@${e} eq ${ie(t)}`},R.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},R.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},R.is=function(e,t){return`@${e} is ${t}`},R.or=function(...e){return e.join(" or ")};const $=new Ar,qe=new re;class Ir{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return De(i,r),Et([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function vr(n,e="images"){return`/static-folder/${e}/${n}`}class Or{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):P.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return y(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},M=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},K=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,oe,Ae,Ne,se,ae,je;const Y="_______LIST_______ROW_______INDEX________NAME_______",Ie=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,be,void 0),this.array=[],z(this,oe,[]),z(this,Ae,[]),z(this,Ne,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),z(this,se,!1),z(this,ae,(...t)=>Promise),z(this,je,()=>{}),K(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&K(this,oe,e.config)}set config(e){K(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return M(this,oe)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return M(this,Ae)}set order(e){K(this,Ae,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return M(this,Ne)}set filters(e){$r(M(this,Ne),e)}set wait(e){K(this,se,e),this.emit(I.Form.EVENT_WAIT,M(this,se))}get wait(){return M(this,se)}get primaryKeys(){return M(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){K(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=M(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){K(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>M(this,je).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[Y]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=W.getCellName(e),i=(()=>{let s=r?fe(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};be=new WeakMap,oe=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,se=new WeakMap,ae=new WeakMap,je=new WeakMap,Ie.EVENT_DATA="list-data: update",Ie.EVENT_CONFIG_UPDATE="list-config:update",Ie.EVENT_ORDER_UPDATE="list-order:update",Ie.EVENT_FILTERS_UPDATE="list-filters:update";function Rr(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function $r(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Lr(n){const e=o.reactive([]);function t(c){return e.includes(c)}function r(c){t(c)||e.push(c)}function i(c){const u=e.findIndex(f=>f===c);u!==-1&&e.splice(u,1)}function s(c){const u=o.unref(n);if(c===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(c)?i(c):r(c)}const d=o.computed(()=>{const c=o.unref(n);return e.length===c.length&&c.length!==0});return[e,s,d,r,i]}function Pr(n){return n.statusName==="Completed"}function Dr(n){return n.statusName==="FinalStepWithConfirmation"}function Br(n){return n.statusName==="ValidationError"}function Ur(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const c=o.ref(null);function u(){c.value=s.find(a=>a.name===d)||null}function f(){var a;return d?((a=s.find(h=>h.name===d))==null?void 0:a.fields)||[]:[]}function g(a){if(u(),Br(a))return void t.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Vr(f(),t.presets)))return E(t.presets||{});Pr(a)&&t.onCompleted(a),Dr(a)&&t.onConfirmation(a)}async function C(){try{await L(),await p()}catch(a){const{message:h}=_e(a);Ce.add("error",h)}}function L(){return i.wait="Loading process information.",Ee.getStartConfig(e,n).then(a=>{s=a.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((m,B)=>(B.properties.forEach(N=>{m.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),m),[])}))}).then(a=>(i.wait=!1,a))}function w(a){return d=a.nextStepName,r=a.token,a}function T(a){const h=_e(a);Ce.add("error",h.message)}function p(){return i.wait="Starting process",Ee.startProcess(e,n).then(w).then(g).catch(T).finally(()=>{i.wait=null})}function E(a={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Expect the result",Ee.runStep(e,n,d,r,a).then(w).then(g).catch(T).finally(()=>{i.wait=!1}))}return{initialize:C,state:i,currentStepConfig:o.readonly(c),next:E}}function Vr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Mr="close-api/proxy/Equipment/Search";class Wr{static search(e,t,r,i,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const c=`/${Mr}?${d.toString()}`;return y(c,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Fr={clickOutside:pe,staticLink:vr},qr={usage:Dt,utils:jt,config:Gt,types:xt};l.Communication=Tr,l.CoreError=P,l.Filter=R,l.Manager=$,l.NotificationSystem=Ce,l.WidgetButton=En,l.WidgetIcon=ne,l.WidgetImage=vn,l.WidgetList=qn,l.WidgetLoader=Nn,l.WidgetMultiButton=kn,l.WidgetSpinner=we,l.WidgetTable=hn,l.actionService=Ir,l.asyncProcess=jn,l.authService=k,l.billingService=X,l.catchUniversal=V,l.clickOutside=pe,l.clientService=Je,l.communicationService=Zt,l.constants=b,l.dataService=te,l.debounce=Jn,l.default=qr,l.documentsService=Or,l.equipmentService=Wr,l.fileService=en,l.getCellName=ut,l.getCellValue=dt,l.getNamesFromListConfig=xn,l.groupArrayByField=zn,l.historyService=zt,l.internationalizationService=Kt,l.invitationService=tn,l.openService=nn,l.parseError=_e,l.prettyDate=Ve,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Qn,l.processWizardService=Ee,l.request=Et,l.ruleValidationService=Be,l.t=H,l.throttle=Hn,l.universalEntityCreate=_t,l.universalEntityDelete=Tt,l.universalEntityRead=Te,l.universalEntityUpdate=We,l.universalListSettingRead=ir,l.universalMetadataFieldTreat=or,l.useCommunication=pr,l.useFormEntity=hr,l.useListActiveRow=sr,l.useListEntity=ar,l.useListSearch=Rr,l.useListSelect=Lr,l.useLogger=Jt,l.useManagerState=cr,l.useMetadata=Er,l.useSocket=A,l.useWizard=Ur,l.utils=Fr,l.uuidv4=Kn,l.valuesToUpperCase=Fe,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
11
11
  //# sourceMappingURL=eservices-core.umd.js.map
@@ -16,7 +16,7 @@ export interface IUniversalEntityReadSingleOptions {
16
16
  export interface IUniversalEntityUpdateOptions {
17
17
  entity: string;
18
18
  id: IEntityId;
19
- version: IEntityVersion;
19
+ version?: IEntityVersion;
20
20
  values: unknown;
21
21
  }
22
22
  export interface IUniversalEntityUpdatingResult {
@@ -38,5 +38,5 @@ export interface IUniversalEntityCreatingResult {
38
38
  export interface IUniversalEntityDeleteOptions {
39
39
  entity: string;
40
40
  id: IEntityId;
41
- version: IEntityVersion;
41
+ version?: IEntityVersion;
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.62",
3
+ "version": "1.3.63",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {