eservices-core 1.3.13 → 1.3.14

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}.head-cell[data-v-4e1d87c8]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-4e1d87c8]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-4e1d87c8]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-4e1d87c8]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-4e1d87c8]{transform:rotate(180deg)}.head-cell-resize[data-v-4e1d87c8]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-4e1d87c8]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-4e1d87c8]: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.13
3
+ * eservices-core v1.3.14
4
4
  * (c) 2023 ESERVICES
5
- */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),_=require("jenesius-vue-form"),Xt=require("object-hash"),Zt=require("jenesius-vue-modal"),yt=require("vue-router"),Qt=require("date-and-time");function en(n,e){return!!n&&n===e||"password is not equal"}function wt(n){return Number(n.replace(/[^0-9.]/g,""))}function tn(n,e=null){let r=String(wt(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 nn=Object.freeze(Object.defineProperty({__proto__:null,numeric:wt,prettyNumeric:tn,validPassword:en},Symbol.toStringTag,{value:"Module"})),rn={inputs:nn};function de(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?de(n[r],e.substr(t+1)):void 0}return n[e]}function Fe(n,e){if(!n)return console.warn("Element is not provided.");function t(i,o){return i==o.target||i.contains(o.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ge(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const vt=class C extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=C.ID++}static ParentFormNotFound(){return new C("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new C("Composite object name is undefined",e)}static EntityWithoutName(e){return new C("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new C(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new C("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new C("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new C(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return C.ApiNotAvailable()}static ApiError(e){return new C("Request error",e)}static ApiNotAvailable(){return new C(`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?C.ApiNotAvailable():new C(e||"Authorization Error",t)}static ApiResponseParseFailed(){return C.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new C("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new C(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new C("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new C("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new C(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new C(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new C(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new C(`Metadata for the ${e} is not currently available.`)}};vt.ID=0;let L=vt;const Et="Please try again later or submit a feedback if problem doesn't go.";function it(n){return typeof n=="string"?Ve(n):sn(n)?Ve(n.message):Ve(Et)}function sn(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function Ve(n,e=[]){return{message:n,details:e}}class Ct{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const X=new class{constructor(){this.store=s.reactive([])}add(e,t,{children:r,timeout:i=10,click:o=()=>{}}={}){const u=new on(e,t,i,r||[],o);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.")}},_t=class St{constructor(e,t,r,i,o){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=o,this.id=St.cardId++}};_t.cardId=1;let on=_t;/*!
5
+ */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),_=require("jenesius-vue-form"),Zt=require("object-hash"),Qt=require("jenesius-vue-modal"),yt=require("vue-router"),en=require("date-and-time");function tn(n,e){return!!n&&n===e||"password is not equal"}function wt(n){return Number(n.replace(/[^0-9.]/g,""))}function nn(n,e=null){let r=String(wt(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 rn=Object.freeze(Object.defineProperty({__proto__:null,numeric:wt,prettyNumeric:nn,validPassword:tn},Symbol.toStringTag,{value:"Module"})),sn={inputs:rn};function de(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?de(n[r],e.substr(t+1)):void 0}return n[e]}function Fe(n,e){if(!n)return console.warn("Element is not provided.");function t(i,o){return i==o.target||i.contains(o.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ge(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const vt=class C extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=C.ID++}static ParentFormNotFound(){return new C("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new C("Composite object name is undefined",e)}static EntityWithoutName(e){return new C("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new C(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new C("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new C("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new C(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return C.ApiNotAvailable()}static ApiError(e){return new C("Request error",e)}static ApiNotAvailable(){return new C(`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?C.ApiNotAvailable():new C(e||"Authorization Error",t)}static ApiResponseParseFailed(){return C.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new C("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new C(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new C("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new C("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new C(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new C(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new C(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new C(`Metadata for the ${e} is not currently available.`)}};vt.ID=0;let L=vt;const Et="Please try again later or submit a feedback if problem doesn't go.";function it(n){return typeof n=="string"?Ve(n):on(n)?Ve(n.message):Ve(Et)}function on(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function Ve(n,e=[]){return{message:n,details:e}}class Ct{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const X=new class{constructor(){this.store=s.reactive([])}add(e,t,{children:r,timeout:i=10,click:o=()=>{}}={}){const u=new an(e,t,i,r||[],o);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.")}},_t=class St{constructor(e,t,r,i,o){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=o,this.id=St.cardId++}};_t.cardId=1;let an=_t;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const st=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ot=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},at=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ct=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return st.call(this,e,t)}emit(e,t){return ot.call(this,e,t)}off(e,t){return at.call(this,e,t)}cleanEvents(){ct.call(this)}static on(e,t){return st.call(I,e,t)}static emit(e,t){return ot.call(I,e,t)}static off(e,t){return at.call(I,e,t)}static cleanEvents(){ct.call(I)}}I.events={};var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),Be=(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)},xe=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ne,ye,we;const J=class F extends I{constructor(){super(...arguments),Be(this,ne,void 0),Be(this,ye,"front"),this.organizations=[],Be(this,we,!1)}set language(e){localStorage.setItem(F.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(F.LOCALSTORAGE_LANGUAGE_KEY)||F.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(F.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){xe(this,ne,e)}get router(){if(!me(this,ne))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,ne)}set type(e){xe(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xe(this,we,e),this.emit(F.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(F.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(F.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(F.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(F.CURRENT_CONTEXT_KEY,String(e)),this.emit(F.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(F.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{X.add("error",L.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;ye=new WeakMap;we=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 Tt=J;const v=new Tt;function an(){const n=s.reactive({contextType:v.contextType,contextId:v.contextId,context:v.context});return v.onupdateContext(()=>{n.contextType=v.contextType,n.contextId=v.contextId,n.context=v.context}),n}function cn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Et}})}function m(n,e={}){return v.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=v.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw L.ApiNotAvailable()}).then(t=>cn(t).then(r=>{if(!t.ok)throw r;return r}))}class Ie{constructor(){}static parseNamesFromListConfig(e){let t=Ie.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}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 o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class ln{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 Nt=new ln;function At(n){return n&&n[0].toLowerCase()+n.slice(1)}function $e(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=$e(r)),e[i]=r,e},{})}function un(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 le={Request:m,clickOutside:Fe,getPropFromObject:de,runPromiseQueue:Ge,GraphQL:Ie,firstChapterToLowerCase:At,valuesToUpperCase:$e,prettyMoney:un},dn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ie,Journal:Nt,Request:m,clickOutside:Fe,default:le,firstChapterToLowerCase:At,getPropFromObject:de,runPromiseQueue:Ge,valuesToUpperCase:$e},Symbol.toStringTag,{value:"Module"}));function kt(n,e=""){for(let t in n){if(typeof n[t]=="object"){kt(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 x={};function fn(n){for(let e in n)x[e]=n[e];n.styles&&kt(n.styles),Nt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=x}const hn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function pn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const gn="masterId",mn="masterEntity";function Ne(n,e){if(!Array.isArray(e))return;if(pn(e))return t(e);e.forEach(t);function t(r){n.append(mn,r[0]),n.append(gn,r[1].toString())}}class T{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),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(([a,c="desc"])=>`@${a} ${c}`).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=T.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=T.getSearchParamsForEntityListRead(t||{});return m(`/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 Ne(i,r==null?void 0:r.masterEntities),m(`/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 m(`/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 o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const o=new URLSearchParams;return Ne(o,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${o.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 T.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}var Ot=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},je=(n,e,t)=>(Ot(n,e,"read from private field"),t?t.call(n):e.get(n)),lt=(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)},ut=(n,e,t,r)=>(Ot(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,ve;const Je=class K extends I{constructor(e){super(),lt(this,re,[]),lt(this,ve,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){ut(this,ve,e),this.emit(K.EVENT_CHANGE_WAIT,e)}get wait(){return je(this,ve)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),T.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(K.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){ut(this,re,e),this.emit(K.EVENT_DATA,this.array)}add(e){je(this,re).push(...e),this.emit(K.EVENT_DATA,this.array)}get array(){return je(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=K.getCellName(e),i=(()=>{let o=r?de(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap;ve=new WeakMap;Je.EVENT_DATA="LIST:DATA";Je.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Ft=Je;const z=Symbol("__ROW_INDEX__");let He=class extends Ft{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(_.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};He.PROVIDE_NAME="table-controller";function yn(n){const e=s.reactive(n.array);s.provide(He.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(Ft.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(_.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=_.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function wn(n,e){n.read=()=>T.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(_.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await T.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await T.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await T.removeById(t,r(i),0)}),n.emit(_.Form.EVENT_SAVE)}}const vn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class En{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var It=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},D=(n,e,t)=>(It(n,e,"read from private field"),t?t.call(n):e.get(n)),W=(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)},U=(n,e,t,r)=>(It(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,ie,Ce,_e,se,oe,Ue;const q="_______LIST_______ROW_______INDEX________NAME_______",fe=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,W(this,Ee,void 0),this.array=[],W(this,ie,[]),W(this,Ce,[]),W(this,_e,new Proxy({},{set:(t,r,i,o)=>(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)})),W(this,se,!1),W(this,oe,(...t)=>Promise),W(this,Ue,()=>{}),U(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&U(this,ie,e.config)}set config(e){U(this,ie,e.map(_.utils.copyObject)),this.emitUpdateConfig()}get config(){return D(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return D(this,Ce)}set order(e){U(this,Ce,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return D(this,_e)}set filters(e){Dt(D(this,_e),e)}set wait(e){U(this,se,e),this.emit(_.Form.EVENT_WAIT,D(this,se))}get wait(){return D(this,se)}get primaryKeys(){return D(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[q]===e)}indexByKey(e){return this.array.findIndex(t=>t[q]===e)}static getKey(e){return e[q]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,q)}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,[q]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,q)}set read(e){U(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=D(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){U(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>D(this,Ue).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,[q]: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 o=r?de(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};Ee=new WeakMap;ie=new WeakMap;Ce=new WeakMap;_e=new WeakMap;se=new WeakMap;oe=new WeakMap;Ue=new WeakMap;fe.EVENT_DATA="list-data: update";fe.EVENT_CONFIG_UPDATE="list-config:update";fe.EVENT_ORDER_UPDATE="list-order:update";fe.EVENT_FILTERS_UPDATE="list-filters:update";let j=fe;function $t(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const f=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return f!==t&&!Number.isNaN(f)&&(r=0,t=f),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=T.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Lt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(j.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(_.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Pt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(j.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function Cn(n){const e=s.reactive([...n.config]);return n.on(j.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function Rt(n){const e=n.order||[],t=s.reactive(e);return n.on(j.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function _n(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Dt(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Sn(n){const e=s.reactive(_.utils.copyObject(n.filters));return n.on(j.EVENT_FILTERS_UPDATE,t=>{Dt(e,t),n.read()}),e}function bn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(f=>f===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class Tn extends j{constructor(e){super(e),this.changes=[],this.save=Nn.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function Nn(){const n=this.changes.filter(e=>e.status==="active");return Ge(n.map(e=>{console.log("++")}))}function An(){const n=s.ref(null);function e(t){n.value=t&&Xt(t)}return{activeRow:n,activateRow:e}}const kn=Object.freeze(Object.defineProperty({__proto__:null,List:j,Table:Tn,useListOrder:Rt,useListProvide:Pt,useListRead:$t,useListState:Lt,useTableActiveRow:An},Symbol.toStringTag,{value:"Module"}));class On extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Ke.get(e)}}const ae=new On;function Fn(n){const e=s.ref(ae.get(n));return ae.on(ae.EVENT_NEW,t=>{n===t.entityName&&(e.value=ae.get(n))}),e}function In(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Vt().error("prettify value by metadata",n,t)}}class $n{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let G={};function Z(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=_.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,n);if(typeof t=="string")return dt(t,e);const r=_.utils.getPropFromObject(G==null?void 0:G.root,n);return typeof r=="string"?dt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function dt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Z.setGlobalVocabulary=function(n){G=n};Z.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Z.bind({vocabulary:_.utils.getPropFromObject(G,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=_.utils.getPropFromObject(G,n)),Z.bind({vocabulary:n})};const Ln=function(){let n=!1;const e=[];function t(){return n}function r(c,f){t()&&console[c](...f),e.push(f)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Vt(){return Ln}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw L.AuthServiceError(e.title,t)}static login(e){return m(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=x.applicationName,m(x.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return m(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return m(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Bt=class ce{static async create(e){return m(ce.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 m(ce.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Bt.url="/close-api/communications";let ue=Bt;class Pn{static async getDefaultView(e){return m("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function ft(n){return{...n,createdEntities:n.createdEntites}}const xt=class Se{static async getStartConfig(e,t){return m([Se.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Se.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ft)}static async runStep(e,t,r,i,o){return m([Se.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then(ft)}};xt.url="/close-api/views/process-wizard";let be=xt;class Ke{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return Ne(i,r),t&&i.append("id",t),m([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return m(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return m(`/open-api/metadata/${e}/list-fields/${t}`)}}class Rn{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(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Dn{static invite(e,t,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ye{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ye.url+e,{method:"POST",body:JSON.stringify(t)})}}class Vn{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class jt{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 Ne(i,r),m([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Mt=class Wt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Wt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Mt.EVENT_DATA="list-config:update";let Bn=Mt;class xn extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ue.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ue.read(e).then(t=>t.length===0?ue.create(e):t[0])}}function jn(n){const e=_.Form.getParentForm();e?e.subscribe(n):console.warn(L.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>ue.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function Mn(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Mn(r)){let i=function(o){var u;return((u=o.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($.is(t,r)),e)},[]).join(" and ")}function he(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${he(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${he(t)}`};$.notEq=function(e,t){return`@${e} nq ${he(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${he(t)}`};$.in=function(e,t){const r=t.map(he).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};function Wn(n,e="images"){return`/static-folder/${e}/${n}`}function Un(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function qn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function zn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Gn(n,e){const t=s.ref(null);function r(){return n.name?Ke.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=L.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");X.add("error",i.message)}):Promise.reject()}return n.on(_.Form.EVENT_READ,r),{metadata:t,update:r}}class Xe extends Error{static UndefinedStatus(){return new Xe("Status is undefined.")}}class Jn extends Xe{}function Hn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw Jn.UndefinedStatus();const a=await jt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:v.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?Zt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):X.add("error",c.message),new Error;return c}).then(c=>{c.message&&X.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Kn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(_.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Yn(n,e){const t=yt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=le.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return T.readById(n.name,r.value,{fields:e.fields})}).then(le.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=le.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return T.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Xn(){const n=s.reactive({contextId:v.contextId,person:v.person,organizations:v.organizations,ready:v.ready,user:v.user}),e=s.computed(()=>{if(!v.ready||!v.person)return null;const r=n.contextId;return v.person.id===r?v.person:v.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return v.onupdateContext(r=>{n.contextId=r}),v.onupdateData(()=>{n.person=v.person,n.organizations=v.organizations,n.user=v.user}),v.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function Zn(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName("Use Form Request");return T.readById(n.name,i.id,{fields:i.fields})}).then(le.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=it(o);throw X.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName("Use Form Request");return T.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=it(o);throw X.add("error",u.message),u})},n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class Qn{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(o=>o.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Y.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]):L.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 m(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class er{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return m(i)}}function tr(n){return n.statusName==="Completed"}function nr(n){return n.statusName==="FinalStepWithConfirmation"}function rr(n){return n.statusName==="ValidationError"}function ir(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(y=>y.name===u)||null}function f(){var y;return u?((y=o.find(S=>S.name===u))==null?void 0:y.fields)||[]:[]}function l(y){if(c(),rr(y))return void t.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!f().length||sr(f(),t.presets)))return E(t.presets||{});tr(y)&&t.onCompleted(y),nr(y)&&t.onConfirmation(y)}async function d(){try{await h(),await w()}catch(y){const{message:S}=ke(y);Oe.add("error",S)}}function h(){return i.wait="Loading process information.",be.getStartConfig(e,n).then(y=>{o=y.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((N,k)=>(k.properties.forEach(P=>{N.push({name:P.name,label:P.title,type:P.refEntityName||P.dataType})}),N),[])}))}).then(y=>(i.wait=!1,y))}function p(y){return u=y.nextStepName,r=y.token,y}function g(y){const S=ke(y);Oe.add("error",S.message)}function w(){return i.wait="Starting process",be.startProcess(e,n).then(p).then(l).catch(g).finally(()=>{i.wait=null})}function E(y={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",be.runStep(e,n,u,r,y).then(p).then(l).catch(g).finally(()=>{i.wait=!1}))}return{initialize:d,state:i,currentStepConfig:s.readonly(a),next:E}}function sr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!_.utils.getPropFromObject(e,r.name))return!1}return!0}const or="close-api/proxy/Equipment/Search";class ar{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${or}?${u.toString()}`;return m(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const cr={class:"widget-table__head"},lr={class:"widget-table__head-label margin_0 text_overflow"},ur=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",cr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",lr,s.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},dr=M(ur,[["__scopeId","data-v-25198f4a"]]);function fr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function hr(n,e){const t=fr(n);let r=t?_.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function pr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qe={exports:{}},Me,ht;function gr(){if(ht)return Me;ht=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;Me=function(l,d){d=d||{};var h=typeof l;if(h==="string"&&l.length>0)return u(l);if(h==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var h=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return h*o;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*t;case"minutes":case"minute":case"mins":case"min":case"m":return h*e;case"seconds":case"second":case"secs":case"sec":case"s":return h*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=t?Math.round(l/t)+"h":d>=e?Math.round(l/e)+"m":d>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?f(l,d,r,"day"):d>=t?f(l,d,t,"hour"):d>=e?f(l,d,e,"minute"):d>=n?f(l,d,n,"second"):l+" ms"}function f(l,d,h,p){var g=d>=h*1.5;return Math.round(l/h)+" "+p+(g?"s":"")}return Me}function mr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=gr(),t.destroy=f,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let d=0;for(let h=0;h<l.length;h++)d=(d<<5)-d+l.charCodeAt(h),d|=0;return t.colors[Math.abs(d)%t.colors.length]}t.selectColor=e;function t(l){let d,h=null,p,g;function w(...E){if(!w.enabled)return;const y=w,S=Number(new Date),N=S-(d||S);y.diff=N,y.prev=d,y.curr=S,d=S,E[0]=t.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let k=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(B,b)=>{if(B==="%%")return"%";k++;const Q=t.formatters[b];if(typeof Q=="function"){const pe=E[k];B=Q.call(y,pe),E.splice(k,1),k--}return B}),t.formatArgs.call(y,E),(y.log||t.log).apply(y,E)}return w.namespace=l,w.useColors=t.useColors(),w.color=t.selectColor(l),w.extend=r,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,g=t.enabled(l)),g),set:E=>{h=E}}),typeof t.init=="function"&&t.init(w),w}function r(l,d){const h=t(this.namespace+(typeof d>"u"?":":d)+l);return h.log=this.log,h}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let d;const h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(d=0;d<p;d++)h[d]&&(l=h[d].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(d=>"-"+d)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let d,h;for(d=0,h=t.skips.length;d<h;d++)if(t.skips[d].test(l))return!1;for(d=0,h=t.names.length;d<h;d++)if(t.names[d].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var yr=mr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;c.splice(1,0,f,"color: inherit");let l=0,d=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(l++,h==="%c"&&(d=l))}),c.splice(d,0,f)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=yr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(qe,qe.exports);var wr=qe.exports;const Ut=pr(wr);function qt(n){return["eservices-core",n].join(":")}function zt(n){return Ze(n,"YYYY/MM/DD HH:mm:ss")}function Ze(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Qt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const vr={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()=>s.h("i",{class:`icon icon-${t}`})}},Le=M(vr,[["__scopeId","data-v-e287c8d9"]]),Er=Ut(qt("setup-list-row"));function Cr(n,e){const t=n.config.map(r=>_r(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function _r(n,e,t){const r=e.values;let i=hr(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],f=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ze(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=zt(typeof i=="string"?i:null);break}case"multi-select":{f.push(s.h(_.FormField,{type:"single-checkbox",modelValue:e.selected})),u(pt.bind(null,t,!0));break}case"select":{f.push(s.h(_.FormField,{type:"single-radio",modelValue:e.selected})),u(pt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const d=s.h(yt.RouterLink,{to:l});f.push(d),a("widget-table-cell_link")}}catch(l){Er("Can't add router link",l)}return n.href&&(f.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&f.push(s.h(Le,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,f)),c}function pt(n,e){n.emit("select",e)}function Gt(n,e){return()=>{try{return Cr(n,e)}catch(t){return console.warn(t),null}}}const Sr={props:{values:Object,config:Object,selected:Boolean},setup:Gt},br=["colspan"],gt=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,br)],512))}}),Qe={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Tr={class:"widget-table"},mt="update:selectedRows",Nr=s.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=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(mt,t.selectedRows.includes(a)?[]:[a]);const f=[...t.selectedRows],l=f.indexOf(a);return l===-1?f.push(a):f.splice(l,1),e(mt,f)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Tr,[s.createVNode(dr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(f,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(Sr,{config:a.config,values:f,selected:a.selectedRows.includes(f),onSelect:d=>o(f,d),class:s.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(s.openBlock(),s.createBlock(gt,{key:0,component:i.value,"row-length":a.config.length,values:f,onClose:c[0]||(c[0]=d=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Qe).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(gt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),Ar=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Pe=M(Ar,[["__scopeId","data-v-0ef9ae88"]]),kr={class:"widget-button"},Or=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",kr,[e.wait?(s.openBlock(),s.createBlock(Pe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Fr=M(Or,[["__scopeId","data-v-450dc564"]]),Ir={class:"widget-multi-button-wrap position_relative cursor_pointer"},$r={class:"widget-multi-button-body grid"},Lr=["onClick"],Pr={class:"widget-multi-button-side-wrap"},Rr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.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 o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",Ir,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",$r,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,f)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Lr))),128))]),s.createElementVNode("div",Pr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Pe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(Le),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}});const Dr=M(Rr,[["__scopeId","data-v-a8d711d1"]]),Vr={class:"widget-loader flex flex-align_center gap_10 padding_15"},Br={class:"text_md"},xr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Vr,[s.createVNode(Pe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Br,s.toDisplayString(e.label),1)]))}}),jr=["alt","src"],Mr=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,jr))}}),Wr={props:{config:Array,values:Object,selected:Boolean},setup:Gt};const Ur=M(Wr,[["__scopeId","data-v-344a8cc1"]]),qr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),zr={class:"head-cell"},Gr=qr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Jr=s.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)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",zr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(_.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.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]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(Le),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Gr])]))}});const Hr=M(Jr,[["__scopeId","data-v-4e1d87c8"]]),Kr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(p,g){let w=-1;do w++,g-=p[w];while(g>0&&w<p.length);return w}function f(p,g){let w=0;for(;g>0&&g>p[w]&&w<p.length;)g-=p[w],w++;return console.log(g,w),w>0?w:0}function l(p){try{i.value.style.insetInlineStart=p+"px"}catch(g){console.log(g)}}function d(p){try{i.value.style.width=p+"px",i.value.style.minWidth=p+"px",i.value.style.maxWidth=p+"px"}catch(g){console.log(g)}}function h(p){return p===null?!1:p.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(g){var rt;function w(O){return O.screenX+S-P}const E=r.value,y=[...E.children].filter(O=>O.localName==="th"),S=((rt=E.offsetParent)==null?void 0:rt.scrollLeft)||0,N=y.map(O=>O.clientWidth),k=h(g.target),P=E.getBoundingClientRect().left,B=w(g),b=c(N,B),Q=N.slice(0,b).reduce((O,R)=>O+R,0),pe=B-Q,Re=E.offsetWidth,ee=y[b].clientWidth;if(t.config[b].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",g.screenX),console.log("Widths",N),console.log("max width",Re),console.log("Start Position",B),console.log("Position From",b),console.log("Start Position",b),console.log("Global offset (Отступ самой таблицы от края экрана)",P),console.log("Del",pe),console.groupEnd(),i.value.innerText=y[b].textContent||"",i.value.style.display="grid",i.value.style.width=ee+"px",i.value.style.cursor="grabbing",l(Q),d(ee),document.addEventListener("pointermove",nt,{passive:!0}),document.addEventListener("pointerup",tt);function tt(O){if(console.group("END"),document.removeEventListener("pointermove",nt),document.removeEventListener("pointerup",tt),k&&(t.config[b].width=i.value.style.width,t.config[b].minWidth=i.value.style.width,t.config[b].maxWidth=i.value.style.width,o(t.config)),!k){const R=O.screenX+S-P;console.log("ENP Position",R);const ge=f(N,R);if(console.log(b,"->",ge),ge!==b){const te=t.config[b],De=t.config;De.splice(b,1),De.splice(ge,0,te),o(De)}else{const te=t.config[b].name;u(te)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function nt(O){if(k){const te=w(O)-B+ee;d(te);return}let R=O.screenX+S-P-pe;R<0&&(R=0),R+ee>Re&&(R=Re-ee),l(R)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,f==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,f)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,d)=>(s.openBlock(),s.createBlock(Hr,s.mergeProps({key:l},l,{onOrder:h=>u(l.name),onSelect:f[0]||(f[0]=h=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Yr=M(Kr,[["__scopeId","data-v-ccffc6bd"]]),Xr={class:"widget-list"},Zr={class:"widget-list-body position_relative"},Qr=50,ei=s.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(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const f=[...t.selectedRows],l=f.indexOf(a);l===-1?f.push(a):f==null||f.splice(l,1),o(f)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Qr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Xr,[s.createElementVNode("thead",null,[s.createVNode(Yr,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Zr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(f,l)=>{var d;return s.openBlock(),s.createBlock(Ur,{key:l,class:"widget-list-row",values:f,config:a.config,selected:(d=a.selectedRows)==null?void 0:d.includes(f),onSelect:h=>r(f,h)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ti(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=s.reactive({wait:!1,call:e});return t}function ke(n){return typeof n=="string"?We(n):ni(n)?We(n.message):We(Qe.DEFAULT_ERROR_MESSAGE)}function ni(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function Te(n="error"){return function(e){const{message:t}=ke(e);Oe.add(n,t)}}function ze(n,e){return et().emit("entity:read",{...e,entity:n})}function Jt(n,e){return et().emit("entity:update",{...e,entity:n})}function ri(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function ii(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 si(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const H=Ut(qt("use-socket"));function et(){return oi}const oi=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(h){const p=[...t.values()];H("Handlers array length is %d. Response event: %s. Request id: %d",t.size,h.event,h.requestId),p.forEach(g=>{const w=h.requestId;(g.requestId&&g.requestId===w||!g.requestId&&g.event===h.event)&&(H("Find appropriated handler: %d, event: %s",n,g.event),g.callback(h.data,h),g.once&&(t.delete(g),H("Handler was removed by *once* params was passed. %o",g)))})}function u(h){console.log(`%cInitializing sockets: %c${h}`,"color: purple","color: black"),e=new WebSocket(h),e.onclose=function(p){H("Connection to server was stopped: %d %s",p.code,p.reason),setTimeout(()=>u(h))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(p=>{a(p),r.delete(p)})},e.onerror=function(p){console.warn(p)},e.onmessage=p=>{try{const g=JSON.parse(p.data);if(!Ht(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}o(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function a(h){e.send(h)}function c(h,p){t.add({event:h,callback:p})}function f(h,p){t.add({event:h,callback:p,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function d(h,p,g){const w=++n,E=JSON.stringify({requestId:w,event:h,data:p,contextId:v.contextId,url:window.location.href});return l()?a(E):(r.add(E),H("Socket is not connected. Message was send to save-queue. %s")),new Promise((y,S)=>{t.add({event:h,requestId:w,once:!0,callback:(N,k)=>{if(H("Promise was resolve with next data:",N),ai(k))return void S(N);g&&g(N,k),y(N)}})})}return{get socket(){return e},on:c,once:f,emit:d,initialization:u,getDevInfo:i}}(),ai=n=>!!Ht(n)&&n.event==="request-error",Ht=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ci(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){return i.value?Promise.reject("The process has already started."):(i.value=!0,typeof e.limit!="number"&&(e.limit=100),e.offset=r,ze(n,e).then(d=>(r+=d.length,d)).finally(()=>{i.value=!1}))}function u(d,h){var g;const p=d.Version||((g=t.find(w=>w.Id===h))==null?void 0:g.Version);if(p===void 0)throw new Error("Object without version.");return p}function a(d,h){const p=t.findIndex(g=>g.Id===d);if(p===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(p,1,h)}async function c(d,h){try{const p=u(h,d);delete h.Version,await Jt(n,{id:d,values:h,version:p});const g=await ze(n,{fields:e.fields||"",id:d});a(d,g)}catch(p){Te()(p)}}async function f(){try{const d=await o();t.push(...d)}catch(d){Te()(d)}}async function l(){try{r=0;const d=await o();t.splice(0,t.length,...d)}catch(d){Te()(d)}}return{array:t,updateById:c,next:f,reload:l,wait:i}}const Oe=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=li(r),o=new ui(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function li(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 Yt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Yt.cardId++}};Kt.cardId=1;let ui=Kt;const di={clickOutside:Fe,valuesToUpperCase:$e,Filter:$,staticLink:Wn,groupArrayByField:Un,uuidv4:qn,Request:m},fi={usage:rn,utils:dn,config:fn,types:hn};exports.ApplicationManager=Tt;exports.Communication=xn;exports.ComputedMetadata=Fn;exports.CoreError=L;exports.Filter=$;exports.List=j;exports.ListConfig=Bn;exports.Manager=v;exports.MetadataStore=ae;exports.NotificationSystem=Oe;exports.Request=m;exports.Table=He;exports.WidgetButton=Fr;exports.WidgetIcon=Le;exports.WidgetImage=Mr;exports.WidgetList=ei;exports.WidgetLoader=xr;exports.WidgetMultiButton=Dr;exports.WidgetSpinner=Pe;exports.WidgetTable=Nr;exports.actionService=jt;exports.asyncProcess=ti;exports.authService=A;exports.billingService=Y;exports.catchUniversal=Te;exports.clickOutside=Fe;exports.clientService=Ct;exports.communicationService=ue;exports.configurationService=er;exports.constants=Qe;exports.dataService=T;exports.debounce=zn;exports.default=fi;exports.documentsService=Qn;exports.equipmentService=ar;exports.fileService=Rn;exports.getNamesFromListConfig=ri;exports.historyService=En;exports.internationalizationService=$n;exports.invitationService=Dn;exports.metadataService=Ke;exports.newImport=kn;exports.openService=Vn;exports.parseError=ke;exports.prettifyValueByMetadata=In;exports.prettyDate=Ze;exports.prettyDateWithTime=zt;exports.prettyMoney=ii;exports.processWizardService=be;exports.ruleValidationService=Ye;exports.t=Z;exports.testTypes=vn;exports.universalEntityRead=ze;exports.universalEntityUpdate=Jt;exports.useCommunication=jn;exports.useCustomerState=Xn;exports.useFormAction=Hn;exports.useFormLabel=Kn;exports.useFormMetadata=Gn;exports.useFormRequest=Zn;exports.useFormRequestData=Yn;exports.useListActiveRow=si;exports.useListConfig=Cn;exports.useListEntity=ci;exports.useListFilter=Sn;exports.useListOrder=Rt;exports.useListProvide=Pt;exports.useListRead=$t;exports.useListSearch=_n;exports.useListSelect=bn;exports.useListState=Lt;exports.useLogger=Vt;exports.useManagerState=an;exports.useSocket=et;exports.useTableRequest=wn;exports.useTableState=yn;exports.useWizard=ir;exports.utils=di;exports.viewService=Pn;
10
+ */const st=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ot=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},at=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ct=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return st.call(this,e,t)}emit(e,t){return ot.call(this,e,t)}off(e,t){return at.call(this,e,t)}cleanEvents(){ct.call(this)}static on(e,t){return st.call(I,e,t)}static emit(e,t){return ot.call(I,e,t)}static off(e,t){return at.call(I,e,t)}static cleanEvents(){ct.call(I)}}I.events={};var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),Be=(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)},xe=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ne,ye,we;const J=class F extends I{constructor(){super(...arguments),Be(this,ne,void 0),Be(this,ye,"front"),this.organizations=[],Be(this,we,!1)}set language(e){localStorage.setItem(F.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(F.LOCALSTORAGE_LANGUAGE_KEY)||F.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(F.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){xe(this,ne,e)}get router(){if(!me(this,ne))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,ne)}set type(e){xe(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xe(this,we,e),this.emit(F.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(F.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(F.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(F.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(F.CURRENT_CONTEXT_KEY,String(e)),this.emit(F.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(F.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{X.add("error",L.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;ye=new WeakMap;we=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 Tt=J;const v=new Tt;function cn(){const n=s.reactive({contextType:v.contextType,contextId:v.contextId,context:v.context});return v.onupdateContext(()=>{n.contextType=v.contextType,n.contextId=v.contextId,n.context=v.context}),n}function ln(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Et}})}function m(n,e={}){return v.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=v.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw L.ApiNotAvailable()}).then(t=>ln(t).then(r=>{if(!t.ok)throw r;return r}))}class Ie{constructor(){}static parseNamesFromListConfig(e){let t=Ie.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}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 o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class un{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 Nt=new un;function At(n){return n&&n[0].toLowerCase()+n.slice(1)}function $e(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=$e(r)),e[i]=r,e},{})}function dn(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 le={Request:m,clickOutside:Fe,getPropFromObject:de,runPromiseQueue:Ge,GraphQL:Ie,firstChapterToLowerCase:At,valuesToUpperCase:$e,prettyMoney:dn},fn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ie,Journal:Nt,Request:m,clickOutside:Fe,default:le,firstChapterToLowerCase:At,getPropFromObject:de,runPromiseQueue:Ge,valuesToUpperCase:$e},Symbol.toStringTag,{value:"Module"}));function kt(n,e=""){for(let t in n){if(typeof n[t]=="object"){kt(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 x={};function hn(n){for(let e in n)x[e]=n[e];n.styles&&kt(n.styles),Nt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=x}const pn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const mn="masterId",yn="masterEntity";function Ne(n,e){if(!Array.isArray(e))return;if(gn(e))return t(e);e.forEach(t);function t(r){n.append(yn,r[0]),n.append(mn,r[1].toString())}}class T{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),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(([a,c="desc"])=>`@${a} ${c}`).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=T.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=T.getSearchParamsForEntityListRead(t||{});return m(`/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 Ne(i,r==null?void 0:r.masterEntities),m(`/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 m(`/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 o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const o=new URLSearchParams;return Ne(o,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${o.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 T.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}var Ot=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},je=(n,e,t)=>(Ot(n,e,"read from private field"),t?t.call(n):e.get(n)),lt=(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)},ut=(n,e,t,r)=>(Ot(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,ve;const Je=class K extends I{constructor(e){super(),lt(this,re,[]),lt(this,ve,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){ut(this,ve,e),this.emit(K.EVENT_CHANGE_WAIT,e)}get wait(){return je(this,ve)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),T.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(K.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){ut(this,re,e),this.emit(K.EVENT_DATA,this.array)}add(e){je(this,re).push(...e),this.emit(K.EVENT_DATA,this.array)}get array(){return je(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=K.getCellName(e),i=(()=>{let o=r?de(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap;ve=new WeakMap;Je.EVENT_DATA="LIST:DATA";Je.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Ft=Je;const z=Symbol("__ROW_INDEX__");let He=class extends Ft{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(_.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};He.PROVIDE_NAME="table-controller";function wn(n){const e=s.reactive(n.array);s.provide(He.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(Ft.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(_.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=_.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function vn(n,e){n.read=()=>T.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(_.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await T.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await T.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await T.removeById(t,r(i),0)}),n.emit(_.Form.EVENT_SAVE)}}const En=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Cn{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var It=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},D=(n,e,t)=>(It(n,e,"read from private field"),t?t.call(n):e.get(n)),W=(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)},U=(n,e,t,r)=>(It(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,ie,Ce,_e,se,oe,Ue;const q="_______LIST_______ROW_______INDEX________NAME_______",fe=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,W(this,Ee,void 0),this.array=[],W(this,ie,[]),W(this,Ce,[]),W(this,_e,new Proxy({},{set:(t,r,i,o)=>(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)})),W(this,se,!1),W(this,oe,(...t)=>Promise),W(this,Ue,()=>{}),U(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&U(this,ie,e.config)}set config(e){U(this,ie,e.map(_.utils.copyObject)),this.emitUpdateConfig()}get config(){return D(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return D(this,Ce)}set order(e){U(this,Ce,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return D(this,_e)}set filters(e){Dt(D(this,_e),e)}set wait(e){U(this,se,e),this.emit(_.Form.EVENT_WAIT,D(this,se))}get wait(){return D(this,se)}get primaryKeys(){return D(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[q]===e)}indexByKey(e){return this.array.findIndex(t=>t[q]===e)}static getKey(e){return e[q]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,q)}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,[q]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,q)}set read(e){U(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=D(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){U(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>D(this,Ue).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,[q]: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 o=r?de(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};Ee=new WeakMap;ie=new WeakMap;Ce=new WeakMap;_e=new WeakMap;se=new WeakMap;oe=new WeakMap;Ue=new WeakMap;fe.EVENT_DATA="list-data: update";fe.EVENT_CONFIG_UPDATE="list-config:update";fe.EVENT_ORDER_UPDATE="list-order:update";fe.EVENT_FILTERS_UPDATE="list-filters:update";let j=fe;function $t(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const f=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return f!==t&&!Number.isNaN(f)&&(r=0,t=f),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=T.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Lt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(j.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(_.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Pt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(j.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function _n(n){const e=s.reactive([...n.config]);return n.on(j.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function Rt(n){const e=n.order||[],t=s.reactive(e);return n.on(j.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function Sn(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Dt(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function bn(n){const e=s.reactive(_.utils.copyObject(n.filters));return n.on(j.EVENT_FILTERS_UPDATE,t=>{Dt(e,t),n.read()}),e}function Tn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(f=>f===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class Nn extends j{constructor(e){super(e),this.changes=[],this.save=An.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function An(){const n=this.changes.filter(e=>e.status==="active");return Ge(n.map(e=>{console.log("++")}))}function kn(){const n=s.ref(null);function e(t){n.value=t&&Zt(t)}return{activeRow:n,activateRow:e}}const On=Object.freeze(Object.defineProperty({__proto__:null,List:j,Table:Nn,useListOrder:Rt,useListProvide:Pt,useListRead:$t,useListState:Lt,useTableActiveRow:kn},Symbol.toStringTag,{value:"Module"}));class Fn extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Ke.get(e)}}const ae=new Fn;function In(n){const e=s.ref(ae.get(n));return ae.on(ae.EVENT_NEW,t=>{n===t.entityName&&(e.value=ae.get(n))}),e}function $n(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Vt().error("prettify value by metadata",n,t)}}class Ln{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let G={};function Z(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=_.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,n);if(typeof t=="string")return dt(t,e);const r=_.utils.getPropFromObject(G==null?void 0:G.root,n);return typeof r=="string"?dt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function dt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Z.setGlobalVocabulary=function(n){G=n};Z.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Z.bind({vocabulary:_.utils.getPropFromObject(G,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=_.utils.getPropFromObject(G,n)),Z.bind({vocabulary:n})};const Pn=function(){let n=!1;const e=[];function t(){return n}function r(c,f){t()&&console[c](...f),e.push(f)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Vt(){return Pn}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw L.AuthServiceError(e.title,t)}static login(e){return m(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=x.applicationName,m(x.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return m(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return m(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Bt=class ce{static async create(e){return m(ce.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 m(ce.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Bt.url="/close-api/communications";let ue=Bt;class Rn{static async getDefaultView(e){return m("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function ft(n){return{...n,createdEntities:n.createdEntites}}const xt=class Se{static async getStartConfig(e,t){return m([Se.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Se.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ft)}static async runStep(e,t,r,i,o){return m([Se.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then(ft)}};xt.url="/close-api/views/process-wizard";let be=xt;class Ke{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return Ne(i,r),t&&i.append("id",t),m([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return m(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return m(`/open-api/metadata/${e}/list-fields/${t}`)}}class Dn{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(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Vn{static invite(e,t,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ye{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ye.url+e,{method:"POST",body:JSON.stringify(t)})}}class Bn{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class jt{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 Ne(i,r),m([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Mt=class Wt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Wt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Mt.EVENT_DATA="list-config:update";let xn=Mt;class jn extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ue.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ue.read(e).then(t=>t.length===0?ue.create(e):t[0])}}function Mn(n){const e=_.Form.getParentForm();e?e.subscribe(n):console.warn(L.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>ue.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function Wn(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Wn(r)){let i=function(o){var u;return((u=o.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($.is(t,r)),e)},[]).join(" and ")}function he(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${he(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${he(t)}`};$.notEq=function(e,t){return`@${e} nq ${he(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${he(t)}`};$.in=function(e,t){const r=t.map(he).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};function Un(n,e="images"){return`/static-folder/${e}/${n}`}function qn(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Gn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Jn(n,e){const t=s.ref(null);function r(){return n.name?Ke.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=L.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");X.add("error",i.message)}):Promise.reject()}return n.on(_.Form.EVENT_READ,r),{metadata:t,update:r}}class Xe extends Error{static UndefinedStatus(){return new Xe("Status is undefined.")}}class Hn extends Xe{}function Kn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw Hn.UndefinedStatus();const a=await jt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:v.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?Qt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):X.add("error",c.message),new Error;return c}).then(c=>{c.message&&X.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Yn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(_.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Xn(n,e){const t=yt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=le.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return T.readById(n.name,r.value,{fields:e.fields})}).then(le.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=le.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return T.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Zn(){const n=s.reactive({contextId:v.contextId,person:v.person,organizations:v.organizations,ready:v.ready,user:v.user}),e=s.computed(()=>{if(!v.ready||!v.person)return null;const r=n.contextId;return v.person.id===r?v.person:v.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return v.onupdateContext(r=>{n.contextId=r}),v.onupdateData(()=>{n.person=v.person,n.organizations=v.organizations,n.user=v.user}),v.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function Qn(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName("Use Form Request");return T.readById(n.name,i.id,{fields:i.fields})}).then(le.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=it(o);throw X.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName("Use Form Request");return T.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=it(o);throw X.add("error",u.message),u})},n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class er{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(o=>o.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Y.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]):L.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 m(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class tr{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return m(i)}}function nr(n){return n.statusName==="Completed"}function rr(n){return n.statusName==="FinalStepWithConfirmation"}function ir(n){return n.statusName==="ValidationError"}function sr(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(y=>y.name===u)||null}function f(){var y;return u?((y=o.find(S=>S.name===u))==null?void 0:y.fields)||[]:[]}function l(y){if(c(),ir(y))return void t.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!f().length||or(f(),t.presets)))return E(t.presets||{});nr(y)&&t.onCompleted(y),rr(y)&&t.onConfirmation(y)}async function d(){try{await h(),await w()}catch(y){const{message:S}=ke(y);Oe.add("error",S)}}function h(){return i.wait="Loading process information.",be.getStartConfig(e,n).then(y=>{o=y.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((N,k)=>(k.properties.forEach(P=>{N.push({name:P.name,label:P.title,type:P.refEntityName||P.dataType})}),N),[])}))}).then(y=>(i.wait=!1,y))}function p(y){return u=y.nextStepName,r=y.token,y}function g(y){const S=ke(y);Oe.add("error",S.message)}function w(){return i.wait="Starting process",be.startProcess(e,n).then(p).then(l).catch(g).finally(()=>{i.wait=null})}function E(y={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",be.runStep(e,n,u,r,y).then(p).then(l).catch(g).finally(()=>{i.wait=!1}))}return{initialize:d,state:i,currentStepConfig:s.readonly(a),next:E}}function or(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!_.utils.getPropFromObject(e,r.name))return!1}return!0}const ar="close-api/proxy/Equipment/Search";class cr{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${ar}?${u.toString()}`;return m(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const lr={class:"widget-table__head"},ur={class:"widget-table__head-label margin_0 text_overflow"},dr=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",lr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",ur,s.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},fr=M(dr,[["__scopeId","data-v-25198f4a"]]);function hr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Ut(n,e){const t=hr(n);let r=t?_.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function pr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qe={exports:{}},Me,ht;function gr(){if(ht)return Me;ht=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;Me=function(l,d){d=d||{};var h=typeof l;if(h==="string"&&l.length>0)return u(l);if(h==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var h=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return h*o;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*t;case"minutes":case"minute":case"mins":case"min":case"m":return h*e;case"seconds":case"second":case"secs":case"sec":case"s":return h*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=t?Math.round(l/t)+"h":d>=e?Math.round(l/e)+"m":d>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?f(l,d,r,"day"):d>=t?f(l,d,t,"hour"):d>=e?f(l,d,e,"minute"):d>=n?f(l,d,n,"second"):l+" ms"}function f(l,d,h,p){var g=d>=h*1.5;return Math.round(l/h)+" "+p+(g?"s":"")}return Me}function mr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=gr(),t.destroy=f,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let d=0;for(let h=0;h<l.length;h++)d=(d<<5)-d+l.charCodeAt(h),d|=0;return t.colors[Math.abs(d)%t.colors.length]}t.selectColor=e;function t(l){let d,h=null,p,g;function w(...E){if(!w.enabled)return;const y=w,S=Number(new Date),N=S-(d||S);y.diff=N,y.prev=d,y.curr=S,d=S,E[0]=t.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let k=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(B,b)=>{if(B==="%%")return"%";k++;const Q=t.formatters[b];if(typeof Q=="function"){const pe=E[k];B=Q.call(y,pe),E.splice(k,1),k--}return B}),t.formatArgs.call(y,E),(y.log||t.log).apply(y,E)}return w.namespace=l,w.useColors=t.useColors(),w.color=t.selectColor(l),w.extend=r,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,g=t.enabled(l)),g),set:E=>{h=E}}),typeof t.init=="function"&&t.init(w),w}function r(l,d){const h=t(this.namespace+(typeof d>"u"?":":d)+l);return h.log=this.log,h}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let d;const h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(d=0;d<p;d++)h[d]&&(l=h[d].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(d=>"-"+d)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let d,h;for(d=0,h=t.skips.length;d<h;d++)if(t.skips[d].test(l))return!1;for(d=0,h=t.names.length;d<h;d++)if(t.names[d].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var yr=mr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;c.splice(1,0,f,"color: inherit");let l=0,d=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(l++,h==="%c"&&(d=l))}),c.splice(d,0,f)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=yr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(qe,qe.exports);var wr=qe.exports;const qt=pr(wr);function zt(n){return["eservices-core",n].join(":")}function Gt(n){return Ze(n,"YYYY/MM/DD HH:mm:ss")}function Ze(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return en.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const vr={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()=>s.h("i",{class:`icon icon-${t}`})}},Le=M(vr,[["__scopeId","data-v-e287c8d9"]]),Er=qt(zt("setup-list-row"));function Cr(n,e){const t=n.config.map(r=>_r(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function _r(n,e,t){const r=e.values;let i=Ut(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],f=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ze(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Gt(typeof i=="string"?i:null);break}case"multi-select":{f.push(s.h(_.FormField,{type:"single-checkbox",modelValue:e.selected})),u(pt.bind(null,t,!0));break}case"select":{f.push(s.h(_.FormField,{type:"single-radio",modelValue:e.selected})),u(pt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const d=s.h(yt.RouterLink,{to:l});f.push(d),a("widget-table-cell_link")}}catch(l){Er("Can't add router link",l)}return n.href&&(f.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&f.push(s.h(Le,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,f)),c}function pt(n,e){n.emit("select",e)}function Jt(n,e){return()=>{try{return Cr(n,e)}catch(t){return console.warn(t),null}}}const Sr={props:{values:Object,config:Object,selected:Boolean},setup:Jt},br=["colspan"],gt=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,br)],512))}}),Qe={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Tr={class:"widget-table"},mt="update:selectedRows",Nr=s.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=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(mt,t.selectedRows.includes(a)?[]:[a]);const f=[...t.selectedRows],l=f.indexOf(a);return l===-1?f.push(a):f.splice(l,1),e(mt,f)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Tr,[s.createVNode(fr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(f,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(Sr,{config:a.config,values:f,selected:a.selectedRows.includes(f),onSelect:d=>o(f,d),class:s.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(s.openBlock(),s.createBlock(gt,{key:0,component:i.value,"row-length":a.config.length,values:f,onClose:c[0]||(c[0]=d=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Qe).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(gt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),Ar=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Pe=M(Ar,[["__scopeId","data-v-0ef9ae88"]]),kr={class:"widget-button"},Or=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",kr,[e.wait?(s.openBlock(),s.createBlock(Pe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Fr=M(Or,[["__scopeId","data-v-450dc564"]]),Ir={class:"widget-multi-button-wrap position_relative cursor_pointer"},$r={class:"widget-multi-button-body grid"},Lr=["onClick"],Pr={class:"widget-multi-button-side-wrap"},Rr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.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 o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",Ir,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",$r,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,f)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Lr))),128))]),s.createElementVNode("div",Pr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Pe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(Le),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}});const Dr=M(Rr,[["__scopeId","data-v-a8d711d1"]]),Vr={class:"widget-loader flex flex-align_center gap_10 padding_15"},Br={class:"text_md"},xr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Vr,[s.createVNode(Pe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Br,s.toDisplayString(e.label),1)]))}}),jr=["alt","src"],Mr=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,jr))}}),Wr={props:{config:Array,values:Object,selected:Boolean},setup:Jt};const Ur=M(Wr,[["__scopeId","data-v-344a8cc1"]]),qr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),zr={class:"head-cell"},Gr=qr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Jr=s.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)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",zr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(_.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.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]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(Le),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Gr])]))}});const Hr=M(Jr,[["__scopeId","data-v-4e1d87c8"]]),Kr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(p,g){let w=-1;do w++,g-=p[w];while(g>0&&w<p.length);return w}function f(p,g){let w=0;for(;g>0&&g>p[w]&&w<p.length;)g-=p[w],w++;return console.log(g,w),w>0?w:0}function l(p){try{i.value.style.insetInlineStart=p+"px"}catch(g){console.log(g)}}function d(p){try{i.value.style.width=p+"px",i.value.style.minWidth=p+"px",i.value.style.maxWidth=p+"px"}catch(g){console.log(g)}}function h(p){return p===null?!1:p.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(g){var rt;function w(O){return O.screenX+S-P}const E=r.value,y=[...E.children].filter(O=>O.localName==="th"),S=((rt=E.offsetParent)==null?void 0:rt.scrollLeft)||0,N=y.map(O=>O.clientWidth),k=h(g.target),P=E.getBoundingClientRect().left,B=w(g),b=c(N,B),Q=N.slice(0,b).reduce((O,R)=>O+R,0),pe=B-Q,Re=E.offsetWidth,ee=y[b].clientWidth;if(t.config[b].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",g.screenX),console.log("Widths",N),console.log("max width",Re),console.log("Start Position",B),console.log("Position From",b),console.log("Start Position",b),console.log("Global offset (Отступ самой таблицы от края экрана)",P),console.log("Del",pe),console.groupEnd(),i.value.innerText=y[b].textContent||"",i.value.style.display="grid",i.value.style.width=ee+"px",i.value.style.cursor="grabbing",l(Q),d(ee),document.addEventListener("pointermove",nt,{passive:!0}),document.addEventListener("pointerup",tt);function tt(O){if(console.group("END"),document.removeEventListener("pointermove",nt),document.removeEventListener("pointerup",tt),k&&(t.config[b].width=i.value.style.width,t.config[b].minWidth=i.value.style.width,t.config[b].maxWidth=i.value.style.width,o(t.config)),!k){const R=O.screenX+S-P;console.log("ENP Position",R);const ge=f(N,R);if(console.log(b,"->",ge),ge!==b){const te=t.config[b],De=t.config;De.splice(b,1),De.splice(ge,0,te),o(De)}else{const te=t.config[b].name;u(te)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function nt(O){if(k){const te=w(O)-B+ee;d(te);return}let R=O.screenX+S-P-pe;R<0&&(R=0),R+ee>Re&&(R=Re-ee),l(R)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,f==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,f)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,d)=>(s.openBlock(),s.createBlock(Hr,s.mergeProps({key:l},l,{onOrder:h=>u(l.name),onSelect:f[0]||(f[0]=h=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Yr=M(Kr,[["__scopeId","data-v-ccffc6bd"]]),Xr={class:"widget-list"},Zr={class:"widget-list-body position_relative"},Qr=50,ei=s.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(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const f=[...t.selectedRows],l=f.indexOf(a);l===-1?f.push(a):f==null||f.splice(l,1),o(f)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Qr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Xr,[s.createElementVNode("thead",null,[s.createVNode(Yr,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Zr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(f,l)=>{var d;return s.openBlock(),s.createBlock(Ur,{key:l,class:"widget-list-row",values:f,config:a.config,selected:(d=a.selectedRows)==null?void 0:d.includes(f),onSelect:h=>r(f,h)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ti(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=s.reactive({wait:!1,call:e});return t}function ke(n){return typeof n=="string"?We(n):ni(n)?We(n.message):We(Qe.DEFAULT_ERROR_MESSAGE)}function ni(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function Te(n="error"){return function(e){const{message:t}=ke(e);Oe.add(n,t)}}function ze(n,e){return et().emit("entity:read",{...e,entity:n})}function Ht(n,e){return et().emit("entity:update",{...e,entity:n})}function ri(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function ii(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 si(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const H=qt(zt("use-socket"));function et(){return oi}const oi=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(h){const p=[...t.values()];H("Handlers array length is %d. Response event: %s. Request id: %d",t.size,h.event,h.requestId),p.forEach(g=>{const w=h.requestId;(g.requestId&&g.requestId===w||!g.requestId&&g.event===h.event)&&(H("Find appropriated handler: %d, event: %s",n,g.event),g.callback(h.data,h),g.once&&(t.delete(g),H("Handler was removed by *once* params was passed. %o",g)))})}function u(h){console.log(`%cInitializing sockets: %c${h}`,"color: purple","color: black"),e=new WebSocket(h),e.onclose=function(p){H("Connection to server was stopped: %d %s",p.code,p.reason),setTimeout(()=>u(h))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(p=>{a(p),r.delete(p)})},e.onerror=function(p){console.warn(p)},e.onmessage=p=>{try{const g=JSON.parse(p.data);if(!Kt(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}o(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function a(h){e.send(h)}function c(h,p){t.add({event:h,callback:p})}function f(h,p){t.add({event:h,callback:p,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function d(h,p,g){const w=++n,E=JSON.stringify({requestId:w,event:h,data:p,contextId:v.contextId,url:window.location.href});return l()?a(E):(r.add(E),H("Socket is not connected. Message was send to save-queue. %s")),new Promise((y,S)=>{t.add({event:h,requestId:w,once:!0,callback:(N,k)=>{if(H("Promise was resolve with next data:",N),ai(k))return void S(N);g&&g(N,k),y(N)}})})}return{get socket(){return e},on:c,once:f,emit:d,initialization:u,getDevInfo:i}}(),ai=n=>!!Kt(n)&&n.event==="request-error",Kt=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ci(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){return i.value?Promise.reject("The process has already started."):(i.value=!0,typeof e.limit!="number"&&(e.limit=100),e.offset=r,ze(n,e).then(d=>(r+=d.length,d)).finally(()=>{i.value=!1}))}function u(d,h){var g;const p=d.Version||((g=t.find(w=>w.Id===h))==null?void 0:g.Version);if(p===void 0)throw new Error("Object without version.");return p}function a(d,h){const p=t.findIndex(g=>g.Id===d);if(p===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(p,1,h)}async function c(d,h){try{const p=u(h,d);delete h.Version,await Ht(n,{id:d,values:h,version:p});const g=await ze(n,{fields:e.fields||"",id:d});a(d,g)}catch(p){Te()(p)}}async function f(){try{const d=await o();t.push(...d)}catch(d){Te()(d)}}async function l(){try{r=0;const d=await o();t.splice(0,t.length,...d)}catch(d){Te()(d)}}return{array:t,updateById:c,next:f,reload:l,wait:i}}const Oe=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=li(r),o=new ui(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function li(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 Yt=class Xt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Xt.cardId++}};Yt.cardId=1;let ui=Yt;const di={clickOutside:Fe,valuesToUpperCase:$e,Filter:$,staticLink:Un,groupArrayByField:qn,uuidv4:zn,Request:m},fi={usage:sn,utils:fn,config:hn,types:pn};exports.ApplicationManager=Tt;exports.Communication=jn;exports.ComputedMetadata=In;exports.CoreError=L;exports.Filter=$;exports.List=j;exports.ListConfig=xn;exports.Manager=v;exports.MetadataStore=ae;exports.NotificationSystem=Oe;exports.Request=m;exports.Table=He;exports.WidgetButton=Fr;exports.WidgetIcon=Le;exports.WidgetImage=Mr;exports.WidgetList=ei;exports.WidgetLoader=xr;exports.WidgetMultiButton=Dr;exports.WidgetSpinner=Pe;exports.WidgetTable=Nr;exports.actionService=jt;exports.asyncProcess=ti;exports.authService=A;exports.billingService=Y;exports.catchUniversal=Te;exports.clickOutside=Fe;exports.clientService=Ct;exports.communicationService=ue;exports.configurationService=tr;exports.constants=Qe;exports.dataService=T;exports.debounce=Gn;exports.default=fi;exports.documentsService=er;exports.equipmentService=cr;exports.fileService=Dn;exports.getCellValue=Ut;exports.getNamesFromListConfig=ri;exports.historyService=Cn;exports.internationalizationService=Ln;exports.invitationService=Vn;exports.metadataService=Ke;exports.newImport=On;exports.openService=Bn;exports.parseError=ke;exports.prettifyValueByMetadata=$n;exports.prettyDate=Ze;exports.prettyDateWithTime=Gt;exports.prettyMoney=ii;exports.processWizardService=be;exports.ruleValidationService=Ye;exports.t=Z;exports.testTypes=En;exports.universalEntityRead=ze;exports.universalEntityUpdate=Ht;exports.useCommunication=Mn;exports.useCustomerState=Zn;exports.useFormAction=Kn;exports.useFormLabel=Yn;exports.useFormMetadata=Jn;exports.useFormRequest=Qn;exports.useFormRequestData=Xn;exports.useListActiveRow=si;exports.useListConfig=_n;exports.useListEntity=ci;exports.useListFilter=bn;exports.useListOrder=Rt;exports.useListProvide=Pt;exports.useListRead=$t;exports.useListSearch=Sn;exports.useListSelect=Tn;exports.useListState=Lt;exports.useLogger=Vt;exports.useManagerState=cn;exports.useSocket=et;exports.useTableRequest=vn;exports.useTableState=wn;exports.useWizard=sr;exports.utils=di;exports.viewService=Rn;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -6,7 +6,7 @@ import { openModal as Cn } from "jenesius-vue-modal";
6
6
  import { useRoute as _n, RouterLink as bn } from "vue-router";
7
7
  import Tn from "date-and-time";
8
8
  /*!
9
- * eservices-core v1.3.13
9
+ * eservices-core v1.3.14
10
10
  * (c) 2023 ESERVICES
11
11
  */
12
12
  function Sn(n, e) {
@@ -3380,6 +3380,7 @@ export {
3380
3380
  js as documentsService,
3381
3381
  Us as equipmentService,
3382
3382
  Ss as fileService,
3383
+ pr as getCellValue,
3383
3384
  Ks as getNamesFromListConfig,
3384
3385
  gs as historyService,
3385
3386
  bs as internationalizationService,
@@ -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}.head-cell[data-v-4e1d87c8]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-4e1d87c8]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-4e1d87c8]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-4e1d87c8]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-4e1d87c8]{transform:rotate(180deg)}.head-cell-resize[data-v-4e1d87c8]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-4e1d87c8]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-4e1d87c8]: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
- (function(f,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("jenesius-vue-form"),require("object-hash"),require("jenesius-vue-modal"),require("vue-router"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","object-hash","jenesius-vue-modal","vue-router","date-and-time"],s):(f=typeof globalThis<"u"?globalThis:f||self,s(f["eservices-core"]={},f.Vue,f.JenesiusVueForm,f.ObjectHash,f.JenesiusVueModal,f.VueRouter,f.DateAndTime))})(this,function(f,s,_,Zt,Qt,nt,en){"use strict";/*!
3
- * eservices-core v1.3.13
2
+ (function(f,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("jenesius-vue-form"),require("object-hash"),require("jenesius-vue-modal"),require("vue-router"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","object-hash","jenesius-vue-modal","vue-router","date-and-time"],s):(f=typeof globalThis<"u"?globalThis:f||self,s(f["eservices-core"]={},f.Vue,f.JenesiusVueForm,f.ObjectHash,f.JenesiusVueModal,f.VueRouter,f.DateAndTime))})(this,function(f,s,_,Qt,en,nt,tn){"use strict";/*!
3
+ * eservices-core v1.3.14
4
4
  * (c) 2023 ESERVICES
5
- */function tn(n,e){return!!n&&n===e||"password is not equal"}function rt(n){return Number(n.replace(/[^0-9.]/g,""))}function nn(n,e=null){let r=String(rt(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 rn={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:rt,prettyNumeric:nn,validPassword:tn},Symbol.toStringTag,{value:"Module"}))};function ee(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?ee(n[r],e.substr(t+1)):void 0}return n[e]}function ge(n,e){if(!n)return console.warn("Element is not provided.");function t(i,o){return i==o.target||i.contains(o.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function De(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const it=class b extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=b.ID++}static ParentFormNotFound(){return new b("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new b("Composite object name is undefined",e)}static EntityWithoutName(e){return new b("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new b(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new b("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new b("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new b(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return b.ApiNotAvailable()}static ApiError(e){return new b("Request error",e)}static ApiNotAvailable(){return new b(`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?b.ApiNotAvailable():new b(e||"Authorization Error",t)}static ApiResponseParseFailed(){return b.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new b("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new b(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new b("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new b("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new b(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new b(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new b(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new b(`Metadata for the ${e} is not currently available.`)}};it.ID=0;let F=it;const st="Please try again later or submit a feedback if problem doesn't go.";function ot(n){return typeof n=="string"?Be(n):sn(n)?Be(n.message):Be(st)}function sn(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function Be(n,e=[]){return{message:n,details:e}}class at{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const K=new class{constructor(){this.store=s.reactive([])}add(e,t,{children:r,timeout:i=10,click:o=()=>{}}={}){const u=new on(e,t,i,r||[],o);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.")}},ct=class Kt{constructor(e,t,r,i,o){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=o,this.id=Kt.cardId++}};ct.cardId=1;let on=ct;/*!
5
+ */function nn(n,e){return!!n&&n===e||"password is not equal"}function rt(n){return Number(n.replace(/[^0-9.]/g,""))}function rn(n,e=null){let r=String(rt(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 sn={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:rt,prettyNumeric:rn,validPassword:nn},Symbol.toStringTag,{value:"Module"}))};function ee(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?ee(n[r],e.substr(t+1)):void 0}return n[e]}function ge(n,e){if(!n)return console.warn("Element is not provided.");function t(i,o){return i==o.target||i.contains(o.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function De(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const it=class b extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=b.ID++}static ParentFormNotFound(){return new b("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new b("Composite object name is undefined",e)}static EntityWithoutName(e){return new b("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new b(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new b("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new b("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new b(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return b.ApiNotAvailable()}static ApiError(e){return new b("Request error",e)}static ApiNotAvailable(){return new b(`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?b.ApiNotAvailable():new b(e||"Authorization Error",t)}static ApiResponseParseFailed(){return b.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new b("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new b(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new b("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new b("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new b(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new b(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new b(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new b(`Metadata for the ${e} is not currently available.`)}};it.ID=0;let F=it;const st="Please try again later or submit a feedback if problem doesn't go.";function ot(n){return typeof n=="string"?Be(n):on(n)?Be(n.message):Be(st)}function on(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function Be(n,e=[]){return{message:n,details:e}}class at{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const K=new class{constructor(){this.store=s.reactive([])}add(e,t,{children:r,timeout:i=10,click:o=()=>{}}={}){const u=new an(e,t,i,r||[],o);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.")}},ct=class Yt{constructor(e,t,r,i,o){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=o,this.id=Yt.cardId++}};ct.cardId=1;let an=ct;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const lt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ut=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},dt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ft=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return lt.call(this,e,t)}emit(e,t){return ut.call(this,e,t)}off(e,t){return dt.call(this,e,t)}cleanEvents(){ft.call(this)}static on(e,t){return lt.call(I,e,t)}static emit(e,t){return ut.call(I,e,t)}static off(e,t){return dt.call(I,e,t)}static cleanEvents(){ft.call(I)}}I.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Ve=(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)},Me=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ye,we;const q=class P extends I{constructor(){super(...arguments),Ve(this,te,void 0),Ve(this,ye,"front"),this.organizations=[],Ve(this,we,!1)}set language(e){localStorage.setItem(P.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)||P.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(P.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){Me(this,te,e)}get router(){if(!me(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,te)}set type(e){Me(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Me(this,we,e),this.emit(P.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(P.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(P.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(P.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(P.CURRENT_CONTEXT_KEY,String(e)),this.emit(P.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(P.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",F.ApiNotAvailable().message)}}loadCustomerData(){return at.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))}};te=new WeakMap,ye=new WeakMap,we=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let pt=q;const C=new pt;function an(){const n=s.reactive({contextType:C.contextType,contextId:C.contextId,context:C.context});return C.onupdateContext(()=>{n.contextType=C.contextType,n.contextId=C.contextId,n.context=C.context}),n}function cn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return st}})}function y(n,e={}){return C.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=C.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw F.ApiNotAvailable()}).then(t=>cn(t).then(r=>{if(!t.ok)throw r;return r}))}class Ee{constructor(){}static parseNamesFromListConfig(e){let t=Ee.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}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 o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class ln{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 gt=new ln;function mt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ce(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=Ce(r)),e[i]=r,e},{})}function un(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 ne={Request:y,clickOutside:ge,getPropFromObject:ee,runPromiseQueue:De,GraphQL:Ee,firstChapterToLowerCase:mt,valuesToUpperCase:Ce,prettyMoney:un},dn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ee,Journal:gt,Request:y,clickOutside:ge,default:ne,firstChapterToLowerCase:mt,getPropFromObject:ee,runPromiseQueue:De,valuesToUpperCase:Ce},Symbol.toStringTag,{value:"Module"}));function yt(n,e=""){for(let t in n){if(typeof n[t]=="object"){yt(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 fn(n){for(let e in n)M[e]=n[e];n.styles&&yt(n.styles),gt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const hn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function pn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const gn="masterId",mn="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(pn(e))return t(e);e.forEach(t);function t(r){n.append(mn,r[0]),n.append(gn,r[1].toString())}}class v{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),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(([a,c="desc"])=>`@${a} ${c}`).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=v.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=v.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 _e(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 o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.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 o=new URLSearchParams;return _e(o,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${o.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 v.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})})}}var wt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},We=(n,e,t)=>(wt(n,e,"read from private field"),t?t.call(n):e.get(n)),Et=(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)},Ct=(n,e,t,r)=>(wt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,Se;const Ue=class Q extends I{constructor(e){super(),Et(this,re,[]),Et(this,Se,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){Ct(this,Se,e),this.emit(Q.EVENT_CHANGE_WAIT,e)}get wait(){return We(this,Se)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),v.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(Q.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){Ct(this,re,e),this.emit(Q.EVENT_DATA,this.array)}add(e){We(this,re).push(...e),this.emit(Q.EVENT_DATA,this.array)}get array(){return We(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=Q.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap,Se=new WeakMap,Ue.EVENT_DATA="LIST:DATA",Ue.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let _t=Ue;const z=Symbol("__ROW_INDEX__");let je=class extends _t{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(_.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};je.PROVIDE_NAME="table-controller";function yn(n){const e=s.reactive(n.array);s.provide(je.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(_t.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(_.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=_.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function wn(n,e){n.read=()=>v.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(_.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await v.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await v.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await v.removeById(t,r(i),0)}),n.emit(_.Form.EVENT_SAVE)}}const hi="",En=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Cn{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(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(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)},J=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ie,Te,Ne,se,oe,qe;const x="_______LIST_______ROW_______INDEX________NAME_______",ae=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,G(this,be,void 0),this.array=[],G(this,ie,[]),G(this,Te,[]),G(this,Ne,new Proxy({},{set:(t,r,i,o)=>(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)})),G(this,se,!1),G(this,oe,(...t)=>Promise),G(this,qe,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ie,e.config)}set config(e){J(this,ie,e.map(_.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,Te)}set order(e){J(this,Te,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,Ne)}set filters(e){At(B(this,Ne),e)}set wait(e){J(this,se,e),this.emit(_.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[x]===e)}indexByKey(e){return this.array.findIndex(t=>t[x]===e)}static getKey(e){return e[x]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,x)}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,[x]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,x)}set read(e){J(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,qe).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,[x]: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 o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};be=new WeakMap,ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,se=new WeakMap,oe=new WeakMap,qe=new WeakMap,ae.EVENT_DATA="list-data: update",ae.EVENT_CONFIG_UPDATE="list-config:update",ae.EVENT_ORDER_UPDATE="list-order:update",ae.EVENT_FILTERS_UPDATE="list-filters:update";let W=ae;function bt(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const h=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return h!==t&&!Number.isNaN(h)&&(r=0,t=h),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=v.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Tt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(W.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(_.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Nt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(W.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function _n(n){const e=s.reactive([...n.config]);return n.on(W.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function vt(n){const e=n.order||[],t=s.reactive(e);return n.on(W.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function Sn(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function At(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function bn(n){const e=s.reactive(_.utils.copyObject(n.filters));return n.on(W.EVENT_FILTERS_UPDATE,t=>{At(e,t),n.read()}),e}function Tn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(h=>h===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class Nn extends W{constructor(e){super(e),this.changes=[],this.save=vn.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function vn(){const n=this.changes.filter(e=>e.status==="active");return De(n.map(e=>{console.log("++")}))}function An(){const n=s.ref(null);function e(t){n.value=t&&Zt(t)}return{activeRow:n,activateRow:e}}const kn=Object.freeze(Object.defineProperty({__proto__:null,List:W,Table:Nn,useListOrder:vt,useListProvide:Nt,useListRead:bt,useListState:Tt,useTableActiveRow:An},Symbol.toStringTag,{value:"Module"}));class On extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await ze.get(e)}}const ce=new On;function In(n){const e=s.ref(ce.get(n));return ce.on(ce.EVENT_NEW,t=>{n===t.entityName&&(e.value=ce.get(n))}),e}function $n(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Ot().error("prettify value by metadata",n,t)}}class Ln{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let H={};function Y(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=_.utils.getPropFromObject((this==null?void 0:this.vocabulary)||H,n);if(typeof t=="string")return kt(t,e);const r=_.utils.getPropFromObject(H==null?void 0:H.root,n);return typeof r=="string"?kt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function kt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Y.setGlobalVocabulary=function(n){H=n},Y.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Y.bind({vocabulary:_.utils.getPropFromObject(H,e.toLowerCase())})},Y.setVocabulary=function(n){return typeof n=="string"&&(n=_.utils.getPropFromObject(H,n)),Y.bind({vocabulary:n})};const Pn=function(){let n=!1;const e=[];function t(){return n}function r(c,h){t()&&console[c](...h),e.push(h)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Ot(){return Pn}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw F.AuthServiceError(e.title,t)}static login(e){return y(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=M.applicationName,y(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const It=class pe{static async create(e){return y(pe.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(pe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${pe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${pe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};It.url="/close-api/communications";let le=It;class Fn{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function $t(n){return{...n,createdEntities:n.createdEntites}}const Lt=class Re{static async getStartConfig(e,t){return y([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then($t)}static async runStep(e,t,r,i,o){return y([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then($t)}};Lt.url="/close-api/views/process-wizard";let ve=Lt;class ze{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),y([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return y(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return y(`/open-api/metadata/${e}/list-fields/${t}`)}}class Rn{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(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Dn{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 Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class Bn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Pt{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 _e(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Ft=class Yt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Yt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Ft.EVENT_DATA="list-config:update";let Vn=Ft;class Mn extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return le.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return le.read(e).then(t=>t.length===0?le.create(e):t[0])}}function Wn(n){const e=_.Form.getParentForm();e?e.subscribe(n):console.warn(F.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>le.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function Un(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Un(r)){let i=function(o){var u;return((u=o.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($.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`},$.notEq=function(e,t){return`@${e} nq ${ue(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`},$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};function jn(n,e="images"){return`/static-folder/${e}/${n}`}function qn(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Gn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Jn(n,e){const t=s.ref(null);function r(){return n.name?ze.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=F.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",i.message)}):Promise.reject()}return n.on(_.Form.EVENT_READ,r),{metadata:t,update:r}}class Je extends Error{static UndefinedStatus(){return new Je("Status is undefined.")}}class xn extends Je{}function Hn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw xn.UndefinedStatus();const a=await Pt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:C.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?Qt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):K.add("error",c.message),new Error;return c}).then(c=>{c.message&&K.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Kn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(_.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Yn(n,e){const t=nt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.readById(n.name,r.value,{fields:e.fields})}).then(ne.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Xn(){const n=s.reactive({contextId:C.contextId,person:C.person,organizations:C.organizations,ready:C.ready,user:C.user}),e=s.computed(()=>{if(!C.ready||!C.person)return null;const r=n.contextId;return C.person.id===r?C.person:C.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return C.onupdateContext(r=>{n.contextId=r}),C.onupdateData(()=>{n.person=C.person,n.organizations=C.organizations,n.user=C.user}),C.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function Zn(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.readById(n.name,i.id,{fields:i.fields})}).then(ne.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=ot(o);throw K.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=ot(o);throw K.add("error",u.message),u})},n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class Qn{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(o=>o.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]):F.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})})}}class er{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return y(i)}}function tr(n){return n.statusName==="Completed"}function nr(n){return n.statusName==="FinalStepWithConfirmation"}function rr(n){return n.statusName==="ValidationError"}function ir(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(w=>w.name===u)||null}function h(){var w;return u?((w=o.find(T=>T.name===u))==null?void 0:w.fields)||[]:[]}function l(w){if(c(),rr(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||sr(h(),t.presets)))return S(t.presets||{});tr(w)&&t.onCompleted(w),nr(w)&&t.onConfirmation(w)}async function d(){try{await p(),await E()}catch(w){const{message:T}=Ie(w);Le.add("error",T)}}function p(){return i.wait="Loading process information.",ve.getStartConfig(e,n).then(w=>{o=w.steps.map(T=>({label:T.title,name:T.stepName,number:T.number,fields:T.frontendEntity.objectTypes.reduce((k,O)=>(O.properties.forEach(R=>{k.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),k),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const T=Ie(w);Le.add("error",T.message)}function E(){return i.wait="Starting process",ve.startProcess(e,n).then(g).then(l).catch(m).finally(()=>{i.wait=null})}function S(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ve.runStep(e,n,u,r,w).then(g).then(l).catch(m).finally(()=>{i.wait=!1}))}return{initialize:d,state:i,currentStepConfig:s.readonly(a),next:S}}function sr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!_.utils.getPropFromObject(e,r.name))return!1}return!0}const or="close-api/proxy/Equipment/Search";class ar{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${or}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const cr={class:"widget-table__head"},lr={class:"widget-table__head-label margin_0 text_overflow"},ur=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",cr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",lr,s.toDisplayString(r.label),1)]))),128))]))}}),pi="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},dr=U(ur,[["__scopeId","data-v-25198f4a"]]);function fr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function hr(n,e){const t=fr(n);let r=t?_.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function pr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xe={exports:{}},He,Rt;function gr(){if(Rt)return He;Rt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;He=function(l,d){d=d||{};var p=typeof l;if(p==="string"&&l.length>0)return u(l);if(p==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var p=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return p*o;case"weeks":case"week":case"w":return p*i;case"days":case"day":case"d":return p*r;case"hours":case"hour":case"hrs":case"hr":case"h":return p*t;case"minutes":case"minute":case"mins":case"min":case"m":return p*e;case"seconds":case"second":case"secs":case"sec":case"s":return p*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=t?Math.round(l/t)+"h":d>=e?Math.round(l/e)+"m":d>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?h(l,d,r,"day"):d>=t?h(l,d,t,"hour"):d>=e?h(l,d,e,"minute"):d>=n?h(l,d,n,"second"):l+" ms"}function h(l,d,p,g){var m=d>=p*1.5;return Math.round(l/p)+" "+g+(m?"s":"")}return He}function mr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=gr(),t.destroy=h,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let d=0;for(let p=0;p<l.length;p++)d=(d<<5)-d+l.charCodeAt(p),d|=0;return t.colors[Math.abs(d)%t.colors.length]}t.selectColor=e;function t(l){let d,p=null,g,m;function E(...S){if(!E.enabled)return;const w=E,T=Number(new Date),k=T-(d||T);w.diff=k,w.prev=d,w.curr=T,d=T,S[0]=t.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let O=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(j,N)=>{if(j==="%%")return"%";O++;const de=t.formatters[N];if(typeof de=="function"){const Pe=S[O];j=de.call(w,Pe),S.splice(O,1),O--}return j}),t.formatArgs.call(w,S),(w.log||t.log).apply(w,S)}return E.namespace=l,E.useColors=t.useColors(),E.color=t.selectColor(l),E.extend=r,E.destroy=t.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(l)),m),set:S=>{p=S}}),typeof t.init=="function"&&t.init(E),E}function r(l,d){const p=t(this.namespace+(typeof d>"u"?":":d)+l);return p.log=this.log,p}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let d;const p=(typeof l=="string"?l:"").split(/[\s,]+/),g=p.length;for(d=0;d<g;d++)p[d]&&(l=p[d].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(d=>"-"+d)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let d,p;for(d=0,p=t.skips.length;d<p;d++)if(t.skips[d].test(l))return!1;for(d=0,p=t.names.length;d<p;d++)if(t.names[d].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var yr=mr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;c.splice(1,0,h,"color: inherit");let l=0,d=0;c[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(l++,p==="%c"&&(d=l))}),c.splice(d,0,h)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=yr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(xe,xe.exports);var wr=xe.exports;const Dt=pr(wr);function Bt(n){return["eservices-core",n].join(":")}function Vt(n){return Ke(n,"YYYY/MM/DD HH:mm:ss")}function Ke(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return en.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const gi="",ke=U({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()=>s.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),Er=Dt(Bt("setup-list-row"));function Cr(n,e){const t=n.config.map(r=>_r(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function _r(n,e,t){const r=e.values;let i=hr(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],h=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ke(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Vt(typeof i=="string"?i:null);break}case"multi-select":{h.push(s.h(_.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Mt.bind(null,t,!0));break}case"select":{h.push(s.h(_.FormField,{type:"single-radio",modelValue:e.selected})),u(Mt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const d=s.h(nt.RouterLink,{to:l});h.push(d),a("widget-table-cell_link")}}catch(l){Er("Can't add router link",l)}return n.href&&(h.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(s.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,h)),c}function Mt(n,e){n.emit("select",e)}function Wt(n,e){return()=>{try{return Cr(n,e)}catch(t){return console.warn(t),null}}}const Sr={props:{values:Object,config:Object,selected:Boolean},setup:Wt},br=["colspan"],Ut=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,br)],512))}}),Ye={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Tr={class:"widget-table"},jt="update:selectedRows",Nr=s.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=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(jt,t.selectedRows.includes(a)?[]:[a]);const h=[...t.selectedRows],l=h.indexOf(a);return l===-1?h.push(a):h.splice(l,1),e(jt,h)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Tr,[s.createVNode(dr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(Sr,{config:a.config,values:h,selected:a.selectedRows.includes(h),onSelect:d=>o(h,d),class:s.normalizeClass(a.classCallback?a.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===h?(s.openBlock(),s.createBlock(Ut,{key:0,component:i.value,"row-length":a.config.length,values:h,onClose:c[0]||(c[0]=d=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Ye).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(Ut,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),vr=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),yi="",Oe=U(vr,[["__scopeId","data-v-0ef9ae88"]]),Ar={class:"widget-button"},kr=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",Ar,[e.wait?(s.openBlock(),s.createBlock(Oe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),wi="",Or=U(kr,[["__scopeId","data-v-450dc564"]]),Ir={class:"widget-multi-button-wrap position_relative cursor_pointer"},$r={class:"widget-multi-button-body grid"},Lr=["onClick"],Pr={class:"widget-multi-button-side-wrap"},Fr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.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 o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",Ir,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",$r,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,h)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Lr))),128))]),s.createElementVNode("div",Pr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}}),Ei="",Rr=U(Fr,[["__scopeId","data-v-a8d711d1"]]),Dr={class:"widget-loader flex flex-align_center gap_10 padding_15"},Br={class:"text_md"},Vr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Dr,[s.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Br,s.toDisplayString(e.label),1)]))}}),Mr=["alt","src"],Wr=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Mr))}}),Ur={props:{config:Array,values:Object,selected:Boolean},setup:Wt},Ci="",jr=U(Ur,[["__scopeId","data-v-344a8cc1"]]),qr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),zr={class:"head-cell"},Gr=qr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Jr=s.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)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",zr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(_.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.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]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(ke),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Gr])]))}}),_i="",xr=U(Jr,[["__scopeId","data-v-4e1d87c8"]]),Hr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(g,m){let E=-1;do E++,m-=g[E];while(m>0&&E<g.length);return E}function h(g,m){let E=0;for(;m>0&&m>g[E]&&E<g.length;)m-=g[E],E++;return console.log(m,E),E>0?E:0}function l(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function d(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function p(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ht;function E(L){return L.screenX+T-R}const S=r.value,w=[...S.children].filter(L=>L.localName==="th"),T=((Ht=S.offsetParent)==null?void 0:Ht.scrollLeft)||0,k=w.map(L=>L.clientWidth),O=p(m.target),R=S.getBoundingClientRect().left,j=E(m),N=c(k,j),de=k.slice(0,N).reduce((L,D)=>L+D,0),Pe=j-de,et=S.offsetWidth,fe=w[N].clientWidth;if(t.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",k),console.log("max width",et),console.log("Start Position",j),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",Pe),console.groupEnd(),i.value.innerText=w[N].textContent||"",i.value.style.display="grid",i.value.style.width=fe+"px",i.value.style.cursor="grabbing",l(de),d(fe),document.addEventListener("pointermove",xt,{passive:!0}),document.addEventListener("pointerup",Jt);function Jt(L){if(console.group("END"),document.removeEventListener("pointermove",xt),document.removeEventListener("pointerup",Jt),O&&(t.config[N].width=i.value.style.width,t.config[N].minWidth=i.value.style.width,t.config[N].maxWidth=i.value.style.width,o(t.config)),!O){const D=L.screenX+T-R;console.log("ENP Position",D);const Fe=h(k,D);if(console.log(N,"->",Fe),Fe!==N){const he=t.config[N],tt=t.config;tt.splice(N,1),tt.splice(Fe,0,he),o(tt)}else{const he=t.config[N].name;u(he)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function xt(L){if(O){const he=E(L)-j+fe;d(he);return}let D=L.screenX+T-R-Pe;D<0&&(D=0),D+fe>et&&(D=et-fe),l(D)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,h==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,h)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,d)=>(s.openBlock(),s.createBlock(xr,s.mergeProps({key:l},l,{onOrder:p=>u(l.name),onSelect:h[0]||(h[0]=p=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Si="",Kr=U(Hr,[["__scopeId","data-v-ccffc6bd"]]),Yr={class:"widget-list"},Xr={class:"widget-list-body position_relative"},Zr=50,Qr=s.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(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const h=[...t.selectedRows],l=h.indexOf(a);l===-1?h.push(a):h==null||h.splice(l,1),o(h)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Zr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Yr,[s.createElementVNode("thead",null,[s.createVNode(Kr,{onSelect:c[0]||(c[0]=h=>i()),"onUpdate:order":c[1]||(c[1]=h=>e("update:order",h)),"onUpdate:config":c[2]||(c[2]=h=>e("update:config",h)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Xr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>{var d;return s.openBlock(),s.createBlock(jr,{key:l,class:"widget-list-row",values:h,config:a.config,selected:(d=a.selectedRows)==null?void 0:d.includes(h),onSelect:p=>r(h,p)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ei(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=s.reactive({wait:!1,call:e});return t}function Ie(n){return typeof n=="string"?Xe(n):ti(n)?Xe(n.message):Xe(Ye.DEFAULT_ERROR_MESSAGE)}function ti(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Xe(n){return{message:n}}function $e(n="error"){return function(e){const{message:t}=Ie(e);Le.add(n,t)}}function Ze(n,e){return Qe().emit("entity:read",{...e,entity:n})}function qt(n,e){return Qe().emit("entity:update",{...e,entity:n})}function ni(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function ri(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 ii(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Z=Dt(Bt("use-socket"));function Qe(){return si}const si=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(p){const g=[...t.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",t.size,p.event,p.requestId),g.forEach(m=>{const E=p.requestId;(m.requestId&&m.requestId===E||!m.requestId&&m.event===p.event)&&(Z("Find appropriated handler: %d, event: %s",n,m.event),m.callback(p.data,p),m.once&&(t.delete(m),Z("Handler was removed by *once* params was passed. %o",m)))})}function u(p){console.log(`%cInitializing sockets: %c${p}`,"color: purple","color: black"),e=new WebSocket(p),e.onclose=function(g){Z("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(p))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{a(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!zt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}o(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function a(p){e.send(p)}function c(p,g){t.add({event:p,callback:g})}function h(p,g){t.add({event:p,callback:g,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function d(p,g,m){const E=++n,S=JSON.stringify({requestId:E,event:p,data:g,contextId:C.contextId,url:window.location.href});return l()?a(S):(r.add(S),Z("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,T)=>{t.add({event:p,requestId:E,once:!0,callback:(k,O)=>{if(Z("Promise was resolve with next data:",k),oi(O))return void T(k);m&&m(k,O),w(k)}})})}return{get socket(){return e},on:c,once:h,emit:d,initialization:u,getDevInfo:i}}(),oi=n=>!!zt(n)&&n.event==="request-error",zt=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ai(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){return i.value?Promise.reject("The process has already started."):(i.value=!0,typeof e.limit!="number"&&(e.limit=100),e.offset=r,Ze(n,e).then(d=>(r+=d.length,d)).finally(()=>{i.value=!1}))}function u(d,p){var m;const g=d.Version||((m=t.find(E=>E.Id===p))==null?void 0:m.Version);if(g===void 0)throw new Error("Object without version.");return g}function a(d,p){const g=t.findIndex(m=>m.Id===d);if(g===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(g,1,p)}async function c(d,p){try{const g=u(p,d);delete p.Version,await qt(n,{id:d,values:p,version:g});const m=await Ze(n,{fields:e.fields||"",id:d});a(d,m)}catch(g){$e()(g)}}async function h(){try{const d=await o();t.push(...d)}catch(d){$e()(d)}}async function l(){try{r=0;const d=await o();t.splice(0,t.length,...d)}catch(d){$e()(d)}}return{array:t,updateById:c,next:h,reload:l,wait:i}}const Le=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=ci(r),o=new li(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function ci(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 Gt=class Xt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Xt.cardId++}};Gt.cardId=1;let li=Gt;const ui={clickOutside:ge,valuesToUpperCase:Ce,Filter:$,staticLink:jn,groupArrayByField:qn,uuidv4:zn,Request:y},di={usage:rn,utils:dn,config:fn,types:hn};f.ApplicationManager=pt,f.Communication=Mn,f.ComputedMetadata=In,f.CoreError=F,f.Filter=$,f.List=W,f.ListConfig=Vn,f.Manager=C,f.MetadataStore=ce,f.NotificationSystem=Le,f.Request=y,f.Table=je,f.WidgetButton=Or,f.WidgetIcon=ke,f.WidgetImage=Wr,f.WidgetList=Qr,f.WidgetLoader=Vr,f.WidgetMultiButton=Rr,f.WidgetSpinner=Oe,f.WidgetTable=Nr,f.actionService=Pt,f.asyncProcess=ei,f.authService=A,f.billingService=X,f.catchUniversal=$e,f.clickOutside=ge,f.clientService=at,f.communicationService=le,f.configurationService=er,f.constants=Ye,f.dataService=v,f.debounce=Gn,f.default=di,f.documentsService=Qn,f.equipmentService=ar,f.fileService=Rn,f.getNamesFromListConfig=ni,f.historyService=Cn,f.internationalizationService=Ln,f.invitationService=Dn,f.metadataService=ze,f.newImport=kn,f.openService=Bn,f.parseError=Ie,f.prettifyValueByMetadata=$n,f.prettyDate=Ke,f.prettyDateWithTime=Vt,f.prettyMoney=ri,f.processWizardService=ve,f.ruleValidationService=Ge,f.t=Y,f.testTypes=En,f.universalEntityRead=Ze,f.universalEntityUpdate=qt,f.useCommunication=Wn,f.useCustomerState=Xn,f.useFormAction=Hn,f.useFormLabel=Kn,f.useFormMetadata=Jn,f.useFormRequest=Zn,f.useFormRequestData=Yn,f.useListActiveRow=ii,f.useListConfig=_n,f.useListEntity=ai,f.useListFilter=bn,f.useListOrder=vt,f.useListProvide=Nt,f.useListRead=bt,f.useListSearch=Sn,f.useListSelect=Tn,f.useListState=Tt,f.useLogger=Ot,f.useManagerState=an,f.useSocket=Qe,f.useTableRequest=wn,f.useTableState=yn,f.useWizard=ir,f.utils=ui,f.viewService=Fn,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */const lt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ut=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},dt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ft=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return lt.call(this,e,t)}emit(e,t){return ut.call(this,e,t)}off(e,t){return dt.call(this,e,t)}cleanEvents(){ft.call(this)}static on(e,t){return lt.call(I,e,t)}static emit(e,t){return ut.call(I,e,t)}static off(e,t){return dt.call(I,e,t)}static cleanEvents(){ft.call(I)}}I.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Ve=(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)},Me=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ye,we;const q=class P extends I{constructor(){super(...arguments),Ve(this,te,void 0),Ve(this,ye,"front"),this.organizations=[],Ve(this,we,!1)}set language(e){localStorage.setItem(P.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)||P.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(P.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){Me(this,te,e)}get router(){if(!me(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,te)}set type(e){Me(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Me(this,we,e),this.emit(P.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(P.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(P.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(P.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(P.CURRENT_CONTEXT_KEY,String(e)),this.emit(P.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(P.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",F.ApiNotAvailable().message)}}loadCustomerData(){return at.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))}};te=new WeakMap,ye=new WeakMap,we=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let pt=q;const C=new pt;function cn(){const n=s.reactive({contextType:C.contextType,contextId:C.contextId,context:C.context});return C.onupdateContext(()=>{n.contextType=C.contextType,n.contextId=C.contextId,n.context=C.context}),n}function ln(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return st}})}function y(n,e={}){return C.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=C.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw F.ApiNotAvailable()}).then(t=>ln(t).then(r=>{if(!t.ok)throw r;return r}))}class Ee{constructor(){}static parseNamesFromListConfig(e){let t=Ee.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}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 o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class un{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 gt=new un;function mt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ce(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=Ce(r)),e[i]=r,e},{})}function dn(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 ne={Request:y,clickOutside:ge,getPropFromObject:ee,runPromiseQueue:De,GraphQL:Ee,firstChapterToLowerCase:mt,valuesToUpperCase:Ce,prettyMoney:dn},fn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ee,Journal:gt,Request:y,clickOutside:ge,default:ne,firstChapterToLowerCase:mt,getPropFromObject:ee,runPromiseQueue:De,valuesToUpperCase:Ce},Symbol.toStringTag,{value:"Module"}));function yt(n,e=""){for(let t in n){if(typeof n[t]=="object"){yt(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 hn(n){for(let e in n)M[e]=n[e];n.styles&&yt(n.styles),gt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const pn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const mn="masterId",yn="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(gn(e))return t(e);e.forEach(t);function t(r){n.append(yn,r[0]),n.append(mn,r[1].toString())}}class v{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),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(([a,c="desc"])=>`@${a} ${c}`).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=v.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=v.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 _e(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 o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.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 o=new URLSearchParams;return _e(o,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${o.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 v.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})})}}var wt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},We=(n,e,t)=>(wt(n,e,"read from private field"),t?t.call(n):e.get(n)),Et=(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)},Ct=(n,e,t,r)=>(wt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,Se;const Ue=class Q extends I{constructor(e){super(),Et(this,re,[]),Et(this,Se,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){Ct(this,Se,e),this.emit(Q.EVENT_CHANGE_WAIT,e)}get wait(){return We(this,Se)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),v.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(Q.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){Ct(this,re,e),this.emit(Q.EVENT_DATA,this.array)}add(e){We(this,re).push(...e),this.emit(Q.EVENT_DATA,this.array)}get array(){return We(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=Q.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap,Se=new WeakMap,Ue.EVENT_DATA="LIST:DATA",Ue.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let _t=Ue;const z=Symbol("__ROW_INDEX__");let je=class extends _t{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(_.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};je.PROVIDE_NAME="table-controller";function wn(n){const e=s.reactive(n.array);s.provide(je.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(_t.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(_.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=_.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function En(n,e){n.read=()=>v.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(_.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await v.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await v.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await v.removeById(t,r(i),0)}),n.emit(_.Form.EVENT_SAVE)}}const hi="",Cn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class _n{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(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(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)},J=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ie,Te,Ne,se,oe,qe;const H="_______LIST_______ROW_______INDEX________NAME_______",ae=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,G(this,be,void 0),this.array=[],G(this,ie,[]),G(this,Te,[]),G(this,Ne,new Proxy({},{set:(t,r,i,o)=>(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)})),G(this,se,!1),G(this,oe,(...t)=>Promise),G(this,qe,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ie,e.config)}set config(e){J(this,ie,e.map(_.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,Te)}set order(e){J(this,Te,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,Ne)}set filters(e){At(B(this,Ne),e)}set wait(e){J(this,se,e),this.emit(_.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[H]===e)}indexByKey(e){return this.array.findIndex(t=>t[H]===e)}static getKey(e){return e[H]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,H)}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,[H]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,H)}set read(e){J(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,qe).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,[H]: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 o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};be=new WeakMap,ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,se=new WeakMap,oe=new WeakMap,qe=new WeakMap,ae.EVENT_DATA="list-data: update",ae.EVENT_CONFIG_UPDATE="list-config:update",ae.EVENT_ORDER_UPDATE="list-order:update",ae.EVENT_FILTERS_UPDATE="list-filters:update";let W=ae;function bt(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const h=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return h!==t&&!Number.isNaN(h)&&(r=0,t=h),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=v.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Tt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(W.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(_.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Nt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(W.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function Sn(n){const e=s.reactive([...n.config]);return n.on(W.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function vt(n){const e=n.order||[],t=s.reactive(e);return n.on(W.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function bn(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function At(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Tn(n){const e=s.reactive(_.utils.copyObject(n.filters));return n.on(W.EVENT_FILTERS_UPDATE,t=>{At(e,t),n.read()}),e}function Nn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(h=>h===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class vn extends W{constructor(e){super(e),this.changes=[],this.save=An.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function An(){const n=this.changes.filter(e=>e.status==="active");return De(n.map(e=>{console.log("++")}))}function kn(){const n=s.ref(null);function e(t){n.value=t&&Qt(t)}return{activeRow:n,activateRow:e}}const On=Object.freeze(Object.defineProperty({__proto__:null,List:W,Table:vn,useListOrder:vt,useListProvide:Nt,useListRead:bt,useListState:Tt,useTableActiveRow:kn},Symbol.toStringTag,{value:"Module"}));class In extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await ze.get(e)}}const ce=new In;function $n(n){const e=s.ref(ce.get(n));return ce.on(ce.EVENT_NEW,t=>{n===t.entityName&&(e.value=ce.get(n))}),e}function Ln(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Ot().error("prettify value by metadata",n,t)}}class Pn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let x={};function Y(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=_.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return kt(t,e);const r=_.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?kt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function kt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Y.setGlobalVocabulary=function(n){x=n},Y.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Y.bind({vocabulary:_.utils.getPropFromObject(x,e.toLowerCase())})},Y.setVocabulary=function(n){return typeof n=="string"&&(n=_.utils.getPropFromObject(x,n)),Y.bind({vocabulary:n})};const Fn=function(){let n=!1;const e=[];function t(){return n}function r(c,h){t()&&console[c](...h),e.push(h)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Ot(){return Fn}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw F.AuthServiceError(e.title,t)}static login(e){return y(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=M.applicationName,y(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const It=class pe{static async create(e){return y(pe.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(pe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${pe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${pe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};It.url="/close-api/communications";let le=It;class Rn{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function $t(n){return{...n,createdEntities:n.createdEntites}}const Lt=class Re{static async getStartConfig(e,t){return y([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then($t)}static async runStep(e,t,r,i,o){return y([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then($t)}};Lt.url="/close-api/views/process-wizard";let ve=Lt;class ze{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),y([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return y(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return y(`/open-api/metadata/${e}/list-fields/${t}`)}}class Dn{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(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Bn{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 Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class Vn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Pt{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 _e(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Ft=class Xt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Xt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Ft.EVENT_DATA="list-config:update";let Mn=Ft;class Wn extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return le.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return le.read(e).then(t=>t.length===0?le.create(e):t[0])}}function Un(n){const e=_.Form.getParentForm();e?e.subscribe(n):console.warn(F.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>le.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function jn(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(jn(r)){let i=function(o){var u;return((u=o.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($.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`},$.notEq=function(e,t){return`@${e} nq ${ue(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`},$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};function qn(n,e="images"){return`/static-folder/${e}/${n}`}function zn(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function Gn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Hn(n,e){const t=s.ref(null);function r(){return n.name?ze.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=F.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",i.message)}):Promise.reject()}return n.on(_.Form.EVENT_READ,r),{metadata:t,update:r}}class Je extends Error{static UndefinedStatus(){return new Je("Status is undefined.")}}class xn extends Je{}function Kn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw xn.UndefinedStatus();const a=await Pt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:C.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?en.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):K.add("error",c.message),new Error;return c}).then(c=>{c.message&&K.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Yn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(_.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Xn(n,e){const t=nt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.readById(n.name,r.value,{fields:e.fields})}).then(ne.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Zn(){const n=s.reactive({contextId:C.contextId,person:C.person,organizations:C.organizations,ready:C.ready,user:C.user}),e=s.computed(()=>{if(!C.ready||!C.person)return null;const r=n.contextId;return C.person.id===r?C.person:C.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return C.onupdateContext(r=>{n.contextId=r}),C.onupdateData(()=>{n.person=C.person,n.organizations=C.organizations,n.user=C.user}),C.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function Qn(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.readById(n.name,i.id,{fields:i.fields})}).then(ne.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=ot(o);throw K.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=ot(o);throw K.add("error",u.message),u})},n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class er{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(o=>o.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]):F.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})})}}class tr{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return y(i)}}function nr(n){return n.statusName==="Completed"}function rr(n){return n.statusName==="FinalStepWithConfirmation"}function ir(n){return n.statusName==="ValidationError"}function sr(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(w=>w.name===u)||null}function h(){var w;return u?((w=o.find(T=>T.name===u))==null?void 0:w.fields)||[]:[]}function l(w){if(c(),ir(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||or(h(),t.presets)))return S(t.presets||{});nr(w)&&t.onCompleted(w),rr(w)&&t.onConfirmation(w)}async function d(){try{await p(),await E()}catch(w){const{message:T}=Ie(w);Le.add("error",T)}}function p(){return i.wait="Loading process information.",ve.getStartConfig(e,n).then(w=>{o=w.steps.map(T=>({label:T.title,name:T.stepName,number:T.number,fields:T.frontendEntity.objectTypes.reduce((k,O)=>(O.properties.forEach(R=>{k.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),k),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const T=Ie(w);Le.add("error",T.message)}function E(){return i.wait="Starting process",ve.startProcess(e,n).then(g).then(l).catch(m).finally(()=>{i.wait=null})}function S(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ve.runStep(e,n,u,r,w).then(g).then(l).catch(m).finally(()=>{i.wait=!1}))}return{initialize:d,state:i,currentStepConfig:s.readonly(a),next:S}}function or(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!_.utils.getPropFromObject(e,r.name))return!1}return!0}const ar="close-api/proxy/Equipment/Search";class cr{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${ar}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const lr={class:"widget-table__head"},ur={class:"widget-table__head-label margin_0 text_overflow"},dr=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",lr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",ur,s.toDisplayString(r.label),1)]))),128))]))}}),pi="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},fr=U(dr,[["__scopeId","data-v-25198f4a"]]);function hr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Rt(n,e){const t=hr(n);let r=t?_.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function pr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var He={exports:{}},xe,Dt;function gr(){if(Dt)return xe;Dt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;xe=function(l,d){d=d||{};var p=typeof l;if(p==="string"&&l.length>0)return u(l);if(p==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var p=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return p*o;case"weeks":case"week":case"w":return p*i;case"days":case"day":case"d":return p*r;case"hours":case"hour":case"hrs":case"hr":case"h":return p*t;case"minutes":case"minute":case"mins":case"min":case"m":return p*e;case"seconds":case"second":case"secs":case"sec":case"s":return p*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=t?Math.round(l/t)+"h":d>=e?Math.round(l/e)+"m":d>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?h(l,d,r,"day"):d>=t?h(l,d,t,"hour"):d>=e?h(l,d,e,"minute"):d>=n?h(l,d,n,"second"):l+" ms"}function h(l,d,p,g){var m=d>=p*1.5;return Math.round(l/p)+" "+g+(m?"s":"")}return xe}function mr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=gr(),t.destroy=h,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let d=0;for(let p=0;p<l.length;p++)d=(d<<5)-d+l.charCodeAt(p),d|=0;return t.colors[Math.abs(d)%t.colors.length]}t.selectColor=e;function t(l){let d,p=null,g,m;function E(...S){if(!E.enabled)return;const w=E,T=Number(new Date),k=T-(d||T);w.diff=k,w.prev=d,w.curr=T,d=T,S[0]=t.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let O=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(j,N)=>{if(j==="%%")return"%";O++;const de=t.formatters[N];if(typeof de=="function"){const Pe=S[O];j=de.call(w,Pe),S.splice(O,1),O--}return j}),t.formatArgs.call(w,S),(w.log||t.log).apply(w,S)}return E.namespace=l,E.useColors=t.useColors(),E.color=t.selectColor(l),E.extend=r,E.destroy=t.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(l)),m),set:S=>{p=S}}),typeof t.init=="function"&&t.init(E),E}function r(l,d){const p=t(this.namespace+(typeof d>"u"?":":d)+l);return p.log=this.log,p}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let d;const p=(typeof l=="string"?l:"").split(/[\s,]+/),g=p.length;for(d=0;d<g;d++)p[d]&&(l=p[d].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(d=>"-"+d)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let d,p;for(d=0,p=t.skips.length;d<p;d++)if(t.skips[d].test(l))return!1;for(d=0,p=t.names.length;d<p;d++)if(t.names[d].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var yr=mr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;c.splice(1,0,h,"color: inherit");let l=0,d=0;c[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(l++,p==="%c"&&(d=l))}),c.splice(d,0,h)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=yr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(He,He.exports);var wr=He.exports;const Bt=pr(wr);function Vt(n){return["eservices-core",n].join(":")}function Mt(n){return Ke(n,"YYYY/MM/DD HH:mm:ss")}function Ke(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return tn.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const gi="",ke=U({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()=>s.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),Er=Bt(Vt("setup-list-row"));function Cr(n,e){const t=n.config.map(r=>_r(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function _r(n,e,t){const r=e.values;let i=Rt(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],h=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ke(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Mt(typeof i=="string"?i:null);break}case"multi-select":{h.push(s.h(_.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Wt.bind(null,t,!0));break}case"select":{h.push(s.h(_.FormField,{type:"single-radio",modelValue:e.selected})),u(Wt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const d=s.h(nt.RouterLink,{to:l});h.push(d),a("widget-table-cell_link")}}catch(l){Er("Can't add router link",l)}return n.href&&(h.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(s.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,h)),c}function Wt(n,e){n.emit("select",e)}function Ut(n,e){return()=>{try{return Cr(n,e)}catch(t){return console.warn(t),null}}}const Sr={props:{values:Object,config:Object,selected:Boolean},setup:Ut},br=["colspan"],jt=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,br)],512))}}),Ye={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Tr={class:"widget-table"},qt="update:selectedRows",Nr=s.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=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(qt,t.selectedRows.includes(a)?[]:[a]);const h=[...t.selectedRows],l=h.indexOf(a);return l===-1?h.push(a):h.splice(l,1),e(qt,h)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Tr,[s.createVNode(fr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(Sr,{config:a.config,values:h,selected:a.selectedRows.includes(h),onSelect:d=>o(h,d),class:s.normalizeClass(a.classCallback?a.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===h?(s.openBlock(),s.createBlock(jt,{key:0,component:i.value,"row-length":a.config.length,values:h,onClose:c[0]||(c[0]=d=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Ye).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(jt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),vr=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),yi="",Oe=U(vr,[["__scopeId","data-v-0ef9ae88"]]),Ar={class:"widget-button"},kr=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",Ar,[e.wait?(s.openBlock(),s.createBlock(Oe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),wi="",Or=U(kr,[["__scopeId","data-v-450dc564"]]),Ir={class:"widget-multi-button-wrap position_relative cursor_pointer"},$r={class:"widget-multi-button-body grid"},Lr=["onClick"],Pr={class:"widget-multi-button-side-wrap"},Fr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.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 o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",Ir,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",$r,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,h)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Lr))),128))]),s.createElementVNode("div",Pr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}}),Ei="",Rr=U(Fr,[["__scopeId","data-v-a8d711d1"]]),Dr={class:"widget-loader flex flex-align_center gap_10 padding_15"},Br={class:"text_md"},Vr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Dr,[s.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Br,s.toDisplayString(e.label),1)]))}}),Mr=["alt","src"],Wr=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Mr))}}),Ur={props:{config:Array,values:Object,selected:Boolean},setup:Ut},Ci="",jr=U(Ur,[["__scopeId","data-v-344a8cc1"]]),qr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),zr={class:"head-cell"},Gr=qr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Jr=s.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)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",zr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(_.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.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]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(ke),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Gr])]))}}),_i="",Hr=U(Jr,[["__scopeId","data-v-4e1d87c8"]]),xr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(g,m){let E=-1;do E++,m-=g[E];while(m>0&&E<g.length);return E}function h(g,m){let E=0;for(;m>0&&m>g[E]&&E<g.length;)m-=g[E],E++;return console.log(m,E),E>0?E:0}function l(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function d(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function p(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Kt;function E(L){return L.screenX+T-R}const S=r.value,w=[...S.children].filter(L=>L.localName==="th"),T=((Kt=S.offsetParent)==null?void 0:Kt.scrollLeft)||0,k=w.map(L=>L.clientWidth),O=p(m.target),R=S.getBoundingClientRect().left,j=E(m),N=c(k,j),de=k.slice(0,N).reduce((L,D)=>L+D,0),Pe=j-de,et=S.offsetWidth,fe=w[N].clientWidth;if(t.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",k),console.log("max width",et),console.log("Start Position",j),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",Pe),console.groupEnd(),i.value.innerText=w[N].textContent||"",i.value.style.display="grid",i.value.style.width=fe+"px",i.value.style.cursor="grabbing",l(de),d(fe),document.addEventListener("pointermove",xt,{passive:!0}),document.addEventListener("pointerup",Ht);function Ht(L){if(console.group("END"),document.removeEventListener("pointermove",xt),document.removeEventListener("pointerup",Ht),O&&(t.config[N].width=i.value.style.width,t.config[N].minWidth=i.value.style.width,t.config[N].maxWidth=i.value.style.width,o(t.config)),!O){const D=L.screenX+T-R;console.log("ENP Position",D);const Fe=h(k,D);if(console.log(N,"->",Fe),Fe!==N){const he=t.config[N],tt=t.config;tt.splice(N,1),tt.splice(Fe,0,he),o(tt)}else{const he=t.config[N].name;u(he)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function xt(L){if(O){const he=E(L)-j+fe;d(he);return}let D=L.screenX+T-R-Pe;D<0&&(D=0),D+fe>et&&(D=et-fe),l(D)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,h==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,h)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,d)=>(s.openBlock(),s.createBlock(Hr,s.mergeProps({key:l},l,{onOrder:p=>u(l.name),onSelect:h[0]||(h[0]=p=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Si="",Kr=U(xr,[["__scopeId","data-v-ccffc6bd"]]),Yr={class:"widget-list"},Xr={class:"widget-list-body position_relative"},Zr=50,Qr=s.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(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const h=[...t.selectedRows],l=h.indexOf(a);l===-1?h.push(a):h==null||h.splice(l,1),o(h)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Zr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Yr,[s.createElementVNode("thead",null,[s.createVNode(Kr,{onSelect:c[0]||(c[0]=h=>i()),"onUpdate:order":c[1]||(c[1]=h=>e("update:order",h)),"onUpdate:config":c[2]||(c[2]=h=>e("update:config",h)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Xr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>{var d;return s.openBlock(),s.createBlock(jr,{key:l,class:"widget-list-row",values:h,config:a.config,selected:(d=a.selectedRows)==null?void 0:d.includes(h),onSelect:p=>r(h,p)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ei(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=s.reactive({wait:!1,call:e});return t}function Ie(n){return typeof n=="string"?Xe(n):ti(n)?Xe(n.message):Xe(Ye.DEFAULT_ERROR_MESSAGE)}function ti(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Xe(n){return{message:n}}function $e(n="error"){return function(e){const{message:t}=Ie(e);Le.add(n,t)}}function Ze(n,e){return Qe().emit("entity:read",{...e,entity:n})}function zt(n,e){return Qe().emit("entity:update",{...e,entity:n})}function ni(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function ri(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 ii(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Z=Bt(Vt("use-socket"));function Qe(){return si}const si=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(p){const g=[...t.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",t.size,p.event,p.requestId),g.forEach(m=>{const E=p.requestId;(m.requestId&&m.requestId===E||!m.requestId&&m.event===p.event)&&(Z("Find appropriated handler: %d, event: %s",n,m.event),m.callback(p.data,p),m.once&&(t.delete(m),Z("Handler was removed by *once* params was passed. %o",m)))})}function u(p){console.log(`%cInitializing sockets: %c${p}`,"color: purple","color: black"),e=new WebSocket(p),e.onclose=function(g){Z("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(p))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{a(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!Gt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}o(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function a(p){e.send(p)}function c(p,g){t.add({event:p,callback:g})}function h(p,g){t.add({event:p,callback:g,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function d(p,g,m){const E=++n,S=JSON.stringify({requestId:E,event:p,data:g,contextId:C.contextId,url:window.location.href});return l()?a(S):(r.add(S),Z("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,T)=>{t.add({event:p,requestId:E,once:!0,callback:(k,O)=>{if(Z("Promise was resolve with next data:",k),oi(O))return void T(k);m&&m(k,O),w(k)}})})}return{get socket(){return e},on:c,once:h,emit:d,initialization:u,getDevInfo:i}}(),oi=n=>!!Gt(n)&&n.event==="request-error",Gt=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ai(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){return i.value?Promise.reject("The process has already started."):(i.value=!0,typeof e.limit!="number"&&(e.limit=100),e.offset=r,Ze(n,e).then(d=>(r+=d.length,d)).finally(()=>{i.value=!1}))}function u(d,p){var m;const g=d.Version||((m=t.find(E=>E.Id===p))==null?void 0:m.Version);if(g===void 0)throw new Error("Object without version.");return g}function a(d,p){const g=t.findIndex(m=>m.Id===d);if(g===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(g,1,p)}async function c(d,p){try{const g=u(p,d);delete p.Version,await zt(n,{id:d,values:p,version:g});const m=await Ze(n,{fields:e.fields||"",id:d});a(d,m)}catch(g){$e()(g)}}async function h(){try{const d=await o();t.push(...d)}catch(d){$e()(d)}}async function l(){try{r=0;const d=await o();t.splice(0,t.length,...d)}catch(d){$e()(d)}}return{array:t,updateById:c,next:h,reload:l,wait:i}}const Le=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=ci(r),o=new li(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function ci(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 Jt=class Zt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Zt.cardId++}};Jt.cardId=1;let li=Jt;const ui={clickOutside:ge,valuesToUpperCase:Ce,Filter:$,staticLink:qn,groupArrayByField:zn,uuidv4:Gn,Request:y},di={usage:sn,utils:fn,config:hn,types:pn};f.ApplicationManager=pt,f.Communication=Wn,f.ComputedMetadata=$n,f.CoreError=F,f.Filter=$,f.List=W,f.ListConfig=Mn,f.Manager=C,f.MetadataStore=ce,f.NotificationSystem=Le,f.Request=y,f.Table=je,f.WidgetButton=Or,f.WidgetIcon=ke,f.WidgetImage=Wr,f.WidgetList=Qr,f.WidgetLoader=Vr,f.WidgetMultiButton=Rr,f.WidgetSpinner=Oe,f.WidgetTable=Nr,f.actionService=Pt,f.asyncProcess=ei,f.authService=A,f.billingService=X,f.catchUniversal=$e,f.clickOutside=ge,f.clientService=at,f.communicationService=le,f.configurationService=tr,f.constants=Ye,f.dataService=v,f.debounce=Jn,f.default=di,f.documentsService=er,f.equipmentService=cr,f.fileService=Dn,f.getCellValue=Rt,f.getNamesFromListConfig=ni,f.historyService=_n,f.internationalizationService=Pn,f.invitationService=Bn,f.metadataService=ze,f.newImport=On,f.openService=Vn,f.parseError=Ie,f.prettifyValueByMetadata=Ln,f.prettyDate=Ke,f.prettyDateWithTime=Mt,f.prettyMoney=ri,f.processWizardService=ve,f.ruleValidationService=Ge,f.t=Y,f.testTypes=Cn,f.universalEntityRead=Ze,f.universalEntityUpdate=zt,f.useCommunication=Un,f.useCustomerState=Zn,f.useFormAction=Kn,f.useFormLabel=Yn,f.useFormMetadata=Hn,f.useFormRequest=Qn,f.useFormRequestData=Xn,f.useListActiveRow=ii,f.useListConfig=Sn,f.useListEntity=ai,f.useListFilter=Tn,f.useListOrder=vt,f.useListProvide=Nt,f.useListRead=bt,f.useListSearch=bn,f.useListSelect=Nn,f.useListState=Tt,f.useLogger=Ot,f.useManagerState=cn,f.useSocket=Qe,f.useTableRequest=En,f.useTableState=wn,f.useWizard=sr,f.utils=ui,f.viewService=Rn,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
11
11
  //# sourceMappingURL=eservices-core.umd.js.map
@@ -97,9 +97,9 @@ declare const _default: {
97
97
  export default _default;
98
98
  export { StylesInterface, };
99
99
  import { WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList } from "./../src/index";
100
- import { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
100
+ import { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
101
101
  import type { IListCell, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityUpdateOptions, IUniversalEntityReadOptions, IValues, IListOrder } from "./../src/index";
102
102
  import { constants } from "./../src/index";
103
103
  import { useListActiveRow, useSocket, useListEntity } from "./../src/index";
104
104
  import { NotificationSystem } from "./../src/index";
105
- export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity };
105
+ export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity };
@@ -35,7 +35,8 @@ import universalEntityRead from './methods/universal-entity-read';
35
35
  import universalEntityUpdate from './methods/universal-entity-update';
36
36
  import getNamesFromListConfig from './methods/get-names-from-list-config';
37
37
  import prettyMoney from './methods/pretty-money';
38
- export { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig };
38
+ import getCellValue from './methods/get-cell-value';
39
+ export { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue };
39
40
  /****
40
41
  HOOKS
41
42
  ****/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {