halov 0.26.306 → 0.26.316

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,7 +1,7 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("img[data-v-f7799232]{display:block;max-width:100%}.app-tab-item[data-v-df170cc3]{border-top-width:2px}[data-v-e7319d81] .n-upload-trigger{display:block}.item-box[data-v-e7319d81]{display:block;flex-grow:1}.form-input[data-v-e7319d81]{display:block}.text-input[data-v-e7319d81]{font-size:small;display:block;text-align:end;padding-right:4px}div[data-v-8b391a0f] div.n-form-item-feedback-wrapper{display:none}div[data-v-8b391a0f] .n-form-item-blank{margin-bottom:4px}.n-form-item.n-form-item--left-labelled.n-form-item--auto-label-width>label{min-width:8em}[data-v-18129d6e] .n-upload-trigger{display:block}.main-detail-panel[data-v-ca4664e2]{display:flex;width:100%;height:100%;overflow:hidden;--n-resize-trigger-color: rgb(224, 224, 230, .24);--n-resize-trigger-color-hover: #36ad6a}.dark .main-detail-panel[data-v-ca4664e2]{--n-resize-trigger-color: rgba(255, 255, 255, .24);--n-resize-trigger-color-hover: #7fe7c4}.main-detail-panel.horizontal[data-v-ca4664e2]{flex-direction:row}.main-detail-panel.vertical[data-v-ca4664e2]{flex-direction:column}.panel[data-v-ca4664e2]{overflow:auto;display:flex;flex-direction:column}.divider[data-v-ca4664e2]{background-color:var(--n-resize-trigger-color);cursor:col-resize;transition:background .2s}.main-detail-panel.horizontal .divider[data-v-ca4664e2]{width:4px;height:100%}.main-detail-panel.vertical .divider[data-v-ca4664e2]{height:4px;width:100%;cursor:row-resize}.divider.dragging[data-v-ca4664e2],.divider[data-v-ca4664e2]:hover{background-color:var(--n-resize-trigger-color-hover)}.icon-container[data-v-ff87aac6]{display:flex;flex-direction:row;flex-wrap:wrap;padding-right:4px;padding-bottom:4px}.icon-button[data-v-ff87aac6]{max-width:100px;height:90px;width:80px;margin:4px 0 0 4px}.menu-spin>.n-spin-content{height:100%;display:flex;flex-direction:column}.user-name-box[data-v-0d4b7b61]{background:#abf3;position:relative;z-index:1;width:6rem;height:27px;line-height:27px;border-radius:0 27px 27px 0;left:20px;top:6px}.user-name-label[data-v-0d4b7b61]{padding-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:uppercase;text-align:center}.app-tabs{margin-bottom:0}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #D1D5DB;--n-tab-text-color: #1E1B4B;--n-tab-text-color-active: #1E1B4B;--n-tab-border-color: #A3A3A3}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #27272A;--n-tab-text-color: #71717A;--n-tab-text-color-active: #D4D4D8;--n-tab-border-color: #525252}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#f4f4f5;border-bottom-color:#f4f4f5;font-weight:bolder;border-top-color:#1e40af}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#171717;border-bottom-color:#171717;border-top-color:#e2e8f0}.app-tab-label{padding:0 1em}.d-block{display:block}.d-none{display:none}.d-flex{display:flex}.d-inline{display:inline}.d-inline-block{display:inline-block}.n-form .n-form-item .n-form-item-feedback-wrapper:empty{display:none}.n-form .n-form-item{margin-bottom:4px}.n-data-table-td,.n-data-table-th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.n-dropdown-menu.n-dropdown{min-width:150px}.text-monospace,.halo-form-code input,.halo-form-code-u input,.halo-form-code-l input{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}.halo-form-code-u input,.halo-form-code-u{text-transform:uppercase}.halo-form-code-l input,.halo-form-code-l{text-transform:lowercase}.halo-form-wrap{white-space:wrap;overflow-wrap:break-word;display:inline-block}.h-100{height:100%}.h-50{height:50%}td .halo-form-code,td .halo-form-code-u,td .halo-form-code-l{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td.text-num{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace;text-align:right}td.text-date,td.text-time,td.text-datetime{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td .percent-mark{margin-left:4px;margin-right:2px}td .percent-mark svg{margin:0 auto;display:block}td .status-tag{border-radius:2px;border-width:0 0 0 4px;border-style:solid;padding:0 4px;font-size:smaller;border-color:#9999}td .status-New,td .status-Created,td .status-Standby{border-color:#8bc34a99}td .status-True,td .status-true,td .status-Success,td .status-Succeeded,td .status-Succeed,td .status-Good,td .status-InStock,td .status-Passed,td .status-Resolved,td .status-Processing,td .status-InProduction,td .status-Allowed,td .status-Qualified,td .status-Loaded{border-color:#18a05899}td .status-False,td .status-false,td .status-NonGood,td .status-Failed,td .status-Rejected,td .status-Abnormal,td .status-Forbidden,td .status-Defective{border-color:#d0305099}td .status-Confirmed,td .status-Dispatched,td .status-Inspected{border-color:#3f51b599}td .status-Consumed,td .status-Finished,td .status-Unloaded{border-color:#607d8b99}td .status-Ignored{border-color:#79554899}td .status-OutStock,td .status-Cancelled{border-color:#9e9e9e99}td .status-InTransit{border-color:#78909c99}td .status-InFactory{border-color:#43a04799}td .status-InGarage{border-color:#673ab799}td .status-Doubt,td .status-Paused{border-color:#ffc10799}td .status-Read{border-color:#ffc107cc}td .status-Write{border-color:#673ab7cc}.n-data-table .n-data-table-th .n-data-table-sorter:not(.n-data-table-sorter--asc):not(.n-data-table-sorter--desc){display:none}.n-data-table .btn-cell-ref .n-button__content{opacity:.2}.n-data-table .btn-cell-ref:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table .btn-cell-qr .n-button__content{opacity:.2}.n-data-table .btn-cell-qr:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table-td:not(.check-mark) .cell-unchecked{display:none}.draging-ghost{opacity:.5;background:#c8ebfb}.drag-sorting-handle{cursor:row-resize}.pg-item{margin:1px;border:1px solid transparent;padding:2px;border-radius:3px}.pg-item:hover{border-color:#eee}.dark .pg-item:hover{border-color:#fff6}.pg-label{padding:0 2px;white-space:nowrap;max-width:50%;text-overflow:clip}.pg-value{padding-left:.5em;padding-right:1em;position:relative}.menu-icon{border-radius:2px}.menu-icon-blank{width:16px;height:16px}.text-positive{color:#00c853}.text-negative,.text-danger{color:#b71c1c}ul,li{list-style:none}html,body,#app,.n-config-provider{height:100%;margin:0;padding:0}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.flex-1{flex:1 1 0}.flex-grow-1{flex-grow:1}.flex-shrink-1{flex-shrink:1}.flex-wrap{flex-wrap:wrap}.gap1{gap:1em}.gap05{gap:.5em}.gap025{gap:.25em}.gap015{gap:.15em}.gap01{gap:.1em}.gap-x-1{column-gap:1em}.gap-x-05{column-gap:.5em}.gap-x-25{column-gap:.25em}.gap-y-1{row-gap:1em}.gap-y-05{row-gap:.5em}.gap-y-25{row-gap:.25em}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.week-0{background-color:#a5d6a7}input.ime-off,.ime-off input{ime-mode:disabled}.h-scroll{overflow-x:scroll}.v-scroll{overflow-y:scroll}.tabs-card.n-card>.n-card__content{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane>.n-card{border-top:0}.info-card{flex-grow:1;margin-top:1em}.info-card>.n-card__content{display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs{flex-grow:1}.info-card>.n-card__content>.n-tabs>.n-tab-pane{flex-grow:1;display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs>.n-tab-pane>div{flex-grow:1;display:flex;flex-direction:column}.page-component.n-space>div:first-child{flex-grow:1;display:flex;flex-direction:column}.form-create .n-input--disabled .n-input__input-el,.form-create .n-input--disabled .n-input__placeholder,.form-create .n-input--disabled .n-input__textarea-el,.form-create .n-base-selection--disabled .n-base-selection-overlay__wrapper{color:#000;font-weight:700}.bordered{border:1px solid var(--n-border-color);border-radius:var(--n-border-radius)}.n-dialog__content .line,.n-message__content .line{display:block}.n-tree-node-content__text{white-space:nowrap}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(B,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(B=typeof globalThis<"u"?globalThis:B||self,e(B.halov={},B.Vue,B.axios,B.VueRouter,B.NaiveUI,B.Pinia,B.moment,B.Mustache,B.VueDraggablePlus))})(this,function(B,e,le,fe,p,De,se,Ce,ll){"use strict";var sd=Object.defineProperty;var id=(B,e,le)=>e in B?sd(B,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):B[e]=le;var J=(B,e,le)=>id(B,typeof e!="symbol"?e+"":e,le);var ve=typeof document<"u"?document.currentScript:null;const et=window,Pt="halo-lang";class rl{constructor(l,o=!0){J(this,"langCode","");J(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Pt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Pt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=et.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=et.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=et.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Ht=Symbol("halo-i18n");let tt=null;function Gt(t,l){return tt||(tt=new rl(t,l)),tt}function Kt(t,l,o=!0){const n=Gt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Ht,n)}function Z(){const t=e.inject(Ht);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const al=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};le.defaults.headers["Client-Device-Id"]=al(),le.defaults.headers["Content-type"]="application/json",le.defaults.timeout=1e3*60,le.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),le.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status){const l=fe.useRouter();switch(t.response.status){case 401:l==null||l.push({name:"Unauthorized"});break}}return Promise.reject(t)});const sl=["src"],il=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ve&&ve.tagName.toUpperCase()==="SCRIPT"&&ve.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,sl))}}),re=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Wt=re(il,[["__scopeId","data-v-f7799232"]]);function cl(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const ot=De.defineStore("tabs",{state:()=>({tabs:cl(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var dl=typeof global=="object"&&global&&global.Object===Object&&global,fl=typeof self=="object"&&self&&self.Object===Object&&self,ul=dl||fl||Function("return this")(),be=ul.Symbol,Zt=Object.prototype,pl=Zt.hasOwnProperty,ml=Zt.toString,Ae=be?be.toStringTag:void 0;function hl(t){var l=pl.call(t,Ae),o=t[Ae];try{t[Ae]=void 0;var n=!0}catch{}var r=ml.call(t);return n&&(l?t[Ae]=o:delete t[Ae]),r}var gl=Object.prototype,yl=gl.toString;function wl(t){return yl.call(t)}var Cl="[object Null]",bl="[object Undefined]",Yt=be?be.toStringTag:void 0;function kl(t){return t==null?t===void 0?bl:Cl:Yt&&Yt in Object(t)?hl(t):wl(t)}function Nl(t){return t!=null&&typeof t=="object"}var xl="[object Symbol]";function Sl(t){return typeof t=="symbol"||Nl(t)&&kl(t)==xl}function Il(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var Bl=Array.isArray,Qt=be?be.prototype:void 0,Xt=Qt?Qt.toString:void 0;function Jt(t){if(typeof t=="string")return t;if(Bl(t))return Il(t,Jt)+"";if(Sl(t))return Xt?Xt.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function nt(t){return t==null?"":Jt(t)}function Vl(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function Ml(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:Vl(t,l,o)}var Al="\\ud800-\\udfff",Tl="\\u0300-\\u036f",El="\\ufe20-\\ufe2f",_l="\\u20d0-\\u20ff",Ll=Tl+El+_l,zl="\\ufe0e\\ufe0f",$l="\\u200d",Dl=RegExp("["+$l+Al+Ll+zl+"]");function qt(t){return Dl.test(t)}function Rl(t){return t.split("")}var Ut="\\ud800-\\udfff",Ol="\\u0300-\\u036f",jl="\\ufe20-\\ufe2f",Fl="\\u20d0-\\u20ff",Pl=Ol+jl+Fl,Hl="\\ufe0e\\ufe0f",Gl="["+Ut+"]",lt="["+Pl+"]",rt="\\ud83c[\\udffb-\\udfff]",Kl="(?:"+lt+"|"+rt+")",vt="[^"+Ut+"]",eo="(?:\\ud83c[\\udde6-\\uddff]){2}",to="[\\ud800-\\udbff][\\udc00-\\udfff]",Wl="\\u200d",oo=Kl+"?",no="["+Hl+"]?",Zl="(?:"+Wl+"(?:"+[vt,eo,to].join("|")+")"+no+oo+")*",Yl=no+oo+Zl,Ql="(?:"+[vt+lt+"?",lt,eo,to,Gl].join("|")+")",Xl=RegExp(rt+"(?="+rt+")|"+Ql+Yl,"g");function Jl(t){return t.match(Xl)||[]}function ql(t){return qt(t)?Jl(t):Rl(t)}function Ul(t){return function(l){l=nt(l);var o=qt(l)?ql(l):void 0,n=o?o[0]:l.charAt(0),r=o?Ml(o,1).join(""):l.slice(1);return n[t]()+r}}var vl=Ul("toUpperCase");function er(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function tr(t){return function(l){return t==null?void 0:t[l]}}var or={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},nr=tr(or),lr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rr="\\u0300-\\u036f",ar="\\ufe20-\\ufe2f",sr="\\u20d0-\\u20ff",ir=rr+ar+sr,cr="["+ir+"]",dr=RegExp(cr,"g");function fr(t){return t=nt(t),t&&t.replace(lr,nr).replace(dr,"")}var ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function pr(t){return t.match(ur)||[]}var mr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function hr(t){return mr.test(t)}var lo="\\ud800-\\udfff",gr="\\u0300-\\u036f",yr="\\ufe20-\\ufe2f",wr="\\u20d0-\\u20ff",Cr=gr+yr+wr,ro="\\u2700-\\u27bf",ao="a-z\\xdf-\\xf6\\xf8-\\xff",br="\\xac\\xb1\\xd7\\xf7",kr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Nr="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",so="A-Z\\xc0-\\xd6\\xd8-\\xde",Sr="\\ufe0e\\ufe0f",io=br+kr+Nr+xr,co="['’]",fo="["+io+"]",Ir="["+Cr+"]",uo="\\d+",Br="["+ro+"]",po="["+ao+"]",mo="[^"+lo+io+uo+ro+ao+so+"]",Vr="\\ud83c[\\udffb-\\udfff]",Mr="(?:"+Ir+"|"+Vr+")",Ar="[^"+lo+"]",ho="(?:\\ud83c[\\udde6-\\uddff]){2}",go="[\\ud800-\\udbff][\\udc00-\\udfff]",ke="["+so+"]",Tr="\\u200d",yo="(?:"+po+"|"+mo+")",Er="(?:"+ke+"|"+mo+")",wo="(?:"+co+"(?:d|ll|m|re|s|t|ve))?",Co="(?:"+co+"(?:D|LL|M|RE|S|T|VE))?",bo=Mr+"?",ko="["+Sr+"]?",_r="(?:"+Tr+"(?:"+[Ar,ho,go].join("|")+")"+ko+bo+")*",Lr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$r=ko+bo+_r,Dr="(?:"+[Br,ho,go].join("|")+")"+$r,Rr=RegExp([ke+"?"+po+"+"+wo+"(?="+[fo,ke,"$"].join("|")+")",Er+"+"+Co+"(?="+[fo,ke+yo,"$"].join("|")+")",ke+"?"+yo+"+"+wo,ke+"+"+Co,zr,Lr,uo,Dr].join("|"),"g");function Or(t){return t.match(Rr)||[]}function jr(t,l,o){return t=nt(t),l=l,l===void 0?hr(t)?Or(t):pr(t):t.match(l)||[]}var Fr="['’]",Pr=RegExp(Fr,"g");function Hr(t){return function(l){return er(jr(fr(l).replace(Pr,"")),t,"")}}var Gr=Hr(function(t,l,o){return t+(o?" ":"")+vl(l)});const Te="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",Ee="HH:mm:ss";function te(t){return t.length?Gr(t):t}function ie(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return ie(l)}}}function Re(t,l){const o=ie(t);return o===void 0?l||!1:o}function No(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return se(t,l||Te).toDate()}}function xo(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function Kr(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function So(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Io(t,l){const o=se(t,l||Ee);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function Bo(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=se(t,l||Te))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function Vo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||Ee);if(t instanceof Date)return se(t).format(l||Ee);if(xo(t))return se(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||Ee);if(typeof t=="object")return t==null?void 0:t.toString()}}function Mo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||ge);if(t instanceof Date)return se(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function at(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||Te);if(t instanceof Date)return se(t).format(l||Te);if(typeof t=="object")return t==null?void 0:t.toString()}}function Ao(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function To(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const s=n.indexOf("=");if(s>-1?(r=n.substring(0,s),a=n.substring(s+1)):r=n,r in l){if(a){const i=l[r];Array.isArray(i)?i.push(a):i?l[r]=[i,a]:l[r]=a}}else l[r]=a}return l}function Wr(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const s of a)n.push(`${r}=${encodeURIComponent(s)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function v(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=To(t.substring(a+1)));let s={};const i=Array.isArray(l)?l:[l];for(let m of i)if(m)if(typeof m=="string")s=To(m);else for(const c in m){const u=m[c];Array.isArray(u)?s[c]=u.map(g=>g==null?void 0:g.toString()):u!=null?s[c]=u.toString():s[c]=void 0}else continue;if(Object.keys(s).length==0)return t;if(r.length)for(const m in s)if(m in r&&!o){const c=r[m],u=s[m];Array.isArray(c)?Array.isArray(u)?c.push(...u):c.push(u):c?Array.isArray(u)?r[m]=[c,...u]:r[m]=[c,u]:r[m]=s[m]}else r[m]=s[m];else for(const m in s)r[m]=s[m];return Wr(n,r)}function Oe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return ie(t);case"date":case"datetime":return at(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function Eo(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function Zr(){return new Date().getTime().toString()}function Yr(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[te(n)]=t[n]:o[te(n.name)]=t[n.name];else for(const n in t)o[te(n)]=t[n];return o}function Qr(t,l){return se(t,ge).add(l,"days").format(ge)}function Xr(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function Jr(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function qr(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(s=>s.trim()))==null?void 0:a.filter(s=>!l||s.length>0);return n&&o&&(n=n.filter((s,i,m)=>s&&m.indexOf(s)==i)),n}function Ur(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(s=>s.trim()))==null?void 0:a.filter(s=>!l||s.length>0);return n&&o&&(n=n.filter((s,i,m)=>s&&m.indexOf(s)==i)),n}function vr(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function _o(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function Lo(t){return t==null?!0:/^\s*$/.test(t)}function ea(t,l){return Lo(t)?l:t}const Ne=De.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Re(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),ta={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},oa=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ta,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},la=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",na,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},zo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ra,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},sa=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",aa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ca=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},fa=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},$o=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ma=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ga=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Do=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ya,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ca=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ka=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),Na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},xa=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Na,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),Sa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ia=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Sa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),Ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Va=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),Ma={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},st=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ma,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),Aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ta=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Aa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),Ea={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},_a=e.defineComponent({name:"MoreHorizFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ea,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1)]))}}),La={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},za=e.defineComponent({name:"NotificationsNoneTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",La,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M12 6.5c-2.49 0-4 2.02-4 4.5v6h8v-6c0-2.48-1.51-4.5-4-4.5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 16v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6zm-4 5c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z",fill:"currentColor"},null,-1)]))}}),$a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Da=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),Ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Oa=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ra,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fa=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ha=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pa,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),Ga={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ka=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ga,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),Wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},je=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Wa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),Za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ue=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Za,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),Ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qa=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),Ro={rootMenuName:"MainMenu",menuPosition:"side"},it=Symbol("HalovConfig");function ct(){return e.inject(it)}const Xa=["src"],xe=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,Xa)):e.createCommentVNode("",!0)}}),Oo=re(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var x;const o=t,n=l,{t:r}=Z(),a=ot(),s=Ne(),i=e.computed(()=>s.menuCollapsed),m=((x=ct())==null?void 0:x.menuPosition)??"side",c=()=>s.setMenuCollapsed(!s.menuCollapsed),u=e.ref(o.currentTab),g=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(I=>({label:r(I.title),key:I.id,url:I.url}))]);function d(I){o.tabs.find(V=>V.id==I)&&a.closeTab(I),n("closeTab",I)}function h(I){if(I.key=="close-current"||I.key=="close-all"||I.key=="close-others")return e.h(p.NIcon,null,{default:()=>e.h(sa)});if(I.key&&I.key==u.value)return e.h(p.NIcon,null,{default:()=>e.h(la)})}function b(I){if(typeof I=="string"&&I)switch(I){case"close-current":n("closeTab",u.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",u.value);break;default:u.value=I;break}}return e.watch(()=>o.currentTab,I=>{u.value=I}),e.watch(u,I=>{I!=o.currentTab&&n("update:currentTab",I)}),(I,H)=>I.tabs.length?(e.openBlock(),e.createBlock(e.unref(p.NTabs),{key:0,type:"card",closable:"",onClose:d,"tab-style":"min-width: 80px;",value:u.value,"onUpdate:value":H[0]||(H[0]=V=>u.value=V)},{prefix:e.withCtx(()=>[e.renderSlot(I.$slots,"prefix",{},()=>[e.unref(m)=="side"?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:c,title:i.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Ta),{key:0})),i.value?(e.openBlock(),e.createBlock(e.unref(st),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NDropdown),{trigger:"click",options:g.value,placement:"bottom-end",onSelect:b,"render-icon":h},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(oa))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.tabs,V=>(e.openBlock(),e.createBlock(e.unref(p.NTab),{key:V.id,name:V.id,title:V.id,closable:V.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":V.color})},{default:e.withCtx(()=>[V.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:V.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(V.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),Ja=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const s=l.value;if(s){const i=t.step||1;switch(t.direction){case"Left":s.scrollWidth>s.clientWidth&&(s.scrollLeft+s.clientWidth>s.scrollWidth-3?s.scrollLeft=0:s.scrollLeft+=i);break;case"Bottom":s.scrollHeight>s.clientHeight&&(s.scrollTop<3?s.scrollTop=s.scrollHeight:s.scrollTop-=i);break;case"Top":s.scrollHeight>s.clientHeight&&(s.scrollTop+s.clientHeight>s.scrollHeight-3?s.scrollTop=0:s.scrollTop+=i);break;case"Right":default:s.scrollWidth>s.clientWidth&&(s.scrollLeft<3?s.scrollLeft=s.scrollWidth:s.scrollLeft-=i);break}}}function r(){o++,o>1e8&&(o=0);let s=t.intervalFrames||1;s<=0&&(s=1),o%s==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const s=l.value;if(s){switch(t.direction){case"Left":s.scrollLeft=0;break;case"Bottom":s.scrollTop=s.scrollHeight;break;case"Top":s.scrollTop=0;break;case"Right":default:s.scrollLeft=s.scrollWidth;break}s.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),qa={ref:"areaRef",style:{overflow:"hidden"}};function Ua(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",qa,[e.renderSlot(t.$slots,"default")],512)}const jo=re(Ja,[["render",Ua]]);function Fo(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const Po=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=Fo(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(p.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function Ho(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&Ho(l.items)}function va(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=De.defineStore("account",{state:()=>({userInfo:va(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]")}),actions:{setSession(t){this.sessionToken=t,t?localStorage.setItem("sessionToken",t):localStorage.removeItem("sessionToken")},setLastUserName(t){this.lastUserName=t,t?localStorage.setItem("lastUserName",t):localStorage.removeItem("lastUserName")},setUser(t){this.userInfo=t,t?localStorage.setItem("userInfo",JSON.stringify(t)):localStorage.removeItem("userInfo")},setAvatar(t){this.userInfo&&(this.userInfo.avatar=t,localStorage.setItem("userInfo",JSON.stringify(this.userInfo)))},clearUser(){this.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},setMenus(t){this.menus=t},setIsLoadingMenu(t){this.isLoadingMenu=t},logout(){localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),this.clearUser(),this.setMenus(null),localStorage.removeItem("_msgs")},async loadMenus(t){var l;this.setIsLoadingMenu(!0);try{t||(t=((l=ct())==null?void 0:l.rootMenuName)??"MainMenu");const o=await le.get(`/api/core/account/menus?rootName=${encodeURIComponent(t)}`);if(o.isSuccess){const n=o.value||[];Ho(n),this.setMenus(n)}else console.log(o.errorMessage||"get remote menus error.")}catch(o){console.log(o)}finally{this.setIsLoadingMenu(!1)}},addMessage(t){this.messages.push(t),localStorage.setItem("_msgs",JSON.stringify(this.messages))}}}),es={key:0,style:{"padding-left":"1rem"}},dt=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=p.useMessage(),a=e.inject("axios"),s=Se(),i=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),m=e.ref(!1),c=e.ref(null),u=e.computed(()=>{var I;return(I=s.userInfo)==null?void 0:I.userName}),g=e.ref([]),d={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function h(){var I;u.value&&!m.value&&c.value&&((I=c.value)==null||I.validate(H=>{if(!H)if(i.value.confirmPassword!=i.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(i.value.newPassword==i.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else b(u.value,i.value.oldPassword,i.value.newPassword)}))}async function b(I,H,V){try{const k={userName:I,oldPassword:H,newPassword:V},N=await a.post("/api/core/account/changePassword",k);N.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(N.errorMessage||"Error"))}catch(k){r.error((k==null?void 0:k.toString())||n("Error"))}}async function x(){try{const I=await a.get("/api/core/system/passwordOptions");I.isSuccess&&I.value!=null?g.value=I.value:r.error(n(I.errorMessage||"Error"))}catch(I){console.error(I),r.error((I==null?void 0:I.toString())||n("Error"))}}return e.onMounted(()=>{x()}),(I,H)=>{const V=e.resolveComponent("n-input"),k=e.resolveComponent("n-form-item"),N=e.resolveComponent("n-spin"),S=e.resolveComponent("n-text"),T=e.resolveComponent("n-button"),O=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(O,{show:I.show,onClose:H[3]||(H[3]=()=>I.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[g.value.length?(e.openBlock(),e.createElementBlock("ul",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j},[e.createVNode(S,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(T,{type:"primary",block:"",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NForm),{model:i.value,ref_key:"formRef",ref:c,rules:d},{default:e.withCtx(()=>[e.createVNode(N,{show:m.value},{default:e.withCtx(()=>[e.createVNode(k,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(V,{value:u.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:i.value.oldPassword,"onUpdate:value":H[0]||(H[0]=j=>i.value.oldPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:i.value.newPassword,"onUpdate:value":H[1]||(H[1]=j=>i.value.newPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:i.value.confirmPassword,"onUpdate:value":H[2]||(H[2]=j=>i.value.confirmPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),ft=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(p.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(p.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ca))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}});function Go(t){return typeof t=="object"&&t!==null&&"source"in t}function Ie(t){return typeof t=="object"&&t!==null&&"name"in t}function ts(t){for(const l in t)delete t[l]}function Ko(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=ie(r)||!1;break;default:const a=Eo(o.dataType);a!=null&&(l[n]=a)}}return l}function Wo(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=ie(a)||!1:o[r]=ie(a)||null;break;default:o[r]=a||null;break}}}function Zo(t,l){const o={};return Object.assign(o,t),Wo(t,l,o),o}function os(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function Yo(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(te(r)),visibility:!0,editor:"text"});else if(Ie(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?os(r.dataType):!r.required,label:r.title?o(r.title):o(te(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(s=>{if(typeof s=="string"){let i=s;return i&&(r.prefix&&(i=r.prefix+i),r.suffix&&(i=i+r.suffix)),{value:s,label:o(i)}}else return s})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(s=>{if(typeof s=="string"){let i=s;return i&&(r.prefix&&(i=r.prefix+i),r.suffix&&(i=i+r.suffix)),{value:s,label:o(i)}}else return s})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function ut(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function _e(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:te(o),sortIndex:0,visible:!0});else if(Ie(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:ut(o.size),minWidth:ut(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=_e(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function ns(t,l){return Ce.render(t,l)}function Qo(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ie(a)&&a.search){const s={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(te(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")s.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(s.searchMethod=a.search);else{if(a.search.editor&&(s.editor=a.search.editor),a.search.method=="range"?s.searchMethod="range":s.searchMethod="normal",a.search.required&&(s.nullable=!1),a.search.role){const i=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(s.role)for(let m of i)s.role.includes(m)||s.role.push(m);else s.role=i}a.search.field&&(s.searchField=a.search.field),s.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?s.valueSource={type:"static",isLoading:!1,values:a.values.map(i=>{if(typeof i=="string"){let m=i;return a.formatter&&(m=a.formatter.call(null,m,null)??m),m&&(s.prefix&&(m=s.prefix+m),s.suffix&&(m=m+s.suffix)),{value:i,label:o(m)}}else return i})}:typeof a.values=="function"?s.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?s.valueSource={type:"static",isLoading:!1,values:a.values.source.map(i=>{var m;return typeof i=="string"?{value:i,label:o(((m=a.formatter)==null?void 0:m.call(null,i,null))||i)}:i})}:s.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},s.dataType=="boolean"&&Array.isArray((r=s.valueSource)==null?void 0:r.values))){const i=s.valueSource.values;i.length<=2&&i.splice(0,0,{value:"",label:""})}n.push(s)}return n}async function Fe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=v(a,o));const s=await t.get(a);if(s.isSuccess&&s.value!=null){let i=s.value;if(!Array.isArray(i)&&"rows"in i&&Array.isArray(i.rows)&&(i=i.rows),Array.isArray(i)){const m=i.filter(c=>c&&!0).map(c=>{if(typeof c=="string")return{value:c,label:n?n(c):c};{let u;if(l.renderLabel)u=l.renderLabel(c);else if(l.labelTemplate)u=Ce.render(l.labelTemplate,c);else{if(u=c[l.label||"label"],n&&(u=n(u)),l.subLabel){const g=c[l.subLabel];typeof g=="string"&&(u+=" "+(n?n(g):g))}u&&(l.prefix&&(u=l.prefix+u),l.suffix&&(u=u+l.suffix))}return{value:c[l.key||"value"],label:u}}});r&&m.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...m)}}}finally{l.isLoading=!1}}}function pt(t,l){return()=>e.h(p.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function ls(t,l,o){if(t)return e.h(p.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function rs(t,l,o){return e.h(p.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(p.NIcon,{size:20},{default:()=>e.h(t)})})}function as(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const Pe=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=i=>{const m=Bo(i);return m===void 0?null:m},a=e.ref(r(o.value)),s=i=>{if(i!=null){a.value=i;const m=at(i);n("update:value",m,i)}else n("update:value",null,i)};return e.watch(()=>o.value,i=>a.value=r(i)),(i,m)=>(e.openBlock(),e.createBlock(e.unref(p.NDatePicker),{value:a.value,type:i.type,placeholder:"",disabled:i.readonly,"onUpdate:value":s,clearable:i.clearable},null,8,["value","type","disabled","clearable"]))}}),mt=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=i=>{if(i==null)return null;if(typeof i=="number"){const m=new Date(2e3,1,1);return m.setSeconds(i),m.getTime()}else if(typeof i=="string"){const m=Io(i);if(!m)return null;const c=new Date(2e3,1,1);return c.setMilliseconds(m.millisecond+m.second*1e3+m.minute*60*1e3+m.hour*60*60*1e3),c.getTime()}else return i instanceof Date?i.getTime():null},a=i=>{if(i!=null){s.value=i;const m=new Date;m.setTime(i);const c=m.getSeconds()+m.getMinutes()*60+m.getHours()*60*60;n("update:value",c)}else n("update:value",null)},s=e.ref(r(o.value));return e.watch(()=>o.value,i=>s.value=r(i)),(i,m)=>(e.openBlock(),e.createBlock(e.unref(p.NTimePicker),{value:s.value,type:i.type,placeholder:"",disabled:i.readonly,"onUpdate:value":a,clearable:i.clearable},null,8,["value","type","disabled","clearable"]))}}),ht=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),s=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],i=m=>{const c=ie(m);c==null?n("update:value",null):n("update:value",c)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(m,c)=>(e.openBlock(),e.createBlock(e.unref(p.NSelect),{value:a.value,options:s,placeholder:"",disabled:m.readonly,clearable:"","onUpdate:value":c[0]||(c[0]=u=>i(u))},null,8,["value","disabled"]))}}),gt=()=>{const{t}=Z(),l=p.useMessage(),o=p.useDialog(),n=p.useModal();function r(b){return b&&t(b)}function a(b){return e.h("div",{},b.split(`
3
- `).map(x=>e.h("span",{class:"line"},t(x))))}function s(b,x){switch(x){case"create":l.create(()=>a(b));break;case"error":l.error(()=>a(b));break;case"loading":l.loading(t(b));break;case"success":l.success(t(b));break;case"warning":l.warning(t(b));break;default:case"info":l.info(t(b));break}}function i(b,x,I){o.warning({title:t(b??"Confirm"),content:()=>a(x),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>I()})}function m(b,x,I){o.success({title:t(x??"Success"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>I==null?void 0:I()})}function c(b,x,I){o.error({title:t(x??"Error"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>I==null?void 0:I()})}function u(b,x,I){o.info({title:t(x??"Information"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>I==null?void 0:I()})}function g(b,x,I){o.warning({title:t(x??"Warning"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>I==null?void 0:I()})}function d(b){let x=[];const I=n.create({title:t(b.title??"Search"),preset:"card",style:{width:b.width??"800px",height:b.height??"600px"},contentClass:"flex-column",draggable:b.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:b.config,multiSelect:b.multiSelect==!0,onSearchBack:H=>{b.callback.call(null,H)},onResultSelected:(H,V)=>{x=V??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(p.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{x.length&&(b.callback.call(null,x),I.destroy())}},()=>t("OK")),e.h(p.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>I.destroy()},()=>t("Close"))])})}function h(b,x){const I=n.create({title:x,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(p.NQrCode,{value:b,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},b),e.h(p.NButton,{type:"primary",onClick:()=>I.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})}return{t:r,message:s,confirm:i,error:b=>l.error(t(b)),success:b=>l.success(t(b)),warning:b=>l.warning(t(b)),info:b=>l.info(t(b)),errorDialog:c,successDialog:m,warningDialog:g,infoDialog:u,showSearchModal:d,showQrModal:h}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}},ss=Ge.exports,Xo;function is(){return Xo||(Xo=1,function(t,l){(function(o,n){n()})(ss,function(){function o(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,u,g){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){m(d.response,u,g)},d.onerror=function(){console.error("could not download file")},d.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof He=="object"&&He.global===He?He:void 0,i=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(c,u,g){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?a(h):r(h.href)?n(c,u,g):a(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,g){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(o(c,g),u);else if(r(c))n(c,u,g);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){a(d)})}}:function(c,u,g,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return n(c,u,g);var h=c.type==="application/octet-stream",b=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||h&&b||i)&&typeof FileReader<"u"){var I=new FileReader;I.onloadend=function(){var k=I.result;k=x?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=k:location=k,d=null},I.readAsDataURL(c)}else{var H=s.URL||s.webkitURL,V=H.createObjectURL(c);d?d.location=V:location.href=V,d=null,setTimeout(function(){H.revokeObjectURL(V)},4e4)}});s.saveAs=m.saveAs=m,t.exports=m})}(Ge)),Ge.exports}var cs=is();function Jo(){const t=le.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function ds(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function pe(t,l,o,n){const r=Jo();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:s,headers:i,status:m,statusText:c}=a;if(m==200||s.length){i&&(o||(o=i["content-type"]),l||(l=ds(i["content-disposition"])));const u=new Blob([s],{type:o||"application/octet-stream"});cs.saveAs(u,l)}else throw`[${m}] ${c}`}async function qo(t,l,o){const n=Jo();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:s,status:i,statusText:m}=r;if(i==200||a.length){s&&(l||(l=s["content-type"]));const c=new Blob([a],{type:l||"application/octet-stream"}),u=URL.createObjectURL(c);window.open(u)}else throw`[${i}] ${m}`}function Uo(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function fs(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function vo(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function us(t,l,o,n,r,a){const s={name:t,label:l||te(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},i=a??(m=>m);return r&&(typeof r=="string"?s.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?s.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?s.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:i(r[0])},{value:"false",label:i(r[1])}]}:s.valueSource={type:"static",isLoading:!1,values:r.map(m=>typeof m=="string"?{value:m,label:i(m)}:m)}:Go(r)?Array.isArray(r.source)?s.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(m=>typeof m=="string"?{value:m,label:i(m)}:m)]}:s.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:s.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(m=>({value:r[m],label:i(m)}))}),s}function ps(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function ms(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],s=Math.max(1,Math.floor(r/l));let i=r;for(let m=0;m<l;m++){let c;m==l-1?c=Math.max(0,i):(c=Math.min(s,i),i=Math.max(0,i-s)),c=parseFloat((c/n).toFixed(o)),a.push(c)}return a}function hs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),s=[];let i=r;for(;i>0;){let m=Math.min(a,i);i-=a,s.push(parseFloat((m/n).toFixed(o)))}return s}function gs(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}const me=()=>{const t=gt(),l=e.inject("axios");async function o(m,c="Error"){if(m)if(m.response){let u=t.t(m.response.statusText);return m.response.data&&(m.response.data instanceof Blob?u+=`
4
- `+t.t(await m.response.data.text()):u+=`
5
- `+t.t(m.response.data.toString()),console.log(u)),u}else return m.toString();else return c}function n(m,c,u){t.confirm(m,c,()=>{r(u)})}async function r(m){var c,u,g,d,h,b;try{(c=m.loadingStatus)==null||c.call(null,!0);let x;m.data?x=await l.post(m.url,m.data):x=await l.post(m.url),(u=m.callback)==null||u.call(null,x),x.isSuccess?((g=m.success)==null||g.call(null,x.value),m.successMessage===!0?t.message("Successful operation.","success"):typeof m.successMessage=="string"&&t.message(m.successMessage,"success")):((d=m.fail)==null||d.call(null,x),x.errorMessage&&console.error(x.errorMessage),m.failMessage?t.message(m.failMessage,"error"):t.message(x.errorMessage??((h=x.value)==null?void 0:h.toString())??"Error","error"))}catch(x){t.message(await o(x)??m.failMessage??"Error")}finally{(b=m.loadingStatus)==null||b.call(null,!1)}}async function a(m){var c,u,g,d;try{(c=m.loadingStatus)==null||c.call(null,!0);let h=await l.get(m.url);if(h.isSuccess)return(u=m.callback)==null||u.call(null,h.value),h.value;m.quiet!=!0&&t.message(h.errorMessage??((g=h.value)==null?void 0:g.toString())??"Error","error")}catch(h){t.message(await o(h)??"Error","error")}finally{(d=m.loadingStatus)==null||d.call(null,!1)}}async function s(m){var c,u,g;try{(c=m.loadingStatus)==null||c.call(null,!0),await qo(m.url,m.contentType,m.method),(u=m.callback)==null||u.call(null)}catch(d){t.message(await o(d)??"Error","error")}finally{(g=m.loadingStatus)==null||g.call(null,!1)}}async function i(m){var c,u,g;try{(c=m.loadingStatus)==null||c.call(null,!0),await pe(m.url,m.filename,m.contentType,m.method),(u=m.callback)==null||u.call(null)}catch(d){t.message(await o(d)??"Error","error")}finally{(g=m.loadingStatus)==null||g.call(null,!1)}}return{post:r,get:a,confirmToPost:n,getHttpErrorMessage:o,openFile:s,downloadFile:i}},yt=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=Ne(),a=me(),s=e.ref(c(o.value)),i=e.ref([]);async function m(){if(o.tagSource){const g=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);i.value=g.map(d=>({value:d.code,label:`[${d.code}] ${d.name}`}))}else i.value=[]}function c(g){return g?g.split(","):[]}function u(g){o.disabled||(Array.isArray(g)?n("update:value",g.join(",")):n("update:value",g))}return e.watch(()=>o.value,g=>s.value=c(g)),e.watch(()=>o.tagSource,()=>m()),e.onMounted(()=>m()),(g,d)=>g.tagSource?(e.openBlock(),e.createBlock(e.unref(p.NSelect),{key:0,value:s.value,multiple:"",options:i.value,"onUpdate:value":u},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(p.NDynamicTags),{key:1,value:s.value,"onUpdate:value":u},null,8,["value"]))}}),wt=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=()=>{o.readonly||n("update:value",i()),n("update:show",!1)},s=()=>{var c,u,g,d;return o.value?Array.isArray(o.value)?o.value.join(`
6
- `):((d=(g=(u=(c=o.value)==null?void 0:c.replace(/\n/g,","))==null?void 0:u.split(","))==null?void 0:g.map(b=>b.trim()))==null?void 0:d.filter((b,x,I)=>b&&I.indexOf(b)==x)).join(`
7
- `):o.value},i=()=>{var u,g,d;return m.value?((d=(g=(u=m.value)==null?void 0:u.split(/\r?\n/))==null?void 0:g.map(h=>h.trim()))==null?void 0:d.filter((h,b,x)=>h&&x.indexOf(h)==b)).join(","):""},m=e.ref(s());return e.watch(()=>o.value,()=>{m.value=s()}),(c,u)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{title:c.title,show:c.show,preset:"card",style:{width:"350px"},draggable:"",onClose:u[2]||(u[2]=()=>c.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:c.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:u[1]||(u[1]=()=>c.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.message),1)]),_:1}),e.createVNode(e.unref(p.NInput),{value:m.value,"onUpdate:value":u[0]||(u[0]=g=>m.value=g),placeholder:c.placeholder,maxlength:c.maxLength,type:"textarea",readonly:c.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),Ct=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),s=o.config;function i(){a.value=!a.value}function m(c){c!=null&&(n("update:value",c),a.value=!1)}return e.watch(()=>o.value,c=>{console.log(`value changed: [${c}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(c,u)=>(e.openBlock(),e.createBlock(e.unref(p.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInput),{readonly:c.inputReadOnly,value:c.value,placeholder:c.placeholder,"onUpdate:value":u[0]||(u[0]=g=>c.$emit("update:value",g))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(p.NButton),{ghost:"",onClick:i},{default:e.withCtx(()=>u[4]||(u[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(p.NModal),{show:a.value,"onUpdate:show":u[2]||(u[2]=g=>a.value=g),title:e.unref(r)(e.unref(s).title??c.label??""),onClose:u[3]||(u[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(s).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(s).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s).componentType),{key:0,style:e.normalizeStyle(e.unref(s).style),"onUpdate:selected":u[1]||(u[1]=g=>m(g))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),ys={key:0,style:{"flex-grow":"1"}},ws={key:0,style:{"text-align":"right"}},Cs=["readonly","disabled"],bs=["readonly","disabled"],Be=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=Z(),s=e.inject("axios"),i=e.ref(void 0),m=e.ref(!1),c=e.ref(!1);function u(d){if(d.target instanceof HTMLInputElement){const h=d.target.files;h!=null&&h.length?r.value=h[0]:r.value=null}}async function g(d){var b,x;const h=(b=o.formItem)==null?void 0:b.valueSource;h&&h.type=="remote"&&h.sourceUrl&&h.filterable&&Fe(s,h,{searchWords:d},I=>h.i18n?a(I):I,((x=o.formItem)==null?void 0:x.nullable)!=!1)}return e.watch(r,d=>{n("update:value",d)}),e.watch(()=>o.value,d=>{r.value=d}),e.onMounted(()=>{var d,h;(h=(d=o.formItem)==null?void 0:d.role)!=null&&h.length&&(m.value=o.formItem.role.includes("list"),i.value=o.formItem.role.map(b=>`halo-form-${b}`).join(" "))}),(d,h)=>{var T,O,j,z,P,A,C,M,L,$,_,F,Y,U,ee,oe,ne,W;const b=e.resolveComponent("n-switch"),x=e.resolveComponent("n-text"),I=e.resolveComponent("n-select"),H=e.resolveComponent("n-input-number"),V=e.resolveComponent("n-checkbox"),k=e.resolveComponent("n-input"),N=e.resolveComponent("n-icon"),S=e.resolveComponent("n-button");return d.formItem?(e.openBlock(),e.createElementBlock("div",ys,[typeof d.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor),{value:r.value,"onUpdate:value":h[0]||(h[0]=K=>r.value=K)},null,40,["value"]))],1024)):((T=d.formItem.editor)==null?void 0:T.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":h[1]||(h[1]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label,readonly:d.readonly,disabled:d.readonly},null,40,["value","config","label","readonly","disabled"])):d.formItem.editor=="modal"?(e.openBlock(),e.createBlock(Ct,{key:2,value:r.value,"onUpdate:value":h[2]||(h[2]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label},null,8,["value","config","label"])):d.formItem.editor=="boolean"&&Array.isArray(d.formItem.values)&&d.formItem.values.length>1?(e.openBlock(),e.createBlock(b,{key:3,value:r.value,"onUpdate:value":h[3]||(h[3]=K=>r.value=K),style:e.normalizeStyle((O=d.formItem.editorConfig)==null?void 0:O.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[1]),1)]),_:1},8,["value","style"])):d.formItem.valueSource?(e.openBlock(),e.createBlock(I,{key:4,value:r.value,"onUpdate:value":h[4]||(h[4]=K=>r.value=K),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((j=d.formItem.role)==null?void 0:j.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((z=d.formItem.editorConfig)==null?void 0:z.style),onSearch:g},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",ws,[e.createVNode(x,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):d.formItem.editor=="number"?(e.openBlock(),e.createBlock(H,{key:5,value:r.value,"onUpdate:value":h[5]||(h[5]=K=>r.value=K),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((P=d.formItem.editorConfig)==null?void 0:P.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):d.formItem.editor=="boolean"&&d.formItem.nullable?(e.openBlock(),e.createBlock(ht,{key:6,value:r.value,"onUpdate:value":h[6]||(h[6]=K=>r.value=K),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(V,{key:7,checked:r.value,"onUpdate:checked":h[7]||(h[7]=K=>r.value=K),disabled:d.readonly,style:e.normalizeStyle((C=d.formItem.editorConfig)==null?void 0:C.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:1},8,["checked","disabled","style"])):d.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Pe,{key:8,value:r.value,"onUpdate:value":h[8]||(h[8]=K=>r.value=K),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((M=d.formItem.editorConfig)==null?void 0:M.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(Pe,{key:9,value:r.value,"onUpdate:value":h[9]||(h[9]=K=>r.value=K),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(mt,{key:10,value:r.value,"onUpdate:value":h[10]||(h[10]=K=>r.value=K),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle(($=d.formItem.editorConfig)==null?void 0:$.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(ft,{key:11,value:r.value,"onUpdate:value":h[11]||(h[11]=K=>r.value=K),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((_=d.formItem.editorConfig)==null?void 0:_.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(yt,{key:12,value:r.value,"onUpdate:value":h[12]||(h[12]=K=>r.value=K),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((F=d.formItem.editorConfig)==null?void 0:F.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:u,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((Y=d.formItem.editorConfig)==null?void 0:Y.style)},null,44,Cs)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:u,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((U=d.formItem.editorConfig)==null?void 0:U.style)},null,44,bs)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(k,{key:15,value:r.value,"onUpdate:value":h[13]||(h[13]=K=>r.value=K),class:e.normalizeClass(i.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((ee=d.formItem.editorConfig)==null?void 0:ee.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(k,{key:16,value:r.value,"onUpdate:value":h[14]||(h[14]=K=>r.value=K),class:e.normalizeClass(i.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((oe=d.formItem.editorConfig)==null?void 0:oe.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(k,{key:17,value:r.value,"onUpdate:value":h[16]||(h[16]=K=>r.value=K),class:e.normalizeClass(i.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle((ne=d.formItem.editorConfig)==null?void 0:ne.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(S,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:h[15]||(h[15]=()=>c.value=!0)},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Oa))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),m.value?(e.openBlock(),e.createBlock(wt,{key:18,show:c.value,"onUpdate:show":h[17]||(h[17]=K=>c.value=K),title:d.formItem.label,readonly:d.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":h[18]||(h[18]=K=>r.value=K),style:e.normalizeStyle((W=d.formItem.editorConfig)==null?void 0:W.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),ks=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Be,NForm:p.NForm,NFormItem:p.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=Z(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),s=e.ref(t.columns||1),i=e.ref({}),m=e.ref(g(t.formItems)),c=h(t.formItems),u=e.ref(void 0);function g(k){return k?[...new Set(k.map(S=>S.group))].map(S=>({label:S||"General",items:k.filter(T=>T.group==S)})):[]}function d(k){return k.dataType=="boolean"&&!k.nullable?" ":k.label}function h(k){const N={};if(k&&k.length)for(const S of k){const T=[];S.nullable==!1&&S.dataType!="boolean"&&T.push({required:!0,message:o("Must be filled here.")}),T.length&&(N[S.name]=T)}return N}async function b(k,N){var S;if(N.type=="remote"&&N.sourceUrl)Fe(n,N,null,T=>N.i18n?o(T):T,k.nullable);else if(N.type=="function"&&N.func){N.isLoading=!0;try{const T=(S=N.func)==null?void 0:S.call(void 0);T&&(N.values=T)}finally{N.isLoading=!1}}}function x(){var k;(k=t.formItems)==null||k.forEach(N=>{N.valueSource&&(N.valueSource.type=="remote"||N.valueSource.type=="function")&&b(N,N.valueSource)})}function I(k,N){l.emit("itemChange",{item:k,data:t.data,value:N})}function H(k){return!!(k.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(k.readonly)&&k.readonly.includes(t.method))}function V(k){return!!(k.visibility==!0||t.method&&Array.isArray(k.visibility)&&k.visibility.includes(t.method))}return e.onMounted(()=>{x(),t.data&&(i.value=t.data)}),e.watch(()=>t.data,k=>i.value=k||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:d,originalModel:u,model:i,rules:c,formColumns:s,updateValue:I,formGroups:m,isReadonly:H,isVisible:V}}}),Ns={class:"item-box"},xs={class:"item-box"},Ss={class:"item-box"};function Is(t,l,o,n,r,a){const s=e.resolveComponent("form-input"),i=e.resolveComponent("n-text"),m=e.resolveComponent("n-form-item-grid-item"),c=e.resolveComponent("n-grid"),u=e.resolveComponent("n-tab-pane"),g=e.resolveComponent("n-tabs"),d=e.resolveComponent("n-grid-item"),h=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(h,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(g,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(u,{key:b,name:b.label,tab:t.t(b.label)},{default:e.withCtx(()=>[e.createVNode(c,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ns,[e.createVNode(s,{"form-item":x,value:t.model[x.name],"onUpdate:value":[I=>t.model[x.name]=I,I=>t.updateValue(x,I)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(i,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(c,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(d,{key:b},{default:e.withCtx(()=>[e.createVNode(c,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",xs,[e.createVNode(s,{"form-item":x,value:t.model[x.name],"onUpdate:value":[I=>t.model[x.name]=I,I=>t.updateValue(x,I)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(i,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(c,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,b=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:b.name,label:t.getItemLabel(b),path:b.name,feedback:b.errorMessage,"validation-status":b.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ss,[e.createVNode(s,{"form-item":b,value:t.model[b.name],"onUpdate:value":[x=>t.model[b.name]=x,x=>t.updateValue(b,x)],readonly:t.isReadonly(b),label:b.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),b.description?(e.openBlock(),e.createBlock(i,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(b.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(b)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const bt=re(ks,[["render",Is],["__scopeId","data-v-e7319d81"]]),Bs={class:"pg-value flex-grow-1"},kt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=Z(),n=e.ref(a());function r(){n.value=a()}function a(){var u;const s=new Array,i=l.data,m=l.names,c=l.hideEmpty;if(i)if(m)for(const g of m)if(typeof g=="string")(!c||i[g])&&s.push({label:o(te(g)),value:i[g],span:1});else{const d={label:o(g.label||te(g.name)),value:i[g.name],span:g.span||1,dataType:g.dataType,role:g.role};d.value!=null&&(d.dataType=="boolean"?d.value=ie(d.value)?o("Yes"):o("No"):g.i18n&&(d.value=o((u=d.value)==null?void 0:u.toString()))),(!c||d.value)&&s.push(d)}else if(Array.isArray(i))for(const g of i)(!c||g.value)&&s.push({label:o(te(g.label)),value:g.value,span:1});else for(const g in i)(!c||i[g])&&s.push({label:o(te(g)),value:i[g],span:1});return s}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(s,i)=>(e.openBlock(),e.createBlock(e.unref(p.NGrid),{cols:s.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(m=>!s.hideEmpty||m.value),m=>(e.openBlock(),e.createBlock(e.unref(p.NGridItem),{class:"pg-item",key:m.label,span:m.span},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{label:m.label,value:m.value},()=>[e.createElementVNode("div",{class:"flex-row justify",style:e.normalizeStyle({"justify-content":s.justify})},[e.createVNode(e.unref(p.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label)+":",1)]),_:2},1024),e.createElementVNode("div",Bs,[m.role=="percent"?(e.openBlock(),e.createBlock(e.unref(p.NProgress),{key:0,type:"line",percentage:Number(m.value),title:m.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(p.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:2},1024))])],4)])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),Vs={key:0},Ms={class:"flex-column gap1 flex-grow-1"},As={class:"flex-row",style:{"justify-content":"space-between"}},Ts={class:"text-monospace",style:{"font-size":"24pt"}},Es={key:0},_s=["src"],Ls=["src"],zs={style:{"text-align":"right"}},en=e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=Z(),o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(p.NSpin),{show:n.loading,style:{"align-self":"center",margin:"1em"},class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NCard),{embedded:"",style:{width:"1080px"},segmented:{content:!0,footer:"soft"},class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(p.NH2),{style:{"margin-bottom":"2px"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon"),n.title?(e.openBlock(),e.createElementBlock("span",Vs,e.toDisplayString(e.unref(l)(n.title)),1)):e.createCommentVNode("",!0)]),_:3})]),"header-extra":e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{text:"",onClick:r[0]||(r[0]=()=>n.$emit("refresh"))},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(l)("Refresh")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Ms,[e.createElementVNode("div",As,[e.createElementVNode("div",null,[e.createElementVNode("div",Ts,e.toDisplayString(n.subject),1),n.showBarcode?(e.openBlock(),e.createElementBlock("div",Es,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+n.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,_s)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[n.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+n.subject+"&format=CODE_128&width=100&height=100"},null,8,Ls)):e.createCommentVNode("",!0)])]),e.createVNode(e.unref(p.NCollapse),{"display-directive":"show","default-expanded-names":"info"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NCollapseItem),{name:"info",title:e.unref(l)("Property")},{default:e.withCtx(()=>[e.createVNode(kt,{data:n.data,columns:n.columns,names:n.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"]),e.createElementVNode("div",zs,[e.createVNode(e.unref(p.NButton),{text:"",onClick:r[1]||(r[1]=a=>o.value=!o.value),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(_a))]),_:1})]),_:1},8,["title"])])]),_:1},8,["title"])]),_:1}),e.renderSlot(n.$slots,"default")])]),_:3})]),_:3},8,["show"])]))}}),$s={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ds=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$s,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Rs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Os=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Rs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Fs=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),Ps={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Hs=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ps,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),Gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ks=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zs=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),Ys={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Qs=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ys,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Nt=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),Js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},qs=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),Us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},tn=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},on=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",vs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},nn=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),ti={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ln=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ti,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ni=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),li={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ri=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",li,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),ai={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ai,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ii=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},di=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ci,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),fi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ui=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),pi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},mi=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",pi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),hi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},gi=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",hi,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),yi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},rn=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",yi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),wi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},an=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),Ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},bi=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ci,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),ki={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ni=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ki,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),xi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Si=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",xi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),Ii={style:{"min-height":"50px"}},St=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=Z(),n=e.ref(null),r=e.ref(i()),a=e.ref(null),s=e.ref(m());function i(){let c=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const u=l.supportedFormats;return u&&(c=c.filter(g=>u.includes(g.value))),n.value=c.length?c[0].value:null,c}function m(){const c=l.supportedRanges||["empty","selection","page","all"],u=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(g=>c.includes(g.value));return l.range?a.value=l.range:a.value=u.length?u[0].value:null,u}return e.watch(()=>l.range,c=>{c&&(a.value=c)}),(c,u)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{show:c.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:u[4]||(u[4]=()=>c.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{onClick:u[2]||(u[2]=()=>c.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(on))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{onClick:u[3]||(u[3]=()=>c.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Ii,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(p.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSelect),{options:r.value,value:n.value,"onUpdate:value":u[0]||(u[0]=g=>n.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),s.value.length>1?(e.openBlock(),e.createBlock(e.unref(p.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSelect),{options:s.value,value:a.value,"onUpdate:value":u[1]||(u[1]=g=>a.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"options")])]),_:3},8,["show","title"]))}}),Bi={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},sn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Bi,[e.createVNode(e.unref(p.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(bi))]),_:1}),e.createVNode(e.unref(p.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),Vi=e.defineComponent({components:{FullscreenIcon:ka,ExitFullscreenIcon:Ca},emits:["change"],setup(t,l){const{t:o}=Z(),n=Ne(),r=e.computed(()=>n.isFullscreen);function a(c){c||(c=document.body),c.requestFullscreen&&c.requestFullscreen()}function s(){document.exitFullscreen&&document.exitFullscreen()}function i(c){var u;if(r.value)s();else{const g=(u=c.target)==null?void 0:u.closest(".fullscreen-view");a(g)}}function m(){const c=!!document.fullscreenElement;n.setIsFullscreen(c),l.emit("change",c)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",m),document.addEventListener("mozfullscreenchange",m),document.addEventListener("webkitfullscreenchange",m),document.addEventListener("msfullscreenchange",m)}),{t:o,isFullscreen:r,toggleFullscreen:i}}});function Mi(t,l,o,n,r,a){const s=e.resolveComponent("fullscreen-icon"),i=e.resolveComponent("exit-fullscreen-icon"),m=e.resolveComponent("n-icon"),c=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(c,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(i,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const cn=re(Vi,[["render",Mi]]),dn=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(g=>{typeof g=="string"?(o[g]=!1,n.push(g)):(o[g.id]=!1,o[g.name]=!1,n.push(g.id),r.push(g))});let a=0;async function s(g){a||await m(g)}function i(){for(let g in o)o[g]=!1}async function m(g){i();const d=n.filter(h=>(h==null?void 0:h.length)==32);if(d.length)try{let h=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(d.join())}`);h.isSuccess&&h.value!=null?(a++,h.value.forEach(b=>{o[b]=!0;const x=r.find(I=>I.id==b);x&&(o[x.name]=!0)}),g==null||g.call(null,o)):console.error(h.errorMessage)}catch(h){console.error(h)}}function c(){for(let g in o)if(!o[g])return!1;return!0}function u(){for(let g in o)if(o[g])return!0;return!1}return{flags:o,check:m,checkOnce:s,all:c,any:u}},Ai={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Ti={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},fn=200,It=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=me(),s=e.inject("axios"),i=p.useMessage(),m=dn(["2E2466DDD34847C8B33460E4277A6528"]),c=e.ref(o.pageSize),u=e.ref(!1),g=e.ref(!1),d=N=>N?N.map((S,T)=>({columnId:S.name,title:S.title?r(S.title):r(te(S.name)),visible:!0,sortIndex:T})).sort((S,T)=>S.sortIndex-T.sortIndex):[],h=N=>(S,T)=>{let O=null;if(N=="visible"){const j=Re(S[N]);O=e.h(p.NIcon,{size:"20"},{default:()=>j?e.h(Zs):e.h(Ks)})}else N=="move_up"?O=e.h(p.NIcon,{size:"20"},{default:()=>e.h(Hs)}):N=="move_down"&&(O=e.h(p.NIcon,{size:"20"},{default:()=>e.h(Ds)}));return e.h(p.NButton,{text:!0,onClick:j=>{b(S,T,N),j.stopPropagation()}},{default:()=>O})};function b(N,S,T){switch(T){case"visible":N.visible=!N.visible;break;case"move_up":if(S>0&&V.value){const O=V.value.splice(S,1);V.value.splice(S-1,0,O[0])}break;case"move_down":if(V.value&&S<V.value.length-1){const O=V.value.splice(S,1);V.value.splice(S+1,0,O[0])}break}}const x=()=>{const N=o.gridId;N&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${N}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function I(){if(!o.gridId)return;const N={dataGridId:o.gridId,pageSize:c.value,columns:V.value.filter(S=>S.columnId).map((S,T)=>({columnId:S.columnId,visible:S.visible,sortIndex:T}))};N.pageSize&&(N.pageSize=Math.max(1,Math.min(fn,N.pageSize)));try{const S=u.value&&g.value,T=await s.post(`/api/core/UserDataGrids/Save?isDefault=${S}`,N);(T==null?void 0:T.isSuccess)==!0?(i.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",c.value),n("update:config",N)):i.error((T==null?void 0:T.errorMessage)||r("Error"))}catch(S){i.error((S==null?void 0:S.toString())||r("Error"))}}async function H(){if(o.gridId&&V.value.length)try{const N=u.value&&g.value,S=await s.get(`/api/core/UserDataGrids/${encodeURIComponent(o.gridId)}?isDefault=${N}`);if(S!=null&&S.isSuccess)if(S.value){c.value=S.value.pageSize;for(const T of S.value.columns){const O=V.value.find(j=>j.columnId==T.columnId);O&&(O.visible=T.visible,O.sortIndex=T.sortIndex),V.value.sort((j,z)=>j.sortIndex-z.sortIndex)}}else V.value=d(o.gridColumns),c.value=o.pageSize;else console.log(S==null?void 0:S.errorMessage)}catch(N){console.log(N)}}e.watch(()=>o.show,N=>{N&&(m.checkOnce(S=>{g.value=S["2E2466DDD34847C8B33460E4277A6528"]}),H())}),e.watch(()=>o.gridColumns,()=>V.value=d(o.gridColumns)),e.watch(u,()=>H());const V=e.ref(d(o.gridColumns)),k=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:h("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:h("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:h("move_down")},{key:"empty",width:20,fixed:"right"}];return(N,S)=>{const T=e.resolveComponent("n-switch"),O=e.resolveComponent("n-data-table"),j=e.resolveComponent("n-input-number"),z=e.resolveComponent("n-space"),P=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(P,{show:N.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:S[3]||(S[3]=()=>N.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(z,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{onClick:I,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{onClick:x,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{onClick:S[2]||(S[2]=()=>N.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",Ai,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(T,{value:u.value,"onUpdate:value":S[0]||(S[0]=A=>u.value=A)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(O,{columns:k,data:V.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",Ti,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(j,{value:c.value,"onUpdate:value":S[1]||(S[1]=A=>c.value=A),max:fn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),un=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),s=e.ref(!1),i=e.ref([]);async function m(u){let g=o.sourceUrl;if(g){const d=o.labelFormatter,h=o.keyField,b=o.labelField,x=o.subLabelField,I=o.additionalQuery;s.value=!0,i.value=[];try{I&&(g=v(g,I,!0));const H=await a.get(g);if(H.isSuccess&&H.value!=null){let V=H.value;if(!Array.isArray(V)&&"rows"in V&&Array.isArray(V.rows)&&(V=V.rows),Array.isArray(V)){const k=V.filter(N=>N&&!0).map(N=>{if(typeof N=="string")return{value:N,label:d?d(N):r(N)};{let S=N[b||"label"];if(d&&(S=d(S)),x){const T=N[x];typeof T=="string"&&(S+=" "+(d?d(T):T))}return{value:N[h||"value"],label:S}}});i.value=k}}}finally{s.value=!1}}}function c(u,g){n("update:value",u,g)}return e.watch(()=>o.sourceUrl,()=>m()),e.onMounted(()=>{m()}),(u,g)=>{const d=e.resolveComponent("n-radio-button"),h=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(h,{value:u.value,size:u.size,"onUpdate:value":c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,b=>(e.openBlock(),e.createBlock(d,{key:b.value,value:b.value,label:b.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ke=re(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=e.inject("axios"),i=V=>V==null?void 0:V.map(k=>typeof k=="string"?{label:a(k),value:k}:k),m=()=>{const V=new Array;if(n.searchItems)for(const k of n.searchItems)if(typeof k=="string")V.push({name:k,label:te(k),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let N=k;k.searchField&&(N=Object.assign({},k),N.name=k.searchField),V.push(N)}return V},c=()=>{const V={};if(x.forEach(k=>{V[k.name]=null,k.searchMethod=="range"&&(V[k.name+"From"]=null,V[k.name+"To"]=null)}),n.searchArgs)for(const k in V)n.searchArgs[k]!=null&&(V[k]=n.searchArgs[k]);return V},u=()=>{for(const V in I)I[V]=null},g=async V=>{var N,S;const k=V.valueSource;if(k){if(k.type=="remote"&&k.sourceUrl)await Fe(s,k,null,T=>k.i18n?a(T):T,!1),V.nullable==!1&&((N=k.values)!=null&&N.length)&&(I[V.name]=k.values[0].value);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const T=(S=k.func)==null?void 0:S.call(void 0);T&&(k.values=T)}finally{k.isLoading=!1}}}},d=()=>{var k;const V={};for(const N of x){const S=N.searchField??N.name;if(N.searchMethod=="range"){const T=h(S+"From",N);T!=null&&(V[S+"From"]=T);let O=h(S+"To",N);O!=null&&(N.editor=="date"&&typeof O=="string"&&(O=se(O,ge).add(1,"days").format(ge)),V[S+"To"]=O)}else{const T=h(S,N);T!=null&&(((k=N.role)==null?void 0:k.includes("list"))==!0&&typeof T=="string"?T.includes(",")?V[S]=T.split(","):V[S]=[T]:V[S]=T)}}return V},h=(V,k)=>{var S,T;let N=I[V];if(!(typeof N=="string"&&(N=N.trim(),N==""&&!k.valueSource))){if(Array.isArray((S=k.valueSource)==null?void 0:S.values)){const O=(T=k.valueSource)==null?void 0:T.values;if(O){if(O.some(j=>j.value==I[V]))N=I[V];else if(N=="")return;if(k.dataType=="boolean"){if(typeof N=="boolean")return N;const j=O.findIndex(z=>z.value==N);return j>-1&&(O.length==2?N=j==0:O.length==3&&j>0&&(N=j==1)),typeof N=="boolean"?N:Oe(N,k.dataType,k.role)}}}return Oe(N,k.dataType,k.role)}},b=()=>{r("update:searchArgs",d())},x=m(),I=e.reactive(c()),H=e.ref(i(n.groupOptions));return e.watch(()=>n.groupOptions,()=>H.value=i(n.groupOptions)),e.onMounted(()=>{c(),x.forEach(V=>{V.valueSource&&(V.valueSource.type=="remote"||V.valueSource.type=="function"?g(V):V.valueSource.type=="static")})}),l({reset:u,updateValues:b,pickValues:d}),(V,k)=>(e.openBlock(),e.createBlock(e.unref(p.NForm),{model:I,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),N=>(e.openBlock(),e.createBlock(e.unref(p.NGridItem),{key:N.name},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NFormItem),{label:e.unref(a)(N.label==null?N.name:N.label),path:N.name},{default:e.withCtx(()=>[N.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(p.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Be,{"form-item":N,value:I[N.name+"From"],"onUpdate:value":S=>I[N.name+"From"]=S,style:{"flex-grow":"1"},onInput:k[0]||(k[0]=()=>b())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(p.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Be,{"form-item":N,value:I[N.name+"To"],"onUpdate:value":S=>I[N.name+"To"]=S,style:{"flex-grow":"1"},onInput:k[1]||(k[1]=()=>b())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Be,{key:1,"form-item":N,value:I[N.name],"onUpdate:value":S=>I[N.name]=S,onInput:k[2]||(k[2]=()=>b())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),H.value?(e.openBlock(),e.createBlock(e.unref(p.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSelect),{value:V.groupBy,options:H.value,"onUpdate:value":k[3]||(k[3]=N=>V.$emit("update:groupBy",N))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),Ei={class:"flex-row gap05"},Bt=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=me(),r=e.ref([]);async function a(){var i;const s=((i=l.tags)==null?void 0:i.map(m=>({value:m,text:m})))??[];if(r.value=s,l.tagSource){const m=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const c of s){const u=m.find(g=>g.code==c.value);u&&(c.desc=u.name,c.color=u.color)}r.value=[...s]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(s,i)=>(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,m=>(e.openBlock(),e.createBlock(e.unref(p.NTag),{key:m.value,title:m.desc,color:{borderColor:m.color},size:s.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),We=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=fe.useRouter(),i=gt(),m=e.ref(void 0),c=e.ref(H()),u=e.ref([]),g=e.ref(void 0),d=e.ref(h());function h(){const C={};return typeof n.height=="number"?C.height=`${n.height}px`:typeof n.height=="string"&&(C.height=n.height),C}function b(){var L;const C=u.value,M=(L=n.data)==null?void 0:L.filter($=>C.includes($[n.keyField]));r("update:selectedIds",C,M),C.length&&r("update:selectedId",C[0])}function x(C){return C[n.keyField]}function I(C,M){let L=0,$=0;for(const _ of M){let F,Y;if(typeof _=="string")F={key:_,title:a(te(_))};else if(!(_.behavior=="none"||_.visible==!1))if(_.behavior=="link"||_.behavior=="router-link")F={key:_.name||`column_${L}`,title:_.title?a(_.title):void 0,align:_.align,fixed:_.fixed||void 0,width:_.width,sorter:_.sortable==!0,render:_.render||V(_)};else if(_.behavior=="button")F={key:_.name||`column_${L}`,title:_.title?a(_.title):void 0,align:_.align||"center",fixed:_.fixed||void 0,width:_.width,sorter:_.sortable==!0,render:_.render||V(_)};else{let U=_.align,ee=[];if(!_.display)switch(_.dataType){case"number":U=U||"right",Y=60,ee.push("text-num");break;case"boolean":U=U||"center",Y=60;break;case"date":Y=100;break;case"datetime":Y=180;break;case"timespan":U=U||"center",Y=80;break;case"time":Y=80,ee.push(`text-${_.dataType}`);break}if(F={key:_.name||`column_${L}`,title:_.title==null?a(te(_.name)):_?a(_.title):void 0,titleAlign:"center",align:U,width:_.width||Y,sorter:_.sortable==!0,minWidth:_.minWidth,resizable:!0,fixed:_.fixed,render:_.render||V(_)},typeof _.className=="string"?ee.push(_.className):Array.isArray(_.className)&&ee.push(..._.className),ee.length&&(F.className=ee.join(" ")),!F.width&&F.minWidth&&(F.width=F.minWidth),_.referencePage&&typeof F.width=="number"&&(F.width+=30),_.role&&_.role.includes("qr")&&typeof F.width=="number"&&(F.width+=30),_.role&&_.role.includes("percent")&&typeof F.width=="number"&&(F.width+=30,F.align||(F.align="right")),(_.textOverflow=="ellipsis"||_.textOverflow=="clip")&&(F.ellipsis={tooltip:!0},F.resizable=!0,Y||(Y=400)),_.children&&_.children.length){const oe=[];I(oe,_.children),F.children=oe,oe.some(ne=>ne.width)&&(F.width=void 0)}}F&&(C.push(F),typeof _=="object"&&typeof _.width=="number"?$+=_.width:$+=Y||150)}return $}function H(){if(n.columns){const C=[];let M=0;return n.checkable&&(C.push({type:"selection",fixed:"left"}),M+=30),M+=I(C,n.columns),n.withEdit&&(C.push({key:"btn-edit",width:30,fixed:"right",render(L,$){return e.h(p.NButton,{text:!0,titie:a("Edit"),onClick:_=>{r("editRow",L,$),_.stopPropagation()}},{default:()=>e.h(p.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h($o)})})}}),M+=30),n.withDelete&&(C.push({key:"btn-delete",width:30,fixed:"right",render(L,$){return e.h(p.NButton,{text:!0,titie:a("Delete"),onClick:_=>{r("deleteRow",L,$),_.stopPropagation()}},{default:()=>e.h(p.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(zo)})})}}),M+=30),n.withDetails&&(C.push({key:"btn-details",width:30,fixed:"right",render(L,$){return e.h(p.NButton,{text:!0,titie:a("Details"),onClick:_=>{r("showDetails",L,$),_.stopPropagation()}},{default:()=>e.h(p.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(Ka)})})}}),M+=30),n.dragSorting&&(C.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(p.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(ni)})}}),M+=30),m.value=M,C}else return[]}function V(C){return(M,L)=>{var ee,oe,ne;let $=null;const _=C.display||C.name;if(C.template&&typeof C.template=="function")$=C.template.call(null,M,L);else if(C.dataType=="bool"||C.dataType=="boolean"){const W=Re(M[_]);if(C.values&&C.values.length>1)return C.i18n?a(W?C.values[0]:C.values[1]):W?C.values[0]:C.values[1];W!=null?$=e.h(p.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(Qs):e.h(mi)}):$=e.h("span")}else if(C.dataType=="date")$=Mo(No(M[_]));else if(C.dataType=="time")$=Vo(So(M[_]));else if(C.dataType=="timespan")$=Ao(M[_]);else{let W=M[_];C.formatter?W=C.formatter(W,M):C.template&&(W=Ce.render(C.template,M)),typeof W=="string"&&(C.prefix&&(W=C.prefix+W),C.suffix&&(W=W+C.suffix),C.i18n&&(W=a(W))),$=W}let F=C.role;if(F&&!Array.isArray(F)&&(F=[F]),F!=null&&F.length)if(F.includes("tag")){let W;Array.isArray(M[_])?W=M[_]:W=(ne=(oe=(ee=M[_])==null?void 0:ee.toString())==null?void 0:oe.split(","))==null?void 0:ne.filter(K=>K.length),W&&W.length&&($=e.h(Bt,{tags:W,tagSource:C.tagSource},{}))}else $&&($=e.h("span",{class:F.map(W=>{switch(W){case"status":return`status-tag status-${M[_]}`;default:return`halo-form-${W}`}}).join(" ")},[$]));const Y=typeof C.href=="function"?C.href(M):C.href;if(C.behavior=="link")Y?$=e.h("a",{href:Ce.render(Y,M),target:"_blank"},[$]):$=e.h("a",{href:"#",onClick:W=>{var K;r("columnButtonClick",C.name,M,L),(K=C==null?void 0:C.click)==null||K.call(null,M,L),W.stopPropagation()}},[$]);else if(C.behavior=="router-link"&&Y){const W=$;$=e.h(fe.RouterLink,{to:Ce.render(Y,M)},{default:()=>W})}else if(C.behavior=="button"){const W=$;$=e.h(p.NButton,{size:"tiny",tag:"a",onClick:K=>{var ce;r("columnButtonClick",C.name,M,L),(ce=C==null?void 0:C.click)==null||ce.call(null,M,L),K.stopPropagation()}},{default:()=>W})}const U=[];if(C.role&&(C.role.includes("qr")&&U.push(e.h(p.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>N(C,L)},{default:()=>e.h(p.NIcon,{},{default:()=>e.h(gi)})})),C.role.includes("percent"))){const W=_o(M[_]);U.push(e.h(p.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return C.referencePage&&U.push(e.h(p.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>k(C,L)},{default:()=>e.h(p.NIcon,{},{default:()=>e.h(rn)})})),U.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[$]),e.h("div",{},...U)]):$}}function k(C,M){if(Array.isArray(n.data)&&M!=null&&M>=0&&M<n.data.length&&C.referencePage){const L=n.data[M],$=Ce.render(C.referencePage,L);$.startsWith("/")&&s.push({path:$})}}function N(C,M){if(Array.isArray(n.data)&&M!=null&&M>=0&&M<n.data.length){const L=n.data[M][C.name];if(typeof L=="string"){const $=a(C.title??te(C.name));i.showQrModal(L,$)}}}function S(C,M){return{onClick:L=>{if(L.target instanceof HTMLElement&&L.target.classList.contains("n-checkbox-box__border")==!1){const $=x(C);$!==void 0&&!u.value.includes($)&&(u.value=[$],b())}},ondblclick:L=>{L.target instanceof HTMLTableCellElement&&r("editRow",C,M)}}}function T(C,M){M!=!1||!n.multiSelect?(u.value=[C],b()):u.value.includes(C)||(u.value.push(C),b())}function O(C,M){if(M!=!1||!n.multiSelect)u.value=C,b();else{const L=u.value.slice();for(const $ of C)L.includes($)||L.push($);u.value.length<L.length&&(u.value=L,b())}}function j(C){n.multiSelect?u.value=C:u.value=C.slice(0,1),b()}function z(){return u.value}function P(C,M){Array.isArray(n.data)&&C>-1&&vo(n.data,C,M)}function A(){var L;const C=(L=g.value)==null?void 0:L.$el,M=C==null?void 0:C.querySelector("tbody.n-data-table-tbody");if(M&&Array.isArray(n.data)){const $=e.ref(n.data);ll.useDraggable(M,$,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(_){var U;const F=_.oldIndex,Y=_.newIndex;if(F!=null&&Y!=null&&n.data&&F<((U=n.data)==null?void 0:U.length)){const ee=n.data[F];console.log(F,Y,ee==null?void 0:ee.id),r("rowSorting",{oldIndex:F,newIndex:Y,source:ee,updateGrid:()=>P(F,Y)})}}})}}return e.watch(()=>n.data,C=>{const L=C.map($=>$[n.keyField]);u.value=u.value.filter($=>L.includes($)),b()}),e.watch(()=>n.columns,()=>c.value=H()),e.watch(()=>n.height,()=>d.value=h()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{A()},500)}),l({selectRow:T,selectRows:O,getSelectedRowKeys:z}),(C,M)=>(e.openBlock(),e.createBlock(e.unref(p.NDataTable),{ref_key:"nTableRef",ref:g,columns:c.value,data:C.data,size:"small","row-key":x,"row-props":S,loading:C.loading,"single-line":!1,"max-height":C.maxHeight,"scroll-x":m.value,striped:"",remote:"","flex-height":C.flexHeight,style:e.normalizeStyle(d.value),"checked-row-keys":u.value,"onUpdate:checkedRowKeys":[M[0]||(M[0]=L=>u.value=L),j],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":M[1]||(M[1]=L=>C.$emit("update:sorter",L))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),_i={class:"flex-column gap05"},Li={class:"flex-row gap05",style:{"justify-content":"space-between"}},Ze=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=p.useMessage(),i=e.inject("axios"),m=e.ref(null),c=e.ref(1),u=e.ref(0),g=e.ref(!1),d=e.ref(Array()),h=e.ref(Array());let b=!0;function x(S){if(S){const T=S.rows;T.forEach((O,j)=>{O.__key__=j}),d.value=T,u.value=S.pageCount||1,c.value=S.pageIndex+1}}function I(){d.value=[],u.value=0,c.value=1}function H(S){V(S)}async function V(S){var j,z,P;const T=((j=m.value)==null?void 0:j.pickValues())||{},O=(z=n.config)==null?void 0:z.searchAction;if(T&&O){const A={pageSize:((P=n.config)==null?void 0:P.pageSize)||10,pageIndex:(S||c.value)-1};Object.assign(A,T),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(A,n.additionQuery.call(null)):Object.assign(A,n.additionQuery));try{g.value=!0;const C=await i.post(O,A);C.isSuccess&&C.value!=null?(b=!1,x(C.value)):s.error(a(C.errorMessage||"Error"))}catch(C){s.error(C==null?void 0:C.toString())}finally{g.value=!1}}}function k(){const S=h.value;if(S!=null&&S.length){const T=d.value.filter(O=>S.includes(O.__key__));r("searchBack",T,n.config),n.autoClose==!0&&close()}}function N(){n.searchOnMounted&&b&&V(1)}return e.watch(()=>n.config,S=>{S&&(b=!0),I()}),e.onMounted(()=>N()),l({searchPage:V,returnAndClose:k}),(S,T)=>(e.openBlock(),e.createElementBlock("div",_i,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:m,cols:2,"search-items":S.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",Li,[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:T[0]||(T[0]=()=>V(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:T[1]||(T[1]=()=>{var O;return(O=m.value)==null?void 0:O.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(We,{class:"flex-grow-1",style:{height:"200px"},columns:S.config.gridColumns,loading:g.value,data:d.value,multiSelect:S.multiSelect,selectedIds:h.value,"onUpdate:selectedIds":[T[2]||(T[2]=O=>h.value=O),T[3]||(T[3]=(O,j)=>S.$emit("resultSelected",O,j))],onDblclickRow:T[4]||(T[4]=O=>S.$emit("searchBack",[O]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(p.NPagination),{page:c.value,"onUpdate:page":[T[5]||(T[5]=O=>c.value=O),H],"page-count":u.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),zi={key:0,class:"flex-column flex-grow-1"},$i={class:"flex-row",style:{"align-items":"center"}},Di={style:{"margin-left":"0.5em"}},Ri={class:"flex-row",style:{"justify-content":"space-between"}},Vt=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(void 0);let s=!0;const i=e.ref([]);function m(d,h){i.value=h??[]}function c(d){d&&d.length&&n("searchBack",d,o.config)}function u(){i.value&&i.value.length&&(n("searchBack",i.value,o.config),o.autoClose==!0&&g())}function g(){n("update:show",!1)}return e.watch(()=>o.config,d=>{d&&(s=!0)}),e.watch(a,()=>{var d;o.searchOnMounted&&s&&(s=!1,(d=a.value)==null||d.searchPage(1))}),e.watch(()=>o.show,d=>{var h;d&&o.searchOnMounted&&s&&(s=!1,(h=a.value)==null||h.searchPage(1))}),(d,h)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{show:d.show,style:e.normalizeStyle({width:d.width??"900px",height:d.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:h[0]||(h[0]=()=>g())},{header:e.withCtx(()=>[e.createElementVNode("div",$i,[e.createVNode(e.unref(p.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1}),e.createElementVNode("span",Di,e.toDisplayString(e.unref(r)(d.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",Ri,[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[d.config?(e.openBlock(),e.createElementBlock("div",zi,[e.createVNode(Ze,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:d.config,"multi-select":d.multiSelect,"auto-close":d.autoClose,"addition-query":d.additionQuery,onResultSelected:m,onSearchBack:c},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),Oi={style:{"margin-bottom":"12px","min-height":"100px"}},Mt=re(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=p.useMessage(),s=p.useLoadingBar(),i=e.inject("axios"),m=me(),c=e.reactive({}),u=e.ref(!1),g=e.ref(new Array),d=e.ref(!1),h=e.ref(void 0),b=e.ref(x());function x(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function I(){var N;if(d.value)return a.warning("Is uploading..."),!1;let k=typeof o.action=="function"?o.action.call(void 0):o.action;if(k&&o.templateCode&&(k=v(k,{templateCode:o.templateCode})),(N=g.value)!=null&&N.length&&k){if(!o.multiple&&g.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:g})==!1)return!1;try{d.value=!0;const S=g.value.filter(T=>T.status=="pending"||T.status=="error").map(T=>H(T,k));await Promise.all(S),g.value.every(T=>T.status=="finished")&&(g.value.length=0,a.success(r("Upload Success.")),u.value=!1)}catch(S){h.value=(S==null?void 0:S.toString())||r("Error")}finally{d.value=!1}}}async function H(k,N){const S=new FormData;S.append("file",k.file);const T={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{k.percentage=Math.round(j.loaded*100/j.total)}};k.percentage=0,k.status="uploading";let O=N;o.additionParams&&(O=v(N,o.additionParams)),c&&(O=v(O,c));try{const j=await i.post(O,S,T);j.isSuccess?(k.status="finished",n("uploaded",j.value),n("update:show",!1)):(k.status="error",k.errorMessage=j.errorMessage,h.value=r(j.errorMessage||"Error"))}catch(j){k.status="error",k.errorMessage=j==null?void 0:j.toString(),h.value=(j==null?void 0:j.toString())||r("Error")}}async function V(){const k=b.value;if(k)try{s.start(),await pe(k)}catch(N){a.error(await m.getHttpErrorMessage(N,"Error"))}finally{s.finish()}}return e.watch(()=>o.show,()=>{h.value=void 0,g.value=[]}),(k,N)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{show:k.show,"onUpdate:show":N[3]||(N[3]=S=>k.$emit("update:show",S)),preset:"card",title:e.unref(r)(k.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px"},onClick:I,disabled:k.disabled||!k.action||d.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Si))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(p.NSpace),null,{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,style:{"min-width":"100px"},onClick:V},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(on))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:N[2]||(N[2]=()=>k.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpin),{show:d.value},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NUpload),{multiple:k.multiple,"default-upload":!1,"file-list":g.value,"onUpdate:fileList":N[0]||(N[0]=S=>g.value=S),accept:k.accept,disabled:!k.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",Oi,[e.createVNode(e.unref(p.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(Qa))]),_:1})]),e.createVNode(e.unref(p.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(k.$slots,"options",{options:c},void 0,!0)]),_:3})]),_:3},8,["show"]),h.value?(e.openBlock(),e.createBlock(e.unref(p.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:N[1]||(N[1]=()=>h.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-18129d6e"]]),ji={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},Fi={key:0,class:"flex-row",style:{"justify-content":"space-between"}},Pi={style:{"margin-left":"8px"}},Hi={style:{display:"flex"}},Gi={style:{"flex-grow":"1"}},pn=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){var nl;const n=t,r=o,{t:a}=Z(),s=e.inject("axios"),i=e.ref(Array()),m=p.useDialog(),c=p.useMessage(),u=p.useLoadingBar(),g=fe.useRouter(),d=e.ref(Yo(n.columns||[],a)),h=e.ref(_e(n.columns||[])),b=e.ref(Qo(n.columns||[],a));let x=1;const I=e.ref(1),H=e.ref(0),V=e.ref(0),k=e.ref(n.pageSize),N=e.ref(!0),S=e.ref(!1),T=e.ref(!1),O=e.ref(""),j=e.ref(n.searchAction&&((nl=n.columns)==null?void 0:nl.some(f=>Ie(f)&&f.search))),z=e.ref(j.value&&!n.getListAction),P=e.ref(z.value&&!0),A=e.ref(!1),C=e.ref(null),M=e.ref(null),L=e.ref(new Array),$=e.ref(!1),_=e.ref(void 0),F=e.ref(void 0),Y=e.ref(void 0),U=e.ref(!1),ee=e.ref(n.readOnly),oe=e.ref(a("Property")),ne=e.ref(!1),W=e.ref(!1);let K;const ce=e.ref([]),Et=e.ref(Lt("page")),Rn=e.ref($c()),_t=e.ref(void 0),he=e.ref([]),Ve=e.ref(void 0),Qe=e.ref(!1);let ye;const On=e.ref(void 0),we=e.ref(void 0),Me=e.ref(void 0);let Le=[],ze=0;const zc=e.ref({width:Dc(n.modalColumns)});function $c(){var y;const f={};if(n.defaultSearchArgs)for(const w in n.defaultSearchArgs)f[w]=n.defaultSearchArgs[w];return(y=b.value)==null||y.forEach(w=>{w.defaultValue!=null&&(w.searchMethod=="range"?Array.isArray(w.defaultValue)&&(w.defaultValue.length>0&&w.defaultValue[0]!=null&&(f[`${w.name}From`]=w.defaultValue[0]),w.defaultValue.length>1&&w.defaultValue[1]!=null&&(f[`${w.name}To`]=w.defaultValue[1])):f[w.name]=w.defaultValue)}),f}function Lt(f){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(f)?n.exportRanges[0]:f}function Dc(f){return f?f>4?"100%":f>1?450*f+"px":"600px":"600px"}function Xe(f){if(n.keys){if(typeof n.keys=="string")return f[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return f[n.keys[0]];if(n.keys.length>1)return n.keys.map(y=>f[y]).join()}return""}function Je(f){if(f.__key__=Xe(f),n.columns)for(const y of n.columns){let w;if(typeof y=="string")w=y;else if(Ie(y))w=y.name;else continue;w&&!(w in f)&&(f[w]=null)}}function jn(f){if(f){r("beforeRenderPage",{data:f});const w=f.rows;w.forEach(E=>Je(E)),i.value=w,r("update:data",i.value),V.value=f.totalRecords||0,H.value=f.pageCount||1,I.value=f.pageIndex+1,N.value=!0}}function Fn(f){if(f){const y={data:f};r("beforeRenderPage",y),f=y.data,f.forEach(w=>Je(w)),i.value=f,r("update:data",i.value),H.value=1,I.value=1,N.value=!1}}async function de(f){var y,w;if(!(S.value||n.disabled)&&n.getListAction){const E={pageSize:k.value,pageIndex:f},D=(y=O.value)==null?void 0:y.trim();if(n.quickSearch&&D&&(E.searchWords=D),n.additionKeys&&Object.assign(E,n.additionKeys),n.parentKey&&!ae(E))return;(we.value||n.defaultSortBy)&&(E.sortBy=we.value??n.defaultSortBy,E.sortDirection=Me.value??n.defaultSortDirection);try{S.value=!0;let G=n.getListAction;typeof G=="function"&&(G=G.call(void 0));const X=v(G,E),R=await s.get(X);R!=null&&R.isSuccess&&R.value?(ze++,R.value&&(Array.isArray(R.value)?Fn(R.value):jn(R.value))):c.error(a((R==null?void 0:R.errorMessage)??((w=R==null?void 0:R.value)==null?void 0:w.toString())??"Error"))}catch(G){c.error((G==null?void 0:G.toString())??a("Error")),console.error(G)}finally{S.value=!1}}}function $e(f){if(!n.disabled)if(P.value&&ye){const y=Object.assign({},ye);y.sortBy=we.value,y.sortDirection=Me.value,Dt(y)}else f!=null?de(f):de(I.value-1)}function zt(){de(0)}function Rc(){O.value="",de(0)}function Oc(f){if(n.additionKeys)for(const y in n.additionKeys){const w=n.additionKeys[y];w!=null&&(f[y]=w)}}function Pn(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(f=>f==null));if(typeof n.verifyParentKey=="function"){const f=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof f=="boolean")return f}return!0}function ae(f){if(n.verifyParentKey&&Pn()==!1)return!1;if(n.parentKey){const y={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let w=0;w<n.parentKey.length;w++){const E=n.parentKey[w];(typeof E=="string"||typeof E=="number")&&n.parentValue.length>w&&(y[E]=n.parentValue[w])}else for(let w=0;w<n.parentKey.length;w++){const E=n.parentKey[w];(typeof E=="string"||typeof E=="number")&&(y[E]=n.parentValue)}else n.parentKey&&(y[n.parentKey]=n.parentValue);f&&Object.assign(f,y)}return!0}async function $t(){var y;if(n.disabled)return;const f=(y=C.value)==null?void 0:y.pickValues();if(f&&n.searchAction){const w={};Object.assign(w,f),Oc(w),w.pageSize=k.value,w.pageIndex=0,w.sortBy=we.value,w.sortDirection=Me.value,w.groupBy=_t.value,Dt(w)}}async function Dt(f){if(!S.value)try{S.value=!0;let y=n.searchAction;if(typeof y=="function"&&(y=y.call(void 0,f)),!y)return;const w={};if(!ae(w))return;y=v(y,w);const E=await s.post(y,f);E.isSuccess&&E.value!=null?(ze++,ye=f,r("searchReturn",{data:E.value,query:f,action:y}),Array.isArray(E.value)?Fn(E.value):jn(E.value)):c.error(a(E.errorMessage||"Error"))}catch(y){c.error(y==null?void 0:y.toString())}finally{S.value=!1}}function Hn(f,y){const w={};if(ae(w)){if(typeof n.keys=="string"?w[n.keys]=f[n.keys]:n.keys.forEach(D=>w[D]=f[D]),Array.isArray(n.detailsKeys))n.detailsKeys.map(D=>D.toString()).forEach(D=>w[D]=f[D]);else if(typeof n.detailsKeys=="object"){const D=n.detailsKeys;for(const G in D){var E=D[G];E&&(w[G]=f[E])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,w):n.detailsKeys&&(w[n.detailsKeys]=f[n.detailsKeys]);if(n.detailsPageName)g.push({name:n.detailsPageName,params:w});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const D=n.detailsPage(f,y);(typeof D=="string"||typeof D=="object")&&g.push(D)}else g.push({path:n.detailsPage,query:w})}}async function Rt(f,y){var w;if(!n.disabled)if(n.getEntityAction){const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!ae(E))return;typeof n.keys=="string"?E[n.keys]=f[n.keys]:n.keys.forEach(D=>E[D]=f[D]);try{let D=n.getEntityAction;typeof D=="function"&&(D=D.call(void 0,f,y));const G=v(D,E),X=await s.get(G);X.isSuccess&&X.value!=null?qe(X.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):c.error(a((X==null?void 0:X.errorMessage)??((w=X==null?void 0:X.value)==null?void 0:w.toString())??"Error"))}catch(D){c.error((D==null?void 0:D.toString())??a("Error")),console.error(D)}}else qe(f,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Ot(f,y){n.readOnly||n.disabled||n.deleteAction&&f&&f.__key__&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{jc(f,y)}})}async function jc(f,y){var w;if(n.deleteAction&&n.keys.length)try{const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!ae(E))return;typeof n.keys=="string"?E[n.keys]=f[n.keys]:n.keys.forEach(q=>E[q]=f[q]);const D=f.__key__;let G=n.deleteAction;typeof G=="function"&&(G=G.call(void 0,f,y));const X=v(G,E);let R;if(n.deleteMethod=="POST"?R=await s.post(X):R=await s.delete(X),R.isSuccess){let q=i.value.indexOf(f);if(q>-1&&(i.value.splice(q,1),c.success(a("The data has been deleted."))),L.value&&(q=L.value.findIndex(Q=>Q==D),q>-1)){L.value.splice(q,1);const Q=(w=i.value)==null?void 0:w.filter(ad=>L.value.includes(ad["__key__]"]));r("update:selectedIds",L.value,Q),L.value.length?r("update:selectedId",L.value[0],Q!=null&&Q.length?Q[0]:void 0):r("update:selectedId",void 0,void 0)}}else c.error(a(R.errorMessage||"Error"))}catch(E){console.error(E),c.error(E==null?void 0:E.toString())}}function Fc(f){n.readOnly||n.disabled||n.deleteBatchAction&&f&&f.length&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{Pc(f)}})}async function Pc(f){if(n.deleteBatchAction&&f.length)try{const y={ids:f.join()};if(n.additionKeys&&Object.assign(y,n.additionKeys),!ae(y))return;let w=n.deleteBatchAction;typeof w=="function"&&(w=w.call(void 0));const E=v(w,y);let D;if(n.deleteMethod=="POST"?D=await s.post(E):D=await s.delete(E),D.isSuccess){for(const G of f){const X=i.value.findIndex(R=>R.__key__==G);X>-1&&i.value.splice(X,1)}L.value=L.value.filter(G=>!f.includes(G)),c.success(a("The data has been deleted."))}else c.error(a(D.errorMessage||"Error"))}catch(y){c.error(y),console.error(y==null?void 0:y.toString())}}function Gn(){if(L.value.length){const f=i.value.find(y=>y.__key__==L.value[0]);f&&Rt(f,i.value.indexOf(f))}}function Kn(){if(L.value.length>1&&n.deleteBatchAction)Fc(L.value);else if(L.value.length){const f=i.value.find(y=>y.__key__==L.value[0]);f&&Ot(f,i.value.indexOf(f))}}function qe(f,y){const w={method:y,original:f,value:Zo(f,d.value)};switch(r("beforeShow",w),Y.value=f,_.value=w.value,F.value=y,U.value=!0,ee.value=y!="create"&&y!="edit",y){case"create":oe.value=a("New");break;case"edit":oe.value=a("Edit");break;default:oe.value=a("Property");break}}function Wn(){Y.value=void 0,_.value=void 0,F.value=void 0,U.value=!1,oe.value=a("Property")}async function jt(){var f;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let y=n.initEntityAction;typeof y=="function"&&(y=y.call(void 0));let w=y;const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!ae(E))return;w=v(w,E);try{const D=await s.get(w);D!=null&&D.isSuccess&&D.value?qe(D.value||{},"create"):c.error(a((D==null?void 0:D.errorMessage)??((f=D==null?void 0:D.value)==null?void 0:f.toString())??"Error"))}catch(D){c.error(a((D==null?void 0:D.toString())??"Error")),console.error(D)}}else{const y=Ko(d.value);qe(y,"create")}}async function Hc(f,y){var D;if(n.readOnly||n.disabled)return;const w=Ve.value;if(!w||w.searchConfig!=y||!w.actionUrl)return;let E;if(w.dataBuilder)E=w.dataBuilder(f);else{let G;if(w.keyPicker?G=w.keyPicker(f):G=f.map(X=>X.id),!G||!G.length)return;E={},E[w.keyName||"ids"]=G}if(E){let G=w.actionUrl;n.additionKeys&&Object.assign(E,n.additionKeys);const X={};ae(X)&&(G=v(G,X),Object.assign(E,X));try{const R=await s.post(G,E);if(R.isSuccess){if(R.value){for(const Q of R.value)Ue(Q);const q=R.value.map(Q=>Xe(Q));(D=M.value)==null||D.selectRows(q),Qe.value=!1}}else c.error(a(R.errorMessage||"Error"))}catch(R){c.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function Zn(f){Ve.value=f,Qe.value=!0}function Gc(f){const y=d.value;if(!y||!y.length)return!1;y.forEach(w=>{w.validationStatus=void 0,w.errorMessage=void 0});for(const w of y)w.nullable===!1&&!w.readonly&&(f[w.name]==null||f[w.name]===null||!w.dataType&&(f[w.name]==null||f[w.name]==null)?(w.validationStatus="error",w.errorMessage=a("Required here.")):(w.validationStatus="success",w.errorMessage=void 0));return!y.some(w=>w.validationStatus=="error"||w.validationStatus=="warning")}function Kc(){if(n.readOnly||n.disabled)return;const f=d.value;if(!f||!f.length)return;const y=F.value;if(y!="create"&&y!="edit")return;const w=_.value,E=Y.value;if(w&&E){const D=Object.assign({},E);for(let G of f){if(G.readonly==!0||Array.isArray(G.readonly)&&G.readonly.includes(y))continue;let X=Oe(w[G.name],G.dataType,G.role);D[G.name]=X}if(r("commitEdit",{data:D,current:w,original:E,method:y}),n.beforeSave&&n.beforeSave(D,y)===!1)return;Gc(D)?Yn({data:D,original:E,method:y}):c.error(a("Form validation failed."))}}async function Yn(f){var y;if(!(n.readOnly||n.disabled||!n.saveAction))try{let w;const E={};if(n.additionKeys)for(const q in n.additionKeys)n.additionKeys[q]!=null&&(f.data[q]=n.additionKeys[q]);const D={};if(!ae(D))return;if(Object.assign(f.data,D),n.enctype=="multipart/form-data"){w=new FormData;const q=Object.keys(f.data);for(const Q of q)f.data[Q]&&w.set(Q,f.data[Q]);E["Content-Type"]="multipart/form-data"}else w=f.data,E["Content-Type"]="application/json;charset=utf-8";let G=n.saveAction;typeof G=="function"&&(G=G.call(void 0));let X=v(G,D);T.value=!0;const R=await s.post(X,w,{headers:E});if(R.isSuccess){if(c.success(a("The data is saved.")),R.value){f.method=="create"?Ue(R.value):f.method=="edit"&&Qn(R.value),(y=M.value)==null||y.selectRow(Xe(R.value)),f.method=="create"&&n.chainCreating?jt():Wn();try{r("saved",{value:R.value,method:f.method})}catch(q){console.error("emit(saved) fail."+(q==null?void 0:q.toString()))}}}else c.error(a(R.errorMessage||"Error")),R.errors&&Wc(d.value,R.errors)}catch(w){c.error((w==null?void 0:w.toString())||a("Error")),console.error(w)}finally{T.value=!1}}function Wc(f,y){if(f&&f.length)for(const w of y){const E=f.find(D=>D.name.toLowerCase()==w.key.toLowerCase());E&&(E.validationStatus="error",E.errorMessage=w.value)}}function Ue(f){Je(f);const y=f.__key__,w=i.value.findIndex(E=>E.__key__==y);w>-1?i.value.splice(w,1,f):i.value.push(f)}function Qn(f){Je(f);const y=f.__key__,w=i.value.find(E=>E.__key__==y);if(w)for(const E in f)w[E]=f[E]}function Zc(f){if(P.value&&ye){const y=Object.assign({},ye);y.pageIndex=Math.max(0,f-1),Dt(y)}else f>0?de(f-1):de(0)}function Yc(f){f&&(k.value=f)}function Qc(f,y){L.value=f,r("update:selectedIds",f,y),r("update:selectedId",f.length?f[0]:void 0,y.length?y[0]:void 0)}async function Xc(f,y){n.exportAction?await Jc(f,y)&&(ne.value=!1):n.dataExchangeCode&&(Jn(f,y),ne.value=!1)}function Xn(f,y,w){const E={outputType:f,dataRange:y,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(E.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const D={pageSize:k.value,pageIndex:I.value,sortBy:we.value,sortDirection:Me.value};n.additionKeys&&Object.assign(D,n.additionKeys),ae(D),E.searchArgs=JSON.stringify(D)}switch(w&&Object.assign(E,w),y){case"selection":if(!L.value||!L.value.length)throw a("Please select the rows to be exported.");E.selectedKeys=L.value;break;case"page":E.pageSize=k.value,E.pageIndex=Math.max(0,I.value-1);break}return E}async function Jc(f,y){let w=n.exportAction;if(typeof w=="function"&&(w=w.call(void 0)),w){try{if(!Pn())return console.log("Invalid parent key."),!1;const E=Xn(f,y,n.exportOptions);ae(E),u.start(),w=v(w,E),await pe(w)}catch(E){console.log(E),c.error((E==null?void 0:E.toString())||a("Error"))}finally{u.finish()}return!0}else return!1}function qc(){n.importAction&&($.value=!0)}async function Uc(){const f=n.importTemplateCode;if(f){const y=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${f}`;try{u.start(),await pe(y)}finally{u.finish()}}}async function Jn(f,y,w=!1){var q;const E=n.dataExchangeCode;if(!E)return;if(y.toLowerCase()=="empty"){const Q=`/api/core/dataExchange/importTemplate?templateCode=${E}&engineName=${f}`;try{u.start(),await pe(Q)}finally{u.finish()}return}const D={name:E,engineName:f,dataRange:y};n.importTemplateCode&&(D.templateCode=n.importTemplateCode);const G={pageSize:k.value,pageIndex:I.value-1};switch(y.toLowerCase()){case"empty":G.pageSize=0,G.pageIndex=0;break;case"all":G.pageSize=2e3,G.pageIndex=0;break}if(!ae(G)){console.log("Invalid parent key.");return}let X=n.exportAction||n.getListAction;typeof X=="function"&&(X=X.call(void 0));let R=X;if(w)try{const Q=await s.post("/api/core/tempData/add",{value:JSON.stringify(D)});if(Q.isSuccess){if(G.exportOptionId=Q.value,R){R=v(R,G);try{u.start(),await pe(R)}finally{u.finish()}}}else c.error((Q==null?void 0:Q.errorMessage)??((q=Q==null?void 0:Q.value)==null?void 0:q.toString())??a("Error"))}catch(Q){c.error((Q==null?void 0:Q.toString())??a("Error")),console.error(Q)}else if(G.exportOption=btoa(JSON.stringify(D)),R){R=v(R,G);try{u.start(),await pe(R)}finally{u.finish()}}}function qn(f){if(f)switch(f){case"menu_export_action":L.value&&L.value.length?Et.value=Lt("selection"):Et.value=Lt("page"),ne.value=!0;break;case"menu_export_template_action":Uc();break;case"menu_import_action":qc();break;case"menu_export":ne.value=!0;break;case"menu_export_template":Jn("Excel","Empty");break;case"menu_import":break;default:{const y=Le.find(w=>w.key==f);y&&Un(y)}break}}function Un(f){var E;const y=L.value,w={selectedId:y!=null&&y.length?y[0]:void 0,selectedIds:y?[...y]:void 0,data:i.value};typeof f!="string"&&((E=f.click)==null||E.call(null,w)),r("extendedMenuSelect",w)}function vc(f){const y=[];n.exportAction&&y.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(p.NIcon,null,{default:()=>e.h(nn)})}),n.importTemplateCode&&y.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&y.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(p.NIcon,null,{default:()=>e.h(ln)})}),n.dataExchangeCode&&(y.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(p.NIcon,null,{default:()=>e.h(nn)})}),y.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(y.push({type:"divider",key:"------------1"}),y.push({label:a("Import"),key:"menu_import",icon:()=>e.h(p.NIcon,null,{default:()=>e.h(ln)})}))),f&&f.length&&(y.push({type:"divider",key:"----------e--1"}),f.forEach(w=>{const E={label:w.label,key:w.key};w.icon?E.icon=pt(w.icon):w.renderIcon&&(E.icon=w.renderIcon),y.push(E)})),ce.value=y}function Ft(f,y){K=f,k.value=f.pageSize,y||(y=[...h.value]),y.forEach(w=>{w.sortIndex=99999});for(const w of f.columns){const E=y.find(D=>D.name==w.columnId);E&&(E.visible=w.visible,E.sortIndex=w.sortIndex)}y.sort((w,E)=>(w.sortIndex||0)-(E.sortIndex||0)),h.value=y}async function ed(f){if(f)try{const y=await s.get(`/api/core/UserDataGrids/${encodeURIComponent(f)}`);y!=null&&y.isSuccess&&y.value?Ft(y.value):y!=null&&y.errorMessage&&console.log(y==null?void 0:y.errorMessage)}catch(y){console.log(y)}}function td(f){f?Ft(f):(h.value=_e(n.columns||[]),k.value=n.pageSize||20),W.value=!1}function od(f,y){var w;for(const E of f)Ue(E);if(y){const E=f.map(D=>Xe(D));(w=M.value)==null||w.selectRows(E)}}function vn(f){if(!f)return;const y=Le==null?void 0:Le.find(w=>w.key==f);y&&Un(y)}function nd(f){var y,w;Array.isArray(f)?(we.value=(y=f[0].columnKey)==null?void 0:y.toString(),Me.value=f[0].order=="ascend"?"Asc":"Desc"):f&&(we.value=(w=f.columnKey)==null?void 0:w.toString(),Me.value=f.order=="ascend"?"Asc":"Desc"),$e()}function el(){const f=new Array;if(n.extendedMenus)for(const w of n.extendedMenus)typeof w=="string"?f.push({label:a(w),key:x++}):(w.key||(w.key=x++),f.push(w));Le=f,ld(f);const y=f.filter(w=>w.group=="import"||w.group=="export");vc(y)}function ld(f){if(f){const y=f.filter(w=>!w.group).map(w=>w.label=="-"?{type:"divider"}:w.icon?{label:w.label,key:w.key,icon:pt(w.icon)}:w.renderIcon?{label:w.label,key:w.key,icon:w.renderIcon()}:{label:w.label,key:w.key});he.value=y}else he.value=[]}function tl(){const f={};return n.parentKey&&ae(f),n.additionKeys&&Object.assign(f,n.additionKeys),f}function ol(){const f=Object.assign({},tl(),n.importOptions);On.value=Object.keys(f).length?f:void 0}function rd(){z?A.value=!A.value:A.value=!1}return e.onMounted(()=>{ol(),n.name&&ed(n.name),n.autoLoad!=!1&&(z.value?n.autoLoad&&$t():de(0)),el()}),e.watch(e.computed(tl),(f,y)=>{JSON.stringify(f)!=JSON.stringify(y)&&(ol(),n.autoLoad!=!1&&ze>0&&$e())}),e.watch(()=>n.extendedMenus,()=>el()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||ze>0)&&de(0)}),e.watch(()=>n.getListAction,(f,y)=>{y&&(n.autoLoad!=!1||ze>0)&&de(0)}),e.watch(k,(f,y)=>{if(f&&y){var w=void 0,E=I.value,D=V.value;if(E>0&&D){const G=Math.ceil(D/f);G<E&&(w=Math.max(0,G-1))}$e(w)}}),e.watch(()=>n.columns,()=>{const f=_e(n.columns||[]);K?Ft(K,f):h.value=f}),l({reloadPage:$e,addRow:jt,addBatch:Zn,editSelectedRow:Gn,deleteSelectedRows:Kn,saveData:Yn,doQuickSearch:zt,clearQuickSearch:Rc,advancedSerach:$t,checkedRowKeys:L,editRow:Rt,deleteRow:Ot,showDetails:Hn,insertRow:Ue,updateRow:Qn,appendRows:od,buildExportArgs:Xn}),(f,y)=>{var w,E,D,G,X;return e.openBlock(),e.createElementBlock("div",ji,[e.renderSlot(f.$slots,"header"),z.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fi,[e.createVNode(e.unref(p.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(f.$slots,"prefix-tools"),f.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(p.NButton),{onClick:()=>Zn(R),disabled:f.readOnly||f.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(Fa))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),f.saveAction&&!f.readOnly&&f.allowNew?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:1,onClick:jt,disabled:f.readOnly||f.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(ui))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),f.saveAction&&!f.readOnly&&f.allowEdit?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:2,onClick:Gn,disabled:f.readOnly||f.disabled||!L.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref($o))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(f.deleteAction||f.deleteBatchAction)&&!f.readOnly?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:3,onClick:Kn,disabled:f.readOnly||f.disabled||!L.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(zo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.NButton),{onClick:y[0]||(y[0]=()=>$e()),disabled:f.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(f.$slots,"suffix-tools"),ce.value.length?(e.openBlock(),e.createBlock(e.unref(p.NDropdown),{key:4,options:ce.value,disabled:f.disabled,onSelect:qn},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(xa))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Nt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(p.NDropdown),{key:5,options:he.value,disabled:f.disabled,onSelect:vn},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(st))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Nt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(f.$slots,"tools"),f.quickSearch?(e.openBlock(),e.createBlock(e.unref(p.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(p.NInput),{class:"flex-grow-1",style:{width:"260px"},value:O.value,"onUpdate:value":y[1]||(y[1]=R=>O.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:zt},{prefix:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!P.value]]),e.withDirectives(e.createVNode(e.unref(p.NButton),{title:e.unref(a)("Search"),onClick:y[2]||(y[2]=()=>zt()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1})]),_:1},8,["title"]),[[e.vShow,!P.value]]),j.value?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:y[3]||(y[3]=()=>P.value=!P.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ga),{key:0})),P.value?(e.openBlock(),e.createBlock(e.unref(ma),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(f.$slots,"neck"),j.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(p.NCard),{key:1,size:"small",hoverable:"",closable:!z.value,onClose:y[8]||(y[8]=()=>P.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:z.value?"pointer":"unset"}]),onClick:rd},[e.createVNode(e.unref(p.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",Pi," … ",512),[[e.vShow,A.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px"},onClick:$t},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:y[6]||(y[6]=()=>{var R;return(R=C.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),ce.value.length==1&&z.value?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,style:{"min-width":"100px"},onClick:y[7]||(y[7]=()=>ne.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),ce.value.length>1&&z.value?(e.openBlock(),e.createBlock(e.unref(p.NDropdown),{key:1,options:ce.value,onSelect:qn},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"search-tools"),z.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(p.NDropdown),{key:2,options:he.value,onSelect:vn},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(st))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Nt))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ke,{"search-items":b.value,ref_key:"searchFormRef",ref:C,"search-args":Rn.value,"onUpdate:searchArgs":y[4]||(y[4]=R=>Rn.value=R),"group-options":f.searchGroupOptions,"group-by":_t.value,"onUpdate:groupBy":y[5]||(y[5]=R=>_t.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!A.value]])]),_:3},8,["closable"])),[[e.vShow,P.value]]):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"grid",{data:i.value,columns:h.value,loading:S.value,style:"background-color: chartreuse;"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:M,data:i.value,columns:h.value,loading:S.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":f.gridDragSorting,"flex-height":f.gridFlexHeight,"with-edit":!!f.saveAction&&!f.readOnly&&f.allowEdit,"with-delete":(!!f.deleteAction||!!f.deleteBatchAction)&&!f.readOnly,"with-details":!!f.detailsPage||!!f.detailsPageName,"multi-select":f.multiSelect,"max-height":f.gridMaxHeight,height:f.gridHeight,checkable:f.gridCheckable,onEditRow:Rt,onDeleteRow:Ot,onShowDetails:Hn,"onUpdate:selectedIds":Qc,onColumnButtonClick:y[9]||(y[9]=(R,q,Q)=>f.$emit("columnButtonClick",R,q,Q)),"onUpdate:sorter":y[10]||(y[10]=R=>nd(R)),onRowSorting:y[11]||(y[11]=R=>f.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[N.value?(e.openBlock(),e.createBlock(e.unref(p.NPagination),{key:0,page:I.value,"onUpdate:page":[y[12]||(y[12]=R=>I.value=R),Zc],"item-count":V.value,"page-size":k.value,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":Yc},{suffix:e.withCtx(({startIndex:R,endIndex:q,itemCount:Q})=>[Q?(e.openBlock(),e.createBlock(e.unref(p.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(q+1)+"] / "+e.toDisplayString(Q),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),f.name?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:1,text:"",onClick:y[13]||(y[13]=()=>W.value=!0)},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ni))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(f.$slots,"default"),e.renderSlot(f.$slots,"bottom",{formItems:d.value,currentData:_.value,list:i.value,selectedKeys:L.value}),e.createVNode(e.unref(p.NModal),{class:"custom-card",show:U.value,"onUpdate:show":y[15]||(y[15]=R=>U.value=R),preset:"card",draggable:"",style:e.normalizeStyle([zc.value,f.modalStyle]),title:oe.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[F.value=="create"||F.value=="edit"?(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,onClick:Kc,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.NButton),{onClick:Wn,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpin),{show:T.value},{default:e.withCtx(()=>[e.createElementVNode("div",Hi,[e.createElementVNode("div",null,[e.renderSlot(f.$slots,"entity-form-left",{data:_.value,original:Y.value,method:F.value})]),e.createElementVNode("div",Gi,[e.renderSlot(f.$slots,"entity-form",{formItems:d.value,data:_.value,original:Y.value,method:F.value},()=>[e.createVNode(bt,{"form-items":d.value,columns:f.modalColumns,data:_.value,original:Y.value,method:F.value,"group-layout":f.formGroupLayout,"read-only":ee.value,onItemChange:y[14]||(y[14]=R=>f.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(f.$slots,"entity-form-right",{data:_.value,original:Y.value,method:F.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(w=f.batchAdds)!=null&&w.length?(e.openBlock(),e.createBlock(Vt,{key:2,show:Qe.value,"onUpdate:show":y[16]||(y[16]=R=>Qe.value=R),draggable:"",config:(E=Ve.value)==null?void 0:E.searchConfig,title:(D=Ve.value)==null?void 0:D.searchTitle,"multi-select":((G=Ve.value)==null?void 0:G.singleOne)!=!0,"addition-query":(X=Ve.value)==null?void 0:X.additionQuery,onSearchBack:Hc},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),f.importAction?(e.openBlock(),e.createBlock(Mt,{key:3,show:$.value,"onUpdate:show":y[17]||(y[17]=R=>$.value=R),draggable:"",action:f.importAction,"addition-params":On.value,timeout:f.importTimeout,"template-code":f.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(f.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),f.dataExchangeCode||f.exportAction?(e.openBlock(),e.createBlock(St,{key:4,show:ne.value,draggable:"","supported-formats":f.exportFormats,"supported-ranges":f.exportRanges,onClose:y[18]||(y[18]=()=>ne.value=!1),onExport:Xc,range:Et.value,"template-code":f.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(f.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),f.name?(e.openBlock(),e.createBlock(It,{key:5,"grid-id":f.name,draggable:"","grid-columns":h.value,pageSize:k.value,"onUpdate:pageSize":y[19]||(y[19]=R=>k.value=R),show:W.value,onClose:y[20]||(y[20]=()=>W.value=!1),"onUpdate:config":td},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),Ki={class:"flex-row gap05",style:{"align-items":"center"}},mn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",Ki,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(p.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(p.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),Wi={key:0,style:{"text-align":"right"}},hn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),s=e.ref(!1),i=e.ref([]);let m;const c=d=>{(!m||m!=d)&&(m=d,u(d))},u=async d=>{let h=o.sourceUrl;if(h){const b=o.labelFormatter,x=o.keyField,I=o.labelField,H=o.subLabelField,V=o.insertBlank,k=o.additionalQuery;s.value=!0,i.value=[];try{d&&(h=v(h,{searchWords:d})),k&&(h=v(h,k,!0));const N=await a.get(h);if(N.isSuccess&&N.value!=null){let S=N.value;if(!Array.isArray(S)&&"rows"in S&&Array.isArray(S.rows)&&(S=S.rows),Array.isArray(S)){const T=S.filter(O=>O&&!0).map(O=>{if(typeof O=="string")return{value:O,label:b?b(O):r(O)};{let j=O[I||"label"];if(b&&(j=b(j)),o.prefix&&(j=o.prefix+j),o.suffix&&(j=j+o.suffix),o.i18n&&(j=r(j)),H){let z=O[H];typeof z=="string"&&(b&&(z=b(z)),o.i18n&&(z=r(z)),z&&(j+=" "+z))}return{value:O[x||"value"],label:j,data:O}}});V&&T.splice(0,0,{value:"",label:""}),i.value=T,o.autoSelect&&!o.value&&T.length&&n("update:value",T[0].value,T[0],T[0].data)}}}finally{s.value=!1}}},g=(d,h)=>{var x;const b=(x=i.value.find(I=>I.value==d))==null?void 0:x.data;n("update:value",d,h,b)};return e.watch(()=>o.sourceUrl,()=>u()),e.watch(()=>o.additionalQuery,(d,h)=>{JSON.stringify(h)!=JSON.stringify(d)&&u()}),e.onMounted(()=>u()),(d,h)=>(e.openBlock(),e.createBlock(e.unref(p.NSelect),{value:d.value,remote:"",loading:s.value,options:i.value,filterable:d.filterable,multiple:d.multiple,placeholder:"",disabled:d.readonly,clearable:d.clearable,onSearch:c,"onUpdate:value":g},{action:e.withCtx(()=>[d.filterable?(e.openBlock(),e.createElementBlock("div",Wi,[e.createVNode(e.unref(p.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),Zi=e.defineComponent({components:{SearchIcon:rn,LeftIcon:Os,RightIcon:Fs},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Z(),n=e.ref(void 0),r=e.ref(s(t.sourceList)),a=e.ref([]);function s(d){return d?d.map(h=>({isSelected:!1,value:h})):[]}function i(){n.value&&l.emit("search",n.value)}function m(){Uo(a.value,d=>d.isSelected)>0&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function c(){a.value.forEach(h=>h.isSelected=!1);let d=!1;r.value.forEach(h=>{h.isSelected&&!a.value.some(b=>b.value==h.value)&&(a.value.push({value:h.value,isSelected:!1}),d=!0)}),d&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function u(d){d.forEach(h=>h.isSelected=!0)}function g(d){d.forEach(h=>h.isSelected=!h.isSelected)}return e.watch(()=>t.sourceList,d=>r.value=s(d)),{t:o,searchWords:n,searchMaterials:i,source:r,target:a,moveRight:c,moveLeft:m,selectAll:u,inverseSelect:g}}}),Yi={class:"flex-row gap1"},Qi={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Xi={class:"flex-row gap1",style:{"justify-content":"flex-end"}},Ji={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},qi={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Ui={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function vi(t,l,o,n,r,a){const s=e.resolveComponent("search-icon"),i=e.resolveComponent("n-icon"),m=e.resolveComponent("n-input"),c=e.resolveComponent("n-checkbox"),u=e.resolveComponent("n-scrollbar"),g=e.resolveComponent("n-spin"),d=e.resolveComponent("n-button"),h=e.resolveComponent("right-icon"),b=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",Yi,[e.createElementVNode("div",Qi,[e.createVNode(m,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=x=>t.searchWords=x),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(s)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(g,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(u,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,x=>(e.openBlock(),e.createBlock(c,{checked:x.isSelected,"onUpdate:checked":I=>x.isSelected=I,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",Xi,[e.createVNode(d,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",Ji,[e.createVNode(d,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(h)]),_:1})]),_:1},8,["onClick"]),e.createVNode(d,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(b)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",qi,[e.createVNode(u,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,x=>(e.openBlock(),e.createBlock(c,{checked:x.isSelected,"onUpdate:checked":I=>x.isSelected=I,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",Ui,[e.createVNode(d,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const gn=re(Zi,[["render",vi]]),yn=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit"],setup(t){var r;const l=t,{t:o}=Z(),n=e.ref((r=l.value)==null?void 0:r.toString());return(a,s)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},onClose:s[3]||(s[3]=()=>a.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:a.submitting,onClick:s[1]||(s[1]=()=>a.$emit("commit",n.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:s[2]||(s[2]=()=>a.$emit("close",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpin),{show:a.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.message),1)]),_:1}),e.createVNode(e.unref(p.NInput),{value:n.value,"onUpdate:value":s[0]||(s[0]=i=>n.value=i),placeholder:a.placeholder,maxlength:a.maxLength,type:a.type,rows:a.lines},null,8,["value","placeholder","maxlength","type","rows"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),wn=re(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),s=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),i=u=>{u.preventDefault(),l.detailFolded||(n.value=!0)},m=u=>{if(!n.value||!r.value||l.detailFolded)return;const g=r.value.getBoundingClientRect();let d;l.direction==="horizontal"?d=(u.clientX-g.left)/g.width:d=(u.clientY-g.top)/g.height;const h=l.minSize/(l.direction==="horizontal"?g.width:g.height),b=1-h;o.value=Math.max(h,Math.min(b,d))},c=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",c)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",c)}),(u,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[u.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",u.mainPanelClass]),style:e.normalizeStyle([[u.mainPanelStyle,a.value],{}])},[e.renderSlot(u.$slots,"main",{},void 0,!0)],6),u.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:i},null,34)),u.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",u.detailPanelClass]),style:e.normalizeStyle([[u.detailPanelStyle,s.value],{}])},[e.renderSlot(u.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-ca4664e2"]]),Cn=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,s)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:s[3]||(s[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s[1]||(s[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:s[2]||(s[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInputNumber),{value:r.value,"onUpdate:value":s[0]||(s[0]=i=>r.value=i)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),ec={class:"flex-column"},bn=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:[Number,String],rootId:{type:[Number,String],default:"0"},rootName:{type:String,default:"Root"},data:Array,loadTreeAction:{type:String,required:!0},moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function,searchWords:String,iconRender:Function},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var P;const o=l,n=t,{t:r}=Z(),a=me(),s=e.ref(b(n.data)),i=e.ref(new Array),m=e.ref(void 0),c=e.ref(((P=s.value)==null?void 0:P.map(A=>A.key))??[]);function u(A,C){for(const M of A){if(M.key==C)return[M];if(M.key!=null&&M.key!=null&&M.children&&!M.isLeaf){const L=u(M.children,C);if(L.length)return L.push(M),L}}return[]}function g(A,C){for(let M=0;M<A.length;M++){const L=A[M];if(L.key==C)return{nodes:A,index:M};if(L.children){const $=g(L.children,C);if($)return $}}return null}function d(A){const C=u(s.value,A);return C?C.reverse():[]}function h(A){return A}function b(A,C=!0){let M=[];if(Array.isArray(A)){const L=(n==null?void 0:n.treeNodeMapper)??h;M=A.map(L)}return C?[{key:n.rootId,label:r(n.rootName),isLeaf:!Array.isArray(M)||M.length==0,children:M}]:M}function x(){a.get({url:n.loadTreeAction,callback:A=>{if(A){const C=b(A);s.value=C,c.value=C.map(M=>M.key)}}})}function I(A){const C=s.value;if(C){const M=C.map(L=>L.children?V(L.children):[]);c.value=M.flat()}}function H(A){const C=s.value;C&&(c.value=C.map(M=>M.key))}function V(A,C){const M=new Array;for(const L of A)if(L.key&&M.push(L.key),L.children){const $=V(L.children);$.length&&M.push(...$)}return M}function k(A){i.value=A;const C=A.length?A[0]:void 0;o("update:selectedId",C==n.rootId?void 0:C);const M=C?d(C):[];o("update:path",M)}function N(A){return e.h("span",null,A.option.label)}function S(A){return n.iconRender?e.h(p.NIcon,null,{default:()=>{var C;return(C=n.iconRender)==null?void 0:C.call(null,A)}}):A.option.isLeaf?e.h(p.NIcon,null,{default:()=>e.h(tn)}):e.h(p.NIcon,null,{default:()=>e.h(xt)})}function T(A){!n.moveAction&&!n.sortAction||(A.dropPosition=="before"||A.dropPosition=="after"?A.dragNode.key&&typeof A.node.key&&j(A.dragNode,A.node,A.dropPosition):A.dropPosition=="inside"&&typeof A.dragNode.key=="number"&&typeof A.node.key=="number"&&O(A.dragNode,A.node))}function O(A,C){const M=n.moveAction;if(!M)return;const L=A.key,$=[A.key],_=C.key;!L||!_||A==C||a.post({url:M,data:{menuItemIds:$,targetId:_},successMessage:"Successful operation.",success:()=>{const F=g(s.value,L);F&&(F.nodes.splice(F.index,1),C.children&&C.children.push(A))}})}async function j(A,C,M){const L=n.sortAction;if(!L)return;const $=A.key;let _=C.key;if(!$||!_||$==_)return;const F=g(s.value,$);if(F){if(M=="after"){const Y=F.nodes.indexOf(C);if(Y>-1&&Y<F.nodes.length-1&&(C=F.nodes[Y+1],_=C.key,!_||$==_))return}a.post({url:L,data:{menuId:$,nextSiblingId:_},successMessage:"Successful operation.",success:()=>{F.nodes.splice(F.index,1);const Y=F.nodes.indexOf(C);Y>-1?F.nodes.splice(Y,0,A):F.nodes.push(A)}})}}function z(A){if(A==null&&(A=n.rootId),i.value.includes(A))return;const C=u(s.value,A);C.length&&(c.value=C.map(M=>M.key),i.value=[A])}return e.watch(()=>n.data,A=>{A?s.value=b(A):s.value=[]}),e.watch(()=>n.selectedId,A=>{z(A)}),e.onMounted(()=>{x()}),(A,C)=>(e.openBlock(),e.createElementBlock("div",ec,[e.createVNode(e.unref(p.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:C[0]||(C[0]=M=>m.value=M)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(an))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(p.NButton),{ghost:"",onClick:x,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(p.NButton),{ghost:"",onClick:C[1]||(C[1]=()=>I()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ri))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(p.NButton),{ghost:"",onClick:C[2]||(C[2]=()=>H()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(qs))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(p.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:t.sortAction!=null||t.moveAction!=null,data:s.value,pattern:m.value,"render-label":N,"render-prefix":S,onDrop:T,"selected-keys":i.value,"default-expanded-keys":c.value,"onUpdate:selectedKeys":k},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),tc=["src"],kn=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(s){if(!r){var i=s.target;i instanceof HTMLImageElement&&(r=!0,i.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(s,i)=>(e.openBlock(),e.createElementBlock("img",{src:s.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,tc))}}),oc={class:"flex-column gap05"},nc={key:0},lc={class:"flex-row gap05",style:{"align-items":"center"}},Nn=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=me(),s=e.ref(!1),i=e.ref(u()),m=e.ref(g()),c=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function u(){if(o.name){const h=Number(localStorage.getItem(`${o.name}:print-copies`));if(h&&h>0)return h}return 1}function g(){if(o.name){const h=localStorage.getItem(`${o.name}:print-collate`);if(h&&(h=="Collated"||h=="Uncollated"))return h}return"Collated"}function d(){if(o.disabled||s.value)return;const h={action:o.action,collate:m.value,copies:i.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(h)==!1)return;let b=h.action;b&&(b=v(b,[{collate:h.collate,copies:h.copies},h.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,m.value),localStorage.setItem(`${o.name}:print-copies`,i.value.toString())),s.value=!1,a.openFile({url:b,loadingStatus:x=>s.value=x,callback:()=>{s.value=!1,n("update:show",!1)}}))}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(p.NModal),{class:"custom-card",show:h.show,preset:"card",style:e.normalizeStyle({width:h.width}),onClose:b[3]||(b[3]=()=>h.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",lc,[e.createVNode(e.unref(p.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ha))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{onClick:d,style:{"min-width":"100px"},type:"primary",loading:s.value,disable:!h.action||h.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(p.NButton),{onClick:b[2]||(b[2]=()=>h.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",oc,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(p.NInputNumber),{value:i.value,"onUpdate:value":b[0]||(b[0]=x=>i.value=x),min:"1"},null,8,["value"])]),i.value>1?(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(p.NSelect),{options:c,value:m.value,"onUpdate:value":b[1]||(b[1]=x=>m.value=x)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),rc={key:0,style:{"text-align":"center"}},ac=["src"],sc={key:1,style:{"text-align":"center"}},xn=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,s)=>{const i=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(p.NModal),{show:a.show,"onUpdate:show":s[1]||(s[1]=m=>a.$emit("update:show",m)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("img",{src:r.value},null,8,ac),e.createVNode(e.unref(p.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(i,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(p.NButton),{onClick:s[0]||(s[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",sc,[e.createVNode(e.unref(p.NEmpty))]))]),_:1},8,["show","title"])}}}),ic={class:"flex-row",style:{"align-items":"center"}},cc={style:{"margin-left":"0.5em"}},Sn=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref([]),s=(c,u)=>{a.value=u??[]},i=()=>{a&&n("searchBack",a.value,o.config)},m=c=>{c&&c.length&&n("searchBack",c,o.config)};return(c,u)=>(e.openBlock(),e.createBlock(e.unref(p.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",ic,[e.createVNode(e.unref(p.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1}),e.createElementVNode("span",cc,e.toDisplayString(e.unref(r)(c.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(Ze,{class:"flex-grow-1",config:c.config,"multi-select":c.multiSelect,"auto-close":c.autoClose,"addition-query":c.additionQuery,onResultSelected:s,onSearchBack:m},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class dc{constructor(){J(this,"rows",Array());J(this,"totalRecords",null);J(this,"pageIndex",0);J(this,"pageSize",10);J(this,"pageCount",null);J(this,"noTotal",!1);J(this,"message",null);J(this,"summary",null);J(this,"currentPageRecords",0);J(this,"meta")}}const fc={class:"flex-grow-1 flex-column"},uc={class:"icon-container"},pc=["title"],Ye="browse_icon_directory",In="page_index",Bn="search_words",Vn=32,At=re(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=me(),a=e.ref(sessionStorage.getItem(Ye)),s=e.ref(d(void 0)),i=e.ref([]),m=e.ref(1),c=e.ref(0),u=e.ref(!1),g=e.ref(sessionStorage.getItem(Bn));function d(V){const k=[{name:n("Root"),path:"/"}];if(V){for(;V.startsWith("/")||V.startsWith("\\");)V=V.substring(1);const N=V.split(/[\\/]+/);let S="/";for(const T of N){S+=T;const O={name:T,path:S};k.push(O),S+="/"}}return k}function h(V){V.isDirectory?a.value=V.path:V.path&&o("update:selected",V.path)}function b(){I(0)}function x(V){I(V-1)}function I(V){V=Math.max(0,V);let k=`/api/core/SystemIcons/page?pageSize=${Vn}&pageIndex=${V}`;var N=g.value;N&&(k+=`&searchWords=${encodeURIComponent(N)}`);const S=a.value;S&&(k+=`&directory=${encodeURIComponent(S)}`),r.get({url:k,callback:T=>{T&&(i.value=T.rows,c.value=T.totalRecords,m.value=T.pageIndex+1,H(T.pageIndex,S,N))},loadingStatus:T=>u.value=T})}function H(V,k,N){sessionStorage.setItem(In,V.toString()),k?sessionStorage.setItem(Ye,k):sessionStorage.removeItem(Ye),N?sessionStorage.setItem(Bn,N):sessionStorage.removeItem(Ye)}return e.watch(a,V=>{s.value=d(V),I(0)}),e.onMounted(()=>{s.value=d(a.value);let V=Number(sessionStorage.getItem(In));I(V||0)}),(V,k)=>(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",null,[e.createVNode(e.unref(p.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,N=>(e.openBlock(),e.createBlock(e.unref(p.NBreadcrumbItem),{key:N.path},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{text:"",onClick:()=>a.value=N.path,title:N.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Do))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(p.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(p.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:b,value:g.value,"onUpdate:value":k[0]||(k[0]=N=>g.value=N)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(p.NButton),{title:e.unref(n)("Search"),onClick:b,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(p.NPagination),{page:m.value,"onUpdate:page":[k[1]||(k[1]=N=>m.value=N),x],"item-count":c.value??0,"page-size":Vn},{suffix:e.withCtx(({startIndex:N,endIndex:S,itemCount:T})=>[T?(e.openBlock(),e.createBlock(e.unref(p.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(N+1)+"~"+e.toDisplayString(S+1)+"] / "+e.toDisplayString(T),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpin),{show:u.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",uc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createBlock(e.unref(p.NButton),{quaternary:"",class:"icon-button",onClick:()=>h(N)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:N.name},[e.createElementVNode("div",null,[N.isDirectory?(e.openBlock(),e.createBlock(e.unref(p.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Do))]),_:1})):(e.openBlock(),e.createBlock(e.unref(p.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+N.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(N.name),1)],8,pc)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),Mn=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=p.useMessage(),s=e.inject("axios"),i=e.ref(u(o.items)),m=e.ref(!1),c=e.ref(o.selectedValue);function u(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const b=[];for(let x of h)typeof x=="string"||typeof x=="number"?b.push({id:x.toString(),code:r(x.toString())}):b.push(x);return b}async function g(){var b;if(m.value)return;const h=o.getListAction;if(!h){i.value=[];return}try{m.value=!0;const x=await s.get(h);x.isSuccess&&x.value!=null?Array.isArray(x.value)?i.value=x.value:Array.isArray((b=x.value)==null?void 0:b.rows)?i.value=x.value.rows:i.value=[]:a.error(r(x.errorMessage||"Error"))}catch(x){console.log(x),a.error((x==null?void 0:x.toString())||r("Error"))}finally{m.value=!1}}function d(){c.value&&n("valueSelected",c.value)}return e.onMounted(()=>{o.getListAction&&g()}),e.watch(()=>o.getListAction,()=>{g()}),(h,b)=>(e.openBlock(),e.createBlock(e.unref(p.NSpin),{show:m.value},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NModal),{show:h.show,style:e.normalizeStyle({width:h.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(h.title),onClose:b[2]||(b[2]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header"),e.createVNode(e.unref(p.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(e.unref(p.NRadioGroup),{value:c.value,"onUpdate:value":b[0]||(b[0]=x=>c.value=x),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>(e.openBlock(),e.createBlock(e.unref(p.NRadio),{key:x[h.keyName],value:x[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:x},()=>[e.createTextVNode(e.toDisplayString(x.code)+" "+e.toDisplayString(x.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(p.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.description),1)]),_:1}),e.renderSlot(h.$slots,"bottom"),e.createVNode(e.unref(p.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(p.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(p.NButton),{style:{"min-width":"100px"},onClick:b[1]||(b[1]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function An(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=An(o.items,l);if(n)return n}}}const Tt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,s){var m;const i=new Array;if(r){let c=0,u=!1;for(const g of r)if(g.isEnabled!==!1)if(g.isSeparator)u||(i.push({type:"divider",key:`_${a}_${c++}`}),u=!0);else{const d=n(g.title),h={key:g.guid,id:g.guid,label:d,disabled:!g.isEnabled,href:g.url,tabBehavior:g.tabBehavior};if(g.items&&g.items.length)h.children=o(n,g.items,g.guid,s);else if(s&&!l(g,d,s))continue;g.guid&&g.icon&&(t[g.guid]={icon:g.icon,color:g.color}),((m=h.children)!=null&&m.length||h.href)&&i.push(h),u=!1}}return i.every(c=>c.type=="divider")?[]:i}return{menuLooks:t,systemMenuToNaiveMenu:o}},Tn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Z(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),s=e.ref(void 0),i=Tt(),m=e.computed(()=>i.systemMenuToNaiveMenu(l,n.menus,void 0,s.value)),c=e.computed(()=>n.isLoadingMenu);function u(h){if(typeof h.href=="string"&&h.href&&!h.children){let b=h.href.startsWith("~")?h.href.substring(1):h.href;h.id&&(b=v(b,{_menuid:h.id}));let x;return h.tabBehavior=="NewTab"?x="_blank":h.tabBehavior=="NamedTab"&&(x=h.id),r.test(b)?e.h("a",{href:b,target:"_blank"},{default:()=>h.label}):e.h(fe.RouterLink,{to:b,target:x},{default:()=>h.label})}else return typeof h.label=="string"?h.label:""}function g(h){var b,x,I;if(h.key){const H=(b=i.menuLooks[h.key])==null?void 0:b.icon;if(H)return e.h(xe,{path:H,class:"menu-icon"});if((x=h.children)!=null&&x.length){const V=(I=h.key)==null?void 0:I.toString();return V&&a.value.includes(V)?e.h(p.NIcon,{class:"menu-icon"},{default:()=>e.h(ii)}):e.h(p.NIcon,{class:"menu-icon"},{default:()=>e.h(xt)})}else return e.h(p.NIcon,{class:"menu-icon"},{default:()=>e.h(tn)})}}function d(h){if(h)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(h)}`)}catch(b){console.error(b)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(h,b)=>{const x=e.resolveComponent("n-scrollbar"),I=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(p.NSpin),{show:c.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NMenu),{collapsed:h.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:m.value,"root-indent":16,indent:16,"render-label":u,"render-icon":g,value:h.currentMenuId,accordion:!0,"onUpdate:expandedKeys":b[0]||(b[0]=H=>a.value=H),"onUpdate:value":d},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(I,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:b[1]||(b[1]=H=>s.value=H)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(p.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(an))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!h.collapsed]])]),_:1},8,["show"])}}}),mc=["src"],En=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),s=e.ref(void 0);function i(){a.value=!a.value}function m(c){c!=null&&!o.readonly&&(n("update:value",c),a.value=!1)}return e.watch(()=>o.value,c=>{c?s.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(c)}`:s.value=void 0}),(c,u)=>(e.openBlock(),e.createBlock(e.unref(p.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(p.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,mc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(p.NInput),{readonly:c.readonly,value:c.value,placeholder:c.placeholder,"onUpdate:value":u[0]||(u[0]=g=>c.$emit("update:value",g)),clearable:c.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(p.NButton),{ghost:"",onClick:i,disabled:c.readonly},{default:e.withCtx(()=>u[4]||(u[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(p.NModal),{show:a.value,"onUpdate:show":u[2]||(u[2]=g=>a.value=g),title:e.unref(r)("Select Icon"),onClose:u[3]||(u[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode(At,{"onUpdate:selected":u[1]||(u[1]=g=>m(g))})]),_:1},8,["show","title"])]),_:1}))}}),hc=e.defineComponent({components:{NButton:p.NButton,NIcon:p.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Z();return{t}}});function gc(t,l,o,n,r,a){const s=e.resolveComponent("n-icon"),i=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(i,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(s,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const _n=re(hc,[["render",gc]]),yc=e.defineComponent({name:"TopMenu",components:{NMenu:p.NMenu,NSpin:p.NSpin},setup(){const{t}=Z(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=Tt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),s=e.computed(()=>o.isLoadingMenu);function i(u){if(typeof u.href=="string"&&u.href&&!u.children){let g=u.href.startsWith("~")?u.href.substr(1):u.href;u.id&&(g=v(g,{_menuid:u.id}));let d;return u.tabBehavior=="NewTab"?d="_blank":u.tabBehavior=="NamedTab"&&(d=u.id),n.test(g)?e.h("a",{href:g,target:"_blank"},{default:()=>u.label}):e.h(fe.RouterLink,{to:g,target:d},{default:()=>u.label})}else return u.label}function m(u){var g,d;if(u.key){const h=(g=r.menuLooks[u.key])==null?void 0:g.icon;return h?e.h(xe,{path:h,class:"menu-icon"}):(d=u.children)!=null&&d.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function c(u){if(u)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(u)}`)}catch(g){console.error(g)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:s,renderMenuLabel:i,renderMenuIcon:m,onMenuSelected:c}}});function wc(t,l,o,n,r,a){const s=e.resolveComponent("n-menu"),i=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(i,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(s,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const Ln=re(yc,[["render",wc]]),Cc=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=p.useMessage(),n=e.inject("axios"),{t:r}=Z(),a=e.ref(new Array),s=e.ref(new Array),i=e.ref(new Array);function m(z,P){for(const A of z){if(A.key==P)return{node:A,path:[A.key]};if(A.key!=null&&A.key!=null&&A.children&&!A.isLeaf){const C=m(A.children,P);if(C)return{node:C,path:[A.key,...C.path]}}}return null}function c(z,P){for(let A=0;A<z.length;A++){const C=z[A];if(C.key==P)return{nodes:z,index:A};if(C.children){const M=c(C.children,P);if(M)return M}}return null}function u(z){const P=m(a.value,z);return P?P.path:[]}function g(z,P){const A=new Array;for(const C of z)if(C.key&&(!P||P(C.key))&&A.push(C.key),C.children){const M=g(C.children,P);M.length&&A.push(...M)}return A}function d(z){s.value=z}function h(z){i.value=z;const P=z.length?z[0]:null;l.emit("update:selectedId",P);const A=P?u(P):[];l.emit("update:path",A)}function b(z){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,z):{key:z.id,label:z.title,isLeaf:!z.hasSubitems}}async function x(z){const P=t.childrenAction,A=t.parentKey;if(!(!P||!A))try{const C=v(P,{parentKey:A,parentId:z}),M=await n.get(C);if(M.isSuccess&&M.value!=null)return M.value.map(b);o.error(r(M.errorMessage||"Error"))}catch(C){console.log(C),o.error((C==null?void 0:C.toString())||r("Error"))}}async function I(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await x(null)}],t.selectedId==null?i.value=[t.rootId]:t.selectedId?i.value=[t.selectedId]:i.value=[],s.value=[t.rootId]}async function H(z){const P=z.key;if(P!=null){if(z.children){const C=s.value,M=g(z.children,L=>C.includes(L));s.value=s.value.filter(L=>!M.includes(L))}const A=await x(P);A&&(z.isLeaf=!A.length,z.children=A.length?A:void 0)}}function V(z){return e.h("span",null,z.option.label)}function k(z){if(!z.option.isLeaf)return e.h(p.NIcon,null,{default:()=>e.h(xt)})}function N(z){const P=z.option.key;if(P!=null&&i.value.includes(P))return e.h(p.NButton,{text:!0,onClick:A=>{A.stopPropagation(),H(z.option)}},{default:()=>e.h(p.NIcon,null,{default:()=>e.h(je)})})}function S(z){!t.moveAction&&!t.sortAction||(z.dropPosition=="before"||z.dropPosition=="after"?z.dragNode.key&&typeof z.node.key&&O(z.dragNode,z.node,z.dropPosition):z.dropPosition=="inside"&&typeof z.dragNode.key=="number"&&typeof z.node.key=="number"&&T(z.dragNode,z.node))}async function T(z,P){const A=t.moveAction;if(!A)return;const C=z.key,M=[z.key],L=P.key;if(!(!C||!L||z==P))try{const $=await n.post(A,{menuItemIds:M,targetId:L});if($.isSuccess){o.success(r("Successful operation."));const _=c(a.value,C);_&&(_.nodes.splice(_.index,1),P.children?P.children.push(z):H(P))}else o.error(r($.errorMessage||"Error"))}catch($){console.log($),o.error(($==null?void 0:$.toString())||"Error")}}async function O(z,P,A){const C=t.sortAction;if(!C)return;console.log(`dragNode: ${z.key} ${z.label}, targetNode: ${P.key} ${P.label}, dropPosition: ${A}`);const M=z.key;let L=P.key;if(!M||!L||M==L)return;const $=c(a.value,M);if($){if(A=="after"){const _=$.nodes.indexOf(P);if(_>-1&&_<$.nodes.length-1&&(P=$.nodes[_+1],L=P.key,!L||M==L))return}try{const _=await n.post(C,{menuId:M,nextSiblingId:L});if(_.isSuccess){o.success(r("Successful operation.")),$.nodes.splice($.index,1);const F=$.nodes.indexOf(P);F>-1?$.nodes.splice(F,0,z):$.nodes.push(z)}else o.error(r(_.errorMessage||"Error"))}catch(_){console.log(_),o.error((_==null?void 0:_.toString())||"Error")}}}async function j(z){var P;if(z.length){let A=(P=a.value)==null?void 0:P.find($=>$.key==z[0]);A==null&&(A={key:z[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(A));let C=z[0],M=A;for(let $=1;$<z.length-1&&M;$++)if(M.children||(M.children=await x(C)),M.children){const _=z[$];M=M.children.find(F=>F.key==_),C=_}const L=s.value;for(let $=0;$<z.length-1;$++)L.includes(z[$])||L.push(z[$]);s.value=L,i.value=[z[z.length-1]]}}return e.onMounted(()=>{I()}),e.watch(()=>t.childrenAction,()=>{I()}),e.watch(()=>t.path,z=>{z&&j(z)}),{data:a,expandedKeys:s,expandedKeysChanged:d,loadChildren:H,dragDrop:S,renderLabel:V,renderPrefix:k,renderSuffix:N,selectedKeys:i,selectedKeysChanged:h}}});function bc(t,l,o,n,r,a){const s=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(s,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const zn=re(Cc,[["render",bc]]),kc=e.defineComponent({components:{ChangePassword:dt,NotificationIcon:za},setup(){var d;const t=fe.useRouter(),{t:l}=Z(),o=p.useDialog(),n=Ne(),r=Se(),a=ot(),s=e.computed(()=>r.userInfo),i=e.ref(!1),m="/img/user_avatar.png";function c(){o.warning({title:l("Logout"),content:l("Are you sure log out?"),positiveText:l("OK"),negativeText:l("Cancel"),onPositiveClick:()=>{r.logout(),a.clearTabs(),t.push({path:"/login"})}})}function u(h){switch(h){case"preferences":t.push({path:"/core/preferences"});break;case"change_password":i.value=!0;break;case"logout":c();break;case"toggle_theme":n.toggleTheme();break}}const g=[{label:(d=s.value)==null?void 0:d.userName,type:"group",key:"user_group",children:[{label:l("Preferences"),key:"preferences",icon(){return e.h(p.NIcon,null,{default:()=>e.h(Va)})}},{label:l("Change Password"),key:"change_password",icon(){return e.h(p.NIcon,null,{default:()=>e.h(Da)})}}]},{label:l("Toggle Theme"),key:"toggle_theme",icon(){return e.h(p.NIcon,null,{default:()=>e.h(fa)})}},{type:"divider"},{label:l("Logout"),key:"logout",icon(){return e.h(p.NIcon,null,{default:()=>e.h(Ia)})}}];return{userInfo:s,options:g,onMenuSelected:u,changePwdBoxShow:i,defaultAvatarPath:m}}}),Nc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},xc={class:"user-name-box"},Sc={class:"user-name-label"};function Ic(t,l,o,n,r,a){const s=e.resolveComponent("n-avatar"),i=e.resolveComponent("n-dropdown"),m=e.resolveComponent("change-password"),c=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(c,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(i,{trigger:"click",options:t.options,placement:"bottom-end",onSelect:t.onMenuSelected,size:"medium"},{default:e.withCtx(()=>{var u,g,d;return[e.createElementVNode("div",Nc,[e.createVNode(s,{round:"",size:"medium",title:(u=t.userInfo)==null?void 0:u.userName,src:`/api/core/avatar?id=${(g=t.userInfo)==null?void 0:g.avatar}`,"fallback-src":t.defaultAvatarPath,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src","fallback-src"]),e.createElementVNode("div",xc,[e.createElementVNode("div",Sc,e.toDisplayString((d=t.userInfo)==null?void 0:d.name),1)])])]}),_:1},8,["options","onSelect"]),e.createVNode(m,{show:t.changePwdBoxShow,onClose:l[0]||(l[0]=()=>t.changePwdBoxShow=!1)},null,8,["show"])]),_:1})}const $n=re(kc,[["render",Ic],["__scopeId","data-v-0d4b7b61"]]),Bc={class:"flex-row"},Vc={class:"app-tab-label"},Mc={style:{"margin-left":"4px"}},Dn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=fe.useRouter(),o=Se(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(i=>{!i.path||i.path=="/"||i.name=="blank"||(r.value=a(i.path))});function a(i){var c;const m=(c=o.menus)==null?void 0:c.find(u=>{var g;return((g=u.url)==null?void 0:g.toLowerCase())==i.toLowerCase()});if(m)return m.guid}function s(i){var m;if(i){const c=(m=o.menus)==null?void 0:m.find(u=>u.guid==i);c&&c.url&&(l.push(c.url),r.value=c.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(i,m)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(p.NTabs),{key:0,class:"app-tabs",type:i.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createBlock(e.unref(p.NTab),{key:c.guid,name:c.guid},{default:e.withCtx(()=>[e.createElementVNode("div",Bc,[e.createElementVNode("div",null,[c.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:c.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(p.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(di))]),_:1}))]),e.createElementVNode("div",Vc,[e.createElementVNode("span",Mc,e.toDisplayString(c.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}});class Ac{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class Tc{constructor(){J(this,"guid","");J(this,"title","");J(this,"icon");J(this,"color");J(this,"url");J(this,"isSeparator",!1);J(this,"isEnabled",!0);J(this,"groupName");J(this,"description");J(this,"items");J(this,"tabBehavior");J(this,"closable")}}const Ec=De.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var s;const a=(s=localStorage.getItem("fontSizeMode"))==null?void 0:s.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),_c={AppLogoBox:Wt,AppTabs:Oo,AutoScrollView:jo,BarcodeImage:Po,ChangePassword:dt,ColorInput:ft,DefaultPropertyForm:bt,DetailPage:en,ExportModal:St,EmptyDetailView:sn,FormInput:Be,FullscreenSwitch:cn,GridConfigModal:It,HaloButtonSelect:un,HaloDatePicker:Pe,HaloForm:pn,HaloGrid:We,HaloModal:mn,HaloModalInput:Ct,HaloSelect:hn,HaloTagsInput:yt,HaloTimePicker:mt,HaloTransfer:gn,ImportModal:Mt,InputModal:yn,ListInputModal:wt,MainDetailPanel:wn,MenuIcon:xe,NullableBooleanInput:ht,NumberInputModal:Cn,ObjectTreeView:bn,PhotoBox:kn,PrintModal:Nn,PropertyGrid:kt,QrModal:xn,SearchCard:Sn,SearchForm:Ke,SearchModal:Vt,SearchPanel:Ze,SelectIconBox:At,SelectObjectModal:Mn,SideMenu:Tn,SystemIconInput:En,TagsView:Bt,ToolButton:_n,TopMenu:Ln,TreeView:zn,UserMenu:$n,TabMenu:Dn},Lc={install(t,l){const o={...Ro,...l};for(const[n,r]of Object.entries(_c))t.component(n,r);l!=null&&l.langCode&&t.use(Kt,l==null?void 0:l.langCode,!0),t.provide("axios",le),t.provide(it,o)}};B.axios=le,B.AppLogoBox=Wt,B.AppTabs=Oo,B.AutoScrollView=jo,B.BarcodeImage=Po,B.ChangePassword=dt,B.ColorInput=ft,B.DataPage=dc,B.DateFormat=ge,B.DateTimeFormat=Te,B.DefaultPropertyForm=bt,B.DetailPage=en,B.EmptyDetailView=sn,B.ExportModal=St,B.FormInput=Be,B.FullscreenSwitch=cn,B.GridConfigModal=It,B.HaloButtonSelect=un,B.HaloDatePicker=Pe,B.HaloForm=pn,B.HaloGrid=We,B.HaloModal=mn,B.HaloModalInput=Ct,B.HaloSelect=hn,B.HaloTagsInput=yt,B.HaloTimePicker=mt,B.HaloTransfer=gn,B.HalovConfigKey=it,B.I18nPlugin=Kt,B.ImportModal=Mt,B.InputModal=yn,B.ListInputModal=wt,B.MainDetailPanel=wn,B.MenuIcon=xe,B.NullableBooleanInput=ht,B.NumberInputModal=Cn,B.ObjectTreeView=bn,B.PhotoBox=kn,B.PrintModal=Nn,B.PropertyGrid=kt,B.QrModal=xn,B.SearchCard=Sn,B.SearchForm=Ke,B.SearchModal=Vt,B.SearchPanel=Ze,B.SelectIconBox=At,B.SelectObjectModal=Mn,B.SessionSummary=Ac,B.SideMenu=Tn,B.SystemIconInput=En,B.SystemMenu=Tc,B.TabMenu=Dn,B.TagsView=Bt,B.TimeFormat=Ee,B.ToolButton=_n,B.TopMenu=Ln,B.TreeView=zn,B.UserMenu=$n,B.addDays=Qr,B.appendParamsToUrl=v,B.arrayGroupBy=fs,B.arrayMove=vo,B.arrayRemoveIf=Uo,B.buildBarcodeUrl=Fo,B.buildSearchItems=Qo,B.camelToWords=te,B.clearObject=ts,B.convertItems=Yo,B.convertPercentValue=_o,B.convertTo=Oe,B.copyEntity=Zo,B.copyToEntity=Wo,B.createGridColumns=_e,B.createI18n=Gt,B.dateTimeToString=at,B.dateToNumber=Bo,B.dateToString=Mo,B.default=Lc,B.defaultHalovOptions=Ro,B.defaultValue=Eo,B.downloadFile=pe,B.findMenuById=An,B.firstDayOfMonth=Xr,B.formatTimespan=Ao,B.getColumnWidth=ut,B.getConfig=ct,B.iconRender=pt,B.iconRenderIf=ls,B.initEntity=Ko,B.instanceOfColumnValueSource=Go,B.instanceOfHaloColumn=Ie,B.instanceOfTime=xo,B.isNullOrWhiteSpace=Lo,B.lastDayOfMonth=Jr,B.linesToArray=Ur,B.loadItemSources=Fe,B.mergeRoutes=ps,B.msToTime=Kr,B.onNullOrWhiteSpace=ea,B.openFile=qo,B.renderDifference=as,B.renderIconButton=rs,B.renderLabel=ns,B.searchField=us,B.secondsToTime=So,B.splitNumberByCount=ms,B.splitNumberBySize=hs,B.stringToArray=qr,B.stringToTime=Io,B.sumNumbers=gs,B.timeToString=Vo,B.timestamp=Zr,B.toBool=ie,B.toBoolDefault=Re,B.toDate=No,B.toViewModel=Yr,B.useAccountStore=Se,B.useCommonStore=Ne,B.useFontSizeStore=Ec,B.useHttpTools=me,B.useI18n=Z,B.useMenus=Tt,B.usePermissions=dn,B.useTabsStore=ot,B.useUiTools=gt,B.validateEmail=vr,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("img[data-v-f7799232]{display:block;max-width:100%}.app-tab-item[data-v-df170cc3]{border-top-width:2px}[data-v-e7319d81] .n-upload-trigger{display:block}.item-box[data-v-e7319d81]{display:block;flex-grow:1}.form-input[data-v-e7319d81]{display:block}.text-input[data-v-e7319d81]{font-size:small;display:block;text-align:end;padding-right:4px}div[data-v-8b391a0f] div.n-form-item-feedback-wrapper{display:none}div[data-v-8b391a0f] .n-form-item-blank{margin-bottom:4px}.n-form-item.n-form-item--left-labelled.n-form-item--auto-label-width>label{min-width:8em}[data-v-18129d6e] .n-upload-trigger{display:block}.edit-title-btn{visibility:hidden}.grid-config-global-mode .edit-title-btn{visibility:visible}.main-detail-panel[data-v-ca4664e2]{display:flex;width:100%;height:100%;overflow:hidden;--n-resize-trigger-color: rgb(224, 224, 230, .24);--n-resize-trigger-color-hover: #36ad6a}.dark .main-detail-panel[data-v-ca4664e2]{--n-resize-trigger-color: rgba(255, 255, 255, .24);--n-resize-trigger-color-hover: #7fe7c4}.main-detail-panel.horizontal[data-v-ca4664e2]{flex-direction:row}.main-detail-panel.vertical[data-v-ca4664e2]{flex-direction:column}.panel[data-v-ca4664e2]{overflow:auto;display:flex;flex-direction:column}.divider[data-v-ca4664e2]{background-color:var(--n-resize-trigger-color);cursor:col-resize;transition:background .2s}.main-detail-panel.horizontal .divider[data-v-ca4664e2]{width:4px;height:100%}.main-detail-panel.vertical .divider[data-v-ca4664e2]{height:4px;width:100%;cursor:row-resize}.divider.dragging[data-v-ca4664e2],.divider[data-v-ca4664e2]:hover{background-color:var(--n-resize-trigger-color-hover)}.icon-container[data-v-ff87aac6]{display:flex;flex-direction:row;flex-wrap:wrap;padding-right:4px;padding-bottom:4px}.icon-button[data-v-ff87aac6]{max-width:100px;height:90px;width:80px;margin:4px 0 0 4px}.menu-spin>.n-spin-content{height:100%;display:flex;flex-direction:column}.user-name-box[data-v-0d4b7b61]{background:#abf3;position:relative;z-index:1;width:6rem;height:27px;line-height:27px;border-radius:0 27px 27px 0;left:20px;top:6px}.user-name-label[data-v-0d4b7b61]{padding-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:uppercase;text-align:center}.app-tabs{margin-bottom:0}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #D1D5DB;--n-tab-text-color: #1E1B4B;--n-tab-text-color-active: #1E1B4B;--n-tab-border-color: #A3A3A3}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #27272A;--n-tab-text-color: #71717A;--n-tab-text-color-active: #D4D4D8;--n-tab-border-color: #525252}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#f4f4f5;border-bottom-color:#f4f4f5;font-weight:bolder;border-top-color:#1e40af}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#171717;border-bottom-color:#171717;border-top-color:#e2e8f0}.app-tab-label{padding:0 1em}.d-block{display:block}.d-none{display:none}.d-flex{display:flex}.d-inline{display:inline}.d-inline-block{display:inline-block}.n-form .n-form-item .n-form-item-feedback-wrapper:empty{display:none}.n-form .n-form-item{margin-bottom:4px}.n-data-table-td,.n-data-table-th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.n-dropdown-menu.n-dropdown{min-width:150px}.text-monospace,.halo-form-code input,.halo-form-code-u input,.halo-form-code-l input{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}.halo-form-code-u input,.halo-form-code-u{text-transform:uppercase}.halo-form-code-l input,.halo-form-code-l{text-transform:lowercase}.halo-form-wrap{white-space:wrap;overflow-wrap:break-word;display:inline-block}.h-100{height:100%}.h-50{height:50%}td .halo-form-code,td .halo-form-code-u,td .halo-form-code-l{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td.text-num{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace;text-align:right}td.text-date,td.text-time,td.text-datetime{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td .percent-mark{margin-left:4px;margin-right:2px}td .percent-mark svg{margin:0 auto;display:block}td .status-tag{border-radius:2px;border-width:0 0 0 4px;border-style:solid;padding:0 4px;font-size:smaller;border-color:#9999}td .status-New,td .status-Created,td .status-Standby{border-color:#8bc34a99}td .status-True,td .status-true,td .status-Success,td .status-Succeeded,td .status-Succeed,td .status-Good,td .status-InStock,td .status-Passed,td .status-Resolved,td .status-Processing,td .status-InProduction,td .status-Allowed,td .status-Qualified,td .status-Loaded{border-color:#18a05899}td .status-False,td .status-false,td .status-NonGood,td .status-Failed,td .status-Rejected,td .status-Abnormal,td .status-Forbidden,td .status-Defective{border-color:#d0305099}td .status-Confirmed,td .status-Dispatched,td .status-Inspected{border-color:#3f51b599}td .status-Consumed,td .status-Finished,td .status-Unloaded{border-color:#607d8b99}td .status-Ignored{border-color:#79554899}td .status-OutStock,td .status-Cancelled{border-color:#9e9e9e99}td .status-InTransit{border-color:#78909c99}td .status-InFactory{border-color:#43a04799}td .status-InGarage{border-color:#673ab799}td .status-Doubt,td .status-Paused{border-color:#ffc10799}td .status-Read{border-color:#ffc107cc}td .status-Write{border-color:#673ab7cc}.n-data-table .n-data-table-th .n-data-table-sorter:not(.n-data-table-sorter--asc):not(.n-data-table-sorter--desc){display:none}.n-data-table .btn-cell-ref .n-button__content{opacity:.2}.n-data-table .btn-cell-ref:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table .btn-cell-qr .n-button__content{opacity:.2}.n-data-table .btn-cell-qr:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table-td:not(.check-mark) .cell-unchecked{display:none}.draging-ghost{opacity:.5;background:#c8ebfb}.drag-sorting-handle{cursor:row-resize}.pg-item{margin:1px;border:1px solid transparent;padding:2px;border-radius:3px}.pg-item:hover{border-color:#eee}.dark .pg-item:hover{border-color:#fff6}.pg-label{padding:0 2px;white-space:nowrap;max-width:50%;text-overflow:clip}.pg-value{padding-left:.5em;padding-right:1em;position:relative}.menu-icon{border-radius:2px}.menu-icon-blank{width:16px;height:16px}.text-positive{color:#00c853}.text-negative,.text-danger{color:#b71c1c}ul,li{list-style:none}html,body,#app,.n-config-provider{height:100%;margin:0;padding:0}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.flex-1{flex:1 1 0}.flex-grow-1{flex-grow:1}.flex-shrink-1{flex-shrink:1}.flex-wrap{flex-wrap:wrap}.gap1{gap:1em}.gap05{gap:.5em}.gap025{gap:.25em}.gap015{gap:.15em}.gap01{gap:.1em}.gap-x-1{column-gap:1em}.gap-x-05{column-gap:.5em}.gap-x-25{column-gap:.25em}.gap-y-1{row-gap:1em}.gap-y-05{row-gap:.5em}.gap-y-25{row-gap:.25em}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.week-0{background-color:#a5d6a7}input.ime-off,.ime-off input{ime-mode:disabled}.h-scroll{overflow-x:scroll}.v-scroll{overflow-y:scroll}.tabs-card.n-card>.n-card__content{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane>.n-card{border-top:0}.info-card{flex-grow:1;margin-top:1em}.info-card>.n-card__content{display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs{flex-grow:1}.info-card>.n-card__content>.n-tabs>.n-tab-pane{flex-grow:1;display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs>.n-tab-pane>div{flex-grow:1;display:flex;flex-direction:column}.page-component.n-space>div:first-child{flex-grow:1;display:flex;flex-direction:column}.form-create .n-input--disabled .n-input__input-el,.form-create .n-input--disabled .n-input__placeholder,.form-create .n-input--disabled .n-input__textarea-el,.form-create .n-base-selection--disabled .n-base-selection-overlay__wrapper{color:#000;font-weight:700}.bordered{border:1px solid var(--n-border-color);border-radius:var(--n-border-radius)}.n-dialog__content .line,.n-message__content .line{display:block}.n-tree-node-content__text{white-space:nowrap}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.halov={},M.Vue,M.axios,M.VueRouter,M.NaiveUI,M.Pinia,M.moment,M.Mustache,M.VueDraggablePlus))})(this,function(M,e,le,ce,u,$e,se,Ce,Wt){"use strict";var wd=Object.defineProperty;var Cd=(M,e,le)=>e in M?wd(M,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):M[e]=le;var J=(M,e,le)=>Cd(M,typeof e!="symbol"?e+"":e,le);var et=typeof document<"u"?document.currentScript:null;const tt=window,Zt="halo-lang";class cl{constructor(l,o=!0){J(this,"langCode","");J(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Zt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Zt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=tt.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=tt.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=tt.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Yt=Symbol("halo-i18n");let ot=null;function Qt(t,l){return ot||(ot=new cl(t,l)),ot}function Xt(t,l,o=!0){const n=Qt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Yt,n)}function Z(){const t=e.inject(Yt);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const dl=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};le.defaults.headers["Client-Device-Id"]=dl(),le.defaults.headers["Content-type"]="application/json",le.defaults.timeout=1e3*60,le.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),le.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status){const l=ce.useRouter();switch(t.response.status){case 401:l==null||l.push({name:"Unauthorized"});break}}return Promise.reject(t)});const fl=["src"],ul=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:et&&et.tagName.toUpperCase()==="SCRIPT"&&et.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,fl))}}),re=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Jt=re(ul,[["__scopeId","data-v-f7799232"]]);function pl(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const nt=$e.defineStore("tabs",{state:()=>({tabs:pl(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var ml=typeof global=="object"&&global&&global.Object===Object&&global,hl=typeof self=="object"&&self&&self.Object===Object&&self,gl=ml||hl||Function("return this")(),be=gl.Symbol,qt=Object.prototype,yl=qt.hasOwnProperty,wl=qt.toString,Ae=be?be.toStringTag:void 0;function Cl(t){var l=yl.call(t,Ae),o=t[Ae];try{t[Ae]=void 0;var n=!0}catch{}var r=wl.call(t);return n&&(l?t[Ae]=o:delete t[Ae]),r}var bl=Object.prototype,kl=bl.toString;function Nl(t){return kl.call(t)}var xl="[object Null]",Sl="[object Undefined]",Ut=be?be.toStringTag:void 0;function Il(t){return t==null?t===void 0?Sl:xl:Ut&&Ut in Object(t)?Cl(t):Nl(t)}function Bl(t){return t!=null&&typeof t=="object"}var Vl="[object Symbol]";function Ml(t){return typeof t=="symbol"||Bl(t)&&Il(t)==Vl}function Tl(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var Al=Array.isArray,vt=be?be.prototype:void 0,eo=vt?vt.toString:void 0;function to(t){if(typeof t=="string")return t;if(Al(t))return Tl(t,to)+"";if(Ml(t))return eo?eo.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function lt(t){return t==null?"":to(t)}function El(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function _l(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:El(t,l,o)}var zl="\\ud800-\\udfff",Ll="\\u0300-\\u036f",Dl="\\ufe20-\\ufe2f",$l="\\u20d0-\\u20ff",Rl=Ll+Dl+$l,Ol="\\ufe0e\\ufe0f",jl="\\u200d",Fl=RegExp("["+jl+zl+Rl+Ol+"]");function oo(t){return Fl.test(t)}function Pl(t){return t.split("")}var no="\\ud800-\\udfff",Hl="\\u0300-\\u036f",Gl="\\ufe20-\\ufe2f",Kl="\\u20d0-\\u20ff",Wl=Hl+Gl+Kl,Zl="\\ufe0e\\ufe0f",Yl="["+no+"]",rt="["+Wl+"]",at="\\ud83c[\\udffb-\\udfff]",Ql="(?:"+rt+"|"+at+")",lo="[^"+no+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",ao="[\\ud800-\\udbff][\\udc00-\\udfff]",Xl="\\u200d",so=Ql+"?",io="["+Zl+"]?",Jl="(?:"+Xl+"(?:"+[lo,ro,ao].join("|")+")"+io+so+")*",ql=io+so+Jl,Ul="(?:"+[lo+rt+"?",rt,ro,ao,Yl].join("|")+")",vl=RegExp(at+"(?="+at+")|"+Ul+ql,"g");function er(t){return t.match(vl)||[]}function tr(t){return oo(t)?er(t):Pl(t)}function or(t){return function(l){l=lt(l);var o=oo(l)?tr(l):void 0,n=o?o[0]:l.charAt(0),r=o?_l(o,1).join(""):l.slice(1);return n[t]()+r}}var nr=or("toUpperCase");function lr(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function rr(t){return function(l){return t==null?void 0:t[l]}}var ar={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},sr=rr(ar),ir=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cr="\\u0300-\\u036f",dr="\\ufe20-\\ufe2f",fr="\\u20d0-\\u20ff",ur=cr+dr+fr,pr="["+ur+"]",mr=RegExp(pr,"g");function hr(t){return t=lt(t),t&&t.replace(ir,sr).replace(mr,"")}var gr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function yr(t){return t.match(gr)||[]}var wr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Cr(t){return wr.test(t)}var co="\\ud800-\\udfff",br="\\u0300-\\u036f",kr="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",xr=br+kr+Nr,fo="\\u2700-\\u27bf",uo="a-z\\xdf-\\xf6\\xf8-\\xff",Sr="\\xac\\xb1\\xd7\\xf7",Ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Br="\\u2000-\\u206f",Vr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",po="A-Z\\xc0-\\xd6\\xd8-\\xde",Mr="\\ufe0e\\ufe0f",mo=Sr+Ir+Br+Vr,ho="['’]",go="["+mo+"]",Tr="["+xr+"]",yo="\\d+",Ar="["+fo+"]",wo="["+uo+"]",Co="[^"+co+mo+yo+fo+uo+po+"]",Er="\\ud83c[\\udffb-\\udfff]",_r="(?:"+Tr+"|"+Er+")",zr="[^"+co+"]",bo="(?:\\ud83c[\\udde6-\\uddff]){2}",ko="[\\ud800-\\udbff][\\udc00-\\udfff]",ke="["+po+"]",Lr="\\u200d",No="(?:"+wo+"|"+Co+")",Dr="(?:"+ke+"|"+Co+")",xo="(?:"+ho+"(?:d|ll|m|re|s|t|ve))?",So="(?:"+ho+"(?:D|LL|M|RE|S|T|VE))?",Io=_r+"?",Bo="["+Mr+"]?",$r="(?:"+Lr+"(?:"+[zr,bo,ko].join("|")+")"+Bo+Io+")*",Rr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Or="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jr=Bo+Io+$r,Fr="(?:"+[Ar,bo,ko].join("|")+")"+jr,Pr=RegExp([ke+"?"+wo+"+"+xo+"(?="+[go,ke,"$"].join("|")+")",Dr+"+"+So+"(?="+[go,ke+No,"$"].join("|")+")",ke+"?"+No+"+"+xo,ke+"+"+So,Or,Rr,yo,Fr].join("|"),"g");function Hr(t){return t.match(Pr)||[]}function Gr(t,l,o){return t=lt(t),l=l,l===void 0?Cr(t)?Hr(t):yr(t):t.match(l)||[]}var Kr="['’]",Wr=RegExp(Kr,"g");function Zr(t){return function(l){return lr(Gr(hr(l).replace(Wr,"")),t,"")}}var Yr=Zr(function(t,l,o){return t+(o?" ":"")+nr(l)});const Ee="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",_e="HH:mm:ss";function te(t){return t.length?Yr(t):t}function de(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return de(l)}}}function Re(t,l){const o=de(t);return o===void 0?l||!1:o}function Vo(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return se(t,l||Ee).toDate()}}function Mo(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function Qr(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function To(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Ao(t,l){const o=se(t,l||_e);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function Eo(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=se(t,l||Ee))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function _o(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||_e);if(t instanceof Date)return se(t).format(l||_e);if(Mo(t))return se(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||_e);if(typeof t=="object")return t==null?void 0:t.toString()}}function zo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||ge);if(t instanceof Date)return se(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function st(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||Ee);if(t instanceof Date)return se(t).format(l||Ee);if(typeof t=="object")return t==null?void 0:t.toString()}}function Lo(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function Do(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const s=n.indexOf("=");if(s>-1?(r=n.substring(0,s),a=n.substring(s+1)):r=n,r in l){if(a){const c=l[r];Array.isArray(c)?c.push(a):c?l[r]=[c,a]:l[r]=a}}else l[r]=a}return l}function Xr(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const s of a)n.push(`${r}=${encodeURIComponent(s)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function v(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=Do(t.substring(a+1)));let s={};const c=Array.isArray(l)?l:[l];for(let m of c)if(m)if(typeof m=="string")s=Do(m);else for(const i in m){const d=m[i];Array.isArray(d)?s[i]=d.map(g=>g==null?void 0:g.toString()):d!=null?s[i]=d.toString():s[i]=void 0}else continue;if(Object.keys(s).length==0)return t;if(r.length)for(const m in s)if(m in r&&!o){const i=r[m],d=s[m];Array.isArray(i)?Array.isArray(d)?i.push(...d):i.push(d):i?Array.isArray(d)?r[m]=[i,...d]:r[m]=[i,d]:r[m]=s[m]}else r[m]=s[m];else for(const m in s)r[m]=s[m];return Xr(n,r)}function Oe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return de(t);case"date":case"datetime":return st(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function $o(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function Jr(){return new Date().getTime().toString()}function qr(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[te(n)]=t[n]:o[te(n.name)]=t[n.name];else for(const n in t)o[te(n)]=t[n];return o}function Ur(t,l){return se(t,ge).add(l,"days").format(ge)}function vr(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function ea(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function ta(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(s=>s.trim()))==null?void 0:a.filter(s=>!l||s.length>0);return n&&o&&(n=n.filter((s,c,m)=>s&&m.indexOf(s)==c)),n}function oa(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(s=>s.trim()))==null?void 0:a.filter(s=>!l||s.length>0);return n&&o&&(n=n.filter((s,c,m)=>s&&m.indexOf(s)==c)),n}function na(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function Ro(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function Oo(t){return t==null?!0:/^\s*$/.test(t)}function la(t,l){return Oo(t)?l:t}const Ne=$e.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Re(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},aa=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ra,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),sa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ia=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",sa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),ca={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},jo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ca,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},fa=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pa=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),ma={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ha=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ma,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),ga={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fo=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ga,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},wa=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),Ca={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ba=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ca,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),ka={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Po=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ka,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),Na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},xa=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Na,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),Sa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ia=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Sa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),Ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Va=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),Ma={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ta=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ma,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),Aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ea=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Aa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),_a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},it=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",_a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},La=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",za,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),Da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},$a=e.defineComponent({name:"MoreHorizFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1)]))}}),Ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Oa=e.defineComponent({name:"NotificationsNoneTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ra,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M12 6.5c-2.49 0-4 2.02-4 4.5v6h8v-6c0-2.48-1.51-4.5-4-4.5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 16v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6zm-4 5c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z",fill:"currentColor"},null,-1)]))}}),ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fa=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ha=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),Ga={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ka=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ga,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),Wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Za=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Wa,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),Ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qa=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),Xa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},je=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),Ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pe=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ua=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),Ho={rootMenuName:"MainMenu",menuPosition:"side"},ct=Symbol("HalovConfig");function dt(){return e.inject(ct)}const va=["src"],xe=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,va)):e.createCommentVNode("",!0)}}),Go=re(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var N;const o=t,n=l,{t:r}=Z(),a=nt(),s=Ne(),c=e.computed(()=>s.menuCollapsed),m=((N=dt())==null?void 0:N.menuPosition)??"side",i=()=>s.setMenuCollapsed(!s.menuCollapsed),d=e.ref(o.currentTab),g=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(S=>({label:r(S.title),key:S.id,url:S.url}))]);function f(S){o.tabs.find(T=>T.id==S)&&a.closeTab(S),n("closeTab",S)}function h(S){if(S.key=="close-current"||S.key=="close-all"||S.key=="close-others")return e.h(u.NIcon,null,{default:()=>e.h(fa)});if(S.key&&S.key==d.value)return e.h(u.NIcon,null,{default:()=>e.h(ia)})}function b(S){if(typeof S=="string"&&S)switch(S){case"close-current":n("closeTab",d.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",d.value);break;default:d.value=S;break}}return e.watch(()=>o.currentTab,S=>{d.value=S}),e.watch(d,S=>{S!=o.currentTab&&n("update:currentTab",S)}),(S,P)=>S.tabs.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,type:"card",closable:"",onClose:f,"tab-style":"min-width: 80px;",value:d.value,"onUpdate:value":P[0]||(P[0]=T=>d.value=T)},{prefix:e.withCtx(()=>[e.renderSlot(S.$slots,"prefix",{},()=>[e.unref(m)=="side"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:i,title:c.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(La),{key:0})),c.value?(e.openBlock(),e.createBlock(e.unref(it),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NDropdown),{trigger:"click",options:g.value,placement:"bottom-end",onSelect:b,"render-icon":h},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(aa))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.tabs,T=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:T.id,name:T.id,title:T.id,closable:T.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":T.color})},{default:e.withCtx(()=>[T.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:T.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(T.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),es=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const s=l.value;if(s){const c=t.step||1;switch(t.direction){case"Left":s.scrollWidth>s.clientWidth&&(s.scrollLeft+s.clientWidth>s.scrollWidth-3?s.scrollLeft=0:s.scrollLeft+=c);break;case"Bottom":s.scrollHeight>s.clientHeight&&(s.scrollTop<3?s.scrollTop=s.scrollHeight:s.scrollTop-=c);break;case"Top":s.scrollHeight>s.clientHeight&&(s.scrollTop+s.clientHeight>s.scrollHeight-3?s.scrollTop=0:s.scrollTop+=c);break;case"Right":default:s.scrollWidth>s.clientWidth&&(s.scrollLeft<3?s.scrollLeft=s.scrollWidth:s.scrollLeft-=c);break}}}function r(){o++,o>1e8&&(o=0);let s=t.intervalFrames||1;s<=0&&(s=1),o%s==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const s=l.value;if(s){switch(t.direction){case"Left":s.scrollLeft=0;break;case"Bottom":s.scrollTop=s.scrollHeight;break;case"Top":s.scrollTop=0;break;case"Right":default:s.scrollLeft=s.scrollWidth;break}s.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),ts={ref:"areaRef",style:{overflow:"hidden"}};function os(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",ts,[e.renderSlot(t.$slots,"default")],512)}const Ko=re(es,[["render",os]]);function Wo(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const Zo=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=Wo(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(u.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function Yo(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&Yo(l.items)}function ns(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=$e.defineStore("account",{state:()=>({userInfo:ns(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]")}),actions:{setSession(t){this.sessionToken=t,t?localStorage.setItem("sessionToken",t):localStorage.removeItem("sessionToken")},setLastUserName(t){this.lastUserName=t,t?localStorage.setItem("lastUserName",t):localStorage.removeItem("lastUserName")},setUser(t){this.userInfo=t,t?localStorage.setItem("userInfo",JSON.stringify(t)):localStorage.removeItem("userInfo")},setAvatar(t){this.userInfo&&(this.userInfo.avatar=t,localStorage.setItem("userInfo",JSON.stringify(this.userInfo)))},clearUser(){this.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},setMenus(t){this.menus=t},setIsLoadingMenu(t){this.isLoadingMenu=t},logout(){localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),this.clearUser(),this.setMenus(null),localStorage.removeItem("_msgs")},async loadMenus(t){var l;this.setIsLoadingMenu(!0);try{t||(t=((l=dt())==null?void 0:l.rootMenuName)??"MainMenu");const o=await le.get(`/api/core/account/menus?rootName=${encodeURIComponent(t)}`);if(o.isSuccess){const n=o.value||[];Yo(n),this.setMenus(n)}else console.log(o.errorMessage||"get remote menus error.")}catch(o){console.log(o)}finally{this.setIsLoadingMenu(!1)}},addMessage(t){this.messages.push(t),localStorage.setItem("_msgs",JSON.stringify(this.messages))}}}),ls={key:0,style:{"padding-left":"1rem"}},ft=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=u.useMessage(),a=e.inject("axios"),s=Se(),c=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),m=e.ref(!1),i=e.ref(null),d=e.computed(()=>{var S;return(S=s.userInfo)==null?void 0:S.userName}),g=e.ref([]),f={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function h(){var S;d.value&&!m.value&&i.value&&((S=i.value)==null||S.validate(P=>{if(!P)if(c.value.confirmPassword!=c.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(c.value.newPassword==c.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else b(d.value,c.value.oldPassword,c.value.newPassword)}))}async function b(S,P,T){try{const k={userName:S,oldPassword:P,newPassword:T},x=await a.post("/api/core/account/changePassword",k);x.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(x.errorMessage||"Error"))}catch(k){r.error((k==null?void 0:k.toString())||n("Error"))}}async function N(){try{const S=await a.get("/api/core/system/passwordOptions");S.isSuccess&&S.value!=null?g.value=S.value:r.error(n(S.errorMessage||"Error"))}catch(S){console.error(S),r.error((S==null?void 0:S.toString())||n("Error"))}}return e.onMounted(()=>{N()}),(S,P)=>{const T=e.resolveComponent("n-input"),k=e.resolveComponent("n-form-item"),x=e.resolveComponent("n-spin"),V=e.resolveComponent("n-text"),E=e.resolveComponent("n-button"),O=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(O,{show:S.show,onClose:P[3]||(P[3]=()=>S.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[g.value.length?(e.openBlock(),e.createElementBlock("ul",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j},[e.createVNode(V,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(E,{type:"primary",block:"",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),{model:c.value,ref_key:"formRef",ref:i,rules:f},{default:e.withCtx(()=>[e.createVNode(x,{show:m.value},{default:e.withCtx(()=>[e.createVNode(k,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(T,{value:d.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:c.value.oldPassword,"onUpdate:value":P[0]||(P[0]=j=>c.value.oldPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:c.value.newPassword,"onUpdate:value":P[1]||(P[1]=j=>c.value.newPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:c.value.confirmPassword,"onUpdate:value":P[2]||(P[2]=j=>c.value.confirmPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),ut=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pa))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}});function Qo(t){return typeof t=="object"&&t!==null&&"source"in t}function Ie(t){return typeof t=="object"&&t!==null&&"name"in t}function rs(t){for(const l in t)delete t[l]}function Xo(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=de(r)||!1;break;default:const a=$o(o.dataType);a!=null&&(l[n]=a)}}return l}function Jo(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=de(a)||!1:o[r]=de(a)||null;break;default:o[r]=a||null;break}}}function qo(t,l){const o={};return Object.assign(o,t),Jo(t,l,o),o}function as(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function Uo(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(te(r)),visibility:!0,editor:"text"});else if(Ie(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?as(r.dataType):!r.required,label:r.title?o(r.title):o(te(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(s=>{if(typeof s=="string"){let c=s;return c&&(r.prefix&&(c=r.prefix+c),r.suffix&&(c=c+r.suffix)),{value:s,label:o(c)}}else return s})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(s=>{if(typeof s=="string"){let c=s;return c&&(r.prefix&&(c=r.prefix+c),r.suffix&&(c=c+r.suffix)),{value:s,label:o(c)}}else return s})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function pt(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function Be(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:te(o),sortIndex:0,visible:!0});else if(Ie(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:pt(o.size),minWidth:pt(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=Be(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function ss(t,l){return Ce.render(t,l)}function vo(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ie(a)&&a.search){const s={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(te(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")s.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(s.searchMethod=a.search);else{if(a.search.editor&&(s.editor=a.search.editor),a.search.method=="range"?s.searchMethod="range":s.searchMethod="normal",a.search.required&&(s.nullable=!1),a.search.role){const c=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(s.role)for(let m of c)s.role.includes(m)||s.role.push(m);else s.role=c}a.search.field&&(s.searchField=a.search.field),s.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?s.valueSource={type:"static",isLoading:!1,values:a.values.map(c=>{if(typeof c=="string"){let m=c;return a.formatter&&(m=a.formatter.call(null,m,null)??m),m&&(s.prefix&&(m=s.prefix+m),s.suffix&&(m=m+s.suffix)),{value:c,label:o(m)}}else return c})}:typeof a.values=="function"?s.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?s.valueSource={type:"static",isLoading:!1,values:a.values.source.map(c=>{var m;return typeof c=="string"?{value:c,label:o(((m=a.formatter)==null?void 0:m.call(null,c,null))||c)}:c})}:s.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},s.dataType=="boolean"&&Array.isArray((r=s.valueSource)==null?void 0:r.values))){const c=s.valueSource.values;c.length<=2&&c.splice(0,0,{value:"",label:""})}n.push(s)}return n}async function Fe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=v(a,o));const s=await t.get(a);if(s.isSuccess&&s.value!=null){let c=s.value;if(!Array.isArray(c)&&"rows"in c&&Array.isArray(c.rows)&&(c=c.rows),Array.isArray(c)){const m=c.filter(i=>i&&!0).map(i=>{if(typeof i=="string")return{value:i,label:n?n(i):i};{let d;if(l.renderLabel)d=l.renderLabel(i);else if(l.labelTemplate)d=Ce.render(l.labelTemplate,i);else{if(d=i[l.label||"label"],n&&(d=n(d)),l.subLabel){const g=i[l.subLabel];typeof g=="string"&&(d+=" "+(n?n(g):g))}d&&(l.prefix&&(d=l.prefix+d),l.suffix&&(d=d+l.suffix))}return{value:i[l.key||"value"],label:d}}});r&&m.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...m)}}}finally{l.isLoading=!1}}}function mt(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function is(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function cs(t,l,o){return e.h(u.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(u.NIcon,{size:20},{default:()=>e.h(t)})})}function ds(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const Pe=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=c=>{const m=Eo(c);return m===void 0?null:m},a=e.ref(r(o.value)),s=c=>{if(c!=null){a.value=c;const m=st(c);n("update:value",m,c)}else n("update:value",null,c)};return e.watch(()=>o.value,c=>a.value=r(c)),(c,m)=>(e.openBlock(),e.createBlock(e.unref(u.NDatePicker),{value:a.value,type:c.type,placeholder:"",disabled:c.readonly,"onUpdate:value":s,clearable:c.clearable},null,8,["value","type","disabled","clearable"]))}}),ht=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=c=>{if(c==null)return null;if(typeof c=="number"){const m=new Date(2e3,1,1);return m.setSeconds(c),m.getTime()}else if(typeof c=="string"){const m=Ao(c);if(!m)return null;const i=new Date(2e3,1,1);return i.setMilliseconds(m.millisecond+m.second*1e3+m.minute*60*1e3+m.hour*60*60*1e3),i.getTime()}else return c instanceof Date?c.getTime():null},a=c=>{if(c!=null){s.value=c;const m=new Date;m.setTime(c);const i=m.getSeconds()+m.getMinutes()*60+m.getHours()*60*60;n("update:value",i)}else n("update:value",null)},s=e.ref(r(o.value));return e.watch(()=>o.value,c=>s.value=r(c)),(c,m)=>(e.openBlock(),e.createBlock(e.unref(u.NTimePicker),{value:s.value,type:c.type,placeholder:"",disabled:c.readonly,"onUpdate:value":a,clearable:c.clearable},null,8,["value","type","disabled","clearable"]))}}),gt=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),s=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],c=m=>{const i=de(m);i==null?n("update:value",null):n("update:value",i)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(m,i)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:a.value,options:s,placeholder:"",disabled:m.readonly,clearable:"","onUpdate:value":i[0]||(i[0]=d=>c(d))},null,8,["value","disabled"]))}}),yt=()=>{const{t}=Z(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=b=>b&&t(b),a=b=>e.h("div",{},b.split(`
3
+ `).map(N=>e.h("span",{class:"line"},t(N))));return{t:r,message:(b,N)=>{switch(N){case"create":l.create(()=>a(b));break;case"error":l.error(()=>a(b));break;case"loading":l.loading(t(b));break;case"success":l.success(t(b));break;case"warning":l.warning(t(b));break;default:case"info":l.info(t(b));break}},confirm:(b,N,S)=>{o.warning({title:t(b??"Confirm"),content:()=>a(N),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>S()})},error:b=>l.error(t(b)),success:b=>l.success(t(b)),warning:b=>l.warning(t(b)),info:b=>l.info(t(b)),errorDialog:(b,N,S)=>{o.error({title:t(N??"Error"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},successDialog:(b,N,S)=>{o.success({title:t(N??"Success"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},warningDialog:(b,N,S)=>{o.warning({title:t(N??"Warning"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},infoDialog:(b,N,S)=>{o.info({title:t(N??"Information"),content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},showSearchModal:b=>{let N=[];const S=n.create({title:t(b.title??"Search"),preset:"card",style:{width:b.width??"800px",height:b.height??"600px"},contentClass:"flex-column",draggable:b.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:b.config,multiSelect:b.multiSelect==!0,onSearchBack:P=>{b.callback.call(null,P)},onResultSelected:(P,T)=>{N=T??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(u.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{N.length&&(b.callback.call(null,N),S.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>S.destroy()},()=>t("Close"))])})},showQrModal:(b,N)=>{const S=n.create({title:N,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(u.NQrCode,{value:b,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},b),e.h(u.NButton,{type:"primary",onClick:()=>S.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})}}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}},fs=Ge.exports,en;function us(){return en||(en=1,function(t,l){(function(o,n){n()})(fs,function(){function o(i,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}function n(i,d,g){var f=new XMLHttpRequest;f.open("GET",i),f.responseType="blob",f.onload=function(){m(f.response,d,g)},f.onerror=function(){console.error("could not download file")},f.send()}function r(i){var d=new XMLHttpRequest;d.open("HEAD",i,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function a(i){try{i.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof He=="object"&&He.global===He?He:void 0,c=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(i,d,g){var f=s.URL||s.webkitURL,h=document.createElement("a");d=d||i.name||"download",h.download=d,h.rel="noopener",typeof i=="string"?(h.href=i,h.origin===location.origin?a(h):r(h.href)?n(i,d,g):a(h,h.target="_blank")):(h.href=f.createObjectURL(i),setTimeout(function(){f.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(i,d,g){if(d=d||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,g),d);else if(r(i))n(i,d,g);else{var f=document.createElement("a");f.href=i,f.target="_blank",setTimeout(function(){a(f)})}}:function(i,d,g,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof i=="string")return n(i,d,g);var h=i.type==="application/octet-stream",b=/constructor/i.test(s.HTMLElement)||s.safari,N=/CriOS\/[\d]+/.test(navigator.userAgent);if((N||h&&b||c)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var k=S.result;k=N?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=k:location=k,f=null},S.readAsDataURL(i)}else{var P=s.URL||s.webkitURL,T=P.createObjectURL(i);f?f.location=T:location.href=T,f=null,setTimeout(function(){P.revokeObjectURL(T)},4e4)}});s.saveAs=m.saveAs=m,t.exports=m})}(Ge)),Ge.exports}var ps=us();function tn(){const t=le.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function ms(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function me(t,l,o,n){const r=tn();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:s,headers:c,status:m,statusText:i}=a;if(m==200||s.length){c&&(o||(o=c["content-type"]),l||(l=ms(c["content-disposition"])));const d=new Blob([s],{type:o||"application/octet-stream"});ps.saveAs(d,l)}else throw`[${m}] ${i}`}async function on(t,l,o){const n=tn();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:s,status:c,statusText:m}=r;if(c==200||a.length){s&&(l||(l=s["content-type"]));const i=new Blob([a],{type:l||"application/octet-stream"}),d=URL.createObjectURL(i);window.open(d)}else throw`[${c}] ${m}`}function nn(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function hs(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function ln(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function gs(t,l,o,n,r,a){const s={name:t,label:l||te(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},c=a??(m=>m);return r&&(typeof r=="string"?s.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?s.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?s.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:c(r[0])},{value:"false",label:c(r[1])}]}:s.valueSource={type:"static",isLoading:!1,values:r.map(m=>typeof m=="string"?{value:m,label:c(m)}:m)}:Qo(r)?Array.isArray(r.source)?s.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(m=>typeof m=="string"?{value:m,label:c(m)}:m)]}:s.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:s.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(m=>({value:r[m],label:c(m)}))}),s}function ys(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function ws(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],s=Math.max(1,Math.floor(r/l));let c=r;for(let m=0;m<l;m++){let i;m==l-1?i=Math.max(0,c):(i=Math.min(s,c),c=Math.max(0,c-s)),i=parseFloat((i/n).toFixed(o)),a.push(i)}return a}function Cs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),s=[];let c=r;for(;c>0;){let m=Math.min(a,c);c-=a,s.push(parseFloat((m/n).toFixed(o)))}return s}function bs(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}const ie=()=>{const t=yt(),l=e.inject("axios");async function o(m,i="Error"){if(m)if(m.response){let d=t.t(m.response.statusText);return m.response.data&&(m.response.data instanceof Blob?d+=`
4
+ `+t.t(await m.response.data.text()):d+=`
5
+ `+t.t(m.response.data.toString()),console.log(d)),d}else return m.toString();else return i}function n(m,i,d){t.confirm(m,i,()=>{r(d)})}async function r(m){var i,d,g,f,h,b;try{(i=m.loadingStatus)==null||i.call(null,!0);let N;m.data?N=await l.post(m.url,m.data):N=await l.post(m.url),(d=m.callback)==null||d.call(null,N),N.isSuccess?((g=m.success)==null||g.call(null,N.value),m.successMessage===!0?t.message("Successful operation.","success"):typeof m.successMessage=="string"&&t.message(m.successMessage,"success")):((f=m.fail)==null||f.call(null,N),N.errorMessage&&console.error(N.errorMessage),m.failMessage?t.message(m.failMessage,"error"):t.message(N.errorMessage??((h=N.value)==null?void 0:h.toString())??"Error","error"))}catch(N){t.message(await o(N)??m.failMessage??"Error")}finally{(b=m.loadingStatus)==null||b.call(null,!1)}}async function a(m){var i,d,g,f;try{(i=m.loadingStatus)==null||i.call(null,!0);let h=await l.get(m.url);if(h.isSuccess)return(d=m.callback)==null||d.call(null,h.value),h.value;m.quiet!=!0&&t.message(h.errorMessage??((g=h.value)==null?void 0:g.toString())??"Error","error")}catch(h){t.message(await o(h)??"Error","error")}finally{(f=m.loadingStatus)==null||f.call(null,!1)}}async function s(m){var i,d,g;try{(i=m.loadingStatus)==null||i.call(null,!0),await on(m.url,m.contentType,m.method),(d=m.callback)==null||d.call(null)}catch(f){t.message(await o(f)??"Error","error")}finally{(g=m.loadingStatus)==null||g.call(null,!1)}}async function c(m){var i,d,g;try{(i=m.loadingStatus)==null||i.call(null,!0),await me(m.url,m.filename,m.contentType,m.method),(d=m.callback)==null||d.call(null)}catch(f){t.message(await o(f)??"Error","error")}finally{(g=m.loadingStatus)==null||g.call(null,!1)}}return{post:r,get:a,confirmToPost:n,getHttpErrorMessage:o,openFile:s,downloadFile:c}},wt=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=Ne(),a=ie(),s=e.ref(i(o.value)),c=e.ref([]);async function m(){if(o.tagSource){const g=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);c.value=g.map(f=>({value:f.code,label:`[${f.code}] ${f.name}`}))}else c.value=[]}function i(g){return g?g.split(","):[]}function d(g){o.disabled||(Array.isArray(g)?n("update:value",g.join(",")):n("update:value",g))}return e.watch(()=>o.value,g=>s.value=i(g)),e.watch(()=>o.tagSource,()=>m()),e.onMounted(()=>m()),(g,f)=>g.tagSource?(e.openBlock(),e.createBlock(e.unref(u.NSelect),{key:0,value:s.value,multiple:"",options:c.value,"onUpdate:value":d},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(u.NDynamicTags),{key:1,value:s.value,"onUpdate:value":d},null,8,["value"]))}}),Ct=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=()=>{o.readonly||n("update:value",c()),n("update:show",!1)},s=()=>{var i,d,g,f;return o.value?Array.isArray(o.value)?o.value.join(`
6
+ `):((f=(g=(d=(i=o.value)==null?void 0:i.replace(/\n/g,","))==null?void 0:d.split(","))==null?void 0:g.map(b=>b.trim()))==null?void 0:f.filter((b,N,S)=>b&&S.indexOf(b)==N)).join(`
7
+ `):o.value},c=()=>{var d,g,f;return m.value?((f=(g=(d=m.value)==null?void 0:d.split(/\r?\n/))==null?void 0:g.map(h=>h.trim()))==null?void 0:f.filter((h,b,N)=>h&&N.indexOf(h)==b)).join(","):""},m=e.ref(s());return e.watch(()=>o.value,()=>{m.value=s()}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"350px"},draggable:"",onClose:d[2]||(d[2]=()=>i.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:i.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:d[1]||(d[1]=()=>i.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:m.value,"onUpdate:value":d[0]||(d[0]=g=>m.value=g),placeholder:i.placeholder,maxlength:i.maxLength,type:"textarea",readonly:i.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),bt=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),s=o.config;function c(){a.value=!a.value}function m(i){i!=null&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{console.log(`value changed: [${i}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:i.inputReadOnly,value:i.value,placeholder:i.placeholder,"onUpdate:value":d[0]||(d[0]=g=>i.$emit("update:value",g))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:c},{default:e.withCtx(()=>d[4]||(d[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":d[2]||(d[2]=g=>a.value=g),title:e.unref(r)(e.unref(s).title??i.label??""),onClose:d[3]||(d[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(s).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(s).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s).componentType),{key:0,style:e.normalizeStyle(e.unref(s).style),"onUpdate:selected":d[1]||(d[1]=g=>m(g))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),ks={key:0,style:{"flex-grow":"1"}},Ns={key:0,style:{"text-align":"right"}},xs=["readonly","disabled"],Ss=["readonly","disabled"],Ve=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=Z(),s=e.inject("axios"),c=e.ref(void 0),m=e.ref(!1),i=e.ref(!1);function d(f){if(f.target instanceof HTMLInputElement){const h=f.target.files;h!=null&&h.length?r.value=h[0]:r.value=null}}async function g(f){var b,N;const h=(b=o.formItem)==null?void 0:b.valueSource;h&&h.type=="remote"&&h.sourceUrl&&h.filterable&&Fe(s,h,{searchWords:f},S=>h.i18n?a(S):S,((N=o.formItem)==null?void 0:N.nullable)!=!1)}return e.watch(r,f=>{n("update:value",f)}),e.watch(()=>o.value,f=>{r.value=f}),e.onMounted(()=>{var f,h;(h=(f=o.formItem)==null?void 0:f.role)!=null&&h.length&&(m.value=o.formItem.role.includes("list"),c.value=o.formItem.role.map(b=>`halo-form-${b}`).join(" "))}),(f,h)=>{var E,O,j,D,H,B,y,I,A,L,z,F,Y,U,ee,oe,ne,W;const b=e.resolveComponent("n-switch"),N=e.resolveComponent("n-text"),S=e.resolveComponent("n-select"),P=e.resolveComponent("n-input-number"),T=e.resolveComponent("n-checkbox"),k=e.resolveComponent("n-input"),x=e.resolveComponent("n-icon"),V=e.resolveComponent("n-button");return f.formItem?(e.openBlock(),e.createElementBlock("div",ks,[typeof f.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.formItem.editor),{value:r.value,"onUpdate:value":h[0]||(h[0]=K=>r.value=K)},null,40,["value"]))],1024)):((E=f.formItem.editor)==null?void 0:E.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":h[1]||(h[1]=K=>r.value=K),config:f.formItem.editorConfig,label:f.formItem.label,readonly:f.readonly,disabled:f.readonly},null,40,["value","config","label","readonly","disabled"])):f.formItem.editor=="modal"?(e.openBlock(),e.createBlock(bt,{key:2,value:r.value,"onUpdate:value":h[2]||(h[2]=K=>r.value=K),config:f.formItem.editorConfig,label:f.formItem.label},null,8,["value","config","label"])):f.formItem.editor=="boolean"&&Array.isArray(f.formItem.values)&&f.formItem.values.length>1?(e.openBlock(),e.createBlock(b,{key:3,value:r.value,"onUpdate:value":h[3]||(h[3]=K=>r.value=K),style:e.normalizeStyle((O=f.formItem.editorConfig)==null?void 0:O.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.formItem.values[1]),1)]),_:1},8,["value","style"])):f.formItem.valueSource?(e.openBlock(),e.createBlock(S,{key:4,value:r.value,"onUpdate:value":h[4]||(h[4]=K=>r.value=K),remote:f.formItem.valueSource.type=="remote",loading:f.formItem.valueSource.isLoading,options:f.formItem.valueSource.values,filterable:f.formItem.valueSource.filterable,multiple:((j=f.formItem.role)==null?void 0:j.includes("list"))==!0,placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((D=f.formItem.editorConfig)==null?void 0:D.style),onSearch:g},{action:e.withCtx(()=>[f.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ns,[e.createVNode(N,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):f.formItem.editor=="number"?(e.openBlock(),e.createBlock(P,{key:5,value:r.value,"onUpdate:value":h[5]||(h[5]=K=>r.value=K),min:f.formItem.minValue,max:f.formItem.maxValue,clearable:f.formItem.nullable,readonly:f.readonly,placeholder:f.placeholder,style:e.normalizeStyle((H=f.formItem.editorConfig)==null?void 0:H.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):f.formItem.editor=="boolean"&&f.formItem.nullable?(e.openBlock(),e.createBlock(gt,{key:6,value:r.value,"onUpdate:value":h[6]||(h[6]=K=>r.value=K),placeholder:"",disabled:f.readonly,style:e.normalizeStyle((B=f.formItem.editorConfig)==null?void 0:B.style)},null,8,["value","disabled","style"])):f.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(T,{key:7,checked:r.value,"onUpdate:checked":h[7]||(h[7]=K=>r.value=K),disabled:f.readonly,style:e.normalizeStyle((y=f.formItem.editorConfig)==null?void 0:y.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:1},8,["checked","disabled","style"])):f.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Pe,{key:8,value:r.value,"onUpdate:value":h[8]||(h[8]=K=>r.value=K),type:"datetime",placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((I=f.formItem.editorConfig)==null?void 0:I.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="date"?(e.openBlock(),e.createBlock(Pe,{key:9,value:r.value,"onUpdate:value":h[9]||(h[9]=K=>r.value=K),type:"date",placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((A=f.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="time"?(e.openBlock(),e.createBlock(ht,{key:10,value:r.value,"onUpdate:value":h[10]||(h[10]=K=>r.value=K),placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((L=f.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="color"?(e.openBlock(),e.createBlock(ut,{key:11,value:r.value,"onUpdate:value":h[11]||(h[11]=K=>r.value=K),placeholder:"",disabled:f.readonly,readonly:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((z=f.formItem.editorConfig)==null?void 0:z.style)},null,8,["value","disabled","readonly","clearable","style"])):f.formItem.editor=="tags"?(e.openBlock(),e.createBlock(wt,{key:12,value:r.value,"onUpdate:value":h[12]||(h[12]=K=>r.value=K),tagSource:f.formItem.tagSource,placeholder:"",disabled:f.readonly,style:e.normalizeStyle((F=f.formItem.editorConfig)==null?void 0:F.style)},null,8,["value","tagSource","disabled","style"])):f.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:d,readonly:f.readonly,disabled:f.readonly,style:e.normalizeStyle((Y=f.formItem.editorConfig)==null?void 0:Y.style)},null,44,xs)):f.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:d,readonly:f.readonly,disabled:f.readonly,style:e.normalizeStyle((U=f.formItem.editorConfig)==null?void 0:U.style)},null,44,Ss)):f.formItem.editor=="password"?(e.openBlock(),e.createBlock(k,{key:15,value:r.value,"onUpdate:value":h[13]||(h[13]=K=>r.value=K),class:e.normalizeClass(c.value),placeholder:f.placeholder??"",type:"password",readonly:f.readonly,style:e.normalizeStyle((ee=f.formItem.editorConfig)==null?void 0:ee.style)},null,8,["value","class","placeholder","readonly","style"])):f.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(k,{key:16,value:r.value,"onUpdate:value":h[14]||(h[14]=K=>r.value=K),class:e.normalizeClass(c.value),type:"textarea",placeholder:f.placeholder??"",readonly:f.readonly,style:e.normalizeStyle((oe=f.formItem.editorConfig)==null?void 0:oe.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(k,{key:17,value:r.value,"onUpdate:value":h[16]||(h[16]=K=>r.value=K),class:e.normalizeClass(c.value),placeholder:f.placeholder??"",readonly:f.readonly,clearable:f.formItem.nullable,type:f.formItem.editor,style:e.normalizeStyle((ne=f.formItem.editorConfig)==null?void 0:ne.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(V,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:h[15]||(h[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ha))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),m.value?(e.openBlock(),e.createBlock(Ct,{key:18,show:i.value,"onUpdate:show":h[17]||(h[17]=K=>i.value=K),title:f.formItem.label,readonly:f.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":h[18]||(h[18]=K=>r.value=K),style:e.normalizeStyle((W=f.formItem.editorConfig)==null?void 0:W.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),Is=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Ve,NForm:u.NForm,NFormItem:u.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=Z(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),s=e.ref(t.columns||1),c=e.ref({}),m=e.ref(g(t.formItems)),i=h(t.formItems),d=e.ref(void 0);function g(k){return k?[...new Set(k.map(V=>V.group))].map(V=>({label:V||"General",items:k.filter(E=>E.group==V)})):[]}function f(k){return k.dataType=="boolean"&&!k.nullable?" ":k.label}function h(k){const x={};if(k&&k.length)for(const V of k){const E=[];V.nullable==!1&&V.dataType!="boolean"&&E.push({required:!0,message:o("Must be filled here.")}),E.length&&(x[V.name]=E)}return x}async function b(k,x){var V;if(x.type=="remote"&&x.sourceUrl)Fe(n,x,null,E=>x.i18n?o(E):E,k.nullable);else if(x.type=="function"&&x.func){x.isLoading=!0;try{const E=(V=x.func)==null?void 0:V.call(void 0);E&&(x.values=E)}finally{x.isLoading=!1}}}function N(){var k;(k=t.formItems)==null||k.forEach(x=>{x.valueSource&&(x.valueSource.type=="remote"||x.valueSource.type=="function")&&b(x,x.valueSource)})}function S(k,x){l.emit("itemChange",{item:k,data:t.data,value:x})}function P(k){return!!(k.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(k.readonly)&&k.readonly.includes(t.method))}function T(k){return!!(k.visibility==!0||t.method&&Array.isArray(k.visibility)&&k.visibility.includes(t.method))}return e.onMounted(()=>{N(),t.data&&(c.value=t.data)}),e.watch(()=>t.data,k=>c.value=k||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:f,originalModel:d,model:c,rules:i,formColumns:s,updateValue:S,formGroups:m,isReadonly:P,isVisible:T}}}),Bs={class:"item-box"},Vs={class:"item-box"},Ms={class:"item-box"};function Ts(t,l,o,n,r,a){const s=e.resolveComponent("form-input"),c=e.resolveComponent("n-text"),m=e.resolveComponent("n-form-item-grid-item"),i=e.resolveComponent("n-grid"),d=e.resolveComponent("n-tab-pane"),g=e.resolveComponent("n-tabs"),f=e.resolveComponent("n-grid-item"),h=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(h,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(g,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(d,{key:b,name:b.label,tab:t.t(b.label)},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,N=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:N.name,label:t.getItemLabel(N),path:N.name,feedback:N.errorMessage,"validation-status":N.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Bs,[e.createVNode(s,{"form-item":N,value:t.model[N.name],"onUpdate:value":[S=>t.model[N.name]=S,S=>t.updateValue(N,S)],readonly:t.isReadonly(N),label:N.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),N.description?(e.openBlock(),e.createBlock(c,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(N.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(N)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(i,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(f,{key:b},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,N=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:N.name,label:t.getItemLabel(N),path:N.name,feedback:N.errorMessage,"validation-status":N.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Vs,[e.createVNode(s,{"form-item":N,value:t.model[N.name],"onUpdate:value":[S=>t.model[N.name]=S,S=>t.updateValue(N,S)],readonly:t.isReadonly(N),label:N.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),N.description?(e.openBlock(),e.createBlock(c,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(N.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(N)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(i,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,b=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:b.name,label:t.getItemLabel(b),path:b.name,feedback:b.errorMessage,"validation-status":b.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ms,[e.createVNode(s,{"form-item":b,value:t.model[b.name],"onUpdate:value":[N=>t.model[b.name]=N,N=>t.updateValue(b,N)],readonly:t.isReadonly(b),label:b.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),b.description?(e.openBlock(),e.createBlock(c,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(b.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(b)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const kt=re(Is,[["render",Ts],["__scopeId","data-v-e7319d81"]]),As={class:"pg-value flex-grow-1"},Nt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=Z(),n=e.ref(a());function r(){n.value=a()}function a(){var d;const s=new Array,c=l.data,m=l.names,i=l.hideEmpty;if(c)if(m)for(const g of m)if(typeof g=="string")(!i||c[g])&&s.push({label:o(te(g)),value:c[g],span:1});else{const f={label:o(g.label||te(g.name)),value:c[g.name],span:g.span||1,dataType:g.dataType,role:g.role};f.value!=null&&(f.dataType=="boolean"?f.value=de(f.value)?o("Yes"):o("No"):g.i18n&&(f.value=o((d=f.value)==null?void 0:d.toString()))),(!i||f.value)&&s.push(f)}else if(Array.isArray(c))for(const g of c)(!i||g.value)&&s.push({label:o(te(g.label)),value:g.value,span:1});else for(const g in c)(!i||c[g])&&s.push({label:o(te(g)),value:c[g],span:1});return s}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(s,c)=>(e.openBlock(),e.createBlock(e.unref(u.NGrid),{cols:s.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(m=>!s.hideEmpty||m.value),m=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{class:"pg-item",key:m.label,span:m.span},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{label:m.label,value:m.value},()=>[e.createElementVNode("div",{class:"flex-row justify",style:e.normalizeStyle({"justify-content":s.justify})},[e.createVNode(e.unref(u.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label)+":",1)]),_:2},1024),e.createElementVNode("div",As,[m.role=="percent"?(e.openBlock(),e.createBlock(e.unref(u.NProgress),{key:0,type:"line",percentage:Number(m.value),title:m.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(u.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:2},1024))])],4)])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),Es={key:0},_s={class:"flex-column gap1 flex-grow-1"},zs={class:"flex-row",style:{"justify-content":"space-between"}},Ls={class:"text-monospace",style:{"font-size":"24pt"}},Ds={key:0},$s=["src"],Rs=["src"],Os={style:{"text-align":"right"}},rn=e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=Z(),o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(u.NSpin),{show:n.loading,style:{"align-self":"center",margin:"1em"},class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCard),{embedded:"",style:{width:"1080px"},segmented:{content:!0,footer:"soft"},class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NH2),{style:{"margin-bottom":"2px"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon"),n.title?(e.openBlock(),e.createElementBlock("span",Es,e.toDisplayString(e.unref(l)(n.title)),1)):e.createCommentVNode("",!0)]),_:3})]),"header-extra":e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[0]||(r[0]=()=>n.$emit("refresh"))},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(l)("Refresh")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_s,[e.createElementVNode("div",zs,[e.createElementVNode("div",null,[e.createElementVNode("div",Ls,e.toDisplayString(n.subject),1),n.showBarcode?(e.openBlock(),e.createElementBlock("div",Ds,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+n.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,$s)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[n.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+n.subject+"&format=CODE_128&width=100&height=100"},null,8,Rs)):e.createCommentVNode("",!0)])]),e.createVNode(e.unref(u.NCollapse),{"display-directive":"show","default-expanded-names":"info"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCollapseItem),{name:"info",title:e.unref(l)("Property")},{default:e.withCtx(()=>[e.createVNode(Nt,{data:n.data,columns:n.columns,names:n.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"]),e.createElementVNode("div",Os,[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[1]||(r[1]=a=>o.value=!o.value),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref($a))]),_:1})]),_:1},8,["title"])])]),_:1},8,["title"])]),_:1}),e.renderSlot(n.$slots,"default")])]),_:3})]),_:3},8,["show"])]))}}),js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Fs=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Ps={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Hs=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ps,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),Gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ks=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zs=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),Ys={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},an=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ys,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),Qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},sn=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Js=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xt=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),Us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},vs=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},cn=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),ti={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},dn=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ti,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},St=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},It=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ni,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),li={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fn=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",li,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),ri={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ai=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ri,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Bt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),ii={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ci=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ii,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),di={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fi=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",di,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),ui={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pi=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ui,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},hi=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),gi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yi=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",gi,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),wi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},un=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),Ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pn=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ci,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ki=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",bi,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),Ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xi=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ni,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),Si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ii=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29.707 7.293l-3-3a1 1 0 0 0-1.414 0L16 13.586V18h4.414l9.293-9.293a1 1 0 0 0 0-1.414zM19.586 16H18v-1.586l5-5L24.586 11zM26 9.586L24.414 8L26 6.414L27.586 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M27.006 14.235l-1.414 1.414L28 18.058L18.058 28L4 13.941V4h9.942l4.406 4.407l1.415-1.415l-4.407-4.406A2 2 0 0 0 13.94 2H4a2 2 0 0 0-2 2v9.941a2 2 0 0 0 .586 1.414l14.058 14.06a2.001 2.001 0 0 0 2.828 0l9.943-9.943a2.001 2.001 0 0 0 0-2.828z",fill:"currentColor"},null,-1)]))}}),Bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vi=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Bi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),Mi={style:{"min-height":"50px"}},Vt=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=Z(),n=e.ref(null),r=e.ref(c()),a=e.ref(null),s=e.ref(m());function c(){let i=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const d=l.supportedFormats;return d&&(i=i.filter(g=>d.includes(g.value))),n.value=i.length?i[0].value:null,i}function m(){const i=l.supportedRanges||["empty","selection","page","all"],d=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(g=>i.includes(g.value));return l.range?a.value=l.range:a.value=d.length?d[0].value:null,d}return e.watch(()=>l.range,i=>{i&&(a.value=i)}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:i.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:d[4]||(d[4]=()=>i.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:d[2]||(d[2]=()=>i.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:d[3]||(d[3]=()=>i.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Mi,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:r.value,value:n.value,"onUpdate:value":d[0]||(d[0]=g=>n.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),s.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:s.value,value:a.value,"onUpdate:value":d[1]||(d[1]=g=>a.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"options")])]),_:3},8,["show","title"]))}}),Ti={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},mn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ti,[e.createVNode(e.unref(u.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(ki))]),_:1}),e.createVNode(e.unref(u.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),Ai=e.defineComponent({components:{FullscreenIcon:Ia,ExitFullscreenIcon:xa},emits:["change"],setup(t,l){const{t:o}=Z(),n=Ne(),r=e.computed(()=>n.isFullscreen);function a(i){i||(i=document.body),i.requestFullscreen&&i.requestFullscreen()}function s(){document.exitFullscreen&&document.exitFullscreen()}function c(i){var d;if(r.value)s();else{const g=(d=i.target)==null?void 0:d.closest(".fullscreen-view");a(g)}}function m(){const i=!!document.fullscreenElement;n.setIsFullscreen(i),l.emit("change",i)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",m),document.addEventListener("mozfullscreenchange",m),document.addEventListener("webkitfullscreenchange",m),document.addEventListener("msfullscreenchange",m)}),{t:o,isFullscreen:r,toggleFullscreen:c}}});function Ei(t,l,o,n,r,a){const s=e.resolveComponent("fullscreen-icon"),c=e.resolveComponent("exit-fullscreen-icon"),m=e.resolveComponent("n-icon"),i=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(i,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(c,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const hn=re(Ai,[["render",Ei]]),Mt=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(g=>{typeof g=="string"?(o[g]=!1,n.push(g)):(o[g.id]=!1,o[g.name]=!1,n.push(g.id),r.push(g))});let a=0;async function s(g){a||await m(g)}function c(){for(let g in o)o[g]=!1}async function m(g){c();const f=n.filter(h=>(h==null?void 0:h.length)==32);if(f.length)try{let h=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(f.join())}`);h.isSuccess&&h.value!=null?(a++,h.value.forEach(b=>{o[b]=!0;const N=r.find(S=>S.id==b);N&&(o[N.name]=!0)}),g==null||g.call(null,o)):console.error(h.errorMessage)}catch(h){console.error(h)}}function i(){for(let g in o)if(!o[g])return!1;return!0}function d(){for(let g in o)if(o[g])return!0;return!1}return{flags:o,check:m,checkOnce:s,all:i,any:d}},_i={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},zi={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},gn=200,Tt=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),s=e.inject("axios"),c=u.useMessage(),m=Mt(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),d=e.ref(!1),g=e.ref(!1),f=x=>x?x.map((V,E)=>({columnId:V.name,title:V.title?r(V.title):r(te(V.name)),visible:!0,sortIndex:E})).sort((V,E)=>V.sortIndex-E.sortIndex):[],h=x=>(V,E)=>{let O=null;if(x=="visible"){const j=Re(V[x]);O=e.h(u.NIcon,{size:"20"},{default:()=>j?e.h(sn):e.h(an)})}else x=="move_up"?O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Zs)}):x=="move_down"&&(O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Fs)}));return e.h(u.NButton,{text:!0,onClick:j=>{b(V,E,x),j.stopPropagation()}},{default:()=>O})};function b(x,V,E){switch(E){case"visible":x.visible=!x.visible;break;case"move_up":if(V>0&&T.value){const O=T.value.splice(V,1);T.value.splice(V-1,0,O[0])}break;case"move_down":if(T.value&&V<T.value.length-1){const O=T.value.splice(V,1);T.value.splice(V+1,0,O[0])}break}}const N=()=>{const x=o.gridId;x&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${x}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function S(){if(!o.gridId)return;const x={dataGridId:o.gridId,pageSize:i.value,columns:T.value.filter(V=>V.columnId).map((V,E)=>({columnId:V.columnId,visible:V.visible,sortIndex:E}))};x.pageSize&&(x.pageSize=Math.max(1,Math.min(gn,x.pageSize)));try{const V=d.value&&g.value,E=await s.post(`/api/core/UserDataGrids/Save?isDefault=${V}`,x);(E==null?void 0:E.isSuccess)==!0?(c.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",i.value),n("update:config",x)):c.error((E==null?void 0:E.errorMessage)||r("Error"))}catch(V){c.error((V==null?void 0:V.toString())||r("Error"))}}async function P(){if(o.gridId&&T.value.length)try{const x=d.value&&g.value,V=await s.get(`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(o.gridId)}?isDefault=${x}`);if(V!=null&&V.isSuccess)if(V.value){i.value=V.value.pageSize;for(const E of V.value.columns){const O=T.value.find(j=>j.columnId==E.columnId);O&&(O.visible=E.visible,O.sortIndex=E.sortIndex),T.value.sort((j,D)=>j.sortIndex-D.sortIndex)}}else T.value=f(o.gridColumns),i.value=o.pageSize;else console.log(V==null?void 0:V.errorMessage)}catch(x){console.log(x)}}e.watch(()=>o.show,x=>{x&&(m.checkOnce(V=>{g.value=V["2E2466DDD34847C8B33460E4277A6528"]}),P())}),e.watch(()=>o.gridColumns,()=>T.value=f(o.gridColumns)),e.watch(d,()=>P());const T=e.ref(f(o.gridColumns)),k=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:h("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:h("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:h("move_down")},{key:"empty",width:20,fixed:"right"}];return(x,V)=>{const E=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:x.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:V[3]||(V[3]=()=>x.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(E,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:S,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:N,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:V[2]||(V[2]=()=>x.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(e.unref(u.NSwitch),{value:d.value,"onUpdate:value":V[0]||(V[0]=O=>d.value=O)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{columns:k,data:T.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",zi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:i.value,"onUpdate:value":V[1]||(V[1]=O=>i.value=O),max:gn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),yn=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),s=e.ref(!1),c=e.ref([]);async function m(d){let g=o.sourceUrl;if(g){const f=o.labelFormatter,h=o.keyField,b=o.labelField,N=o.subLabelField,S=o.additionalQuery;s.value=!0,c.value=[];try{S&&(g=v(g,S,!0));const P=await a.get(g);if(P.isSuccess&&P.value!=null){let T=P.value;if(!Array.isArray(T)&&"rows"in T&&Array.isArray(T.rows)&&(T=T.rows),Array.isArray(T)){const k=T.filter(x=>x&&!0).map(x=>{if(typeof x=="string")return{value:x,label:f?f(x):r(x)};{let V=x[b||"label"];if(f&&(V=f(V)),N){const E=x[N];typeof E=="string"&&(V+=" "+(f?f(E):E))}return{value:x[h||"value"],label:V}}});c.value=k}}}finally{s.value=!1}}}function i(d,g){n("update:value",d,g)}return e.watch(()=>o.sourceUrl,()=>m()),e.onMounted(()=>{m()}),(d,g)=>{const f=e.resolveComponent("n-radio-button"),h=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(h,{value:d.value,size:d.size,"onUpdate:value":i},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,b=>(e.openBlock(),e.createBlock(f,{key:b.value,value:b.value,label:b.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ke=re(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=e.inject("axios"),c=T=>T==null?void 0:T.map(k=>typeof k=="string"?{label:a(k),value:k}:k),m=()=>{const T=new Array;if(n.searchItems)for(const k of n.searchItems)if(typeof k=="string")T.push({name:k,label:te(k),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let x=k;k.searchField&&(x=Object.assign({},k),x.name=k.searchField),T.push(x)}return T},i=()=>{const T={};if(N.forEach(k=>{T[k.name]=null,k.searchMethod=="range"&&(T[k.name+"From"]=null,T[k.name+"To"]=null)}),n.searchArgs)for(const k in T)n.searchArgs[k]!=null&&(T[k]=n.searchArgs[k]);return T},d=()=>{for(const T in S)S[T]=null},g=async T=>{var x,V;const k=T.valueSource;if(k){if(k.type=="remote"&&k.sourceUrl)await Fe(s,k,null,E=>k.i18n?a(E):E,!1),T.nullable==!1&&((x=k.values)!=null&&x.length)&&(S[T.name]=k.values[0].value);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const E=(V=k.func)==null?void 0:V.call(void 0);E&&(k.values=E)}finally{k.isLoading=!1}}}},f=()=>{var k;const T={};for(const x of N){const V=x.searchField??x.name;if(x.searchMethod=="range"){const E=h(V+"From",x);E!=null&&(T[V+"From"]=E);let O=h(V+"To",x);O!=null&&(x.editor=="date"&&typeof O=="string"&&(O=se(O,ge).add(1,"days").format(ge)),T[V+"To"]=O)}else{const E=h(V,x);E!=null&&(((k=x.role)==null?void 0:k.includes("list"))==!0&&typeof E=="string"?E.includes(",")?T[V]=E.split(","):T[V]=[E]:T[V]=E)}}return T},h=(T,k)=>{var V,E;let x=S[T];if(!(typeof x=="string"&&(x=x.trim(),x==""&&!k.valueSource))){if(Array.isArray((V=k.valueSource)==null?void 0:V.values)){const O=(E=k.valueSource)==null?void 0:E.values;if(O){if(O.some(j=>j.value==S[T]))x=S[T];else if(x=="")return;if(k.dataType=="boolean"){if(typeof x=="boolean")return x;const j=O.findIndex(D=>D.value==x);return j>-1&&(O.length==2?x=j==0:O.length==3&&j>0&&(x=j==1)),typeof x=="boolean"?x:Oe(x,k.dataType,k.role)}}}return Oe(x,k.dataType,k.role)}},b=()=>{r("update:searchArgs",f())},N=m(),S=e.reactive(i()),P=e.ref(c(n.groupOptions));return e.watch(()=>n.groupOptions,()=>P.value=c(n.groupOptions)),e.onMounted(()=>{i(),N.forEach(T=>{T.valueSource&&(T.valueSource.type=="remote"||T.valueSource.type=="function"?g(T):T.valueSource.type=="static")})}),l({reset:d,updateValues:b,pickValues:f}),(T,k)=>(e.openBlock(),e.createBlock(e.unref(u.NForm),{model:S,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),x=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{key:x.name},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)(x.label==null?x.name:x.label),path:x.name},{default:e.withCtx(()=>[x.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Ve,{"form-item":x,value:S[x.name+"From"],"onUpdate:value":V=>S[x.name+"From"]=V,style:{"flex-grow":"1"},onInput:k[0]||(k[0]=()=>b())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(u.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Ve,{"form-item":x,value:S[x.name+"To"],"onUpdate:value":V=>S[x.name+"To"]=V,style:{"flex-grow":"1"},onInput:k[1]||(k[1]=()=>b())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Ve,{key:1,"form-item":x,value:S[x.name],"onUpdate:value":V=>S[x.name]=V,onInput:k[2]||(k[2]=()=>b())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),P.value?(e.openBlock(),e.createBlock(e.unref(u.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{value:T.groupBy,options:P.value,"onUpdate:value":k[3]||(k[3]=x=>T.$emit("update:groupBy",x))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),Li={class:"flex-row gap05"},At=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=ie(),r=e.ref([]);async function a(){var c;const s=((c=l.tags)==null?void 0:c.map(m=>({value:m,text:m})))??[];if(r.value=s,l.tagSource){const m=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const i of s){const d=m.find(g=>g.code==i.value);d&&(i.desc=d.name,i.color=d.color)}r.value=[...s]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(s,c)=>(e.openBlock(),e.createElementBlock("div",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,m=>(e.openBlock(),e.createBlock(e.unref(u.NTag),{key:m.value,title:m.desc,color:{borderColor:m.color},size:s.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),We=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=ce.useRouter(),c=yt(),m=e.ref(void 0),i=e.ref(P()),d=e.ref([]),g=e.ref(void 0),f=e.ref(h());function h(){const y={};return typeof n.height=="number"?y.height=`${n.height}px`:typeof n.height=="string"&&(y.height=n.height),y}function b(){var A;const y=d.value,I=(A=n.data)==null?void 0:A.filter(L=>y.includes(L[n.keyField]));r("update:selectedIds",y,I),y.length&&r("update:selectedId",y[0])}function N(y){return y[n.keyField]}function S(y,I){let A=0,L=0;for(const z of I){let F,Y;if(typeof z=="string")F={key:z,title:a(te(z))};else if(!(z.behavior=="none"||z.visible==!1))if(z.behavior=="link"||z.behavior=="router-link")F={key:z.name||`column_${A}`,title:z.title?a(z.title):void 0,align:z.align,fixed:z.fixed||void 0,width:z.width,sorter:z.sortable==!0,render:z.render||T(z)};else if(z.behavior=="button")F={key:z.name||`column_${A}`,title:z.title?a(z.title):void 0,align:z.align||"center",fixed:z.fixed||void 0,width:z.width,sorter:z.sortable==!0,render:z.render||T(z)};else{let U=z.align,ee=[];if(!z.display)switch(z.dataType){case"number":U=U||"right",Y=60,ee.push("text-num");break;case"boolean":U=U||"center",Y=60;break;case"date":Y=100;break;case"datetime":Y=180;break;case"timespan":U=U||"center",Y=80;break;case"time":Y=80,ee.push(`text-${z.dataType}`);break}if(F={key:z.name||`column_${A}`,title:z.title==null?a(te(z.name)):z?a(z.title):void 0,titleAlign:"center",align:U,width:z.width||Y,sorter:z.sortable==!0,minWidth:z.minWidth,resizable:!0,fixed:z.fixed,render:z.render||T(z)},typeof z.className=="string"?ee.push(z.className):Array.isArray(z.className)&&ee.push(...z.className),ee.length&&(F.className=ee.join(" ")),!F.width&&F.minWidth&&(F.width=F.minWidth),z.referencePage&&typeof F.width=="number"&&(F.width+=30),z.role&&z.role.includes("qr")&&typeof F.width=="number"&&(F.width+=30),z.role&&z.role.includes("percent")&&typeof F.width=="number"&&(F.width+=30,F.align||(F.align="right")),(z.textOverflow=="ellipsis"||z.textOverflow=="clip")&&(F.ellipsis={tooltip:!0},F.resizable=!0,Y||(Y=400)),z.children&&z.children.length){const oe=[];S(oe,z.children),F.children=oe,oe.some(ne=>ne.width)&&(F.width=void 0)}}F&&(y.push(F),typeof z=="object"&&typeof z.width=="number"?L+=z.width:L+=Y||150)}return L}function P(){if(n.columns){const y=[];let I=0;return n.checkable&&(y.push({type:"selection",fixed:"left"}),I+=30),I+=S(y,n.columns),n.withEdit&&(y.push({key:"btn-edit",width:30,fixed:"right",render(A,L){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:z=>{r("editRow",A,L),z.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Fo)})})}}),I+=30),n.withDelete&&(y.push({key:"btn-delete",width:30,fixed:"right",render(A,L){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:z=>{r("deleteRow",A,L),z.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(jo)})})}}),I+=30),n.withDetails&&(y.push({key:"btn-details",width:30,fixed:"right",render(A,L){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:z=>{r("showDetails",A,L),z.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(Qa)})})}}),I+=30),n.dragSorting&&(y.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})}}),I+=30),m.value=I,y}else return[]}function T(y){return(I,A)=>{var ee,oe,ne;let L=null;const z=y.display||y.name;if(y.template&&typeof y.template=="function")L=y.template.call(null,I,A);else if(y.dataType=="bool"||y.dataType=="boolean"){const W=Re(I[z]);if(y.values&&y.values.length>1)return y.i18n?a(W?y.values[0]:y.values[1]):W?y.values[0]:y.values[1];W!=null?L=e.h(u.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(Js):e.h(hi)}):L=e.h("span")}else if(y.dataType=="date")L=zo(Vo(I[z]));else if(y.dataType=="time")L=_o(To(I[z]));else if(y.dataType=="timespan")L=Lo(I[z]);else{let W=I[z];y.formatter?W=y.formatter(W,I):y.template&&(W=Ce.render(y.template,I)),typeof W=="string"&&(y.prefix&&(W=y.prefix+W),y.suffix&&(W=W+y.suffix),y.i18n&&(W=a(W))),L=W}let F=y.role;if(F&&!Array.isArray(F)&&(F=[F]),F!=null&&F.length)if(F.includes("tag")){let W;Array.isArray(I[z])?W=I[z]:W=(ne=(oe=(ee=I[z])==null?void 0:ee.toString())==null?void 0:oe.split(","))==null?void 0:ne.filter(K=>K.length),W&&W.length&&(L=e.h(At,{tags:W,tagSource:y.tagSource},{}))}else L&&(L=e.h("span",{class:F.map(W=>{switch(W){case"status":return`status-tag status-${I[z]}`;default:return`halo-form-${W}`}}).join(" ")},[L]));const Y=typeof y.href=="function"?y.href(I):y.href;if(y.behavior=="link")Y?L=e.h("a",{href:Ce.render(Y,I),target:"_blank"},[L]):L=e.h("a",{href:"#",onClick:W=>{var K;r("columnButtonClick",y.name,I,A),(K=y==null?void 0:y.click)==null||K.call(null,I,A),W.stopPropagation()}},[L]);else if(y.behavior=="router-link"&&Y){const W=L;L=e.h(ce.RouterLink,{to:Ce.render(Y,I)},{default:()=>W})}else if(y.behavior=="button"){const W=L;L=e.h(u.NButton,{size:"tiny",tag:"a",onClick:K=>{var fe;r("columnButtonClick",y.name,I,A),(fe=y==null?void 0:y.click)==null||fe.call(null,I,A),K.stopPropagation()}},{default:()=>W})}const U=[];if(y.role&&(y.role.includes("qr")&&U.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>x(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(yi)})})),y.role.includes("percent"))){const W=Ro(I[z]);U.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return y.referencePage&&U.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>k(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(un)})})),U.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[L]),e.h("div",{},...U)]):L}}function k(y,I){if(Array.isArray(n.data)&&I!=null&&I>=0&&I<n.data.length&&y.referencePage){const A=n.data[I],L=Ce.render(y.referencePage,A);L.startsWith("/")&&s.push({path:L})}}function x(y,I){if(Array.isArray(n.data)&&I!=null&&I>=0&&I<n.data.length){const A=n.data[I][y.name];if(typeof A=="string"){const L=a(y.title??te(y.name));c.showQrModal(A,L)}}}function V(y,I){return{onClick:A=>{if(A.target instanceof HTMLElement&&A.target.classList.contains("n-checkbox-box__border")==!1){const L=N(y);L!==void 0&&!d.value.includes(L)&&(d.value=[L],b())}},ondblclick:A=>{A.target instanceof HTMLTableCellElement&&r("editRow",y,I)}}}function E(y,I){I!=!1||!n.multiSelect?(d.value=[y],b()):d.value.includes(y)||(d.value.push(y),b())}function O(y,I){if(I!=!1||!n.multiSelect)d.value=y,b();else{const A=d.value.slice();for(const L of y)A.includes(L)||A.push(L);d.value.length<A.length&&(d.value=A,b())}}function j(y){n.multiSelect?d.value=y:d.value=y.slice(0,1),b()}function D(){return d.value}function H(y,I){Array.isArray(n.data)&&y>-1&&ln(n.data,y,I)}function B(){var A;const y=(A=g.value)==null?void 0:A.$el,I=y==null?void 0:y.querySelector("tbody.n-data-table-tbody");if(I&&Array.isArray(n.data)){const L=e.ref(n.data);Wt.useDraggable(I,L,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(z){var U;const F=z.oldIndex,Y=z.newIndex;if(F!=null&&Y!=null&&n.data&&F<((U=n.data)==null?void 0:U.length)){const ee=n.data[F];console.log(F,Y,ee==null?void 0:ee.id),r("rowSorting",{oldIndex:F,newIndex:Y,source:ee,updateGrid:()=>H(F,Y)})}}})}}return e.watch(()=>n.data,y=>{const A=y.map(L=>L[n.keyField]);d.value=d.value.filter(L=>A.includes(L)),b()}),e.watch(()=>n.columns,()=>i.value=P()),e.watch(()=>n.height,()=>f.value=h()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{B()},500)}),l({selectRow:E,selectRows:O,getSelectedRowKeys:D}),(y,I)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:g,columns:i.value,data:y.data,size:"small","row-key":N,"row-props":V,loading:y.loading,"single-line":!1,"max-height":y.maxHeight,"scroll-x":m.value,striped:"",remote:"","flex-height":y.flexHeight,style:e.normalizeStyle(f.value),"checked-row-keys":d.value,"onUpdate:checkedRowKeys":[I[0]||(I[0]=A=>d.value=A),j],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":I[1]||(I[1]=A=>y.$emit("update:sorter",A))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),Di={class:"flex-column gap05"},$i={class:"flex-row gap05",style:{"justify-content":"space-between"}},Ze=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),s=u.useMessage(),c=e.inject("axios"),m=e.ref(null),i=e.ref(1),d=e.ref(0),g=e.ref(!1),f=e.ref(Array()),h=e.ref(Array());let b=!0;function N(V){if(V){const E=V.rows;E.forEach((O,j)=>{O.__key__=j}),f.value=E,d.value=V.pageCount||1,i.value=V.pageIndex+1}}function S(){f.value=[],d.value=0,i.value=1}function P(V){T(V)}async function T(V){var j,D,H;const E=((j=m.value)==null?void 0:j.pickValues())||{},O=(D=n.config)==null?void 0:D.searchAction;if(E&&O){const B={pageSize:((H=n.config)==null?void 0:H.pageSize)||10,pageIndex:(V||i.value)-1};Object.assign(B,E),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(B,n.additionQuery.call(null)):Object.assign(B,n.additionQuery));try{g.value=!0;const y=await c.post(O,B);y.isSuccess&&y.value!=null?(b=!1,N(y.value)):s.error(a(y.errorMessage||"Error"))}catch(y){s.error(y==null?void 0:y.toString())}finally{g.value=!1}}}function k(){const V=h.value;if(V!=null&&V.length){const E=f.value.filter(O=>V.includes(O.__key__));r("searchBack",E,n.config),n.autoClose==!0&&close()}}function x(){n.searchOnMounted&&b&&T(1)}return e.watch(()=>n.config,V=>{V&&(b=!0),S()}),e.onMounted(()=>x()),l({searchPage:T,returnAndClose:k}),(V,E)=>(e.openBlock(),e.createElementBlock("div",Di,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:m,cols:2,"search-items":V.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",$i,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:E[0]||(E[0]=()=>T(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:E[1]||(E[1]=()=>{var O;return(O=m.value)==null?void 0:O.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(We,{class:"flex-grow-1",style:{height:"200px"},columns:V.config.gridColumns,loading:g.value,data:f.value,multiSelect:V.multiSelect,selectedIds:h.value,"onUpdate:selectedIds":[E[2]||(E[2]=O=>h.value=O),E[3]||(E[3]=(O,j)=>V.$emit("resultSelected",O,j))],onDblclickRow:E[4]||(E[4]=O=>V.$emit("searchBack",[O]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[E[5]||(E[5]=O=>i.value=O),P],"page-count":d.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),Ri={key:0,class:"flex-column flex-grow-1"},Oi={class:"flex-row",style:{"align-items":"center"}},ji={style:{"margin-left":"0.5em"}},Fi={class:"flex-row",style:{"justify-content":"space-between"}},Et=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(void 0);let s=!0;const c=e.ref([]);function m(f,h){c.value=h??[]}function i(f){f&&f.length&&n("searchBack",f,o.config)}function d(){c.value&&c.value.length&&(n("searchBack",c.value,o.config),o.autoClose==!0&&g())}function g(){n("update:show",!1)}return e.watch(()=>o.config,f=>{f&&(s=!0)}),e.watch(a,()=>{var f;o.searchOnMounted&&s&&(s=!1,(f=a.value)==null||f.searchPage(1))}),e.watch(()=>o.show,f=>{var h;f&&o.searchOnMounted&&s&&(s=!1,(h=a.value)==null||h.searchPage(1))}),(f,h)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:f.show,style:e.normalizeStyle({width:f.width??"900px",height:f.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:h[0]||(h[0]=()=>g())},{header:e.withCtx(()=>[e.createElementVNode("div",Oi,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",ji,e.toDisplayString(e.unref(r)(f.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",Fi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[f.config?(e.openBlock(),e.createElementBlock("div",Ri,[e.createVNode(Ze,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:f.config,"multi-select":f.multiSelect,"auto-close":f.autoClose,"addition-query":f.additionQuery,onResultSelected:m,onSearchBack:i},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),Pi={style:{"margin-bottom":"12px","min-height":"100px"}},Ye=re(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),s=u.useLoadingBar(),c=e.inject("axios"),m=ie(),i=e.reactive({}),d=e.ref(!1),g=e.ref(new Array),f=e.ref(!1),h=e.ref(void 0),b=e.ref(N());function N(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function S(){var x;if(f.value)return a.warning("Is uploading..."),!1;let k=typeof o.action=="function"?o.action.call(void 0):o.action;if(k&&o.templateCode&&(k=v(k,{templateCode:o.templateCode})),(x=g.value)!=null&&x.length&&k){if(!o.multiple&&g.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:g})==!1)return!1;try{f.value=!0;const V=g.value.filter(E=>E.status=="pending"||E.status=="error").map(E=>P(E,k));await Promise.all(V),g.value.every(E=>E.status=="finished")&&(g.value.length=0,a.success(r("Upload Success.")),d.value=!1)}catch(V){h.value=(V==null?void 0:V.toString())||r("Error")}finally{f.value=!1}}}async function P(k,x){const V=new FormData;V.append("file",k.file);const E={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{k.percentage=Math.round(j.loaded*100/j.total)}};k.percentage=0,k.status="uploading";let O=x;o.additionParams&&(O=v(x,o.additionParams)),i&&(O=v(O,i));try{const j=await c.post(O,V,E);j.isSuccess?(k.status="finished",n("uploaded",j.value),n("update:show",!1)):(k.status="error",k.errorMessage=j.errorMessage,h.value=r(j.errorMessage||"Error"))}catch(j){k.status="error",k.errorMessage=j==null?void 0:j.toString(),h.value=(j==null?void 0:j.toString())||r("Error")}}async function T(){const k=b.value;if(k)try{s.start(),await me(k)}catch(x){a.error(await m.getHttpErrorMessage(x,"Error"))}finally{s.finish()}}return e.watch(()=>o.show,()=>{h.value=void 0,g.value=[]}),(k,x)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:k.show,"onUpdate:show":x[3]||(x[3]=V=>k.$emit("update:show",V)),preset:"card",title:e.unref(r)(k.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:S,disabled:k.disabled||!k.action||f.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Vi))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:T},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:x[2]||(x[2]=()=>k.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:f.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUpload),{multiple:k.multiple,"default-upload":!1,"file-list":g.value,"onUpdate:fileList":x[0]||(x[0]=V=>g.value=V),accept:k.accept,disabled:!k.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(Ua))]),_:1})]),e.createVNode(e.unref(u.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(k.$slots,"options",{options:i},void 0,!0)]),_:3})]),_:3},8,["show"]),h.value?(e.openBlock(),e.createBlock(e.unref(u.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:x[1]||(x[1]=()=>h.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-18129d6e"]]),_t=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},clearable:{type:Boolean},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit","update:show","update:value"],setup(t,{emit:l}){var m;const o=t,n=l,{t:r}=Z(),a=e.ref((m=o.value)==null?void 0:m.toString()),s=()=>{n("close"),n("update:show",!1)},c=()=>{n("commit",a.value),n("update:value",a.value)};return e.watch(()=>o.value,i=>a.value=i==null?void 0:i.toString()),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"400px"},onClose:s},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:i.submitting,onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:i.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:a.value,"onUpdate:value":d[0]||(d[0]=g=>a.value=g),placeholder:i.placeholder,maxlength:i.maxLength,type:i.type,rows:i.lines,clearable:i.clearable},null,8,["value","placeholder","maxlength","type","rows","clearable"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),Hi={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Gi={key:1},Ki={class:"flex-row gap05"},Wi={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},Zi={class:"flex-row gap05",style:{"justify-content":"space-between"}},wn=200,Yi=e.defineComponent({__name:"GridConfigBox",props:{gridId:{},pageSize:{},gridColumns:{}},emits:["close","reset","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),s=Mt(["2E2466DDD34847C8B33460E4277A6528"]),c=ce.useRouter(),m=e.ref(o.pageSize),i=e.ref(!1),d=e.ref(!1),g=e.ref(void 0),f=e.ref(void 0),h=e.ref(!1),b=e.ref(!1),N=B=>B?B.map((y,I)=>({columnId:y.name,title:y.title?r(y.title):r(te(y.name)),visible:!0,sortIndex:I})).sort((y,I)=>y.sortIndex-I.sortIndex):[],S=e.ref(N(o.gridColumns)),P=()=>{const B=o.gridId;if(!B)return;const I=i.value&&d.value?`/api/core/UserDataGrids/ResetGlobal?dataGridId=${B}`:`/api/core/UserDataGrids/Reset?dataGridId=${B}`;a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:I,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},T=()=>{if(!o.gridId)return;const B={dataGridId:o.gridId,pageSize:m.value,columns:S.value.filter(A=>A.columnId).map(A=>({columnId:A.columnId,visible:A.visible,customTitle:A.customTitle,sortIndex:A.sortIndex}))};B.pageSize&&(B.pageSize=Math.max(1,Math.min(wn,B.pageSize)));const y=i.value&&d.value,I=y?`/api/core/UserDataGrids/SaveGlobal?isDefault=${y}`:`/api/core/UserDataGrids/Save?isDefault=${y}`;a.post({url:I,data:B,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",m.value),n("update:config",B)}})},k=()=>{if(!o.gridId||!S.value.length)return;const B=i.value&&d.value;a.get({url:`/api/core/UserDataGrids/${encodeURIComponent(o.gridId)}?isDefault=${B}`,callback:y=>{if(y){m.value=y.pageSize;for(const I of y.columns){const A=S.value.find(L=>L.columnId==I.columnId);A&&(A.visible=I.visible,A.sortIndex=I.sortIndex,A.customTitle=I.customTitle),S.value.sort((L,z)=>L.sortIndex-z.sortIndex)}}else S.value=N(o.gridColumns),m.value=o.pageSize}})},x=()=>{var I;const B=(I=g.value)==null?void 0:I.$el,y=B==null?void 0:B.querySelector("tbody.n-data-table-tbody");y&&S&&Wt.useDraggable(y,S,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const A=S.value;for(let L=0;L<A.length;L++)A[L].sortIndex=L;console.log(S.value)}})},V=B=>{var y;h.value=!1,f.value&&(f.value.customTitle=B,i.value&&a.post({url:"/api/core/UserDataGrids/UpdateCustomTitleGlobal",data:{dataGridId:o.gridId,columnId:(y=f.value)==null?void 0:y.columnId,customTitle:B}}))},E=()=>{o.gridId&&a.downloadFile({url:`/api/core/UserDataGrids/export?dataGridId=${encodeURIComponent(o.gridId)}`})},O=B=>e.h("div",{class:"flex-row gap05"},[B.customTitle?e.h("span",null,`${B.customTitle} (${B.title})`):e.h("span",null,`${B.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{f.value=B,h.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(Ii)})})]),j=B=>e.h(u.NButton,{text:!0,onClick:y=>{B.visible=!B.visible,y.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>B.visible?e.h(sn):e.h(an)})}),D=()=>{var y;const B={dataGridId:o.gridId,pageSize:o.pageSize,columns:(y=o.gridColumns)==null?void 0:y.map(I=>({columnId:I.name,sortIndex:I.sortIndex,visible:I.visible,title:I.title}))};B.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:B,success:I=>{I&&c.push({name:"DataGrid",params:{id:I}})}})},H=[{title:r("Name"),key:"title",render:O},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:j},{width:30,align:"center",fixed:"right",render:()=>e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>S.value=N(o.gridColumns)),e.watch(i,()=>k()),e.watch(S,()=>x()),e.onMounted(()=>{setTimeout(()=>{x()},500),s.checkOnce(B=>{d.value=B["2E2466DDD34847C8B33460E4277A6528"]})}),(B,y)=>{var I;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"grid-config-global-mode":i.value},"flex-column gap05"])},[d.value?(e.openBlock(),e.createElementBlock("div",Hi,[e.createVNode(e.unref(u.NButton),{onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("System Default")),1)]),_:1})])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",Ki,[e.createVNode(e.unref(u.NButton),{onClick:y[0]||(y[0]=()=>b.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(It))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Import")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(St))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Export")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:g,columns:H,data:S.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",Wi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:m.value,"onUpdate:value":y[1]||(y[1]=A=>m.value=A),max:wn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(_t,{show:h.value,"onUpdate:show":y[2]||(y[2]=A=>h.value=A),value:((I=f.value)==null?void 0:I.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":V},null,8,["show","value","title"]),e.createVNode(Ye,{show:b.value,"onUpdate:show":y[3]||(y[3]=A=>b.value=A),action:"/api/UserDataGrids/Import",onUploaded:y[4]||(y[4]=()=>k())},null,8,["show"]),e.createElementVNode("div",Zi,[e.createVNode(e.unref(u.NButton),{onClick:T,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:P,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:y[5]||(y[5]=()=>B.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])],2)}}}),Qi=t=>{const l=u.useModal(),{t:o}=Z(),n=ie();return{showConfigModal:s=>{const c=t.gridId??s.gridId;if(!c)return;const m=l.create({title:o("Config Data Grid"),preset:"card",contentClass:"flex-column",style:"width: 500px;",draggable:!0,content:()=>e.h(Yi,{gridId:c,pageSize:s.pageSize,gridColumns:s.gridColumns,class:"flex-grow-1",onClose:()=>m.destroy(),onReset:()=>{var i;(i=t.onReset)==null||i.call(null),m.destroy()},"onUpdate:pageSize":i=>{var d;i>0&&((d=t.onPageSizeChanged)==null||d.call(null,i))},"onUpdate:config":i=>{var d;(d=t.onConfigChanged)==null||d.call(null,i),m.destroy()}})})},loadGridConfig:()=>{t.gridId&&n.get({url:`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(t.gridId)}`,callback:s=>{var c;(c=t.onConfigChanged)==null||c.call(null,s)}})}}},Xi={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},Ji={key:0,class:"flex-row",style:{"justify-content":"space-between"}},qi={style:{"margin-left":"8px"}},Ui={style:{display:"flex"}},vi={style:{"flex-grow":"1"}},Cn=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){var il;const n=t,r=o,{t:a}=Z(),s=e.inject("axios"),c=e.ref(Array()),m=u.useDialog(),i=u.useMessage(),d=u.useLoadingBar(),g=ce.useRouter(),f=e.ref(Uo(n.columns||[],a)),h=e.ref(Be(n.columns||[])),b=e.ref(vo(n.columns||[],a));let N=1;const S=e.ref(1),P=e.ref(0),T=e.ref(0),k=e.ref(n.pageSize),x=e.ref(!0),V=e.ref(!1),E=e.ref(!1),O=e.ref(""),j=e.ref(n.searchAction&&((il=n.columns)==null?void 0:il.some(p=>Ie(p)&&p.search))),D=e.ref(j.value&&!n.getListAction),H=e.ref(D.value&&!0),B=e.ref(!1),y=e.ref(null),I=e.ref(null),A=e.ref(new Array),L=e.ref(!1),z=e.ref(void 0),F=e.ref(void 0),Y=e.ref(void 0),U=e.ref(!1),ee=e.ref(n.readOnly),oe=e.ref(a("Property")),ne=e.ref(!1),W=e.ref(!1);let K;const fe=e.ref([]),Dt=e.ref(Rt("page")),Hn=e.ref(Wc()),$t=e.ref(void 0),he=e.ref([]),Me=e.ref(void 0),Xe=e.ref(!1);let ye;const Gn=e.ref(void 0),we=e.ref(void 0),Te=e.ref(void 0);let ze=[],Le=0;const Kc=e.ref({width:Zc(n.modalColumns)});function Wc(){var w;const p={};if(n.defaultSearchArgs)for(const C in n.defaultSearchArgs)p[C]=n.defaultSearchArgs[C];return(w=b.value)==null||w.forEach(C=>{C.defaultValue!=null&&(C.searchMethod=="range"?Array.isArray(C.defaultValue)&&(C.defaultValue.length>0&&C.defaultValue[0]!=null&&(p[`${C.name}From`]=C.defaultValue[0]),C.defaultValue.length>1&&C.defaultValue[1]!=null&&(p[`${C.name}To`]=C.defaultValue[1])):p[C.name]=C.defaultValue)}),p}function Rt(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function Zc(p){return p?p>4?"100%":p>1?450*p+"px":"600px":"600px"}function Je(p){if(n.keys){if(typeof n.keys=="string")return p[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return p[n.keys[0]];if(n.keys.length>1)return n.keys.map(w=>p[w]).join()}return""}function qe(p){if(p.__key__=Je(p),n.columns)for(const w of n.columns){let C;if(typeof w=="string")C=w;else if(Ie(w))C=w.name;else continue;C&&!(C in p)&&(p[C]=null)}}function Kn(p){if(p){r("beforeRenderPage",{data:p});const C=p.rows;C.forEach(_=>qe(_)),c.value=C,r("update:data",c.value),T.value=p.totalRecords||0,P.value=p.pageCount||1,S.value=p.pageIndex+1,x.value=!0}}function Wn(p){if(p){const w={data:p};r("beforeRenderPage",w),p=w.data,p.forEach(C=>qe(C)),c.value=p,r("update:data",c.value),P.value=1,S.value=1,x.value=!1}}async function ue(p){var w,C;if(!(V.value||n.disabled)&&n.getListAction){const _={pageSize:k.value,pageIndex:p},$=(w=O.value)==null?void 0:w.trim();if(n.quickSearch&&$&&(_.searchWords=$),n.additionKeys&&Object.assign(_,n.additionKeys),n.parentKey&&!ae(_))return;(we.value||n.defaultSortBy)&&(_.sortBy=we.value??n.defaultSortBy,_.sortDirection=Te.value??n.defaultSortDirection);try{V.value=!0;let G=n.getListAction;typeof G=="function"&&(G=G.call(void 0));const X=v(G,_),R=await s.get(X);R!=null&&R.isSuccess&&R.value?(Le++,R.value&&(Array.isArray(R.value)?Wn(R.value):Kn(R.value))):i.error(a((R==null?void 0:R.errorMessage)??((C=R==null?void 0:R.value)==null?void 0:C.toString())??"Error"))}catch(G){i.error((G==null?void 0:G.toString())??a("Error")),console.error(G)}finally{V.value=!1}}}function De(p){if(!n.disabled)if(H.value&&ye){const w=Object.assign({},ye);w.sortBy=we.value,w.sortDirection=Te.value,Ft(w)}else p!=null?ue(p):ue(S.value-1)}function Ot(){ue(0)}function Yc(){O.value="",ue(0)}function Qc(p){if(n.additionKeys)for(const w in n.additionKeys){const C=n.additionKeys[w];C!=null&&(p[w]=C)}}function Zn(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(p=>p==null));if(typeof n.verifyParentKey=="function"){const p=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof p=="boolean")return p}return!0}function ae(p){if(n.verifyParentKey&&Zn()==!1)return!1;if(n.parentKey){const w={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&n.parentValue.length>C&&(w[_]=n.parentValue[C])}else for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&(w[_]=n.parentValue)}else n.parentKey&&(w[n.parentKey]=n.parentValue);p&&Object.assign(p,w)}return!0}async function jt(){var w;if(n.disabled)return;const p=(w=y.value)==null?void 0:w.pickValues();if(p&&n.searchAction){const C={};Object.assign(C,p),Qc(C),C.pageSize=k.value,C.pageIndex=0,C.sortBy=we.value??n.defaultSortBy,C.sortDirection=Te.value??n.defaultSortDirection,C.groupBy=$t.value,Ft(C)}}async function Ft(p){if(!V.value)try{V.value=!0;let w=n.searchAction;if(typeof w=="function"&&(w=w.call(void 0,p)),!w)return;const C={};if(!ae(C))return;w=v(w,C);const _=await s.post(w,p);_.isSuccess&&_.value!=null?(Le++,ye=p,r("searchReturn",{data:_.value,query:p,action:w}),Array.isArray(_.value)?Wn(_.value):Kn(_.value)):i.error(a(_.errorMessage||"Error"))}catch(w){i.error(w==null?void 0:w.toString())}finally{V.value=!1}}function Yn(p,w){const C={};if(ae(C)){if(typeof n.keys=="string"?C[n.keys]=p[n.keys]:n.keys.forEach($=>C[$]=p[$]),Array.isArray(n.detailsKeys))n.detailsKeys.map($=>$.toString()).forEach($=>C[$]=p[$]);else if(typeof n.detailsKeys=="object"){const $=n.detailsKeys;for(const G in $){var _=$[G];_&&(C[G]=p[_])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,C):n.detailsKeys&&(C[n.detailsKeys]=p[n.detailsKeys]);if(n.detailsPageName)g.push({name:n.detailsPageName,params:C});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const $=n.detailsPage(p,w);(typeof $=="string"||typeof $=="object")&&g.push($)}else g.push({path:n.detailsPage,query:C})}}async function Pt(p,w){var C;if(!n.disabled)if(n.getEntityAction){const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach($=>_[$]=p[$]);try{let $=n.getEntityAction;typeof $=="function"&&($=$.call(void 0,p,w));const G=v($,_),X=await s.get(G);X.isSuccess&&X.value!=null?Ue(X.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((X==null?void 0:X.errorMessage)??((C=X==null?void 0:X.value)==null?void 0:C.toString())??"Error"))}catch($){i.error(($==null?void 0:$.toString())??a("Error")),console.error($)}}else Ue(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Ht(p,w){n.readOnly||n.disabled||n.deleteAction&&p&&p.__key__&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{Xc(p,w)}})}async function Xc(p,w){var C;if(n.deleteAction&&n.keys.length)try{const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach(q=>_[q]=p[q]);const $=p.__key__;let G=n.deleteAction;typeof G=="function"&&(G=G.call(void 0,p,w));const X=v(G,_);let R;if(n.deleteMethod=="POST"?R=await s.post(X):R=await s.delete(X),R.isSuccess){let q=c.value.indexOf(p);if(q>-1&&(c.value.splice(q,1),i.success(a("The data has been deleted."))),A.value&&(q=A.value.findIndex(Q=>Q==$),q>-1)){A.value.splice(q,1);const Q=(C=c.value)==null?void 0:C.filter(yd=>A.value.includes(yd["__key__]"]));r("update:selectedIds",A.value,Q),A.value.length?r("update:selectedId",A.value[0],Q!=null&&Q.length?Q[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(R.errorMessage||"Error"))}catch(_){console.error(_),i.error(_==null?void 0:_.toString())}}function Jc(p){n.readOnly||n.disabled||n.deleteBatchAction&&p&&p.length&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{qc(p)}})}async function qc(p){if(n.deleteBatchAction&&p.length)try{const w={ids:p.join()};if(n.additionKeys&&Object.assign(w,n.additionKeys),!ae(w))return;let C=n.deleteBatchAction;typeof C=="function"&&(C=C.call(void 0));const _=v(C,w);let $;if(n.deleteMethod=="POST"?$=await s.post(_):$=await s.delete(_),$.isSuccess){for(const G of p){const X=c.value.findIndex(R=>R.__key__==G);X>-1&&c.value.splice(X,1)}A.value=A.value.filter(G=>!p.includes(G)),i.success(a("The data has been deleted."))}else i.error(a($.errorMessage||"Error"))}catch(w){i.error(w),console.error(w==null?void 0:w.toString())}}function Qn(){if(A.value.length){const p=c.value.find(w=>w.__key__==A.value[0]);p&&Pt(p,c.value.indexOf(p))}}function Xn(){if(A.value.length>1&&n.deleteBatchAction)Jc(A.value);else if(A.value.length){const p=c.value.find(w=>w.__key__==A.value[0]);p&&Ht(p,c.value.indexOf(p))}}function Ue(p,w){const C={method:w,original:p,value:qo(p,f.value)};switch(r("beforeShow",C),Y.value=p,z.value=C.value,F.value=w,U.value=!0,ee.value=w!="create"&&w!="edit",w){case"create":oe.value=a("New");break;case"edit":oe.value=a("Edit");break;default:oe.value=a("Property");break}}function Jn(){Y.value=void 0,z.value=void 0,F.value=void 0,U.value=!1,oe.value=a("Property")}async function Gt(){var p;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let w=n.initEntityAction;typeof w=="function"&&(w=w.call(void 0));let C=w;const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;C=v(C,_);try{const $=await s.get(C);$!=null&&$.isSuccess&&$.value?Ue($.value||{},"create"):i.error(a(($==null?void 0:$.errorMessage)??((p=$==null?void 0:$.value)==null?void 0:p.toString())??"Error"))}catch($){i.error(a(($==null?void 0:$.toString())??"Error")),console.error($)}}else{const w=Xo(f.value);Ue(w,"create")}}async function Uc(p,w){var $;if(n.readOnly||n.disabled)return;const C=Me.value;if(!C||C.searchConfig!=w||!C.actionUrl)return;let _;if(C.dataBuilder)_=C.dataBuilder(p);else{let G;if(C.keyPicker?G=C.keyPicker(p):G=p.map(X=>X.id),!G||!G.length)return;_={},_[C.keyName||"ids"]=G}if(_){let G=C.actionUrl;n.additionKeys&&Object.assign(_,n.additionKeys);const X={};ae(X)&&(G=v(G,X),Object.assign(_,X));try{const R=await s.post(G,_);if(R.isSuccess){if(R.value){for(const Q of R.value)ve(Q);const q=R.value.map(Q=>Je(Q));($=I.value)==null||$.selectRows(q),Xe.value=!1}}else i.error(a(R.errorMessage||"Error"))}catch(R){i.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function qn(p){Me.value=p,Xe.value=!0}function vc(p){const w=f.value;if(!w||!w.length)return!1;w.forEach(C=>{C.validationStatus=void 0,C.errorMessage=void 0});for(const C of w)C.nullable===!1&&!C.readonly&&(p[C.name]==null||p[C.name]===null||!C.dataType&&(p[C.name]==null||p[C.name]==null)?(C.validationStatus="error",C.errorMessage=a("Required here.")):(C.validationStatus="success",C.errorMessage=void 0));return!w.some(C=>C.validationStatus=="error"||C.validationStatus=="warning")}function ed(){if(n.readOnly||n.disabled)return;const p=f.value;if(!p||!p.length)return;const w=F.value;if(w!="create"&&w!="edit")return;const C=z.value,_=Y.value;if(C&&_){const $=Object.assign({},_);for(let G of p){if(G.readonly==!0||Array.isArray(G.readonly)&&G.readonly.includes(w))continue;let X=Oe(C[G.name],G.dataType,G.role);$[G.name]=X}if(r("commitEdit",{data:$,current:C,original:_,method:w}),n.beforeSave&&n.beforeSave($,w)===!1)return;vc($)?Un({data:$,original:_,method:w}):i.error(a("Form validation failed."))}}async function Un(p){var w;if(!(n.readOnly||n.disabled||!n.saveAction))try{let C;const _={};if(n.additionKeys)for(const q in n.additionKeys)n.additionKeys[q]!=null&&(p.data[q]=n.additionKeys[q]);const $={};if(!ae($))return;if(Object.assign(p.data,$),n.enctype=="multipart/form-data"){C=new FormData;const q=Object.keys(p.data);for(const Q of q)p.data[Q]&&C.set(Q,p.data[Q]);_["Content-Type"]="multipart/form-data"}else C=p.data,_["Content-Type"]="application/json;charset=utf-8";let G=n.saveAction;typeof G=="function"&&(G=G.call(void 0));let X=v(G,$);E.value=!0;const R=await s.post(X,C,{headers:_});if(R.isSuccess){if(i.success(a("The data is saved.")),R.value){p.method=="create"?ve(R.value):p.method=="edit"&&vn(R.value),(w=I.value)==null||w.selectRow(Je(R.value)),p.method=="create"&&n.chainCreating?Gt():Jn();try{r("saved",{value:R.value,method:p.method})}catch(q){console.error("emit(saved) fail."+(q==null?void 0:q.toString()))}}}else i.error(a(R.errorMessage||"Error")),R.errors&&td(f.value,R.errors)}catch(C){i.error((C==null?void 0:C.toString())||a("Error")),console.error(C)}finally{E.value=!1}}function td(p,w){if(p&&p.length)for(const C of w){const _=p.find($=>$.name.toLowerCase()==C.key.toLowerCase());_&&(_.validationStatus="error",_.errorMessage=C.value)}}function ve(p){qe(p);const w=p.__key__,C=c.value.findIndex(_=>_.__key__==w);C>-1?c.value.splice(C,1,p):c.value.push(p)}function vn(p){qe(p);const w=p.__key__,C=c.value.find(_=>_.__key__==w);if(C)for(const _ in p)C[_]=p[_]}function od(p){if(H.value&&ye){const w=Object.assign({},ye);w.pageIndex=Math.max(0,p-1),Ft(w)}else p>0?ue(p-1):ue(0)}function nd(p){p&&(k.value=p)}function ld(p,w){A.value=p,r("update:selectedIds",p,w),r("update:selectedId",p.length?p[0]:void 0,w.length?w[0]:void 0)}async function rd(p,w){n.exportAction?await ad(p,w)&&(ne.value=!1):n.dataExchangeCode&&(tl(p,w),ne.value=!1)}function el(p,w,C){const _={outputType:p,dataRange:w,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(_.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const $={pageSize:k.value,pageIndex:S.value,sortBy:we.value,sortDirection:Te.value};n.additionKeys&&Object.assign($,n.additionKeys),ae($),_.searchArgs=JSON.stringify($)}switch(C&&Object.assign(_,C),w){case"selection":if(!A.value||!A.value.length)throw a("Please select the rows to be exported.");_.selectedKeys=A.value;break;case"page":_.pageSize=k.value,_.pageIndex=Math.max(0,S.value-1);break}return _}async function ad(p,w){let C=n.exportAction;if(typeof C=="function"&&(C=C.call(void 0)),C){try{if(!Zn())return console.log("Invalid parent key."),!1;const _=el(p,w,n.exportOptions);ae(_),d.start(),C=v(C,_),await me(C)}catch(_){console.log(_),i.error((_==null?void 0:_.toString())||a("Error"))}finally{d.finish()}return!0}else return!1}function sd(){n.importAction&&(L.value=!0)}async function id(){const p=n.importTemplateCode;if(p){const w=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{d.start(),await me(w)}finally{d.finish()}}}async function tl(p,w,C=!1){var q;const _=n.dataExchangeCode;if(!_)return;if(w.toLowerCase()=="empty"){const Q=`/api/core/dataExchange/importTemplate?templateCode=${_}&engineName=${p}`;try{d.start(),await me(Q)}finally{d.finish()}return}const $={name:_,engineName:p,dataRange:w};n.importTemplateCode&&($.templateCode=n.importTemplateCode);const G={pageSize:k.value,pageIndex:S.value-1};switch(w.toLowerCase()){case"empty":G.pageSize=0,G.pageIndex=0;break;case"all":G.pageSize=2e3,G.pageIndex=0;break}if(!ae(G)){console.log("Invalid parent key.");return}let X=n.exportAction||n.getListAction;typeof X=="function"&&(X=X.call(void 0));let R=X;if(C)try{const Q=await s.post("/api/core/tempData/add",{value:JSON.stringify($)});if(Q.isSuccess){if(G.exportOptionId=Q.value,R){R=v(R,G);try{d.start(),await me(R)}finally{d.finish()}}}else i.error((Q==null?void 0:Q.errorMessage)??((q=Q==null?void 0:Q.value)==null?void 0:q.toString())??a("Error"))}catch(Q){i.error((Q==null?void 0:Q.toString())??a("Error")),console.error(Q)}else if(G.exportOption=btoa(JSON.stringify($)),R){R=v(R,G);try{d.start(),await me(R)}finally{d.finish()}}}function ol(p){if(p)switch(p){case"menu_export_action":A.value&&A.value.length?Dt.value=Rt("selection"):Dt.value=Rt("page"),ne.value=!0;break;case"menu_export_template_action":id();break;case"menu_import_action":sd();break;case"menu_export":ne.value=!0;break;case"menu_export_template":tl("Excel","Empty");break;case"menu_import":break;default:{const w=ze.find(C=>C.key==p);w&&nl(w)}break}}function nl(p){var _;const w=A.value,C={selectedId:w!=null&&w.length?w[0]:void 0,selectedIds:w?[...w]:void 0,data:c.value};typeof p!="string"&&((_=p.click)==null||_.call(null,C)),r("extendedMenuSelect",C)}function cd(p){const w=[];n.exportAction&&w.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(St)})}),n.importTemplateCode&&w.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&w.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}),n.dataExchangeCode&&(w.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(St)})}),w.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(w.push({type:"divider",key:"------------1"}),w.push({label:a("Import"),key:"menu_import",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}))),p&&p.length&&(w.push({type:"divider",key:"----------e--1"}),p.forEach(C=>{const _={label:C.label,key:C.key};C.icon?_.icon=mt(C.icon):C.renderIcon&&(_.icon=C.renderIcon),w.push(_)})),fe.value=w}Qi({gridId:n.name,onConfigChanged:p=>Kt(p),onPageSizeChanged:p=>k.value=p,onReset:()=>fd}).loadGridConfig();const Kt=(p,w)=>{if(p){K=p,k.value=p.pageSize,w||(w=[...h.value]),w.forEach(C=>{C.sortIndex=99999});for(const C of p.columns){const _=w.find($=>$.name==C.columnId);_&&(_.visible=C.visible,_.sortIndex=C.sortIndex)}w.sort((C,_)=>(C.sortIndex||0)-(_.sortIndex||0)),h.value=w}};function dd(p){p?Kt(p):(h.value=Be(n.columns||[]),k.value=n.pageSize||20),W.value=!1}const fd=()=>{h.value=Be(n.columns||[]),k.value=n.pageSize||20},ud=()=>{n.name&&(W.value=!0)};function pd(p,w){var C;for(const _ of p)ve(_);if(w){const _=p.map($=>Je($));(C=I.value)==null||C.selectRows(_)}}function ll(p){if(!p)return;const w=ze==null?void 0:ze.find(C=>C.key==p);w&&nl(w)}function md(p){var w,C;Array.isArray(p)?(we.value=(w=p[0].columnKey)==null?void 0:w.toString(),Te.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(we.value=(C=p.columnKey)==null?void 0:C.toString(),Te.value=p.order=="ascend"?"Asc":"Desc"),De()}function rl(){const p=new Array;if(n.extendedMenus)for(const C of n.extendedMenus)typeof C=="string"?p.push({label:a(C),key:N++}):(C.key||(C.key=N++),p.push(C));ze=p,hd(p);const w=p.filter(C=>C.group=="import"||C.group=="export");cd(w)}function hd(p){if(p){const w=p.filter(C=>!C.group).map(C=>C.label=="-"?{type:"divider"}:C.icon?{label:C.label,key:C.key,icon:mt(C.icon)}:C.renderIcon?{label:C.label,key:C.key,icon:C.renderIcon()}:{label:C.label,key:C.key});he.value=w}else he.value=[]}function al(){const p={};return n.parentKey&&ae(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function sl(){const p=Object.assign({},al(),n.importOptions);Gn.value=Object.keys(p).length?p:void 0}function gd(){D?B.value=!B.value:B.value=!1}return e.onMounted(()=>{sl(),n.autoLoad!=!1&&(D.value?n.autoLoad&&jt():ue(0)),rl()}),e.watch(e.computed(al),(p,w)=>{JSON.stringify(p)!=JSON.stringify(w)&&(sl(),n.autoLoad!=!1&&Le>0&&De())}),e.watch(()=>n.extendedMenus,()=>rl()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||Le>0)&&ue(0)}),e.watch(()=>n.getListAction,(p,w)=>{w&&(n.autoLoad!=!1||Le>0)&&ue(0)}),e.watch(k,(p,w)=>{if(p&&w){var C=void 0,_=S.value,$=T.value;if(_>0&&$){const G=Math.ceil($/p);G<_&&(C=Math.max(0,G-1))}De(C)}}),e.watch(()=>n.columns,()=>{const p=Be(n.columns||[]);K?Kt(K,p):h.value=p}),l({reloadPage:De,addRow:Gt,addBatch:qn,editSelectedRow:Qn,deleteSelectedRows:Xn,saveData:Un,doQuickSearch:Ot,clearQuickSearch:Yc,advancedSerach:jt,checkedRowKeys:A,editRow:Pt,deleteRow:Ht,showDetails:Yn,insertRow:ve,updateRow:vn,appendRows:pd,buildExportArgs:el}),(p,w)=>{var C,_,$,G,X;return e.openBlock(),e.createElementBlock("div",Xi,[e.renderSlot(p.$slots,"header"),D.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ji,[e.createVNode(e.unref(u.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix-tools"),p.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>qn(R),disabled:p.readOnly||p.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ka))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),p.saveAction&&!p.readOnly&&p.allowNew?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,onClick:Gt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(pi))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),p.saveAction&&!p.readOnly&&p.allowEdit?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:2,onClick:Qn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(p.deleteAction||p.deleteBatchAction)&&!p.readOnly?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:3,onClick:Xn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(jo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:w[0]||(w[0]=()=>De()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),fe.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:fe.value,disabled:p.disabled,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(Va))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:he.value,disabled:p.disabled,onSelect:ll},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(it))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(p.$slots,"tools"),p.quickSearch?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(u.NInput),{class:"flex-grow-1",style:{width:"260px"},value:O.value,"onUpdate:value":w[1]||(w[1]=R=>O.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:Ot},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!H.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:w[2]||(w[2]=()=>Ot()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["title"]),[[e.vShow,!H.value]]),j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:w[3]||(w[3]=()=>H.value=!H.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ba),{key:0})),H.value?(e.openBlock(),e.createBlock(e.unref(wa),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(p.$slots,"neck"),j.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!D.value,onClose:w[8]||(w[8]=()=>H.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:D.value?"pointer":"unset"}]),onClick:gd},[e.createVNode(e.unref(u.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",qi," … ",512),[[e.vShow,B.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:jt},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:w[6]||(w[6]=()=>{var R;return(R=y.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),fe.value.length==1&&D.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:w[7]||(w[7]=()=>ne.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),fe.value.length>1&&D.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:fe.value,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-tools"),D.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:he.value,onSelect:ll},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(it))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ke,{"search-items":b.value,ref_key:"searchFormRef",ref:y,"search-args":Hn.value,"onUpdate:searchArgs":w[4]||(w[4]=R=>Hn.value=R),"group-options":p.searchGroupOptions,"group-by":$t.value,"onUpdate:groupBy":w[5]||(w[5]=R=>$t.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!B.value]])]),_:3},8,["closable"])),[[e.vShow,H.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:c.value,columns:h.value,loading:V.value,style:"background-color: chartreuse;"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:I,data:c.value,columns:h.value,loading:V.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":p.gridDragSorting,"flex-height":p.gridFlexHeight,"with-edit":!!p.saveAction&&!p.readOnly&&p.allowEdit,"with-delete":(!!p.deleteAction||!!p.deleteBatchAction)&&!p.readOnly,"with-details":!!p.detailsPage||!!p.detailsPageName,"multi-select":p.multiSelect,"max-height":p.gridMaxHeight,height:p.gridHeight,checkable:p.gridCheckable,onEditRow:Pt,onDeleteRow:Ht,onShowDetails:Yn,"onUpdate:selectedIds":ld,onColumnButtonClick:w[9]||(w[9]=(R,q,Q)=>p.$emit("columnButtonClick",R,q,Q)),"onUpdate:sorter":w[10]||(w[10]=R=>md(R)),onRowSorting:w[11]||(w[11]=R=>p.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[x.value?(e.openBlock(),e.createBlock(e.unref(u.NPagination),{key:0,page:S.value,"onUpdate:page":[w[12]||(w[12]=R=>S.value=R),od],"item-count":T.value,"page-size":k.value,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":nd},{suffix:e.withCtx(({startIndex:R,endIndex:q,itemCount:Q})=>[Q?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(q+1)+"] / "+e.toDisplayString(Q),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,text:"",onClick:w[13]||(w[13]=()=>ud())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xi))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:f.value,currentData:z.value,list:c.value,selectedKeys:A.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:U.value,"onUpdate:show":w[15]||(w[15]=R=>U.value=R),preset:"card",draggable:"",style:e.normalizeStyle([Kc.value,p.modalStyle]),title:oe.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[F.value=="create"||F.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:ed,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:Jn,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:E.value},{default:e.withCtx(()=>[e.createElementVNode("div",Ui,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:z.value,original:Y.value,method:F.value})]),e.createElementVNode("div",vi,[e.renderSlot(p.$slots,"entity-form",{formItems:f.value,data:z.value,original:Y.value,method:F.value},()=>[e.createVNode(kt,{"form-items":f.value,columns:p.modalColumns,data:z.value,original:Y.value,method:F.value,"group-layout":p.formGroupLayout,"read-only":ee.value,onItemChange:w[14]||(w[14]=R=>p.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:z.value,original:Y.value,method:F.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(C=p.batchAdds)!=null&&C.length?(e.openBlock(),e.createBlock(Et,{key:2,show:Xe.value,"onUpdate:show":w[16]||(w[16]=R=>Xe.value=R),draggable:"",config:(_=Me.value)==null?void 0:_.searchConfig,title:($=Me.value)==null?void 0:$.searchTitle,"multi-select":((G=Me.value)==null?void 0:G.singleOne)!=!0,"addition-query":(X=Me.value)==null?void 0:X.additionQuery,onSearchBack:Uc},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(Ye,{key:3,show:L.value,"onUpdate:show":w[17]||(w[17]=R=>L.value=R),draggable:"",action:p.importAction,"addition-params":Gn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(p.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Vt,{key:4,show:ne.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:w[18]||(w[18]=()=>ne.value=!1),onExport:rd,range:Dt.value,"template-code":p.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(p.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(Tt,{key:5,"grid-id":p.name,draggable:"","grid-columns":h.value,pageSize:k.value,"onUpdate:pageSize":w[19]||(w[19]=R=>k.value=R),show:W.value,onClose:w[20]||(w[20]=()=>W.value=!1),"onUpdate:config":dd},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),ec={class:"flex-row gap05",style:{"align-items":"center"}},bn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",ec,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(u.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),tc={key:0,style:{"text-align":"right"}},kn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),s=e.ref(!1),c=e.ref([]);let m;const i=f=>{(!m||m!=f)&&(m=f,d(f))},d=async f=>{let h=o.sourceUrl;if(h){const b=o.labelFormatter,N=o.keyField,S=o.labelField,P=o.subLabelField,T=o.insertBlank,k=o.additionalQuery;s.value=!0,c.value=[];try{f&&(h=v(h,{searchWords:f})),k&&(h=v(h,k,!0));const x=await a.get(h);if(x.isSuccess&&x.value!=null){let V=x.value;if(!Array.isArray(V)&&"rows"in V&&Array.isArray(V.rows)&&(V=V.rows),Array.isArray(V)){const E=V.filter(O=>O&&!0).map(O=>{if(typeof O=="string")return{value:O,label:b?b(O):r(O)};{let j=O[S||"label"];if(b&&(j=b(j)),o.prefix&&(j=o.prefix+j),o.suffix&&(j=j+o.suffix),o.i18n&&(j=r(j)),P){let D=O[P];typeof D=="string"&&(b&&(D=b(D)),o.i18n&&(D=r(D)),D&&(j+=" "+D))}return{value:O[N||"value"],label:j,data:O}}});T&&E.splice(0,0,{value:"",label:""}),c.value=E,o.autoSelect&&!o.value&&E.length&&n("update:value",E[0].value,E[0],E[0].data)}}}finally{s.value=!1}}},g=(f,h)=>{var N;const b=(N=c.value.find(S=>S.value==f))==null?void 0:N.data;n("update:value",f,h,b)};return e.watch(()=>o.sourceUrl,()=>d()),e.watch(()=>o.additionalQuery,(f,h)=>{JSON.stringify(h)!=JSON.stringify(f)&&d()}),e.onMounted(()=>d()),(f,h)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:f.value,remote:"",loading:s.value,options:c.value,filterable:f.filterable,multiple:f.multiple,placeholder:"",disabled:f.readonly,clearable:f.clearable,onSearch:i,"onUpdate:value":g},{action:e.withCtx(()=>[f.filterable?(e.openBlock(),e.createElementBlock("div",tc,[e.createVNode(e.unref(u.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),oc=e.defineComponent({components:{SearchIcon:un,LeftIcon:Hs,RightIcon:Ks},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Z(),n=e.ref(void 0),r=e.ref(s(t.sourceList)),a=e.ref([]);function s(f){return f?f.map(h=>({isSelected:!1,value:h})):[]}function c(){n.value&&l.emit("search",n.value)}function m(){nn(a.value,f=>f.isSelected)>0&&l.emit("update:selectedItems",a.value.map(f=>f.value))}function i(){a.value.forEach(h=>h.isSelected=!1);let f=!1;r.value.forEach(h=>{h.isSelected&&!a.value.some(b=>b.value==h.value)&&(a.value.push({value:h.value,isSelected:!1}),f=!0)}),f&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function d(f){f.forEach(h=>h.isSelected=!0)}function g(f){f.forEach(h=>h.isSelected=!h.isSelected)}return e.watch(()=>t.sourceList,f=>r.value=s(f)),{t:o,searchWords:n,searchMaterials:c,source:r,target:a,moveRight:i,moveLeft:m,selectAll:d,inverseSelect:g}}}),nc={class:"flex-row gap1"},lc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},rc={class:"flex-row gap1",style:{"justify-content":"flex-end"}},ac={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},sc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},ic={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function cc(t,l,o,n,r,a){const s=e.resolveComponent("search-icon"),c=e.resolveComponent("n-icon"),m=e.resolveComponent("n-input"),i=e.resolveComponent("n-checkbox"),d=e.resolveComponent("n-scrollbar"),g=e.resolveComponent("n-spin"),f=e.resolveComponent("n-button"),h=e.resolveComponent("right-icon"),b=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("div",lc,[e.createVNode(m,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=N=>t.searchWords=N),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(s)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(g,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(d,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,N=>(e.openBlock(),e.createBlock(i,{checked:N.isSelected,"onUpdate:checked":S=>N.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:N.value,isSelected:N.isSelected},()=>[e.createTextVNode(e.toDisplayString(N.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",rc,[e.createVNode(f,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(f,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",ac,[e.createVNode(f,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(h)]),_:1})]),_:1},8,["onClick"]),e.createVNode(f,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(b)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",sc,[e.createVNode(d,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,N=>(e.openBlock(),e.createBlock(i,{checked:N.isSelected,"onUpdate:checked":S=>N.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:N.value,isSelected:N.isSelected},()=>[e.createTextVNode(e.toDisplayString(N.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",ic,[e.createVNode(f,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(f,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const Nn=re(oc,[["render",cc]]),xn=re(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),s=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),c=d=>{d.preventDefault(),l.detailFolded||(n.value=!0)},m=d=>{if(!n.value||!r.value||l.detailFolded)return;const g=r.value.getBoundingClientRect();let f;l.direction==="horizontal"?f=(d.clientX-g.left)/g.width:f=(d.clientY-g.top)/g.height;const h=l.minSize/(l.direction==="horizontal"?g.width:g.height),b=1-h;o.value=Math.max(h,Math.min(b,f))},i=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",i)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",i)}),(d,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[d.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",d.mainPanelClass]),style:e.normalizeStyle([[d.mainPanelStyle,a.value],{}])},[e.renderSlot(d.$slots,"main",{},void 0,!0)],6),d.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:c},null,34)),d.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",d.detailPanelClass]),style:e.normalizeStyle([[d.detailPanelStyle,s.value],{}])},[e.renderSlot(d.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-ca4664e2"]]),Sn=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:s[3]||(s[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s[1]||(s[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s[2]||(s[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputNumber),{value:r.value,"onUpdate:value":s[0]||(s[0]=c=>r.value=c)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),dc={class:"flex-column"},In=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:[Number,String],rootId:{type:[Number,String],default:"0"},rootName:{type:String,default:"Root"},data:Array,loadTreeAction:{type:String,required:!0},moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function,searchWords:String,iconRender:Function},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var H;const o=l,n=t,{t:r}=Z(),a=ie(),s=e.ref(b(n.data)),c=e.ref(new Array),m=e.ref(void 0),i=e.ref(((H=s.value)==null?void 0:H.map(B=>B.key))??[]);function d(B,y){for(const I of B){if(I.key==y)return[I];if(I.key!=null&&I.key!=null&&I.children&&!I.isLeaf){const A=d(I.children,y);if(A.length)return A.push(I),A}}return[]}function g(B,y){for(let I=0;I<B.length;I++){const A=B[I];if(A.key==y)return{nodes:B,index:I};if(A.children){const L=g(A.children,y);if(L)return L}}return null}function f(B){const y=d(s.value,B);return y?y.reverse():[]}function h(B){return B}function b(B,y=!0){let I=[];if(Array.isArray(B)){const A=(n==null?void 0:n.treeNodeMapper)??h;I=B.map(A)}return y?[{key:n.rootId,label:r(n.rootName),isLeaf:!Array.isArray(I)||I.length==0,children:I}]:I}function N(){a.get({url:n.loadTreeAction,callback:B=>{if(B){const y=b(B);s.value=y,i.value=y.map(I=>I.key)}}})}function S(B){const y=s.value;if(y){const I=y.map(A=>A.children?T(A.children):[]);i.value=I.flat()}}function P(B){const y=s.value;y&&(i.value=y.map(I=>I.key))}function T(B,y){const I=new Array;for(const A of B)if(A.key&&I.push(A.key),A.children){const L=T(A.children);L.length&&I.push(...L)}return I}function k(B){c.value=B;const y=B.length?B[0]:void 0;o("update:selectedId",y==n.rootId?void 0:y);const I=y?f(y):[];o("update:path",I)}function x(B){return e.h("span",null,B.option.label)}function V(B){return n.iconRender?e.h(u.NIcon,null,{default:()=>{var y;return(y=n.iconRender)==null?void 0:y.call(null,B)}}):B.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(cn)}):e.h(u.NIcon,null,{default:()=>e.h(Bt)})}function E(B){!n.moveAction&&!n.sortAction||(B.dropPosition=="before"||B.dropPosition=="after"?B.dragNode.key&&typeof B.node.key&&j(B.dragNode,B.node,B.dropPosition):B.dropPosition=="inside"&&typeof B.dragNode.key=="number"&&typeof B.node.key=="number"&&O(B.dragNode,B.node))}function O(B,y){const I=n.moveAction;if(!I)return;const A=B.key,L=[B.key],z=y.key;!A||!z||B==y||a.post({url:I,data:{menuItemIds:L,targetId:z},successMessage:"Successful operation.",success:()=>{const F=g(s.value,A);F&&(F.nodes.splice(F.index,1),y.children&&y.children.push(B))}})}async function j(B,y,I){const A=n.sortAction;if(!A)return;const L=B.key;let z=y.key;if(!L||!z||L==z)return;const F=g(s.value,L);if(F){if(I=="after"){const Y=F.nodes.indexOf(y);if(Y>-1&&Y<F.nodes.length-1&&(y=F.nodes[Y+1],z=y.key,!z||L==z))return}a.post({url:A,data:{menuId:L,nextSiblingId:z},successMessage:"Successful operation.",success:()=>{F.nodes.splice(F.index,1);const Y=F.nodes.indexOf(y);Y>-1?F.nodes.splice(Y,0,B):F.nodes.push(B)}})}}function D(B){if(B==null&&(B=n.rootId),c.value.includes(B))return;const y=d(s.value,B);y.length&&(i.value=y.map(I=>I.key),c.value=[B])}return e.watch(()=>n.data,B=>{B?s.value=b(B):s.value=[]}),e.watch(()=>n.selectedId,B=>{D(B)}),e.onMounted(()=>{N()}),(B,y)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:y[0]||(y[0]=I=>m.value=I)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:N,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[1]||(y[1]=()=>S()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ai))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[2]||(y[2]=()=>P()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(vs))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(u.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:t.sortAction!=null||t.moveAction!=null,data:s.value,pattern:m.value,"render-label":x,"render-prefix":V,onDrop:E,"selected-keys":c.value,"default-expanded-keys":i.value,"onUpdate:selectedKeys":k},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),fc=["src"],Bn=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(s){if(!r){var c=s.target;c instanceof HTMLImageElement&&(r=!0,c.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(s,c)=>(e.openBlock(),e.createElementBlock("img",{src:s.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,fc))}}),uc={class:"flex-column gap05"},pc={key:0},mc={class:"flex-row gap05",style:{"align-items":"center"}},Vn=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),s=e.ref(!1),c=e.ref(d()),m=e.ref(g()),i=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function d(){if(o.name){const h=Number(localStorage.getItem(`${o.name}:print-copies`));if(h&&h>0)return h}return 1}function g(){if(o.name){const h=localStorage.getItem(`${o.name}:print-collate`);if(h&&(h=="Collated"||h=="Uncollated"))return h}return"Collated"}function f(){if(o.disabled||s.value)return;const h={action:o.action,collate:m.value,copies:c.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(h)==!1)return;let b=h.action;b&&(b=v(b,[{collate:h.collate,copies:h.copies},h.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,m.value),localStorage.setItem(`${o.name}:print-copies`,c.value.toString())),s.value=!1,a.openFile({url:b,loadingStatus:N=>s.value=N,callback:()=>{s.value=!1,n("update:show",!1)}}))}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:h.show,preset:"card",style:e.normalizeStyle({width:h.width}),onClose:b[3]||(b[3]=()=>h.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",mc,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Za))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:f,style:{"min-width":"100px"},type:"primary",loading:s.value,disable:!h.action||h.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(u.NButton),{onClick:b[2]||(b[2]=()=>h.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",uc,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(u.NInputNumber),{value:c.value,"onUpdate:value":b[0]||(b[0]=N=>c.value=N),min:"1"},null,8,["value"])]),c.value>1?(e.openBlock(),e.createElementBlock("div",pc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(u.NSelect),{options:i,value:m.value,"onUpdate:value":b[1]||(b[1]=N=>m.value=N)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),hc={key:0,style:{"text-align":"center"}},gc=["src"],yc={key:1,style:{"text-align":"center"}},Mn=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,s)=>{const c=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:a.show,"onUpdate:show":s[1]||(s[1]=m=>a.$emit("update:show",m)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("img",{src:r.value},null,8,gc),e.createVNode(e.unref(u.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(c,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:s[0]||(s[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",yc,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),wc={class:"flex-row",style:{"align-items":"center"}},Cc={style:{"margin-left":"0.5em"}},Tn=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref([]),s=(i,d)=>{a.value=d??[]},c=()=>{a&&n("searchBack",a.value,o.config)},m=i=>{i&&i.length&&n("searchBack",i,o.config)};return(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",wc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",Cc,e.toDisplayString(e.unref(r)(i.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(Ze,{class:"flex-grow-1",config:i.config,"multi-select":i.multiSelect,"auto-close":i.autoClose,"addition-query":i.additionQuery,onResultSelected:s,onSearchBack:m},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class bc{constructor(){J(this,"rows",Array());J(this,"totalRecords",null);J(this,"pageIndex",0);J(this,"pageSize",10);J(this,"pageCount",null);J(this,"noTotal",!1);J(this,"message",null);J(this,"summary",null);J(this,"currentPageRecords",0);J(this,"meta")}}const kc={class:"flex-grow-1 flex-column"},Nc={class:"icon-container"},xc=["title"],Qe="browse_icon_directory",An="page_index",En="search_words",_n=32,zt=re(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=ie(),a=e.ref(sessionStorage.getItem(Qe)),s=e.ref(f(void 0)),c=e.ref([]),m=e.ref(1),i=e.ref(0),d=e.ref(!1),g=e.ref(sessionStorage.getItem(En));function f(T){const k=[{name:n("Root"),path:"/"}];if(T){for(;T.startsWith("/")||T.startsWith("\\");)T=T.substring(1);const x=T.split(/[\\/]+/);let V="/";for(const E of x){V+=E;const O={name:E,path:V};k.push(O),V+="/"}}return k}function h(T){T.isDirectory?a.value=T.path:T.path&&o("update:selected",T.path)}function b(){S(0)}function N(T){S(T-1)}function S(T){T=Math.max(0,T);let k=`/api/core/SystemIcons/page?pageSize=${_n}&pageIndex=${T}`;var x=g.value;x&&(k+=`&searchWords=${encodeURIComponent(x)}`);const V=a.value;V&&(k+=`&directory=${encodeURIComponent(V)}`),r.get({url:k,callback:E=>{E&&(c.value=E.rows,i.value=E.totalRecords,m.value=E.pageIndex+1,P(E.pageIndex,V,x))},loadingStatus:E=>d.value=E})}function P(T,k,x){sessionStorage.setItem(An,T.toString()),k?sessionStorage.setItem(Qe,k):sessionStorage.removeItem(Qe),x?sessionStorage.setItem(En,x):sessionStorage.removeItem(Qe)}return e.watch(a,T=>{s.value=f(T),S(0)}),e.onMounted(()=>{s.value=f(a.value);let T=Number(sessionStorage.getItem(An));S(T||0)}),(T,k)=>(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",null,[e.createVNode(e.unref(u.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,x=>(e.openBlock(),e.createBlock(e.unref(u.NBreadcrumbItem),{key:x.path},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:()=>a.value=x.path,title:x.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Po))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:b,value:g.value,"onUpdate:value":k[0]||(k[0]=x=>g.value=x)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(u.NButton),{title:e.unref(n)("Search"),onClick:b,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(u.NPagination),{page:m.value,"onUpdate:page":[k[1]||(k[1]=x=>m.value=x),N],"item-count":i.value??0,"page-size":_n},{suffix:e.withCtx(({startIndex:x,endIndex:V,itemCount:E})=>[E?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(x+1)+"~"+e.toDisplayString(V+1)+"] / "+e.toDisplayString(E),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:d.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,x=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{quaternary:"",class:"icon-button",onClick:()=>h(x)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:x.name},[e.createElementVNode("div",null,[x.isDirectory?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Po))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+x.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(x.name),1)],8,xc)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),zn=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),s=e.inject("axios"),c=e.ref(d(o.items)),m=e.ref(!1),i=e.ref(o.selectedValue);function d(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const b=[];for(let N of h)typeof N=="string"||typeof N=="number"?b.push({id:N.toString(),code:r(N.toString())}):b.push(N);return b}async function g(){var b;if(m.value)return;const h=o.getListAction;if(!h){c.value=[];return}try{m.value=!0;const N=await s.get(h);N.isSuccess&&N.value!=null?Array.isArray(N.value)?c.value=N.value:Array.isArray((b=N.value)==null?void 0:b.rows)?c.value=N.value.rows:c.value=[]:a.error(r(N.errorMessage||"Error"))}catch(N){console.log(N),a.error((N==null?void 0:N.toString())||r("Error"))}finally{m.value=!1}}function f(){i.value&&n("valueSelected",i.value)}return e.onMounted(()=>{o.getListAction&&g()}),e.watch(()=>o.getListAction,()=>{g()}),(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:m.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NModal),{show:h.show,style:e.normalizeStyle({width:h.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(h.title),onClose:b[2]||(b[2]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header"),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(e.unref(u.NRadioGroup),{value:i.value,"onUpdate:value":b[0]||(b[0]=N=>i.value=N),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:N[h.keyName],value:N[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:N},()=>[e.createTextVNode(e.toDisplayString(N.code)+" "+e.toDisplayString(N.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.description),1)]),_:1}),e.renderSlot(h.$slots,"bottom"),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:b[1]||(b[1]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function Ln(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=Ln(o.items,l);if(n)return n}}}const Lt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,s){var m;const c=new Array;if(r){let i=0,d=!1;for(const g of r)if(g.isEnabled!==!1)if(g.isSeparator)d||(c.push({type:"divider",key:`_${a}_${i++}`}),d=!0);else{const f=n(g.title),h={key:g.guid,id:g.guid,label:f,disabled:!g.isEnabled,href:g.url,tabBehavior:g.tabBehavior};if(g.items&&g.items.length)h.children=o(n,g.items,g.guid,s);else if(s&&!l(g,f,s))continue;g.guid&&g.icon&&(t[g.guid]={icon:g.icon,color:g.color}),((m=h.children)!=null&&m.length||h.href)&&c.push(h),d=!1}}return c.every(i=>i.type=="divider")?[]:c}return{menuLooks:t,systemMenuToNaiveMenu:o}},Dn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Z(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),s=e.ref(void 0),c=Lt(),m=e.computed(()=>c.systemMenuToNaiveMenu(l,n.menus,void 0,s.value)),i=e.computed(()=>n.isLoadingMenu);function d(h){if(typeof h.href=="string"&&h.href&&!h.children){let b=h.href.startsWith("~")?h.href.substring(1):h.href;h.id&&(b=v(b,{_menuid:h.id}));let N;return h.tabBehavior=="NewTab"?N="_blank":h.tabBehavior=="NamedTab"&&(N=h.id),r.test(b)?e.h("a",{href:b,target:"_blank"},{default:()=>h.label}):e.h(ce.RouterLink,{to:b,target:N},{default:()=>h.label})}else return typeof h.label=="string"?h.label:""}function g(h){var b,N,S;if(h.key){const P=(b=c.menuLooks[h.key])==null?void 0:b.icon;if(P)return e.h(xe,{path:P,class:"menu-icon"});if((N=h.children)!=null&&N.length){const T=(S=h.key)==null?void 0:S.toString();return T&&a.value.includes(T)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(ci)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Bt)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(cn)})}}function f(h){if(h)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(h)}`)}catch(b){console.error(b)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(h,b)=>{const N=e.resolveComponent("n-scrollbar"),S=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:i.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NMenu),{collapsed:h.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:m.value,"root-indent":16,indent:16,"render-label":d,"render-icon":g,value:h.currentMenuId,accordion:!0,"onUpdate:expandedKeys":b[0]||(b[0]=P=>a.value=P),"onUpdate:value":f},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(S,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:b[1]||(b[1]=P=>s.value=P)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!h.collapsed]])]),_:1},8,["show"])}}}),Sc=["src"],$n=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),s=e.ref(void 0);function c(){a.value=!a.value}function m(i){i!=null&&!o.readonly&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{i?s.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(i)}`:s.value=void 0}),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,Sc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(u.NInput),{readonly:i.readonly,value:i.value,placeholder:i.placeholder,"onUpdate:value":d[0]||(d[0]=g=>i.$emit("update:value",g)),clearable:i.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:c,disabled:i.readonly},{default:e.withCtx(()=>d[4]||(d[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":d[2]||(d[2]=g=>a.value=g),title:e.unref(r)("Select Icon"),onClose:d[3]||(d[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode(zt,{"onUpdate:selected":d[1]||(d[1]=g=>m(g))})]),_:1},8,["show","title"])]),_:1}))}}),Ic=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Z();return{t}}});function Bc(t,l,o,n,r,a){const s=e.resolveComponent("n-icon"),c=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(c,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(s,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const Rn=re(Ic,[["render",Bc]]),Vc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Z(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=Lt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),s=e.computed(()=>o.isLoadingMenu);function c(d){if(typeof d.href=="string"&&d.href&&!d.children){let g=d.href.startsWith("~")?d.href.substr(1):d.href;d.id&&(g=v(g,{_menuid:d.id}));let f;return d.tabBehavior=="NewTab"?f="_blank":d.tabBehavior=="NamedTab"&&(f=d.id),n.test(g)?e.h("a",{href:g,target:"_blank"},{default:()=>d.label}):e.h(ce.RouterLink,{to:g,target:f},{default:()=>d.label})}else return d.label}function m(d){var g,f;if(d.key){const h=(g=r.menuLooks[d.key])==null?void 0:g.icon;return h?e.h(xe,{path:h,class:"menu-icon"}):(f=d.children)!=null&&f.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function i(d){if(d)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(d)}`)}catch(g){console.error(g)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:s,renderMenuLabel:c,renderMenuIcon:m,onMenuSelected:i}}});function Mc(t,l,o,n,r,a){const s=e.resolveComponent("n-menu"),c=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(c,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(s,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const On=re(Vc,[["render",Mc]]),Tc=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=u.useMessage(),n=e.inject("axios"),{t:r}=Z(),a=e.ref(new Array),s=e.ref(new Array),c=e.ref(new Array);function m(D,H){for(const B of D){if(B.key==H)return{node:B,path:[B.key]};if(B.key!=null&&B.key!=null&&B.children&&!B.isLeaf){const y=m(B.children,H);if(y)return{node:y,path:[B.key,...y.path]}}}return null}function i(D,H){for(let B=0;B<D.length;B++){const y=D[B];if(y.key==H)return{nodes:D,index:B};if(y.children){const I=i(y.children,H);if(I)return I}}return null}function d(D){const H=m(a.value,D);return H?H.path:[]}function g(D,H){const B=new Array;for(const y of D)if(y.key&&(!H||H(y.key))&&B.push(y.key),y.children){const I=g(y.children,H);I.length&&B.push(...I)}return B}function f(D){s.value=D}function h(D){c.value=D;const H=D.length?D[0]:null;l.emit("update:selectedId",H);const B=H?d(H):[];l.emit("update:path",B)}function b(D){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,D):{key:D.id,label:D.title,isLeaf:!D.hasSubitems}}async function N(D){const H=t.childrenAction,B=t.parentKey;if(!(!H||!B))try{const y=v(H,{parentKey:B,parentId:D}),I=await n.get(y);if(I.isSuccess&&I.value!=null)return I.value.map(b);o.error(r(I.errorMessage||"Error"))}catch(y){console.log(y),o.error((y==null?void 0:y.toString())||r("Error"))}}async function S(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await N(null)}],t.selectedId==null?c.value=[t.rootId]:t.selectedId?c.value=[t.selectedId]:c.value=[],s.value=[t.rootId]}async function P(D){const H=D.key;if(H!=null){if(D.children){const y=s.value,I=g(D.children,A=>y.includes(A));s.value=s.value.filter(A=>!I.includes(A))}const B=await N(H);B&&(D.isLeaf=!B.length,D.children=B.length?B:void 0)}}function T(D){return e.h("span",null,D.option.label)}function k(D){if(!D.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(Bt)})}function x(D){const H=D.option.key;if(H!=null&&c.value.includes(H))return e.h(u.NButton,{text:!0,onClick:B=>{B.stopPropagation(),P(D.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(je)})})}function V(D){!t.moveAction&&!t.sortAction||(D.dropPosition=="before"||D.dropPosition=="after"?D.dragNode.key&&typeof D.node.key&&O(D.dragNode,D.node,D.dropPosition):D.dropPosition=="inside"&&typeof D.dragNode.key=="number"&&typeof D.node.key=="number"&&E(D.dragNode,D.node))}async function E(D,H){const B=t.moveAction;if(!B)return;const y=D.key,I=[D.key],A=H.key;if(!(!y||!A||D==H))try{const L=await n.post(B,{menuItemIds:I,targetId:A});if(L.isSuccess){o.success(r("Successful operation."));const z=i(a.value,y);z&&(z.nodes.splice(z.index,1),H.children?H.children.push(D):P(H))}else o.error(r(L.errorMessage||"Error"))}catch(L){console.log(L),o.error((L==null?void 0:L.toString())||"Error")}}async function O(D,H,B){const y=t.sortAction;if(!y)return;console.log(`dragNode: ${D.key} ${D.label}, targetNode: ${H.key} ${H.label}, dropPosition: ${B}`);const I=D.key;let A=H.key;if(!I||!A||I==A)return;const L=i(a.value,I);if(L){if(B=="after"){const z=L.nodes.indexOf(H);if(z>-1&&z<L.nodes.length-1&&(H=L.nodes[z+1],A=H.key,!A||I==A))return}try{const z=await n.post(y,{menuId:I,nextSiblingId:A});if(z.isSuccess){o.success(r("Successful operation.")),L.nodes.splice(L.index,1);const F=L.nodes.indexOf(H);F>-1?L.nodes.splice(F,0,D):L.nodes.push(D)}else o.error(r(z.errorMessage||"Error"))}catch(z){console.log(z),o.error((z==null?void 0:z.toString())||"Error")}}}async function j(D){var H;if(D.length){let B=(H=a.value)==null?void 0:H.find(L=>L.key==D[0]);B==null&&(B={key:D[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(B));let y=D[0],I=B;for(let L=1;L<D.length-1&&I;L++)if(I.children||(I.children=await N(y)),I.children){const z=D[L];I=I.children.find(F=>F.key==z),y=z}const A=s.value;for(let L=0;L<D.length-1;L++)A.includes(D[L])||A.push(D[L]);s.value=A,c.value=[D[D.length-1]]}}return e.onMounted(()=>{S()}),e.watch(()=>t.childrenAction,()=>{S()}),e.watch(()=>t.path,D=>{D&&j(D)}),{data:a,expandedKeys:s,expandedKeysChanged:f,loadChildren:P,dragDrop:V,renderLabel:T,renderPrefix:k,renderSuffix:x,selectedKeys:c,selectedKeysChanged:h}}});function Ac(t,l,o,n,r,a){const s=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(s,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const jn=re(Tc,[["render",Ac]]),Ec=e.defineComponent({components:{ChangePassword:ft,NotificationIcon:Oa},setup(){var f;const t=ce.useRouter(),{t:l}=Z(),o=u.useDialog(),n=Ne(),r=Se(),a=nt(),s=e.computed(()=>r.userInfo),c=e.ref(!1),m="/img/user_avatar.png";function i(){o.warning({title:l("Logout"),content:l("Are you sure log out?"),positiveText:l("OK"),negativeText:l("Cancel"),onPositiveClick:()=>{r.logout(),a.clearTabs(),t.push({path:"/login"})}})}function d(h){switch(h){case"preferences":t.push({path:"/core/preferences"});break;case"change_password":c.value=!0;break;case"logout":i();break;case"toggle_theme":n.toggleTheme();break}}const g=[{label:(f=s.value)==null?void 0:f.userName,type:"group",key:"user_group",children:[{label:l("Preferences"),key:"preferences",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Ea)})}},{label:l("Change Password"),key:"change_password",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Fa)})}}]},{label:l("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h(ha)})}},{type:"divider"},{label:l("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Ta)})}}];return{userInfo:s,options:g,onMenuSelected:d,changePwdBoxShow:c,defaultAvatarPath:m}}}),_c={style:{margin:"0 20px 10px 0",cursor:"pointer"}},zc={class:"user-name-box"},Lc={class:"user-name-label"};function Dc(t,l,o,n,r,a){const s=e.resolveComponent("n-avatar"),c=e.resolveComponent("n-dropdown"),m=e.resolveComponent("change-password"),i=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(i,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(c,{trigger:"click",options:t.options,placement:"bottom-end",onSelect:t.onMenuSelected,size:"medium"},{default:e.withCtx(()=>{var d,g,f;return[e.createElementVNode("div",_c,[e.createVNode(s,{round:"",size:"medium",title:(d=t.userInfo)==null?void 0:d.userName,src:`/api/core/avatar?id=${(g=t.userInfo)==null?void 0:g.avatar}`,"fallback-src":t.defaultAvatarPath,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src","fallback-src"]),e.createElementVNode("div",zc,[e.createElementVNode("div",Lc,e.toDisplayString((f=t.userInfo)==null?void 0:f.name),1)])])]}),_:1},8,["options","onSelect"]),e.createVNode(m,{show:t.changePwdBoxShow,onClose:l[0]||(l[0]=()=>t.changePwdBoxShow=!1)},null,8,["show"])]),_:1})}const Fn=re(Ec,[["render",Dc],["__scopeId","data-v-0d4b7b61"]]),$c={class:"flex-row"},Rc={class:"app-tab-label"},Oc={style:{"margin-left":"4px"}},Pn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=ce.useRouter(),o=Se(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(c=>{!c.path||c.path=="/"||c.name=="blank"||(r.value=a(c.path))});function a(c){var i;const m=(i=o.menus)==null?void 0:i.find(d=>{var g;return((g=d.url)==null?void 0:g.toLowerCase())==c.toLowerCase()});if(m)return m.guid}function s(c){var m;if(c){const i=(m=o.menus)==null?void 0:m.find(d=>d.guid==c);i&&i.url&&(l.push(i.url),r.value=i.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(c,m)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,class:"app-tabs",type:c.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,i=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:i.guid,name:i.guid},{default:e.withCtx(()=>[e.createElementVNode("div",$c,[e.createElementVNode("div",null,[i.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:i.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(fi))]),_:1}))]),e.createElementVNode("div",Rc,[e.createElementVNode("span",Oc,e.toDisplayString(i.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}});class jc{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class Fc{constructor(){J(this,"guid","");J(this,"title","");J(this,"icon");J(this,"color");J(this,"url");J(this,"isSeparator",!1);J(this,"isEnabled",!0);J(this,"groupName");J(this,"description");J(this,"items");J(this,"tabBehavior");J(this,"closable")}}const Pc=$e.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var s;const a=(s=localStorage.getItem("fontSizeMode"))==null?void 0:s.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),Hc={AppLogoBox:Jt,AppTabs:Go,AutoScrollView:Ko,BarcodeImage:Zo,ChangePassword:ft,ColorInput:ut,DefaultPropertyForm:kt,DetailPage:rn,ExportModal:Vt,EmptyDetailView:mn,FormInput:Ve,FullscreenSwitch:hn,GridConfigModal:Tt,HaloButtonSelect:yn,HaloDatePicker:Pe,HaloForm:Cn,HaloGrid:We,HaloModal:bn,HaloModalInput:bt,HaloSelect:kn,HaloTagsInput:wt,HaloTimePicker:ht,HaloTransfer:Nn,ImportModal:Ye,InputModal:_t,ListInputModal:Ct,MainDetailPanel:xn,MenuIcon:xe,NullableBooleanInput:gt,NumberInputModal:Sn,ObjectTreeView:In,PhotoBox:Bn,PrintModal:Vn,PropertyGrid:Nt,QrModal:Mn,SearchCard:Tn,SearchForm:Ke,SearchModal:Et,SearchPanel:Ze,SelectIconBox:zt,SelectObjectModal:zn,SideMenu:Dn,SystemIconInput:$n,TagsView:At,ToolButton:Rn,TopMenu:On,TreeView:jn,UserMenu:Fn,TabMenu:Pn},Gc={install(t,l){const o={...Ho,...l};for(const[n,r]of Object.entries(Hc))t.component(n,r);l!=null&&l.langCode&&t.use(Xt,l==null?void 0:l.langCode,!0),t.provide("axios",le),t.provide(ct,o)}};M.axios=le,M.AppLogoBox=Jt,M.AppTabs=Go,M.AutoScrollView=Ko,M.BarcodeImage=Zo,M.ChangePassword=ft,M.ColorInput=ut,M.DataPage=bc,M.DateFormat=ge,M.DateTimeFormat=Ee,M.DefaultPropertyForm=kt,M.DetailPage=rn,M.EmptyDetailView=mn,M.ExportModal=Vt,M.FormInput=Ve,M.FullscreenSwitch=hn,M.GridConfigModal=Tt,M.HaloButtonSelect=yn,M.HaloDatePicker=Pe,M.HaloForm=Cn,M.HaloGrid=We,M.HaloModal=bn,M.HaloModalInput=bt,M.HaloSelect=kn,M.HaloTagsInput=wt,M.HaloTimePicker=ht,M.HaloTransfer=Nn,M.HalovConfigKey=ct,M.I18nPlugin=Xt,M.ImportModal=Ye,M.InputModal=_t,M.ListInputModal=Ct,M.MainDetailPanel=xn,M.MenuIcon=xe,M.NullableBooleanInput=gt,M.NumberInputModal=Sn,M.ObjectTreeView=In,M.PhotoBox=Bn,M.PrintModal=Vn,M.PropertyGrid=Nt,M.QrModal=Mn,M.SearchCard=Tn,M.SearchForm=Ke,M.SearchModal=Et,M.SearchPanel=Ze,M.SelectIconBox=zt,M.SelectObjectModal=zn,M.SessionSummary=jc,M.SideMenu=Dn,M.SystemIconInput=$n,M.SystemMenu=Fc,M.TabMenu=Pn,M.TagsView=At,M.TimeFormat=_e,M.ToolButton=Rn,M.TopMenu=On,M.TreeView=jn,M.UserMenu=Fn,M.addDays=Ur,M.appendParamsToUrl=v,M.arrayGroupBy=hs,M.arrayMove=ln,M.arrayRemoveIf=nn,M.buildBarcodeUrl=Wo,M.buildSearchItems=vo,M.camelToWords=te,M.clearObject=rs,M.convertItems=Uo,M.convertPercentValue=Ro,M.convertTo=Oe,M.copyEntity=qo,M.copyToEntity=Jo,M.createGridColumns=Be,M.createI18n=Qt,M.dateTimeToString=st,M.dateToNumber=Eo,M.dateToString=zo,M.default=Gc,M.defaultHalovOptions=Ho,M.defaultValue=$o,M.downloadFile=me,M.findMenuById=Ln,M.firstDayOfMonth=vr,M.formatTimespan=Lo,M.getColumnWidth=pt,M.getConfig=dt,M.iconRender=mt,M.iconRenderIf=is,M.initEntity=Xo,M.instanceOfColumnValueSource=Qo,M.instanceOfHaloColumn=Ie,M.instanceOfTime=Mo,M.isNullOrWhiteSpace=Oo,M.lastDayOfMonth=ea,M.linesToArray=oa,M.loadItemSources=Fe,M.mergeRoutes=ys,M.msToTime=Qr,M.onNullOrWhiteSpace=la,M.openFile=on,M.renderDifference=ds,M.renderIconButton=cs,M.renderLabel=ss,M.searchField=gs,M.secondsToTime=To,M.splitNumberByCount=ws,M.splitNumberBySize=Cs,M.stringToArray=ta,M.stringToTime=Ao,M.sumNumbers=bs,M.timeToString=_o,M.timestamp=Jr,M.toBool=de,M.toBoolDefault=Re,M.toDate=Vo,M.toViewModel=qr,M.useAccountStore=Se,M.useCommonStore=Ne,M.useFontSizeStore=Pc,M.useHttpTools=ie,M.useI18n=Z,M.useMenus=Lt,M.usePermissions=Mt,M.useTabsStore=nt,M.useUiTools=yt,M.validateEmail=na,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});