eservices-core 1.3.76 → 1.3.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(
|
|
3
|
-
* eservices-core v1.3.
|
|
2
|
+
(function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","debug","date-and-time","jenesius-vue-modal"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l["eservices-core"]={},l.Vue,l.JenesiusVueForm,l.VueRouter,l.Debug,l.DateAndTime,l.JenesiusVueModal))})(this,function(l,o,b,Ke,Pe,vt,pe){"use strict";/*!
|
|
3
|
+
* eservices-core v1.3.78
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
5
|
*/function Rt(n,e){return!!n&&n===e||"password is not equal"}function Je(n){return Number(n.replace(/[^0-9.]/g,""))}function Lt(n,e=null){let r=String(Je(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Pt={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:Je,prettyNumeric:Lt,validPassword:Rt},Symbol.toStringTag,{value:"Module"}))};function he(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?he(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,a){return i==a.target||i.contains(a.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ye(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const He=class _ extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=_.ID++}static ParentFormNotFound(){return new _("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new _("Composite object name is undefined",e)}static EntityWithoutName(e){return new _("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new _(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new _("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new _("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new _(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return _.ApiNotAvailable()}static ApiError(e){return new _("Request error",e)}static ApiNotAvailable(){return new _(`Sorry, we experience difficulties here.
|
|
6
|
-
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?_.ApiNotAvailable():new _(e||"Authorization Error",t)}static ApiResponseParseFailed(){return _.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new _("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new _(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new _("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new _("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new _(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new _(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new _(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new _(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new _("The request took too long to complete. Try again later.")}};He.ID=0;let q=He;const $t="Please try again later or submit a feedback if problem doesn't go.";class Xe{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:a=()=>{}}={}){const
|
|
6
|
+
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?_.ApiNotAvailable():new _(e||"Authorization Error",t)}static ApiResponseParseFailed(){return _.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new _("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new _(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new _("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new _("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new _(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new _(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new _(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new _(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new _("The request took too long to complete. Try again later.")}};He.ID=0;let q=He;const $t="Please try again later or submit a feedback if problem doesn't go.";class Xe{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:a=()=>{}}={}){const d=new Mt(e,t,i,r||[],a);return this.store.push(d),i&&setTimeout(this.remove.bind(this,d.id),i*1e3),d}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},Qe=class It{constructor(e,t,r,i,a){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=a,this.id=It.cardId++}};Qe.cardId=1;let Mt=Qe;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const Ze=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},et=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},tt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},nt=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ze.call(this,e,t)}emit(e,t){return et.call(this,e,t)}off(e,t){return tt.call(this,e,t)}cleanEvents(){nt.call(this)}static on(e,t){return Ze.call(D,e,t)}static emit(e,t){return et.call(D,e,t)}static off(e,t){return tt.call(D,e,t)}static cleanEvents(){nt.call(D)}}D.events={};var rt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ye=(n,e,t)=>(rt(n,e,"read from private field"),t?t.call(n):e.get(n)),$e=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},De=(n,e,t,r)=>(rt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,me,Ee;const G=class R extends D{constructor(){super(...arguments),$e(this,te,void 0),$e(this,me,"front"),this.organizations=[],$e(this,Ee,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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){De(this,te,e)}get router(){if(!ye(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ye(this,te)}set type(e){De(this,me,e)}get type(){return ye(this,me)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,Ee,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return ye(this,Ee)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.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(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Xe.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,me=new WeakMap,Ee=new WeakMap,G.DEFAULT_LANGUAGE="en",G.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",G.EVENT_CONTEXT_UPDATE="event:context-update",G.EVENT_READY_UPDATE="event:ready-update",G.EVENT_DATA_UPDATE="event:data-update",G.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=G;const it=new Bt;function Ut(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return $t}})}function m(n,e={}){return it.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=it.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw q.ApiNotAvailable()}).then(t=>Ut(t).then(r=>{if(!t.ok)throw r;return r}))}class we{constructor(){}static parseNamesFromListConfig(e){let t=we.parseFieldsToGraphQL(e.reduce((i,a)=>(a.name&&i.push(a.name),i),[]));function r(i){let a="";for(let u in i)typeof i[u]=="boolean"?a+=` ${u} `:a+=` ${u} { ${r(i[u])} }`;return a}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 a=i.indexOf("."),u=i.substring(a+1),s=i.substring(0,a);s in r||(r[s]={}),t(r[s],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Vt{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const Ft=new Vt;function ot(n){return n&&n[0].toLowerCase()+n.slice(1)}function Me(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=Me(r)),e[i]=r,e},{})}function Wt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:we,Journal:Ft,Request:m,clickOutside:ge,default:{Request:m,clickOutside:ge,getPropFromObject:he,runPromiseQueue:Ye,GraphQL:we,firstChapterToLowerCase:ot,valuesToUpperCase:Me,prettyMoney:Wt},firstChapterToLowerCase:ot,getPropFromObject:he,runPromiseQueue:Ye,valuesToUpperCase:Me},Symbol.toStringTag,{value:"Module"})),qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Zr="";class Gt{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(a=>{if(!a.changes)return a;const u=a.changes.map(s=>({...s,oldValue:s.originalValue,name:s.fieldName}));return{...a,changes:u}});return{...r,history:i}})}}class xt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let x={};function X(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=b.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return at(t,e);const r=b.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?at(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function at(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}X.setGlobalVocabulary=function(n){x=n},X.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),X.bind({vocabulary:b.utils.getPropFromObject(x,e.toLowerCase())})},X.setVocabulary=function(n){return typeof n=="string"&&(n=b.utils.getPropFromObject(x,n)),X.bind({vocabulary:n})};const zt=function(){let n=!1;const e=[];function t(){return n}function r(l,f){t()&&console[l](...f),e.push(f)}function i(...l){r("log",l)}function a(...l){r("warn",l)}function u(...l){r("error",l)}function s(l=!0){n=l}return{info:i,warn:a,history:e,display:s,error:u}}();function Kt(){return zt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Ht="masterEntity";function Be(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,a)=>r.append(i,a),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(([s,l="desc"])=>`@${s} ${l}`).join(",");t("order",u)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=ne.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.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 Be(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 a=r.fields;typeof a=="string"&&(a=[a]),i.append("fields",a.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 a=new URLSearchParams;return Be(a,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${a.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 ne.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})})}}const st=class fe{static async create(e){return m(fe.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(fe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${fe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${fe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};st.url="/close-api/communications";let Xt=st;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Le{static async getStartConfig(e,t){return m([Le.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Le.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,a){return m([Le.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(ct)}};lt.url="/close-api/views/process-wizard";let _e=lt;class Qt{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(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Zt{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 Ue{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ue.url+e,{method:"POST",body:JSON.stringify(t)})}}class en{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const tn={class:"widget-table__head"},nn={class:"widget-table__head-label margin_0 text_overflow"},rn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",tn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",nn,o.toDisplayString(r.label),1)]))),128))]))}}),ei="",j=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},on=j(rn,[["__scopeId","data-v-25198f4a"]]);function dt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function ut(n,e){const t=dt(n);let r=t?b.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ve(n){return["eservices-core",n].join(":")}function ft(n){return Fe(n,"YYYY/MM/DD HH:mm:ss")}function Fe(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return vt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ti="",re=j({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),an=Pe(Ve("setup-list-row"));function sn(n,e){const t=n.config.map(r=>cn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function cn(n,e,t){const r=e.values;let i=ut(n,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(h){a.onClick.push(()=>h(r))}function s(h){Array.isArray(h)?a.class.push(...h):a.class.push(h)}const l=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(s(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Fe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(b.FormField,{type:"single-checkbox",modelValue:e.selected})),u(pt.bind(null,t,!0));break}case"select":{f.push(o.h(b.FormField,{type:"single-radio",modelValue:e.selected})),u(pt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const h=n.link(r);if(h){const S=o.h(Ke.RouterLink,{to:h});f.push(S),s("widget-table-cell_link")}}catch(h){an("Can't add router link",h)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),s("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(re,{name:n.icon})),typeof n.icon=="function")){const h=n.icon(r);h!==null&&f.push(o.h(re,{name:h}))}return n.class&&(typeof n.class=="function"?s(n.class(r)):s(n.class)),l.push(o.h("td",a,f)),l}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return sn(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:ht},dn=["colspan"],gt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,dn)],512))}}),C={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",TIME_TO_LIVE_SOCKET_REQUEST:15e3,MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm"},un={class:"widget-table"},yt="update:selectedRows",fn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,l=!0){if(!t.selectedRows)return;if(!l)return e(yt,t.selectedRows.includes(s)?[]:[s]);const f=[...t.selectedRows],h=f.indexOf(s);return h===-1?f.push(s):f.splice(h,1),e(yt,f)}function u(s){e("save",s),e("update:activeRow",null)}return(s,l)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",un,[o.createVNode(on,{config:s.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:h},[o.createVNode(ln,{config:s.config,values:f,selected:s.selectedRows.includes(f),onSelect:S=>a(f,S),class:o.normalizeClass(s.classCallback?s.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,values:f,onClose:l[0]||(l[0]=S=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,onClose:l[1]||(l[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),pn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),ri="",Te=j(pn,[["__scopeId","data-v-0ef9ae88"]]),hn={class:"widget-button"},gn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",hn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),ii="",yn=j(gn,[["__scopeId","data-v-450dc564"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},wn=["onClick"],_n={class:"widget-multi-button-side-wrap"},Tn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function a(u=!t.active){t.active=u}return(u,s)=>(o.openBlock(),o.createElementBlock("div",mn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",En,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:s[0]||(s[0]=l=>a())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(l,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:h=>{i(l.callback),a(!1)}},o.toDisplayString(l.label),9,wn))),128))]),o.createElementVNode("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:s[1]||(s[1]=l=>a())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Te),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(re),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),oi="",Cn=j(Tn,[["__scopeId","data-v-a8d711d1"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),Nn=["alt","src"],bn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Nn))}}),In={props:{config:Array,values:Object,selected:Boolean},setup:ht},ai="",On=j(In,[["__scopeId","data-v-344a8cc1"]]),vn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Rn={class:"widget-list-head-cell"},Ln=vn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Pn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Rn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(b.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(re),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Ln])]))}}),si="",$n=j(Pn,[["__scopeId","data-v-bf495d6a"]]),Dn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function l(w,T){let p=-1;do p++,T-=w[p];while(T>0&&p<w.length);return p}function f(w,T){let p=0;for(;T>0&&T>w[p]&&p<w.length;)T-=w[p],p++;return console.log(T,p),p>0?p:0}function h(w){try{i.value.style.insetInlineStart=w+"px"}catch(T){console.log(T)}}function S(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(T){console.log(T)}}function $(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(T){var bt;function p(v){return v.screenX+g-N}const E=r.value,c=[...E.children].filter(v=>v.localName==="th"),g=((bt=E.offsetParent)==null?void 0:bt.scrollLeft)||0,y=c.map(v=>v.clientWidth),M=$(T.target),N=E.getBoundingClientRect().left,Z=p(T),A=l(y,Z),H=y.slice(0,A).reduce((v,B)=>v+B,0),le=Z-H,xe=E.offsetWidth,de=c[A].clientWidth;if(t.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",y),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",le),console.groupEnd(),i.value.innerText=c[A].textContent||"",i.value.style.display="grid",i.value.style.width=de+"px",i.value.style.cursor="grabbing",h(H),S(de),document.addEventListener("pointermove",Nt,{passive:!0}),document.addEventListener("pointerup",kt);function kt(v){if(console.group("END"),document.removeEventListener("pointermove",Nt),document.removeEventListener("pointerup",kt),M&&(t.config[A].width=i.value.style.width,t.config[A].minWidth=i.value.style.width,t.config[A].maxWidth=i.value.style.width,a(t.config)),!M){const B=v.screenX+g-N;console.log("ENP Position",B);const Re=f(y,B);if(console.log(A,"->",Re),Re!==A){const ue=t.config[A],ze=t.config;ze.splice(A,1),ze.splice(Re,0,ue),a(ze)}else{const ue=t.config[A].name;u(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Nt(v){if(M){const ue=p(v)-Z+de;S(ue);return}let B=v.screenX+g-N-le;B<0&&(B=0),B+de>xe&&(B=xe-de),h(B)}})});function a(l){e("update:config",l)}function u(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(t.order.length===0||t.order[0]!==l)return void s([l]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([l,f==="asc"?"desc":"asc"])}function s(l){e("update:order",l)}return(l,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.config,(h,S)=>(o.openBlock(),o.createBlock($n,o.mergeProps({key:h},h,{onOrder:$=>u(h.name),onSelect:f[0]||(f[0]=$=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),ci="",Mn=j(Dn,[["__scopeId","data-v-ccffc6bd"]]),Bn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Vn=50,Fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(s,l=!0){if(t.selectedRows)if(!l)a(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],h=f.indexOf(s);h===-1?f.push(s):f==null||f.splice(h,1),a(f)}}function i(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return a([...t.array]);a([])}function a(s){e("update:selectedRows",s)}function u(s){if(!s)return;const l=s.target;l.scrollTop+l.clientHeight+Vn>l.scrollHeight&&e("scrollEnd")}return(s,l)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Bn,[o.createElementVNode("thead",null,[o.createVNode(Mn,{onSelect:l[0]||(l[0]=f=>i()),"onUpdate:order":l[1]||(l[1]=f=>e("update:order",f)),"onUpdate:config":l[2]||(l[2]=f=>e("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),o.createElementVNode("tbody",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,h)=>{var S;return o.openBlock(),o.createBlock(On,{key:h,class:"widget-list-row",values:f,config:s.config,selected:(S=s.selectedRows)==null?void 0:S.includes(f),onSelect:$=>r(f,$)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),U={};function Wn(n){for(let e in n)U[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function jn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function Ce(n){return typeof n=="string"?We(n):qn(n)?We(n.message):We(C.DEFAULT_ERROR_MESSAGE)}function qn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ie.add(n,t)}}function Se(n,e={}){return k().emit("entity:read",{...e,entity:n})}function je(n,e){return k().emit("entity:update",{...e,entity:n})}function Gn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function qe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=qe(r)),e[i]=r,e},{})}function xn(n,e){const t=new Map;return n.forEach(r=>{var a;const i=e(r);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(r)}),t}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 Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function V(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Yn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Hn=Pe(Ve("pretty-value-field-by-entity"));function Xn(n,e,t){try{const r=Ne.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Hn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const Qn=1,Zn=5e3,z=Pe(Ve("use-socket"));function k(){return tr}function er(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const tr=function(){let n=1,e,t;const r=new Set;let i=0;const a=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn*2);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{E(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?l({requestId:c.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function s(){return{safeQueue:a,requestId:n,handlers:r,socketInstance:e}}function l(c){const g=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),g.forEach(y=>{const M=c.requestId;(y.requestId&&y.requestId===M||!y.requestId&&y.event===c.event)&&(z("Find appropriated handler: %d, event: %s",n,y.event),y.callback(c.data,c),y.once&&(r.delete(y),z("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(g=>{g.guaranteedAnswer&&g.serializeString&&a.add(g.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(c=>{h(c),a.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var g;try{if(er(c.data)){u();return}const y=JSON.parse(c.data);if(!Et(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(g=y==null?void 0:y.data)!=null&&g.refresh&&location.reload(),l(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function h(c){e.send(c)}function S(c,g){p({event:c,callback:g})}function $(c,g){p({event:c,callback:g,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function T(c,g,y){const M=++n,N=JSON.stringify({requestId:M,event:c,data:g,contextId:O.contextId,url:window.location.href});return w()?h(N):(a.add(N),z("Socket is not connected. Message was send to save-queue")),new Promise((Z,A)=>{p({event:c,requestId:M,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(H,le)=>{if(z("Promise was resolve with next data:",H),nr(le))return void A(H);y&&y(H,le),Z(H)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function p(c){const g={timeToLive:0,...c,created:new Date().getTime()};r.add(g)}function E(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:S,once:$,emit:T,initialization(c){t=c},getDevInfo:s}}(),nr=n=>!!Et(n)&&n.event==="request-error",Et=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function rr(n,e){return k().emit("list-setting:read",{entity:n,mark:e})}function ir(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function wt(n,e){return k().emit("entity:create",{...e,entity:n})}function _t(n,e){return k().emit("entity:delete",{...e,entity:n})}function or(n,e){return k().emit("usage-context:read",{...e,entity:n})}function Tt(n={}){return k().emit("tool:read",n)}function ar(n,e={},t={}){const r=Array.isArray(n)?n:o.inject(C.PROVIDE_NAME_ACTIONS),i=typeof n=="string"?n:e,a=typeof e=="string"?t:e;return o.computed(()=>{const u=(o.unref(r)||[]).find(s=>s.action.name===i);return u?{...u,...a}:null})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function cr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function a(){if(i.value)return Promise.reject("The process has already started.");const p=w();return i.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=r,Se(n,p).then(E=>(r+=E.length,E)).finally(()=>{i.value=!1})}function u(p,E){var g;return typeof p.Version=="number"?p.Version:(g=t.find(y=>y.Id===E))==null?void 0:g.Version}function s(p,E){const c=t.findIndex(g=>g.Id===p);if(c===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(c,1,E)}function l(p){const E=t.findIndex(c=>c.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(E,1)}async function f(p,E){try{const c=w(),g=u(E,p);delete E.Version,await je(n,{id:p,values:E,version:g});const y=await Se(n,{fields:c.fields||"",id:p});s(p,y)}catch(c){L()(c)}}async function h(p,E){try{const c=w(),g=u(E,p);delete E.Version,await _t(n,{id:p,version:g}),l(p)}catch(c){L()(c)}}async function S(p){try{await wt(n,{values:p}),await T()}catch(E){L()(E)}}async function $(){try{const p=await a();t.push(...p)}catch(p){L()(p)}}function w(){return typeof e=="function"?e():e}async function T(){try{r=0;const p=await a();t.splice(0,t.length,...p)}catch(p){L()(p)}}return{array:t,updateById:f,next:$,reload:T,wait:i,create:S,deleteById:h}}function lr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function dr(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ur(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function pr(n){return k().emit("communication-message:read",{communicationId:n})}function hr(n){const e=b.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>pr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function gr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw q.EntityWithoutName(n);return Se(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw q.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function yr(n){if(!n)return o.inject(C.PROVIDE_NAME_METADATA);Ne.initEntity(n);const e=o.computed(()=>Ne.state[n]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function mr(n,e={}){if(!n)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await or(n,Er(e||{}))}}}function Er(n){return typeof n=="function"?n():n}function wr(n={}){const e=o.reactive([]),t=o.computed(()=>e.map(a=>i(a)));o.provide(C.PROVIDE_NAME_ACTIONS,t),n.router=Ke.useRouter(),n.handleConfirmation||(n.handleConfirmation=Tr),n.handleAffectedEntity||(n.handleAffectedEntity=Sr),n.handleCloseForm||(n.handleCloseForm=Ar),n.handleValidationResult||(n.handleValidationResult=Cr);function r(a={}){return e.splice(0,e.length),Tt(a).then(u=>e.splice(0,0,...u)).catch(L("error"))}function i(a){return{...a,label:a.title,callback(){const u=typeof n.values=="function"?n.values():n.values,s=()=>V(a.url,{method:"POST",body:JSON.stringify({keys:u,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async l=>{if(!kr(l))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const f of n.handlers)await f(a,l,n);if(!l.success)throw n.handleValidationResult&&l.validationEffect&&n.handleValidationResult(a,l.validationEffect,n),new Error(l.message);return l.message&&ie.add("info",l.message),Array.isArray(l.affectedEntities)&&n.handleAffectedEntity&&l.affectedEntities.forEach(f=>{var h;return(h=n.handleAffectedEntity)==null?void 0:h.call(n,a,f,n)}),a.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(a,n),l}).catch(L("error"));return!a.confirmation||!n.handleConfirmation?s():n.handleConfirmation(a,s)}}}return{actions:t,update:r}}function _r(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}function Tr(n,e){const t=_r(n.confirmation),r=C.MODAL_CONFIRM;if(!pe.getComponentFromStore(r))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");return new Promise((i,a)=>{pe.pushModal(r,{message:t,resolve:()=>Promise.resolve().then(e).then(i),reject:a})})}function Cr(n,e){const t=C.MODAL_VALIDATION_EFFECT;if(!pe.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{pe.pushModal(t,e)})}function Sr(n,e,t){var s;const{router:r,form:i,emits:a}=t,u=(s=e.primaryKey)==null?void 0:s.Id;if(a&&a("affectEntity",e),r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:u}});i&&e.name===i.name&&e.updated&&u===i.id&&i.read()}function Ar(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function kr(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}const ie=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Nr(r),a=new br(e,t,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Nr(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 Ct=class Ot{constructor(e,t,r,i,a){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=a,this.id=Ot.cardId++}};Ct.cardId=1;let br=Ct;class Ir extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fr(this.id,e)}static checkAndGenerate(e,t,r){return ur(e,t,r).then(i=>i.length===0?dr(e,t,r):i[0])}}function Or(){return k().emit("client:read",{})}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},vr=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),Rr=(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)},Lr=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],Rr(this,Ae,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||ee.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Lr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return vr(this,Ae)}onReady(e){return this.on(ee.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(ee.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(ee.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Or()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ae=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let Pr=ke;function $r(n){return k().emit("metadata:read",{entity:n})}const Ne=function(){const e=o.reactive({}),t=new Map;function r(s){return e[s]}async function i(s){if(t.has(s)&&await t.get(s),e[s])return;const l=await a(s);u(s,l)}function a(s){const l=$r(s).finally(()=>{t.delete(s)});return t.set(s,l),l}function u(s,l){e[s]=l}return{state:e,initEntity:i,get:r}}();class I{static login(e){return V(U.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:U.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return I.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return I.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return I.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return I.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return V(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return I.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return I.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return I.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return V(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(I.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e){return V(`${U.identityServerURL}/api/Authenticate/StartPasswordReset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:e})})}static verifyPasswordResetBySMS(e,t){return I.verifyPasswordReset("SMS",e,t)}static verifyPasswordResetByEmail(e,t){return I.verifyPasswordReset("Email",e,t)}static verifyPasswordReset(e,t,r){return V(`${U.identityServerURL}/api/Authenticate/VerifyPasswordReset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({Token:t,Code:r,Channel:e})})}static resolvePasswordReset(e,t){return V(`${U.identityServerURL}/api/Authenticate/ResetPassword`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({Token:e,NewPassword:t})})}}function Dr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function P(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Dr(r)){let i=function(a){var u;return((u=a.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(P.is(t,r)),e)},[]).join(" and ")}function oe(n){return typeof n=="string"?`'${n}'`:`${n}`}P.includes=function(e,t){return`@${e} Contains ${oe(t)}`},P.beginWith=function(e,t){return`@${e} BeginWith ${oe(t)}`},P.notEq=function(e,t){return`@${e} nq ${oe(t)}`},P.eq=function(e,t){return Array.isArray(t)?P.in(e,t):`@${e} eq ${oe(t)}`},P.in=function(e,t){const r=t.map(oe).join(", ");return`@${e} in (${r})`},P.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},P.is=function(e,t){return`@${e} is ${t}`},P.or=function(...e){return e.join(" or ")};const O=new Pr;class Mr{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 Be(i,r),V([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Br(n,e="images"){return`/static-folder/${e}/${n}`}class Ur{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(a=>a.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Q.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]):q.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},F=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),K=(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)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ae,Ie,Oe,se,ce,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",ve=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,K(this,be,void 0),this.array=[],K(this,ae,[]),K(this,Ie,[]),K(this,Oe,new Proxy({},{set:(t,r,i,a)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),K(this,se,!1),K(this,ce,(...t)=>Promise),K(this,Ge,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ae,e.config)}set config(e){J(this,ae,e.map(b.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Ie)}set order(e){J(this,Ie,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Oe)}set filters(e){Fr(F(this,Oe),e)}set wait(e){J(this,se,e),this.emit(b.Form.EVENT_WAIT,F(this,se))}get wait(){return F(this,se)}get primaryKeys(){return F(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){J(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=F(this,ce).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,Ge).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[Y]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=W.getCellName(e),i=(()=>{let a=r?he(t,r):null;return a===void 0&&(a=null),e.value?e.value(a,t):a})();return{name:r,value:i}}};be=new WeakMap,ae=new WeakMap,Ie=new WeakMap,Oe=new WeakMap,se=new WeakMap,ce=new WeakMap,Ge=new WeakMap,ve.EVENT_DATA="list-data: update",ve.EVENT_CONFIG_UPDATE="list-config:update",ve.EVENT_ORDER_UPDATE="list-order:update",ve.EVENT_FILTERS_UPDATE="list-filters:update";function Vr(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Fr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Wr(n){const e=o.reactive([]);function t(s){return e.includes(s)}function r(s){t(s)||e.push(s)}function i(s){const l=e.findIndex(f=>f===s);l!==-1&&e.splice(l,1)}function a(s){const l=o.unref(n);if(s===void 0){e.length===0?l.forEach(r):l.forEach(i);return}t(s)?i(s):r(s)}const u=o.computed(()=>{const s=o.unref(n);return e.length===s.length&&s.length!==0});return[e,a,u,r,i]}function jr(n){return n.statusName==="Completed"}function qr(n){return n.statusName==="FinalStepWithConfirmation"}function Gr(n){return n.statusName==="ValidationError"}function xr(n,e,t){let r=null;const i=o.reactive({wait:null});let a=[],u=null;const s=o.ref(null);function l(){s.value=a.find(c=>c.name===u)||null}function f(){var c;return u?((c=a.find(g=>g.name===u))==null?void 0:c.fields)||[]:[]}function h(c){if(l(),Gr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||zr(f(),t.presets)))return E(t.presets||{});jr(c)&&t.onCompleted(c),qr(c)&&t.onConfirmation(c)}async function S(){try{await $(),await p()}catch(c){const{message:g}=Ce(c);ie.add("error",g)}}function $(){return i.wait="Loading process information.",_e.getStartConfig(e,n).then(c=>{a=c.steps.map(g=>({label:g.title,name:g.stepName,number:g.number,fields:g.frontendEntity.objectTypes.reduce((y,M)=>(M.properties.forEach(N=>{y.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),y),[])}))}).then(c=>(i.wait=!1,c))}function w(c){return u=c.nextStepName,r=c.token,c}function T(c){const g=Ce(c);ie.add("error",g.message)}function p(){return i.wait="Starting process",_e.startProcess(e,n).then(w).then(h).catch(T).finally(()=>{i.wait=null})}function E(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",_e.runStep(e,n,u,r,c).then(w).then(h).catch(T).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(s),next:E}}function zr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!b.utils.getPropFromObject(e,r.name))return!1}return!0}const Kr="close-api/proxy/Equipment/Search";class Jr{static search(e,t,r,i,a){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),a&&(u.append("limit",String(a.limit)),u.append("offset",String(a.offset)));const s=`/${Kr}?${u.toString()}`;return m(s,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Yr={clickOutside:ge,staticLink:Br},Hr={usage:Pt,utils:jt,types:qt};d.Communication=Ir,d.CoreError=q,d.Filter=P,d.Manager=O,d.MetadataStore=Ne,d.NotificationSystem=ie,d.WidgetButton=yn,d.WidgetIcon=re,d.WidgetImage=bn,d.WidgetList=Fn,d.WidgetLoader=kn,d.WidgetMultiButton=Cn,d.WidgetSpinner=Te,d.WidgetTable=fn,d.actionService=Mr,d.asyncProcess=jn,d.authService=I,d.billingService=Q,d.catchUniversal=L,d.clickOutside=ge,d.clientService=Xe,d.communicationService=Xt,d.config=Wn,d.configuration=U,d.constants=C,d.dataService=ne,d.debounce=Jn,d.default=Hr,d.documentsService=Ur,d.equipmentService=Jr,d.fileService=Qt,d.getCellName=dt,d.getCellValue=ut,d.getNamesFromListConfig=Gn,d.groupArrayByField=xn,d.historyService=Gt,d.injectAction=ar,d.internationalizationService=xt,d.invitationService=Zt,d.openService=en,d.parseError=Ce,d.prettyDate=Fe,d.prettyDateWithTime=ft,d.prettyMoney=mt,d.prettyValueFieldByEntity=Xn,d.processWizardService=_e,d.request=V,d.ruleValidationService=Ue,d.t=X,d.throttle=Yn,d.universalEntityCreate=wt,d.universalEntityDelete=_t,d.universalEntityRead=Se,d.universalEntityUpdate=je,d.universalListSettingRead=rr,d.universalMetadataFieldTreat=ir,d.universalToolRead=Tt,d.useActions=wr,d.useCommunication=hr,d.useFormEntity=gr,d.useListActiveRow=sr,d.useListEntity=cr,d.useListSearch=Vr,d.useListSelect=Wr,d.useLogger=Kt,d.useManagerState=lr,d.useMetadata=yr,d.useSocket=k,d.useUsageContext=mr,d.useWizard=xr,d.utils=Yr,d.uuidv4=zn,d.valuesToUpperCase=qe,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
*/const Ze=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},et=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},tt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},nt=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ze.call(this,e,t)}emit(e,t){return et.call(this,e,t)}off(e,t){return tt.call(this,e,t)}cleanEvents(){nt.call(this)}static on(e,t){return Ze.call(D,e,t)}static emit(e,t){return et.call(D,e,t)}static off(e,t){return tt.call(D,e,t)}static cleanEvents(){nt.call(D)}}D.events={};var rt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ye=(n,e,t)=>(rt(n,e,"read from private field"),t?t.call(n):e.get(n)),$e=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},De=(n,e,t,r)=>(rt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,me,Ee;const G=class R extends D{constructor(){super(...arguments),$e(this,te,void 0),$e(this,me,"front"),this.organizations=[],$e(this,Ee,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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){De(this,te,e)}get router(){if(!ye(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ye(this,te)}set type(e){De(this,me,e)}get type(){return ye(this,me)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,Ee,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return ye(this,Ee)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.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(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Xe.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,me=new WeakMap,Ee=new WeakMap,G.DEFAULT_LANGUAGE="en",G.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",G.EVENT_CONTEXT_UPDATE="event:context-update",G.EVENT_READY_UPDATE="event:ready-update",G.EVENT_DATA_UPDATE="event:data-update",G.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=G;const it=new Bt;function Vt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return $t}})}function m(n,e={}){return it.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=it.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw q.ApiNotAvailable()}).then(t=>Vt(t).then(r=>{if(!t.ok)throw r;return r}))}class we{constructor(){}static parseNamesFromListConfig(e){let t=we.parseFieldsToGraphQL(e.reduce((i,a)=>(a.name&&i.push(a.name),i),[]));function r(i){let a="";for(let d in i)typeof i[d]=="boolean"?a+=` ${d} `:a+=` ${d} { ${r(i[d])} }`;return a}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 a=i.indexOf("."),d=i.substring(a+1),s=i.substring(0,a);s in r||(r[s]={}),t(r[s],d)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ut{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const Ft=new Ut;function ot(n){return n&&n[0].toLowerCase()+n.slice(1)}function Me(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=Me(r)),e[i]=r,e},{})}function Wt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:we,Journal:Ft,Request:m,clickOutside:ge,default:{Request:m,clickOutside:ge,getPropFromObject:he,runPromiseQueue:Ye,GraphQL:we,firstChapterToLowerCase:ot,valuesToUpperCase:Me,prettyMoney:Wt},firstChapterToLowerCase:ot,getPropFromObject:he,runPromiseQueue:Ye,valuesToUpperCase:Me},Symbol.toStringTag,{value:"Module"})),qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ei="";class Gt{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(a=>{if(!a.changes)return a;const d=a.changes.map(s=>({...s,oldValue:s.originalValue,name:s.fieldName}));return{...a,changes:d}});return{...r,history:i}})}}class xt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let x={};function X(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=b.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return at(t,e);const r=b.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?at(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function at(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}X.setGlobalVocabulary=function(n){x=n},X.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),X.bind({vocabulary:b.utils.getPropFromObject(x,e.toLowerCase())})},X.setVocabulary=function(n){return typeof n=="string"&&(n=b.utils.getPropFromObject(x,n)),X.bind({vocabulary:n})};const zt=function(){let n=!1;const e=[];function t(){return n}function r(u,f){t()&&console[u](...f),e.push(f)}function i(...u){r("log",u)}function a(...u){r("warn",u)}function d(...u){r("error",u)}function s(u=!0){n=u}return{info:i,warn:a,history:e,display:s,error:d}}();function Kt(){return zt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Ht="masterEntity";function Be(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,a)=>r.append(i,a),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const d=(Array.isArray(i)?[i]:Object.entries(i)).map(([s,u="desc"])=>`@${s} ${u}`).join(",");t("order",d)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=ne.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.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 Be(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 a=r.fields;typeof a=="string"&&(a=[a]),i.append("fields",a.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 a=new URLSearchParams;return Be(a,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${a.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 ne.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})})}}const st=class fe{static async create(e){return m(fe.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(fe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${fe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${fe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};st.url="/close-api/communications";let Xt=st;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Le{static async getStartConfig(e,t){return m([Le.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Le.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,a){return m([Le.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(ct)}};lt.url="/close-api/views/process-wizard";let _e=lt;class Qt{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(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Zt{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 Ve{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ve.url+e,{method:"POST",body:JSON.stringify(t)})}}class en{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const tn={class:"widget-table__head"},nn={class:"widget-table__head-label margin_0 text_overflow"},rn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",tn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",nn,o.toDisplayString(r.label),1)]))),128))]))}}),ti="",j=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},on=j(rn,[["__scopeId","data-v-25198f4a"]]);function dt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function ut(n,e){const t=dt(n);let r=t?b.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ue(n){return["eservices-core",n].join(":")}function ft(n){return Fe(n,"YYYY/MM/DD HH:mm:ss")}function Fe(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return vt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ni="",re=j({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),an=Pe(Ue("setup-list-row"));function sn(n,e){const t=n.config.map(r=>cn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function cn(n,e,t){const r=e.values;let i=ut(n,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(g){a.onClick.push(()=>g(r))}function s(g){Array.isArray(g)?a.class.push(...g):a.class.push(g)}const u=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(s(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Fe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(b.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(b.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const g=n.link(r);if(g){const S=o.h(Ke.RouterLink,{to:g});f.push(S),s("widget-table-cell_link")}}catch(g){an("Can't add router link",g)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),s("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(re,{name:n.icon})),typeof n.icon=="function")){const g=n.icon(r);g!==null&&f.push(o.h(re,{name:g}))}return n.class&&(typeof n.class=="function"?s(n.class(r)):s(n.class)),u.push(o.h("td",a,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return sn(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:ht},dn=["colspan"],gt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,dn)],512))}}),C={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",TIME_TO_LIVE_SOCKET_REQUEST:15e3,MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm"},un={class:"widget-table"},yt="update:selectedRows",fn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(s)?[]:[s]);const f=[...t.selectedRows],g=f.indexOf(s);return g===-1?f.push(s):f.splice(g,1),e(yt,f)}function d(s){e("save",s),e("update:activeRow",null)}return(s,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",un,[o.createVNode(on,{config:s.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(ln,{config:s.config,values:f,selected:s.selectedRows.includes(f),onSelect:S=>a(f,S),class:o.normalizeClass(s.classCallback?s.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,values:f,onClose:u[0]||(u[0]=S=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,onClose:u[1]||(u[1]=f=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),pn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),ii="",Te=j(pn,[["__scopeId","data-v-0ef9ae88"]]),hn={class:"widget-button"},gn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",hn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),oi="",yn=j(gn,[["__scopeId","data-v-450dc564"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},wn=["onClick"],_n={class:"widget-multi-button-side-wrap"},Tn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function a(d=!t.active){t.active=d}return(d,s)=>(o.openBlock(),o.createElementBlock("div",mn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",En,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:s[0]||(s[0]=u=>a())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(u,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:g=>{i(u.callback),a(!1)}},o.toDisplayString(u.label),9,wn))),128))]),o.createElementVNode("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:s[1]||(s[1]=u=>a())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Te),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(re),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),ai="",Cn=j(Tn,[["__scopeId","data-v-a8d711d1"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),Nn=["alt","src"],bn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Nn))}}),In={props:{config:Array,values:Object,selected:Boolean},setup:ht},si="",On=j(In,[["__scopeId","data-v-344a8cc1"]]),vn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Rn={class:"widget-list-head-cell"},Ln=vn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Pn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Rn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(b.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(re),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Ln])]))}}),ci="",$n=j(Pn,[["__scopeId","data-v-bf495d6a"]]),Dn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function u(w,T){let p=-1;do p++,T-=w[p];while(T>0&&p<w.length);return p}function f(w,T){let p=0;for(;T>0&&T>w[p]&&p<w.length;)T-=w[p],p++;return console.log(T,p),p>0?p:0}function g(w){try{i.value.style.insetInlineStart=w+"px"}catch(T){console.log(T)}}function S(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(T){console.log(T)}}function $(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(T){var bt;function p(v){return v.screenX+h-N}const E=r.value,c=[...E.children].filter(v=>v.localName==="th"),h=((bt=E.offsetParent)==null?void 0:bt.scrollLeft)||0,y=c.map(v=>v.clientWidth),M=$(T.target),N=E.getBoundingClientRect().left,Z=p(T),A=u(y,Z),H=y.slice(0,A).reduce((v,B)=>v+B,0),le=Z-H,xe=E.offsetWidth,de=c[A].clientWidth;if(t.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",y),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",le),console.groupEnd(),i.value.innerText=c[A].textContent||"",i.value.style.display="grid",i.value.style.width=de+"px",i.value.style.cursor="grabbing",g(H),S(de),document.addEventListener("pointermove",Nt,{passive:!0}),document.addEventListener("pointerup",kt);function kt(v){if(console.group("END"),document.removeEventListener("pointermove",Nt),document.removeEventListener("pointerup",kt),M&&(t.config[A].width=i.value.style.width,t.config[A].minWidth=i.value.style.width,t.config[A].maxWidth=i.value.style.width,a(t.config)),!M){const B=v.screenX+h-N;console.log("ENP Position",B);const Re=f(y,B);if(console.log(A,"->",Re),Re!==A){const ue=t.config[A],ze=t.config;ze.splice(A,1),ze.splice(Re,0,ue),a(ze)}else{const ue=t.config[A].name;d(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Nt(v){if(M){const ue=p(v)-Z+de;S(ue);return}let B=v.screenX+h-N-le;B<0&&(B=0),B+de>xe&&(B=xe-de),g(B)}})});function a(u){e("update:config",u)}function d(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){e("update:order",u)}return(u,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.config,(g,S)=>(o.openBlock(),o.createBlock($n,o.mergeProps({key:g},g,{onOrder:$=>d(g.name),onSelect:f[0]||(f[0]=$=>e("select")),order:u.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),li="",Mn=j(Dn,[["__scopeId","data-v-ccffc6bd"]]),Bn={class:"widget-list"},Vn={class:"widget-list-body position_relative"},Un=50,Fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(s,u=!0){if(t.selectedRows)if(!u)a(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],g=f.indexOf(s);g===-1?f.push(s):f==null||f.splice(g,1),a(f)}}function i(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return a([...t.array]);a([])}function a(s){e("update:selectedRows",s)}function d(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+Un>u.scrollHeight&&e("scrollEnd")}return(s,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Bn,[o.createElementVNode("thead",null,[o.createVNode(Mn,{onSelect:u[0]||(u[0]=f=>i()),"onUpdate:order":u[1]||(u[1]=f=>e("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>e("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),o.createElementVNode("tbody",Vn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>{var S;return o.openBlock(),o.createBlock(On,{key:g,class:"widget-list-row",values:f,config:s.config,selected:(S=s.selectedRows)==null?void 0:S.includes(f),onSelect:$=>r(f,$)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),V={};function Wn(n){for(let e in n)V[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function jn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function Ce(n){return typeof n=="string"?We(n):qn(n)?We(n.message):We(C.DEFAULT_ERROR_MESSAGE)}function qn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ie.add(n,t)}}function Se(n,e={}){return k().emit("entity:read",{...e,entity:n})}function je(n,e){return k().emit("entity:update",{...e,entity:n})}function Gn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function qe(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=qe(r)),e[i]=r,e},{})}function xn(n,e){const t=new Map;return n.forEach(r=>{var a;const i=e(r);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(r)}),t}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 Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function U(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Yn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Hn=Pe(Ue("pretty-value-field-by-entity"));function Xn(n,e,t){try{const r=Ne.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Hn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const Qn=1,Zn=5e3,z=Pe(Ue("use-socket"));function k(){return tr}function er(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const tr=function(){let n=1,e,t;const r=new Set;let i=0;const a=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn*2);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{E(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?u({requestId:c.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function s(){return{safeQueue:a,requestId:n,handlers:r,socketInstance:e}}function u(c){const h=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),h.forEach(y=>{const M=c.requestId;(y.requestId&&y.requestId===M||!y.requestId&&y.event===c.event)&&(z("Find appropriated handler: %d, event: %s",n,y.event),y.callback(c.data,c),y.once&&(r.delete(y),z("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&a.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(c=>{g(c),a.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var h;try{if(er(c.data)){d();return}const y=JSON.parse(c.data);if(!Et(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(h=y==null?void 0:y.data)!=null&&h.refresh&&location.reload(),u(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function g(c){e.send(c)}function S(c,h){p({event:c,callback:h})}function $(c,h){p({event:c,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function T(c,h,y){const M=++n,N=JSON.stringify({requestId:M,event:c,data:h,contextId:O.contextId,url:window.location.href});return w()?g(N):(a.add(N),z("Socket is not connected. Message was send to save-queue")),new Promise((Z,A)=>{p({event:c,requestId:M,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(H,le)=>{if(z("Promise was resolve with next data:",H),nr(le))return void A(H);y&&y(H,le),Z(H)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function p(c){const h={timeToLive:0,...c,created:new Date().getTime()};r.add(h)}function E(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:S,once:$,emit:T,initialization(c){t=c},getDevInfo:s}}(),nr=n=>!!Et(n)&&n.event==="request-error",Et=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function rr(n,e){return k().emit("list-setting:read",{entity:n,mark:e})}function ir(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function wt(n,e){return k().emit("entity:create",{...e,entity:n})}function _t(n,e){return k().emit("entity:delete",{...e,entity:n})}function or(n,e){return k().emit("usage-context:read",{...e,entity:n})}function Tt(n={}){return k().emit("tool:read",n)}function ar(n,e={},t={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof n=="string"?n:e,a=typeof e=="string"?t:e;return o.computed(()=>{const d=(Array.isArray(n)?o.unref(n):r?r.actions.value:[]).find(s=>s.action.name===i);return d?{...d,...a}:null})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function cr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function a(){if(i.value)return Promise.reject("The process has already started.");const p=w();return i.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=r,Se(n,p).then(E=>(r+=E.length,E)).finally(()=>{i.value=!1})}function d(p,E){var h;return typeof p.Version=="number"?p.Version:(h=t.find(y=>y.Id===E))==null?void 0:h.Version}function s(p,E){const c=t.findIndex(h=>h.Id===p);if(c===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(c,1,E)}function u(p){const E=t.findIndex(c=>c.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);t.splice(E,1)}async function f(p,E){try{const c=w(),h=d(E,p);delete E.Version,await je(n,{id:p,values:E,version:h});const y=await Se(n,{fields:c.fields||"",id:p});s(p,y)}catch(c){L()(c)}}async function g(p,E){try{const c=w(),h=d(E,p);delete E.Version,await _t(n,{id:p,version:h}),u(p)}catch(c){L()(c)}}async function S(p){try{await wt(n,{values:p}),await T()}catch(E){L()(E)}}async function $(){try{const p=await a();t.push(...p)}catch(p){L()(p)}}function w(){return typeof e=="function"?e():e}async function T(){try{r=0;const p=await a();t.splice(0,t.length,...p)}catch(p){L()(p)}}return{array:t,updateById:f,next:$,reload:T,wait:i,create:S,deleteById:g}}function lr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function dr(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ur(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function pr(n){return k().emit("communication-message:read",{communicationId:n})}function hr(n){const e=b.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>pr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function gr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw q.EntityWithoutName(n);return Se(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw q.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function yr(n){if(!n)return o.inject(C.PROVIDE_NAME_METADATA);Ne.initEntity(n);const e=o.computed(()=>Ne.state[n]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function mr(n,e={}){if(!n)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await or(n,Er(e||{}))}}}function Er(n){return typeof n=="function"?n():n}function wr(n){if(!n)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),t=o.computed(()=>e.map(a=>_r(n,a))),r={actions:t,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),n.router=Ke.useRouter(),n.handleConfirmation||(n.handleConfirmation=Cr),n.handleAffectedEntity||(n.handleAffectedEntity=Ar),n.handleCloseForm||(n.handleCloseForm=kr),n.handleValidationResult||(n.handleValidationResult=Sr);function i(a={}){return e.splice(0,e.length),Tt(a).then(d=>e.splice(0,0,...d)).catch(L("error"))}return{actions:t,update:i}}function _r(n,e){return{...e,label:e.title,callback(){const t=typeof n.values=="function"?n.values():n.values,r=()=>U(e.url,{method:"POST",body:JSON.stringify({keys:t,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{if(!Nr(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const a of n.handlers)await a(e,i,n);if(!i.success)throw n.handleValidationResult&&i.validationEffect&&n.handleValidationResult(e,i.validationEffect,n),new Error(i.message);return i.message&&ie.add("info",i.message),Array.isArray(i.affectedEntities)&&n.handleAffectedEntity&&i.affectedEntities.forEach(a=>{var d;return(d=n.handleAffectedEntity)==null?void 0:d.call(n,e,a,n)}),e.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(e,n),i}).catch(L("error"));return!e.confirmation||!n.handleConfirmation?r():n.handleConfirmation(e,r)}}}function Tr(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}function Cr(n,e){const t=Tr(n.confirmation),r=C.MODAL_CONFIRM;if(!pe.getComponentFromStore(r))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");return new Promise((i,a)=>{pe.pushModal(r,{message:t,resolve:()=>Promise.resolve().then(e).then(i),reject:a})})}function Sr(n,e){const t=C.MODAL_VALIDATION_EFFECT;if(!pe.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{pe.pushModal(t,e)})}function Ar(n,e,t){var d;const{router:r,form:i}=t,a=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function kr(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function Nr(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}const ie=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=br(r),a=new Ir(e,t,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function br(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 Ct=class Ot{constructor(e,t,r,i,a){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=a,this.id=Ot.cardId++}};Ct.cardId=1;let Ir=Ct;class Or extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fr(this.id,e)}static checkAndGenerate(e,t,r){return ur(e,t,r).then(i=>i.length===0?dr(e,t,r):i[0])}}function vr(){return k().emit("client:read",{})}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Rr=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),Lr=(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)},Pr=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],Lr(this,Ae,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||ee.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Pr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return Rr(this,Ae)}onReady(e){return this.on(ee.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(ee.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(ee.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return vr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ae=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let $r=ke;function Dr(n){return k().emit("metadata:read",{entity:n})}const Ne=function(){const e=o.reactive({}),t=new Map;function r(s){return e[s]}async function i(s){if(t.has(s)&&await t.get(s),e[s])return;const u=await a(s);d(s,u)}function a(s){const u=Dr(s).finally(()=>{t.delete(s)});return t.set(s,u),u}function d(s,u){e[s]=u}return{state:e,initEntity:i,get:r}}();class I{static login(e){return U(V.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:V.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return I.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return I.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return I.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return I.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return U(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return I.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return I.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return I.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return U(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(I.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e){return U(`${V.identityServerURL}/api/Authenticate/StartPasswordReset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:e})})}static verifyPasswordResetBySMS(e,t){return I.verifyPasswordReset("SMS",e,t)}static verifyPasswordResetByEmail(e,t){return I.verifyPasswordReset("Email",e,t)}static verifyPasswordReset(e,t,r){return U(`${V.identityServerURL}/api/Authenticate/VerifyPasswordReset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({Token:t,Code:r,Channel:e})})}static resolvePasswordReset(e,t){return U(`${V.identityServerURL}/api/Authenticate/ResetPassword`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({Token:e,NewPassword:t})})}}function Mr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function P(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Mr(r)){let i=function(a){var d;return((d=a.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(P.is(t,r)),e)},[]).join(" and ")}function oe(n){return typeof n=="string"?`'${n}'`:`${n}`}P.includes=function(e,t){return`@${e} Contains ${oe(t)}`},P.beginWith=function(e,t){return`@${e} BeginWith ${oe(t)}`},P.notEq=function(e,t){return`@${e} nq ${oe(t)}`},P.eq=function(e,t){return Array.isArray(t)?P.in(e,t):`@${e} eq ${oe(t)}`},P.in=function(e,t){const r=t.map(oe).join(", ");return`@${e} in (${r})`},P.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},P.is=function(e,t){return`@${e} is ${t}`},P.or=function(...e){return e.join(" or ")};const O=new $r;class Br{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 Be(i,r),U([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Vr(n,e="images"){return`/static-folder/${e}/${n}`}class Ur{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(a=>a.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Q.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]):q.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},F=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),K=(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)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ae,Ie,Oe,se,ce,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",ve=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,K(this,be,void 0),this.array=[],K(this,ae,[]),K(this,Ie,[]),K(this,Oe,new Proxy({},{set:(t,r,i,a)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),K(this,se,!1),K(this,ce,(...t)=>Promise),K(this,Ge,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ae,e.config)}set config(e){J(this,ae,e.map(b.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Ie)}set order(e){J(this,Ie,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Oe)}set filters(e){Wr(F(this,Oe),e)}set wait(e){J(this,se,e),this.emit(b.Form.EVENT_WAIT,F(this,se))}get wait(){return F(this,se)}get primaryKeys(){return F(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){J(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=F(this,ce).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,Ge).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[Y]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=W.getCellName(e),i=(()=>{let a=r?he(t,r):null;return a===void 0&&(a=null),e.value?e.value(a,t):a})();return{name:r,value:i}}};be=new WeakMap,ae=new WeakMap,Ie=new WeakMap,Oe=new WeakMap,se=new WeakMap,ce=new WeakMap,Ge=new WeakMap,ve.EVENT_DATA="list-data: update",ve.EVENT_CONFIG_UPDATE="list-config:update",ve.EVENT_ORDER_UPDATE="list-order:update",ve.EVENT_FILTERS_UPDATE="list-filters:update";function Fr(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Wr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function jr(n){const e=o.reactive([]);function t(s){return e.includes(s)}function r(s){t(s)||e.push(s)}function i(s){const u=e.findIndex(f=>f===s);u!==-1&&e.splice(u,1)}function a(s){const u=o.unref(n);if(s===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(s)?i(s):r(s)}const d=o.computed(()=>{const s=o.unref(n);return e.length===s.length&&s.length!==0});return[e,a,d,r,i]}function qr(n){return n.statusName==="Completed"}function Gr(n){return n.statusName==="FinalStepWithConfirmation"}function xr(n){return n.statusName==="ValidationError"}function zr(n,e,t){let r=null;const i=o.reactive({wait:null});let a=[],d=null;const s=o.ref(null);function u(){s.value=a.find(c=>c.name===d)||null}function f(){var c;return d?((c=a.find(h=>h.name===d))==null?void 0:c.fields)||[]:[]}function g(c){if(u(),xr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Kr(f(),t.presets)))return E(t.presets||{});qr(c)&&t.onCompleted(c),Gr(c)&&t.onConfirmation(c)}async function S(){try{await $(),await p()}catch(c){const{message:h}=Ce(c);ie.add("error",h)}}function $(){return i.wait="Loading process information.",_e.getStartConfig(e,n).then(c=>{a=c.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((y,M)=>(M.properties.forEach(N=>{y.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),y),[])}))}).then(c=>(i.wait=!1,c))}function w(c){return d=c.nextStepName,r=c.token,c}function T(c){const h=Ce(c);ie.add("error",h.message)}function p(){return i.wait="Starting process",_e.startProcess(e,n).then(w).then(g).catch(T).finally(()=>{i.wait=null})}function E(c={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",_e.runStep(e,n,d,r,c).then(w).then(g).catch(T).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(s),next:E}}function Kr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!b.utils.getPropFromObject(e,r.name))return!1}return!0}const Jr="close-api/proxy/Equipment/Search";class Yr{static search(e,t,r,i,a){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),a&&(d.append("limit",String(a.limit)),d.append("offset",String(a.offset)));const s=`/${Jr}?${d.toString()}`;return m(s,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Hr={clickOutside:ge,staticLink:Vr},Xr={usage:Pt,utils:jt,types:qt};l.Communication=Or,l.CoreError=q,l.Filter=P,l.Manager=O,l.MetadataStore=Ne,l.NotificationSystem=ie,l.WidgetButton=yn,l.WidgetIcon=re,l.WidgetImage=bn,l.WidgetList=Fn,l.WidgetLoader=kn,l.WidgetMultiButton=Cn,l.WidgetSpinner=Te,l.WidgetTable=fn,l.actionService=Br,l.asyncProcess=jn,l.authService=I,l.billingService=Q,l.catchUniversal=L,l.clickOutside=ge,l.clientService=Xe,l.communicationService=Xt,l.config=Wn,l.configuration=V,l.constants=C,l.dataService=ne,l.debounce=Jn,l.default=Xr,l.documentsService=Ur,l.equipmentService=Yr,l.fileService=Qt,l.getCellName=dt,l.getCellValue=ut,l.getNamesFromListConfig=Gn,l.groupArrayByField=xn,l.historyService=Gt,l.injectAction=ar,l.internationalizationService=xt,l.invitationService=Zt,l.openService=en,l.parseError=Ce,l.prettyDate=Fe,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Xn,l.processWizardService=_e,l.request=U,l.ruleValidationService=Ve,l.t=X,l.throttle=Yn,l.universalEntityCreate=wt,l.universalEntityDelete=_t,l.universalEntityRead=Se,l.universalEntityUpdate=je,l.universalListSettingRead=rr,l.universalMetadataFieldTreat=ir,l.universalToolRead=Tt,l.useActions=wr,l.useCommunication=hr,l.useFormEntity=gr,l.useListActiveRow=sr,l.useListEntity=cr,l.useListSearch=Fr,l.useListSelect=jr,l.useLogger=Kt,l.useManagerState=lr,l.useMetadata=yr,l.useSocket=k,l.useUsageContext=mr,l.useWizard=zr,l.utils=Hr,l.uuidv4=zn,l.valuesToUpperCase=qe,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|
|
@@ -18,6 +18,22 @@ export declare function useActions(options?: Partial<IActionOptions>): {
|
|
|
18
18
|
title: string;
|
|
19
19
|
url: string;
|
|
20
20
|
}[]>;
|
|
21
|
+
} | {
|
|
22
|
+
actions: import("vue").ComputedRef<{
|
|
23
|
+
label: string;
|
|
24
|
+
callback(): Promise<void | IToolResult>;
|
|
25
|
+
action: import("../../../backend/src/types/action-type").IAction;
|
|
26
|
+
closeHostForm: boolean;
|
|
27
|
+
confirmation: string | true | null;
|
|
28
|
+
description: string | null;
|
|
29
|
+
name: string;
|
|
30
|
+
order: number;
|
|
31
|
+
redirectEntity: string | null;
|
|
32
|
+
requireSave: boolean;
|
|
33
|
+
showOnToolPanel: boolean;
|
|
34
|
+
title: string;
|
|
35
|
+
url: string;
|
|
36
|
+
}[]>;
|
|
21
37
|
update: (options?: Partial<IActionReadOptions>) => Promise<void | {
|
|
22
38
|
action: {
|
|
23
39
|
entity: string;
|
|
@@ -18,7 +18,6 @@ export interface IActionOptions {
|
|
|
18
18
|
handleValidationResult: (tool: ITool, validationResult: IValidationEffect, options: Partial<IActionOptions>) => any;
|
|
19
19
|
router: Router;
|
|
20
20
|
form: Form;
|
|
21
|
-
emits: ((event: string, data: unknown) => void);
|
|
22
21
|
}
|
|
23
22
|
export declare type IValidationEffect = {
|
|
24
23
|
results: IValidationEffectItem[];
|