@a2simcode/ui 0.0.21 → 0.0.23

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.
Files changed (87) hide show
  1. package/LICENSE +53 -53
  2. package/README.md +130 -130
  3. package/dist/components/autocomplete/index.d.ts +3 -0
  4. package/dist/components/autocomplete/src/autocomplete.vue.d.ts +3 -0
  5. package/dist/components/barcode/index.d.ts +520 -93
  6. package/dist/components/barcode/src/barcode.vue.d.ts +419 -98
  7. package/dist/components/button-select/index.d.ts +61 -0
  8. package/dist/components/button-select/src/button-select.vue.d.ts +35 -0
  9. package/dist/components/cascader-select/index.d.ts +4 -20
  10. package/dist/components/cascader-select/src/cascader-select.vue.d.ts +4 -33
  11. package/dist/components/checkbox/index.d.ts +3 -3
  12. package/dist/components/checkbox/src/checkbox.vue.d.ts +1 -1
  13. package/dist/components/code-mirror/index.d.ts +0 -1
  14. package/dist/components/code-mirror/src/code-mirror.vue.d.ts +0 -1
  15. package/dist/components/collapse/index.d.ts +44 -0
  16. package/dist/components/collapse/src/collapse.vue.d.ts +37 -0
  17. package/dist/components/comp/index.d.ts +30 -15
  18. package/dist/components/comp/src/comp.vue.d.ts +31 -45
  19. package/dist/components/comp/src/interface.d.ts +101 -0
  20. package/dist/components/count-up/index.d.ts +3 -3
  21. package/dist/components/count-up/src/count-up.vue.d.ts +1 -1
  22. package/dist/components/dialog/index.d.ts +5 -5
  23. package/dist/components/dialog/src/index.vue.d.ts +2 -2
  24. package/dist/components/dialog-full/index.d.ts +5 -5
  25. package/dist/components/dialog-full/src/index.vue.d.ts +2 -2
  26. package/dist/components/drawer/index.d.ts +5 -5
  27. package/dist/components/drawer/src/drawer.vue.d.ts +2 -2
  28. package/dist/components/editor/index.d.ts +160 -0
  29. package/dist/components/editor/src/editor.vue.d.ts +86 -0
  30. package/dist/components/form/index.d.ts +6 -6
  31. package/dist/components/form/src/form.vue.d.ts +3 -3
  32. package/dist/components/form-item/src/form-item.vue.d.ts +1 -1
  33. package/dist/components/icon/src/icon.vue.d.ts +0 -4
  34. package/dist/components/index.d.ts +24 -6
  35. package/dist/components/inject-provide.d.ts +159 -0
  36. package/dist/components/input/index.d.ts +3 -1
  37. package/dist/components/input/src/input.vue.d.ts +5 -1
  38. package/dist/components/input-color/index.d.ts +114 -0
  39. package/dist/components/input-color/src/input-color.vue.d.ts +73 -0
  40. package/dist/components/input-rows/index.d.ts +200 -0
  41. package/dist/components/input-rows/src/input-rows.vue.d.ts +154 -0
  42. package/dist/components/input-rows/src/interface.d.ts +33 -0
  43. package/dist/components/layer-form/index.d.ts +178 -0
  44. package/dist/components/layer-form/src/layer-form.vue.d.ts +149 -0
  45. package/dist/components/map/index.d.ts +127 -0
  46. package/dist/components/map/src/map.vue.d.ts +92 -0
  47. package/dist/components/number/index.d.ts +3 -3
  48. package/dist/components/number/src/number.vue.d.ts +3 -3
  49. package/dist/components/page/index.d.ts +15 -9
  50. package/dist/components/page/src/page.vue.d.ts +5 -3
  51. package/dist/components/select/index.d.ts +6 -1
  52. package/dist/components/select/src/select.vue.d.ts +7 -2
  53. package/dist/components/slider/index.d.ts +3 -3
  54. package/dist/components/slider/src/slider.vue.d.ts +1 -1
  55. package/dist/components/switch/index.d.ts +71 -0
  56. package/dist/components/switch/src/switch.vue.d.ts +83 -0
  57. package/dist/components/table/index.d.ts +275 -66
  58. package/dist/components/table/src/editors/index.d.ts +26 -0
  59. package/dist/components/table/src/editors/j-comp-editor.d.ts +62 -0
  60. package/dist/components/table/src/table.vue.d.ts +326 -61
  61. package/dist/components/table/src/theme/default.d.ts +27 -0
  62. package/dist/components/table-panel/index.d.ts +459 -0
  63. package/dist/components/table-panel/src/column-panel.vue.d.ts +37 -0
  64. package/dist/components/table-panel/src/filter-panel.vue.d.ts +49 -0
  65. package/dist/components/table-panel/src/keyword-panel.vue.d.ts +36 -0
  66. package/dist/components/table-panel/src/order-panel.vue.d.ts +24 -0
  67. package/dist/components/table-panel/src/table-panel.vue.d.ts +445 -0
  68. package/dist/components/tabs/index.d.ts +156 -0
  69. package/dist/components/tabs/src/tabs.vue.d.ts +110 -0
  70. package/dist/components/tree/index.d.ts +451 -0
  71. package/dist/components/tree/src/tree.vue.d.ts +478 -0
  72. package/dist/components/upload/index.d.ts +13 -13
  73. package/dist/components/upload/src/list.vue.d.ts +1 -1
  74. package/dist/components/upload/src/upload.vue.d.ts +5 -5
  75. package/dist/components/workflow-viewer/index.d.ts +60 -0
  76. package/dist/components/workflow-viewer/src/utils.d.ts +2 -0
  77. package/dist/components/workflow-viewer/src/workflow-viewer.vue.d.ts +25 -0
  78. package/dist/core/utils/comp.d.ts +18 -0
  79. package/dist/core/utils/index.d.ts +2 -0
  80. package/dist/core/utils/map.d.ts +1 -0
  81. package/dist/core/utils/tree.d.ts +1 -0
  82. package/dist/core/utils/useSortable.d.ts +5 -0
  83. package/dist/simcode-ui.es.js +13254 -3594
  84. package/dist/simcode-ui.umd.js +2 -2
  85. package/dist/stats.html +1 -1
  86. package/dist/ui.css +1 -1
  87. package/package.json +49 -24
@@ -1,4 +1,4 @@
1
- (function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("crypto-js/aes"),require("crypto-js/enc-utf8"),require("crypto-js/pad-pkcs7"),require("crypto-js/enc-base64"),require("crypto-js/md5"),require("crypto-js/sha256"),require("crypto-js/sha512"),require("@visactor/vtable"),require("echarts"),require("jsbarcode"),require("countup.js"),require("sql-formatter"),require("async-validator")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","crypto-js/aes","crypto-js/enc-utf8","crypto-js/pad-pkcs7","crypto-js/enc-base64","crypto-js/md5","crypto-js/sha256","crypto-js/sha512","@visactor/vtable","echarts","jsbarcode","countup.js","sql-formatter","async-validator"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x.SimCodeUI={},x.Vue,x.IconifyVue,x.dayjs,x.CryptoJS.AES,x.CryptoJS.enc.Utf8,x.CryptoJS.pad.Pkcs7,x.CryptoJS.enc.Base64,x.CryptoJS.MD5,x.CryptoJS.SHA256,x.CryptoJS.SHA512,x.VTable,x.echarts,x.JsBarcode,x.CountUp,x.SqlFormatter,x.AsyncValidator))})(this,(function(x,e,je,Pe,De,me,oo,We,lo,no,ao,io,so,co,ro,uo,fo){"use strict";function Ue(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(n,l,o.get?o:{enumerable:!0,get:()=>t[l]})}}return n.default=t,Object.freeze(n)}const He=Ue(io),mo=Ue(so),P=t=>(t.install=n=>{n.component(t.name,t)},t);function Ne(t){return t&&Array.isArray(t)}function Ye(t,n){return toString.call(t)===`[object ${n}]`}function po(t){return t!==null&&Ye(t,"Object")}const se=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),pe=e.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const n=t,l=e.computed(()=>{const i=n.icon;if(i.indexOf(":")===-1)return je.getIcon(`jcode:${n.icon}`)==null,`jcode:${n.icon}`;const s=`jcode:${i.split(":")[1]}`;return je.getIcon(s)!=null?s:i}),o=e.computed(()=>({...n,icon:l.value}));return(i,a)=>t.isDiv?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0},i.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[e.createVNode(e.unref(je.Icon),e.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg"}),null,16,["height","width"])],16)):(e.openBlock(),e.createElementBlock("span",e.mergeProps({key:1},i.$attrs,{class:"jicon"}),[e.createVNode(e.unref(je.Icon),e.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg"}),null,16,["height","width"])],16))}}),ho=["disabled"],go={key:2},qe=P(e.defineComponent({name:"JButton",__name:"button",props:{type:{type:String,default:"default"},size:{type:String,default:"default"},shape:{type:String,default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:()=>!1},icon:{type:String,default:""},href:{type:String,default:""},target:{type:String,default:"_self"},label:{type:String,default:""},notLabel:{type:Boolean,default:!1},compact:Boolean,lastCompactItem:Boolean,firstCompactItem:Boolean},emits:["click"],setup(t,{expose:n,emit:l}){const o=t,i=l,a=h=>{!f.value&&!o.disabled&&(i("click",h),o.href&&window.open(o.href,o.target?o.target:"_self"))},s=e.shallowRef(null),c=()=>{s.value?.focus()},p=()=>{s.value?.blur()},d=e.computed(()=>o.notLabel||!o.label),f=e.ref(!1);e.watch(()=>o.loading,h=>{if(typeof h=="boolean")f.value=h;else if(se(h?.delay))f.value=!1;else{const y=setTimeout(()=>{f.value=!0},h.delay);return()=>clearTimeout(y)}},{immediate:!0});const r=e.computed(()=>o.label||"");return n({focus:c,blur:p}),(h,y)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonNodeRef",ref:s,type:"button",class:e.normalizeClass(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":f.value==!0,"j-button-icon-only":d.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:e.withModifiers(a,["stop"])},[f.value?(e.openBlock(),e.createBlock(pe,{key:0,icon:"mdi-light:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):e.createCommentVNode("",!0),t.icon?(e.openBlock(),e.createBlock(pe,{key:1,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.notLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",go,e.toDisplayString(r.value),1)),e.renderSlot(h.$slots,"iconAfter")],10,ho))}}));function xe(t){Object.keys(t||{}).forEach(n=>{delete t[n]})}function Xe(t){const{toString:n}=Object.prototype,l={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return t instanceof Element?"element":l[n.call(t)]}function he(t){const n=Xe(t);let l;if(n==="array")l=[];else if(n==="object")l={};else return t;if(n==="array")for(let o=0,i=t.length;o<i;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,l.push(he(t[o]));else n==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,l[o]=he(t[o])});return l}function $e(t,n,l=[]){Object.keys(n).forEach(o=>{l.indexOf(o)===-1&&(t[o]=n[o])})}const Ge=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const l=Math.random()*16|0;return(n==="x"?l:l&3|8).toString(16)});let Fe=0;function ze(t=""){const n=Date.now(),l=Math.floor(Math.random()*1e9);return Fe++,t?t+"_"+l+Fe+String(n):l+Fe+String(n)}const Ie=t=>{if(t)try{const n=new Function("return "+t)();return typeof n=="function"?{res:!0,msg:"ok",fn:n}:(console.warn("此方法不是一个函数",t),{res:!1,msg:"此方法不是一个函数"})}catch(n){return console.warn(n,t),{res:!1,msg:n}}else return{res:!1,msg:"没设置脚本函数"}};function Qe(t,n,l){if(!t||typeof t!="object")return t;const o=Array.isArray(n)?n:n.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(o.length===0)return t;let i=t;for(let a=0;a<o.length-1;a++){const s=o[a],c=o[a+1];(!(s in i)||typeof i[s]!="object"||i[s]===null)&&(i[s]=/^\d+$/.test(c)?[]:{}),i=i[s]}return i[o[o.length-1]]=l,t}const Se=t=>{let n=parseFloat(t);return isNaN(n)?0:(n=Math.round(t*100)/100,n)},yo=function(t,n,l){const o=(t-1)*n;return o+n>=l.length?l.slice(o,l.length):l.slice(o,o+n)},bo=function(t,n){const l=(t.page-1)*t.rows,o=l+t.rows>=n.length?n.slice(l,n.length):n.slice(l,l+t.rows);return{rows:o,total:n.length,page:t.page,records:o.length}},ko=function(t){return t.filter((n,l,o)=>o.indexOf(n,0)===l)},Ze=t=>{if(!/^\d*(\.\d*)?$/.test(t))return"Number is wrong!";const n=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],l=["","十","百","千","万","亿","点",""],o=(""+t).replace(/(^0*)/g,"").split(".");let i=0,a="";for(let s=o[0].length-1;s>=0;s--){switch(i){case 0:a=l[7]+a;break;case 4:new RegExp("0{4}\\d{"+(o[0].length-s-1)+"}$").test(o[0])||(a=l[4]+a);break;case 8:a=l[5]+a,l[7]=l[5],i=0;break}i%4===2&&o[0].charAt(s+2)!=="0"&&o[0].charAt(s+1)==="0"&&(a=n[0]+a),o[0].charAt(s)!=="0"&&(a=n[Number(o[0].charAt(s))]+l[i%4]+a),i++}if(o.length>1){a+=l[6];for(let s=0;s<o[1].length;s++)a+=n[Number(o[1].charAt(s))]}return a},Ke=t=>{const n=(t+"").split("."),l=n[0]+"",o=n[1]||"",i=l.length%3;let a=l.substring(0,i);for(let s=0;s<Math.floor(l.length/3);s++)a+=","+l.substring(i+s*3,i+(s+1)*3);return i===0&&(a=a.substring(1)),t=a+(o?"."+o:""),t},_e=t=>{if(!t)return;const n=document.createElement("span");n.style.fontSize="var(--font-size)",n.style.visibility="hidden",n.style.position="absolute",n.innerText=t,document.body.appendChild(n);const l=n.offsetWidth;return document.body.removeChild(n),l};function et(t){return t==null||t===void 0||t===""?"":t===t.toUpperCase()?t.split("_").map(o=>(o=o.toLowerCase(),o.slice(0,1).toUpperCase()+o.slice(1))).join(""):t.slice(0,1).toUpperCase()+t.slice(1)}function Co(t,n=!0){if(t==null||t===void 0||t==="")return"";n&&(t=et(t));let l="";for(let o=0,i=t.length;o<i&&(l+=t[o].toLowerCase(),!(o<i-1&&t[o+1]===t[o+1].toLowerCase()||o<i-2&&t[o+2]===t[o+2].toLowerCase()));o++);if(l.length<t.length)for(let o=l.length,i=t.length;o<i;o++)l+=t[o];return l}const Ee=t=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-slider-captcha"].includes(t)||t.indexOf("j-input")!=-1,ge=t=>{const n=t.config||{};if(t.getCompConfig){const l=t.getCompConfig({config:n,formData:t.formData,row:t.row,tableData:t.tableData,pRowData:t.pRowData})||{};for(const o in n)l[o]=n[o];return l}return n},Bo="YYYY-MM-DD HH:mm:ss",wo="YYYY-MM-DD";function tt(t,n=Bo){return Pe(t).format(n)}function Ve(t,n=wo){return Pe(t).format(n)}function ot(t){const n="j-loading-spin",l=document.querySelector(`.${n}`);if(t){if(!l){document.body.style.overflow="hidden";const o=new DocumentFragment,i=document.createElement("div");i.className=n;const a=document.createElement("span");a.className="j-loading-spin-dot";for(let s=0;s<4;s++){const c=document.createElement("i");a.appendChild(c)}i.appendChild(a),o.appendChild(i),document.body.appendChild(o)}}else l&&l.parentNode&&(document.body.style.overflow="",l.parentNode.removeChild(l))}const xo=(()=>{let t=null,n=0;return l=>{l?(n++,t&&clearTimeout(t),ot(!0),t=null):(n=Math.max(0,n-1),n===0&&(t&&clearTimeout(t),t=setTimeout(()=>{ot(!1),t=null},400)))}})();function ye(t){xo(t)}const lt=(t,n=32)=>{const{length:l}=t;if(l<n){for(let o=0,i=n-l;o<i;o++)t+="0";return t}return l>n?t.substring(0,n):t};class So{key;iv;constructor({key:n,iv:l}){this.key=me.parse(lt(n)),this.iv=me.parse(lt(l||"1234567890000000",16))}get getOptions(){return{padding:oo,iv:this.iv}}encrypt(n){return De.encrypt(n,this.key,this.getOptions).toString()}decrypt(n){return De.decrypt(n,this.key,this.getOptions).toString(me)}}class be{static instance;constructor(){}static getInstance(){return be.instance||(be.instance=new be),be.instance}encrypt(n){return me.parse(n).toString(We)}decrypt(n){return We.parse(n).toString(me)}}class ke{static instance;constructor(){}static getInstance(){return ke.instance||(ke.instance=new ke),ke.instance}hash(n){return lo(n).toString()}}class Ce{static instance;constructor(){}static getInstance(){return Ce.instance||(Ce.instance=new Ce),Ce.instance}hash(n){return no(n).toString()}}class Be{static instance;constructor(){}static getInstance(){return Be.instance||(Be.instance=new Be),Be.instance}hash(n){return ao(n).toString()}}class nt{static createAesEncryption(n){return new So(n)}static createBase64Encryption(){return be.getInstance()}}class Vo{static createMD5Hashing(){return ke.getInstance()}static createSHA256Hashing(){return Ce.getInstance()}static createSHA512Hashing(){return Be.getInstance()}}const jo=(t,n)=>De.decrypt(t,n).toString(me);function at(t,n,l){const o={},i={};return t.forEach(a=>{o[a[l]]=o[a[l]]||[],o[a[l]].push(a),i[a[n]]=a}),{group:o,map:i}}function Oe(t,n,l,o,i,a){const s=[];return t==null?Object.keys(n.group).forEach(c=>{(!a||a.indexOf(c)===-1)&&(n.map[c]||n.group[c].forEach(d=>{(!a||a.indexOf(d[l])===-1)&&(o&&(d.value=d[o]),i&&(d.label=d[i]),n.group[d[l]]&&n.group[d[l]].length>0&&(d.children=Oe(n.group[d[l]],n,l,o,i,a)),s.push(d))}))}):t.forEach(c=>{(!a||a.indexOf(c[l])===-1)&&(o&&(c.value=c[o]),i&&(c.label=c[i]),n.group[c[l]]&&n.group[c[l]].length>0&&(c.children=Oe(n.group[c[l]],n,l,o,i,a)),s.push(c))}),s}function No(t,n,l,o,i,a){if(t.length===0||!n&&!t[0]._id)return t;const s=n||"_id";l=l||"_pid";let c=[],p={};if(o?t.forEach(f=>{p[f[o]]||(p[f[o]]=!0,c.push(he(f)))}):c=t,p={},s===l){const f=[];return c.forEach(r=>{(!a||a.indexOf(r[s])===-1)&&(o&&(r.value=r[o]),i&&(r.label=r[i]),f.push(r))}),f}const d=at(c,s,l);return Oe(null,d,s,o,i,a)}const it=(t,n,l,o)=>{l=l||[];for(let i=0,a=l.length;i<a;i++){const s=l[i],c={};c._id=s.prop||`${n}_${i}`,c._pid=n,Object.keys(s).forEach(d=>{(!o||o.indexOf(d)===-1)&&(c[d]=s[d])}),t.push(c);const p=s.children||[];p.length>0&&(c._hasChildren=!0,it(t,c._id,p))}},$o=(t,n)=>{const l=[];return it(l,"0",t,n),l},st=(t,n,l,o)=>{n=n||[];for(let i=0,a=n.length;i<a;i++){const s=n[i],c={value:s[l],label:s[o]};t.push(c);const p=s.children||[];p.length>0&&(c.children=[],st(c.children,p,l,o))}},zo=(t,n,l)=>{const o=[];return st(o,t,n||"value",l||"label"),o};function Eo(t){const n=o=>{t.value.open(o)};return{handleClick:o=>{if(!o.disabled){if(o.layerName){o.layerGetParam&&(o.layerParam=o.layerGetParam()),n({title:o.layerTitle,name:o.layerName,width:o.layerWidth||1e3,height:o.layerHeight||600,afterOk:o.afterOk||null,afterClose:o.afterClose||null,formConfig:o.layerFormConfig||{},param:o.layerParam||{},type:o.layerType,hasBtns:o.layerHasBtns});return}o.click&&o.click({handleOpenForm:n})}}}}const ct=P(e.defineComponent({name:"JButtons",__name:"index",props:{list:{type:Array,default:()=>[]},group:{type:Object,default:()=>({})},isLink:Boolean,size:{type:String,default:"default"},readonly:Boolean},setup(t){const n=t,l=e.computed(()=>{if(Object.keys(n.group).length>0)return n.group;const a={},s=he(n.list),c=s.length;for(let p=0;p<c;p++){const d=s[p];d.groupId=d.groupId||ze(),a[d.groupId]=a[d.groupId]||[],a[d.groupId].push(d)}return a}),o=e.ref(),{handleClick:i}=Eo(o);return(a,s)=>{const c=e.resolveComponent("j-button"),p=e.resolveComponent("el-space"),d=e.resolveComponent("el-dropdown"),f=e.resolveComponent("j-dynamic-layer");return e.openBlock(),e.createBlock(p,{style:e.normalizeStyle({display:t.readonly?"none":""}),size:t.isLink?0:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,h)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:h},{ref_for:!0},a.$attrs),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(y,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u},[y.children?.length&&y.children?.length>0?(e.openBlock(),e.createBlock(d,{key:0},{dropdown:e.withCtx(()=>[e.createVNode(p,{direction:"vertical"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.children||[],m=>(e.openBlock(),e.createBlock(c,{key:m.prop,label:m.label,type:"text",danger:m.danger,size:t.size,disabled:m.disabled,icon:m.icon,onClick:e.withModifiers(b=>e.unref(i)(m),["stop"])},null,8,["label","danger","size","disabled","icon","onClick"]))),128))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(c,{label:y.label,type:t.isLink?"link":y.type,danger:y.danger,size:t.size,icon:y.icon,onClick:e.withModifiers(m=>e.unref(i)(y),["stop"])},null,8,["label","type","danger","size","icon","onClick"])]),_:2},1024)):(e.openBlock(),e.createBlock(c,{key:1,label:y.label,type:t.isLink?"link":y.type,danger:y.danger,size:t.size,icon:y.icon,compact:!0,"last-compact-item":u===r.length-1,"first-compact-item":u===0,onClick:e.withModifiers(m=>e.unref(i)(y),["stop"])},null,8,["label","type","danger","size","icon","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128)),e.createVNode(f,{ref_key:"layerRef",ref:o},null,512)]),_:1},8,["style","size"])}}})),rt=P(e.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){return l.modelValue},set(f){o("update:modelValue",f)}}),a=f=>{o("input",f)},s=f=>{o("focus",f)},c=f=>{o("blur",f)},p=()=>{o("clear")},d=f=>{o("change",f)};return(f,r)=>{const h=e.resolveComponent("j-icon"),y=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(y,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=u=>i.value=u),type:t.type,"model-modifiers":t.modelModifiers,maxlength:t.maxlength,minlength:t.minlength,"show-word-limit":t.showWordLimit,"word-limit-position":t.wordLimitPosition,placeholder:t.placeholder,clearable:t.clearable,"clear-icon":t.clearIcon,formatter:t.formatter,parser:t.parser,"show-password":t.showPassword,disabled:t.disabled,size:t.size,rows:t.rows,autosize:t.autosize,autocomplete:t.autocomplete,name:t.name,readonly:t.readonly,max:t.max,min:t.min,step:t.step,resize:t.resize,autofocus:t.autofocus,form:t.form,"aria-label":t.ariaLabel,tabindex:t.tabindex,"validate-event":t.validateEvent,"input-style":t.inputStyle,label:t.label,inputmode:t.inputmode},f.$attrs,{onInput:a,onFocus:s,onBlur:c,onClear:p,onChange:d}),e.createSlots({_:2},[t.prefixIcon?{name:"prefix",fn:e.withCtx(()=>[e.createVNode(h,{icon:t.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,t.suffixIcon?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(h,{icon:t.suffixIcon},null,8,["icon"])]),key:"1"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}})),dt=P(pe),To={key:1},ut=P(e.defineComponent({name:"JRadio",__name:"radio",props:{modelValue:{type:[String],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){let a=l.options;if(!se(l.modelValue)&&a&&a.length>0){let s=l.modelValue+"",c=l.options.find(p=>p.value+""===s);if(c)return c.value}return l.modelValue},set(a){o("update:modelValue",a)}});return(a,s)=>{const c=e.resolveComponent("el-radio-button"),p=e.resolveComponent("el-tag"),d=e.resolveComponent("el-radio"),f=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(f,{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=r=>i.value=r),disabled:t.readonly},{default:e.withCtx(()=>[t.isButton?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,r=>(e.openBlock(),e.createBlock(c,{key:r.value,value:r.value,size:t.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:2},1032,["value","size"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,(r,h)=>(e.openBlock(),e.createBlock(d,{key:r.value,value:r.value,size:t.size},{default:e.withCtx(()=>[t.isColor?(e.openBlock(),e.createBlock(p,{key:0,color:t.colors[h]||r.color||"",size:t.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.label),1)]),_:2},1032,["color","size"])):(e.openBlock(),e.createElementBlock("span",To,e.toDisplayString(r.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}})),Lo={class:"j-select-input-label-wrapper"},Mo={class:"j-select-option-wrapper"},Do={class:"j-select-option-wrapper"},ft=P(e.defineComponent({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){return l.modelValue},set(f){o("update:modelValue",f)}}),a=e.computed(()=>!se(i.value)&&!l.multiple&&l.options.filter(f=>i.value==f.value).map(f=>f.label).join(",")||""),s=e.computed(()=>!se(i.value)&&!l.multiple?l.options.find(f=>f.value===i.value)?.icon:""),c=e.computed(()=>l.selectData?.split(",")||[]),p=e.computed(()=>{let f=[];if(l.isSelectOnlyone?f=l.options.map(r=>({...r,disabled:c.value.includes(r.value)})):f=l.options,l.isGroup){const r=[],h={};return f.forEach(y=>{let u={};const m=y[l.groupKey||""]||"";h[m]||(u.value=m,u.label=m,h[m]=[],u.children=h[m],r.push(u));const b={value:y.value,label:y.label,icon:y.icon,disabled:y.disabled};h[m].push(b)}),r}return f}),d=f=>{if(l.multiple){if(f.length==0){o("change",void 0);return}const r=[];f.forEach(h=>{const y=l.options.find(u=>u.value==h);y&&r.push(y)}),o("change",r)}else{if(f==""||f==null||f==null){o("change",void 0);return}const r=l.options.find(h=>h.value==f);o("change",r)}};return(f,r)=>{const h=e.resolveComponent("el-tooltip"),y=e.resolveComponent("el-option"),u=e.resolveComponent("el-option-group"),m=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(m,e.mergeProps(f.$attrs,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=b=>i.value=b),class:[{"no-border":t.noBorder,"rows-background":t.isRows}],teleported:t.teleported,size:t.size,disabled:t.disabled||t.readonly,multiple:t.multiple,clearable:t.clearable,filterable:t.filterable,"collapse-tags":t.collapseTags,"collapse-tags-tooltip":t.collapseTagsTooltip,placeholder:t.placeholder,onChange:d}),e.createSlots({default:e.withCtx(()=>[t.isGroup?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.value,b=>(e.openBlock(),e.createBlock(u,{key:b.label,label:b.label},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.children,k=>(e.openBlock(),e.createBlock(y,{key:k.value,label:k.label,value:k.value||" ",disabled:!!k.disabled},{default:e.withCtx(()=>[e.createElementVNode("div",Mo,[k.icon?(e.openBlock(),e.createBlock(pe,{key:0,class:"j-select-option-icon",icon:k.icon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(k.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(p.value,b=>(e.openBlock(),e.createBlock(y,{key:b.value,label:b.label,value:b.value+"",disabled:!!b.disabled},{default:e.withCtx(()=>[e.createElementVNode("div",Do,[b.icon?(e.openBlock(),e.createBlock(pe,{key:0,class:"j-select-option-icon",icon:b.icon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(b.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[t.multiple?void 0:{name:"label",fn:e.withCtx(()=>[e.createElementVNode("div",Lo,[s.value?(e.openBlock(),e.createBlock(pe,{key:0,class:"j-select-option-icon",icon:s.value},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[t.isShowTooltip?(e.openBlock(),e.createBlock(h,{key:0,content:a.value,placement:"top"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1},8,["content"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(a.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}})),mt=P(e.defineComponent({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(t,{expose:n,emit:l}){const o=t,i=e.ref(null),a=e.ref(null),s=l;n({getCheckedNodes:(h=!1)=>i.value?.getCheckedNodes(h),clearCheckedNodes:()=>{a.value?.clearCheckedNodes()}});const d=e.computed({get(){return se(o.modelValue)?[]:o.modelValue?.split(",")||[]},set(h){s("update:modelValue",se(h)?"":h.join(","))}}),f=(h,y)=>{d.value=h,s("change",{value:se(h)?"":h.join(","),data:y})},r=e.computed(()=>({checkStrictly:o.checkStrictly,expandTrigger:o.expandTrigger,multiple:o.multiple,emitPath:o.emitPath,lazy:o.lazy,lazyLoad:o.lazyLoad,hoverThreshold:o.hoverThreshold,checkOnClickNode:o.checkOnClickNode,checkOnClickLeaf:o.checkOnClickLeaf,showPrefix:o.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return(h,y)=>{const u=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(u,{ref_key:"cascaderRef",ref:i,modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=m=>d.value=m),"cascader-panel-ref":a.value,props:r.value,options:t.options,placeholder:t.placeholder,disabled:t.disabled||t.readonly,clearable:t.clearable,"collapse-tags":t.collapseTags,"max-collapse-tags":t.maxCollapseTags,"collapse-tags-tooltip":t.collapseTagsTooltip,filterable:t.filterable,"show-all-levels":t.showAllLevels,separator:t.separator,size:t.size,onChange:f},{default:e.withCtx(({node:m,data:b})=>[e.renderSlot(h.$slots,"default",{node:m,data:b},()=>[e.createTextVNode(e.toDisplayString(b?.label),1)])]),prefix:e.withCtx(()=>[e.renderSlot(h.$slots,"prefix")]),"suggestion-item":e.withCtx(({item:m})=>[e.renderSlot(h.$slots,"suggestion-item",{item:m})]),tag:e.withCtx(({option:m,handleClose:b,disabled:k})=>[e.renderSlot(h.$slots,"tag",{option:m,handleClose:b,disabled:k})]),header:e.withCtx(()=>[e.renderSlot(h.$slots,"header")]),footer:e.withCtx(()=>[e.renderSlot(h.$slots,"footer")]),empty:e.withCtx(()=>[e.renderSlot(h.$slots,"empty")]),_:3},8,["modelValue","cascader-panel-ref","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}})),pt=P(e.defineComponent({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"#fff"},fill:{default:"#409eff"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){return l.modelValue},set(s){o("update:modelValue",s)}}),a=s=>{o("change",s)};return(s,c)=>{const p=e.resolveComponent("el-checkbox"),d=e.resolveComponent("el-checkbox-button"),f=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(f,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=r=>i.value=r),disabled:t.disabled||t.readonly,size:t.size,min:t.min,max:t.max,"text-color":t.textColor,fill:t.fill,tag:t.tag,"validate-event":t.validateEvent,label:t.label,type:t.type,onChange:a},{default:e.withCtx(()=>[t.type==="checkbox"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,r=>(e.openBlock(),e.createBlock(p,{key:r.value,value:r.value,disabled:r.disabled,size:t.size,label:r.label},null,8,["value","disabled","size","label"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,r=>(e.openBlock(),e.createBlock(d,{key:r.value,value:r.value,disabled:r.disabled,size:t.size,label:r.label},null,8,["value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}})),ht=P(e.defineComponent({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},controlsPosition:{},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},validateEvent:{type:Boolean,default:!0},label:{},inputmode:{},align:{default:"center"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{}},emits:["update:modelValue","change","blur","focus"],setup(t,{expose:n,emit:l}){const o=t,i=e.ref(),a=l,s=e.computed({get(){return o.modelValue},set(h){a("update:modelValue",h)}}),c=h=>{a("change",h)},p=()=>{a("blur")},d=()=>{a("focus")};return n({blur:()=>{i.value?.blur()},focus:()=>{i.value?.focus()}}),(h,y)=>{const u=e.resolveComponent("j-icon"),m=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(m,{id:t.id,ref_key:"inputNumberRef",ref:i,modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=b=>s.value=b),min:t.min,max:t.max,step:t.step,"step-strictly":t.stepStrictly,precision:t.precision,size:t.size,readonly:t.readonly||t.disabled,disabled:t.disabled||t.readonly,controls:t.controls,"controls-position":t.controlsPosition,"aria-label":t.ariaLabel,placeholder:t.placeholder,"value-on-clear":t.valueOnClear,"validate-event":t.validateEvent,label:t.label,inputmode:t.inputmode,align:t.align,"disabled-scientific":t.disabledScientific,onChange:c,onBlur:p,onFocus:d},{prefix:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.prefix||""),1)]),suffix:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.suffix||""),1)]),"decrease-icon":e.withCtx(()=>[t.decreaseIcon?(e.openBlock(),e.createBlock(u,{key:0,icon:t.decreaseIcon},null,8,["icon"])):t.controlsPosition==="right"?(e.openBlock(),e.createBlock(u,{key:1,icon:"ep:arrow-down"})):(e.openBlock(),e.createBlock(u,{key:2,icon:"ep:minus"}))]),"increase-icon":e.withCtx(()=>[t.increaseIcon?(e.openBlock(),e.createBlock(u,{key:0,icon:t.increaseIcon},null,8,["icon"])):t.controlsPosition==="right"?(e.openBlock(),e.createBlock(u,{key:1,icon:"ep:arrow-up"})):(e.openBlock(),e.createBlock(u,{key:2,icon:"ep:plus"}))]),_:1},8,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","validate-event","label","inputmode","align","disabled-scientific"])}}})),gt=P(e.defineComponent({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0}},emits:["update:modelValue","select","change","focus","blur"],setup(t,{expose:n,emit:l}){const o=t,i=e.ref(null),a=l,s=e.computed({get(){return o.modelValue||""},set(m){a("update:modelValue",m)}}),c=(m,b)=>{if(o.fetchSuggestions){o.fetchSuggestions(m,b);return}const k=m?o.options.filter(p(m)):o.options;b(k)},p=m=>b=>b?.[o.valueKey]?.toLowerCase().indexOf(m.toLowerCase())===0,d=m=>{a("select",m)},f=m=>{a("change",m)},r=()=>{a("focus")},h=()=>{a("blur")};return n({focus:()=>{i.value?.focus()},blur:()=>{i.value?.blur()}}),(m,b)=>{const k=e.resolveComponent("el-autocomplete");return e.openBlock(),e.createBlock(k,{ref_key:"autocompleteRef",ref:i,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=B=>s.value=B),"fetch-suggestions":c,placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled||t.readonly,"value-key":t.valueKey,debounce:t.debounce,placement:t.placement,"trigger-on-focus":t.triggerOnFocus,"select-when-unmatched":t.selectWhenUnmatched,"aria-label":t.ariaLabel,"hide-loading":t.hideLoading,"popper-class":t.popperClass,"popper-style":t.popperStyle,teleported:t.teleported,"append-to":t.appendTo,"highlight-first-item":t.highlightFirstItem,"fit-input-width":t.fitInputWidth,"loop-navigation":t.loopNavigation,onSelect:d,onChange:f,onFocus:r,onBlur:h},e.createSlots({default:e.withCtx(({item:B})=>[e.renderSlot(m.$slots,"default",{item:B},()=>[e.createElementVNode("div",null,e.toDisplayString(B[t.valueKey]||""),1)])]),_:2},[m.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"prefix")]),key:"0"}:void 0,m.$slots.suffix?{name:"suffix",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"suffix")]),key:"1"}:void 0,m.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"header")]),key:"2"}:void 0,m.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"footer")]),key:"3"}:void 0,m.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"prepend")]),key:"4"}:void 0,m.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"append")]),key:"5"}:void 0,m.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}})),Fo={class:"j-block"},Io={key:1,class:"j-layout--container"},Oo={class:"j-block"},vo={class:"j-block"},Ao={class:"j-block"},yt=P(e.defineComponent({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(t){const n=t,l=e.useSlots(),o=e.ref(),i=e.ref(),a=e.ref(-1),s=e.ref(-1),c=e.ref(-1),p=e.ref(-1),d=e.ref(0),f=e.ref(!1),r=e.reactive({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),h=e.computed({get(){return a.value!==-1?a.value:n.left},set(L){a.value=L}}),y=e.computed({get(){return s.value!==-1?s.value:n.right},set(L){s.value=L}}),u=e.computed({get(){return c.value!==-1?c.value:n.top},set(L){c.value=L}}),m=e.computed({get(){return p.value!==-1?p.value:n.bottom},set(L){p.value=L}}),b=e.computed(()=>l.left),k=e.computed(()=>l.right),B=e.computed(()=>l.top),E=e.computed(()=>l.bottom),F=e.computed(()=>b.value?f.value&&n.hideMidWhenNarrow&&k.value?"50%":f.value&&n.hideMidWhenNarrow&&!k.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),A=e.computed(()=>k.value?f.value&&n.hideMidWhenNarrow&&b.value?"50%":f.value&&n.hideMidWhenNarrow&&!b.value?"100%":typeof y.value=="number"?y.value+"px":y.value:"0"),g=e.computed(()=>B.value?typeof u.value=="number"?u.value+"px":u.value:"0"),w=e.computed(()=>E.value?typeof m.value=="number"?m.value+"px":m.value:"0"),z=e.computed(()=>({minWidth:n.midMinWidth+"px",minHeight:n.midMinHeight+"px"})),$=(L,J)=>{r.type=L,r.isMove=!0,r.pageX=J.pageX,r.pageY=J.pageY,r.h=i.value.clientHeight,r.w=i.value.clientWidth;const v=o.value.clientWidth,X=o.value.clientHeight;switch(L){case"left":{const H=h.value;r.size=typeof H=="string"&&H.includes("%")?parseFloat(H)/100*v:Number(H);break}case"right":{const H=y.value;r.size=typeof H=="string"&&H.includes("%")?parseFloat(H)/100*v:Number(H);break}case"top":{const H=u.value;r.size=typeof H=="string"&&H.includes("%")?parseFloat(H)/100*X:Number(H);break}case"bottom":{const H=m.value;r.size=typeof H=="string"&&H.includes("%")?parseFloat(H)/100*X:Number(H);break}}document.onmouseup=j,document.onmousemove=W},W=L=>{if(r.isMove)switch(r.type){case"left":{const J=L.pageX-r.pageX;let v=r.size+J;v<0?v=4:v>r.size+r.w-n.midMinWidth&&(v=r.size+r.w-n.midMinWidth),h.value=v;break}case"right":{const J=L.pageX-r.pageX;let v=r.size-J;v<0?v=4:v>r.size+r.w-n.midMinWidth&&(v=r.size+r.w-n.midMinWidth),y.value=v;break}case"top":{const J=L.pageY-r.pageY;let v=r.size+J;v<0?v=4:v>r.size+r.h-n.midMinHeight&&(v=r.size+r.h-n.midMinHeight),u.value=v;break}case"bottom":{const J=L.pageY-r.pageY;let v=r.size-J;v<0?v=4:v>r.size+r.h-n.midMinHeight&&(v=r.size+r.h-n.midMinHeight),m.value=v;break}}},j=()=>{r.isMove=!1,document.onmouseup=null,document.onmousemove=null},G=()=>{if(!n.hideMidWhenNarrow||!o.value){f.value=!1;return}d.value=o.value.clientWidth;let L=0,J=0;if(b.value){const X=h.value;L=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*d.value:Number(X)}if(k.value){const X=y.value;J=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*d.value:Number(X)}const v=d.value-L-J;f.value=v<n.midMinWidth};let I=null;return e.onMounted(()=>{n.hideMidWhenNarrow&&o.value&&(G(),I=new ResizeObserver(()=>{G()}),I.observe(o.value))}),e.onUnmounted(()=>{I&&I.disconnect()}),(L,J)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"layout",ref:o,class:e.normalizeClass(["j-layout",{"j-layout-not-hidden":t.notHidden}])},[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--left",style:e.normalizeStyle({width:F.value})},[e.createElementVNode("div",Fo,[e.renderSlot(L.$slots,"left")]),t.leftMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:J[0]||(J[0]=v=>$("left",v))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Io,[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--top",style:e.normalizeStyle({height:g.value})},[e.createElementVNode("div",Oo,[e.renderSlot(L.$slots,"top")]),t.topMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:J[1]||(J[1]=v=>$("top",v))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"mid",ref:i,class:"j-layout--wrapper",style:e.normalizeStyle(z.value)},[e.renderSlot(L.$slots,"default")],4),E.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"j-layout--bottom",style:e.normalizeStyle({height:w.value})},[e.createElementVNode("div",vo,[e.renderSlot(L.$slots,"bottom")]),t.bottomMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:J[2]||(J[2]=v=>$("bottom",v))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)])),k.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"j-layout--right",style:e.normalizeStyle({width:A.value})},[e.createElementVNode("div",Ao,[e.renderSlot(L.$slots,"right")]),t.rightMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:J[3]||(J[3]=v=>$("right",v))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],2))}})),Ro={class:"j-block"},bt=P(e.defineComponent({name:"JTable",__name:"table",props:{columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,required:!0,default:()=>[]},widthMode:{type:String,default:"standard"},height:{type:Number,default:void 0},border:{type:Boolean,default:!0},stripe:{type:Boolean,default:!1},theme:{type:String,default:"default"}},emits:["ready"],setup(t,{expose:n,emit:l}){const o=t,i=l,a=e.ref(null);let s=null;const c=()=>{if(!a.value)return;const u={records:o.records,columns:o.columns,autoFillWidth:!0,autoFillHeight:!0};o.height&&(u.height=o.height),o.stripe&&(u.theme={...He.themes[o.theme==="dark"?"DARK":"DEFAULT"],bodyStyle:{bgColor:m=>{const{row:b}=m;return b%2===0?o.theme==="dark"?"#1a1a1a":"#fafafa":o.theme==="dark"?"#0f0f0f":"#ffffff"}}}),console.log(u),s=new He.ListTable(a.value,u),i("ready",s)},p=()=>{s&&(s.release(),s=null)},d=()=>{s&&s.setRecords(o.records)},f=()=>s,r=u=>{s&&s.setRecords(u)},h=u=>{s&&s.setColumns(u)},y=()=>{s&&(p(),c())};return e.onMounted(()=>{c()}),e.onBeforeUnmount(()=>{p()}),e.watch(()=>o.records,()=>{d()},{deep:!0}),n({getInstance:f,setRecords:r,setColumns:h,refresh:y}),(u,m)=>(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",{ref_key:"tableContainer",ref:a,class:e.normalizeClass(["j-table",{"j-table-border":t.border}])},null,2)]))}})),Jo=["title"],Po={key:0,style:{"margin-left":"8px"}},Wo={key:0,class:"j-dialog-steps"},Uo={key:1,class:"j-dialog-btns"},kt=P(e.defineComponent({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(t,{expose:n,emit:l}){const o=t,i=l,{t:a}=e.inject("jcode_app_provide",{t:D=>D}),s=e.ref(!1),c=e.ref(!1),p=e.ref(""),d=e.ref(!1),f=e.ref(!0),r=e.ref(!1),h=e.ref(!0),y=e.ref(-1),u=e.reactive({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),m=e.ref(0),b=e.ref(),k=e.ref(48),B=e.ref(0),E=e.ref(0);e.watch(()=>o.visible,D=>{m.value=1,m.value=0,s.value=D,D===!0&&o.zoomControls&&e.nextTick(()=>{b.value=document.querySelector(".j-dialog"),b.value.onmousemove=ue})},{immediate:!0});const F=e.computed(()=>{let D=o.height+m.value;return D+40>window.innerHeight&&(D=window.innerHeight-32-40),D}),A=e.computed(()=>{let D=0+m.value;return D=(document.body.clientWidth-w.value)/2,D}),g=e.computed(()=>{let D=0+m.value;return D=(window.innerHeight-F.value-40)/2,D}),w=e.computed(()=>{let D=0+m.value;return D=o.width,D>document.body.clientWidth&&(D=document.body.clientWidth-32),D}),z=D=>{p.value=D||"保存数据中...",c.value=!0},$=()=>{c.value=!1},W=()=>{o.beforeClose&&o.beforeClose()===!1||(s.value=!1,i("update:visible",!1),i("cancel"))},j=()=>{i("ok",z,$)},G=()=>{u.left=0,u.top=0,E.value=0,B.value=0,o.isStep&&(I.value=0,e.nextTick(()=>{X()})),i("closed")},I=e.computed({get(){return y.value!==-1?y.value:o.stepActive},set(D){y.value=D,i("update:stepActive",D)}}),L=()=>{I.value>0&&I.value--,e.nextTick(()=>{X()})},J=async()=>{await v()&&(I.value<o.steps.length-1&&(I.value+=1),e.nextTick(()=>{X()}))},v=async()=>{if(d.value=!0,o.validateSteps){const D=await o.validateSteps(o.stepActive,z,$);return d.value=!1,D}return d.value=!1,!0},X=()=>{switch(h.value=!0,r.value=!0,f.value=!0,I.value){case 0:r.value=!1;break;case o.steps.length-1:f.value=!1,h.value=!1;break;default:f.value=!1,r.value=!1;break}},H=e.computed(()=>o.steps.map(D=>({title:D,disabled:!0}))),ce=function(D){o.autoHeight||(u.pageX=D.pageX,u.pageY=D.pageY,u._left=u.left,u._top=u.top,u.isMove=!0,document.onmouseup=Y,document.onmousemove=oe)},Y=()=>{u.isMove=!1,document.onmouseup=null,document.onmousemove=null},oe=D=>{if(u.isMove){const ne=D.pageX-u.pageX,ee=D.pageY-u.pageY;let Q=u._left+ne,le=u._top+ee;Q+A.value<0&&(Q=-A.value),B.value?Q+B.value+A.value>document.body.clientWidth&&(Q=document.body.clientWidth-B.value-A.value):Q+w.value+A.value>document.body.clientWidth&&(Q=document.body.clientWidth-w.value-A.value),le+g.value<0&&(le=-g.value),E.value?le+E.value+g.value+40>window.innerHeight&&(le=window.innerHeight-E.value-g.value-40):le+F.value+g.value+40>window.innerHeight&&(le=window.innerHeight-F.value-g.value-40),u.left=Q,u.top=le}},ue=D=>{const ne=b.value.offsetLeft,ee=b.value.offsetTop,Q=b.value.clientWidth,le=b.value.clientHeight,ie=le-k.value,V=b.value.scrollTop;if(D.clientX>ne+Q-10&&V+D.clientY>ee+le-10||V+D.clientY<ee+5&&ne+10>D.clientX)b.value.style.cursor="se-resize";else if(ne+10>D.clientX&&V+D.clientY>ee+le-10||D.clientX>ne+Q-10&&V+D.clientY<ee+5)b.value.style.cursor="sw-resize";else if(D.clientX>ne+Q-10||ne+10>D.clientX)b.value.style.cursor="w-resize";else if(V+D.clientY>ee+le-10||V+D.clientY<ee+5)b.value.style.cursor="s-resize";else{b.value.style.cursor="default",b.value.onmousedown=null;return}b.value.onmousedown=O=>{const{clientX:U}=O,{clientY:_}=O,re=u.left+A.value,de=u.top+g.value;u._left=u.left,u._top=u.top,E.value||(E.value=ie),B.value||(B.value=Q),U>re+10&&U<re+Q-10&&_>de+5&&_<de+47||(document.onmousemove=function(Z){Z.preventDefault(),U>re&&U<re+10&&(U>Z.clientX&&(B.value=Q+(U-Z.clientX),u.left=u._left-(U-Z.clientX)),U<Z.clientX&&B.value>o.minWidth&&(B.value=Q-(Z.clientX-U),u.left=u._left+Z.clientX-U)),U>re+Q-10&&U<re+Q&&(U>Z.clientX&&B.value>o.minWidth&&(B.value=Q-(U-Z.clientX)),U<Z.clientX&&A.value+u.left+B.value<document.body.clientWidth&&(B.value=Q+(Z.clientX-U))),_>de&&_<de+5&&(_>Z.clientY&&(E.value=ie+_-Z.clientY,u.top=u._top-(_-Z.clientY)),_<Z.clientY&&E.value>o.minHeight&&(E.value=ie-(Z.clientY-_),u.top=u._top+Z.clientY-_)),V+_>de+ie+38&&V+_<de+ie+48&&(_>Z.clientY&&E.value>o.minHeight&&(E.value=ie-(_-Z.clientY)),_<Z.clientY&&g.value+u.top+E.value+48<window.innerHeight&&(E.value=ie+Z.clientY-_))},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null})}},fe=async D=>{D.click&&await D.click()};return n({showLoading:z,hideLoading:$}),(D,ne)=>{const ee=e.resolveComponent("j-button"),Q=e.resolveComponent("el-space"),le=e.resolveComponent("el-step"),ie=e.resolveComponent("el-steps"),V=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(V,{modelValue:s.value,"onUpdate:modelValue":ne[0]||(ne[0]=O=>s.value=O),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":t.destroyOnClose,"show-close":!1,modal:t.mask,"modal-penetrable":!t.mask,"close-on-click-modal":!1,width:`${B.value||w.value}px`,style:e.normalizeStyle({position:"fixed",left:`${A.value+u.left}px`,top:`${g.value+u.top}px`,"pointer-events":t.mask?"":"none"}),onClosed:G},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"j-dialog-header",onMousedown:ce},[e.createElementVNode("div",{class:"j-dialog-header-left",title:e.unref(a)(t.title||""),style:e.normalizeStyle({cursor:t.autoHeight?"":"move"})},[e.createElementVNode("span",null,e.toDisplayString(e.unref(a)(t.title||"")),1),t.subtitle?(e.openBlock(),e.createElementBlock("span",Po,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle())))])):e.createCommentVNode("",!0)],12,Jo),t.showCloseBtn?(e.openBlock(),e.createBlock(Q,{key:0,size:0},{default:e.withCtx(()=>[e.createVNode(ee,{type:"text",icon:"material-symbols-light:close-rounded",onClick:W})]),_:1})):e.createCommentVNode("",!0)],32),e.createElementVNode("div",{class:e.normalizeClass(["j-dialog-window",{"j-dialog-window-hasBtns":t.hasBtns},{"j-dialog-window-hasSteps":t.isStep}]),style:e.normalizeStyle({height:t.autoHeight?"auto":(E.value>0?E.value:F.value)+"px"})},[t.isStep?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",{style:e.normalizeStyle({maxWidth:`${200*H.value.length}px`,width:"100%"})},[e.createVNode(ie,{simple:"",active:I.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,(O,U)=>(e.openBlock(),e.createBlock(le,{key:U,title:e.unref(a)(O.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):e.createCommentVNode("",!0),e.renderSlot(D.$slots,"default"),t.hasBtns?(e.openBlock(),e.createElementBlock("div",Uo,[e.createVNode(Q,{size:8},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(ee,{key:0,size:"mini",disabled:f.value,label:e.unref(a)("上一步"),onClick:L},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(ee,{key:1,size:"mini",disabled:r.value,loading:d.value,label:e.unref(a)("下一步"),onClick:J},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),!t.isStep&&t.showCloseBtn?(e.openBlock(),e.createBlock(ee,{key:2,size:"mini",label:e.unref(a)("取消"),onClick:W},null,8,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,O=>(e.openBlock(),e.createBlock(ee,{key:O.prop,label:O.label,danger:O.danger,ghost:O.ghost,type:O.type,icon:O.icon,onClick:U=>fe(O)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(ee,{key:3,size:"mini",type:"primary",disabled:h.value&&t.isStep,label:e.unref(a)(t.btnText),onClick:j},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}})),Ho=["element-loading-text"],Yo={class:"j-dialog-full-header"},qo={class:"j-dialog-full-header-left"},Xo=["src"],Go={class:"j-dialog-full-title-text"},Qo={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Zo={class:"j-dialog-full-header-right"},Ko={class:"j-dialog-full-body"},Ct=P(e.defineComponent({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(t,{expose:n,emit:l}){const o=t,i=l,{logoImg:a,t:s}=e.inject("jcode_app_provide",{logoImg:"",t:j=>j}),c=e.ref(!1),p=e.ref(!1),d=e.ref(""),f=e.ref(!1),r=e.ref(!0),h=e.ref(!1),y=e.ref(!0),u=e.ref(-1);e.watch(()=>o.visible,j=>{c.value=j},{immediate:!0});const m=e.computed({get(){return u.value!==-1?u.value:o.stepActive},set(j){u.value=j,i("update:stepActive",j)}}),b=()=>{o.beforeClose&&o.beforeClose()===!1||(c.value=!1,i("update:visible",!1),i("cancel"))},k=()=>{i("ok",E,F)},B=()=>{o.isStep&&(m.value=0,e.nextTick(()=>{z()})),i("closed")},E=j=>{d.value=j||"保存数据中...",p.value=!0},F=()=>{p.value=!1},A=()=>{m.value>0&&m.value--,e.nextTick(()=>{z()})},g=async()=>{await w()&&(m.value<o.steps.length-1&&(m.value+=1),e.nextTick(()=>{z()}))},w=async()=>{if(f.value=!0,o.validateSteps){const j=await o.validateSteps(o.stepActive,E,F);return f.value=!1,j}return f.value=!1,!0},z=()=>{switch(y.value=!0,h.value=!0,r.value=!0,m.value){case 0:h.value=!1;break;case o.steps.length-1:r.value=!1,y.value=!1;break;default:r.value=!1,h.value=!1;break}},$=e.computed(()=>o.steps.map(j=>({title:j,disabled:!0}))),W=async j=>{j.click&&await j.click()};return n({showLoading:E,hideLoading:F}),(j,G)=>{const I=e.resolveComponent("el-step"),L=e.resolveComponent("el-steps"),J=e.resolveComponent("j-button"),v=e.resolveComponent("el-space"),X=e.resolveComponent("el-divider"),H=e.resolveComponent("el-dialog"),ce=e.resolveDirective("loading");return e.openBlock(),e.createBlock(H,{modelValue:c.value,"onUpdate:modelValue":G[0]||(G[0]=Y=>c.value=Y),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":t.destroyOnClose,onClosed:B},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"j-block j-dialog-full-window","element-loading-text":e.unref(s)(d.value)},[e.createElementVNode("div",Yo,[e.createElementVNode("div",qo,[e.unref(a)?(e.openBlock(),e.createElementBlock("img",{key:0,class:"j-dialog-full-header-logo",src:e.unref(a)},null,8,Xo)):e.createCommentVNode("",!0),e.createElementVNode("span",Go,e.toDisplayString(e.unref(s)(t.title)),1),e.createElementVNode("span",Qo,[t.subtitle?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle()),{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:"j-dialog-full-header-mid",style:e.normalizeStyle({maxWidth:`${200*$.value.length}px`})},[t.isStep?(e.openBlock(),e.createBlock(L,{key:0,simple:"",active:m.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(Y,oe)=>(e.openBlock(),e.createBlock(I,{key:oe,title:e.unref(s)(Y.title)},null,8,["title"]))),128))]),_:1},8,["active"])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",Zo,[e.createVNode(v,{size:0},{default:e.withCtx(()=>[t.hasBtns?(e.openBlock(),e.createBlock(v,{key:0},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(J,{key:0,size:"mini",disabled:r.value,label:e.unref(s)("上一步"),onClick:A},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(J,{key:1,size:"mini",disabled:h.value,loading:f.value,label:e.unref(s)("下一步"),onClick:g},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,Y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Y.prop},[Y.display!==!1?(e.openBlock(),e.createBlock(J,{key:0,label:Y.label,danger:Y.danger,ghost:Y.ghost,type:Y.type,disabled:Y.disabled,icon:Y.icon?Y.icon:"",onClick:oe=>W(Y)},null,8,["label","danger","ghost","type","disabled","icon","onClick"])):e.createCommentVNode("",!0)],64))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(J,{key:2,size:"mini",type:"primary",disabled:y.value&&t.isStep,label:e.unref(s)(t.btnText),onClick:k},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),t.showCloseBtn&&t.hasBtns?(e.openBlock(),e.createBlock(X,{key:1,type:"vertical",style:{margin:"0 8px"}})):e.createCommentVNode("",!0),t.showCloseBtn?(e.openBlock(),e.createBlock(J,{key:2,type:"text",icon:"material-symbols-light:close-rounded",onClick:b})):e.createCommentVNode("",!0)]),_:1})])]),e.createElementVNode("div",Ko,[e.renderSlot(j.$slots,"default")])],8,Ho)),[[ce,p.value]])]),_:3},8,["modelValue","destroy-on-close"])}}})),_o=["element-loading-text"],el={class:"j-block"},tl={key:0,class:"j-drawer-bottom-btns"},ol={class:"j-drawer--header"},ll={class:"j-drawer--title"},nl={style:{height:"28px","line-height":"32px","margin-left":"8px"}},al={key:0,class:"j-drawer--btns"},il={key:0,class:"j-drawer-steps"},Bt=P(e.defineComponent({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(t,{expose:n,emit:l}){const o=t,{t:i}=e.inject("jcode_app_provide",{t:j=>j}),a=l,s=e.ref(!1),c=e.ref(""),p=e.computed(()=>["ltr","rtl"].indexOf(o.direction)!==-1?`${o.width}px`:`${o.height}px`),d=e.computed({get(){return o.visible},set(j){a("update:visible",!!j)}}),f=j=>{c.value=j||"保存数据中...",s.value=!0},r=()=>{s.value=!1},h=()=>{o.isStep&&(A.value=0,e.nextTick(()=>{$()})),a("closed")},y=()=>{a("ok",f,r)},u=()=>{o.beforeClose&&o.beforeClose()===!1||(d.value=!1,a("update:visible",!1),a("cancel"))},m=async j=>{j.click&&await j.click()},b=e.ref(!1),k=e.ref(!0),B=e.ref(!1),E=e.ref(!0),F=e.ref(-1),A=e.computed({get(){return F.value!==-1?F.value:o.stepActive},set(j){F.value=j,a("update:stepActive",j)}}),g=()=>{A.value>0&&A.value--,e.nextTick(()=>{$()})},w=async()=>{await z()&&(A.value<o.steps.length-1&&(A.value+=1),e.nextTick(()=>{$()}))},z=async()=>{if(b.value=!0,o.validateSteps){const j=await o.validateSteps(o.stepActive,f,r);return b.value=!1,j}return b.value=!1,!0},$=()=>{switch(E.value=!0,B.value=!0,k.value=!0,A.value){case 0:B.value=!1;break;case o.steps.length-1:k.value=!1,E.value=!1;break;default:k.value=!1,B.value=!1;break}},W=e.computed(()=>o.steps.map(j=>({title:j,disabled:!0})));return n({showLoading:f,hideLoading:r}),(j,G)=>{const I=e.resolveComponent("el-input"),L=e.resolveComponent("j-button"),J=e.resolveComponent("el-space"),v=e.resolveComponent("el-step"),X=e.resolveComponent("el-steps"),H=e.resolveComponent("el-drawer"),ce=e.resolveDirective("loading");return e.openBlock(),e.createBlock(H,{modelValue:d.value,"onUpdate:modelValue":G[0]||(G[0]=Y=>d.value=Y),class:"j-drawer","append-to-body":!0,direction:t.direction,size:p.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":t.destroyOnClose,modal:t.mask,"before-close":t.beforeClose,"close-on-click-modal":!0,onClosed:h},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":t.isStep}]),"element-loading-text":c.value},[e.createElementVNode("div",{class:"j-drawer--body",style:e.normalizeStyle({"padding-bottom":t.showCloseBtn||t.hasSaveBtn||t.buttons.length>0?"48px":"0"})},[e.createVNode(I,{style:{position:"absolute",top:"-200px"}}),e.createElementVNode("div",el,[e.renderSlot(j.$slots,"default")]),t.hasBtns?(e.openBlock(),e.createElementBlock("div",tl,[e.createVNode(J,{size:8},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(L,{key:0,size:"mini",disabled:k.value,label:e.unref(i)("上一步"),onClick:g},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(L,{key:1,size:"mini",disabled:B.value,loading:b.value,label:e.unref(i)("下一步"),onClick:w},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),!t.isStep&&t.showCloseBtn?(e.openBlock(),e.createBlock(L,{key:2,size:"mini",label:e.unref(i)("取消"),onClick:u},null,8,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,Y=>(e.openBlock(),e.createBlock(L,{key:Y.prop,label:Y.label,danger:Y.danger,ghost:Y.ghost,type:Y.type,icon:Y.icon,onClick:oe=>m(Y)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(L,{key:3,size:"mini",type:"primary",disabled:E.value&&t.isStep,label:e.unref(i)(t.btnText),onClick:y},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",ol,[e.createElementVNode("div",ll,[e.createElementVNode("span",null,e.toDisplayString(e.unref(i)(t.title)),1),e.createElementVNode("span",nl,[t.subtitle?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle()),{key:0})):e.createCommentVNode("",!0)])]),t.showCloseBtn?(e.openBlock(),e.createElementBlock("div",al,[e.createVNode(L,{type:"text",icon:"material-symbols-light:close-rounded",onClick:u})])):e.createCommentVNode("",!0)]),t.isStep?(e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",{style:e.normalizeStyle({maxWidth:`${200*W.value.length}px`,width:"100%"})},[e.createVNode(X,{simple:"",active:A.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(Y,oe)=>(e.openBlock(),e.createBlock(v,{key:oe,title:e.unref(i)(Y.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):e.createCommentVNode("",!0)],10,_o)),[[ce,s.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}})),wt=P(e.defineComponent({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(t,{expose:n,emit:l}){const o=l,i=e.ref(!1),a=e.ref(""),s=e.ref(),c=e.ref(0),p=e.ref(""),d=e.ref(),f=(k,B,E)=>{a.value=k,d.value=E,p.value=B||"modal",i.value=!0},r=()=>{i.value=!1},h=(k,B)=>{o("ok",k,B)},y=()=>{c.value=0,o("closed")},u=()=>{o("cancel")},m=k=>{s.value&&s.value.showLoading(k)},b=()=>{s.value&&s.value.hideLoading()};return e.provide("jcode_layer_provide",{stepActive:c}),n({open:f,close:r,showLoading:m,hideLoading:b}),(k,B)=>{const E=e.resolveComponent("j-dialog-full"),F=e.resolveComponent("j-drawer"),A=e.resolveComponent("j-dialog");return p.value==="full"?(e.openBlock(),e.createBlock(E,{key:0,ref_key:"modalRef",ref:s,visible:i.value,"onUpdate:visible":B[0]||(B[0]=g=>i.value=g),"step-active":c.value,"onUpdate:stepActive":B[1]||(B[1]=g=>c.value=g),title:a.value,"before-close":t.beforeClose,"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"has-header":t.hasHeader,subtitle:d.value,onOk:h,onClosed:y,onCancel:u},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):p.value==="drawer"?(e.openBlock(),e.createBlock(F,{key:1,ref_key:"modalRef",ref:s,visible:i.value,"onUpdate:visible":B[2]||(B[2]=g=>i.value=g),"step-active":c.value,"onUpdate:stepActive":B[3]||(B[3]=g=>c.value=g),"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"has-header":t.hasHeader,subtitle:d.value,onOk:h,onClosed:y,onCancel:u},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):(e.openBlock(),e.createBlock(A,{key:2,ref_key:"modalRef",ref:s,visible:i.value,"onUpdate:visible":B[4]||(B[4]=g=>i.value=g),"step-active":c.value,"onUpdate:stepActive":B[5]||(B[5]=g=>c.value=g),width:t.width,height:t.height,title:a.value,"before-close":t.beforeClose,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,subtitle:d.value,onOk:h,onClosed:y,onCancel:u},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}})),xt=P(e.defineComponent({name:"JDynamicLayer",__name:"dynamic-layer",setup(t,{expose:n}){const l=e.ref(),o=e.ref(600),i=e.ref(400),a=e.ref(!0),s=e.ref(!0),c=e.ref(!0),p=e.ref(""),d=e.ref([]),f=e.ref(!0),r=e.ref(),h=e.shallowRef(),y=e.ref(),{getPageName:u}=e.inject("jcode_auth_page_provide",{getPageName:()=>""}),m=()=>{const I=u();return I||(typeof h.value=="string"?h.value:"")},b=e.ref(!1),k=e.ref([]),B=async I=>{if(r.value?.validateSteps){ye(!0);const L=r.value.validateSteps(I);return ye(!1),L}return!0},E=()=>r.value?.beforeClose?r.value.beforeClose():!0;let F,A,g,w=0;const z=async I=>{if(r.value){if(w=0,r.value.getConfig){const L=r.value.getConfig();d.value=L.buttons||[],b.value=L.isStep,k.value=L.steps||[]}else d.value=[],b.value=!1,k.value=[];if(r.value.open)try{const{buttons:L}=await r.value.open(I,l.value,()=>{F&&F()})||{};if(L&&L.length>0){const J=[];J.push(...d.value),J.push(...L),d.value=J}}catch(L){l.value.close(),console.error(L)}l.value.hideLoading()}else{if(w>600){console.warn("表单组件加载超时"),l.value.hideLoading();return}w++,setTimeout(async()=>{await z(I)},100)}},$=I=>{h.value=I?.name,o.value=I?.width||600,i.value=I?.height||400,a.value=I?.hasBtns!==!1,s.value=I?.hasSaveBtn!==!1,c.value=I?.hasHeader!==!1,I?.destroyOnClose!==!1&&(f.value=!0),y.value=I?.config||{},p.value=I?.btnText||"保存",F=I?.afterOk||null,A=I?.afterClose||null,g=I?.afterCancel||null,l.value.open(I.title,I.type,I.subtitle),e.nextTick(async()=>{l.value.showLoading("加载中"),await z(I.param||{})})},W=async()=>{if(r.value?.ok){ye(!0);const I=await r.value.ok();I&&(l.value.close(),F&&await F(I)),ye(!1)}},j=()=>{r.value?.closed&&r.value.closed(),A&&A()},G=()=>{g&&g()};return e.provide("jcode_auth_page_provide",{getPageName:m}),n({open:$}),(I,L)=>{const J=e.resolveComponent("j-layer");return e.openBlock(),e.createBlock(J,{ref_key:"layerRef",ref:l,width:o.value,height:i.value,"before-close":E,"validate-steps":B,"is-step":b.value,steps:k.value,"has-btns":a.value,buttons:d.value,"btn-text":p.value,"destroy-on-close":f.value,"has-save-btn":s.value,"has-header":c.value,onOk:W,onClosed:j,onCancel:G},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h.value),e.mergeProps({ref_key:"componentRef",ref:r},y.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}})),St=P(e.defineComponent({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(t,{emit:n}){const l=t,o=n,i=e.ref(),a=e.computed(()=>se(l.modelValue)?[]:l.modelValue?.split(",")||[]),s=e.computed(()=>l.isStyleLoop?a.value?.map((f,r)=>{let h=l.colors[r%l.colors.length]||{};return h={...h,borderWidth:(h.borderWidth||0)+"px"},h})||[]:l.colors),c=f=>{p(),o("select",f)},p=()=>{i.value&&(a.value.push(i.value),i.value="",o("update:modelValue",a.value.join(",")),o("change",{value:a.value.join(",")}))},d=f=>{a.value.splice(f,1),o("update:modelValue",a.value.join(",")),o("change",{value:a.value.join(",")})};return(f,r)=>{const h=e.resolveComponent("el-tag"),y=e.resolveComponent("el-space"),u=e.resolveComponent("j-autocomplete");return e.openBlock(),e.createBlock(u,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=m=>i.value=m),class:"j-input-tag",options:t.options,style:{width:"100%"},readonly:t.readonly,placeholder:t.placeholder,size:t.size,onSelect:c,onKeyup:e.withKeys(p,["enter"])},{prefix:e.withCtx(()=>[e.createVNode(y,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,b)=>(e.openBlock(),e.createBlock(h,{key:b,type:"info",closable:!t.readonly,style:e.normalizeStyle(s.value[b]||{}),size:t.size,onClose:e.withModifiers(k=>d(b),["prevent"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size"])}}})),Vt=P(e.defineComponent({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){return Number(l.modelValue)},set(p){o("update:modelValue",p),o("change",{value:p})}}),a=e.computed(()=>l.texts?.map(p=>p.value)||[]),s=e.ref(0),c=p=>{s.value=p};return(p,d)=>{const f=e.resolveComponent("el-rate");return e.openBlock(),e.createBlock(f,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=r=>i.value=r),size:t.size,max:t.max,"allow-half":t.allowHalf,clearable:t.allowClear,disabled:t.readonly,"show-text":t.showText,texts:a.value,"show-score":t.showScore,onHoverChange:c},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}})),jt=P(e.defineComponent({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get(){return Number(l.modelValue)},set(a){o("update:modelValue",a),o("change",{value:a})}});return(a,s)=>{const c=e.resolveComponent("el-slider");return e.openBlock(),e.createBlock(c,{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=p=>i.value=p),min:t.min,max:t.max,disabled:t.readonly,step:t.step,"show-input":t.showInput,"show-input-controls":t.showInputControls,size:t.size,"input-size":t.size,"show-stops":t.showStops,"show-tooltip":t.showTooltip,"format-tooltip":t.formatTooltip,range:t.range,vertical:t.vertical,height:t.height,"aria-label":t.ariaLabel,"range-start-label":t.rangeStartLabel,"range-end-label":t.rangeEndLabel,"format-value-text":t.formatValueText,"tooltip-class":t.tooltipClass,placement:t.placement,marks:t.marks,"validate-event":t.validateEvent,persistent:t.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}})),Te=t=>t<1024?Se(t)+" B":t>=1024&&t<1048576?Se(t/1024)+" KB":t>=1048576&&t<1073741824?Se(t/1024/1024)+" MB":t>=1073741824?Se(t/1024/1024/1024)+" GB":"",sl=t=>{const n=window.open("_blank");n&&(n.location=t)},cl={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},rl=["src"],dl={class:"j-upload-dragItem-content"},ul={class:"j-upload-dragItem-mask"},fl=["src"],ml={class:"j-upload-imgItem-mask"},pl={class:"j-upload-item-content"},Nt=e.defineComponent({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(t){const{t:n}=e.inject("jcode_app_provide",{t:l=>l});return(l,o)=>{const i=e.resolveComponent("j-icon"),a=e.resolveComponent("el-text"),s=e.resolveComponent("j-button"),c=e.resolveComponent("el-progress"),p=e.resolveComponent("el-link");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-upload-list",{"j-upload-image-list":t.isUploadImg,"j-upload-drag-list":t.drag}])},[t.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showFileList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.list,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:"j-upload-dragItem"},[t.isUploadImg?(e.openBlock(),e.createElementBlock("div",cl,[e.createElementVNode("img",{src:d.url,style:{width:"100%"},alt:""},null,8,rl)])):(e.openBlock(),e.createBlock(i,{key:0,icon:"file-text",style:e.normalizeStyle({color:d.color?`var(${d.color})`:void 0}),size:72},null,8,["style"])),e.createElementVNode("div",dl,[e.createVNode(a,{ellipsis:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(n)(d.name)}${d.status==="unUpload"?"("+e.unref(n)("未传")+")":""}`),1)]),_:2},1024),e.createElementVNode("div",null,[d.status==="uploading"?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Te)(d.uploadSize))+"/",1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Te)(d.size)),1)]),_:2},1024)])]),e.withDirectives(e.createElementVNode("div",ul,[d.status==="done"||d.status==="unUpload"?(e.openBlock(),e.createBlock(s,{key:0,type:"link"},{icon:e.withCtx(()=>[e.createVNode(i,{icon:"eye",size:24,onClick:e.withModifiers(f=>t.previewFile(d),["stop"])},null,8,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),!t.readonly&&(d.status==="done"||d.status==="unUpload")?(e.openBlock(),e.createBlock(s,{key:1,icon:"delete",type:"link",danger:"",onClick:e.withModifiers(f=>t.deleteFile(d),["stop","prevent"])},null,8,["onClick"])):e.createCommentVNode("",!0)],512),[[e.vShow,d.status==="error"]]),d.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:d.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")],64)):t.isUploadImg?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.list,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:"j-upload-imgItem"},[d.status==="done"||d.status==="unUpload"?(e.openBlock(),e.createElementBlock("img",{key:0,src:d.url,style:{width:"100%"},alt:""},null,8,fl)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",ml,[d.status==="done"||d.status==="unUpload"?(e.openBlock(),e.createBlock(s,{key:0,type:"link"},{icon:e.withCtx(()=>[e.createVNode(i,{icon:"eye",size:24,onClick:e.withModifiers(f=>t.previewFile(d),["stop"])},null,8,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0),!t.readonly&&(d.status==="done"||d.status==="unUpload")?(e.openBlock(),e.createBlock(s,{key:1,type:"link",danger:""},{icon:e.withCtx(()=>[e.createVNode(i,{icon:"delete",size:24,onClick:e.withModifiers(f=>t.deleteFile(d),["stop","prevent"])},null,8,["onClick"])]),_:2},1024)):e.createCommentVNode("",!0)],512),[[e.vShow,d.status==="error"]]),d.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:1,"stroke-width":4,percent:d.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.list,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:"j-upload-item"},[e.createVNode(i,{icon:"file-text",style:e.normalizeStyle({color:d.color?`var(${d.color})`:void 0}),size:16},null,8,["style"]),e.createElementVNode("div",pl,[e.createVNode(p,{type:"primary",underline:"never",onClick:e.withModifiers(f=>t.previewFile(d),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(n)(d.name)}${d.status==="unUpload"?"("+e.unref(n)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),d.status==="uploading"?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Te)(d.uploadSize))+"/",1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Te)(d.size)),1)]),_:2},1024),d.status==="done"&&t.isShowSuccessIcon?(e.openBlock(),e.createBlock(i,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):e.createCommentVNode("",!0),t.readonly?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createBlock(i,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:e.withModifiers(f=>t.deleteFile(d),["stop","prevent"])},null,8,["onClick"])),[[e.vShow,d.status==="error"]]),d.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:d.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128))],2)}}}),hl={class:"j-upload"},gl={key:0},yl={style:{"margin-top":"8px"}},bl={key:0,style:{"margin-top":"4px"}},kl={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},Cl=["src"],Bl={key:1,class:"j-block"},wl=["src"],$t=P(e.defineComponent({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(t,{emit:n}){const l=t,o=n,{warning:i,error:a,createConfirm:s,t:c,apiUrl:p,token:d}=e.inject("jcode_app_provide",{t:V=>V}),{useFile:f}=e.inject("jcode_app_form_provide",{useFile:()=>({})}),{fileChunkedUpload:r,deleteFile:h}=f(),y=e.computed(()=>l.isUploadImg?l.accept||"image/*":l.accept),u=e.computed(()=>{if(l.limit!==-1)return l.limit}),m=e.computed(()=>l.limit===-1?"":`,${c("上传数量")}${l.limit}`),b=e.ref(""),k=e.computed(()=>({folderId:l.modelValue||b.value,maxSize:l.maxSize,sizeType:l.sizeType})),B=e.ref([]),E=()=>{B.value=[...B.value]},F=V=>{if(l.maxSize&&l.sizeType){let O=V;switch(l.sizeType){case"GB":O=1024*1024*1024*l.maxSize;break;case"MB":O=1024*1024*l.maxSize;break;case"KB":O=1024*l.maxSize;break;default:O=l.maxSize;break}if(O<V)return!1}return!0},A={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},g=V=>{if(V){const O=V.split(".");return O[O.length-1]}return""},w=(V,O)=>{if(O&&O.indexOf("image")>-1)return"file-image";const U=g(V);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(U)?"file-image":A[U]||"file-ufo"},z=V=>{V.status=l.autoUpload?"uploading":"unUpload",V.uploadSize=0,V.icon=w(V.name,V.type),r||(V.icon="file-text"),V.id=V.uid,V.url=window.URL.createObjectURL(V),V.date=Ve(),V.param=k.value},$=V=>{o("start",{file:V,list:B.value})},W=(V,O,U)=>{V.percent=U,V.uploadSize=O,E()},j=V=>{V.status="done",V.id+="1",V.uid+="1",E(),o("success",{file:V,list:B.value}),l.modelValue||(o("update:modelValue",b.value),o("change",{value:b.value}))},G=(V,O)=>{console.error(O,"简搭提醒您:文件上传错误!"),V.status="error",E(),o("error",{file:V,list:B.value})},I=V=>{if(B.value.push(V),V.status==="unUpload"){o("notUploadChange",{value:V.url});return}!l.isNotApi&&l.upload?l.upload(V):!l.isNotApi&&r?r(V,{onStart:$,onProgress:W,onSuccess:j,onError:G,uploadCallback:l.uploadCallback}):j(V)},L=V=>{if(!F(V.size))return a&&a("上传文件超出大小了"),!1},J=V=>{z(V.file),I(V.file)},v=V=>new Promise(O=>{s?s({title:"提示",iconType:"warning",content:`您确定删除【${V.name}】?`,onOk:()=>{O(!0)},onCancel:()=>{O(!1)}}):(X(V),O(!0))}),X=V=>{if(!l.isNotApi){const O=V.response?.fileId||V.id;h&&h(O)}B.value=B.value.filter(O=>O.id!==V.id),B.value.length===0&&(o("update:modelValue",""),o("change",{value:""})),o("delete",{file:V,list:B.value})},H=async V=>{await v(V)&&X(V)},ce=e.ref(!1),Y=e.ref(""),oe=e.ref(""),ue=e.ref(!1),fe=e.ref(!1);let D=null;const ne=e.ref(Ve(new Date,"YYYY-MM-DD")),ee=V=>{if(V.isPreview===!1&&!l.isUploadImg){i&&i("无权限预览!");return}const O=V.name.split(".")[V.name.split(".").length-1];switch(D=V,ce.value=!1,Y.value=V.name,O.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":ce.value=!0,oe.value=V.url,fe.value=!1,ue.value=!0;break;default:if(l.isNotApi){i&&i("预览表单中,不支持预览!");return}if(V.status!=="done"){i&&i("当前文件还没上传成功,不支持预览!");return}if(oe.value=Q(V),oe.value===""){i&&i("当前文件不支持预览!");return}fe.value=!0,ue.value=!0;break}ne.value=Ve(new Date,"YYYY-MM-DD HH:mm:ss")},Q=V=>{const O=V.response?.fileId||V.id;if(!p)return"";const U=Ve(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+O,_=nt.createAesEncryption({key:"jianda"}).encrypt(U).replace(/\//g,"|");return`${p}/system/annexesfile/preview/${_}?token=${d?.value}`},le=()=>{D.isDown===!1&&i&&i("无权限下载!");const V=D.response?.fileId||D.id,O=`${p}/system/annexesfile/${V}?token=${d?.value}`;sl(O)},ie=()=>{if(l.limit!==-1&&l.limit<=B.value.length)return i&&i(`当前限制选择${l.limit}个文件`),!1};return(V,O)=>{const U=e.resolveComponent("j-icon"),_=e.resolveComponent("j-button"),re=e.resolveComponent("el-popover"),de=e.resolveComponent("el-upload"),Z=e.resolveComponent("el-text"),Ae=e.resolveComponent("j-dialog-full"),Re=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",hl,[e.createVNode(de,{action:"",drag:t.drag,disabled:t.readonly,"show-file-list":t.isUploadImg&&!t.isLayer&&t.showFileList,"list-type":t.isUploadImg&&!t.isLayer?"picture-card":void 0,accept:y.value,limit:u.value,multiple:t.multiple,"before-upload":L,"http-request":J,"file-list":B.value,"before-remove":v,"on-remove":X,"on-preview":ee,"on-exceed":ie},{default:e.withCtx(()=>[t.isUploadImg&&!t.isLayer&&!t.readonly?(e.openBlock(),e.createElementBlock("div",gl,[e.createVNode(U,{icon:"material-symbols-light:add-2-rounded"}),e.createElementVNode("div",yl,e.toDisplayString(e.unref(c)(t.placeholder)),1)])):t.isLayer&&t.showFileList&&B.value.length>0&&!ue.value?(e.openBlock(),e.createBlock(re,{key:1,placement:"bottom",title:t.isUploadImg?e.unref(c)("图片列表"):e.unref(c)("文件列表")},{content:e.withCtx(()=>[e.createVNode(Nt,{style:e.normalizeStyle({width:t.isUploadImg?void 0:"400px"}),list:B.value,"preview-file":ee,"delete-file":H,"is-upload-img":t.isUploadImg,readonly:t.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:e.withCtx(()=>[e.createVNode(_,{type:t.btnType,size:t.btnSize,icon:"material-symbols-light:upload-rounded",label:t.readonly?e.unref(c)(t.btnText):t.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:2,type:t.btnType,size:t.btnSize,icon:"material-symbols-light:upload-rounded",label:t.placeholder},null,8,["type","size","label"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),t.isTip?(e.openBlock(),e.createElementBlock("div",bl,[e.createVNode(Z,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(c)("只能上传不超过{0}的{1}文件",`${t.maxSize}${t.sizeType}`,`${y.value||""}`)},${m.value}`),1)]),_:1})])):e.createCommentVNode("",!0),!t.isLayer&&!t.isUploadImg&&t.showFileList&&B.value.length>0?(e.openBlock(),e.createBlock(Nt,{key:1,style:{"margin-top":"4px"},list:B.value,"preview-file":ee,"delete-file":H,readonly:t.readonly,"is-show-success-icon":t.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):e.createCommentVNode("",!0),e.createVNode(Ae,{visible:ue.value,"onUpdate:visible":O[1]||(O[1]=Me=>ue.value=Me),"btn-text":"下载",title:`${e.unref(c)("文件预览")}【${Y.value}】`,"destroy-on-close":!0,"has-btns":!!e.unref(p),onOk:le},{default:e.withCtx(()=>[ce.value&&oe.value?(e.openBlock(),e.createElementBlock("div",kl,[e.createElementVNode("img",{width:"100%",style:{"max-width":"1024px"},src:oe.value,alt:""},null,8,Cl)])):oe.value!=""?e.withDirectives((e.openBlock(),e.createElementBlock("div",Bl,[e.createElementVNode("iframe",{ref:"iframe",src:oe.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:O[0]||(O[0]=Me=>fe.value=!1)},null,40,wl)])),[[Re,fe.value]]):e.createCommentVNode("",!0)]),_:1},8,["visible","title","has-btns"])])}}})),zt=P(((t,n)=>{const l=t.__vccOpts||t;for(const[o,i]of n)l[o]=i;return l})(e.defineComponent({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(t,{expose:n,emit:l}){const o=t,i=l,a=e.ref(),s=e.shallowRef();let c=null,p=null;const d=async()=>{a.value&&(s.value=mo.init(a.value,o.theme,o.initOptions),f(o.option),s.value&&s.value.on("click",u=>{i("click",u)}),c=new ResizeObserver(()=>{s.value?.resize()}),c.observe(a.value),s.value&&i("ready",s.value))},f=u=>{s.value&&(p&&clearTimeout(p),o.updateDelay>0?p=setTimeout(()=>{s.value?.setOption(u,o.notMerge)},o.updateDelay):s.value.setOption(u,o.notMerge))};return e.watch(()=>o.option,u=>{f(u)},{deep:!0}),e.onMounted(()=>{d()}),e.onUnmounted(()=>{p&&clearTimeout(p),c&&a.value&&(c.unobserve(a.value),c.disconnect(),c=null),s.value&&(s.value.dispose(),s.value=void 0)}),n({getInstance:()=>s.value,resize:u=>{s.value?.resize(u)},clear:()=>{s.value?.clear()}}),(u,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"chartRef",ref:a,class:"j-echarts"},null,512))}}),[["__scopeId","data-v-d0771090"]])),xl=["src"],Et=P(e.defineComponent({name:"JBarcode",__name:"barcode",props:{modelValue:{default:void 0},format:{default:"CODE128"},width:{default:2},height:{default:100},displayValue:{type:Boolean,default:!0},text:{default:void 0},fontOptions:{default:""},font:{default:"monospace"},textAlign:{default:"center"},textPosition:{default:"bottom"},textMargin:{default:2},fontSize:{default:20},background:{default:"#ffffff"},color:{default:"#000000"},margin:{default:0},marginTop:{default:void 0},marginRight:{default:void 0},marginBottom:{default:void 0},marginLeft:{default:void 0},flat:{type:Boolean,default:!1},size:{default:400},correctLevel:{default:0},autoColor:{type:Boolean,default:!0},backgroundImage:{default:void 0},backgroundDimming:{default:void 0},gifBackground:{default:void 0},whiteMargin:{type:Boolean,default:!0},logoImage:{default:void 0},logoScale:{default:.2},logoMargin:{default:6},logoCornerRadius:{default:8}},setup(t){const n=t,l=e.ref(),o=e.ref(1),i=e.ref(""),a=e.computed(()=>{const c={};return n.format==="qr"?(c.text=n.modelValue+"",c.size=n.size,c.margin=n.margin,c.correctLevel=n.correctLevel,c.colorDark=n.color,c.colorLight=n.background,c.autoColor=n.autoColor,c.backgroundImage=n.backgroundImage,c.backgroundDimming=n.backgroundDimming,c.gifBackground=n.gifBackground,c.whiteMargin=n.whiteMargin,c.logoImage=n.logoImage,c.logoScale=n.logoScale,c.logoMargin=n.logoMargin,c.logoCornerRadius=n.logoCornerRadius):(c.format=n.format,c.width=n.width,c.height=n.height,c.text=n.text,c.fontOptions=n.fontOptions,c.textAlign=n.textAlign,c.textPosition=n.textPosition,c.textMargin=n.textMargin,c.fontSize=n.fontSize,c.background=n.background,c.lineColor=n.color,c.margin=n.margin,c.marginTop=n.marginTop,c.marginRight=n.marginRight,c.marginBottom=n.marginBottom,c.marginLeft=n.marginLeft,c.displayValue=n.displayValue,c.flat=n.flat),c}),s=()=>{if(n.format==="qr"){if(!window.AwesomeQR){console.error("缺少awesome-qr.js");return}new window.AwesomeQR.AwesomeQR(a.value).draw().then(c=>{i.value=c,o.value++}).catch(c=>{console.error(c)})}else l.value?se(n.modelValue)||co(l.value,n.modelValue+"",a.value):se(n.modelValue)||setTimeout(()=>{s()},100)};return e.watch(()=>[n.modelValue],()=>{setTimeout(()=>{s()},100)},{immediate:!0}),e.watch(a,()=>{s()}),(c,p)=>i.value||t.format!="qr"&&!e.unref(se)(t.modelValue)?(e.openBlock(),e.createElementBlock("img",{key:o.value,ref_key:"barcodeRef",ref:l,src:i.value},null,8,xl)):e.createCommentVNode("",!0)}})),Tt=P(e.defineComponent({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=(...g)=>{g=g.flat();let w=0;for(let z=0;z<g.length;z++)w+=g[z];return w/g.length},i=(g,w)=>w<0?-Math.ceil(g/Math.abs(w))*w||0:Math.ceil(g/w)*w||0,a=(...g)=>(g=g.flat(),g.length),s=(g,w)=>{let z=0;if(Array.isArray(g))if(/[><=]/.test(w)){const $=w.match(/^([><=]+)(.+)$/);if($){const W=$[1],j=Number($[2]);for(let G=0;G<g.length;G++)try{const I=Number(g[G]);let L=!1;switch(W){case">":L=I>j;break;case"<":L=I<j;break;case">=":L=I>=j;break;case"<=":L=I<=j;break;case"==":case"===":L=I===j;break;case"!=":case"!==":L=I!==j;break}L&&z++}catch{console.log("计算失败");break}}}else for(let $=0;$<g.length;$++)g[$]===w&&z++;return z},c=(g,w)=>g.toFixed(w),p=(g,w)=>w<0?-Math.floor(g/Math.abs(w))*w||0:Math.floor(g/w)*w||0,d=(g,w)=>{if(Array.isArray(g))return g.sort((z,$)=>$-z),g[w-1]},f=(g,w)=>{if(Array.isArray(g))return g.sort((z,$)=>z-$),g[w-1]},r=(g,w)=>Math.log(g)/Math.log(w),h=(g,w)=>g%w,y=(...g)=>{g=g.flat();let w=1;for(let z=0;z<g.length;z++)w*=g[z];return w},u=(g,w)=>{const z=g.toFixed(w);return Number(z)},m=(...g)=>{g=g.flat();let w=0;for(let z=0;z<g.length;z++)w+=Number(g[z]);return w},b=(...g)=>g[0].map(($,W)=>{let j=$;for(let G=1;G<g.length;G++)j*=g[G][W]||0;return j}).reduce(($,W)=>$+W,0),k=n,{getValue:B}=e.inject("jd_form_provide",{}),E=g=>{const w=B(g);if(Ne(w)){const $=[];return w.forEach(W=>{const j=Number(W);Number.isNaN(j)?$.push(0):$.push(j)}),$}const z=Number(w);return Number.isNaN(z)?0:z},F=e.computed(()=>{if(!B)return"";const g=JSON.parse(l.formatJson||"[]");let w="";for(let W=0;W<g.length;W++){const j=g[W];if(j.type==="fun"&&j.value!=="("&&j.value!==")")if(["abs","max","min","sqrt"].includes(j.value))w+=`Math.${j.value}`;else if(["int","power","rand"].includes(j.value))switch(j.value){case"int":w+="Math.floor";break;case"power":w+="Math.pow";break;case"rand":w+="Math.random";break}else w+=`${j.value}Fun`;else j.type==="comp"?w+=`getCompValue('${j.value}')`:j.value==="i"&&l.tableIndex!==void 0?w+=l.tableIndex:w+=j.value}if(!w)return"";w=`(
1
+ (function(M,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("crypto-js/aes"),require("crypto-js/enc-utf8"),require("crypto-js/pad-pkcs7"),require("crypto-js/enc-base64"),require("crypto-js/md5"),require("crypto-js/sha256"),require("crypto-js/sha512"),require("sortablejs"),require("@visactor/vtable"),require("echarts"),require("@bwip-js/browser"),require("countup.js"),require("sql-formatter"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lang-javascript"),require("@codemirror/lang-css"),require("@codemirror/lang-html"),require("@codemirror/lang-json"),require("@codemirror/lang-sql"),require("@codemirror/lang-xml"),require("@codemirror/lang-python"),require("@codemirror/lang-markdown"),require("@codemirror/lang-java"),require("@codemirror/autocomplete"),require("@codemirror/commands"),require("@codemirror/language"),require("async-validator"),require("@wangeditor/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","crypto-js/aes","crypto-js/enc-utf8","crypto-js/pad-pkcs7","crypto-js/enc-base64","crypto-js/md5","crypto-js/sha256","crypto-js/sha512","sortablejs","@visactor/vtable","echarts","@bwip-js/browser","countup.js","sql-formatter","codemirror","@codemirror/view","@codemirror/state","@codemirror/lang-javascript","@codemirror/lang-css","@codemirror/lang-html","@codemirror/lang-json","@codemirror/lang-sql","@codemirror/lang-xml","@codemirror/lang-python","@codemirror/lang-markdown","@codemirror/lang-java","@codemirror/autocomplete","@codemirror/commands","@codemirror/language","async-validator","@wangeditor/editor"],n):(M=typeof globalThis<"u"?globalThis:M||self,n(M.SimCodeUI={},M.Vue,M.IconifyVue,M.dayjs,M.CryptoJS.AES,M.CryptoJS.enc.Utf8,M.CryptoJS.pad.Pkcs7,M.CryptoJS.enc.Base64,M.CryptoJS.MD5,M.CryptoJS.SHA256,M.CryptoJS.SHA512,M.Sortable,M.VTable,M.echarts,M.bwipjs,M.CountUp,M.SqlFormatter,M.CodeMirror,M.CodeMirrorView,M.CodeMirrorState,M.CodeMirrorLangJavaScript,M.CodeMirrorLangCSS,M.CodeMirrorLangHTML,M.CodeMirrorLangJSON,M.CodeMirrorLangSQL,M.CodeMirrorLangXML,M.CodeMirrorLangPython,M.CodeMirrorLangMarkdown,M.CodeMirrorLangJava,M.CodeMirrorAutocomplete,M.CodeMirrorCommands,M.CodeMirrorLanguage,M.AsyncValidator,M.WangEditor))})(this,(function(M,n,ft,ji,vs,Vi,Cs,Ti,ks,xs,Ss,Bs,Es,_s,js,Vs,Ts,Ns,Ze,So,zt,$s,Ms,Ls,Ps,Rs,As,Os,Fs,Bo,Eo,Dt,Is,Ni){"use strict";function $i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const _o=$i(Es),zs=$i(_s),te=e=>(e.install=t=>{t.component(e.name,e)},e);function Mn(e){return e&&Array.isArray(e)}function Mi(e,t){return toString.call(e)===`[object ${t}]`}function Ds(e){return e!==null&&Mi(e,"Object")}const it=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0),Nt=n.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(e){const t=e,o=n.computed(()=>{const a=t.icon;if(a.indexOf(":")===-1)return ft.getIcon(`jcode:${t.icon}`)==null,`jcode:${t.icon}`;const r=`jcode:${a.split(":")[1]}`;return ft.getIcon(r)!=null?r:a}),i=n.computed(()=>({size:t.size,color:t.color,icon:o.value}));return(a,l)=>e.isDiv?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0},a.$attrs,{class:"j-icon jicon",style:{height:`${e.size}px`}}),[n.createVNode(n.unref(ft.Icon),n.mergeProps(i.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16)):(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1},a.$attrs,{class:"jicon"}),[n.createVNode(n.unref(ft.Icon),n.mergeProps(i.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),Hs=["disabled"],Ws={key:2},Li=te(n.defineComponent({name:"JButton",__name:"button",props:{type:{type:String,default:"default"},size:{type:String,default:"default"},shape:{type:String,default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:()=>!1},icon:{type:String,default:""},href:{type:String,default:""},target:{type:String,default:"_self"},label:{type:String,default:""},notLabel:{type:Boolean,default:!1},compact:Boolean,lastCompactItem:Boolean,firstCompactItem:Boolean},emits:["click"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=p=>{!f.value&&!i.disabled&&(a("click",p),i.href&&window.open(i.href,i.target?i.target:"_self"))},r=n.shallowRef(null),s=()=>{r.value?.focus()},d=()=>{r.value?.blur()},c=n.computed(()=>i.notLabel||!i.label),f=n.ref(!1);n.watch(()=>i.loading,p=>{if(typeof p=="boolean")f.value=p;else if(it(p?.delay))f.value=!1;else{const h=setTimeout(()=>{f.value=!0},p.delay);return()=>clearTimeout(h)}},{immediate:!0});const u=n.computed(()=>i.label||"");return t({focus:s,blur:d}),(p,h)=>(n.openBlock(),n.createElementBlock("button",{ref_key:"buttonNodeRef",ref:r,type:"button",class:n.normalizeClass(["j-button",{"j-button-primary":e.type=="primary","j-button-default":e.type=="default","j-button-dashed":e.type=="dashed","j-button-link":e.type=="link","j-button-text":e.type=="text","j-button-ghost":e.ghost==!0,"j-button-danger":e.danger==!0,"j-button-lg":e.size=="large","j-button-sm":e.size=="small","j-button-circle":e.shape=="circle","j-button-round":e.shape=="round","j-button-block":e.block==!0,"j-button-loading":f.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":e.compact==!0,"j-button-last-compact-item":e.lastCompactItem==!0,"j-button-first-compact-item":e.firstCompactItem==!0}]),disabled:e.disabled,onClick:n.withModifiers(l,["stop"])},[f.value?(n.openBlock(),n.createBlock(Nt,{key:0,icon:"mdi:loading",size:e.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):n.createCommentVNode("",!0),e.icon?(n.openBlock(),n.createBlock(Nt,{key:1,icon:e.icon},null,8,["icon"])):n.createCommentVNode("",!0),e.notLabel?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Ws,n.toDisplayString(u.value),1)),n.renderSlot(p.$slots,"iconAfter")],10,Hs))}}));function cn(e){Object.keys(e||{}).forEach(t=>{delete e[t]})}function Pi(e){const{toString:t}=Object.prototype,o={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&e instanceof Element?"element":o[t.call(e)]}function pt(e){const t=Pi(e);let o;if(t==="array")o=[];else if(t==="object")o={};else return e;if(t==="array")for(let i=0,a=e.length;i<a;i++)e[i]=(e[i]===0,e[i]),e[i]&&delete e[i].$parent,o.push(pt(e[i]));else t==="object"&&Object.keys(e).forEach(i=>{e&&delete e.$parent,o[i]=pt(e[i])});return o}function Ln(e,t,o=[]){Object.keys(t).forEach(i=>{o.indexOf(i)===-1&&(e[i]=t[i])})}const dn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=Math.random()*16|0;return(t==="x"?o:o&3|8).toString(16)});let jo=0;function Pn(e=""){const t=Date.now(),o=Math.floor(Math.random()*1e9);return jo++,e?e+"_"+o+jo+String(t):o+jo+String(t)}const Vo=e=>{if(e)try{const t=new Function("return "+e)();return typeof t=="function"?{res:!0,msg:"ok",fn:t}:(console.warn("此方法不是一个函数",e),{res:!1,msg:"此方法不是一个函数"})}catch(t){return console.warn(t,e),{res:!1,msg:t}}else return{res:!1,msg:"没设置脚本函数"}};function Ri(e,t,o){if(!e||typeof e!="object")return e;const i=Array.isArray(t)?t:t.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(i.length===0)return e;let a=e;for(let l=0;l<i.length-1;l++){const r=i[l],s=i[l+1];(!(r in a)||typeof a[r]!="object"||a[r]===null)&&(a[r]=/^\d+$/.test(s)?[]:{}),a=a[r]}return a[i[i.length-1]]=o,e}const un=e=>{let t=parseFloat(e);return isNaN(t)?0:(t=Math.round(e*100)/100,t)},Us=function(e,t,o){const i=(e-1)*t;return i+t>=o.length?o.slice(i,o.length):o.slice(i,i+t)},Js=function(e,t){const o=(e.page-1)*e.rows,i=o+e.rows>=t.length?t.slice(o,t.length):t.slice(o,o+e.rows);return{rows:i,total:t.length,page:e.page,records:i.length}},Ys=function(e){return e.filter((t,o,i)=>i.indexOf(t,0)===o)},Ai=e=>{if(!/^\d*(\.\d*)?$/.test(e))return"Number is wrong!";const t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],o=["","十","百","千","万","亿","点",""],i=(""+e).replace(/(^0*)/g,"").split(".");let a=0,l="";for(let r=i[0].length-1;r>=0;r--){switch(a){case 0:l=o[7]+l;break;case 4:new RegExp("0{4}\\d{"+(i[0].length-r-1)+"}$").test(i[0])||(l=o[4]+l);break;case 8:l=o[5]+l,o[7]=o[5],a=0;break}a%4===2&&i[0].charAt(r+2)!=="0"&&i[0].charAt(r+1)==="0"&&(l=t[0]+l),i[0].charAt(r)!=="0"&&(l=t[Number(i[0].charAt(r))]+o[a%4]+l),a++}if(i.length>1){l+=o[6];for(let r=0;r<i[1].length;r++)l+=t[Number(i[1].charAt(r))]}return l},Oi=e=>{const t=(e+"").split("."),o=t[0]+"",i=t[1]||"",a=o.length%3;let l=o.substring(0,a);for(let r=0;r<Math.floor(o.length/3);r++)l+=","+o.substring(a+r*3,a+(r+1)*3);return a===0&&(l=l.substring(1)),e=l+(i?"."+i:""),e},fn=e=>{if(!e)return;if(typeof document>"u"||!document.body)return e.length*7;const t=document.createElement("span");t.style.fontSize="14px",t.style.visibility="hidden",t.style.position="absolute",t.innerText=e,document.body.appendChild(t);const o=t.offsetWidth;return document.body.removeChild(t),o};function Fi(e){return e==null||e===void 0||e===""?"":e===e.toUpperCase()?e.split("_").map(i=>(i=i.toLowerCase(),i.slice(0,1).toUpperCase()+i.slice(1))).join(""):e.slice(0,1).toUpperCase()+e.slice(1)}function qs(e,t=!0){if(e==null||e===void 0||e==="")return"";t&&(e=Fi(e));let o="";for(let i=0,a=e.length;i<a&&(o+=e[i].toLowerCase(),!(i<a-1&&e[i+1]===e[i+1].toLowerCase()||i<a-2&&e[i+2]===e[i+2].toLowerCase()));i++);if(o.length<e.length)for(let i=o.length,a=e.length;i<a;i++)o+=e[i];return o}function Ii(e,t,o){const i={},a={};return e.forEach(l=>{i[l[o]]=i[l[o]]||[],i[l[o]].push(l),a[l[t]]=l}),{group:i,map:a}}function To(e,t,o,i,a,l){const r=[];return e==null?Object.keys(t.group).forEach(s=>{(!l||l.indexOf(s)===-1)&&(t.map[s]||t.group[s].forEach(c=>{(!l||l.indexOf(c[o])===-1)&&(i&&(c.value=c[i]),a&&(c.label=c[a]),t.group[c[o]]&&t.group[c[o]].length>0&&(c.children=To(t.group[c[o]],t,o,i,a,l)),r.push(c))}))}):e.forEach(s=>{(!l||l.indexOf(s[o])===-1)&&(i&&(s.value=s[i]),a&&(s.label=s[a]),t.group[s[o]]&&t.group[s[o]].length>0&&(s.children=To(t.group[s[o]],t,o,i,a,l)),r.push(s))}),r}function Gs(e,t,o,i,a,l){if(e.length===0||!t&&!e[0]._id)return e;const r=t||"_id";o=o||"_pid";let s=[],d={};if(i?e.forEach(f=>{d[f[i]]||(d[f[i]]=!0,s.push(pt(f)))}):s=e,d={},r===o){const f=[];return s.forEach(u=>{(!l||l.indexOf(u[r])===-1)&&(i&&(u.value=u[i]),a&&(u.label=u[a]),f.push(u))}),f}const c=Ii(s,r,o);return To(null,c,r,i,a,l)}const zi=(e,t,o,i)=>{o=o||[];for(let a=0,l=o.length;a<l;a++){const r=o[a],s={};s._id=r.prop||`${t}_${a}`,s._pid=t,Object.keys(r).forEach(c=>{(!i||i.indexOf(c)===-1)&&(s[c]=r[c])}),e.push(s);const d=r.children||[];d.length>0&&(s._hasChildren=!0,zi(e,s._id,d))}},Di=(e,t)=>{const o=[];return zi(o,"0",e,t),o},Hi=(e,t,o,i)=>{t=t||[];for(let a=0,l=t.length;a<l;a++){const r=t[a],s={value:r[o],label:r[i]};e.push(s);const d=r.children||[];d.length>0&&(s.children=[],Hi(s.children,d,o,i))}},Ks=(e,t,o)=>{const i=[];return Hi(i,e,t||"value",o||"label"),i},Wi=(e,t,o,i="",a)=>{t=t||[];for(let l=0,r=t.length;l<r;l++){const s=t[l],d=o(s),c=i?`${i}.${d}`:d,f=s.children||[];if(f.length>0)Wi(e,f,o,c,a);else{const u={};Object.keys(s).forEach(p=>{(!a||a.indexOf(p)===-1)&&(u[p]=s[p])}),u.label=c,e.push(u)}}},Ui=(e,t,o)=>{const i=[];return Wi(i,e,t,"",o),i},Rn=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-slider-captcha","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,Ji=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,$t=e=>{const t=e.config||{};if(e.getCompConfig){const o=e.getCompConfig({config:t,formData:e.formData,row:e.row,tableData:e.tableData,pRowData:e.pRowData})||{};for(const i in t)o[i]=t[i];return o}return t},No=e=>e.getCompType?e.getCompType({config:e.config,formData:e.formData,row:e.row,tableData:e.tableData}):e.type,Yi=(e,t,o)=>{const i=$t(o),a=No({...o,config:i});if(a==="j-autocomplete")return e;if(i&&i.options){if(e?.split){const l=e.split(","),r=Di(i.options);return l.map(s=>r.find(d=>d.value===s)?.label).join(a==="j-cascader-select"?"/":",")}return i.options.find(l=>l.value===e)?.label}else if(t)return t(e,a,i);return e},Xs="YYYY-MM-DD HH:mm:ss",Zs="YYYY-MM-DD";function qi(e,t=Xs){return ji(e).format(t)}function pn(e,t=Zs){return ji(e).format(t)}function Gi(e){const t="j-loading-spin",o=document.querySelector(`.${t}`);if(e){if(!o){document.body.style.overflow="hidden";const i=new DocumentFragment,a=document.createElement("div");a.className=t;const l=document.createElement("span");l.className="j-loading-spin-dot";for(let r=0;r<4;r++){const s=document.createElement("i");l.appendChild(s)}a.appendChild(l),i.appendChild(a),document.body.appendChild(i)}}else o&&o.parentNode&&(document.body.style.overflow="",o.parentNode.removeChild(o))}const Qs=(()=>{let e=null,t=0;return o=>{o?(t++,e&&clearTimeout(e),Gi(!0),e=null):(t=Math.max(0,t-1),t===0&&(e&&clearTimeout(e),e=setTimeout(()=>{Gi(!1),e=null},400)))}})();function Ht(e){Qs(e)}const{decrypt:Ki,encrypt:ec}=vs,An=Vi,Xi=Vi.parse,Zi=(e,t=32)=>{const{length:o}=e;if(o<t){for(let i=0,a=t-o;i<a;i++)e+="0";return e}return o>t?e.substring(0,t):e};class tc{key;iv;constructor({key:t,iv:o}){this.key=Xi(Zi(t)),this.iv=Xi(Zi(o||"1234567890000000",16))}get getOptions(){return{padding:Cs,iv:this.iv}}encrypt(t){return ec(t,this.key,this.getOptions).toString()}decrypt(t){return Ki(t,this.key,this.getOptions).toString(An)}}class Wt{static instance;constructor(){}static getInstance(){return Wt.instance||(Wt.instance=new Wt),Wt.instance}encrypt(t){return An.parse(t).toString(Ti)}decrypt(t){return Ti.parse(t).toString(An)}}class Ut{static instance;constructor(){}static getInstance(){return Ut.instance||(Ut.instance=new Ut),Ut.instance}hash(t){return ks(t).toString()}}class Jt{static instance;constructor(){}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}hash(t){return xs(t).toString()}}class Yt{static instance;constructor(){}static getInstance(){return Yt.instance||(Yt.instance=new Yt),Yt.instance}hash(t){return Ss(t).toString()}}class Qi{static createAesEncryption(t){return new tc(t)}static createBase64Encryption(){return Wt.getInstance()}}class nc{static createMD5Hashing(){return Ut.getInstance()}static createSHA256Hashing(){return Jt.getInstance()}static createSHA512Hashing(){return Yt.getInstance()}}const oc=(e,t)=>Ki(e,t).toString(An);function ea(e,t){function o(){n.nextTick(()=>{e=n.unref(e),e&&Bs.create(e,{animation:100,delay:400,delayOnTouchOnly:!0,...t})})}return{initSortable:o}}const ta=async e=>new Promise((t,o)=>{if(typeof window.BMap<"u"){t(window.BMap);return}window.onBMapCallback=function(){t(window.BMap)};const i=document.createElement("script");i.type="text/javascript",i.src=`https://api.map.baidu.com/api?v=3.0&ak=${e||"dPHQKHyFl1GmMBjGVbVCSs6GSrswTuPQ"}&callback=onBMapCallback`,i.onerror=o,document.head.appendChild(i)});function ic(e){const t=i=>{e.value.open(i)};return{handleClick:i=>{if(!i.disabled){if(i.layerName){i.layerGetParam&&(i.layerParam=i.layerGetParam()),t({title:i.layerTitle,name:i.layerName,width:i.layerWidth||1e3,height:i.layerHeight||600,afterOk:i.afterOk||null,afterClose:i.afterClose||null,formConfig:i.layerFormConfig||{},param:i.layerParam||{},type:i.layerType,hasBtns:i.layerHasBtns});return}i.click&&i.click({handleOpenForm:t})}}}}const na=te(n.defineComponent({name:"JButtons",__name:"index",props:{list:{type:Array,default:()=>[]},group:{type:Object,default:()=>({})},isLink:Boolean,size:{type:String,default:"default"},readonly:Boolean},setup(e){const t=e,o=n.computed(()=>{if(Object.keys(t.group).length>0)return t.group;const l={},r=pt(t.list),s=r.length;for(let d=0;d<s;d++){const c=r[d];c.groupId=c.groupId||Pn(),l[c.groupId]=l[c.groupId]||[],l[c.groupId].push(c)}return l}),i=n.ref(),{handleClick:a}=ic(i);return(l,r)=>{const s=n.resolveComponent("j-button"),d=n.resolveComponent("el-space"),c=n.resolveComponent("el-dropdown"),f=n.resolveComponent("j-dynamic-layer");return n.openBlock(),n.createBlock(d,{style:n.normalizeStyle({display:e.readonly?"none":""}),size:e.isLink?0:8},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(u,p)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:p},{ref_for:!0},l.$attrs),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u,(h,m)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[h.children?.length&&h.children?.length>0?(n.openBlock(),n.createBlock(c,{key:0},{dropdown:n.withCtx(()=>[n.createVNode(d,{direction:"vertical"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.children||[],g=>(n.openBlock(),n.createBlock(s,{key:g.prop,label:g.label,type:"text",danger:g.danger,size:e.size,disabled:g.disabled,icon:g.icon,onClick:n.withModifiers(b=>n.unref(a)(g),["stop"])},null,8,["label","danger","size","disabled","icon","onClick"]))),128))]),_:2},1024)]),default:n.withCtx(()=>[n.createVNode(s,{label:h.label,type:e.isLink?"link":h.type,danger:h.danger,size:e.size,icon:h.icon,onClick:n.withModifiers(g=>n.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","onClick"])]),_:2},1024)):(n.openBlock(),n.createBlock(s,{key:1,label:h.label,type:e.isLink?"link":h.type,danger:h.danger,size:e.size,icon:h.icon,compact:!0,"last-compact-item":m===u.length-1,"first-compact-item":m===0,onClick:n.withModifiers(g=>n.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128)),n.createVNode(f,{ref_key:"layerRef",ref:i},null,512)]),_:1},8,["style","size"])}}})),oa=te(n.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{},autoFocus:{type:Boolean}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed({get(){return o.modelValue},set(u){i("update:modelValue",u)}}),r=u=>{i("input",u)},s=u=>{i("focus",u)},d=u=>{i("blur",u)},c=()=>{i("clear")},f=u=>{i("change",u)};return n.onMounted(()=>{o.autoFocus&&a.value.focus()}),(u,p)=>{const h=n.resolveComponent("j-icon"),m=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(m,n.mergeProps({ref_key:"inputRef",ref:a,modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=g=>l.value=g),type:e.type,"model-modifiers":e.modelModifiers,maxlength:e.maxlength,minlength:e.minlength,"show-word-limit":e.showWordLimit,"word-limit-position":e.wordLimitPosition,placeholder:e.placeholder,clearable:e.clearable,"clear-icon":e.clearIcon,formatter:e.formatter,parser:e.parser,"show-password":e.showPassword,disabled:e.disabled,size:e.size,rows:e.rows,autosize:e.autosize,autocomplete:e.autocomplete,name:e.name,readonly:e.readonly,max:e.max,min:e.min,step:e.step,resize:e.resize,autofocus:e.autofocus,form:e.form,"aria-label":e.ariaLabel,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle,label:e.label,inputmode:e.inputmode},u.$attrs,{onInput:r,onFocus:s,onBlur:d,onClear:c,onChange:f}),n.createSlots({_:2},[e.prefixIcon?{name:"prefix",fn:n.withCtx(()=>[n.createVNode(h,{icon:e.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,e.suffixIcon?{name:"suffix",fn:n.withCtx(()=>[n.createVNode(h,{icon:e.suffixIcon},null,8,["icon"])]),key:"1"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}})),ia=te(Nt),ac={key:1},aa=te(n.defineComponent({name:"JRadio",__name:"radio",props:{modelValue:{type:[String],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){let l=o.options;if(!it(o.modelValue)&&l&&l.length>0){let r=o.modelValue+"",s=o.options.find(d=>d.value+""===r);if(s)return s.value}return o.modelValue},set(l){i("update:modelValue",l)}});return(l,r)=>{const s=n.resolveComponent("el-radio-button"),d=n.resolveComponent("el-tag"),c=n.resolveComponent("el-radio"),f=n.resolveComponent("el-radio-group");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=u=>a.value=u),disabled:e.readonly},{default:n.withCtx(()=>[e.isButton?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(s,{key:u.value,value:u.value,size:e.size},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u.label),1)]),_:2},1032,["value","size"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.options,(u,p)=>(n.openBlock(),n.createBlock(c,{key:u.value,value:u.value,size:e.size},{default:n.withCtx(()=>[e.isColor?(n.openBlock(),n.createBlock(d,{key:0,color:e.colors[p]||u.color||"",size:e.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u.label),1)]),_:2},1032,["color","size"])):(n.openBlock(),n.createElementBlock("span",ac,n.toDisplayString(u.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}})),lc={class:"j-select-input-label-wrapper"},rc={class:"j-select-option-wrapper"},sc={class:"j-select-option-wrapper"},la=te(n.defineComponent({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed({get(){return o.multiple&&typeof o.modelValue=="string"?o.modelValue?.split(",")||[]:o.modelValue},set(u){o.multiple&&Array.isArray(u)&&(u=u?.join(",")||[]),i("update:modelValue",u)}}),r=n.computed(()=>!it(l.value)&&!o.multiple&&o.options.filter(u=>l.value==u.value).map(u=>u.label).join(",")||""),s=n.computed(()=>!it(l.value)&&!o.multiple?o.options.find(u=>u.value===l.value)?.icon:""),d=n.computed(()=>typeof o.selectData=="string"?o.selectData?.split(",")||[]:[]),c=n.computed(()=>{let u=[];if(o.isSelectOnlyone?u=o.options.map(p=>({...p,disabled:d.value.includes(p.value)})):u=o.options,o.isGroup){const p=[],h={};return u.forEach(m=>{let g={};const b=m[o.groupKey||""]||"";h[b]||(g.value=b,g.label=b,h[b]=[],g.children=h[b],p.push(g));const k={value:m.value,label:m.label,icon:m.icon,disabled:m.disabled};h[b].push(k)}),p}return u}),f=u=>{if(o.multiple){if(u.length==0){i("change",void 0);return}const p=[];u.forEach(h=>{const m=o.options.find(g=>g.value==h);m&&p.push(m)}),i("change",p)}else{if(u==""||u==null||u==null){i("change",void 0);return}const p=o.options.find(h=>h.value==u);i("change",p)}};return n.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value.toggleMenu()},50)}),(u,p)=>{const h=n.resolveComponent("el-tooltip"),m=n.resolveComponent("el-option"),g=n.resolveComponent("el-option-group"),b=n.resolveComponent("el-select");return n.openBlock(),n.createBlock(b,n.mergeProps({ref_key:"selectRef",ref:a},u.$attrs,{modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=k=>l.value=k),class:[{"no-border":e.noBorder,"rows-background":e.isRows}],teleported:e.teleported,size:e.size,disabled:e.disabled||e.readonly,multiple:e.multiple,clearable:e.clearable,filterable:e.filterable,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,placeholder:e.placeholder,onChange:f}),n.createSlots({default:n.withCtx(()=>[e.isGroup?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(c.value,k=>(n.openBlock(),n.createBlock(g,{key:k.label,label:k.label},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.children,v=>(n.openBlock(),n.createBlock(m,{key:v.value,label:v.label,value:v.value||" ",disabled:!!v.disabled},{default:n.withCtx(()=>[n.createElementVNode("div",rc,[v.icon?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:v.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(v.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(c.value,k=>(n.openBlock(),n.createBlock(m,{key:k.value,label:k.label,value:k.value+"",disabled:!!k.disabled},{default:n.withCtx(()=>[n.createElementVNode("div",sc,[k.icon?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:k.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(k.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[e.multiple?void 0:{name:"label",fn:n.withCtx(()=>[n.createElementVNode("div",lc,[s.value?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:s.value},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,[e.isShowTooltip?(n.openBlock(),n.createBlock(h,{key:0,content:r.value,placement:"top"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.value),1)]),_:1},8,["content"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}})),ra=te(n.defineComponent({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(null),l=o;t({getCheckedNodes:(u=!1)=>a.value?.getCheckedNodes(u),clearCheckedNodes:()=>{a.value?.cascaderPanelRef?.value?.clearCheckedNodes()}});const d=n.computed({get(){return it(i.modelValue)?[]:i.modelValue?.split(",")||[]},set(u){l("update:modelValue",it(u)?"":u.join(","))}}),c=(u,p)=>{d.value=u,l("change",{value:it(u)?"":u.join(","),data:p})},f=n.computed(()=>({checkStrictly:i.checkStrictly,expandTrigger:i.expandTrigger,multiple:i.multiple,emitPath:i.emitPath,lazy:i.lazy,lazyLoad:i.lazyLoad,hoverThreshold:i.hoverThreshold,checkOnClickNode:i.checkOnClickNode,checkOnClickLeaf:i.checkOnClickLeaf,showPrefix:i.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return n.onMounted(()=>{i.autoFocus&&setTimeout(()=>{a.value.togglePopperVisible()},50)}),(u,p)=>{const h=n.resolveComponent("el-cascader");return n.openBlock(),n.createBlock(h,{ref_key:"cascaderRef",ref:a,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),props:f.value,options:e.options,placeholder:e.placeholder,disabled:e.disabled||e.readonly,clearable:e.clearable,"collapse-tags":e.collapseTags,"max-collapse-tags":e.maxCollapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,filterable:e.filterable,"show-all-levels":e.showAllLevels,separator:e.separator,size:e.size,onChange:c},null,8,["modelValue","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}})),sa=te(n.defineComponent({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"var(--j-color-primary)"},fill:{default:"var(--j-color-bg-container)"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return o.modelValue},set(r){i("update:modelValue",r)}}),l=r=>{i("change",r)};return(r,s)=>{const d=n.resolveComponent("el-checkbox"),c=n.resolveComponent("el-checkbox-button"),f=n.resolveComponent("el-checkbox-group");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=u=>a.value=u),disabled:e.disabled||e.readonly,size:e.size,min:e.min,max:e.max,"text-color":e.textColor,fill:e.fill,tag:e.tag,"validate-event":e.validateEvent,label:e.label,type:e.type,onChange:l},{default:n.withCtx(()=>[e.type==="checkbox"?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(d,{key:u.value,value:u.value,disabled:u.disabled,size:e.size,label:u.label},null,8,["value","disabled","size","label"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(c,{key:u.value,class:n.normalizeClass({"j-checkbox-notFillOrColor":!e.fill&&!e.textColor}),value:u.value,disabled:u.disabled,size:e.size,label:u.label},null,8,["class","value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}})),ca=te(n.defineComponent({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},controlsPosition:{default:"right"},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},label:{},inputmode:{},align:{default:"left"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{},autoFocus:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(),l=o,r=n.computed({get(){return i.modelValue},set(p){l("update:modelValue",p)}}),s=p=>{l("change",p)},d=()=>{l("blur")},c=()=>{l("focus")};return t({blur:()=>{a.value?.blur()},focus:()=>{a.value?.focus()}}),n.onMounted(()=>{i.autoFocus&&a.value?.focus()}),(p,h)=>{const m=n.resolveComponent("j-icon"),g=n.resolveComponent("el-input-number");return n.openBlock(),n.createBlock(g,{id:e.id,ref_key:"inputNumberRef",ref:a,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=b=>r.value=b),min:e.min,max:e.max,step:e.step,"step-strictly":e.stepStrictly,precision:e.precision,size:e.size,readonly:e.readonly||e.disabled,disabled:e.disabled||e.readonly,controls:e.controls,"controls-position":e.controlsPosition,"aria-label":e.ariaLabel,placeholder:e.placeholder,"value-on-clear":e.valueOnClear,label:e.label,inputmode:e.inputmode,align:e.align,"disabled-scientific":e.disabledScientific,onChange:s,onBlur:d,onFocus:c},n.createSlots({"decrease-icon":n.withCtx(()=>[e.decreaseIcon?(n.openBlock(),n.createBlock(m,{key:0,icon:e.decreaseIcon},null,8,["icon"])):n.createCommentVNode("",!0)]),"increase-icon":n.withCtx(()=>[e.increaseIcon?(n.openBlock(),n.createBlock(m,{key:0,icon:e.increaseIcon},null,8,["icon"])):n.createCommentVNode("",!0)]),_:2},[e.prefix?{name:"prefix",fn:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(e.prefix),1)]),key:"0"}:void 0,e.suffix?{name:"suffix",fn:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(e.suffix),1)]),key:"1"}:void 0]),1032,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","label","inputmode","align","disabled-scientific"])}}})),da=te(n.defineComponent({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","select","change","focus","blur"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(null),l=o,r=n.computed({get(){return i.modelValue||""},set(g){l("update:modelValue",g)}}),s=(g,b)=>{if(i.fetchSuggestions){i.fetchSuggestions(g,b);return}const k=g?i.options.filter(d(g)):i.options;b(k)},d=g=>b=>b?.[i.valueKey]?.toLowerCase().indexOf(g.toLowerCase())===0,c=g=>{l("select",g)},f=g=>{l("change",g)},u=()=>{l("focus")},p=()=>{l("blur")};return t({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()}}),n.onMounted(()=>{i.autoFocus&&setTimeout(()=>{a.value.focus()},50)}),(g,b)=>{const k=n.resolveComponent("el-autocomplete");return n.openBlock(),n.createBlock(k,{ref_key:"autocompleteRef",ref:a,modelValue:r.value,"onUpdate:modelValue":b[0]||(b[0]=v=>r.value=v),"fetch-suggestions":s,placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled||e.readonly,"value-key":e.valueKey,debounce:e.debounce,placement:e.placement,"trigger-on-focus":e.triggerOnFocus,"select-when-unmatched":e.selectWhenUnmatched,"aria-label":e.ariaLabel,"hide-loading":e.hideLoading,"popper-class":e.popperClass,"popper-style":e.popperStyle,teleported:e.teleported,"append-to":e.appendTo,"highlight-first-item":e.highlightFirstItem,"fit-input-width":e.fitInputWidth,"loop-navigation":e.loopNavigation,onSelect:c,onChange:f,onFocus:u,onBlur:p},n.createSlots({default:n.withCtx(({item:v})=>[n.renderSlot(g.$slots,"default",{item:v},()=>[n.createElementVNode("div",null,n.toDisplayString(v[e.valueKey]||""),1)])]),_:2},[g.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"prefix")]),key:"0"}:void 0,g.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"suffix")]),key:"1"}:void 0,g.$slots.header?{name:"header",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"header")]),key:"2"}:void 0,g.$slots.footer?{name:"footer",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"footer")]),key:"3"}:void 0,g.$slots.prepend?{name:"prepend",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"prepend")]),key:"4"}:void 0,g.$slots.append?{name:"append",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"append")]),key:"5"}:void 0,g.$slots.loading?{name:"loading",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}})),cc={class:"j-block"},dc={key:1,class:"j-layout--container"},uc={class:"j-block"},fc={class:"j-block"},pc={class:"j-block"},ua=te(n.defineComponent({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(e){const t=e,o=n.useSlots(),i=n.ref(),a=n.ref(),l=n.ref(-1),r=n.ref(-1),s=n.ref(-1),d=n.ref(-1),c=n.ref(0),f=n.ref(!1),u=n.reactive({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),p=n.computed({get(){return l.value!==-1?l.value:t.left},set(R){l.value=R}}),h=n.computed({get(){return r.value!==-1?r.value:t.right},set(R){r.value=R}}),m=n.computed({get(){return s.value!==-1?s.value:t.top},set(R){s.value=R}}),g=n.computed({get(){return d.value!==-1?d.value:t.bottom},set(R){d.value=R}}),b=n.computed(()=>o.left),k=n.computed(()=>o.right),v=n.computed(()=>o.top),w=n.computed(()=>o.bottom),C=n.computed(()=>b.value?f.value&&t.hideMidWhenNarrow&&k.value?"50%":f.value&&t.hideMidWhenNarrow&&!k.value?"100%":typeof p.value=="number"?p.value+"px":p.value:"0"),S=n.computed(()=>k.value?f.value&&t.hideMidWhenNarrow&&b.value?"50%":f.value&&t.hideMidWhenNarrow&&!b.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),y=n.computed(()=>v.value?typeof m.value=="number"?m.value+"px":m.value:"0"),E=n.computed(()=>w.value?typeof g.value=="number"?g.value+"px":g.value:"0"),B=n.computed(()=>({minWidth:t.midMinWidth+"px",minHeight:t.midMinHeight+"px"})),_=(R,V)=>{u.type=R,u.isMove=!0,u.pageX=V.pageX,u.pageY=V.pageY,u.h=a.value.clientHeight,u.w=a.value.clientWidth;const x=i.value.clientWidth,L=i.value.clientHeight;switch(R){case"left":{const P=p.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*x:Number(P);break}case"right":{const P=h.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*x:Number(P);break}case"top":{const P=m.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*L:Number(P);break}case"bottom":{const P=g.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*L:Number(P);break}}document.onmouseup=j,document.onmousemove=T},T=R=>{if(u.isMove)switch(u.type){case"left":{const V=R.pageX-u.pageX;let x=u.size+V;x<0?x=4:x>u.size+u.w-t.midMinWidth&&(x=u.size+u.w-t.midMinWidth),p.value=x;break}case"right":{const V=R.pageX-u.pageX;let x=u.size-V;x<0?x=4:x>u.size+u.w-t.midMinWidth&&(x=u.size+u.w-t.midMinWidth),h.value=x;break}case"top":{const V=R.pageY-u.pageY;let x=u.size+V;x<0?x=4:x>u.size+u.h-t.midMinHeight&&(x=u.size+u.h-t.midMinHeight),m.value=x;break}case"bottom":{const V=R.pageY-u.pageY;let x=u.size-V;x<0?x=4:x>u.size+u.h-t.midMinHeight&&(x=u.size+u.h-t.midMinHeight),g.value=x;break}}},j=()=>{u.isMove=!1,document.onmouseup=null,document.onmousemove=null},D=()=>{if(!t.hideMidWhenNarrow||!i.value){f.value=!1;return}c.value=i.value.clientWidth;let R=0,V=0;if(b.value){const L=p.value;R=typeof L=="string"&&L.includes("%")?parseFloat(L)/100*c.value:Number(L)}if(k.value){const L=h.value;V=typeof L=="string"&&L.includes("%")?parseFloat(L)/100*c.value:Number(L)}const x=c.value-R-V;f.value=x<t.midMinWidth};let A=null;return n.onMounted(()=>{t.hideMidWhenNarrow&&i.value&&typeof window<"u"&&window.ResizeObserver&&(D(),A=new ResizeObserver(()=>{D()}),A.observe(i.value))}),n.onUnmounted(()=>{A&&A.disconnect()}),(R,V)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"layout",ref:i,class:n.normalizeClass(["j-layout",{"j-layout-not-hidden":e.notHidden}])},[b.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--left",style:n.normalizeStyle({width:C.value})},[n.createElementVNode("div",cc,[n.renderSlot(R.$slots,"left")]),e.leftMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[0]||(V[0]=x=>_("left",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0),f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",dc,[v.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--top",style:n.normalizeStyle({height:y.value})},[n.createElementVNode("div",uc,[n.renderSlot(R.$slots,"top")]),e.topMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[1]||(V[1]=x=>_("top",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"mid",ref:a,class:"j-layout--wrapper",style:n.normalizeStyle(B.value)},[n.renderSlot(R.$slots,"default")],4),w.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"j-layout--bottom",style:n.normalizeStyle({height:E.value})},[n.createElementVNode("div",fc,[n.renderSlot(R.$slots,"bottom")]),e.bottomMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[2]||(V[2]=x=>_("bottom",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)])),k.value?(n.openBlock(),n.createElementBlock("div",{key:2,class:"j-layout--right",style:n.normalizeStyle({width:S.value})},[n.createElementVNode("div",pc,[n.renderSlot(R.$slots,"right")]),e.rightMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[3]||(V[3]=x=>_("right",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)],2))}})),$o={cellInnerBorder:!1,defaultStyle:{bgColor:"#fff",borderColor:"#e5e6eb",color:"#1d2129",fontSize:14,fontFamily:"Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif"},headerStyle:{bgColor:"#f2f3f5",fontWeight:500,padding:[0,8,0,8],lineHeight:14},bodyStyle:{padding:[0,8,0,8],lineHeight:14},frameStyle:{},scrollStyle:{barToSide:!0,width:10,visible:"always",hoverOn:!1}},Ye={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide"};function qt(e,t){return n.inject(e,t)}function Gt(e,t){n.provide(e,t)}function Pe(){return qt(Ye.APP_PROVIDE,{t:(e,...t)=>{if(!e)return"";if(typeof e!="string")return e;let o=e||"";return t.length>0&&t.forEach((i,a)=>{o=o.replace(new RegExp(`\\{${a}\\}`,"g"),i)}),o.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({})})}function Kt(){return qt(Ye.FORM_PROVIDE,{})}function fa(e){Gt(Ye.FORM_PROVIDE,e)}function hc(){return qt(Ye.TABLE_PROVIDE,{})}function Mo(e){Gt(Ye.TABLE_PROVIDE,e)}function On(){return qt(Ye.MENU_PROVIDE,{})}function mc(e){Gt(Ye.MENU_PROVIDE,e)}function gc(){return qt(Ye.H_MENU_PROVIDE,{})}function yc(e){Gt(Ye.H_MENU_PROVIDE,e)}function bc(){return qt(Ye.AUTH_PAGE_PROVIDE,{getPageName:()=>""})}function wc(e){Gt(Ye.AUTH_PAGE_PROVIDE,e)}function vc(e){Gt(Ye.LAYER_PROVIDE,e)}const pa=n.defineComponent({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},row:{type:Object,default:void 0},isTableCell:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,{formData:a,formChange:l}=Kt(),{tableData:r,row:s,rowChange:d}=hc(),c=o.row||s;Mo({tableData:r,row:c,rowChange:d});const f=n.computed(()=>Rn(m.value)&&!p.value?.notInput||p.value?.isInput||m.value==="j-tabs"||m.value==="j-collapse"),u=n.computed({get(){let v;if(c?v=c[o.id]:a?v=a[o.id]:v=o.modelValue,v===void 0&&m.value==="j-tabs"){if(p.value?.defaultValue)return p.value.defaultValue;const w=o.children.findIndex(C=>C.config?.active);return w>-1?"_tab"+w:"_tab0"}if(v===void 0&&m.value==="j-collapse"){if(p.value?.defaultValue)return p.value.defaultValue;const w=o.children.map((C,S)=>({item:C,index:S})).filter(({item:C})=>C.config?.active);return p.value?.accordion?w.length>0?"_collapse"+w[0].index:"":w.map(({index:C})=>"_collapse"+C)}return v},set(v){c?c[o.id]=v:a&&(a[o.id]=v),i("update:modelValue",v)}}),p=n.computed(()=>$t({config:o.config,getCompConfig:o.getCompConfig,formData:a||{},row:c,tableData:r})),h=n.computed(()=>No({type:o.type,getCompType:o.getCompType,config:p.value,formData:a||{},row:c,tableData:r})),m=n.computed(()=>o.isTableCell&&(h.value==="j-radio"||h.value==="j-checkbox")?"j-select":h.value==="j-textarea"?"j-input":h.value),g=n.computed(()=>{const v={...p.value};return m.value==="j-layer-form"&&(v.schema=o.children),m.value==="el-collapse-item"&&v.label&&(v.title=v.label,delete v.label),o.isTableCell&&(h.value==="j-checkbox"&&(v.multiple=!0),h.value==="j-select"&&v.multiple&&(v.collapseTags=!0,v.collapseTagsTooltip=!0),h.value==="j-switch"&&(v.size="small"),h.value==="j-textarea"&&(v.type="textarea")),v}),b=n.computed(()=>{if(m.value==="j-layer-form")return{};const v={};return o.children.forEach((w,C)=>{let S=w;m.value==="j-tabs"&&(S={...w,config:{...w.config||{},name:"_tab"+C}}),m.value==="j-collapse"&&(S={...w,config:{...w.config||{},name:"_collapse"+C}}),S.slot?(v[S.slot]=v[S.slot]||[],v[S.slot].push(S)):(v.default=v.default||[],v.default.push(S))}),v}),k=v=>{const w={...v,id:o.id,formData:a,row:c,tableData:r,config:p.value,type:"change"};console.log(w,"changeData"),p.value?.change&&p.value?.change(w),d&&d(w),l&&l(w),i("change",w)};return(v,w)=>{const C=n.resolveComponent("JComp");return g.value.display!=!1&&f.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(m.value),n.mergeProps({key:0},g.value,{modelValue:u.value,"onUpdate:modelValue":w[0]||(w[0]=S=>u.value=S),onChange:k}),n.createSlots({_:2},[n.renderList(b.value,(S,y)=>({name:y,fn:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S,E=>(n.openBlock(),n.createBlock(C,n.mergeProps({key:E.id},{ref_for:!0},E),null,16))),128))])}))]),1040,["modelValue"])):g.value.display!=!1?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(m.value),n.mergeProps({key:1},g.value,{onChange:k}),n.createSlots({_:2},[n.renderList(b.value,(S,y)=>({name:y,fn:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S,E=>(n.openBlock(),n.createBlock(C,n.mergeProps({key:E.id},{ref_for:!0},E),null,16))),128))])}))]),1040)):n.createCommentVNode("",!0)}}});class Cc{wrapContainer=null;container=null;currentValue=null;async onStart(t){const{value:o}=t;await this.createElement(t)&&o!=null&&this.setValue(o)}findColumnByField(t,o){for(const i of t){if(i.field===o)return i;if(i.columns){const a=this.findColumnByField(i.columns,o);if(a)return a}}return null}async createElement(t){return await this.createEditor(t)}async createEditor(t){const{container:o,referencePosition:i,col:a,row:l,table:r}=t,s=r.getBodyField(a,l),d=r.options?.columns||[],c=this.findColumnByField(d,s),f=c?._compConfig||{},u=r.getCellOriginRecord(a,l)||{};if(!o)return!1;const p=document.createElement("div");p.style.position="absolute",p.style.width="100%",p.style.height="100%",p.style.boxSizing="border-box";const{bgColor:h}=r.getCellStyle(a,l)||{};p.style.backgroundColor=h||"#FFFFFF",this.wrapContainer=p,this.container=o,this.container&&this.container.appendChild(p),f.autoFocus=!0;const m=n.h(pa,{id:s,type:c._compType,config:f,getCompConfig:c._getCompConfig,getCompType:c._getCompType,row:u||{},isTableCell:!0,class:"j-comp-editor","onUpdate:modelValue":g=>{this.currentValue=g,console.log("onUpdate:modelValue triggered with:",g)}});return m.appContext=r._getAppContext(),n.render(m,p),i?.rect&&this.adjustPosition(i.rect),!0}getValue(){return this.currentValue}setValue(t){this.currentValue=t}adjustPosition(t){console.log("Adjusting position:",t),this.wrapContainer&&(this.wrapContainer.style.top=`${t.top}px`,this.wrapContainer.style.left=`${t.left}px`,this.wrapContainer.style.width=`${t.width-1}px`,this.wrapContainer.style.height=`${t.height-1}px`)}onEnd(){this.wrapContainer&&this.container&&(n.render(null,this.wrapContainer),this.container.removeChild(this.wrapContainer),this.wrapContainer=null)}isEditorElement(t){return this.wrapContainer?.contains(t)?!0:this.isClickPopUp(t)}isClickPopUp(t){let o=t;for(;o;){if(o.classList){const i=["el-select-dropdown","el-popper","el-picker-panel","el-cascader-panel","el-autocomplete-suggestion","el-date-picker","el-time-picker"];for(const a of i)if(o.classList.contains(a))return!0}o=o.parentNode}return!1}}const ha=new Map;function kc(){if(!ha.has("j-comp-editor")){const e=new Cc;_o.register.editor("j-comp-editor",e),ha.set("j-comp-editor",e)}}function xc(e){if(Ji(e))return"j-comp-editor"}function Sc(e){if(e)return xc(e)}function Bc(){kc()}const Ec={class:"j-table-footer"},_c={key:0,class:"j-table-pagination"},jc=["onClick"],ma=te(n.defineComponent({name:"JTable",__name:"table",props:{columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageLayoutSimple:{type:Boolean,default:!1},pageSizes:Array,pageTotal:{type:Number,default:0},tablePage:{type:Number,default:1},pageSize:{type:Number,default:100},selectField:{type:String,default:""},rowKey:{type:String,default:"id"},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},isAnimationAppear:{type:Boolean,default:!1},heightMode:{type:String,default:"full"},maxHeight:{type:[String,Number],default:void 0}},emits:["ready","selectionChanged","update:tablePage","update:pageSize","loadPageData","rowChange"],setup(e,{expose:t,emit:o}){const i=n.getCurrentInstance(),a=e,l=o,{formData:r}=Kt(),{useData:s}=Pe(),{getLabel:d}=s(),c=n.computed(()=>a.heightMode==="auto"?{height:"auto"}:{}),f=n.ref(40),u=n.computed(()=>{const N={};return a.heightMode==="auto"&&(N.height=f.value+"px",N.flex="none",a.maxHeight&&(N.maxHeight=typeof a.maxHeight=="number"?`${a.maxHeight}px`:a.maxHeight)),N}),p=n.ref(null);let h=null,m=0,g=0,b=!1;const k=n.ref(!1),v=n.ref({}),w=n.ref([]),C=n.ref(null),S=n.ref(0);let y=null,E=!1,B=!1;const _=(N,$,W,U,Q)=>{w.value=N,C.value=$,S.value=W,v.value={left:`${U}px`,top:`${Q}px`},k.value=!0,E=!1,document.addEventListener("wheel",V,{passive:!1})},T=()=>{k.value=!1,E=!1,B=!1,D(),document.removeEventListener("wheel",V)},j=()=>{D(),y=setTimeout(()=>{!E&&!B&&T()},100)},D=()=>{y&&(clearTimeout(y),y=null)},A=()=>{E=!0,D()},R=()=>{E=!1,j()},V=N=>{N.preventDefault()},x=N=>{C.value&&N.click(C.value,S.value),T()},L=()=>{const{Group:N,Text:$}=_o.CustomLayout,W=a.actionsMaxCount,U=a.actions.length>W,Q=U?a.actions.slice(0,W-1):a.actions,z=U?a.actions.slice(W-1):[];let F=0;if(Q.forEach((ve,J)=>{const oe=fn(ve.label)||0;F+=oe+(J===0?24:12)}),U){const ve=(fn("更多")||0)+12;F+=ve}const de=Math.max(80,F)+"px";return{field:"__actions__",title:a.actionsLabel,width:de,maxWidth:de,minWidth:de,disableColumnResize:!0,disableSelect:!0,customLayout:ve=>{const{table:J,row:oe,col:ge}=ve,ue=J.getCellOriginRecord(ge,oe),Te=J.getRecordIndexByCell(ge,oe),re=new N({height:40,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap"});if(Q.forEach((ye,Me)=>{const Le=ye.isDanger?"#f53f3f":"#165dff",Ce=new $({text:ye.label,fontSize:14,fill:Le,boundsPadding:[0,12,0,Me==0?12:0],cursor:"pointer"});Ce.addEventListener("click",()=>{ye.click(ue,Te)}),Ce.addEventListener("mouseenter",He=>{He.target.setAttribute("fill",Y(Le,-20)),J.scenegraph.stage.renderNextFrame()}),Ce.addEventListener("mouseleave",He=>{He.target.setAttribute("fill",Le),J.scenegraph.stage.renderNextFrame()}),re.add(Ce)}),U){const ye="#1677ff",Me=new $({text:"更多",fontSize:14,fill:ye,boundsPadding:[0,0,0,0],cursor:"pointer"});Me.addEventListener("mouseenter",Le=>{Le.target.setAttribute("fill",Y(ye,-20)),J.scenegraph.stage.renderNextFrame();const Ce=p.value?.getBoundingClientRect();if(Ce){const He=Le.canvasX+Ce.left-64,Ei=Le.canvasY+Ce.top+8;_(z,ue,Te,He,Ei)}B=!0,D()}),Me.addEventListener("mouseleave",Le=>{Le.target.setAttribute("fill",ye),J.scenegraph.stage.renderNextFrame(),B=!1,j()}),re.add(Me)}return{rootContainer:re,renderDefault:!1}}}},P=(N,$)=>{for(const W of N){if(W.field===$)return W;if(W.columns){const U=P(W.columns,$);if(U)return U}}return null},G=(N,$,W,U)=>{const Q=U.getBodyField($,W),z=U.options?.columns||[],F=P(z,Q);return F._fieldFormat?F._fieldFormat(N,$,W,U):Yi(N[Q],d,{type:F._compType,getCompType:F._getCompType,getCompConfig:F._getCompConfig,config:F._compConfig,formData:r,tableData:a.records,row:N})},K=N=>{const{dataValue:$,rect:W}=N;let U="mdi:toggle-switch",Q="#165dff";$||(U="mdi:toggle-switch-off",Q="#e5e6eb");const z=ft.getIcon(U),F=z?.body?.replace(/currentColor/g,Q),de=[];return de.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 ${z?.width} ${z?.height}" >${F}</svg>`,x:8,y:(W.height-40)/2,width:40,height:40}),{elements:de}},ne=N=>{const{dataValue:$,rect:W}=N,U=Number($)||0,Q=5,z=20,F=4,de=8,ve=(W.height-z)/2,J=[],oe=ft.getIcon("mdi:star"),ge=ft.getIcon("mdi:star-half-full"),ue=ft.getIcon("mdi:star-outline"),Te="#f7ba2a",re="#e5e6eb";for(let ye=0;ye<Q;ye++){const Me=de+ye*(z+F),Le=ve;if(U>=ye+1){const Ce=oe?.body?.replace(/currentColor/g,Te);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${oe?.width} ${oe?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}else if(U>ye&&U<ye+1){const Ce=ge?.body?.replace(/currentColor/g,Te);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${ge?.width} ${ge?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}else{const Ce=ue?.body?.replace(/currentColor/g,re);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${ue?.width} ${ue?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}}return{elements:J}},pe=N=>{const{dataValue:$,rect:W,table:U,col:Q,row:z}=N,F=U.getBodyField(Q,z),de=U.options?.columns||[],J=P(de,F)?._compConfig||{},oe=Number(J.min)||0,ge=Number(J.max)||100,ue=Number($)||0,Te=ge-oe,re=Te===0?0:Math.max(0,Math.min(100,(ue-oe)/Te*100)),ye=4,Me=8,Le=8,Ce=(W.height-ye)/2,He=String(ue),Ei=fn(He)||0,_i=Me,bs=Ce,sn=W.width-Me*2-Ei-Le,$n=sn*re/100,ko=[],ws=(Ie,Ae,xo)=>{const Oe=Math.min(xo,Ae/2,Ie/2);return`M ${Oe} 0 L ${Ie-Oe} 0 Q ${Ie} 0 ${Ie} ${Oe} L ${Ie} ${Ae-Oe} Q ${Ie} ${Ae} ${Ie-Oe} ${Ae} L ${Oe} ${Ae} Q 0 ${Ae} 0 ${Ae-Oe} L 0 ${Oe} Q 0 0 ${Oe} 0 Z`},$m=(Ie,Ae,xo)=>{const Oe=Math.min(xo,Ae/2,Ie/2);return Ie<=Oe*2?ws(Ie,Ae,xo):`M ${Oe} 0 L ${Ie} 0 L ${Ie} ${Ae} L ${Oe} ${Ae} Q 0 ${Ae} 0 ${Ae-Oe} L 0 ${Oe} Q 0 0 ${Oe} 0 Z`},Mm=ye/2,Lm=ws(sn,ye,Mm);if(ko.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${sn}" height="${ye}" viewBox="0 0 ${sn} ${ye}"><path d="${Lm}" fill="#e5e6eb"/></svg>`,x:_i,y:bs,width:sn,height:ye}),$n>0){const Ie=ye/2,Ae=$m($n,ye,Ie);ko.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${$n}" height="${ye}" viewBox="0 0 ${$n} ${ye}"><path d="${Ae}" fill="#165dff"/></svg>`,x:_i,y:bs,width:$n,height:ye})}const Pm=_i+sn+Le,Rm=W.height/2;return ko.push({type:"text",text:He,x:Pm,y:Rm,fontSize:14,fill:"#333333",textAlign:"left",textBaseline:"middle"}),{elements:ko}},fe=N=>{const $=N.filter(W=>W.config?.display!==!1).map(W=>{const{id:U,type:Q,config:z,getCompConfig:F,getCompType:de,children:ve}=W,{label:J,width:oe,minWidth:ge,maxWidth:ue,align:Te,fieldFormat:re,editor:ye,frozen:Me,...Le}=z||{},Ce={field:U,title:J,width:oe,minWidth:ge,maxWidth:ue,style:{textAlign:Te},_fieldFormat:re,_compType:Q,_compConfig:{...Le},_getCompConfig:F,_getCompType:de,frozen:Me},He=Sc(Q);return He&&(Ce.editor=He,Q==="j-switch"&&(Ce.customRender=K),b=!0),Q==="j-rate"&&(Ce.customRender=ne),Q==="j-slider"&&(Ce.customRender=pe),Ce.fieldFormat=G,ve&&(Ce.columns=fe(ve)),Ce});return a.isTree&&$.length>0&&($[0].tree=!0),$},Y=(N,$)=>{const W=N.replace("#",""),U=parseInt(W,16),Q=Math.min(255,Math.max(0,(U>>16)+$)),z=Math.min(255,Math.max(0,(U>>8&255)+$)),F=Math.min(255,Math.max(0,(U&255)+$));return`#${(Q<<16|z<<8|F).toString(16).padStart(6,"0")}`},he=()=>({field:"__sequence__",title:"序号",width:"auto",minWidth:44,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:(N,$,W,U)=>{const Q=U.getRecordIndexByCell($,W);return a.isPage?me.value+Q+1:Q+1},_getCompConfig:void 0,_getCompType:void 0}),ae=()=>{m=0,g=0,b=!1;const N={};let $=fe(a.columns);const W=oe=>{if(oe.frozen)return oe.frozen;if(oe.columns)for(const ge of oe.columns){const ue=W(ge);if(ue)return ue}},U=oe=>{const ge=[];return oe.forEach(ue=>{if(ue.frozen){ge.push(ue);return}if(!ue.columns||ue.columns.length===0){ge.push(ue);return}const Te=U(ue.columns),re=[],ye=[],Me=[];if(Te.forEach(Ce=>{const He=W(Ce);He==="left"?re.push(Ce):He==="right"?ye.push(Ce):Me.push(Ce)}),(re.length>0?1:0)+(ye.length>0?1:0)+(Me.length>0?1:0)<=1){ue.columns=Te,ge.push(ue);return}re.length&&ge.push({...ue,columns:re}),Me.length&&ge.push({...ue,columns:Me}),ye.length&&ge.push({...ue,columns:ye})}),ge};$=U($);const Q=oe=>{let ge=0,ue=0;return oe.forEach(Te=>{if(Te.columns&&Te.columns.length>0){const re=Q(Te.columns);ge+=re.left,ue+=re.right}else Te.frozen==="left"?ge++:Te.frozen==="right"&&ue++}),{left:ge,right:ue}},z=[],F=[],de=[];$.forEach(oe=>{const ge=W(oe);ge==="left"?z.push(oe):ge==="right"?F.push(oe):de.push(oe)});const ve=Q(z),J=Q(F);return g+=ve.left,m+=J.right,$=[...z,...de,...F],a.isShowNumber&&($.unshift(he()),g++),a.actions.length>0&&($.push(L()),m++),b&&(N.editCellTrigger="click",N.keyboardOptions={copySelected:!0,cutSelected:!0,pasteValueToCell:!0,selectAllOnCtrlA:!0}),{columns:$,option:N}},se=()=>{const N=ae();a.isMultiple&&g++;const $={records:[],columns:N.columns,autoFillWidth:!0,enableCheckboxCascade:a.isMultiple,enableHeaderCheckboxCascade:a.isMultiple,rightFrozenColCount:m,frozenColCount:g,emptyTip:{text:"暂无数据"},tooltip:{isShowOverflowTextTooltip:!0},...N.option};return a.isAnimationAppear&&($.animationAppear={duration:100,delay:0,type:"one-by-one",direction:"row"}),a.isMultiple&&($.rowSeriesNumber={width:40,minWidth:40,maxWidth:40,disableColumnResize:!0,format:()=>"",cellType:"checkbox",headerType:"checkbox",headerStyle:{textAlign:"center"},style:{textAlign:"center"}},a.selectField&&($.rowSeriesNumber.field=a.selectField)),$.theme=$o,a.heightMode==="auto"&&($.theme={...$o,scrollStyle:{...$o.scrollStyle,hoverOn:!0,width:8}}),$},xe=()=>{if(!p.value)return;Bc();const N=se();h=new _o.ListTable(p.value,N),h._getAppContext=()=>i?.appContext,h.on("click_cell",({col:$,cellType:W})=>{if(W==="checkbox"&&$==0){const U=ut();l("selectionChanged",U)}}),H(),f.value=h.getAllRowsHeight(),l("ready",h)},Ve=()=>{h&&(h.release(),h=null)},H=()=>{le(a.records)},X=()=>h,le=N=>{h&&(h.setScrollTop(0),h.setRecords(N))};n.onMounted(()=>{xe()}),n.onBeforeUnmount(()=>{Ve(),D(),document.removeEventListener("wheel",V)});const we=n.computed({get(){return a.tablePage},set(N){l("update:tablePage",N)}}),$e=n.ref(0),Re=n.computed({get(){return $e.value!==0?$e.value:a.pageSize},set(N){$e.value=N,l("update:pageSize",N)}}),me=n.computed(()=>(we.value-1)*Re.value),De=(N,$)=>{l("loadPageData",{rows:$,page:N})},ut=()=>{if(!h)return[];if(h.stateManager&&h.stateManager.checkedState){const N=h.stateManager.checkedState,$=[];return N.forEach((W,U)=>{if(Object.values(W).some(z=>z===!0)){const z=Number(U);!isNaN(z)&&h.records[z]&&$.push(h.records[z])}}),$}return[]},ot=N=>a.rowKey?a.rowKey.split(",").map(W=>N[W.trim()]).join("::"):"",O=N=>{if(!h||!a.isMultiple)return;const $=h.records;if(a.rowKey){const W=new Set(N.map(ot));$.forEach((U,Q)=>{const z=W.has(ot(U)),F=h.getTableIndexByRecordIndex(Q);h.setCellCheckboxState(0,F,z)})}else console.warn("Warning: rowKey is not defined. Please set rowKey to enable row selection.")},q=N=>{l("rowChange",N)},I=()=>{if(!h)return;const N=ut(),$=se();$.records=h.records,h.updateOption($,{clearColWidthCache:!1,clearRowHeightCache:!1}),a.heightMode==="auto"&&(f.value=h.getAllRowsHeight()),N.length>0&&O(N)};return n.watch(()=>a.columns,()=>{I()}),n.watch(()=>[a.isTree,a.isMultiple,a.isShowNumber,a.isPage,a.isAnimationAppear,a.actionsMaxCount,a.actionsLabel,a.selectField,a.heightMode],()=>{I()}),n.watch(()=>a.actions,()=>{I()},{deep:!0}),Mo({tableData:a.records,rowChange:q}),t({getInstance:X,setRecords:le,getSelection:ut,setSelection:O}),(N,$)=>{const W=n.resolveComponent("el-pagination");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-table",{"j-table-auto":e.heightMode==="auto"}]),style:n.normalizeStyle(c.value)},[n.createElementVNode("div",{class:"j-table-wrapper",style:n.normalizeStyle(u.value)},[n.createElementVNode("div",{class:n.normalizeClass("j-block"),ref_key:"tableContainer",ref:p},null,512)],4),n.createElementVNode("div",Ec,[e.isPage?(n.openBlock(),n.createElementBlock("div",_c,[$[2]||($[2]=n.createElementVNode("div",null,null,-1)),e.isPage?(n.openBlock(),n.createBlock(W,{key:0,"current-page":we.value,"onUpdate:currentPage":$[0]||($[0]=U=>we.value=U),"page-size":Re.value,"onUpdate:pageSize":$[1]||($[1]=U=>Re.value=U),"page-sizes":e.pageSizes||[100,200,500,1e3],total:e.pageTotal,layout:"total, prev, pager, next,sizes",onChange:De},null,8,["current-page","page-size","page-sizes","total"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),k.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-table-dropdown",style:n.normalizeStyle(v.value),onMouseenter:A,onMouseleave:R},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,U=>(n.openBlock(),n.createElementBlock("div",{key:U.id,class:"j-table-dropdown-item",style:n.normalizeStyle({color:U.isDanger?"var(--j-color-danger)":"var(--j-color-primary)"}),onClick:Q=>x(U)},n.toDisplayString(U.label),13,jc))),128))],36)):n.createCommentVNode("",!0)],6)}}})),Vc=["title"],Tc={key:0,style:{"margin-left":"8px"}},Nc={key:0,class:"j-dialog-steps"},$c={key:1,class:"j-dialog-btns"},ga=te(n.defineComponent({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const i=e,a=o,{t:l}=Pe(),r=n.ref(!1),s=n.ref(!1),d=n.ref(""),c=n.ref(!1),f=n.ref(!0),u=n.ref(!1),p=n.ref(!0),h=n.ref(-1),m=n.reactive({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),g=n.ref(0),b=n.ref(),k=n.ref(48),v=n.ref(0),w=n.ref(0);n.watch(()=>i.visible,Y=>{g.value=1,g.value=0,r.value=Y,Y===!0&&i.zoomControls&&n.nextTick(()=>{typeof document<"u"&&(b.value=document.querySelector(".j-dialog"),b.value&&(b.value.onmousemove=pe))})},{immediate:!0});const C=n.computed(()=>{let Y=i.height+g.value;return typeof window<"u"&&Y+40>window.innerHeight&&(Y=window.innerHeight-32-40),Y}),S=n.computed(()=>{let Y=0+g.value;return typeof document<"u"&&document.body&&(Y=(document.body.clientWidth-E.value)/2),Y}),y=n.computed(()=>{let Y=0+g.value;return typeof window<"u"&&(Y=(window.innerHeight-C.value-40)/2),Y}),E=n.computed(()=>{let Y=0+g.value;return Y=i.width,typeof document<"u"&&document.body&&Y>document.body.clientWidth&&(Y=document.body.clientWidth-32),Y}),B=Y=>{d.value=Y||"保存数据中...",s.value=!0},_=()=>{s.value=!1},T=()=>{i.beforeClose&&i.beforeClose()===!1||(r.value=!1,a("update:visible",!1),a("cancel"))},j=()=>{a("ok",B,_)},D=()=>{m.left=0,m.top=0,w.value=0,v.value=0,i.isStep&&(A.value=0,n.nextTick(()=>{L()})),a("closed")},A=n.computed({get(){return h.value!==-1?h.value:i.stepActive},set(Y){h.value=Y,a("update:stepActive",Y)}}),R=()=>{A.value>0&&A.value--,n.nextTick(()=>{L()})},V=async()=>{await x()&&(A.value<i.steps.length-1&&(A.value+=1),n.nextTick(()=>{L()}))},x=async()=>{if(c.value=!0,i.validateSteps){const Y=await i.validateSteps(i.stepActive,B,_);return c.value=!1,Y}return c.value=!1,!0},L=()=>{switch(p.value=!0,u.value=!0,f.value=!0,A.value){case 0:u.value=!1;break;case i.steps.length-1:f.value=!1,p.value=!1;break;default:f.value=!1,u.value=!1;break}},P=n.computed(()=>i.steps.map(Y=>({title:Y,disabled:!0}))),G=function(Y){i.autoHeight||(m.pageX=Y.pageX,m.pageY=Y.pageY,m._left=m.left,m._top=m.top,m.isMove=!0,typeof document<"u"&&(document.onmouseup=K,document.onmousemove=ne))},K=()=>{m.isMove=!1,typeof document<"u"&&(document.onmouseup=null,document.onmousemove=null)},ne=Y=>{if(m.isMove){const he=Y.pageX-m.pageX,ae=Y.pageY-m.pageY;let se=m._left+he,xe=m._top+ae;se+S.value<0&&(se=-S.value),typeof document<"u"&&document.body&&(v.value?se+v.value+S.value>document.body.clientWidth&&(se=document.body.clientWidth-v.value-S.value):se+E.value+S.value>document.body.clientWidth&&(se=document.body.clientWidth-E.value-S.value)),xe+y.value<0&&(xe=-y.value),typeof window<"u"&&(w.value?xe+w.value+y.value+40>window.innerHeight&&(xe=window.innerHeight-w.value-y.value-40):xe+C.value+y.value+40>window.innerHeight&&(xe=window.innerHeight-C.value-y.value-40)),m.left=se,m.top=xe}},pe=Y=>{const he=b.value.offsetLeft,ae=b.value.offsetTop,se=b.value.clientWidth,xe=b.value.clientHeight,Ve=xe-k.value,H=b.value.scrollTop;if(Y.clientX>he+se-10&&H+Y.clientY>ae+xe-10||H+Y.clientY<ae+5&&he+10>Y.clientX)b.value.style.cursor="se-resize";else if(he+10>Y.clientX&&H+Y.clientY>ae+xe-10||Y.clientX>he+se-10&&H+Y.clientY<ae+5)b.value.style.cursor="sw-resize";else if(Y.clientX>he+se-10||he+10>Y.clientX)b.value.style.cursor="w-resize";else if(H+Y.clientY>ae+xe-10||H+Y.clientY<ae+5)b.value.style.cursor="s-resize";else{b.value.style.cursor="default",b.value.onmousedown=null;return}b.value.onmousedown=X=>{const{clientX:le}=X,{clientY:we}=X,$e=m.left+S.value,Re=m.top+y.value;m._left=m.left,m._top=m.top,w.value||(w.value=Ve),v.value||(v.value=se),le>$e+10&&le<$e+se-10&&we>Re+5&&we<Re+47||(typeof document<"u"&&(document.onmousemove=function(me){me.preventDefault(),le>$e&&le<$e+10&&(le>me.clientX&&(v.value=se+(le-me.clientX),m.left=m._left-(le-me.clientX)),le<me.clientX&&v.value>i.minWidth&&(v.value=se-(me.clientX-le),m.left=m._left+me.clientX-le)),le>$e+se-10&&le<$e+se&&(le>me.clientX&&v.value>i.minWidth&&(v.value=se-(le-me.clientX)),le<me.clientX&&typeof document<"u"&&document.body&&S.value+m.left+v.value<document.body.clientWidth&&(v.value=se+(me.clientX-le))),we>Re&&we<Re+5&&(we>me.clientY&&(w.value=Ve+we-me.clientY,m.top=m._top-(we-me.clientY)),we<me.clientY&&w.value>i.minHeight&&(w.value=Ve-(me.clientY-we),m.top=m._top+me.clientY-we)),H+we>Re+Ve+38&&H+we<Re+Ve+48&&(we>me.clientY&&w.value>i.minHeight&&(w.value=Ve-(we-me.clientY)),we<me.clientY&&typeof window<"u"&&y.value+m.top+w.value+48<window.innerHeight&&(w.value=Ve+me.clientY-we))}),typeof document<"u"&&(document.onmouseup=function(){typeof document<"u"&&(document.onmousemove=null,document.onmouseup=null)}))}},fe=async Y=>{Y.click&&await Y.click()};return t({showLoading:B,hideLoading:_}),(Y,he)=>{const ae=n.resolveComponent("j-button"),se=n.resolveComponent("el-space"),xe=n.resolveComponent("el-step"),Ve=n.resolveComponent("el-steps"),H=n.resolveComponent("el-dialog");return n.openBlock(),n.createBlock(H,{modelValue:r.value,"onUpdate:modelValue":he[0]||(he[0]=X=>r.value=X),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":e.destroyOnClose,"show-close":!1,modal:e.mask,"modal-penetrable":!e.mask,"close-on-click-modal":!1,width:`${v.value||E.value}px`,style:n.normalizeStyle({position:"fixed",left:`${S.value+m.left}px`,top:`${y.value+m.top}px`,"pointer-events":e.mask?"":"none"}),onClosed:D},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"j-dialog-header",onMousedown:G},[n.createElementVNode("div",{class:"j-dialog-header-left",title:n.unref(l)(e.title||""),style:n.normalizeStyle({cursor:e.autoHeight?"":"move"})},[n.createElementVNode("span",null,n.toDisplayString(n.unref(l)(e.title||"")),1),e.subtitle?(n.openBlock(),n.createElementBlock("span",Tc,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle())))])):n.createCommentVNode("",!0)],12,Vc),e.showCloseBtn?(n.openBlock(),n.createBlock(se,{key:0,size:0},{default:n.withCtx(()=>[n.createVNode(ae,{type:"text",icon:"mdi:close",onClick:T})]),_:1})):n.createCommentVNode("",!0)],32),n.createElementVNode("div",{class:n.normalizeClass(["j-dialog-window",{"j-dialog-window-hasBtns":e.hasBtns},{"j-dialog-window-hasSteps":e.isStep}]),style:n.normalizeStyle({height:e.autoHeight?"auto":(w.value>0?w.value:C.value)+"px"})},[e.isStep?(n.openBlock(),n.createElementBlock("div",Nc,[n.createElementVNode("div",{style:n.normalizeStyle({maxWidth:`${200*P.value.length}px`,width:"100%"})},[n.createVNode(Ve,{simple:"",active:A.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(P.value,(X,le)=>(n.openBlock(),n.createBlock(xe,{key:le,title:n.unref(l)(X.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):n.createCommentVNode("",!0),n.renderSlot(Y.$slots,"default"),e.hasBtns?(n.openBlock(),n.createElementBlock("div",$c,[n.createVNode(se,{size:8},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(ae,{key:0,size:"mini",disabled:f.value,label:n.unref(l)("上一步"),onClick:R},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(ae,{key:1,size:"mini",disabled:u.value,loading:c.value,label:n.unref(l)("下一步"),onClick:V},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),!e.isStep&&e.showCloseBtn?(n.openBlock(),n.createBlock(ae,{key:2,size:"mini",label:n.unref(l)("取消"),onClick:T},null,8,["label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,X=>(n.openBlock(),n.createBlock(ae,{key:X.prop,label:X.label,danger:X.danger,ghost:X.ghost,type:X.type,icon:X.icon,onClick:le=>fe(X)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(ae,{key:3,size:"mini",type:"primary",disabled:p.value&&e.isStep,label:n.unref(l)(e.btnText),onClick:j},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}})),Mc=["element-loading-text"],Lc={class:"j-dialog-full-header"},Pc={class:"j-dialog-full-header-left"},Rc=["src"],Ac={class:"j-dialog-full-title-text"},Oc={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Fc={class:"j-dialog-full-header-right"},Ic={class:"j-dialog-full-body"},ya=te(n.defineComponent({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const i=e,a=o,{logoImg:l,t:r}=Pe(),s=n.ref(!1),d=n.ref(!1),c=n.ref(""),f=n.ref(!1),u=n.ref(!0),p=n.ref(!1),h=n.ref(!0),m=n.ref(-1);n.watch(()=>i.visible,j=>{s.value=j},{immediate:!0});const g=n.computed({get(){return m.value!==-1?m.value:i.stepActive},set(j){m.value=j,a("update:stepActive",j)}}),b=()=>{i.beforeClose&&i.beforeClose()===!1||(s.value=!1,a("update:visible",!1),a("cancel"))},k=()=>{a("ok",w,C)},v=()=>{i.isStep&&(g.value=0,n.nextTick(()=>{B()})),a("closed")},w=j=>{c.value=j||"保存数据中...",d.value=!0},C=()=>{d.value=!1},S=()=>{g.value>0&&g.value--,n.nextTick(()=>{B()})},y=async()=>{await E()&&(g.value<i.steps.length-1&&(g.value+=1),n.nextTick(()=>{B()}))},E=async()=>{if(f.value=!0,i.validateSteps){const j=await i.validateSteps(i.stepActive,w,C);return f.value=!1,j}return f.value=!1,!0},B=()=>{switch(h.value=!0,p.value=!0,u.value=!0,g.value){case 0:p.value=!1;break;case i.steps.length-1:u.value=!1,h.value=!1;break;default:u.value=!1,p.value=!1;break}},_=n.computed(()=>i.steps.map(j=>({title:j,disabled:!0}))),T=async j=>{j.click&&await j.click()};return t({showLoading:w,hideLoading:C}),(j,D)=>{const A=n.resolveComponent("el-step"),R=n.resolveComponent("el-steps"),V=n.resolveComponent("j-button"),x=n.resolveComponent("el-space"),L=n.resolveComponent("el-divider"),P=n.resolveComponent("el-dialog"),G=n.resolveDirective("loading");return n.openBlock(),n.createBlock(P,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=K=>s.value=K),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":e.destroyOnClose,onClosed:v},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:"j-block j-dialog-full-window","element-loading-text":n.unref(r)(c.value)},[n.createElementVNode("div",Lc,[n.createElementVNode("div",Pc,[n.unref(l)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"j-dialog-full-header-logo",src:n.unref(l)},null,8,Rc)):n.createCommentVNode("",!0),n.createElementVNode("span",Ac,n.toDisplayString(n.unref(r)(e.title)),1),n.createElementVNode("span",Oc,[e.subtitle?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle()),{key:0})):n.createCommentVNode("",!0)])]),n.createElementVNode("div",{class:"j-dialog-full-header-mid",style:n.normalizeStyle({maxWidth:`${200*_.value.length}px`})},[e.isStep?(n.openBlock(),n.createBlock(R,{key:0,simple:"",active:g.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,(K,ne)=>(n.openBlock(),n.createBlock(A,{key:ne,title:n.unref(r)(K.title)},null,8,["title"]))),128))]),_:1},8,["active"])):n.createCommentVNode("",!0)],4),n.createElementVNode("div",Fc,[n.createVNode(x,{size:0},{default:n.withCtx(()=>[e.hasBtns?(n.openBlock(),n.createBlock(x,{key:0},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(V,{key:0,size:"mini",disabled:u.value,label:n.unref(r)("上一步"),onClick:S},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(V,{key:1,size:"mini",disabled:p.value,loading:f.value,label:n.unref(r)("下一步"),onClick:y},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,K=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:K.prop},[K.display!==!1?(n.openBlock(),n.createBlock(V,{key:0,label:K.label,danger:K.danger,ghost:K.ghost,type:K.type,disabled:K.disabled,icon:K.icon?K.icon:"",onClick:ne=>T(K)},null,8,["label","danger","ghost","type","disabled","icon","onClick"])):n.createCommentVNode("",!0)],64))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(V,{key:2,size:"mini",type:"primary",disabled:h.value&&e.isStep,label:n.unref(r)(e.btnText),onClick:k},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),e.showCloseBtn&&e.hasBtns?(n.openBlock(),n.createBlock(L,{key:1,type:"vertical",style:{margin:"0 8px"}})):n.createCommentVNode("",!0),e.showCloseBtn?(n.openBlock(),n.createBlock(V,{key:2,type:"text",icon:"mdi:close",onClick:b})):n.createCommentVNode("",!0)]),_:1})])]),n.createElementVNode("div",Ic,[n.renderSlot(j.$slots,"default")])],8,Mc)),[[G,d.value]])]),_:3},8,["modelValue","destroy-on-close"])}}})),zc=["element-loading-text"],Dc={class:"j-block"},Hc={key:0,class:"j-drawer-bottom-btns"},Wc={class:"j-drawer--header"},Uc={class:"j-drawer--title"},Jc={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Yc={key:0,class:"j-drawer--btns"},qc={key:0,class:"j-drawer-steps"},ba=te(n.defineComponent({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(e,{expose:t,emit:o}){const i=e,{t:a}=Pe(),l=o,r=n.ref(!1),s=n.ref(""),d=n.computed(()=>["ltr","rtl"].indexOf(i.direction)!==-1?`${i.width}px`:`${i.height}px`),c=n.computed({get(){return i.visible},set(j){l("update:visible",!!j)}}),f=j=>{s.value=j||"保存数据中...",r.value=!0},u=()=>{r.value=!1},p=()=>{i.isStep&&(S.value=0,n.nextTick(()=>{_()})),l("closed")},h=()=>{l("ok",f,u)},m=()=>{i.beforeClose&&i.beforeClose()===!1||(c.value=!1,l("update:visible",!1),l("cancel"))},g=async j=>{j.click&&await j.click()},b=n.ref(!1),k=n.ref(!0),v=n.ref(!1),w=n.ref(!0),C=n.ref(-1),S=n.computed({get(){return C.value!==-1?C.value:i.stepActive},set(j){C.value=j,l("update:stepActive",j)}}),y=()=>{S.value>0&&S.value--,n.nextTick(()=>{_()})},E=async()=>{await B()&&(S.value<i.steps.length-1&&(S.value+=1),n.nextTick(()=>{_()}))},B=async()=>{if(b.value=!0,i.validateSteps){const j=await i.validateSteps(i.stepActive,f,u);return b.value=!1,j}return b.value=!1,!0},_=()=>{switch(w.value=!0,v.value=!0,k.value=!0,S.value){case 0:v.value=!1;break;case i.steps.length-1:k.value=!1,w.value=!1;break;default:k.value=!1,v.value=!1;break}},T=n.computed(()=>i.steps.map(j=>({title:j,disabled:!0})));return t({showLoading:f,hideLoading:u}),(j,D)=>{const A=n.resolveComponent("el-input"),R=n.resolveComponent("j-button"),V=n.resolveComponent("el-space"),x=n.resolveComponent("el-step"),L=n.resolveComponent("el-steps"),P=n.resolveComponent("el-drawer"),G=n.resolveDirective("loading");return n.openBlock(),n.createBlock(P,{modelValue:c.value,"onUpdate:modelValue":D[0]||(D[0]=K=>c.value=K),class:"j-drawer","append-to-body":!0,direction:e.direction,size:d.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":e.destroyOnClose,modal:e.mask,"before-close":e.beforeClose,"close-on-click-modal":!0,onClosed:p},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":e.isStep}]),"element-loading-text":s.value},[n.createElementVNode("div",{class:"j-drawer--body",style:n.normalizeStyle({"padding-bottom":e.showCloseBtn||e.hasSaveBtn||e.buttons.length>0?"48px":"0"})},[n.createVNode(A,{style:{position:"absolute",top:"-200px"}}),n.createElementVNode("div",Dc,[n.renderSlot(j.$slots,"default")]),e.hasBtns?(n.openBlock(),n.createElementBlock("div",Hc,[n.createVNode(V,{size:8},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(R,{key:0,size:"mini",disabled:k.value,label:n.unref(a)("上一步"),onClick:y},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(R,{key:1,size:"mini",disabled:v.value,loading:b.value,label:n.unref(a)("下一步"),onClick:E},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),!e.isStep&&e.showCloseBtn?(n.openBlock(),n.createBlock(R,{key:2,size:"mini",label:n.unref(a)("取消"),onClick:m},null,8,["label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,K=>(n.openBlock(),n.createBlock(R,{key:K.prop,label:K.label,danger:K.danger,ghost:K.ghost,type:K.type,icon:K.icon,onClick:ne=>g(K)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(R,{key:3,size:"mini",type:"primary",disabled:w.value&&e.isStep,label:n.unref(a)(e.btnText),onClick:h},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)],4),n.createElementVNode("div",Wc,[n.createElementVNode("div",Uc,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a)(e.title)),1),n.createElementVNode("span",Jc,[e.subtitle?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle()),{key:0})):n.createCommentVNode("",!0)])]),e.showCloseBtn?(n.openBlock(),n.createElementBlock("div",Yc,[n.createVNode(R,{type:"text",icon:"mdi:close",onClick:m})])):n.createCommentVNode("",!0)]),e.isStep?(n.openBlock(),n.createElementBlock("div",qc,[n.createElementVNode("div",{style:n.normalizeStyle({maxWidth:`${200*T.value.length}px`,width:"100%"})},[n.createVNode(L,{simple:"",active:S.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.value,(K,ne)=>(n.openBlock(),n.createBlock(x,{key:ne,title:n.unref(a)(K.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):n.createCommentVNode("",!0)],10,zc)),[[G,r.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}})),wa=te(n.defineComponent({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(e,{expose:t,emit:o}){const i=o,a=n.ref(!1),l=n.ref(""),r=n.ref(),s=n.ref(0),d=n.ref(""),c=n.ref(),f=(k,v,w)=>{l.value=k,c.value=w,d.value=v||"modal",a.value=!0},u=()=>{a.value=!1},p=(k,v)=>{i("ok",k,v)},h=()=>{s.value=0,i("closed")},m=()=>{i("cancel")},g=k=>{r.value&&r.value.showLoading(k)},b=()=>{r.value&&r.value.hideLoading()};return vc({stepActive:s}),t({open:f,close:u,showLoading:g,hideLoading:b}),(k,v)=>{const w=n.resolveComponent("j-dialog-full"),C=n.resolveComponent("j-drawer"),S=n.resolveComponent("j-dialog");return d.value==="full"?(n.openBlock(),n.createBlock(w,{key:0,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[0]||(v[0]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[1]||(v[1]=y=>s.value=y),title:l.value,"before-close":e.beforeClose,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):d.value==="drawer"?(n.openBlock(),n.createBlock(C,{key:1,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[2]||(v[2]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[3]||(v[3]=y=>s.value=y),"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):(n.openBlock(),n.createBlock(S,{key:2,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[4]||(v[4]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[5]||(v[5]=y=>s.value=y),width:e.width,height:e.height,title:l.value,"before-close":e.beforeClose,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}})),va=te(n.defineComponent({name:"JDynamicLayer",__name:"dynamic-layer",setup(e,{expose:t}){const o=n.ref(),i=n.ref(600),a=n.ref(400),l=n.ref(!0),r=n.ref(!0),s=n.ref(!0),d=n.ref(""),c=n.ref([]),f=n.ref(!0),u=n.ref(),p=n.shallowRef(),h=n.ref(),{getPageName:m}=bc(),g=()=>{const A=m();return A||(typeof p.value=="string"?p.value:"")},b=n.ref(!1),k=n.ref([]),v=async A=>{if(u.value?.validateSteps){Ht(!0);const R=u.value.validateSteps(A);return Ht(!1),R}return!0},w=()=>u.value?.beforeClose?u.value.beforeClose():!0;let C,S,y,E=0;const B=async A=>{if(u.value){if(E=0,u.value.getConfig){const R=u.value.getConfig();c.value=R.buttons||[],b.value=R.isStep,k.value=R.steps||[]}else c.value=[],b.value=!1,k.value=[];if(u.value.open)try{const{buttons:R}=await u.value.open(A,o.value,()=>{C&&C()})||{};if(R&&R.length>0){const V=[];V.push(...c.value),V.push(...R),c.value=V}}catch(R){o.value.close(),console.error(R)}o.value.hideLoading()}else{if(E>600){console.warn("表单组件加载超时"),o.value.hideLoading();return}E++,setTimeout(async()=>{await B(A)},100)}},_=A=>{p.value=A?.name,i.value=A?.width||600,a.value=A?.height||400,l.value=A?.hasBtns!==!1,r.value=A?.hasSaveBtn!==!1,s.value=A?.hasHeader!==!1,A?.destroyOnClose!==!1&&(f.value=!0),h.value=A?.config||{},d.value=A?.btnText||"保存",C=A?.afterOk||null,S=A?.afterClose||null,y=A?.afterCancel||null,o.value.open(A.title,A.type,A.subtitle),n.nextTick(async()=>{o.value.showLoading("加载中"),await B(A.param||{})})},T=async()=>{if(u.value?.ok){Ht(!0);const A=await u.value.ok();A&&(o.value.close(),C&&await C(A)),Ht(!1)}},j=()=>{u.value?.closed&&u.value.closed(),S&&S()},D=()=>{y&&y()};return wc({getPageName:g}),t({open:_}),(A,R)=>{const V=n.resolveComponent("j-layer");return n.openBlock(),n.createBlock(V,{ref_key:"layerRef",ref:o,width:i.value,height:a.value,"before-close":w,"validate-steps":v,"is-step":b.value,steps:k.value,"has-btns":l.value,buttons:c.value,"btn-text":d.value,"destroy-on-close":f.value,"has-save-btn":r.value,"has-header":s.value,onOk:T,onClosed:j,onCancel:D},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value),n.mergeProps({ref_key:"componentRef",ref:u},h.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}})),Ca=te(n.defineComponent({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed(()=>it(o.modelValue)?[]:o.modelValue?.split(",")||[]),r=n.computed(()=>o.isStyleLoop?l.value?.map((u,p)=>{let h=o.colors[p%o.colors.length]||{};return h={...h,borderWidth:(h.borderWidth||0)+"px"},h})||[]:o.colors),s=u=>{c(),i("select",u)},d=u=>{u.preventDefault(),u.stopPropagation()},c=()=>{if(a.value){const u=[...l.value,a.value];a.value="",i("update:modelValue",u.join(",")),i("change",{value:u.join(",")})}},f=u=>{const p=[...l.value];p.splice(u,1),i("update:modelValue",p.join(",")),i("change",{value:p.join(",")})};return(u,p)=>{const h=n.resolveComponent("el-tag"),m=n.resolveComponent("el-space"),g=n.resolveComponent("j-autocomplete");return n.openBlock(),n.createBlock(g,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=b=>a.value=b),class:"j-input-tag",options:e.options,style:{width:"100%"},readonly:e.readonly,placeholder:e.placeholder,size:e.size,onSelect:s,onKeyup:n.withKeys(n.withModifiers(c,["stop"]),["enter"]),onKeydown:n.withKeys(n.withModifiers(d,["stop"]),["enter"])},{prefix:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(b,k)=>(n.openBlock(),n.createBlock(h,{key:k,type:"info",closable:!e.readonly,style:n.normalizeStyle(r.value[k]||{}),size:e.size,onClose:n.withModifiers(v=>f(k),["prevent"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size","onKeyup","onKeydown"])}}})),ka=te(n.defineComponent({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return Number(o.modelValue)},set(d){i("update:modelValue",d),i("change",{value:d})}}),l=n.computed(()=>o.texts?.map(d=>d.value)||[]),r=n.ref(0),s=d=>{r.value=d};return(d,c)=>{const f=n.resolveComponent("el-rate");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=u=>a.value=u),size:e.size,max:e.max,"allow-half":e.allowHalf,clearable:e.allowClear,disabled:e.readonly,"show-text":e.showText,texts:l.value,"show-score":e.showScore,onHoverChange:s},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}})),xa=te(n.defineComponent({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return Number(o.modelValue)},set(l){i("update:modelValue",l),i("change",{value:l})}});return(l,r)=>{const s=n.resolveComponent("el-slider");return n.openBlock(),n.createBlock(s,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=d=>a.value=d),min:e.min,max:e.max,disabled:e.readonly,step:e.step,"show-input":e.showInput,"show-input-controls":e.showInputControls,size:e.size,"input-size":e.size,"show-stops":e.showStops,"show-tooltip":e.showTooltip,"format-tooltip":e.formatTooltip,range:e.range,vertical:e.vertical,height:e.height,"aria-label":e.ariaLabel,"range-start-label":e.rangeStartLabel,"range-end-label":e.rangeEndLabel,"format-value-text":e.formatValueText,"tooltip-class":e.tooltipClass,placement:e.placement,marks:e.marks,"validate-event":e.validateEvent,persistent:e.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}})),Fn=e=>e<1024?un(e)+" B":e>=1024&&e<1048576?un(e/1024)+" KB":e>=1048576&&e<1073741824?un(e/1024/1024)+" MB":e>=1073741824?un(e/1024/1024/1024)+" GB":"",Gc=e=>{const t=window.open("_blank");t&&(t.location=e)},Kc={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},Xc=["src"],Zc={class:"j-upload-dragItem-content"},Qc={class:"j-upload-dragItem-mask"},ed=["src"],td={class:"j-upload-imgItem-mask"},nd={class:"j-upload-item-content"},Sa=n.defineComponent({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(e){const{t}=Pe();return(o,i)=>{const a=n.resolveComponent("j-icon"),l=n.resolveComponent("el-text"),r=n.resolveComponent("j-button"),s=n.resolveComponent("el-progress"),d=n.resolveComponent("el-link");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-upload-list",{"j-upload-image-list":e.isUploadImg,"j-upload-drag-list":e.drag}])},[e.drag?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.showFileList?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-dragItem"},[e.isUploadImg?(n.openBlock(),n.createElementBlock("div",Kc,[n.createElementVNode("img",{src:c.url,style:{width:"100%"},alt:""},null,8,Xc)])):(n.openBlock(),n.createBlock(a,{key:0,icon:"file-text",style:n.normalizeStyle({color:c.color?`var(${c.color})`:void 0}),size:72},null,8,["style"])),n.createElementVNode("div",Zc,[n.createVNode(l,{ellipsis:""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(t)(c.name)}${c.status==="unUpload"?"("+n.unref(t)("未传")+")":""}`),1)]),_:2},1024),n.createElementVNode("div",null,[c.status==="uploading"?(n.openBlock(),n.createBlock(l,{key:0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.uploadSize))+"/",1)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(l,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.size)),1)]),_:2},1024)])]),n.withDirectives(n.createElementVNode("div",Qc,[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createBlock(r,{key:0,icon:"mdi:eye",type:"link",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):n.createCommentVNode("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?(n.openBlock(),n.createBlock(r,{key:1,icon:"mdi:delete",type:"link",danger:"",onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):n.createCommentVNode("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"default")],64)):e.isUploadImg?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-imgItem"},[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createElementBlock("img",{key:0,src:c.url,style:{width:"100%"},alt:""},null,8,ed)):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",td,[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createBlock(r,{key:0,type:"link",icon:"mdi:eye",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):n.createCommentVNode("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?(n.openBlock(),n.createBlock(r,{key:1,type:"link",danger:"",icon:"mdi:delete",onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):n.createCommentVNode("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:1,"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-item"},[n.createVNode(a,{icon:"file-text",style:n.normalizeStyle({color:c.color?`var(${c.color})`:void 0}),size:16},null,8,["style"]),n.createElementVNode("div",nd,[n.createVNode(d,{type:"primary",underline:"never",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(t)(c.name)}${c.status==="unUpload"?"("+n.unref(t)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),c.status==="uploading"?(n.openBlock(),n.createBlock(l,{key:0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.uploadSize))+"/",1)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(l,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.size)),1)]),_:2},1024),c.status==="done"&&e.isShowSuccessIcon?(n.openBlock(),n.createBlock(a,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):n.createCommentVNode("",!0),e.readonly?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createBlock(a,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128))],2)}}}),od={class:"j-upload"},id={key:0},ad={style:{"margin-top":"8px"}},ld={key:0,style:{"margin-top":"4px"}},rd={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},sd=["src"],cd={key:1,class:"j-block"},dd=["src"],Ba=te(n.defineComponent({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(e,{emit:t}){const o=e,i=t,{warning:a,error:l,createConfirm:r,t:s,apiUrl:d,token:c,useFile:f}=Pe(),{fileChunkedUpload:u,deleteFile:p}=f(),h=n.computed(()=>o.isUploadImg?o.accept||"image/*":o.accept),m=n.computed(()=>{if(o.limit!==-1)return o.limit}),g=n.computed(()=>o.limit===-1?"":`,${s("上传数量")}${o.limit}`),b=n.ref(""),k=n.computed(()=>({folderId:o.modelValue||b.value,maxSize:o.maxSize,sizeType:o.sizeType})),v=n.ref([]),w=()=>{v.value=[...v.value]},C=H=>{if(o.maxSize&&o.sizeType){let X=H;switch(o.sizeType){case"GB":X=1024*1024*1024*o.maxSize;break;case"MB":X=1024*1024*o.maxSize;break;case"KB":X=1024*o.maxSize;break;default:X=o.maxSize;break}if(X<H)return!1}return!0},S={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},y=H=>{if(H){const X=H.split(".");return X[X.length-1]}return""},E=(H,X)=>{if(X&&X.indexOf("image")>-1)return"file-image";const le=y(H);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(le)?"file-image":S[le]||"file-ufo"},B=H=>{H.status=o.autoUpload?"uploading":"unUpload",H.uploadSize=0,H.icon=E(H.name,H.type),u||(H.icon="file-text"),H.id=H.uid,H.url=window.URL.createObjectURL(H),H.date=pn(),H.param=k.value},_=H=>{i("start",{file:H,list:v.value})},T=(H,X,le)=>{H.percent=le,H.uploadSize=X,w()},j=H=>{H.status="done",H.id+="1",H.uid+="1",w(),i("success",{file:H,list:v.value}),o.modelValue||(i("update:modelValue",b.value),i("change",{value:b.value}))},D=(H,X)=>{console.error(X,"简搭提醒您:文件上传错误!"),H.status="error",w(),i("error",{file:H,list:v.value})},A=H=>{if(v.value.push(H),H.status==="unUpload"){i("notUploadChange",{value:H.url});return}!o.isNotApi&&o.upload?o.upload(H):!o.isNotApi&&u?u(H,{onStart:_,onProgress:T,onSuccess:j,onError:D,uploadCallback:o.uploadCallback}):j(H)},R=H=>{if(!C(H.size))return l&&l("上传文件超出大小了"),!1},V=H=>{B(H.file),A(H.file)},x=H=>new Promise(X=>{r?r({title:"提示",iconType:"warning",content:`您确定删除【${H.name}】?`,onOk:()=>{X(!0)},onCancel:()=>{X(!1)}}):(L(H),X(!0))}),L=H=>{if(!o.isNotApi){const X=H.response?.fileId||H.id;p&&p(X)}v.value=v.value.filter(X=>X.id!==H.id),v.value.length===0&&(i("update:modelValue",""),i("change",{value:""})),i("delete",{file:H,list:v.value})},P=async H=>{await x(H)&&L(H)},G=n.ref(!1),K=n.ref(""),ne=n.ref(""),pe=n.ref(!1),fe=n.ref(!1);let Y=null;const he=n.ref(pn(new Date,"YYYY-MM-DD")),ae=H=>{if(H.isPreview===!1&&!o.isUploadImg){a&&a("无权限预览!");return}const X=H.name.split(".")[H.name.split(".").length-1];switch(Y=H,G.value=!1,K.value=H.name,X.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":G.value=!0,ne.value=H.url,fe.value=!1,pe.value=!0;break;default:if(o.isNotApi){a&&a("预览表单中,不支持预览!");return}if(H.status!=="done"){a&&a("当前文件还没上传成功,不支持预览!");return}if(ne.value=se(H),ne.value===""){a&&a("当前文件不支持预览!");return}fe.value=!0,pe.value=!0;break}he.value=pn(new Date,"YYYY-MM-DD HH:mm:ss")},se=H=>{const X=H.response?.fileId||H.id;if(!d)return"";const le=pn(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+X,we=Qi.createAesEncryption({key:"jianda"}).encrypt(le).replace(/\//g,"|");return`${d}/system/annexesfile/preview/${we}?token=${c?.value}`},xe=()=>{Y.isDown===!1&&a&&a("无权限下载!");const H=Y.response?.fileId||Y.id,X=`${d}/system/annexesfile/${H}?token=${c?.value}`;Gc(X)},Ve=()=>{if(o.limit!==-1&&o.limit<=v.value.length)return a&&a(`当前限制选择${o.limit}个文件`),!1};return(H,X)=>{const le=n.resolveComponent("j-icon"),we=n.resolveComponent("j-button"),$e=n.resolveComponent("el-popover"),Re=n.resolveComponent("el-upload"),me=n.resolveComponent("el-text"),De=n.resolveComponent("j-dialog-full"),ut=n.resolveDirective("loading");return n.openBlock(),n.createElementBlock("div",od,[n.createVNode(Re,{action:"",drag:e.drag,disabled:e.readonly,"show-file-list":e.isUploadImg&&!e.isLayer&&e.showFileList,"list-type":e.isUploadImg&&!e.isLayer?"picture-card":void 0,accept:h.value,limit:m.value,multiple:e.multiple,"before-upload":R,"http-request":V,"file-list":v.value,"before-remove":x,"on-remove":L,"on-preview":ae,"on-exceed":Ve},{default:n.withCtx(()=>[e.isUploadImg&&!e.isLayer&&!e.readonly?(n.openBlock(),n.createElementBlock("div",id,[n.createVNode(le,{icon:"mdi:add"}),n.createElementVNode("div",ad,n.toDisplayString(n.unref(s)(e.placeholder)),1)])):e.isLayer&&e.showFileList&&v.value.length>0&&!pe.value?(n.openBlock(),n.createBlock($e,{key:1,placement:"bottom",title:e.isUploadImg?n.unref(s)("图片列表"):n.unref(s)("文件列表")},{content:n.withCtx(()=>[n.createVNode(Sa,{style:n.normalizeStyle({width:e.isUploadImg?void 0:"400px"}),list:v.value,"preview-file":ae,"delete-file":P,"is-upload-img":e.isUploadImg,readonly:e.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:n.withCtx(()=>[n.createVNode(we,{type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.readonly?n.unref(s)(e.btnText):e.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):e.readonly?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(we,{key:2,type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.placeholder},null,8,["type","size","label"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),e.isTip?(n.openBlock(),n.createElementBlock("div",ld,[n.createVNode(me,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(s)("只能上传不超过{0}的{1}文件",`${e.maxSize}${e.sizeType}`,`${h.value||""}`)},${g.value}`),1)]),_:1})])):n.createCommentVNode("",!0),!e.isLayer&&!e.isUploadImg&&e.showFileList&&v.value.length>0?(n.openBlock(),n.createBlock(Sa,{key:1,style:{"margin-top":"4px"},list:v.value,"preview-file":ae,"delete-file":P,readonly:e.readonly,"is-show-success-icon":e.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):n.createCommentVNode("",!0),n.createVNode(De,{visible:pe.value,"onUpdate:visible":X[1]||(X[1]=ot=>pe.value=ot),"btn-text":"下载",title:`${n.unref(s)("文件预览")}【${K.value}】`,"destroy-on-close":!0,"has-btns":!!n.unref(d),onOk:xe},{default:n.withCtx(()=>[G.value&&ne.value?(n.openBlock(),n.createElementBlock("div",rd,[n.createElementVNode("img",{width:"100%",style:{"max-width":"1024px"},src:ne.value,alt:""},null,8,sd)])):ne.value!=""?n.withDirectives((n.openBlock(),n.createElementBlock("div",cd,[n.createElementVNode("iframe",{ref:"iframe",src:ne.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:X[0]||(X[0]=ot=>fe.value=!1)},null,40,dd)])),[[ut,fe.value]]):n.createCommentVNode("",!0)]),_:1},8,["visible","title","has-btns"])])}}})),ud=n.defineComponent({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.shallowRef();let s=null,d=null;const c=async()=>{l.value&&(r.value=zs.init(l.value,i.theme,i.initOptions),f(i.option),r.value&&r.value.on("click",m=>{a("click",m)}),typeof window<"u"&&window.ResizeObserver&&(s=new ResizeObserver(()=>{r.value?.resize()}),s.observe(l.value)),r.value&&a("ready",r.value))},f=m=>{r.value&&(d&&clearTimeout(d),i.updateDelay>0?d=setTimeout(()=>{r.value?.setOption(m,i.notMerge)},i.updateDelay):r.value.setOption(m,i.notMerge))};return n.watch(()=>i.option,m=>{f(m)},{deep:!0}),n.onMounted(()=>{c()}),n.onUnmounted(()=>{d&&clearTimeout(d),s&&l.value&&(s.unobserve(l.value),s.disconnect(),s=null),r.value&&(r.value.dispose(),r.value=void 0)}),t({getInstance:()=>r.value,resize:m=>{r.value?.resize(m)},clear:()=>{r.value?.clear()}}),(m,g)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartRef",ref:l,class:"j-echarts"},null,512))}}),Ea=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},_a=te(Ea(ud,[["__scopeId","data-v-69ad659b"]])),fd=["innerHTML"],pd={key:1,class:"j-barcode-error"},ja=te(n.defineComponent({name:"JBarcode",__name:"barcode",props:{bcid:{type:String,required:!0},modelValue:{type:String,required:!0},scale:{type:Number,default:2},scaleX:{type:Number,default:null},scaleY:{type:Number,default:null},height:{type:Number,default:10},width:{type:Number,default:void 0},rotate:{type:String,default:"N"},barcolor:{type:String,default:"000000"},backgroundcolor:{type:String,default:""},padding:{type:Number,default:0},paddingwidth:{type:Number,default:null},paddingheight:{type:Number,default:null},inkspread:{type:Number,default:0},includetext:{type:Boolean,default:!0},alttext:{type:String,default:""},textfont:{type:String,default:"OCR-B"},textsize:{type:Number,default:10},textxalign:{type:String,default:"center"},textyalign:{type:String,default:void 0},textxoffset:{type:Number,default:0},textyoffset:{type:Number,default:0},textcolor:{type:String,default:""},includecheck:{type:Boolean,default:!1},includecheckintext:{type:Boolean,default:!1},parse:{type:Boolean,default:!1},parsefnc:{type:Boolean,default:!1},guardwhitespace:{type:Boolean,default:!1},guardwidth:{type:Number,default:null},eclevel:{type:[String,Number],default:"M"},version:{type:[Number,String],default:""},format:{type:String,default:""},columns:{type:Number,default:null},rows:{type:Number,default:null},errorlevel:{type:Number,default:null}},setup(e){const t=e,o=n.ref(""),i=n.ref(""),a=f=>{if(f.length!==13)throw new Error("GTIN must be 13 digits for checksum calculation");let u=0;for(let h=12;h>=0;h--){const m=parseInt(f[h]),b=(13-h)%2===1?3:1;u+=m*b}return(10-u%10)%10},l=f=>{const u=/\(01\)(\d{14})/,p=f.match(u);if(!p)return f;const h=p[1],m=h.substring(0,13),g=parseInt(h[13]),b=a(m);if(g!==b){const k=m+b;return f.replace(u,`(01)${k}`)}return f},r=f=>{if(!/^\d+$/.test(f))return f;const u={11:10,45:18,59:18,62:25},p=Object.keys(u);let h=null;for(const k of p)if(f.startsWith(k)){h=k;break}let m=f,g=!1;if(!h){const k=f.length;if(k<=8)m="11"+f.substring(0,8),g=!0,h="11";else if(k<=16){const v=f.substring(0,8),w=f.substring(8,16);m="59"+v+w,g=!0,h="59"}else{const w=f.substring(0,23),C=w.substring(0,8),S=w.substring(8,23);m="62"+C+S,m.length!==25&&(m=m.substring(0,25)),g=!0,h="62"}}if(h&&!g){const k=u[h];m.length>k&&(m=m.substring(0,k))}let b=null;for(const k of p)if(m.startsWith(k)){b=k;break}if(b){const k=u[b];m.length>k&&(m=m.substring(0,k))}else console.error("AUSPOST: 无法检测到有效的FCC,结果:",m);return/^\d+$/.test(m)?(m.length>25&&(console.error("AUSPOST: 返回值长度超过25位:",m.length,m),m=m.substring(0,25)),m):(console.error("AUSPOST: 返回值不是纯数字:",m),f)},s=f=>{if(!/^\d+$/.test(f))throw new Error("PZN must contain only digits");if(f.length===7){const u=f.substring(0,6);let p=0;for(let m=0;m<6;m++){const g=parseInt(u[m]),b=m+2;p+=g*b}const h=p%11;return h===10?null:h}else if(f.length===8){const u=f.substring(0,7);let p=0;for(let m=0;m<7;m++){const g=parseInt(u[m]),b=m+1;p+=g*b}const h=p%11;return h===10?null:h}else throw new Error("PZN must be 7 or 8 digits")},d=f=>{if(!/^\d+$/.test(f)||f.length!==7&&f.length!==8)return f;try{const u=s(f);if(u===null)return f;if(f.length===7){const p=f.substring(0,6);if(parseInt(f[6])!==u)return p+u}else if(f.length===8){const p=f.substring(0,7);if(parseInt(f[7])!==u)return p+u}}catch(u){console.warn("PZN checksum calculation failed:",u.message)}return f},c=()=>{try{i.value="";const f={...t};Object.keys(f).forEach(m=>{(f[m]===null||f[m]===""||f[m]===void 0)&&delete f[m]}),f.bcid==="codabar"&&(f.bcid="rationalizedCodabar"),f.bcid==="uspsonecode"&&(f.bcid="onecode"),f.bcid==="datamatrixrect"&&(f.bcid="datamatrix",f.format||(f.format="rectangle")),f.bcid==="datamatrix"&&f.format==="rect"&&(f.format="rectangle");const u=["offleft","left","center","right","offright"];if(f.textxalign&&!u.includes(f.textxalign)&&(console.warn(`Invalid textxalign value: ${f.textxalign}. Using default 'center'. Valid values: ${u.join(", ")}`),f.textxalign="center"),(f.bcid==="pdf417"||f.bcid==="micropdf417")&&delete f.eclevel,(f.bcid==="qrcode"||f.bcid==="microqrcode")&&delete f.errorlevel,f.bcid==="azteccode"&&(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"&&/^[LMQH]$/i.test(f.eclevel)&&delete f.eclevel),f.bcid==="hanxin")if(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"){const m={L:"L1",M:"L2",Q:"L3",H:"L4"},g=f.eclevel.toUpperCase();m[g]?f.eclevel=m[g]:/^L[1-4]$/i.test(f.eclevel)||(f.eclevel="L1")}else f.eclevel||(f.eclevel="L1");let p=f.modelValue;if(t.bcid==="gs1-128"&&typeof p=="string")try{p=l(p),p!==f.modelValue&&console.warn(`GS1-128 AI 01 checksum corrected: ${f.modelValue} -> ${p}`)}catch(m){console.warn("GS1 checksum validation failed:",m.message)}if(t.bcid==="auspost"&&typeof p=="string")try{const m=p;if(p=r(p),p!==m){const g=m.length>p.length,b=p.match(/^(11|45|59|62)/),k=b?b[1]:"unknown";console.warn(g?`AUSPOST 值已调整: ${m} -> ${p} (长度: ${m.length} -> ${p.length}, FCC: ${k})`:`AUSPOST FCC 已添加: ${m} -> ${p} (FCC: ${k}, 长度: ${p.length})`)}}catch(m){console.error("[AUSPOST] FCC validation failed:",m),console.warn("AUSPOST FCC validation failed:",m.message)}if(t.bcid==="pzn"&&typeof p=="string")try{const m=p;p=d(p),p!==m&&console.warn(`PZN checksum corrected: ${m} -> ${p}`)}catch(m){console.warn("PZN checksum validation failed:",m.message)}f.text=p,delete f.modelValue,t.bcid==="auspost"&&typeof p=="string"&&p.match(/^(11|45|59|62)/)&&(p.length>20?(f.custinfoenc="numeric",console.log(`[AUSPOST] 值长度 ${p.length} > 20,使用数字编码 (custinfoenc=numeric)`)):/^\d+$/.test(p)&&(f.custinfoenc="numeric",console.log("[AUSPOST] 值全是数字,使用数字编码 (custinfoenc=numeric)"))),t.scaleX||(f.scaleX=t.scale),t.scaleY||(f.scaleY=f.scaleX),["qrcode","microqrcode","datamatrix","datamatrixrect","pdf417","micropdf417","azteccode","hanxin"].includes(f.bcid)&&(f.width||(f.width=f.height));const h=js.toSVG(f);o.value=h}catch(f){console.error("BWIP-JS Render Error:",f);let u=f.message||"条码数据或参数错误";f.message&&f.message.includes("Bad checksum")&&t.bcid==="gs1-128"?u=`GS1-128 校验位错误: ${f.message}。请确保 AI 01 的14位数字包含正确的校验位。`:f.message&&f.message.includes("GS1badChecksum")?u=`GS1 校验位错误: ${f.message}。请检查应用标识符 (AI) 的数据格式和校验位是否正确。`:f.message&&f.message.includes("auspostBadFCC")&&t.bcid==="auspost"?u=`AUSPOST FCC 错误: ${f.message}。AUSPOST 条码必须以有效的 FCC (Format Control Code) 开头:11, 45, 59 或 62。如果值未以有效的 FCC 开头,系统会自动添加合适的 FCC。`:f.message&&f.message.includes("auspostTooLong")&&t.bcid==="auspost"?u=`AUSPOST 长度错误: ${f.message}。AUSPOST 条码长度限制:FCC 11 (10位), FCC 59 (18位), FCC 62 (25位,最大容量)。如果值超过限制,系统会自动截断并使用合适的 FCC。`:f.message&&f.message.includes("pznBadCheckDigit")&&t.bcid==="pzn"&&(u=`PZN 校验位错误: ${f.message}。PZN (德国医药产品编号) 必须是7位或8位数字,包含正确的校验位。如果校验位不正确,系统会自动修复。`),i.value=u,o.value=""}};return n.watchEffect(c),(f,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-barcode",innerHTML:o.value},null,8,fd)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createElementBlock("div",pd,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)],64))}})),Va=te(n.defineComponent({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=(...y)=>{y=y.flat();let E=0;for(let B=0;B<y.length;B++)E+=y[B];return E/y.length},a=(y,E)=>E<0?-Math.ceil(y/Math.abs(E))*E||0:Math.ceil(y/E)*E||0,l=(...y)=>(y=y.flat(),y.length),r=(y,E)=>{let B=0;if(Array.isArray(y))if(/[><=]/.test(E)){const _=E.match(/^([><=]+)(.+)$/);if(_){const T=_[1],j=Number(_[2]);for(let D=0;D<y.length;D++)try{const A=Number(y[D]);let R=!1;switch(T){case">":R=A>j;break;case"<":R=A<j;break;case">=":R=A>=j;break;case"<=":R=A<=j;break;case"==":case"===":R=A===j;break;case"!=":case"!==":R=A!==j;break}R&&B++}catch{console.log("计算失败");break}}}else for(let _=0;_<y.length;_++)y[_]===E&&B++;return B},s=(y,E)=>y.toFixed(E),d=(y,E)=>E<0?-Math.floor(y/Math.abs(E))*E||0:Math.floor(y/E)*E||0,c=(y,E)=>{if(Array.isArray(y))return y.sort((B,_)=>_-B),y[E-1]},f=(y,E)=>{if(Array.isArray(y))return y.sort((B,_)=>B-_),y[E-1]},u=(y,E)=>Math.log(y)/Math.log(E),p=(y,E)=>y%E,h=(...y)=>{y=y.flat();let E=1;for(let B=0;B<y.length;B++)E*=y[B];return E},m=(y,E)=>{const B=y.toFixed(E);return Number(B)},g=(...y)=>{y=y.flat();let E=0;for(let B=0;B<y.length;B++)E+=Number(y[B]);return E},b=(...y)=>y[0].map((_,T)=>{let j=_;for(let D=1;D<y.length;D++)j*=y[D][T]||0;return j}).reduce((_,T)=>_+T,0),k=t,{getValue:v}=Kt(),w=y=>{const E=v({id:y});if(Mn(E)){const _=[];return E.forEach(T=>{const j=Number(T);Number.isNaN(j)?_.push(0):_.push(j)}),_}const B=Number(E);return Number.isNaN(B)?0:B},C=n.computed(()=>{if(!v)return"";const y=JSON.parse(o.formatJson||"[]");let E="";for(let T=0;T<y.length;T++){const j=y[T];if(j.type==="fun"&&j.value!=="("&&j.value!==")")if(["abs","max","min","sqrt"].includes(j.value))E+=`Math.${j.value}`;else if(["int","power","rand"].includes(j.value))switch(j.value){case"int":E+="Math.floor";break;case"power":E+="Math.pow";break;case"rand":E+="Math.random";break}else E+=`${j.value}Fun`;else j.type==="comp"?E+=`getCompValue('${j.value}')`:j.value==="i"&&o.tableIndex!==void 0?E+=o.tableIndex:E+=j.value}if(!E)return"";E=`(
2
2
  averageFun,
3
3
  ceilingFun,
4
4
  countFun,
@@ -13,4 +13,4 @@
13
13
  roundFun,
14
14
  sumFun,
15
15
  sumproductFun,
16
- getCompValue)=>{ return ${w} }`;let z;const $=Ie(w);if($.res)try{z=$.fn(o,i,a,s,c,p,d,f,r,h,y,u,m,b,E)}catch(W){console.log(W,"计算组件公式运行错误")}else return console.log($.msg),"";return Number.isNaN(z)?"":(l.decimal!==void 0&&(z=z.toFixed(l.decimal)),z)}),A=e.computed(()=>{let g=F.value;return l.thousandSeparator&&(g=Ke(g)),l.isChinese&&(g=Ze(g)),g});return e.watch(F,g=>{k("update:modelValue",g),k("change",{value:g,data:A.value})}),(g,w)=>{const z=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(z,{modelValue:A.value,"onUpdate:modelValue":w[0]||(w[0]=$=>A.value=$),readonly:"",size:t.size},null,8,["modelValue","size"])}}})),Sl={key:0},Lt=P(e.defineComponent({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(t,{expose:n}){const l=t,o=e.computed(()=>({...l})),i=e.ref(),a=e.ref(null),s=e.computed(()=>l.options);e.onMounted(()=>{l.animation&&c()}),e.watch(()=>l.decimals,()=>{a.value&&a.value.update&&(a.value.options.decimalPlaces=l.decimals,a.value.reset(),a.value.update(l.endValue))},{deep:!0}),e.watch(()=>l.endValue,h=>{a.value&&a.value.update&&a.value.update(h)});const c=()=>{a.value||(s.value.startVal=l.startValue,s.value.decimalPlaces=l.decimals,s.value.duration=l.duration,a.value=new ro.CountUp(i.value,Number(l.endValue),s.value),a.value.start(()=>{l.callback?.(a.value)}))};return e.onUnmounted(()=>{a.value=null}),e.onBeforeUnmount(()=>{a.value=null}),n({myProps:o,el:i,init:c,start:h=>{a.value&&a.value.start&&a.value.start(()=>{h?.(a.value)})},pauseResume:()=>{a.value&&a.value.pauseResume&&a.value.pauseResume()},reset:()=>{a.value&&a.value.reset&&a.value.reset()},update:h=>{a.value&&a.value.update&&a.value.update(h)}}),(h,y)=>(e.openBlock(),e.createElementBlock("span",{ref_key:"el",ref:i},[t.animation?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Sl,e.toDisplayString(t.endValue),1))],512))}})),Vl={class:"j-block j-data-panel"},jl={key:0,class:"j-data-panel-header"},Nl={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},$l={class:"j-data-panel-header-right"},zl={class:"j-data-panel-body"},Mt=P(e.defineComponent({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(t){return(n,l)=>(e.openBlock(),e.createElementBlock("div",Vl,[t.title?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("div",Nl,e.toDisplayString(t.title),1),e.createElementVNode("div",$l,[e.renderSlot(n.$slots,"titleRight")])])):e.createCommentVNode("",!0),e.createElementVNode("div",zl,[e.renderSlot(n.$slots,"default")])]))}})),El={class:"j-divider-content"},Dt=P(e.defineComponent({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(t){const n=t,l=e.computed(()=>{const i={color:n.color};return n.size&&Number(n.size)&&(i.fontSize=`${n.size}px`),i}),o=e.computed(()=>({borderTopStyle:n.borderStyle}));return(i,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`j-divider-container j-divider-${t.contentPosition}`),style:e.normalizeStyle(l.value)},[e.createElementVNode("div",{class:"j-divider-line j-divider-line-left",style:e.normalizeStyle(o.value)},null,4),e.createElementVNode("div",El,[e.createElementVNode("span",null,e.toDisplayString(t.content||""),1)]),e.createElementVNode("div",{class:"j-divider-line j-divider-line-right",style:e.normalizeStyle(o.value)},null,4)],6))}})),Tl={class:"j-hpanel"},Ll={class:"j-hpanel-main"},Ft=P(e.defineComponent({name:"JHpanel",__name:"hpanel",setup(t){return(n,l)=>(e.openBlock(),e.createElementBlock("div",Tl,[e.renderSlot(n.$slots,"left"),e.createElementVNode("div",Ll,[e.renderSlot(n.$slots,"default")]),e.renderSlot(n.$slots,"right")]))}})),It=P(e.defineComponent({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.ref(),a=e.ref(),s=async(f,r)=>{l.ok&&(f("保存数据中..."),a.value=await l.ok(),o("update:modelValue",a.value),o("change",{value:a.value}),r(),i.value.close())},c=()=>l.beforeClose?l.beforeClose(a.value):!0,p=()=>{l.closed?.()},d=()=>{i.value.open(l.title||l.btnText,l.layerType),setTimeout(()=>{l.open?.(a.value)},200)};return e.watch(()=>l.modelValue,f=>{a.value=f},{immediate:!0}),(f,r)=>{const h=e.resolveComponent("j-button"),y=e.resolveComponent("j-layer");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(h,e.mergeProps({style:{width:"auto"}},f.$attrs,{type:t.type,label:t.btnText,size:t.size,onClick:d}),null,16,["type","label","size"]),e.createVNode(y,{ref_key:"layerRef",ref:i,height:t.height,width:t.width,"destroy-on-close":t.destroyOnClose,"btn-text":"确定","before-close":c,onOk:s,onClosed:p},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}})),Ot=P(e.defineComponent({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,i=e.computed({get:()=>l.modelValue,set:r=>{o("update:modelValue",r)}}),a=e.ref(""),s=r=>{a.value=r},c=()=>a.value,p=r=>l.beforeClose?l.beforeClose(r):!0,d=r=>{o("change",r)},f=e.computed(()=>l.modelValue&&l.modelValue.trim()?`${l.btnText}(已设置)`:l.btnText);return(r,h)=>{const y=e.resolveComponent("j-code-mirror"),u=e.resolveComponent("j-layout"),m=e.resolveComponent("j-input-button");return e.openBlock(),e.createBlock(m,{modelValue:i.value,"onUpdate:modelValue":h[1]||(h[1]=b=>i.value=b),type:t.type,"btn-text":f.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":p,ok:c,open:s,onChange:d},{default:e.withCtx(()=>[e.createVNode(u,{"right-move":!1,right:560},e.createSlots({default:e.withCtx(()=>[e.createVNode(y,{value:a.value,"onUpdate:value":h[0]||(h[0]=b=>a.value=b),mode:t.mode,"is-hint":t.isHint,"handle-hint":t.handleHint},null,8,["value","mode","is-hint","handle-hint"])]),_:2},[t.example?{name:"right",fn:e.withCtx(()=>[e.createVNode(y,{value:t.example,mode:t.mode,"read-only":""},null,8,["value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}})),vt=P(e.defineComponent({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"}},setup(t){const n=t,l=e.computed(()=>n.class||""),o=e.computed(()=>{const i={...n.style};return n.color&&(i.color=n.color),n.size&&(typeof n.size=="number"?i.fontSize=`${n.size}px`:i.fontSize=n.size),n.weight&&(i.fontWeight=n.weight),i});return(i,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-title",l.value]),style:e.normalizeStyle(o.value)},e.toDisplayString(t.title),7))}})),At=P(e.defineComponent({name:"JCodeMirror",__name:"code-mirror",props:{value:{default:""},mode:{default:"application/javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:value","change"],setup(t,{expose:n,emit:l}){const o=t,i=l,a=e.ref(),s=e.ref(),c=e.ref("");let p;const d=()=>{const u=p.getCursor(),m=p.getTokenAt(u),{end:b,start:k,string:B}=m;let E=[];return o.handleHint&&(E=o.handleHint(B)),{list:E,from:window.CodeMirror.Pos(u.line,k),to:window.CodeMirror.Pos(u.line,b)}},f=()=>{if(!window.CodeMirror){console.error("CodeMirror is not loaded yet");return}const u={lineNumbers:!0,styleActiveLine:!0,matchBrackets:!0,readOnly:o.readonly,mode:o.mode,indentUnit:2,gutters:["CodeMirror-lint-markers","CodeMirror-linenumbers","CodeMirror-foldgutter"]},m=window.CodeMirror;m.fold&&m.fold.combine&&m.fold.indent&&m.fold.comment?u.foldGutter={rangeFinder:new m.fold.combine(m.fold.indent,m.fold.comment)}:u.gutters=["CodeMirror-lint-markers","CodeMirror-linenumbers"],o.mode==="text/x-vue"&&(u.mode={name:"vue"}),o.isHint&&(u.hintOptions={hint:d,completeSingle:!1}),p=window.CodeMirror.fromTextArea(a.value,u),c.value=o.value,p.setValue(o.value),p.on("change",(b,k)=>{o.isHint&&k.origin!=="complete"&&/^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/g.test(k.text[0])&&b.showHint();const B=p.getValue();c.value=B,i("update:value",B),i("change",{value:B})})},r=()=>{let u=uo.format(o.value);u=u.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),i("update:value",u),i("change",{value:u})},h=()=>{const u=p.getScrollInfo();p.scrollTo(u.left,u.height+u.top)},y=new ResizeObserver(()=>{p?.refresh()});return e.watch(()=>o.value,u=>{u!==c.value&&(c.value=u,p?.setValue(u),setTimeout(()=>{p?.refresh(),o.isScrollToBottom&&h()}))}),e.watch(()=>o.mode,u=>{p?.setOption("mode",u)}),e.onMounted(()=>{let u=0;const m=50,b=()=>{const k=window.CodeMirror,B=k&&k.fromTextArea,E=!k?.fold||k.fold.combine&&k.fold.indent&&k.fold.comment;B&&E?(f(),setTimeout(()=>{p?.refresh()},300),y.observe(s.value)):(u++,u<m?setTimeout(b,100):console.error("CodeMirror failed to load after maximum retries"))};b()}),e.onUnmounted(()=>{p.off("change"),p=null}),n({sqlFormatter:r}),(u,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"codeWraperRef",ref:s,class:"j-code-mirror",style:e.normalizeStyle({height:t.height?`${t.height}px`:""})},[e.createElementVNode("textarea",{ref_key:"codeRef",ref:a},null,512)],4))}})),Ml=e.defineComponent({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(t,{expose:n}){const l=t,o=e.useTemplateRef("actionRef"),i=e.ref("0"),a=e.computed(()=>{const{actionStyle:c,toLeft:p}=l;return{...c,left:p?"0":i.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:s.value?"6px":void 0,transition:p?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),s=e.computed(()=>Number.parseInt(i.value)>10&&!l.isPassing);return n({getEl:()=>o.value,getStyle:()=>o?.value?.style,setLeft:c=>{i.value=c}}),(c,p)=>{const d=e.resolveComponent("j-icon");return e.openBlock(),e.createElementBlock("div",{ref_key:"actionRef",ref:o,style:e.normalizeStyle(a.value),class:"j-slider-captcha-action",name:"captcha-action"},[t.isPassing?(e.openBlock(),e.createBlock(d,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi-light:check-circle"})):(e.openBlock(),e.createBlock(d,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi-light:chevron-double-right"}))],4)}}}),Dl=e.defineComponent({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(t,{expose:n}){const l=t,o=e.useTemplateRef("barRef"),i=e.ref("0"),a=e.computed(()=>{const{barStyle:s,toLeft:c}=l;return{...s,width:c?"0":i.value,transition:c?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return n({getEl:()=>o.value,setWidth:s=>{i.value=s}}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"barRef",ref:o,style:e.normalizeStyle(a.value)},null,4))}}),Fl=e.defineComponent({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(t,{expose:n}){const l=t,o=e.useTemplateRef("contentRef"),i=e.computed(()=>{const{contentStyle:s}=l;return{...s,fontSize:"12px"}});n({getEl:()=>o.value});const a=e.computed(()=>({animation:`shine ${l.animationDuration}s linear ${l.animationIterationCount}`}));return(s,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contentRef",ref:o,class:e.normalizeClass([{success:t.isPassing},"j-slider-captcha-content"]),style:e.normalizeStyle(i.value)},[e.createElementVNode("div",{style:e.normalizeStyle(a.value),class:"j-spine-text"},e.toDisplayString(t.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),Rt=P(e.defineComponent({name:"JSliderCaptcha",__name:"slider-captcha",props:e.mergeModels({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:e.mergeModels(["end","move","start","success"],["update:modelValue"]),setup(t,{emit:n}){const l=t,o=n,i=e.useModel(t,"modelValue"),a=e.reactive({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),s=e.useTemplateRef("wrapperRef"),c=e.useTemplateRef("barRef"),p=e.useTemplateRef("contentRef"),d=e.useTemplateRef("actionRef");e.watch(()=>a.isPassing,k=>{if(k){const{endTime:B,startTime:E}=a,F=(B-E)/1e3;o("success",{isPassing:k,time:F.toFixed(1)}),i.value=k}}),e.watchEffect(()=>{a.isPassing=!!i.value});function f(k){return"pageX"in k?k.pageX:"touches"in k&&k.touches[0]?k.touches[0].pageX:0}function r(k){a.isPassing||d.value&&(o("start",k),a.moveDistance=f(k)-Number.parseInt(d.value.getStyle().left.replace("px","")||"0",10),a.startTime=Date.now(),a.isMoving=!0)}function h(k){const B=s.value?.offsetWidth??220,E=k?.offsetWidth??40,F=B-E-6;return{actionWidth:E,offset:F,wrapperWidth:B}}function y(k){const{isMoving:B,moveDistance:E}=a;if(B){const F=e.unref(d),A=e.unref(c);if(!F||!A)return;const{actionWidth:g,offset:w,wrapperWidth:z}=h(F.getEl()),$=f(k)-E;o("move",{event:k,moveDistance:E,moveX:$}),$>0&&$<=w?(F.setLeft(`${$}px`),A.setWidth(`${$+g/2}px`)):$>w&&(F.setLeft(`${z-g}px`),A.setWidth(`${z-g/2}px`),m())}}function u(k){const{isMoving:B,isPassing:E,moveDistance:F}=a;if(B&&!E){o("end",k);const A=d.value,g=e.unref(c);if(!A||!g)return;const w=f(k)-F,{actionWidth:z,offset:$,wrapperWidth:W}=h(A.getEl());w<$?b():(A.setLeft(`${W-z}px`),g.setWidth(`${W-z/2}px`),m()),a.isMoving=!1}}function m(){a.endTime=Date.now(),a.isPassing=!0,a.isMoving=!1}function b(){a.isMoving=!1,a.isPassing=!1,a.moveDistance=0,a.toLeft=!1,a.startTime=0,a.endTime=0;const k=e.unref(d),B=e.unref(c),E=e.unref(p);!k||!B||!E||(E.getEl().style.width="100%",a.toLeft=!0,setTimeout(()=>{a.toLeft=!1,k.setLeft("0"),B.setWidth("0")},300))}return(k,B)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:s,class:e.normalizeClass(["j-slider-captcha slider-border",l.class]),style:e.normalizeStyle([{"background-color":"var(--j-color-bg)"},t.wrapperStyle]),onMouseleave:u,onMousemove:y,onMouseup:u,onTouchend:u,onTouchmove:y},[e.createVNode(Dl,{ref_key:"barRef",ref:c,"bar-style":t.barStyle,"to-left":a.toLeft},null,8,["bar-style","to-left"]),e.createVNode(Fl,{ref_key:"contentRef",ref:p,"content-style":t.contentStyle,"is-passing":a.isPassing},null,8,["content-style","is-passing"]),e.createVNode(Ml,{ref_key:"actionRef",ref:d,"action-style":t.actionStyle,"is-passing":a.isPassing,"to-left":a.toLeft,onMousedown:r,onTouchstart:r},null,8,["action-style","is-passing","to-left"])],38))}}));function Il(t,n){return e.getCurrentScope()?(e.onScopeDispose(t,n),!0):!1}const Ol=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function vl(t){return Array.isArray(t)?t:[t]}function Al(t){return e.getCurrentInstance()}function Rl(t,n=!0,l){Al()?e.onMounted(t,l):n?t():e.nextTick(t)}const Jt=Ol?window:void 0;function we(t){var n;const l=e.toValue(t);return(n=l?.$el)!==null&&n!==void 0?n:l}function Jl(){const t=e.shallowRef(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function Pl(t){const n=Jl();return e.computed(()=>(n.value,!!t()))}function Wl(t,n,l={}){const{window:o=Jt,...i}=l;let a;const s=Pl(()=>o&&"ResizeObserver"in o),c=()=>{a&&(a.disconnect(),a=void 0)},p=e.watch(e.computed(()=>{const f=e.toValue(t);return Array.isArray(f)?f.map(r=>we(r)):[we(f)]}),f=>{if(c(),s.value&&o){a=new ResizeObserver(n);for(const r of f)r&&a.observe(r,i)}},{immediate:!0,flush:"post"}),d=()=>{c(),p()};return Il(d),{isSupported:s,stop:d}}function Ul(t,n={width:0,height:0},l={}){const{window:o=Jt,box:i="content-box"}=l,a=e.computed(()=>{var r;return(r=we(t))===null||r===void 0||(r=r.namespaceURI)===null||r===void 0?void 0:r.includes("svg")}),s=e.shallowRef(n.width),c=e.shallowRef(n.height),{stop:p}=Wl(t,([r])=>{const h=i==="border-box"?r.borderBoxSize:i==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;if(o&&a.value){const y=we(t);if(y){const u=y.getBoundingClientRect();s.value=u.width,c.value=u.height}}else if(h){const y=vl(h);s.value=y.reduce((u,{inlineSize:m})=>u+m,0),c.value=y.reduce((u,{blockSize:m})=>u+m,0)}else s.value=r.contentRect.width,c.value=r.contentRect.height},l);Rl(()=>{const r=we(t);r&&(s.value="offsetWidth"in r?r.offsetWidth:n.width,c.value="offsetHeight"in r?r.offsetHeight:n.height)});const d=e.watch(()=>we(t),r=>{s.value=r?n.width:0,c.value=r?n.height:0});function f(){p(),d()}return{width:s,height:c,stop:f}}function ve(t,n){const{containerStyle:l,wrapperProps:o,scrollTo:i,calculateRange:a,currentList:s,containerRef:c}="itemHeight"in n?ql(n,t):Yl(n,t);return{list:s,scrollTo:i,containerProps:{ref:c,onScroll:()=>{a()},style:l},wrapperProps:o}}function Pt(t){const n=e.shallowRef(null),l=Ul(n),o=e.ref([]),i=e.shallowRef(t);return{state:e.ref({start:0,end:10}),source:i,currentList:o,size:l,containerRef:n}}function Wt(t,n,l){return o=>{if(typeof l=="number")return Math.ceil(o/l);const{start:i=0}=t.value;let a=0,s=0;for(let c=i;c<n.value.length;c++){const p=l(c);if(a+=p,s=c,a>o)break}return s-i}}function Ut(t,n){return l=>{if(typeof n=="number")return Math.floor(l/n)+1;let o=0,i=0;for(let a=0;a<t.value.length;a++){const s=n(a);if(o+=s,o>=l){i=a;break}}return i+1}}function Ht(t,n,l,o,{containerRef:i,state:a,currentList:s,source:c}){return()=>{const p=i.value;if(p){const d=l(t==="vertical"?p.scrollTop:p.scrollLeft),f=o(t==="vertical"?p.clientHeight:p.clientWidth),r=d-n,h=d+f+n;a.value={start:r<0?0:r,end:h>c.value.length?c.value.length:h},s.value=c.value.slice(a.value.start,a.value.end).map((y,u)=>({data:y,index:u+a.value.start}))}}}function Yt(t,n){return l=>typeof t=="number"?l*t:n.value.slice(0,l).reduce((o,i,a)=>o+t(a),0)}function qt(t,n,l,o){e.watch([t.width,t.height,()=>e.toValue(n),l],()=>{o()})}function Xt(t,n){return e.computed(()=>typeof t=="number"?n.value.length*t:n.value.reduce((l,o,i)=>l+t(i),0))}const Hl={horizontal:"scrollLeft",vertical:"scrollTop"};function Gt(t,n,l,o){return i=>{o.value&&(o.value[Hl[t]]=l(i),n())}}function Yl(t,n){const l=Pt(n),{state:o,source:i,currentList:a,size:s,containerRef:c}=l,p={overflowX:"auto"},{itemWidth:d,overscan:f=5}=t,r=Wt(o,i,d),h=Ht("horizontal",f,Ut(i,d),r,l),y=Yt(d,i),u=e.computed(()=>y(o.value.start)),m=Xt(d,i);return qt(s,n,c,h),{scrollTo:Gt("horizontal",h,y,c),calculateRange:h,wrapperProps:e.computed(()=>({style:{height:"100%",width:`${m.value-u.value}px`,marginLeft:`${u.value}px`,display:"flex"}})),containerStyle:p,currentList:a,containerRef:c}}function ql(t,n){const l=Pt(n),{state:o,source:i,currentList:a,size:s,containerRef:c}=l,p={overflowY:"auto"},{itemHeight:d,overscan:f=5}=t,r=Wt(o,i,d),h=Ht("vertical",f,Ut(i,d),r,l),y=Yt(d,i),u=e.computed(()=>y(o.value.start)),m=Xt(d,i);return qt(s,n,c,h),{calculateRange:h,scrollTo:Gt("vertical",h,y,c),containerStyle:p,wrapperProps:e.computed(()=>({style:{width:"100%",height:`${m.value-u.value}px`,marginTop:`${u.value}px`}})),currentList:a,containerRef:c}}const Xl=e.defineComponent({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(t,{emit:n}){const l=t,o=n,{getMenuMap:i,toArray:a,activeMenu:s,theme:c}=e.inject("jcode_menu_provide",{}),{getHMoreMenus:p}=e.inject("jianda_h_menu_provide",{}),d=e.ref([]);l.pId==="moreId"?d.value=p.value:d.value=a(i()[l.pId||""]||[],[]);const f=u=>{const m=d.value.find(b=>b.active);m?.value!==u.value&&(m&&(m.active=!1),o("click",u))},{list:r,containerProps:h,wrapperProps:y}=ve(d,{itemHeight:44});return(u,m)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-sub-menu-content",{"j-menu-dark":e.unref(c)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},e.unref(h)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(y))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),b=>(e.openBlock(),e.createBlock(Le,{key:b.data.value,"parent-actives":e.unref(s)?.pid?.split(".")||[],item:b.data,"is-sub":"",onClick:f},null,8,["parent-actives","item"]))),128))],16)],16))}}),Gl={class:"j-menu-item-label"},Ql={class:"j-menu-item-label"},Zl={key:1,class:e.normalizeClass(["j-menu-item-arrow","sub"])},Kl={class:"j-menu-item-label"},Le=e.defineComponent({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(t,{emit:n}){const{t:l}=e.inject("jcode_app_provide",{t:a=>a}),o=n,i=a=>{o("click",a)};return(a,s)=>{const c=e.resolveComponent("j-icon"),p=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-popover");return t.collapsed&&!t.item.hasChildren?(e.openBlock(),e.createBlock(p,{key:0,placement:"right"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(l)(t.item.label)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed}]),onClick:s[0]||(s[0]=e.withModifiers(f=>i(t.item),["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*24+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",Gl,e.toDisplayString(e.unref(l)(t.item.label)),1),t.item.hasChildren?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["j-menu-item-arrow",{open:t.item.open}])},null,2)):e.createCommentVNode("",!0)],6)],2)]),_:1})):(t.collapsed||t.isSub||t.isHorizontal||t.isVertical)&&t.item.hasChildren?(e.openBlock(),e.createBlock(d,{key:1,placement:t.isHorizontal?"bottom-start":"right-start","show-arrow":!1,"popper-class":"j-sub-menu"},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed}])},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*34+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,style:e.normalizeStyle({"margin-right":t.item.label&&(t.isSub||!t.isVertical)?"8px":0,"background-color":t.isVertical?t.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",Ql,e.toDisplayString(e.unref(l)(t.item.label)),1),t.item.hasChildren&&!t.isHorizontal&&!t.isVertical?(e.openBlock(),e.createElementBlock("div",Zl)):e.createCommentVNode("",!0)],6)],2)]),default:e.withCtx(()=>[e.createVNode(Xl,{"p-id":t.item.value,onClick:i},null,8,["p-id"])]),_:1},8,["placement"])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed,sub:t.item.indent>0}]),onClick:s[1]||(s[1]=e.withModifiers(f=>i(t.item),["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*24+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,class:"j-menu-item-icon",style:e.normalizeStyle({"margin-right":t.item.label&&(t.isSub||!t.isVertical)?"8px":0,"background-color":t.isVertical?t.item.color:"transparent"}),size:18},null,8,["icon","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",Kl,e.toDisplayString(e.unref(l)(t.item.label)),1),t.item.hasChildren?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["j-menu-item-arrow",{open:t.item.open}])},null,2)):e.createCommentVNode("",!0)],6)],2))}}}),_l=e.defineComponent({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(t,{emit:n}){const l=t,o=n,{activeMenu:i,theme:a}=e.inject("jcode_menu_provide",{}),s=r=>{o("click",r)},c=e.computed(()=>l.menuList),{list:p,containerProps:d,wrapperProps:f}=ve(c,{itemHeight:44});return(r,h)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-menu",{collapsed:t.collapsed,"j-menu-dark":e.unref(a)==="dark"}]},e.unref(d)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(f))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),y=>(e.openBlock(),e.createBlock(Le,{key:y.data.value,"parent-actives":e.unref(i)?.pid?.split(".")||[],item:y.data,onClick:s,collapsed:t.collapsed,class:e.normalizeClass({"menu-item-entering":y.data.entering,"menu-item-leaving":y.data.leaving})},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),en=e.defineComponent({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(t,{emit:n}){const l=t,o=n,{activeMenu:i,theme:a}=e.inject("jcode_menu_provide",{}),s=e.ref(),c=e.ref(0),p=new ResizeObserver(()=>{s.value&&(c.value=s.value.offsetWidth)});e.onMounted(()=>{p.observe(s.value)});const d=e.computed(()=>{const y=[];let u=0,m=0;const b=l.menuList.length;return l.menuList.forEach(k=>{m++;const B=(_e(k.label)||0)+32+16+4+8;u+=B,(m===b&&u<=c.value||m<b&&u+56<=c.value)&&y.push(k)}),y.length<l.menuList.length&&y.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),y}),f=e.computed(()=>{const y=[];let u=0;const m=d.value.length;return l.menuList.forEach(b=>{u++,u>=m&&y.push(b)}),y}),r=e.computed(()=>{const y=i.value?.pid?.split(".")||[];return(y.length>1&&f.value.findIndex(u=>u.value===y[1])>-1||f.value.findIndex(u=>u.value===i.value?.value)>-1)&&y.push("moreId"),y}),h=y=>{o("click",y)};return e.provide("jianda_h_menu_provide",{getHMoreMenus:f}),(y,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"menuRef",ref:s,class:e.normalizeClass(["j-menu-horizontal",{"j-menu-dark":e.unref(a)==="dark"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createBlock(Le,{key:m.value,"parent-actives":r.value,item:m,"is-horizontal":"",onClick:h},null,8,["parent-actives","item"]))),128))],2))}}),tn=e.defineComponent({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(t,{emit:n}){const l=t,o=n,{activeMenu:i,theme:a}=e.inject("jcode_menu_provide",{}),s=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],c=e.computed(()=>(l.menuList.forEach((y,u)=>{y.color=s[u%s.length]}),l.menuList)),p=e.computed(()=>i.value?.pid?.split(".")||[]),d=y=>{o("click",y)},{list:f,containerProps:r,wrapperProps:h}=ve(c,{itemHeight:96});return(y,u)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-menu-vertical",{"j-menu-dark":e.unref(a)==="dark"}]},e.unref(r)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(h))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),m=>(e.openBlock(),e.createBlock(Le,{key:m.data.value,"parent-actives":p.value,item:m.data,"is-vertical":"",onClick:d},null,8,["parent-actives","item"]))),128))],16)],16))}}),Qt=P(e.defineComponent({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(t,{emit:n}){const l=t,o=n;let i={};const a=e.ref("");a.value=l.activeId||"";const s=(m,b,k,B,E)=>{k=k||[];for(let F=0,A=k.length;F<A;F++){const g=k[F],w={};w.pid=b,w.indent=B,a.value===g.value&&(w.active=!0),Object.keys(g).forEach($=>{$!=="children"&&(w[$]=g[$])}),E&&E.includes(g.value)&&(w.open=!0),m.push(w);const z=g.children||[];z.length>0&&(w.hasChildren=!0,E||(i[w.value]=z),(!E||w.open&&!l.collapsed)&&s(m,`${b}.${w.value}`,z,B+1,E))}},c=(m,b)=>{const k=[];return s(k,"0",m,0,b),k},p=e.ref([]);let d=[];const f=()=>{i={},d=c(l.menus);const m=[];if(a.value&&l.mode==="inline"){const b=d.find(k=>k.value===a.value);b&&m.push(...b.pid.split("."))}p.value=c(l.menus,m),console.log("showMenuList",p.value)};e.watch(()=>l.menus,()=>{f()},{immediate:!0}),e.watch(()=>l.mode,()=>{f()});const r=()=>{if(p.value.find(b=>b.active)?.value!==a.value){const b=d.find(k=>k.value===a.value);if(b){const k=[];l.mode==="inline"&&k.push(...b.pid.split(".")),p.value=c(l.menus,k)}}},h=e.computed(()=>d.find(m=>m.value===a.value));e.watch(()=>l.activeId,()=>{a.value=l.activeId||"",r()}),e.watch(()=>l.collapsed,()=>{if(l.collapsed)p.value=c(l.menus,[]);else{const m=[];if(a.value){const b=d.find(k=>k.value===a.value);b&&m.push(...b.pid.split("."))}p.value=c(l.menus,m)}});const y=e.computed(()=>l.theme),u=m=>{if(m.hasChildren){if(l.collapsed)return;const b=[];b.push(...m.pid.split(".")),m.open||b.push(m.value);const k=c(l.menus,b),B=new Set(p.value.map(F=>F.value)),E=new Set(k.map(F=>F.value));k.forEach(F=>{B.has(F.value)||(F.entering=!0)}),p.value.forEach(F=>{E.has(F.value)||(F.leaving=!0)}),p.value=k,setTimeout(()=>{p.value.forEach(F=>{F.entering=!1,F.leaving=!1})},300)}else{const b=p.value.find(k=>k.active);if(b?.value===m.value)return;b&&(b.active=!1),m.active=!0,a.value=m.value,o("click",m)}};return e.provide("jcode_menu_provide",{getMenuMap:()=>i,toArray:c,activeMenu:h,theme:y}),(m,b)=>t.mode==="inline"?(e.openBlock(),e.createBlock(_l,{key:0,"menu-list":p.value,collapsed:t.collapsed,onClick:u},null,8,["menu-list","collapsed"])):t.mode==="horizontal"?(e.openBlock(),e.createBlock(en,{key:1,"menu-list":p.value,onClick:u},null,8,["menu-list"])):(e.openBlock(),e.createBlock(tn,{key:2,"menu-list":p.value,onClick:u},null,8,["menu-list"]))}})),Zt=P(e.defineComponent({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},row:{type:Object,default:()=>{}},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,o=n,{formData:i,onChange:a}=e.inject("jcode_form_provide",{}),s=e.computed(()=>Ee(d.value)&&!l.config?.notInput||l.config?.isInput),c=e.computed({get(){return l.row?l.modelValue:i?i[l.id]:l.modelValue},set(h){l.row?o("update:modelValue",h):i?i[l.id]=h:o("update:modelValue",h)}}),p=e.computed(()=>ge({config:l.config,getCompConfig:l.getCompConfig,formData:i,row:l.row})),d=e.computed(()=>l.getCompType?l.getCompType({config:l.config,formData:i,row:l.row}):l.type),f=e.computed(()=>{const h={};return l.children.forEach(y=>{y.slot?(h[y.slot]=h[y.slot]||[],h[y.slot].push(y)):(h.default=h.default||[],h.default.push(y))}),h}),r=h=>{l.config?.onChange&&l.config?.onChange({...h,formData:i,row:l.row,id:l.id}),a&&a({...h,formData:i,row:l.row,id:l.id}),o("change",h)};return(h,y)=>{const u=e.resolveComponent("j-comp");return s.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps({key:0},p.value,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=m=>c.value=m),onChange:r}),e.createSlots({_:2},[e.renderList(f.value,(m,b)=>({name:b,fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,k=>(e.openBlock(),e.createBlock(u,e.mergeProps({key:k.id},{ref_for:!0},k),null,16))),128))])}))]),1040,["modelValue"])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps({key:1},p.value,{onChange:r}),e.createSlots({_:2},[e.renderList(f.value,(m,b)=>({name:b,fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,k=>(e.openBlock(),e.createBlock(u,e.mergeProps({key:k.id},{ref_for:!0},k),null,16))),128))])}))]),1040))}}})),on=fo;async function ln(t,n,l){const o={...l};delete o.ruleIndex,delete o.trigger;const i=new on({[t]:[o]});let a=[];try{await i.validate({[t]:n})}catch(s){s.errors?a=s.errors.map(({message:c})=>c):a=[o.message||"校验错误"]}return a.length>0?a[0]:""}async function nn(t,n,l){const o=l.map((i,a)=>({...i,ruleIndex:a})).sort(({warningOnly:i,ruleIndex:a},{warningOnly:s,ruleIndex:c})=>!!i==!!s?a-c:i?1:-1);for(let i=0;i<o.length;i+=1){const a=o[i];"pattern"in a&&(n+="");const s=await ln(t,n,a);if(s!=="")return{name:t,errors:s}}}function an(t,n){const l=(a,s,c,p,d)=>{Object.keys(s).forEach(f=>{let r=f;c&&(r=`${c}.${f}`);const h=s[f],{rules:y,myGridtableId:u}=n(r,c?s:void 0,p,d);if(y.length){const m=o(r,h,y);a.push(m)}u&&h.forEach(m=>{l(a,m,u,h,c?s:void 0)})})},o=(a,s,c)=>nn(a,s,c);return{validateForm:async()=>{const a=e.unref(t),s=[];l(s,a,"");const c=await Promise.all(s),p={};return c.forEach(d=>{d&&(p[d.name]={msg:d.errors})}),p},validateField:o}}const Kt=P(e.defineComponent({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1}},emits:["change"],setup(t,{expose:n,emit:l}){const o=t,i=l,{useData:a,existField:s,httpGet:c,httpPost:p,success:d,warning:f,error:r,info:h,t:y}=e.inject("jcode_app_form_provide",{t:C=>C});let u;a&&(u=a());const m=C=>{r&&r(C)},b=e.ref(!1),k=e.computed(()=>o.config?.gutter||16),B=e.computed(()=>o.config?.span||24),E=e.computed(()=>o.config?.labelWidth),F=e.computed(()=>o.config?.labelPosition||"right"),A=e.computed(()=>z.length===1&&(z[0].type==="j-tabs"||z[0].type==="j-layout"||z[0].config?.isAutoWindow)),g=e.reactive({}),w=e.ref({}),z=[],$={},W=e.ref({});let j={},G={},I=[],L={};const J=C=>{i("change",C)},v=C=>Ee($[C]?.type)&&!$[C]?.config?.notInput||$[C]?.config?.isInput,X=C=>["j-table","j-input-rows","j-input-cards"].includes($[C]?.type||"");let H;const ce=(C,M)=>{Object.keys(C).forEach(S=>{const N=C[S];M&&(S=M+"."+S),N!=null&&typeof N=="object"&&!Ne(N)&&ce(N,S),g[S]=N})},Y=(C,M)=>{let S=C.id;return S||(C.config?.table&&C.config?.field?S=`${C.config.table}.${C.config.field}`:C.config?.table?S=C.config?.table:C.config?.field&&(S=C.config?.field),M&&X(M)&&(S=`${M}.${S}`)),S||ze("j")},oe=(C,M,S,N="")=>{C.forEach(T=>{T.id=Y(T,N);const R={id:T.id,slot:T.slot,type:T.type,getCompType:T.getCompType,getCompConfig:T.getCompConfig,config:{},children:[]};M.push(R);const{children:q}=T;$e(R,T,["children","config"]),$e(R.config,T.config||{},[]),$[T.id]&&console.warn("有重复的组件id:"+T.id),$[T.id]=R,o.readonly===!0&&(R.config.readonly=!0);let K=!1,ae;N!==""&&X(N)&&(K=!0,R.config=T.config||{},R.config.parentTableId=N,ae=$[N]?.config?.table);const te=R.config||{};if(v(T.id))!S&&K===!1&&(te?.defaultValue===0?g[T.id]=te?.defaultValue:g[T.id]=te?.defaultValue||void 0),te.table&&te.field?j[`${te.table}_${te.field}`.toLowerCase()]=T.id:te.field&&(K?j[`${ae}_${te.field}`.toLowerCase()]=T.id:j[`${te.field}`.toLowerCase()]=T.id);else if(K&&te.field)j[`${ae}_${te.field}`.toLowerCase()]=T.id;else if(X(T.id))!S&&!te.isSubTable&&(g[T.id]=[]),te.table&&(j[te.table.toLowerCase()||""]=T.id),te.isSubTable||I.push(R);else if(te?.defaultValue)g[T.id]=te?.defaultValue;else if(T.type==="collapse"&&te?.isExpand){const Je=[];(te?.groups||[]).forEach(dn=>{Je.push(dn.i)}),g[T.id]=Je}q&&q.length>0&&oe(q,R.children,S,R.id)})},ue=async(C,M)=>{b.value=!1;const S=!!M;z.splice(0,z.length),j={},G={},I=[],H=M,xe(g),W.value={},S&&ce(M,""),oe(C,z,S),L=he(g),e.nextTick(()=>{b.value=!0,e.nextTick(()=>{Re(o.config?.codeInit,{})})})},fe=(C,M,S)=>{const N=[];return M.forEach(T=>{const R={};Object.keys(T).forEach(q=>{if(!S||S(q,T[q],C)){const K=U(q);if(K?.type==="j-table")R[K?.id||""]=fe(q,T[q],S);else{let ae=j[`${C}_${q}`.toLowerCase()]||q;ae=ae.indexOf(".")!==-1?ae.split(".")[1]:ae,R[ae]=T[q]}}}),N.push(R)}),N},D=(C,M)=>{Object.keys(C||{}).forEach(S=>{let N=C[S];const T=U(S);if(T===void 0)N&&(Ne(N)&&(N=N[0]||{}),typeof N=="object"?Object.keys(N).forEach(R=>{if(!M||M(S,N[R],S)){let q=R;S!=="main"&&(q=`${S}_${R}`),G[q]=S,g[j[q.toLowerCase()]||R]=N[R]}}):g[S]=N);else if(X(T.id||"")){if(!Array.isArray(N)){console.warn("表格数据不是数组:"+S);return}N?.length>0?g[j[S.toLowerCase()]||S]=fe(S,N,M):g[j[S.toLowerCase()]||S]=[]}else(!M||M(S,N,S))&&(g[j[S.toLowerCase()]||S]=N)}),H&&Object.keys(g).forEach(S=>{const N=U(S);(N===void 0||!["tabs","collapse"].includes(N.type||""))&&Qe(H,S,g[S])})},ne=(C,M=!1)=>{const S={};return Object.keys(C).forEach(N=>{if(N==="parentRow")return;const T=$[N];if(T){const R=T.config?.table,q=T.config?.field;if(M)q?S[q]=C[N]:S[N]=C[N];else if(X(N)){const K=[];C[N].forEach(ae=>{K.push(ne(ae,!0))}),S[R||N]=K}else R&&q?(S[R]=S[R]||{},S[R][q]=C[N]):q&&(S[q]=C[N])}else M?N!=="_X_ROW_KEY"&&N!=="_isHover"&&(S[N]=C[N]):G[N]?(S[G[N]]=S[G[N]]||{},S[G[N]][N.replace(`${G[N]}_`,"")]=C[N]):S[N]=C[N]}),S},ee=(C=!0)=>C?ne(g):g,Q=(C,M,S,N)=>{let T=$[C];if(T==null){const q=C.split(".");T=$[q[q.length-1]]||{}}if(!T)return{};const R=ge({config:{...T.config||{},...W.value[T.id]||{}},getCompConfig:T.getCompConfig,formData:g,tableData:S,row:M,pRowData:N});return R._componentId=T?.id,R},le=(C,M,S,N)=>{const T=Q(C,M,S,N);if(T.isNotRule!==!0&&T.display!==!1){const R=T.rule||[],q=R.find(K=>K.type==="only");return q&&(q.validator=async(K,ae)=>{if(ae){const te={table:K.table,key:K.key,keyName:K.keyName,field:K.field,keyValue:K.getKeyValue?K.getKeyValue():"",value:ae,paramNames:K.paramNames,getParams:K.getParams,withProjectId:K.withProjectId,getValue:K.getValue,formData:g};if(!await s(te))throw y(K.message)||y("数据值重复")}}),{rules:R,myGridtableId:X(T._componentId)?T._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:ie}=an(g,le),V=async()=>{w.value={};const C=await ie();return Object.keys(C).length>0?(w.value=C,m(`${y($[Object.keys(C)[0]]?.config?.label)}:${y(C[Object.keys(C)[0]].msg)}`),!1):!0},O=()=>{w.value={},xe(g),Object.keys(L||{}).forEach(C=>{g[C]=L[C]})},U=C=>{let M=$[C];return M===void 0&&j[C.toLowerCase()]&&(M=$[j[C.toLowerCase()]]),M},_=({id:C,i:M,value:S,type:N})=>{if(N==="add")g[C].push(S);else if(N==="delete")g[C].splice(M,1);else{const T=U(C);T&&(T.config.parentTableId?g[T.config.parentTableId][M][C]=S:g[C]=S)}},re=({id:C,i:M})=>{const S=U(C);if(S){if(S.config.parentTableId){const N=g[S.config.parentTableId],T=S.id?S.id.replace(`${S.config.parentTableId}.`,""):"";if(M!=null)return(N[M]||{})[T||""];const R=[];return N&&N.forEach(q=>{R.push(q[T||""])}),R}if(X(S.id||"")){const N=[];return g[S.id||""].forEach(T=>{N.push(ne(T,!0))}),N}return g[S.id||""]}if(g[C])return g[C]},de=async({id:C,i:M})=>{const S=re({id:C,i:M}),N=U(C);if(N&&u?.getLabel)if(M!==void 0){const T=S[M],R=g[N.config.parentTableId||""][M],q=ge({config:N.config,getCompConfig:N.getCompConfig,formData:g,tableData:g[N.config.parentTableId||""],row:R});return await u?.getLabel({value:T,config:q,formData:g,tableData:g[N.config.parentTableId||""],row:R})}else{const T=ge({config:N.config,getCompConfig:N.getCompConfig,formData:g});return await u?.getLabel({value:S,config:T,formData:g})}return S},Z=async(C,M)=>u?.loadViewDataList?await u?.loadViewDataList(C,M,!1):[],Ae=C=>(C.set=_,C.get=re,C.setFormData=D,C.getFormData=ee,C.getLabel=de,C.getViewData=Z,C.getDateNow=M=>tt(new Date,M||"YYYY-MM-DD HH:mm:ss"),C.httpGet=c||(()=>{console.log("当前状态不支持")}),C.httpPost=p||(()=>{console.log("当前状态不支持")}),C.loading=M=>{ye(M)},C.showMsg=({text:M,type:S})=>{switch(S){case"success":d&&d(M);break;case"warning":f&&f(M);break;case"error":r&&r(M);break;case"info":h&&h(M);break;default:h&&h(M);break}console.log("showMsg",M,S)},C),Re=async(C,M)=>{if(C&&C.trim()){C=`async (jcode) => {${C}}`;const{res:S,fn:N}=Ie(C);S&&await N(Ae(M))}},Me=(C,M)=>{W.value[C]={...W.value[C]||{},...M}};return o.schema&&ue(o.schema),e.provide("jcode_form_provide",{formData:g,compsConfig:W,errorFields:w,isAutoWindow:A,gutter:k,span:B,labelWidth:E,onChange:J}),n({init:ue,reset:O,validate:V,setValue:_,getValue:re,getLabel:de,setFormData:D,getFormData:ee,setCompConfig:Me}),(C,M)=>{const S=e.resolveComponent("j-form-item"),N=e.resolveComponent("el-row"),T=e.resolveComponent("el-form");return b.value?(e.openBlock(),e.createBlock(T,{key:0,class:e.normalizeClass([{"j-block":t.isAutoSize},"j-form"]),"label-position":F.value,"label-width":E.value,size:t.config?.size,onSubmit:M[0]||(M[0]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[A.value?(e.openBlock(),e.createBlock(S,e.normalizeProps(e.mergeProps({key:0},z[0])),null,16)):(e.openBlock(),e.createBlock(N,{key:1,gutter:k.value},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(z,R=>e.createVNode(S,e.mergeProps({key:R.id,ref_for:!0},R),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):e.createCommentVNode("",!0)}}})),_t=P(e.defineComponent({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]}},setup(t){const n=t,{formData:l,compsConfig:o,errorFields:i,isAutoWindow:a,span:s,labelWidth:c}=e.inject("jcode_form_provide",{}),{t:p}=e.inject("jcode_app_provide",{t:m=>m}),d=e.computed(()=>ge({config:{...n.config||{},...o.value[n.id]||{}},getCompConfig:n.getCompConfig,formData:l})),f=e.computed(()=>n.getCompType?n.getCompType({config:n.config,formData:l}):n.type),r=e.computed(()=>Ee(f.value)&&!d.value?.notInput||d.value?.isInput),h=e.computed(()=>d.value?.labelWidth||c.value),y=e.computed(()=>(d.value?.rule||[]).some(b=>b.required===!0)),u=e.computed(()=>{const m=i.value[n.id];return m?m.msg:""});return(m,b)=>{const k=e.resolveComponent("j-comp"),B=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-col");return d.value.display!==!1&&!e.unref(a)?(e.openBlock(),e.createBlock(E,{key:0,span:d.value.span||e.unref(s),style:e.normalizeStyle({...d.value.colStyle||{}}),class:e.normalizeClass(d.value.colClass||{})},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(B,{key:0,label:e.unref(p)(d.value.notShowLabel?"":d.value.label||""),"label-position":d.value.labelPosition,"label-width":h.value,required:y.value,error:e.unref(p)(u.value)},{default:e.withCtx(()=>[e.createVNode(k,{id:t.id,type:f.value,config:d.value,children:t.children},null,8,["id","type","config","children"])]),_:1},8,["label","label-position","label-width","required","error"])):(e.openBlock(),e.createBlock(k,{key:1,id:t.id,type:f.value,config:d.value,children:t.children},null,8,["id","type","config","children"]))]),_:1},8,["span","style","class"])):d.value.display!==!1?(e.openBlock(),e.createBlock(k,{key:1,id:t.id,type:f.value,config:d.value,children:t.children},null,8,["id","type","config","children"])):e.createCommentVNode("",!0)}}})),sn={class:"j-page"},eo=P(e.defineComponent({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(t){const n=t,l=e.ref(!1),o=[],i={},a=e.reactive({}),s=(p,d)=>{p.forEach(f=>{f.id=f.id||ze("c");const r={id:f.id,slot:f.slot,type:f.type,config:{},children:[]},{children:h}=f;i[f.id]=r,$e(r.config,f.config||{},["defaultValue"]),f?.config?.defaultValue!==void 0&&(a.value[f.id]=f.config.defaultValue),d.push(r),h&&h.length>0&&s(h,r.children)})},c=p=>{l.value=!1,o.splice(0,o.length),xe(i),xe(a),s(p,o),e.nextTick(()=>{l.value=!0})};return n.schema&&c(n.schema),(p,d)=>{const f=e.resolveComponent("j-comp");return e.openBlock(),e.createElementBlock("div",sn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,r=>e.createVNode(f,{key:r.id,id:r.id,type:r.type,config:r.config,children:r.children},null,8,["id","type","config","children"])),64))])}}})),to=P(e.defineComponent({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(t,{emit:n}){const l=t,o=n,i=e.ref("");return e.watch(()=>l.modelValue,a=>{a?i.value=a:(i.value=Ge(),o("update:modelValue",i.value))},{immediate:!0}),(a,s)=>{const c=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(c,{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=p=>i.value=p),readonly:"",size:t.size},null,8,["modelValue","size"])}}})),cn=[qe,ct,rt,dt,ut,ft,mt,pt,ht,gt,yt,bt,kt,Ct,Bt,wt,xt,St,Vt,jt,$t,zt,Et,At,Tt,Lt,Mt,Dt,Ft,It,Ot,vt,Zt,Kt,_t,eo,to,Rt,Qt],rn={install:t=>{cn.forEach(n=>{t.component(n.name,n)})}};x.EncryptionFactory=nt,x.HashingFactory=Vo,x.JAutoComplete=gt,x.JBarcode=Et,x.JButton=qe,x.JButtons=ct,x.JCascaderSelect=mt,x.JCheckbox=pt,x.JCodeMirror=At,x.JComp=Zt,x.JCount=Tt,x.JCountUp=Lt,x.JDataPanel=Mt,x.JDialog=kt,x.JDialogFull=Ct,x.JDivider=Dt,x.JDrawer=Bt,x.JDynamicLayer=xt,x.JEcharts=zt,x.JForm=Kt,x.JFormItem=_t,x.JGuid=to,x.JHpanel=Ft,x.JIcon=dt,x.JInput=rt,x.JInputButton=It,x.JInputCode=Ot,x.JInputTag=St,x.JLayer=wt,x.JLayout=yt,x.JMenu=Qt,x.JNumber=ht,x.JPage=eo,x.JRadio=ut,x.JRate=Vt,x.JSelect=ft,x.JSlider=jt,x.JSliderCaptcha=Rt,x.JTable=bt,x.JTitle=vt,x.JUpload=$t,x.buildShortUUID=ze,x.buildUUID=Ge,x.clearJson=xe,x.clone=$e,x.deepClone=he,x.default=rn,x.formatToDate=Ve,x.formatToDateTime=tt,x.fullScreenLoading=ye,x.getCompConfig=ge,x.getFunction=Ie,x.getIsInputComp=Ee,x.getObjType=Xe,x.getTextWidth=_e,x.is=Ye,x.isArray=Ne,x.isNullOrEmpty=se,x.isObject=po,x.lowerFirst=Co,x.myAesDecrypt=jo,x.numberToChinese=Ze,x.numberToThousandSeparator=Ke,x.pagination=yo,x.paginationEx=bo,x.set=Qe,x.setGroupMap=at,x.toArray=$o,x.toDecimal=Se,x.toSimpleTree=zo,x.toTree=No,x.uniqueArray=ko,x.upFirst=et,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
16
+ getCompValue)=>{ return ${E} }`;let B;const _=Vo(E);if(_.res)try{B=_.fn(i,a,l,r,s,d,c,f,u,p,h,m,g,b,w)}catch(T){console.log(T,"计算组件公式运行错误")}else return console.log(_.msg),"";return Number.isNaN(B)?"":(o.decimal!==void 0&&(B=B.toFixed(o.decimal)),B)}),S=n.computed(()=>{let y=C.value;return o.thousandSeparator&&(y=Oi(y)),o.isChinese&&(y=Ai(y)),y});return n.watch(C,y=>{k("update:modelValue",y),k("change",{value:y,data:S.value})}),(y,E)=>{const B=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(B,{modelValue:S.value,"onUpdate:modelValue":E[0]||(E[0]=_=>S.value=_),readonly:"",size:e.size},null,8,["modelValue","size"])}}})),hd={key:0},Ta=te(n.defineComponent({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(e,{expose:t}){const o=e,i=n.computed(()=>({...o})),a=n.ref(),l=n.ref(null),r=n.computed(()=>o.options);n.onMounted(()=>{o.animation&&s()}),n.watch(()=>o.decimals,()=>{l.value&&l.value.update&&(l.value.options.decimalPlaces=o.decimals,l.value.reset(),l.value.update(o.endValue))},{deep:!0}),n.watch(()=>o.endValue,p=>{l.value&&l.value.update&&l.value.update(p)});const s=()=>{l.value||(r.value.startVal=o.startValue,r.value.decimalPlaces=o.decimals,r.value.duration=o.duration,l.value=new Vs.CountUp(a.value,Number(o.endValue),r.value),l.value.start(()=>{o.callback?.(l.value)}))};return n.onUnmounted(()=>{l.value=null}),n.onBeforeUnmount(()=>{l.value=null}),t({myProps:i,el:a,init:s,start:p=>{l.value&&l.value.start&&l.value.start(()=>{p?.(l.value)})},pauseResume:()=>{l.value&&l.value.pauseResume&&l.value.pauseResume()},reset:()=>{l.value&&l.value.reset&&l.value.reset()},update:p=>{l.value&&l.value.update&&l.value.update(p)}}),(p,h)=>(n.openBlock(),n.createElementBlock("span",{ref_key:"el",ref:a},[e.animation?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",hd,n.toDisplayString(e.endValue),1))],512))}})),md={class:"j-block j-data-panel"},gd={key:0,class:"j-data-panel-header"},yd={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},bd={class:"j-data-panel-header-right"},wd={class:"j-data-panel-body"},Na=te(n.defineComponent({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",md,[e.title?(n.openBlock(),n.createElementBlock("div",gd,[n.createElementVNode("div",yd,n.toDisplayString(e.title),1),n.createElementVNode("div",bd,[n.renderSlot(t.$slots,"titleRight")])])):n.createCommentVNode("",!0),n.createElementVNode("div",wd,[n.renderSlot(t.$slots,"default")])]))}})),vd={class:"j-divider-content"},$a=te(n.defineComponent({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(e){const t=e,o=n.computed(()=>{const a={color:t.color};return t.size&&Number(t.size)&&(a.fontSize=`${t.size}px`),a}),i=n.computed(()=>({borderTopStyle:t.borderStyle}));return(a,l)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(`j-divider-container j-divider-${e.contentPosition}`),style:n.normalizeStyle(o.value)},[n.createElementVNode("div",{class:"j-divider-line j-divider-line-left",style:n.normalizeStyle(i.value)},null,4),n.createElementVNode("div",vd,[n.createElementVNode("span",null,n.toDisplayString(e.content||""),1)]),n.createElementVNode("div",{class:"j-divider-line j-divider-line-right",style:n.normalizeStyle(i.value)},null,4)],6))}})),Cd={class:"j-hpanel"},kd={class:"j-hpanel-main"},Ma=te(n.defineComponent({name:"JHpanel",__name:"hpanel",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",Cd,[n.renderSlot(t.$slots,"left"),n.createElementVNode("div",kd,[n.renderSlot(t.$slots,"default")]),n.renderSlot(t.$slots,"right")]))}})),La=te(n.defineComponent({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=async(f,u)=>{o.ok&&(f("保存数据中..."),l.value=await o.ok(),i("update:modelValue",l.value),i("change",{value:l.value}),u(),a.value.close())},s=()=>o.beforeClose?o.beforeClose(l.value):!0,d=()=>{o.closed?.()},c=()=>{a.value.open(o.title||o.btnText,o.layerType),setTimeout(()=>{o.open?.(l.value)},200)};return n.watch(()=>o.modelValue,f=>{l.value=f},{immediate:!0}),(f,u)=>{const p=n.resolveComponent("j-button"),h=n.resolveComponent("j-layer");return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(p,n.mergeProps({style:{width:"auto"}},f.$attrs,{type:e.type,label:e.btnText,size:e.size,onClick:c}),null,16,["type","label","size"]),n.createVNode(h,{ref_key:"layerRef",ref:a,height:e.height,width:e.width,"destroy-on-close":e.destroyOnClose,"btn-text":"确定","before-close":s,onOk:r,onClosed:d},{default:n.withCtx(()=>[n.renderSlot(f.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}})),Pa=te(n.defineComponent({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get:()=>o.modelValue,set:u=>{i("update:modelValue",u)}}),l=n.ref(""),r=u=>{l.value=u},s=()=>l.value,d=u=>o.beforeClose?o.beforeClose(u):!0,c=u=>{i("change",u)},f=n.computed(()=>o.modelValue&&o.modelValue.trim()?`${o.btnText}(已设置)`:o.btnText);return(u,p)=>{const h=n.resolveComponent("j-code-mirror"),m=n.resolveComponent("j-layout"),g=n.resolveComponent("j-input-button");return n.openBlock(),n.createBlock(g,{modelValue:a.value,"onUpdate:modelValue":p[1]||(p[1]=b=>a.value=b),type:e.type,"btn-text":f.value,title:e.title,size:e.size,width:e.width,height:e.height,"before-close":d,ok:s,open:r,onChange:c},{default:n.withCtx(()=>[n.createVNode(m,{"right-move":!1,right:560},n.createSlots({default:n.withCtx(()=>[n.createVNode(h,{value:l.value,"onUpdate:value":p[0]||(p[0]=b=>l.value=b),mode:e.mode,"is-hint":e.isHint,"handle-hint":e.handleHint},null,8,["value","mode","is-hint","handle-hint"])]),_:2},[e.example?{name:"right",fn:n.withCtx(()=>[n.createVNode(h,{value:e.example,mode:e.mode,"read-only":""},null,8,["value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}})),Ra=te(n.defineComponent({name:"JInputColor",__name:"input-color",props:{modelValue:{},placeholder:{default:"请选择颜色"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},onlyButton:{type:Boolean,default:!1},inputType:{default:"append"},showAlpha:{type:Boolean,default:!0},predefineColors:{default:()=>["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]},colorFormat:{default:"hex"},name:{},autofocus:{type:Boolean},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})}},emits:["update:modelValue","input","focus","blur","clear","change","color-change","active-change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.ref(),s=n.computed({get(){return i.modelValue===null||i.modelValue===void 0?r.value:i.modelValue},set(g){r.value=g,a("update:modelValue",g),a("input",g)}}),d=g=>{a("input",g)},c=g=>{a("focus",g)},f=g=>{a("blur",g)},u=()=>{a("clear"),a("update:modelValue","")},p=g=>{a("change",g)},h=g=>{a("color-change",g)},m=g=>{a("active-change",g)};return t({focus:()=>{l.value?.focus()},blur:()=>{l.value?.blur()},select:()=>{l.value?.select()}}),(g,b)=>{const k=n.resolveComponent("el-color-picker"),v=n.resolveComponent("el-input");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-input-color",{"j-input-color-only-button":e.onlyButton},{"j-input-color-disabled":e.disabled}])},[n.createVNode(v,n.mergeProps({placeholder:e.placeholder,modelValue:s.value,"onUpdate:modelValue":b[1]||(b[1]=w=>s.value=w),size:e.size,ref_key:"inputRef",ref:l,readonly:e.readonly||e.onlyButton,clearable:e.readonly||e.onlyButton?!1:e.clearable,disabled:e.disabled,name:e.name,autofocus:e.autofocus,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle},g.$attrs,{onInput:d,onFocus:c,onBlur:f,onClear:u,onChange:p}),{[e.inputType]:n.withCtx(()=>[n.createVNode(k,{size:e.size,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=w=>s.value=w),disabled:e.disabled||e.readonly,"show-alpha":e.showAlpha,predefine:e.predefineColors,"color-format":e.colorFormat,onChange:h,onActiveChange:m},null,8,["size","modelValue","disabled","show-alpha","predefine","color-format"])]),_:2},1040,["placeholder","modelValue","size","readonly","clearable","disabled","name","autofocus","tabindex","validate-event","input-style"])],2)}}})),Aa=te(n.defineComponent({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"}},setup(e){const t=e,o=n.computed(()=>t.class||""),i=n.computed(()=>{const a={...t.style};return t.color&&(a.color=t.color),t.size&&(typeof t.size=="number"?a.fontSize=`${t.size}px`:a.fontSize=t.size),t.weight&&(a.fontWeight=t.weight),a});return(a,l)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-title",o.value]),style:n.normalizeStyle(i.value)},n.toDisplayString(e.title),7))}})),Oa=te(n.defineComponent({name:"JCodeMirror",__name:"code-mirror",props:{value:{default:""},mode:{default:"javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:value","change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.ref("");let s=null;const d=g=>{switch(g){case"application/javascript":case"javascript":case"text/javascript":return zt.javascript();case"css":case"text/css":return $s.css();case"html":case"text/html":return Ms.html();case"json":case"application/json":return Ls.json();case"sql":case"text/x-sql":return Ps.sql();case"xml":case"text/xml":return Rs.xml();case"python":case"text/x-python":return As.python();case"markdown":case"text/markdown":return Os.markdown();case"java":case"text/x-java":return Fs.java();case"vue":case"text/x-vue":return zt.javascript({jsx:!0,typescript:!1});case"typescript":case"application/typescript":return zt.javascript({jsx:!1,typescript:!0});case"jsx":return zt.javascript({jsx:!0,typescript:!1});case"tsx":return zt.javascript({jsx:!0,typescript:!0});default:return zt.javascript()}},c=()=>{const g=[Ns.basicSetup,Ze.lineNumbers(),Ze.highlightActiveLineGutter(),Ze.highlightSpecialChars(),Eo.history(),Ze.drawSelection(),Ze.dropCursor(),Dt.indentOnInput(),Dt.bracketMatching(),Bo.closeBrackets(),Ze.rectangularSelection(),Dt.foldGutter(),Ze.keymap.of([...Bo.closeBracketsKeymap,...Eo.defaultKeymap,...Eo.historyKeymap,...Dt.foldKeymap]),Dt.syntaxHighlighting(Dt.defaultHighlightStyle)];return g.push(d(i.mode)),i.readonly&&g.push(So.EditorState.readOnly.of(!0)),i.isHint&&i.handleHint&&g.push(Bo.autocompletion({override:[b=>{const k=b.matchBefore(/\w*/);if(!k||k.from===k.to)return null;const v=i.handleHint(k.text);return v.length===0?null:{from:k.from,options:v.map(w=>({label:typeof w=="string"?w:w.label||w.name||"",detail:typeof w=="string"?"":w.detail||"",type:typeof w=="string"?"variable":w.type||"variable",apply:typeof w=="string"?w:w.apply||w.name||w.label||""}))}}]})),g.push(Ze.EditorView.updateListener.of(b=>{if(b.docChanged){const k=b.state.doc.toString();r.value=k,a("update:value",k),a("change",{value:k})}})),g},f=async()=>{if(!l.value)return;const g=So.EditorState.create({doc:i.value,extensions:c()});s=new Ze.EditorView({state:g,parent:l.value}),r.value=i.value},u=()=>{if(!s)return;const g=s.state.doc.toString();s&&s.destroy();const b=So.EditorState.create({doc:g,extensions:c()});l.value&&(s=new Ze.EditorView({state:b,parent:l.value}));const k=s.state.doc.toString();k!==i.value&&s.dispatch({changes:{from:0,to:k.length,insert:i.value}})},p=()=>{if(!s)return;const g=s.state.doc.length;s.dispatch({selection:{anchor:g,head:g},scrollIntoView:!0}),setTimeout(()=>{if(s){const b=s.state.doc.length;s.dispatch({selection:{anchor:b,head:b},scrollIntoView:!0})}},100)},h=()=>{let g=Ts.format(i.value);g=g.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),a("update:value",g),a("change",{value:g})};let m=null;return n.watch(()=>i.value,g=>{g!==r.value&&(r.value=g,s&&u(),setTimeout(()=>{s&&i.isScrollToBottom&&p()}))}),n.watch(()=>i.mode,()=>{s&&u()}),n.onMounted(async()=>{await n.nextTick(),await f(),typeof window<"u"&&window.ResizeObserver&&l.value&&(m=new ResizeObserver(()=>{s&&s.dispatch({scrollIntoView:!0})}),m.observe(l.value))}),n.onUnmounted(()=>{m&&l.value&&(m.unobserve(l.value),m.disconnect(),m=null),s&&(s.destroy(),s=null)}),t({sqlFormatter:h}),(g,b)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"codeWraperRef",ref:l,class:"j-code-mirror",style:n.normalizeStyle({height:e.height?`${e.height}px`:""})},null,4))}})),xd=n.defineComponent({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("actionRef"),a=n.ref("0"),l=n.computed(()=>{const{actionStyle:s,toLeft:d}=o;return{...s,left:d?"0":a.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:r.value?"6px":void 0,transition:d?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),r=n.computed(()=>Number.parseInt(a.value)>10&&!o.isPassing);return t({getEl:()=>i.value,getStyle:()=>i?.value?.style,setLeft:s=>{a.value=s}}),(s,d)=>{const c=n.resolveComponent("j-icon");return n.openBlock(),n.createElementBlock("div",{ref_key:"actionRef",ref:i,style:n.normalizeStyle(l.value),class:"j-slider-captcha-action",name:"captcha-action"},[e.isPassing?(n.openBlock(),n.createBlock(c,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:check-circle-outline"})):(n.openBlock(),n.createBlock(c,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:chevron-double-right"}))],4)}}}),Sd=n.defineComponent({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("barRef"),a=n.ref("0"),l=n.computed(()=>{const{barStyle:r,toLeft:s}=o;return{...r,width:s?"0":a.value,transition:s?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return t({getEl:()=>i.value,setWidth:r=>{a.value=r}}),(r,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"barRef",ref:i,style:n.normalizeStyle(l.value)},null,4))}}),Bd=n.defineComponent({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("contentRef"),a=n.computed(()=>{const{contentStyle:r}=o;return{...r,fontSize:"12px"}});t({getEl:()=>i.value});const l=n.computed(()=>({animation:`shine ${o.animationDuration}s linear ${o.animationIterationCount}`}));return(r,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"contentRef",ref:i,class:n.normalizeClass([{success:e.isPassing},"j-slider-captcha-content"]),style:n.normalizeStyle(a.value)},[n.createElementVNode("div",{style:n.normalizeStyle(l.value),class:"j-spine-text"},n.toDisplayString(e.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),Fa=te(n.defineComponent({name:"JSliderCaptcha",__name:"slider-captcha",props:n.mergeModels({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:n.mergeModels(["end","move","start","success"],["update:modelValue"]),setup(e,{emit:t}){const o=e,i=t,a=n.useModel(e,"modelValue"),l=n.reactive({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),r=n.useTemplateRef("wrapperRef"),s=n.useTemplateRef("barRef"),d=n.useTemplateRef("contentRef"),c=n.useTemplateRef("actionRef");n.watch(()=>l.isPassing,k=>{if(k){const{endTime:v,startTime:w}=l,C=(v-w)/1e3;i("success",{isPassing:k,time:C.toFixed(1)}),a.value=k}}),n.watchEffect(()=>{l.isPassing=!!a.value});function f(k){return"pageX"in k?k.pageX:"touches"in k&&k.touches[0]?k.touches[0].pageX:0}function u(k){l.isPassing||c.value&&(i("start",k),l.moveDistance=f(k)-Number.parseInt(c.value.getStyle().left.replace("px","")||"0",10),l.startTime=Date.now(),l.isMoving=!0)}function p(k){const v=r.value?.offsetWidth??220,w=k?.offsetWidth??40,C=v-w-6;return{actionWidth:w,offset:C,wrapperWidth:v}}function h(k){const{isMoving:v,moveDistance:w}=l;if(v){const C=n.unref(c),S=n.unref(s);if(!C||!S)return;const{actionWidth:y,offset:E,wrapperWidth:B}=p(C.getEl()),_=f(k)-w;i("move",{event:k,moveDistance:w,moveX:_}),_>0&&_<=E?(C.setLeft(`${_}px`),S.setWidth(`${_+y/2}px`)):_>E&&(C.setLeft(`${B-y}px`),S.setWidth(`${B-y/2}px`),g())}}function m(k){const{isMoving:v,isPassing:w,moveDistance:C}=l;if(v&&!w){i("end",k);const S=c.value,y=n.unref(s);if(!S||!y)return;const E=f(k)-C,{actionWidth:B,offset:_,wrapperWidth:T}=p(S.getEl());E<_?b():(S.setLeft(`${T-B}px`),y.setWidth(`${T-B/2}px`),g()),l.isMoving=!1}}function g(){l.endTime=Date.now(),l.isPassing=!0,l.isMoving=!1}function b(){l.isMoving=!1,l.isPassing=!1,l.moveDistance=0,l.toLeft=!1,l.startTime=0,l.endTime=0;const k=n.unref(c),v=n.unref(s),w=n.unref(d);!k||!v||!w||(w.getEl().style.width="100%",l.toLeft=!0,setTimeout(()=>{l.toLeft=!1,k.setLeft("0"),v.setWidth("0")},300))}return(k,v)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:n.normalizeClass(["j-slider-captcha slider-border",o.class]),style:n.normalizeStyle([{"background-color":"var(--j-color-bg)"},e.wrapperStyle]),onMouseleave:m,onMousemove:h,onMouseup:m,onTouchend:m,onTouchmove:h},[n.createVNode(Sd,{ref_key:"barRef",ref:s,"bar-style":e.barStyle,"to-left":l.toLeft},null,8,["bar-style","to-left"]),n.createVNode(Bd,{ref_key:"contentRef",ref:d,"content-style":e.contentStyle,"is-passing":l.isPassing},null,8,["content-style","is-passing"]),n.createVNode(xd,{ref_key:"actionRef",ref:c,"action-style":e.actionStyle,"is-passing":l.isPassing,"to-left":l.toLeft,onMousedown:u,onTouchstart:u},null,8,["action-style","is-passing","to-left"])],38))}}));function Ed(e,t){return n.getCurrentScope()?(n.onScopeDispose(e,t),!0):!1}const _d=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function jd(e){return Array.isArray(e)?e:[e]}function Vd(e){return n.getCurrentInstance()}function Td(e,t=!0,o){Vd()?n.onMounted(e,o):t?e():n.nextTick(e)}const Ia=_d?window:void 0;function Xt(e){var t;const o=n.toValue(e);return(t=o?.$el)!==null&&t!==void 0?t:o}function Nd(){const e=n.shallowRef(!1),t=n.getCurrentInstance();return t&&n.onMounted(()=>{e.value=!0},t),e}function $d(e){const t=Nd();return n.computed(()=>(t.value,!!e()))}function Md(e,t,o={}){const{window:i=Ia,...a}=o;let l;const r=$d(()=>i&&"ResizeObserver"in i),s=()=>{l&&(l.disconnect(),l=void 0)},d=n.watch(n.computed(()=>{const f=n.toValue(e);return Array.isArray(f)?f.map(u=>Xt(u)):[Xt(f)]}),f=>{if(s(),r.value&&i){l=new ResizeObserver(t);for(const u of f)u&&l.observe(u,a)}},{immediate:!0,flush:"post"}),c=()=>{s(),d()};return Ed(c),{isSupported:r,stop:c}}function Ld(e,t={width:0,height:0},o={}){const{window:i=Ia,box:a="content-box"}=o,l=n.computed(()=>{var u;return(u=Xt(e))===null||u===void 0||(u=u.namespaceURI)===null||u===void 0?void 0:u.includes("svg")}),r=n.shallowRef(t.width),s=n.shallowRef(t.height),{stop:d}=Md(e,([u])=>{const p=a==="border-box"?u.borderBoxSize:a==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(i&&l.value){const h=Xt(e);if(h){const m=h.getBoundingClientRect();r.value=m.width,s.value=m.height}}else if(p){const h=jd(p);r.value=h.reduce((m,{inlineSize:g})=>m+g,0),s.value=h.reduce((m,{blockSize:g})=>m+g,0)}else r.value=u.contentRect.width,s.value=u.contentRect.height},o);Td(()=>{const u=Xt(e);u&&(r.value="offsetWidth"in u?u.offsetWidth:t.width,s.value="offsetHeight"in u?u.offsetHeight:t.height)});const c=n.watch(()=>Xt(e),u=>{r.value=u?t.width:0,s.value=u?t.height:0});function f(){d(),c()}return{width:r,height:s,stop:f}}function Lo(e,t){const{containerStyle:o,wrapperProps:i,scrollTo:a,calculateRange:l,currentList:r,containerRef:s}="itemHeight"in t?Ad(t,e):Rd(t,e);return{list:r,scrollTo:a,containerProps:{ref:s,onScroll:()=>{l()},style:o},wrapperProps:i}}function za(e){const t=n.shallowRef(null),o=Ld(t),i=n.ref([]),a=n.shallowRef(e);return{state:n.ref({start:0,end:10}),source:a,currentList:i,size:o,containerRef:t}}function Da(e,t,o){return i=>{if(typeof o=="number")return Math.ceil(i/o);const{start:a=0}=e.value;let l=0,r=0;for(let s=a;s<t.value.length;s++){const d=o(s);if(l+=d,r=s,l>i)break}return r-a}}function Ha(e,t){return o=>{if(typeof t=="number")return Math.floor(o/t)+1;let i=0,a=0;for(let l=0;l<e.value.length;l++){const r=t(l);if(i+=r,i>=o){a=l;break}}return a+1}}function Wa(e,t,o,i,{containerRef:a,state:l,currentList:r,source:s}){return()=>{const d=a.value;if(d){const c=o(e==="vertical"?d.scrollTop:d.scrollLeft),f=i(e==="vertical"?d.clientHeight:d.clientWidth),u=c-t,p=c+f+t;l.value={start:u<0?0:u,end:p>s.value.length?s.value.length:p},r.value=s.value.slice(l.value.start,l.value.end).map((h,m)=>({data:h,index:m+l.value.start}))}}}function Ua(e,t){return o=>typeof e=="number"?o*e:t.value.slice(0,o).reduce((i,a,l)=>i+e(l),0)}function Ja(e,t,o,i){n.watch([e.width,e.height,()=>n.toValue(t),o],()=>{i()})}function Ya(e,t){return n.computed(()=>typeof e=="number"?t.value.length*e:t.value.reduce((o,i,a)=>o+e(a),0))}const Pd={horizontal:"scrollLeft",vertical:"scrollTop"};function qa(e,t,o,i){return a=>{i.value&&(i.value[Pd[e]]=o(a),t())}}function Rd(e,t){const o=za(t),{state:i,source:a,currentList:l,size:r,containerRef:s}=o,d={overflowX:"auto"},{itemWidth:c,overscan:f=5}=e,u=Da(i,a,c),p=Wa("horizontal",f,Ha(a,c),u,o),h=Ua(c,a),m=n.computed(()=>h(i.value.start)),g=Ya(c,a);return Ja(r,t,s,p),{scrollTo:qa("horizontal",p,h,s),calculateRange:p,wrapperProps:n.computed(()=>({style:{height:"100%",width:`${g.value-m.value}px`,marginLeft:`${m.value}px`,display:"flex"}})),containerStyle:d,currentList:l,containerRef:s}}function Ad(e,t){const o=za(t),{state:i,source:a,currentList:l,size:r,containerRef:s}=o,d={overflowY:"auto"},{itemHeight:c,overscan:f=5}=e,u=Da(i,a,c),p=Wa("vertical",f,Ha(a,c),u,o),h=Ua(c,a),m=n.computed(()=>h(i.value.start)),g=Ya(c,a);return Ja(r,t,s,p),{calculateRange:p,scrollTo:qa("vertical",p,h,s),containerStyle:d,wrapperProps:n.computed(()=>({style:{width:"100%",height:`${g.value-m.value}px`,marginTop:`${m.value}px`}})),currentList:l,containerRef:s}}const Od=n.defineComponent({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{getMenuMap:a,toArray:l,activeMenu:r,theme:s}=On(),{getHMoreMenus:d}=gc(),c=n.ref([]);o.pId==="moreId"?c.value=d.value:c.value=l(a()[o.pId||""]||[],[]);const f=m=>{const g=c.value.find(b=>b.active);g?.value!==m.value&&(g&&(g.active=!1),i("click",m))},{list:u,containerProps:p,wrapperProps:h}=Lo(c,{itemHeight:44});return(m,g)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-sub-menu-content",{"j-menu-dark":n.unref(s)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},n.unref(p)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(h))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(u),b=>(n.openBlock(),n.createBlock(In,{key:b.data.value,"parent-actives":n.unref(r)?.pid?.split(".")||[],item:b.data,"is-sub":"",onClick:f},null,8,["parent-actives","item"]))),128))],16)],16))}}),Fd={class:"j-menu-item-label"},Id={class:"j-menu-item-label"},zd={key:1,class:n.normalizeClass(["j-menu-item-arrow","sub"])},Dd={class:"j-menu-item-label"},In=n.defineComponent({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(e,{emit:t}){const{t:o}=Pe(),i=t,a=l=>{i("click",l)};return(l,r)=>{const s=n.resolveComponent("j-icon"),d=n.resolveComponent("el-tooltip"),c=n.resolveComponent("el-popover");return e.collapsed&&!e.item.hasChildren?(n.openBlock(),n.createBlock(d,{key:0,placement:"right"},{content:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(n.unref(o)(e.item.label)),1)]),default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed}]),onClick:r[0]||(r[0]=n.withModifiers(f=>a(e.item),["stop"]))},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",Fd,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["j-menu-item-arrow",{open:e.item.open}])},null,2)):n.createCommentVNode("",!0)],6)],2)]),_:1})):(e.collapsed||e.isSub||e.isHorizontal||e.isVertical)&&e.item.hasChildren?(n.openBlock(),n.createBlock(c,{key:1,placement:e.isHorizontal?"bottom-start":"right-start","show-arrow":!1,"popper-class":"j-sub-menu"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed}])},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*34+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,style:n.normalizeStyle({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):n.createCommentVNode("",!0),n.createElementVNode("div",Id,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren&&!e.isHorizontal&&!e.isVertical?(n.openBlock(),n.createElementBlock("div",zd)):n.createCommentVNode("",!0)],6)],2)]),default:n.withCtx(()=>[n.createVNode(Od,{"p-id":e.item.value,onClick:a},null,8,["p-id"])]),_:1},8,["placement"])):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed,sub:e.item.indent>0}]),onClick:r[1]||(r[1]=n.withModifiers(f=>a(e.item),["stop"]))},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,class:"j-menu-item-icon",style:n.normalizeStyle({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),size:18},null,8,["icon","style"])):n.createCommentVNode("",!0),n.createElementVNode("div",Dd,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["j-menu-item-arrow",{open:e.item.open}])},null,2)):n.createCommentVNode("",!0)],6)],2))}}}),Hd=n.defineComponent({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=u=>{i("click",u)},s=n.computed(()=>o.menuList),{list:d,containerProps:c,wrapperProps:f}=Lo(s,{itemHeight:44});return(u,p)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-menu",{collapsed:e.collapsed,"j-menu-dark":n.unref(l)==="dark"}]},n.unref(c)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(f))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(d),h=>(n.openBlock(),n.createBlock(In,{key:h.data.value,"parent-actives":n.unref(a)?.pid?.split(".")||[],item:h.data,collapsed:e.collapsed,class:n.normalizeClass({"menu-item-entering":h.data.entering,"menu-item-leaving":h.data.leaving}),onClick:r},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),Wd=n.defineComponent({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=n.ref(),s=n.ref(0);let d=null;n.onMounted(()=>{typeof window<"u"&&window.ResizeObserver&&r.value&&(d=new ResizeObserver(()=>{r.value&&(s.value=r.value.offsetWidth)}),d.observe(r.value))});const c=n.computed(()=>{const h=[];let m=0,g=0;const b=o.menuList.length;return o.menuList.forEach(k=>{g++;const v=(fn(k.label)||0)+32+16+4+8;m+=v,(g===b&&m<=s.value||g<b&&m+56<=s.value)&&h.push(k)}),h.length<o.menuList.length&&h.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),h}),f=n.computed(()=>{const h=[];let m=0;const g=c.value.length;return o.menuList.forEach(b=>{m++,m>=g&&h.push(b)}),h}),u=n.computed(()=>{const h=a.value?.pid?.split(".")||[];return(h.length>1&&f.value.findIndex(m=>m.value===h[1])>-1||f.value.findIndex(m=>m.value===a.value?.value)>-1)&&h.push("moreId"),h}),p=h=>{i("click",h)};return yc({getHMoreMenus:f}),n.onUnmounted(()=>{d&&r.value&&(d.unobserve(r.value),d.disconnect(),d=null)}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"menuRef",ref:r,class:n.normalizeClass(["j-menu-horizontal",{"j-menu-dark":n.unref(l)==="dark"}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,g=>(n.openBlock(),n.createBlock(In,{key:g.value,"parent-actives":u.value,item:g,"is-horizontal":"",onClick:p},null,8,["parent-actives","item"]))),128))],2))}}),Ud=n.defineComponent({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],s=n.computed(()=>(o.menuList.forEach((h,m)=>{h.color=r[m%r.length]}),o.menuList)),d=n.computed(()=>a.value?.pid?.split(".")||[]),c=h=>{i("click",h)},{list:f,containerProps:u,wrapperProps:p}=Lo(s,{itemHeight:96});return(h,m)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-menu-vertical",{"j-menu-dark":n.unref(l)==="dark"}]},n.unref(u)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(p))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(f),g=>(n.openBlock(),n.createBlock(In,{key:g.data.value,"parent-actives":d.value,item:g.data,"is-vertical":"",onClick:c},null,8,["parent-actives","item"]))),128))],16)],16))}}),Ga=te(n.defineComponent({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(e,{emit:t}){const o=e,i=t;let a={};const l=n.ref("");l.value=o.activeId||"";const r=(g,b,k,v,w)=>{k=k||[];for(let C=0,S=k.length;C<S;C++){const y=k[C],E={};E.pid=b,E.indent=v,l.value===y.value&&(E.active=!0),Object.keys(y).forEach(_=>{_!=="children"&&(E[_]=y[_])}),w&&w.includes(y.value)&&(E.open=!0),g.push(E);const B=y.children||[];B.length>0&&(E.hasChildren=!0,w||(a[E.value]=B),(!w||E.open&&!o.collapsed)&&r(g,`${b}.${E.value}`,B,v+1,w))}},s=(g,b)=>{const k=[];return r(k,"0",g,0,b),k},d=n.ref([]);let c=[];const f=()=>{a={},c=s(o.menus);const g=[];if(l.value&&o.mode==="inline"){const b=c.find(k=>k.value===l.value);b&&g.push(...b.pid.split("."))}d.value=s(o.menus,g),console.log("showMenuList",d.value)};n.watch(()=>o.menus,()=>{f()},{immediate:!0}),n.watch(()=>o.mode,()=>{f()});const u=()=>{if(d.value.find(b=>b.active)?.value!==l.value){const b=c.find(k=>k.value===l.value);if(b){const k=[];o.mode==="inline"&&k.push(...b.pid.split(".")),d.value=s(o.menus,k)}}},p=n.computed(()=>c.find(g=>g.value===l.value));n.watch(()=>o.activeId,()=>{l.value=o.activeId||"",u()}),n.watch(()=>o.collapsed,()=>{if(o.collapsed)d.value=s(o.menus,[]);else{const g=[];if(l.value){const b=c.find(k=>k.value===l.value);b&&g.push(...b.pid.split("."))}d.value=s(o.menus,g)}});const h=n.computed(()=>o.theme),m=g=>{if(g.hasChildren){if(o.collapsed)return;const b=[];b.push(...g.pid.split(".")),g.open||b.push(g.value);const k=s(o.menus,b),v=new Set(d.value.map(C=>C.value)),w=new Set(k.map(C=>C.value));k.forEach(C=>{v.has(C.value)||(C.entering=!0)}),d.value.forEach(C=>{w.has(C.value)||(C.leaving=!0)}),d.value=k,setTimeout(()=>{d.value.forEach(C=>{C.entering=!1,C.leaving=!1})},300)}else{const b=d.value.find(k=>k.active);if(b?.value===g.value)return;b&&(b.active=!1),g.active=!0,l.value=g.value,i("click",g)}};return mc({getMenuMap:()=>a,toArray:s,activeMenu:p,theme:h}),(g,b)=>e.mode==="inline"?(n.openBlock(),n.createBlock(Hd,{key:0,"menu-list":d.value,collapsed:e.collapsed,onClick:m},null,8,["menu-list","collapsed"])):e.mode==="horizontal"?(n.openBlock(),n.createBlock(Wd,{key:1,"menu-list":d.value,onClick:m},null,8,["menu-list"])):(n.openBlock(),n.createBlock(Ud,{key:2,"menu-list":d.value,onClick:m},null,8,["menu-list"]))}})),Jd={class:"j-keyword-panel"},Yd={key:0},qd={key:1,class:"columns-wrapper"},Gd=n.defineComponent({name:"JKeywordPanel",__name:"keyword-panel",props:n.mergeModels({columns:{type:Array,default:()=>[]}},{checkAll:{default:!0},checkAllModifiers:{},checkFields:{default:()=>[]},checkFieldsModifiers:{}}),emits:["update:checkAll","update:checkFields"],setup(e,{expose:t}){const{t:o}=Pe(),i=e,a=n.useModel(e,"checkAll"),l=n.useModel(e,"checkFields"),r=n.ref(!1),s=n.ref(""),d=n.computed(()=>i.columns.filter(p=>p.config?.filter?.isSearchKeyword?s.value?p.config?.label?.indexOf(s.value)!=-1:!0:!1).map(p=>({label:p.config?.label,value:p.id}))),c=()=>{a.value||(a.value=!0,r.value=!1,l.value=[])},f=p=>{p.length>0?a.value=!1:a.value=!0};return t({init:()=>{a.value?r.value=!1:r.value=!0}}),(p,h)=>{const m=n.resolveComponent("j-icon"),g=n.resolveComponent("el-input"),b=n.resolveComponent("j-checkbox");return n.openBlock(),n.createElementBlock("div",Jd,[n.createElementVNode("div",{class:n.normalizeClass(["range-item",{active:a.value}]),onClick:c},[n.createElementVNode("div",null,n.toDisplayString(n.unref(o)("搜索全部")),1),a.value?(n.openBlock(),n.createBlock(m,{key:0,icon:"mdi:check"})):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:"range-item",onClick:h[0]||(h[0]=k=>r.value=!r.value)},[n.createElementVNode("div",null,n.toDisplayString(n.unref(o)("搜索特定字段")),1),n.createVNode(m,{icon:r.value?"mdi:keyboard-arrow-up":"mdi:keyboard-arrow-down"},null,8,["icon"])]),r.value?(n.openBlock(),n.createElementBlock("div",Yd,[n.createVNode(g,{class:"no-border background",modelValue:s.value,"onUpdate:modelValue":h[1]||(h[1]=k=>s.value=k),modelModifiers:{trim:!0},placeholder:n.unref(o)("搜索"),clearable:""},{prefix:n.withCtx(()=>[n.createVNode(m,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])])):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("div",qd,[n.createVNode(b,{options:d.value,modelValue:l.value,"onUpdate:modelValue":h[2]||(h[2]=k=>l.value=k),onChange:f,style:{display:"flex","flex-direction":"column"}},null,8,["options","modelValue"])])):n.createCommentVNode("",!0)])}}}),Kd={key:0,class:"title"},Xd={class:"content"},Zd={class:"relation"},Qd={style:{width:"72px"}},eu={class:"btn-wrapper"},tu={class:"field-wrapper"},nu={class:"buttons"},Ka=n.defineComponent({name:"JFilterPanel",__name:"filter-panel",props:n.mergeModels({columns:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},{relation:{default:"and"},relationModifiers:{},isPin:{default:!1},isPinModifiers:{}}),emits:n.mergeModels(["filter","close"],["update:relation","update:isPin"]),setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=n.useModel(e,"relation"),r=n.useModel(e,"isPin"),s=n.ref([]),d=()=>{r.value=!r.value},c=[{id:"field",type:"j-select",getCompConfig:()=>({selectData:u.value.join(","),options:f.value}),config:{appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",isShowTooltip:!0,isSelectOnlyone:!0,width:r.value?132:160,change:({value:v,row:w})=>{const S=a.columns.find(B=>B.id===v)?.config||{};let y="eq",E="text";["options"].includes(S.dataType||"")?y="in":["dateTime"].includes(S.dataType||"")&&(y="range",E="dateTime"),w.method=y,w.type=S.valueType||E}}},{id:"method",type:"j-select",getCompConfig:({row:v})=>{const C=a.columns.find(S=>S.id===v.field)?.config||{};return["options","switch"].includes(C.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"in",label:"等于任意一个"},{value:"nin",label:"不等于任意一个"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["dateTime"].includes(C.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"range",label:"选择范围"},{value:"formula",label:"动态筛选"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"like",label:"包含"},{value:"unlike",label:"不包含"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}},config:{width:r.value?120:144,appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",noBorder:!0,change:({row:v})=>{v.value=void 0}}},{id:"value",type:"input",getCompType:({row:v})=>{const C=a.columns.find(S=>S.id===v.field)?.config||{};if(["options","dataItem","switch"].includes(C.dataType||"")){if(["in","nin"].includes(v.method)||["eq","ne"].includes(v.method))return"j-select"}else if(["dateTime"].includes(C.dataType||""))return["range"].includes(v.method)?"j-date-range":["formula"].includes(v.method)?"j-select":"j-date";return"j-input"},getCompConfig:({row:v})=>{if(["empty","not_empty"].includes(v.method||""))return{display:!1};const C=a.columns.find(y=>y.id===v.field)?.config||{},S={display:!0,placeholder:"",clearable:!0,filterable:!0};return["options","dataItem"].includes(C.dataType||"")?(S.collapseTags=!0,S.collapseTagsTooltip=!0,S.dataType=C.dataType,S.dataCode=C.dataCode,S.options=C.options):["switch"].includes(C.dataType||"")?(S.options=[],S.dataType="options",C.activeValue==null?S.options.push({label:"是",value:"1"}):S.options.push({label:"是",value:C.activeValue}),C.inactiveValue==null?S.options.push({label:"否",value:"0"}):S.options.push({label:"否",value:C.inactiveValue})):["dateTime"].includes(C.dataType||"")&&(["formula"].includes(v.method)?(S.placeholder="",S.options=[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"明天",value:"tomorrow"},{label:"最近7天",value:"last7days"},{label:"最近30天",value:"last30days"},{label:"本周",value:"thisWeek"},{label:"上周",value:"lastWeek"},{label:"下周",value:"nextWeek"},{label:"本月",value:"thisMonth"},{label:"上月",value:"lastMonth"},{label:"下月",value:"nextMonth"},{label:"本季度",value:"thisQuarter"},{label:"上季度",value:"lastQuarter"},{label:"下季度",value:"nextQuarter"},{label:"今年",value:"thisYear"},{label:"去年",value:"lastYear"},{label:"明年",value:"nextYear"}],S.dataType="options"):(S.type="datetime",["range"].includes(v.method)?(S.startPlaceholder="开始时间",S.endPlaceholder="结束时间",S.defaultTime=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)]):S.placeholder="")),S},config:{width:r.value?234:296,appendTo:r.value?void 0:".j-filter-panel"}}];n.onMounted(()=>{s.value=a.searchFieldList});const f=n.computed(()=>a.columns.filter(v=>!v.children?.length).map(v=>({label:v.config?.label,value:v.id,dataType:v.config?.dataType,options:v.config?.options}))),u=n.computed(()=>s.value.map(v=>v.field)),p=({data:v})=>{if(u.value.includes(v.value))return;const C=a.columns.find(E=>E.id===v.value)?.config||{};let S="eq",y="text";["options","dataItem"].includes(C.dataType||"")?S="in":["dateTime"].includes(C.dataType||"")&&(S="range",y="dateTime"),s.value.push({field:v.value,method:S,type:C.valueType||y})},h=o,m=()=>{s.value.length=0},g=()=>{r.value?h("filter"):h("close",!0)},b=()=>{s.value.forEach(v=>{v.value=void 0}),h("filter")};return t({getSearchFields:()=>s.value}),(v,w)=>{const C=n.resolveComponent("j-icon"),S=n.resolveComponent("j-select"),y=n.resolveComponent("j-button-select"),E=n.resolveComponent("j-button"),B=n.resolveComponent("j-input-rows"),_=n.resolveComponent("el-tooltip");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-filter-panel",{"is-pin":r.value}])},[r.value?(n.openBlock(),n.createElementBlock("div",Kd,[n.createVNode(C,{icon:"mdi:filter-outline"}),n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("筛选")),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Xd,[n.createElementVNode("div",Zd,[n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("筛选出符合以下")),1),n.createElementVNode("div",Qd,[n.createVNode(S,{teleported:!1,noBorder:!0,modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=T=>l.value=T),options:[{value:"and",label:"所有"},{value:"or",label:"任一"}]},null,8,["modelValue"])]),n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("条件的数据")),1)]),n.createElementVNode("div",eu,[n.createVNode(y,{label:"添加过滤条件",options:f.value,modelValue:u.value.join(","),onChange:p},null,8,["options","modelValue"]),s.value.length>0?(n.openBlock(),n.createBlock(E,{key:0,type:"text",danger:"",label:"删除全部",onClick:m})):n.createCommentVNode("",!0)]),n.createElementVNode("div",tu,[n.createVNode(B,{modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=T=>s.value=T),columns:c,editConfig:{isAddBtn:!1},isWrap:r.value},null,8,["modelValue","isWrap"])]),n.createVNode(_,{placement:"bottom",content:r.value?n.unref(i)("取消固定"):n.unref(i)("固定显示")},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"pin-btn",onClick:d},[n.createVNode(C,{rotate:45,icon:r.value?"mdi:keep-off":"mdi:keep"},null,8,["icon"])])]),_:1},8,["content"])]),n.createElementVNode("div",nu,[n.createVNode(E,{label:n.unref(i)("筛选"),type:"primary",onClick:g},null,8,["label"]),n.createVNode(E,{label:n.unref(i)("清空"),icon:"mdi:delete-sweep-outline",type:"text",onClick:b},null,8,["label"])])],2)}}}),ou={class:"j-order-panel"},iu={class:"content"},au={class:"btn-wrapper"},lu={class:"field-wrapper"},ru={class:"buttons"},su=n.defineComponent({name:"JOrderPanel",__name:"order-panel",props:{columns:{type:Array,default:()=>[]}},emits:["save","clear"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o,r=n.computed(()=>a.columns.filter(m=>!m.children?.length&&m.config?.sorter?.isNot!==!0).map(m=>({label:m.config?.label,value:m.id}))),s=n.ref([]),d=n.computed(()=>s.value.map(m=>m.value)),c=[{id:"label",type:"j-title",getCompConfig:({row:m})=>({title:m.label}),config:{style:{width:"180px"}}},{id:"sord",type:"j-radio",config:{dataType:"options",options:[{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],isButton:!0}}],f=({data:m})=>{d.value.includes(m.value)||s.value.push({label:m.label,value:m.value,sord:"ASC"})},u=m=>{s.value=JSON.parse(JSON.stringify(m))},p=()=>{l("save",JSON.parse(JSON.stringify(s.value)))},h=()=>{s.value=[],l("clear")};return t({init:u}),(m,g)=>{const b=n.resolveComponent("j-button-select"),k=n.resolveComponent("j-input-rows"),v=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",ou,[n.createElementVNode("div",iu,[n.createElementVNode("div",au,[n.createVNode(b,{label:"添加排序规则",options:r.value,modelValue:d.value.join(","),onChange:f},null,8,["options","modelValue"])]),n.createElementVNode("div",lu,[n.createVNode(k,{modelValue:s.value,"onUpdate:modelValue":g[0]||(g[0]=w=>s.value=w),columns:c,editConfig:{isAddBtn:!1,drag:!0}},null,8,["modelValue"])])]),n.createElementVNode("div",ru,[n.createVNode(v,{label:n.unref(i)("排序"),type:"primary",onClick:p},null,8,["label"]),s.value.length>0?(n.openBlock(),n.createBlock(v,{key:0,label:n.unref(i)("清空排序"),icon:"mdi:delete-sweep",type:"text",onClick:h},null,8,["label"])):n.createCommentVNode("",!0)])])}}}),cu={class:"j-column-panel"},du={class:"content"},uu={class:"search-wrapper"},fu={class:"tree-wrapper"},pu={class:"buttons"},hu=n.defineComponent({name:"JColumnPanel",__name:"column-panel",props:{columns:{type:Array,default:()=>[]},columnConfig:{type:Array}},emits:["save"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o,r=n.ref(),s=n.ref(""),d={},c=n.ref([]),f=n.ref([]),u=(y,E)=>{const B=[],_=new Map;y.forEach(j=>{_.set(j.id,j),d[j.id]=j});const T=new Set;return E&&E.length>0&&E.forEach(j=>{const D=_.get(j.id);if(D){T.add(D.id);const A={id:D.id,label:D.config?.label||D.id,type:D.type,display:D.config?.display!==!1};D.children&&D.children.length>0&&(A.children=u(D.children,j.children)),B.push(A)}}),y.forEach(j=>{if(!T.has(j.id)){const D={id:j.id,label:j.config?.label||j.id,type:j.type,display:j.config?.display!==!1};j.children&&j.children.length>0&&(D.children=u(j.children)),B.push(D)}}),B},p=(y,E)=>E.length===0?y:y.map(B=>{const _=E.some(j=>B.label.toLowerCase().includes(j.toLowerCase())),T=B.children?p(B.children,E):[];return _||T.length>0?{...B,children:T.length>0?T:B.children}:null}).filter(Boolean),h=n.computed(()=>{if(!s.value)return f.value;const y=s.value.split(/\s+/).filter(Boolean);return p(f.value,y)}),m=n.ref([]),g=n.computed(()=>{const y=new Map;if(a.columnConfig&&a.columnConfig.length>0){const E=B=>{B.forEach(_=>{y.set(_.id,_),_.children&&E(_.children)})};E(a.columnConfig)}return y}),b=()=>{const y=E=>{const B=[];return E.forEach(_=>{let T=!0;if(g.value.size>0){const j=g.value.get(_.id);j?T=j.display:T=_.config?.display!==!1}else T=_.config?.display!==!1;T&&(B.push(_.id),_.children&&B.push(...y(_.children)))}),B};m.value=y(a.columns)},k=(y,{node:E})=>{y.includes(E.id)?m.value.push(E.id):m.value=m.value.filter(_=>_!==E.id)},v=(y,E,B)=>B==="inner"?!1:y.parent===E.parent,w=()=>{const y=E=>E.map(B=>{const _={...B,display:m.value.includes(B.id)};return B.children&&(_.children=y(B.children)),_});l("save",y(f.value))},C=()=>{if(b(),f.value=JSON.parse(JSON.stringify(c.value)),s.value="",r.value){const y=r.value;y.setCheck&&y.setCheck(m.value);const E=y.$refs?.treeRef||y;E?.setCheckedKeys&&E.setCheckedKeys(m.value)}};return t({init:()=>{b(),c.value=u(a.columns,a.columnConfig),f.value=JSON.parse(JSON.stringify(c.value))}}),(y,E)=>{const B=n.resolveComponent("j-icon"),_=n.resolveComponent("el-input"),T=n.resolveComponent("j-tree"),j=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",cu,[n.createElementVNode("div",du,[n.createElementVNode("div",uu,[n.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=D=>s.value=D),modelModifiers:{trim:!0},placeholder:n.unref(i)("搜索 (多个关键词用空格隔开)"),clearable:""},{prefix:n.withCtx(()=>[n.createVNode(B,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),n.createElementVNode("div",fu,[n.createVNode(T,{ref_key:"treeRef",ref:r,list:h.value,"is-tree-data":!0,"default-checked-keys":m.value,"default-expand-all":!0,checkable:"","id-key":"id",draggable:!s.value,"allow-drop":v,check:k},null,8,["list","default-checked-keys","draggable"])])]),n.createElementVNode("div",pu,[n.createVNode(j,{label:n.unref(i)("确定"),type:"primary",onClick:w},null,8,["label"]),n.createVNode(j,{label:n.unref(i)("重置"),icon:"mdi:restore",type:"text",onClick:C},null,8,["label"])])])}}}),mu={class:"j-table-panel-left"},gu={class:"j-table-panel-top"},yu={class:"j-table-panel-top-left"},bu={class:"j-table-panel-top-right"},wu={key:0,style:{width:"200px"}},vu={class:"j-table-panel-main"},Cu={key:0,class:"j-table-panel-filter-panel"},Xa=te(n.defineComponent({name:"JTablePanel",__name:"table-panel",props:{columns:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageSizes:Array,pageSize:{type:Number,default:100},rowKey:{type:String,default:void 0},sort:String,buttons:{type:Array,default:()=>[]},batchButtons:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},loadData:Function,immediate:{type:Boolean,default:!0},noPadding:Boolean},emits:["select","ready"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o;a.isMultiple&&!a.rowKey&&console.warn("rowKey is required when isMultiple is true");const r=n.ref();let s=[];const d=n.ref(0),c=n.ref(1);let f=a.pageSize||100,u="";const p=n.ref([]),h=n.ref(!1),m=n.computed(()=>a.batchButtons&&a.batchButtons.length>0),g=n.computed(()=>p.value.length>0),b=n.computed(()=>m.value&&g.value||h.value),k=n.computed(()=>a.isPage&&!b.value);m.value&&!a.isMultiple&&console.warn("batchButtons is only valid when isMultiple is true");const v=z=>a.rowKey?a.rowKey.split(",").map(de=>z[de.trim()]).join("::"):"",w=(z,F)=>{if(!F||F.length===0)return z.filter(J=>J.config?.display!==!1).map(J=>J.children&&J.children.length>0?{...J,children:w(J.children)}:J);const de=new Map(z.map(J=>[J.id,J])),ve=[];return F.forEach(J=>{const oe=de.get(J.id);if(oe){if(J.display){let ge=oe;oe.children&&oe.children.length>0&&(ge={...oe,children:w(oe.children,J.children)}),ve.push(ge)}de.delete(J.id)}}),z.forEach(J=>{if(de.has(J.id)&&J.config?.display!==!1){let oe=J;J.children&&J.children.length>0&&(oe={...J,children:w(J.children)}),ve.push(oe)}}),ve},C=n.computed(()=>w(a.columns,se.value)),S=n.computed(()=>Ui(a.columns,z=>z.config.label)),y=n.ref(""),E=n.computed(()=>S.value.some(z=>z.config?.filter?.isSearchKeyword)),B=n.ref(),_=n.ref(!0),T=n.ref([]),j=n.computed(()=>_.value?"搜索全部":`搜索范围:${S.value.filter(z=>T.value.includes(z.id)).map(z=>z.config?.label).join("、")}`),D=()=>{B.value.init()},A=n.ref(),R=n.ref(!1),V=n.ref(!1),x=n.ref(!1),L=n.ref([]),P=n.ref("and"),G=n.ref(),K=n.ref(!1),ne=n.ref([]),pe=()=>{G.value.init(ne.value)},fe=z=>{ne.value=z,K.value=!1,De()},Y=()=>{ne.value=[],De()},he=n.ref(),ae=n.ref(!1),se=n.ref(),xe=n.computed(()=>se.value!=null),Ve=()=>{he.value?.init()},H=z=>{console.log("handleColumnSave:",z),se.value=z,ae.value=!1},X=n.ref(!1),le=()=>{X.value=!X.value},we=()=>{p.value=[],r.value&&(r.value.setSelection?.([]),h.value&&(h.value=!1,r.value.setRecords(s)))},$e=()=>{h.value=!h.value,h.value?r.value?.setRecords(p.value):r.value?.setRecords(s),r.value?.setSelection?.(p.value)},Re=n.computed(()=>{if(p.value.length>0){const z=[{label:`已选${p.value.length}条`,type:"text"},{label:h.value?"全部":"仅选中",type:"text",click:$e},{label:"清空选中",type:"text",click:we}],F=a.batchButtons.map(de=>({...de,click:()=>{de.click&&de.click(p.value)}}));return[...z,...F]}return a.buttons}),me=async()=>{const z={},F={};F.rel=P.value;const de=A.value?.getSearchFields?.()||L.value;F.cond=de.filter(J=>J.value!==void 0&&J.value!==null&&J.value!=="").map(J=>({field:J.field,method:J.method,value:J.value,type:J.type})),F.cond.length>0?x.value=!0:x.value=!1,z.filter=F;const ve=ne.value.map(J=>J.value+" "+J.sord).join(",");if(y.value&&(z.keyword={value:y.value,fields:_.value?S.value.filter(J=>J.config?.filter?.isSearchKeyword).map(J=>J.id):n.unref(T)}),a.loadData){if(a.isPage){z.pagination={rows:f,page:c.value,sort:ve||u||a.sort||a.rowKey};const J=await a.loadData(z)||{};s=J.rows||[],d.value=J.records||0}else z.sort=ve,s=await a.loadData(z)||[],d.value=s.length;r.value.setRecords(s),m.value?(p.value=[],h.value=!1):a.rowKey&&p.value.length>0&&r.value?.setSelection?.(p.value)}},De=async()=>{c.value=1,await me()},ut=({rows:z,page:F})=>{f=z,c.value=F,me()},ot=async()=>{c.value=1,await me()},O=async()=>{await me()},q=async()=>{await ot()},I=z=>{l("ready",z)},N=z=>{let F=[];if(m.value)F=z;else if(!a.rowKey)F=z;else{const de=new Map(z.map(J=>[v(J),J])),ve=new Map(p.value.map(J=>[v(J),J]));s.forEach(J=>{const oe=v(J);de.has(oe)?ve.set(oe,de.get(oe)):ve.delete(oe)}),F=Array.from(ve.values())}p.value=F,l("select",F),h.value&&F.length===0?(h.value=!1,r.value&&r.value.setRecords(s)):h.value&&F.length>0&&r.value&&(r.value.setRecords(F),r.value.setSelection?.(F))},$=()=>p.value||[],W=z=>{p.value=z,r.value?.setSelection?.(z)},U=()=>r.value?.getInstance?.();return n.onMounted(async()=>{a.immediate&&await O()}),t({refreshData:O,resetData:ot,getSelection:$,setSelection:W,clearSelection:()=>{we()},getInstance:U}),(z,F)=>{const de=n.resolveComponent("j-buttons"),ve=n.resolveComponent("j-icon"),J=n.resolveComponent("el-popover"),oe=n.resolveComponent("el-tooltip"),ge=n.resolveComponent("el-input"),ue=n.resolveComponent("j-button"),Te=n.resolveComponent("j-table");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-table-panel-wrapper",{fullscreen:X.value,"no-padding":e.noPadding||X.value}])},[n.createElementVNode("div",{class:n.normalizeClass(["j-table-panel",{"j-table-panel-fullscreen":X.value}])},[n.createElementVNode("div",mu,[n.createElementVNode("div",gu,[n.createElementVNode("div",yu,[n.createVNode(de,{list:Re.value},null,8,["list"])]),n.createElementVNode("div",bu,[E.value&&!b.value?(n.openBlock(),n.createElementBlock("div",wu,[n.createVNode(ge,{modelValue:y.value,"onUpdate:modelValue":F[2]||(F[2]=re=>y.value=re),modelModifiers:{trim:!0},placeholder:n.unref(i)("搜索数据"),onKeyup:n.withKeys(De,["enter"]),onClear:De,clearable:"",class:"j-suffix"},{prefix:n.withCtx(()=>[n.createVNode(ve,{icon:"mdi:search"})]),suffix:n.withCtx(()=>[n.createVNode(oe,{placement:"bottom",content:j.value},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom-end","popper-style":"padding: 0",width:200,trigger:"click","show-arrow":!1,onShow:D,onHide:De},{reference:n.withCtx(()=>[n.createVNode(ve,{icon:"mdi:keyboard-arrow-down",style:{cursor:"pointer"}})]),default:n.withCtx(()=>[n.createVNode(Gd,{ref_key:"keywordPanelRef",ref:B,columns:S.value,"check-all":_.value,"onUpdate:checkAll":F[0]||(F[0]=re=>_.value=re),"check-fields":T.value,"onUpdate:checkFields":F[1]||(F[1]=re=>T.value=re)},null,8,["columns","check-all","check-fields"])]),_:1})])]),_:1},8,["content"])]),_:1},8,["modelValue","placeholder"])])):n.createCommentVNode("",!0),!R.value&&!b.value?(n.openBlock(),n.createBlock(J,{key:1,placement:"bottom","popper-style":"padding: 0",width:644,trigger:"click",persistent:!1,visible:V.value,"onUpdate:visible":F[6]||(F[6]=re=>V.value=re),onHide:De},{reference:n.withCtx(()=>[n.createVNode(ue,{icon:"mdi:filter-outline",label:"筛选",type:"text",class:n.normalizeClass({active:x.value})},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(Ka,{ref_key:"filterPanelRef",ref:A,"is-pin":R.value,"onUpdate:isPin":F[3]||(F[3]=re=>R.value=re),relation:P.value,"onUpdate:relation":F[4]||(F[4]=re=>P.value=re),searchFieldList:L.value,columns:S.value,onFilter:De,onClose:F[5]||(F[5]=re=>V.value=!1)},null,8,["is-pin","relation","searchFieldList","columns"])]),_:1},8,["visible"])):n.createCommentVNode("",!0),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:2,placement:"bottom",content:n.unref(i)("排序")},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom","popper-style":"padding: 0",width:380,trigger:"click",onShow:pe,visible:K.value,"onUpdate:visible":F[7]||(F[7]=re=>K.value=re)},{reference:n.withCtx(()=>[n.createVNode(ue,{class:n.normalizeClass({active:ne.value.length>0}),type:"text",icon:"mdi:sort"},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(su,{ref_key:"orderPanelRef",ref:G,columns:S.value,onSave:fe,onClear:Y},null,8,["columns"])]),_:1},8,["visible"])])]),_:1},8,["content"])),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:3,placement:"bottom",content:n.unref(i)("显示字段")},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom","popper-style":"padding: 0",width:400,trigger:"click",onShow:Ve,visible:ae.value,"onUpdate:visible":F[8]||(F[8]=re=>ae.value=re)},{reference:n.withCtx(()=>[n.createVNode(ue,{class:n.normalizeClass({active:xe.value}),type:"text",icon:"mdi:table-headers-eye"},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(hu,{ref_key:"columnPanelRef",ref:he,columns:e.columns,"column-config":se.value,onSave:H},null,8,["columns","column-config"])]),_:1},8,["visible"])])]),_:1},8,["content"])),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:4,placement:"bottom",content:n.unref(i)("刷新")},{default:n.withCtx(()=>[n.createVNode(ue,{onClick:q,type:"text",icon:"mdi:refresh"})]),_:1},8,["content"])),n.createVNode(oe,{placement:"bottom",content:X.value?n.unref(i)("退出全屏"):n.unref(i)("全屏")},{default:n.withCtx(()=>[n.createVNode(ue,{onClick:le,type:"text",icon:X.value?"mdi:fullscreen-exit":"mdi:fullscreen"},null,8,["icon"])]),_:1},8,["content"])])]),n.createElementVNode("div",vu,[n.createVNode(Te,{ref_key:"tableRef",ref:r,columns:C.value,records:n.unref(s),"is-tree":e.isTree,"is-show-number":e.isShowNumber,"is-multiple":e.isMultiple&&!!e.rowKey,"is-page":k.value,"page-sizes":e.pageSizes,"page-size":e.pageSize,"page-total":d.value,"row-key":e.rowKey,actions:e.actions,"actions-max-count":e.actionsMaxCount,"actions-label":e.actionsLabel,"table-page":c.value,"onUpdate:tablePage":F[9]||(F[9]=re=>c.value=re),onLoadPageData:ut,onReady:I,onSelectionChanged:N},null,8,["columns","records","is-tree","is-show-number","is-multiple","is-page","page-sizes","page-size","page-total","row-key","actions","actions-max-count","actions-label","table-page"])])]),R.value&&!b.value?(n.openBlock(),n.createElementBlock("div",Cu,[n.createVNode(Ka,{ref_key:"filterPanelRef",ref:A,"is-pin":R.value,"onUpdate:isPin":F[10]||(F[10]=re=>R.value=re),relation:P.value,"onUpdate:relation":F[11]||(F[11]=re=>P.value=re),searchFieldList:L.value,columns:S.value,onFilter:De},null,8,["is-pin","relation","searchFieldList","columns"])])):n.createCommentVNode("",!0)],2)],2)}}})),ku={class:"j-button-select"},xu={class:"search-wraper"},Su={class:"options-wraper"},Bu=["onClick"],Za=te(n.defineComponent({name:"JButtonSelect",__name:"button-select",props:{modelValue:{default:void 0},label:{default:"添加"},popoverWidth:{default:240},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,{t:a}=Pe(),l=n.ref(""),r=n.computed(()=>l.value===""?o.options:o.options.filter(c=>(c.label||"").includes(l.value))),s=n.computed(()=>o.modelValue?(o.modelValue+"").split(",").filter(Boolean):[]),d=c=>{if(c.disabled||s.value.includes(c.value))return;const u=[...s.value,c.value].join(",");i("update:modelValue",u),i("change",{value:u,data:c})};return(c,f)=>{const u=n.resolveComponent("j-button"),p=n.resolveComponent("j-icon"),h=n.resolveComponent("el-input"),m=n.resolveComponent("el-popover");return n.openBlock(),n.createBlock(m,{teleported:!1,placement:"bottom-start","popper-style":"padding: 0",width:e.popoverWidth,trigger:"click","show-arrow":!1,offset:4},{reference:n.withCtx(()=>[n.createVNode(u,{style:{"justify-content":"flex-start",padding:"4px 0",border:"0"},icon:"mdi:add",label:e.label,type:"link"},null,8,["label"])]),default:n.withCtx(()=>[n.createElementVNode("div",ku,[n.createElementVNode("div",xu,[n.createVNode(h,{modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),modelModifiers:{trim:!0},placeholder:n.unref(a)("搜索"),class:"no-border",clearable:""},{prefix:n.withCtx(()=>[n.createVNode(p,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),n.createElementVNode("div",Su,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,g=>(n.openBlock(),n.createElementBlock("div",{key:g.value,class:n.normalizeClass(["option-item",{active:s.value.includes(g.value)||g.disabled}]),onClick:n.withModifiers(b=>d(g),["stop"])},[g.icon?(n.openBlock(),n.createBlock(p,{key:0,class:"j-button-select-icon",icon:g.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(n.unref(a)(g.label)),1)],10,Bu))),128))])])]),_:1},8,["width"])}}})),Eu={class:"j-tree-item-text"},_u={key:2,class:"j-tree-item-button-group"},ju={key:1,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center"}},Qa=te(n.defineComponent({name:"JTree",__name:"tree",props:{loadData:Function,afterLoadData:Function,click:Function,immediate:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array,default:()=>[]},defaultExpandedKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightCurrent:{type:Boolean,default:!0},filterNode:Function,renderAfterExpand:{type:Boolean,default:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},pidKey:{type:String,default:"pid"},idKey:{type:String},iconKey:{type:String,default:"nodeIcon"},iconColorKey:{type:String,default:"nodeIconColor"},list:{type:Array},dataType:String,dataCode:String,checkable:Boolean,check:Function,emptyDes:{type:String,default:"暂无数据"},defaultIcon:{type:String,default:""},defaultIconColor:{type:String,default:""},treeButtons:{type:Array,default:()=>[]},filterButton:Function,buttonDefaultIcon:{type:String,default:""},buttonIconColor:{type:String,default:""},runFlow:{type:Function},nodeClickFlow:{type:String},isHeightAuto:{type:Boolean,default:!1},theme:{type:String,default:"default"},draggable:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!1},allowDrop:Function},emits:["node-drop"],setup(e,{expose:t,emit:o}){const i=e,a=o,{useData:l,t:r}=Pe(),{getTreeData:s,loadData:d}=l(),c=n.ref(),f=n.ref(!1),u=n.ref(""),p=n.ref([]),h={children:"children",label:"label",disabled:"disabled"},m=n.computed(()=>s?s({dataType:i.dataType,dataCode:i.dataCode,labelKey:i.labelKey,valueKey:i.valueKey,pidKey:i.pidKey,idKey:i.idKey,notLoad:!0})||[]:[]),g=n.computed(()=>i.dataCode||i.dataType?m.value:i.list?n.unref(i.list):p.value),b=async()=>{f.value=!0,i.loadData&&(p.value=await i.loadData()||[]),d&&await d(i.dataType,i.dataCode),f.value=!1,n.nextTick(()=>{i.afterLoadData&&i.afterLoadData(g.value||[])})},k=(A,R=!0)=>{c.value?.setCurrentKey(A,R)},v=()=>c.value?.getCurrentKey(),w=(A,R=!1)=>{c.value?.setCheckedKeys(A,R)},C=(A=!1)=>c.value?.getCheckedKeys(A),S=async(A,R,V,x)=>{if(u.value=A.value,i.nodeClickFlow&&i.runFlow){const L=JSON.parse(i.nodeClickFlow);await i.runFlow(L,{value:A.value})}i.click&&i.click(A.value,A,x)},y=(A,{checkedKeys:R,checkedNodes:V,halfCheckedKeys:x,halfCheckedNodes:L})=>{i.check&&i.check(R,{node:A,checkedNodes:V,halfCheckedKeys:x,halfCheckedNodes:L})},E=(A,R,V,x)=>{a("node-drop",A,R,V,x)},B=A=>{const R=pt(i.treeButtons);return A&&i.filterButton?i.filterButton({buttons:R,node:A}):R},_=(A,R)=>{A.disabled||A.click&&A.click(R)},T=n.ref(""),j=(A,R)=>{T.value=A?R.value:"",console.log(T.value,"row")},D=(A,R,V)=>i.allowDrop?i.allowDrop(A,R,V):!(V=="inner"&&!R.data.canInner);return n.onMounted(async()=>{(i.immediate&&i.loadData||i.dataType||i.dataCode)&&await b()}),n.watch(()=>i.list,()=>{f.value=!0,n.nextTick(()=>{f.value=!1})}),n.watch(()=>i.dataCode||i.dataType,()=>{b()}),t({refreshData:b,setValue:k,getValue:v,setCheck:w,getCheck:C}),(A,R)=>{const V=n.resolveComponent("j-icon"),x=n.resolveComponent("j-button"),L=n.resolveComponent("el-dropdown-item"),P=n.resolveComponent("el-dropdown-menu"),G=n.resolveComponent("el-dropdown"),K=n.resolveComponent("el-tree"),ne=n.resolveComponent("el-empty"),pe=n.resolveDirective("loading");return n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-block","j-tree",{"j-tree-menu":e.theme==="menu"}]),style:{"min-height":"60px"}},[!f.value&&g.value.length>0?(n.openBlock(),n.createBlock(K,{key:0,"node-key":e.idKey||e.valueKey,"default-checked-keys":e.defaultCheckedKeys,"default-expanded-keys":e.defaultExpandedKeys,"current-node-key":u.value,data:g.value,"default-expand-all":e.defaultExpandAll,"show-checkbox":e.checkable,onNodeClick:S,onCheck:y,onNodeDrop:E,props:h,"highlight-current":e.highlightCurrent,accordion:e.accordion,"filter-node-method":e.filterNode,"render-after-expand":e.renderAfterExpand,draggable:e.draggable,"allow-drop":D,"expand-on-click-node":e.expandOnClickNode,ref_key:"treeRef",ref:c},{default:n.withCtx(({node:fe})=>[n.createElementVNode("div",{class:n.normalizeClass(["j-tree-item-wraper",{"is-focus":T.value===fe.data.value}])},[fe.data.openIcon?(n.openBlock(),n.createBlock(V,{key:0,class:"j-tree-item-open-icon",size:18,icon:fe.data.openIcon,color:fe.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):n.createCommentVNode("",!0),fe.data[e.iconKey]||e.defaultIcon?(n.openBlock(),n.createBlock(V,{key:1,class:"j-tree-item-default-icon",size:18,icon:fe.data[e.iconKey]||e.defaultIcon||"",color:fe.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):n.createCommentVNode("",!0),n.createElementVNode("div",Eu,n.toDisplayString(fe.label),1),B(fe.data).length?(n.openBlock(),n.createElementBlock("div",_u,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(B(fe.data),(Y,he)=>(n.openBlock(),n.createBlock(G,{key:he,trigger:"click",onVisibleChange:ae=>j(ae,fe.data)},{dropdown:n.withCtx(()=>[n.createVNode(P,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y.children,(ae,se)=>(n.openBlock(),n.createBlock(L,{key:se,disabled:ae.disabled,divided:ae.divided,onClick:n.withModifiers(xe=>_(ae,fe.data),["stop"])},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"j-flex-item",style:n.normalizeStyle({color:ae.danger?"var(--j-color-danger)":ae.color||e.buttonIconColor||"var(--j-color-text-2)"})},[ae.icon||e.buttonDefaultIcon?(n.openBlock(),n.createBlock(V,{key:0,icon:ae.icon||e.buttonDefaultIcon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(n.unref(r)(ae.label)),1)],4)]),_:2},1032,["disabled","divided","onClick"]))),128))]),_:2},1024)]),default:n.withCtx(()=>[n.createVNode(x,{icon:Y.icon,type:"text"},null,8,["icon"])]),_:2},1032,["onVisibleChange"]))),128))])):n.createCommentVNode("",!0)],2)]),_:1},8,["node-key","default-checked-keys","default-expanded-keys","current-node-key","data","default-expand-all","show-checkbox","highlight-current","accordion","filter-node-method","render-after-expand","draggable","expand-on-click-node"])):(n.openBlock(),n.createElementBlock("div",ju,[n.createVNode(ne,{description:n.unref(r)(e.emptyDes)},null,8,["description"])]))],2)),[[pe,f.value]])}}})),el=te(pa),Vu=Is;async function Tu(e,t,o){const i={...o};delete i.ruleIndex,delete i.trigger;const a=new Vu({[e]:[i]});let l=[];try{await a.validate({[e]:t})}catch(r){r.errors?l=r.errors.map(({message:s})=>s):l=[i.message||"校验错误"]}return l.length>0?l[0]:""}async function Nu(e,t,o){const i=o.map((a,l)=>({...a,ruleIndex:l})).sort(({warningOnly:a,ruleIndex:l},{warningOnly:r,ruleIndex:s})=>!!a==!!r?l-s:a?1:-1);for(let a=0;a<i.length;a+=1){const l=i[a];"pattern"in l&&(t+="");const r=await Tu(e,t,l);if(r!=="")return{name:e,errors:r}}}function $u(e,t){const o=(l,r,s,d,c)=>{Object.keys(r).forEach(f=>{let u=f;s&&(u=`${s}.${f}`);const p=r[f],{rules:h,myGridtableId:m}=t(u,s?r:void 0,d,c);if(h.length){const g=i(u,p,h);l.push(g)}m&&p.forEach(g=>{o(l,g,m,p,s?r:void 0)})})},i=(l,r,s)=>Nu(l,r,s);return{validateForm:async()=>{const l=n.unref(e),r=[];o(r,l,"");const s=await Promise.all(r),d={};return s.forEach(c=>{c&&(d[c.name]={msg:c.errors})}),d},validateField:i}}const tl=te(n.defineComponent({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1}},emits:["change"],setup(e,{expose:t,emit:o}){const i=e,a=o,{useData:l,existField:r,httpGet:s,httpPost:d,success:c,warning:f,error:u,info:p,t:h}=Pe();let m;l&&(m=l());const g=O=>{u&&u(O)},b=n.ref(!1),k=n.computed(()=>i.config?.gutter||16),v=n.computed(()=>i.config?.span||24),w=n.computed(()=>i.config?.labelWidth),C=n.computed(()=>i.config?.labelPosition||"right"),S=n.computed(()=>B.length===1&&(B[0].type==="j-tabs"||B[0].type==="j-layout"||B[0].config?.isAutoWindow)),y=n.reactive({}),E=n.ref({}),B=[],_={},T=n.ref({});let j={},D={},A=[],R={};const V=O=>{a("change",O)},x=O=>Rn(_[O]?.type||"")&&!_[O]?.config?.notInput||_[O]?.config?.isInput,L=O=>["j-table","j-input-rows","j-input-cards"].includes(_[O]?.type||"");let P;const G=(O,q)=>{Object.keys(O).forEach(I=>{const N=O[I];q&&(I=q+"."+I),N!=null&&typeof N=="object"&&!Mn(N)&&G(N,I),y[I]=N})},K=(O,q)=>{let I=O.id;return I||(O.config?.table&&O.config?.field?I=`${O.config.table}.${O.config.field}`:O.config?.table?I=O.config?.table:O.config?.field&&(I=O.config?.field),q&&L(q)&&(I=`${q}.${I}`)),I||Pn("j")},ne=(O,q,I,N="")=>{O.forEach($=>{$.id=K($,N);const W={id:$.id,slot:$.slot,type:$.type,getCompType:$.getCompType,getCompConfig:$.getCompConfig,config:{},children:[]};q.push(W);const{children:U}=$;Ln(W,$,["children","config"]),Ln(W.config,$.config||{},[]),_[$.id]&&console.warn("有重复的组件id:"+$.id),_[$.id]=W,i.readonly===!0&&(W.config.readonly=!0);let Q=!1,z;N!==""&&L(N)&&(Q=!0,W.config=$.config||{},W.config.parentTableId=N,z=_[N]?.config?.table);const F=W.config||{};if(x($.id))!I&&Q===!1&&(F?.defaultValue===0?y[$.id]=F?.defaultValue:y[$.id]=F?.defaultValue||void 0),F.table&&F.field?j[`${F.table}_${F.field}`.toLowerCase()]=$.id:F.field&&(Q?j[`${z}_${F.field}`.toLowerCase()]=$.id:j[`${F.field}`.toLowerCase()]=$.id);else if(Q&&F.field)j[`${z}_${F.field}`.toLowerCase()]=$.id;else if(L($.id))!I&&!F.isSubTable&&(y[$.id]=[]),F.table&&(j[F.table.toLowerCase()||""]=$.id),F.isSubTable||A.push(W);else if(F?.defaultValue)y[$.id]=F?.defaultValue;else if($.type==="collapse"&&F?.isExpand){const de=[];(F?.groups||[]).forEach(ve=>{de.push(ve.i)}),y[$.id]=de}U&&U.length>0&&ne(U,W.children,I,W.id)})},pe=async(O,q)=>{b.value=!1;const I=!!q;B.splice(0,B.length),j={},D={},A=[],P=q,cn(y),T.value={},I&&G(q,""),ne(O,B,I),R=pt(y),n.nextTick(()=>{b.value=!0,n.nextTick(()=>{ut(i.config?.codeInit,{})})})},fe=(O,q,I)=>{const N=[];return q.forEach($=>{const W={};Object.keys($).forEach(U=>{if(!I||I(U,$[U],O)){const Q=le(U);if(Q?.type==="j-table")W[Q?.id||""]=fe(U,$[U],I);else{let z=j[`${O}_${U}`.toLowerCase()]||U;z=z.indexOf(".")!==-1?z.split(".")[1]:z,W[z]=$[U]}}}),N.push(W)}),N},Y=(O,q)=>{Object.keys(O||{}).forEach(I=>{let N=O[I];const $=le(I);if($===void 0)N&&(Mn(N)&&(N=N[0]||{}),typeof N=="object"?Object.keys(N).forEach(W=>{if(!q||q(I,N[W],I)){let U=W;I!=="main"&&(U=`${I}_${W}`),D[U]=I,y[j[U.toLowerCase()]||W]=N[W]}}):y[I]=N);else if(L($.id||"")){if(!Array.isArray(N)){console.warn("表格数据不是数组:"+I);return}N?.length>0?y[j[I.toLowerCase()]||I]=fe(I,N,q):y[j[I.toLowerCase()]||I]=[]}else(!q||q(I,N,I))&&(y[j[I.toLowerCase()]||I]=N)}),P&&Object.keys(y).forEach(I=>{const N=le(I);(N===void 0||!["tabs","collapse"].includes(N.type||""))&&Ri(P,I,y[I])})},he=(O,q=!1)=>{const I={};return Object.keys(O).forEach(N=>{if(N==="parentRow")return;const $=_[N];if($){const W=$.config?.table,U=$.config?.field;if(q)U?I[U]=O[N]:I[N]=O[N];else if(L(N)){const Q=[];O[N].forEach(z=>{Q.push(he(z,!0))}),I[W||N]=Q}else W&&U?(I[W]=I[W]||{},I[W][U]=O[N]):U&&(I[U]=O[N])}else q?N!=="_X_ROW_KEY"&&N!=="_isHover"&&(I[N]=O[N]):D[N]?(I[D[N]]=I[D[N]]||{},I[D[N]][N.replace(`${D[N]}_`,"")]=O[N]):I[N]=O[N]}),I},ae=(O=!0)=>O?he(y):y,se=(O,q,I,N)=>{let $=_[O];if($==null){const U=O.split(".");$=_[U[U.length-1]]||{}}if(!$)return{};const W=$t({config:{...$.config||{},...T.value[$.id]||{}},getCompConfig:$.getCompConfig,formData:y,tableData:I,row:q,pRowData:N});return W._componentId=$?.id,W},xe=(O,q,I,N)=>{const $=se(O,q,I,N);if($.isNotRule!==!0&&$.display!==!1){const W=$.rule||[],U=W.find(Q=>Q.type==="only");return U&&(U.validator=async(Q,z)=>{if(z){const F={table:Q.table,key:Q.key,keyName:Q.keyName,field:Q.field,keyValue:Q.getKeyValue?Q.getKeyValue():"",value:z,paramNames:Q.paramNames,getParams:Q.getParams,withProjectId:Q.withProjectId,getValue:Q.getValue,formData:y};if(!await r(F))throw h(Q.message)||h("数据值重复")}}),{rules:W,myGridtableId:L($._componentId)?$._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:Ve}=$u(y,xe),H=async()=>{E.value={};const O=await Ve();return Object.keys(O).length>0?(E.value=O,g(`${h(_[Object.keys(O)[0]]?.config?.label)}:${h(O[Object.keys(O)[0]].msg)}`),!1):!0},X=()=>{E.value={},cn(y),Object.keys(R||{}).forEach(O=>{y[O]=R[O]})},le=O=>{let q=_[O];return q===void 0&&j[O.toLowerCase()]&&(q=_[j[O.toLowerCase()]]),q},we=({id:O,i:q,value:I,type:N})=>{if(N==="add")y[O].push(I);else if(N==="delete")y[O].splice(q,1);else{const $=le(O);$&&($.config.parentTableId?y[$.config.parentTableId][q][O]=I:y[O]=I)}},$e=({id:O,i:q})=>{const I=le(O);if(I){if(I.config.parentTableId){const N=y[I.config.parentTableId],$=I.id?I.id.replace(`${I.config.parentTableId}.`,""):"";if(q!=null)return(N[q]||{})[$||""];const W=[];return N&&N.forEach(U=>{W.push(U[$||""])}),W}if(L(I.id||"")){const N=[];return y[I.id||""].forEach($=>{N.push(he($,!0))}),N}return y[I.id||""]}if(y[O])return y[O]},Re=async({id:O,i:q})=>{const I=$e({id:O,i:q}),N=le(O);if(N&&m?.getLabel)if(q!==void 0){const $=I[q],W=y[N.config.parentTableId||""][q],U=$t({config:N.config,getCompConfig:N.getCompConfig,formData:y,tableData:y[N.config.parentTableId||""],row:W});return await m?.getLabel({value:$,config:U,formData:y,tableData:y[N.config.parentTableId||""],row:W})}else{const $=$t({config:N.config,getCompConfig:N.getCompConfig,formData:y});return await m?.getLabel({value:I,config:$,formData:y})}return I},me=async(O,q)=>m?.loadViewDataList?await m?.loadViewDataList(O,q,!1):[],De=O=>(O.set=we,O.get=$e,O.setFormData=Y,O.getFormData=ae,O.getLabel=Re,O.getViewData=me,O.getDateNow=q=>qi(new Date,q||"YYYY-MM-DD HH:mm:ss"),O.httpGet=s||(()=>{console.log("当前状态不支持")}),O.httpPost=d||(()=>{console.log("当前状态不支持")}),O.loading=q=>{Ht(q)},O.showMsg=({text:q,type:I})=>{switch(I){case"success":c&&c(q);break;case"warning":f&&f(q);break;case"error":u&&u(q);break;case"info":p&&p(q);break;default:p&&p(q);break}console.log("showMsg",q,I)},O),ut=async(O,q)=>{if(O&&O.trim()){O=`async (jcode) => {${O}}`;const{res:I,fn:N}=Vo(O);I&&await N(De(q))}},ot=(O,q)=>{T.value[O]={...T.value[O]||{},...q}};return i.schema&&pe(i.schema),fa({formData:y,compsConfig:T,errorFields:E,isAutoWindow:S,gutter:k,span:v,labelWidth:w,labelPosition:C,getValue:$e,formChange:V}),t({init:pe,reset:X,validate:H,setValue:we,getValue:$e,getLabel:Re,setFormData:Y,getFormData:ae,setCompConfig:ot}),(O,q)=>{const I=n.resolveComponent("j-form-item"),N=n.resolveComponent("el-row"),$=n.resolveComponent("el-form");return b.value?(n.openBlock(),n.createBlock($,{key:0,class:n.normalizeClass([{"j-block":e.isAutoSize},"j-form"]),"label-position":C.value,"label-width":w.value,size:e.config?.size,onSubmit:q[0]||(q[0]=n.withModifiers(()=>{},["prevent"]))},{default:n.withCtx(()=>[S.value?(n.openBlock(),n.createBlock(I,n.normalizeProps(n.mergeProps({key:0},B[0])),null,16)):(n.openBlock(),n.createBlock(N,{key:1,gutter:k.value},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(B,W=>n.createVNode(I,n.mergeProps({key:W.id,ref_for:!0},W),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):n.createCommentVNode("",!0)}}})),nl=te(n.defineComponent({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]}},setup(e){const t=e,{formData:o,compsConfig:i,errorFields:a,isAutoWindow:l,span:r,labelWidth:s}=Kt(),{t:d}=Pe(),c=n.computed(()=>$t({config:{...t.config||{},...i?.value?.[t.id]||{}},getCompConfig:t.getCompConfig,formData:o})),f=n.computed(()=>t.getCompType?t.getCompType({config:t.config,formData:o}):t.type),u=n.computed(()=>Rn(f.value)&&!c.value?.notInput||c.value?.isInput),p=n.computed(()=>c.value?.labelWidth||s.value),h=n.computed(()=>(c.value?.rule||[]).some(b=>b.required===!0)),m=n.computed(()=>{const g=a?.value?.[t.id];return g?g.msg:""});return(g,b)=>{const k=n.resolveComponent("j-comp"),v=n.resolveComponent("el-form-item"),w=n.resolveComponent("el-col");return c.value.display!==!1&&!n.unref(l)?(n.openBlock(),n.createBlock(w,{key:0,span:c.value.span||n.unref(r),style:n.normalizeStyle({...c.value.colStyle||{}}),class:n.normalizeClass(c.value.colClass||{})},{default:n.withCtx(()=>[u.value?(n.openBlock(),n.createBlock(v,{key:0,label:n.unref(d)(c.value.notShowLabel?"":c.value.label||""),"label-position":c.value.labelPosition,"label-width":p.value,required:h.value,error:n.unref(d)(m.value)},{default:n.withCtx(()=>[n.createVNode(k,{id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"])]),_:1},8,["label","label-position","label-width","required","error"])):(n.openBlock(),n.createBlock(k,{key:1,id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"]))]),_:1},8,["span","style","class"])):c.value.display!==!1?(n.openBlock(),n.createBlock(k,{key:1,id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"])):n.createCommentVNode("",!0)}}})),Mu={class:"j-page"},ol=te(n.defineComponent({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(e,{expose:t}){const o=e,i=n.ref(!1),a=[],l={},r=n.reactive({}),s=(c,f)=>{c.forEach(u=>{u.id=u.id||Pn("c");const p={id:u.id,slot:u.slot,type:u.type,config:{},children:[]},{children:h}=u;l[u.id]=p,Ln(p.config,u.config||{},["defaultValue"]),u?.config?.defaultValue!==void 0&&(r.value[u.id]=u.config.defaultValue),f.push(p),h&&h.length>0&&s(h,p.children)})},d=c=>{i.value=!1,a.splice(0,a.length),cn(l),cn(r),s(c,a),n.nextTick(()=>{i.value=!0})};return o.schema&&d(o.schema),t({init:d}),(c,f)=>{const u=n.resolveComponent("j-comp");return n.openBlock(),n.createElementBlock("div",Mu,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(a,p=>n.createVNode(u,{key:p.id,id:p.id,type:p.type,config:p.config,children:p.children},null,8,["id","type","config","children"])),64))])}}})),il=te(n.defineComponent({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.ref("");return n.watch(()=>o.modelValue,l=>{l?a.value=l:(a.value=dn(),i("update:modelValue",a.value))},{immediate:!0}),(l,r)=>{const s=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(s,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=d=>a.value=d),readonly:"",size:e.size},null,8,["modelValue","size"])}}})),Lu={class:"j-input-rows"},Pu={key:0,class:"j-input-rows-num"},Ru={key:1,class:"j-input-rows-char"},al=te(n.defineComponent({name:"JInputRows",__name:"input-rows",props:{modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},isCompact:{type:Boolean,default:!1},showNum:{type:Boolean,default:!1},showChar:{type:Boolean,default:!1},isWrap:{type:Boolean,default:!1},id:{type:String,default:""}},emits:["update:modelValue","change","rowChange"],setup(e,{emit:t}){const o=C=>C==null,i=e,a=t,{formData:l}=Kt(),r=n.computed(()=>i.editConfig.isAddBtn!==!1),s=n.computed(()=>i.editConfig.addBtnText||"添加"),d=n.computed(()=>i.editConfig.buttonsAlign||"left"),c=n.computed(()=>i.editConfig.isRemoveBtn!==!1),f=n.computed(()=>i.editConfig.readonly),u=n.computed(()=>i.editConfig.drag),p=n.computed(()=>i.editConfig.isNullValue!==!1),h=n.ref(),m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],g=n.ref([]);i.modelValue&&i.modelValue.length>0?(g.value=i.modelValue||[],g.value.forEach(C=>{C.i||(C.i=dn())})):(g.value=[],a("update:modelValue",g.value)),n.watch(()=>i.modelValue,C=>{g.value=i.modelValue||[],g.value=C||[],g.value.forEach(S=>{S.i||(S.i=dn())})},{deep:!0});const k=()=>{const C={i:dn()};i.columns.forEach(S=>{const y=S.config?.valueRowKey||S.id||"";y&&(C[y]=pt(S.config?.defaultValue))}),g.value.push(C),a("change",{id:i.id,value:C,data:C,formData:l,tableData:g.value,type:"add"})},v=C=>{const S=g.value[C];g.value.splice(C,1),a("change",{id:i.id,value:S,data:S,formData:l,tableData:g.value,type:"delete"})},w=C=>{a("rowChange",C)};return n.onMounted(()=>{if(!u.value||!h.value)return;const C=h.value,{initSortable:S}=ea(C,{handle:".j-input-rows-drag",onEnd:y=>{const{oldIndex:E,newIndex:B}=y;if(o(E)||o(B)||E===B||E<0||B<0)return;const _=g.value.splice(E,1)[0];g.value.splice(B,0,_),a("change",{id:i.id,value:_,data:_,formData:l,tableData:g.value,type:"sort"})}});S()}),Mo({tableData:g.value,rowChange:w}),(C,S)=>{const y=n.resolveComponent("j-comp"),E=n.resolveComponent("j-icon"),B=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",Lu,[n.createElementVNode("div",{ref_key:"inputRowsRef",ref:h,class:"j-input-rows-container"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(_,T)=>(n.openBlock(),n.createElementBlock("div",{key:_.i+T,class:n.normalizeClass([e.isCompact?"j-space-compact":"j-space",{"j-space-wrap":e.isWrap}])},[e.showNum?(n.openBlock(),n.createElementBlock("div",Pu,n.toDisplayString(T+1),1)):n.createCommentVNode("",!0),e.showChar?(n.openBlock(),n.createElementBlock("div",Ru,n.toDisplayString(m[T%26]),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.columns,j=>(n.openBlock(),n.createBlock(y,n.mergeProps({key:j.id,ref_for:!0},j,{row:_}),null,16,["row"]))),128)),u.value?(n.openBlock(),n.createBlock(E,{key:2,class:"j-input-rows-drag",icon:"mdi:drag"})):n.createCommentVNode("",!0),c.value&&(p.value||g.value.length>1)&&!f.value?(n.openBlock(),n.createBlock(E,{key:3,icon:"mdi:delete-outline",class:"j-input-rows-delete",onClick:j=>v(T)},null,8,["onClick"])):n.createCommentVNode("",!0)],2))),128))],512),!f.value&&r.value?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({"text-align":d.value}),class:"j-input-rows-actions"},[r.value?(n.openBlock(),n.createBlock(B,{key:0,type:"link",style:{"margin-right":"8px"},label:s.value,icon:"mdi:add",onClick:k},null,8,["label"])):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)])}}})),ll=te(n.defineComponent({name:"JLayerForm",__name:"layer-form",props:{icon:{type:String,default:"mdi:form-outline"},type:{type:String,default:"default"},size:{type:String,default:"default"},layerLabel:{type:String,default:"设置"},layerHeight:{type:Number,default:400},layerWidth:{type:Number,default:600},formConfig:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]}},setup(e){const t=e,o=Kt(),{t:i}=Pe(),a=n.computed(()=>t.formConfig?.gutter||16),l=n.computed(()=>t.formConfig?.span||24),r=n.computed(()=>t.formConfig?.labelWidth||o.labelWidth?.value),s=n.computed(()=>t.formConfig?.labelPosition||o.labelPosition?.value||"right"),d=n.computed(()=>t.schema?.length===1&&(t.schema?.[0]?.type==="j-tabs"||t.schema?.[0]?.type==="j-layout"||t.schema?.[0]?.config?.isAutoWindow)),c=n.ref(!1),f=()=>{c.value=!0};return fa({...o,isAutoWindow:d,gutter:a,span:l,labelWidth:r}),(u,p)=>{const h=n.resolveComponent("j-button"),m=n.resolveComponent("j-form-item"),g=n.resolveComponent("el-row"),b=n.resolveComponent("el-form"),k=n.resolveComponent("j-dialog");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(h,n.mergeProps(u.$attrs,{type:e.type,size:e.size,icon:e.icon,onClick:f}),null,16,["type","size","icon"]),n.createVNode(k,{visible:c.value,"onUpdate:visible":p[1]||(p[1]=v=>c.value=v),title:n.unref(i)(e.layerLabel||"设置"),height:e.layerHeight||400,width:e.layerWidth||600,"has-btns":!1},{default:n.withCtx(()=>[n.createVNode(b,{class:n.normalizeClass(["j-block","j-layer-form"]),"label-position":s.value,"label-width":r.value,size:e.formConfig?.size,onSubmit:p[0]||(p[0]=n.withModifiers(()=>{},["prevent"]))},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(m,n.normalizeProps(n.mergeProps({key:0},e.schema[0])),null,16)):(n.openBlock(),n.createBlock(g,{key:1,gutter:a.value},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.schema,v=>(n.openBlock(),n.createBlock(m,n.mergeProps({key:v.id,ref_for:!0},v),null,16))),128))]),_:1},8,["gutter"]))]),_:1},8,["label-position","label-width","size"])]),_:1},8,["visible","title","height","width"])])}}})),rl=te(n.defineComponent({name:"JSwitch",inheritAttrs:!1,__name:"switch",props:{modelValue:{type:[Boolean,String,Number],default:!1},size:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeText:{},inactiveText:{},activeIcon:{},inactiveIcon:{},activeActionIcon:{},inactiveActionIcon:{},width:{default:40},inlinePrompt:{type:Boolean,default:!1},name:{},validateEvent:{type:Boolean,default:!0},beforeChange:{},id:{},tabindex:{},ariaLabel:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return o.modelValue},set(r){i("update:modelValue",r)}}),l=r=>{i("change",r)};return n.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value=!a.value,l(a.value)},100)}),(r,s)=>{const d=n.resolveComponent("el-switch");return n.openBlock(),n.createBlock(d,n.mergeProps(r.$attrs,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),size:e.size,width:e.width,"inline-prompt":e.inlinePrompt,"active-icon":e.activeIcon,"inactive-icon":e.inactiveIcon,"active-action-icon":e.activeActionIcon,"inactive-action-icon":e.inactiveActionIcon,"active-text":e.activeText,"inactive-text":e.inactiveText,"active-value":e.activeValue,"inactive-value":e.inactiveValue,name:e.name,"validate-event":e.validateEvent,"before-change":e.beforeChange,id:e.id,tabindex:e.tabindex,"aria-label":e.ariaLabel,loading:e.loading,disabled:e.disabled||e.readonly,onChange:l}),n.createSlots({_:2},[r.$slots["active-action"]?{name:"active-action",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"active-action")]),key:"0"}:void 0,r.$slots["inactive-action"]?{name:"inactive-action",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"inactive-action")]),key:"1"}:void 0,r.$slots.active?{name:"active",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"active")]),key:"2"}:void 0,r.$slots.inactive?{name:"inactive",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"inactive")]),key:"3"}:void 0]),1040,["modelValue","size","width","inline-prompt","active-icon","inactive-icon","active-action-icon","inactive-action-icon","active-text","inactive-text","active-value","inactive-value","name","validate-event","before-change","id","tabindex","aria-label","loading","disabled"])}}})),sl=te(n.defineComponent({name:"JTabs",__name:"tabs",props:{modelValue:{},type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},tabPosition:{default:"top"},stretch:{type:Boolean,default:!1},beforeLeave:{}},emits:["update:modelValue","tab-click","tab-change","tab-remove","tab-add","edit"],setup(e,{emit:t}){const o=t,i=c=>{o("update:modelValue",c)},a=(c,f)=>{o("tab-click",c,f)},l=c=>{o("tab-change",c)},r=c=>{o("tab-remove",c)},s=()=>{o("tab-add")},d=(c,f)=>{o("edit",c,f)};return(c,f)=>{const u=n.resolveComponent("el-tabs");return n.openBlock(),n.createBlock(u,n.mergeProps(c.$attrs,{"model-value":e.modelValue,type:e.type,closable:e.closable,addable:e.addable,editable:e.editable,"tab-position":e.tabPosition,stretch:e.stretch,"before-leave":e.beforeLeave,"onUpdate:modelValue":i,onTabClick:a,onTabChange:l,onTabRemove:r,onTabAdd:s,onEdit:d}),{default:n.withCtx(()=>[n.renderSlot(c.$slots,"default")]),_:3},16,["model-value","type","closable","addable","editable","tab-position","stretch","before-leave"])}}})),cl=te(n.defineComponent({name:"JCollapse",__name:"collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=t,i=l=>{o("update:modelValue",l)},a=l=>{o("change",l)};return(l,r)=>{const s=n.resolveComponent("el-collapse");return n.openBlock(),n.createBlock(s,n.mergeProps(l.$attrs,{"model-value":e.modelValue,accordion:e.accordion,onChange:a,"onUpdate:modelValue":i}),{default:n.withCtx(()=>[n.renderSlot(l.$slots,"default")]),_:3},16,["model-value","accordion"])}}})),Au={class:"j-editor"},dl=te(Ea(n.defineComponent({name:"JEditor",__name:"editor",props:{value:{type:String,default:""},height:{type:[String,Number],default:300},options:{type:Object,default:()=>({})},placeholder:{type:String,default:void 0},readonly:{type:Boolean,default:!1},isUploadImg:{type:Boolean,default:!0},token:{type:String,default:""},apiUrl:{type:String,default:""}},emits:["update:value","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=n.shallowRef(),s=n.computed(()=>({height:typeof o.height=="number"?`${o.height}px`:o.height,overflowY:"hidden"}));let d=!1;const c=u=>{if(!u)return"";let p=u;return o.apiUrl&&o.token&&(p=p.replace(/{learun_img_api}/g,`${o.apiUrl}/system/annexesfile/`).replace(/{learun_img_token}/g,`token=${o.token}`)),p},f=u=>{if(!u)return"";let p=u;if(o.apiUrl){const h=`${o.apiUrl}/system/annexesfile/`;p=p.split(h).join("{learun_img_api}"),o.token&&(p=p.split(`token=${o.token}`).join("{learun_img_token}"))}return p};return n.onMounted(()=>{const u={placeholder:o.placeholder||"请输入内容...",readOnly:o.readonly,MENU_CONF:{},...o.options};u.onChange=h=>{if(d)return;const m=h.getHtml(),g=f(m);i("update:value",g),i("change",{value:g})};const p=Ni.createEditor({selector:a.value,html:c(o.value),config:u,mode:"default"});r.value=p,Ni.createToolbar({editor:p,selector:l.value,mode:"default"})}),n.watch(()=>o.value,u=>{const p=r.value;if(p){const h=p.getHtml(),m=c(u);f(h)!==u&&(d=!0,p.setHtml(m),d=!1)}}),n.watch(()=>o.readonly,u=>{const p=r.value;p&&(u?p.disable():p.enable())}),n.onBeforeUnmount(()=>{const u=r.value;u?.destroy()}),(u,p)=>(n.openBlock(),n.createElementBlock("div",Au,[n.createElementVNode("div",{ref_key:"toolbarRef",ref:l,class:"j-editor-toolbar"},null,512),n.createElementVNode("div",{ref_key:"editorRef",ref:a,class:"j-editor-content",style:n.normalizeStyle(s.value)},null,4)]))}}),[["__scopeId","data-v-60cd5d0b"]])),Ou={key:0,class:"j-map-loading"},Fu=te(n.defineComponent({name:"JMap",__name:"map",props:{address:String,lng:Number,lat:Number,height:{type:String,default:"300px"},mapKey:{type:String,default:""}},emits:["update:address","update:lng","update:lat","change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(!0),r=n.ref();let s=null,d=null,c=null,f=null;const u=async()=>{l.value=!0;try{s=await ta(i.mapKey)}catch(k){console.error("Failed to load Baidu Map:",k),l.value=!1;return}if(d!=null){h(i.lng,i.lat),l.value=!1;return}if(!r.value)return;d=new s.Map(r.value,{enableMapClick:!1});const b=new s.Point(121.480248,31.236276);d.centerAndZoom(b,17),c=new s.Marker(b,{enableDragging:!0}),d.addOverlay(c),c.addEventListener("dragend",k=>{p(k.point)}),d.addControl(new s.NavigationControl({anchor:window.BMAP_ANCHOR_TOP_RIGHT,type:window.BMAP_NAVIGATION_CONTROL_SMALL})),f=new s.GeolocationControl({anchor:window.BMAP_ANCHOR_BOTTOM_LEFT}),f.addEventListener("locationSuccess",k=>{p(k.point)}),f.addEventListener("locationError",k=>{alert(k.message)}),d.addControl(f),d.addEventListener("click",k=>{p(k.point)}),d.enableScrollWheelZoom(!0),h(i.lng,i.lat),l.value=!1},p=b=>{new s.Geocoder().getLocation(b,v=>{c.setPosition(b),d.panTo(b),a("update:address",v.address),a("update:lng",b.lng),a("update:lat",b.lat),a("change",{value:{address:v.address,lng:b.lng,lat:b.lat}})})},h=(b,k)=>{if(b&&k&&s){const v=new s.Point(b,k);c&&c.setPosition(v),d&&d.panTo(v)}};let m=null;return t({setPoint:h,querySearchAsync:(b,k)=>{!d||!s||(m||(m=new s.LocalSearch(d,{onSearchComplete:v=>{const w=[];if(v){const C=v.getCurrentNumPois();for(let S=0;S<C;S++)w.push(v.getPoi(S))}k(w)}})),m.search(b))}}),n.onMounted(()=>{u()}),(b,k)=>(n.openBlock(),n.createElementBlock("div",{class:"j-map",style:n.normalizeStyle({height:e.height})},[l.value?(n.openBlock(),n.createElementBlock("div",Ou,[n.createVNode(Nt,{icon:"mdi:loading",class:"is-loading",size:30})])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"j-map-container",ref_key:"mapRef",ref:r},null,512)],4))}})),Iu=/^class[ {]/;function zu(e){return Iu.test(e.toString())}function Po(e){return Array.isArray(e)}function Ro(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zn(...e){e.length===1&&Po(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const Du=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Hu=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Wu=/\/\*([^*]*)\*\//m;function Uu(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(zu(e)?Du:Hu);if(!t)return[];const o=t[1]||t[2];return o&&o.split(",").map(i=>{const a=i.match(Wu);return(a&&a[1]||i).trim()})||[]}function ul(e,t){const o=t||{get:function(w,C){if(i.push(w),C===!1)return null;throw s(`No provider for "${w}"!`)}},i=[],a=this._providers=Object.create(o._providers||null),l=this._instances=Object.create(null),r=l.injector=this,s=function(w){const C=i.join(" -> ");return i.length=0,new Error(C?`${w} (Resolving: ${C})`:w)};function d(w,C){if(!a[w]&&w.includes(".")){const S=w.split(".");let y=d(S.shift());for(;S.length;)y=y[S.shift()];return y}if(Ro(l,w))return l[w];if(Ro(a,w)){if(i.indexOf(w)!==-1)throw i.push(w),s("Cannot resolve circular dependency!");return i.push(w),l[w]=a[w][0](a[w][1]),i.pop(),l[w]}return o.get(w,C)}function c(w,C){if(typeof C>"u"&&(C={}),typeof w!="function")if(Po(w))w=zn(w.slice());else throw s(`Cannot invoke "${w}". Expected a function!`);const y=(w.$inject||Uu(w)).map(E=>Ro(C,E)?C[E]:d(E));return{fn:w,dependencies:y}}function f(w){const{fn:C,dependencies:S}=c(w),y=Function.prototype.bind.call(C,null,...S);return new y}function u(w,C,S){const{fn:y,dependencies:E}=c(w,S);return y.apply(C,E)}function p(w){return zn(C=>w.get(C))}function h(w,C){if(C&&C.length){const S=Object.create(null),y=Object.create(null),E=[],B=[],_=[];let T,j,D,A;for(let R in a)T=a[R],C.indexOf(R)!==-1&&(T[2]==="private"?(j=E.indexOf(T[3]),j===-1?(D=T[3].createChild([],C),A=p(D),E.push(T[3]),B.push(D),_.push(A),S[R]=[A,R,"private",D]):S[R]=[_[j],R,"private",B[j]]):S[R]=[T[2],T[1]],y[R]=!0),(T[2]==="factory"||T[2]==="type")&&T[1].$scope&&C.forEach(V=>{T[1].$scope.indexOf(V)!==-1&&(S[R]=[T[2],T[1]],y[V]=!0)});C.forEach(R=>{if(!y[R])throw new Error('No provider for "'+R+'". Cannot use provider from the parent!')}),w.unshift(S)}return new ul(w,r)}const m={factory:u,type:f,value:function(w){return w}};function g(w,C){const S=w.__init__||[];return function(){S.forEach(y=>{typeof y=="string"?C.get(y):C.invoke(y)})}}function b(w){const C=w.__exports__;if(C){const S=w.__modules__,y=Object.keys(w).reduce((j,D)=>(D!=="__exports__"&&D!=="__modules__"&&D!=="__init__"&&D!=="__depends__"&&(j[D]=w[D]),j),Object.create(null)),E=(S||[]).concat(y),B=h(E),_=zn(function(j){return B.get(j)});C.forEach(function(j){a[j]=[_,j,"private",B]});const T=(w.__init__||[]).slice();return T.unshift(function(){B.init()}),w=Object.assign({},w,{__init__:T}),g(w,B)}return Object.keys(w).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const y=w[S];if(y[2]==="private"){a[S]=y;return}const E=y[0],B=y[1];a[S]=[m[E],Ju(E,B),E]}),g(w,r)}function k(w,C){return w.indexOf(C)!==-1||(w=(C.__depends__||[]).reduce(k,w),w.indexOf(C)!==-1)?w:w.concat(C)}function v(w){const C=w.reduce(k,[]).map(b);let S=!1;return function(){S||(S=!0,C.forEach(y=>y()))}}this.get=d,this.invoke=u,this.instantiate=f,this.createChild=h,this.init=v(e)}function Ju(e,t){return e!=="value"&&Po(t)&&(t=zn(t.slice())),t}function Mt(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var Yu=1e3;function at(e,t){var o=this;t=t||Yu,e.on(["render.shape","render.connection"],t,function(i,a){var l=i.type,r=a.element,s=a.gfx,d=a.attrs;if(o.canRender(r))return l==="render.shape"?o.drawShape(s,r,d):o.drawConnection(s,r,d)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,a){if(o.canRender(a))return i.type==="render.getShapePath"?o.getShapePath(a):o.getConnectionPath(a)})}at.prototype.canRender=function(e){},at.prototype.drawShape=function(e,t){},at.prototype.drawConnection=function(e,t){},at.prototype.getShapePath=function(e){},at.prototype.getConnectionPath=function(e){};const Dn=Object.prototype.toString,qu=Object.prototype.hasOwnProperty;function Ao(e){return e===void 0}function Zt(e){return e!==void 0}function Oo(e){return e==null}function Ne(e){return Dn.call(e)==="[object Array]"}function ht(e){return Dn.call(e)==="[object Object]"}function We(e){return Dn.call(e)==="[object Number]"}function mt(e){const t=Dn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Gu(e){if(!Ne(e))throw new Error("must supply array")}function Fo(e,t){return!Oo(e)&&qu.call(e,t)}function gt(e,t){const o=zo(t);let i;return Z(e,function(a,l){if(o(a,l))return i=a,!1}),i}function Qt(e,t){const o=zo(t);let i=[];return Z(e,function(a,l){o(a,l)&&i.push(a)}),i}function Z(e,t){let o,i;if(Ao(e))return;const a=Ne(e)?tf:ef;for(let l in e)if(Fo(e,l)&&(o=e[l],i=t(o,a(l)),i===!1))return o}function Ku(e,t){if(Ao(e))return[];Gu(e);const o=zo(t);return e.filter(function(i,a){return!o(i,a)})}function en(e,t,o){return Z(e,function(i,a){o=t(o,i,a)}),o}function fl(e,t){return!!en(e,function(o,i,a){return o&&t(i,a)},!0)}function Xu(e,t){return!!gt(e,t)}function yt(e,t){let o=[];return Z(e,function(i,a){o.push(t(i,a))}),o}function Zu(e){return yt(e,t=>t)}function pl(e,t,o={}){return t=Io(t),Z(e,function(i){let a=t(i)||"_",l=o[a];l||(l=o[a]=[]),l.push(i)}),o}function Qu(e,...t){e=Io(e);let o={};return Z(t,a=>pl(a,e,o)),yt(o,function(a,l){return a[0]})}function hl(e,t){t=Io(t);let o=[];return Z(e,function(i,a){let l=t(i,a),r={d:l,v:i};for(var s=0;s<o.length;s++){let{d}=o[s];if(l<d){o.splice(s,0,r);return}}o.push(r)}),yt(o,i=>i.v)}function Io(e){return mt(e)?e:t=>t[e]}function zo(e){return mt(e)?e:t=>t===e}function ef(e){return e}function tf(e){return Number(e)}function nf(e,t){let o,i,a,l;function r(u){let p=Date.now(),h=u?0:l+t-p;if(h>0)return s(h);e.apply(a,i),d()}function s(u){o=setTimeout(r,u)}function d(){o&&clearTimeout(o),o=l=i=a=void 0}function c(){o&&r(!0),d()}function f(...u){l=Date.now(),i=u,a=this,o||s(t)}return f.flush=c,f.cancel=d,f}function Do(e,t){return e.bind(t)}function ie(e,...t){return Object.assign(e,...t)}function Ho(e,t){let o={},i=Object(e);return Z(t,function(a){a in i&&(o[a]=e[a])}),o}function of(e,t){let o={},i=Object(e);return Z(i,function(a,l){t.indexOf(l)===-1&&(o[l]=a)}),o}function af(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function lf(e,t){return t.appendChild(af(e,t))}function Ee(e,t){return lf(t,e),e}var Wo=2,ml={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Wo,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Wo,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function rf(e,t){return ml[t]?e.style[t]:e.getAttributeNS(null,t)}function gl(e,t,o){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=ml[i];a?(a===Wo&&typeof o=="number"&&(o=String(o)+"px"),e.style[i]=o):e.setAttributeNS(null,t,o)}function sf(e,t){var o=Object.keys(t),i,a;for(i=0,a;a=o[i];i++)gl(e,a,t[a])}function ce(e,t,o){if(typeof t=="string")if(o!==void 0)gl(e,t,o);else return rf(e,t);else sf(e,t);return e}const cf=Object.prototype.toString;function Ge(e){return new bt(e)}function bt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}bt.prototype.add=function(e){return this.list.add(e),this},bt.prototype.remove=function(e){return cf.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},bt.prototype.removeMatching=function(e){const t=this.array();for(let o=0;o<t.length;o++)e.test(t[o])&&this.remove(t[o]);return this},bt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},bt.prototype.array=function(){return Array.from(this.list)},bt.prototype.has=bt.prototype.contains=function(e){return this.list.contains(e)};function yl(e){return e.cloneNode(!0)}var Uo={svg:"http://www.w3.org/2000/svg"},bl='<svg xmlns="'+Uo.svg+'"';function df(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Uo.svg)===-1&&(e=bl+e.substring(4)):(e=bl+">"+e+"</svg>",t=!0);var o=uf(e);if(!t)return o;for(var i=document.createDocumentFragment(),a=o.firstChild;a.firstChild;)i.appendChild(a.firstChild);return i}function uf(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function Se(e,t){var o;return e=e.trim(),e.charAt(0)==="<"?(o=df(e).firstChild,o=document.importNode(o,!0)):o=document.createElementNS(Uo.svg,e),t&&ce(o,t),o}var Jo=null;function wl(){return Jo===null&&(Jo=Se("svg")),Jo}function vl(e,t){var o,i,a=Object.keys(t);for(o=0;i=a[o];o++)e[i]=t[i];return e}function ff(e,t,o,i,a,l){var r=wl().createSVGMatrix();switch(arguments.length){case 0:return r;case 1:return vl(r,e);case 6:return vl(r,{a:e,b:t,c:o,d:i,e:a,f:l})}}function pf(e){return wl().createSVGTransform()}function Lt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function hf(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function mf(e,t){var o,i;for(e.clear(),o=0;i=t[o];o++)e.appendItem(hf(e,i))}function Yo(e,t){var o=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),mf(o,t)),o.consolidate()}function Pt(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function gf(e){return["M",e.x,e.y]}function qo(e){return["L",e.x,e.y]}function yf(e,t,o){return["C",e.x,e.y,t.x,t.y,o.x,o.y]}function bf(e,t){const o=e.length,i=[gf(e[0])];for(let a=1;a<o;a++){const l=e[a-1],r=e[a],s=e[a+1];if(!s||!t){i.push(qo(r));continue}const d=Math.min(t,Go(r.x-l.x,r.y-l.y),Go(s.x-r.x,s.y-r.y));if(!d){i.push(qo(r));continue}const c=Hn(r,l,d),f=Hn(r,l,d*.5),u=Hn(r,s,d),p=Hn(r,s,d*.5);i.push(qo(c)),i.push(yf(f,p,u))}return i}function Hn(e,t,o){const i=t.x-e.x,a=t.y-e.y,l=Go(i,a),r=o/l;return{x:e.x+i*r,y:e.y+a*r}}function Go(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Ko(e,t,o){We(t)&&(o=t,t=null),t||(t={});const i=Se("path",t);return We(o)&&(i.dataset.cornerRadius=String(o)),Cl(i,e)}function Cl(e,t){const o=parseInt(e.dataset.cornerRadius,10)||0;return ce(e,{d:Pt(bf(t,o))}),e}function wf(e){return Qt(e,function(t){return!gt(e,function(o){return o!==t&&kl(t,o)})})}function kl(e,t){if(t){if(e===t)return t;if(e.parent)return kl(e.parent,t)}}function xl(e,t,o){o=o||0,Ne(e)||(e=[e]),Z(e,function(i,a){var l=t(i,a,o);Ne(l)&&l.length&&xl(l,t,o+1)})}function vf(e,t,o){Ao(t)&&(t=!0),ht(t)&&(o=t,t=!0),o=o||{};var i=hn(o.allShapes),a=hn(o.allConnections),l=hn(o.enclosedElements),r=hn(o.enclosedConnections),s=hn(o.topLevel,t&&pl(e,function(f){return f.id}));function d(f){s[f.source.id]&&s[f.target.id]&&(s[f.id]=[f]),i[f.source.id]&&i[f.target.id]&&(r[f.id]=l[f.id]=f),a[f.id]=f}function c(f){if(l[f.id]=f,f.waypoints)r[f.id]=a[f.id]=f;else return i[f.id]=f,Z(f.incoming,d),Z(f.outgoing,d),f.children}return xl(e,c),{allShapes:i,allConnections:a,topLevel:s,enclosedConnections:r,enclosedElements:l}}function Wn(e,t){t=!!t,Ne(e)||(e=[e]);var o,i,a,l;return Z(e,function(r){var s=r;r.waypoints&&!t&&(s=Wn(r.waypoints,!0));var d=s.x,c=s.y,f=s.height||0,u=s.width||0;(d<o||o===void 0)&&(o=d),(c<i||i===void 0)&&(i=c),(d+u>a||a===void 0)&&(a=d+u),(c+f>l||l===void 0)&&(l=c+f)}),{x:o,y:i,height:l-i,width:a-o}}function Cf(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Sl(e){return!!(e&&e.isFrame)}function hn(e,t){return ie({},e||{},t||{})}var kf=1;function wt(e,t){at.call(this,e,kf),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Mt(wt,at),wt.prototype.canRender=function(){return!0},wt.prototype.drawShape=function(t,o,i){var a=Se("rect");return ce(a,{x:0,y:0,width:o.width||0,height:o.height||0}),Sl(o)?ce(a,ie({},this.FRAME_STYLE,i||{})):ce(a,ie({},this.SHAPE_STYLE,i||{})),Ee(t,a),a},wt.prototype.drawConnection=function(t,o,i){var a=Ko(o.waypoints,ie({},this.CONNECTION_STYLE,i||{}));return Ee(t,a),a},wt.prototype.getShapePath=function(t){var o=t.x,i=t.y,a=t.width,l=t.height,r=[["M",o,i],["l",a,0],["l",0,l],["l",-a,0],["z"]];return Pt(r)},wt.prototype.getConnectionPath=function(t){var o=t.waypoints,i,a,l=[];for(i=0;a=o[i];i++)a=a.original||a,l.push([i===0?"M":"L",a.x,a.y]);return Pt(l)},wt.$inject=["eventBus","styles"];function xf(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(o,i,a){var l=this.style(i,a);return ie(l,{class:o})},this.style=function(o,i){!Ne(o)&&!i&&(i=o,o=[]);var a=en(o,function(l,r){return ie(l,e[r]||{})},{});return i?ie(a,i):a},this.computeStyle=function(o,i,a){return Ne(i)||(a=i,i=[]),t.style(i||[],ie({},a,o||{}))}}const Sf={__init__:["defaultRenderer"],defaultRenderer:["type",wt],styles:["type",xf]};function Bf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ef(e,t){return t.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(i){if(i!=="default"&&!(i in e)){var a=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:function(){return o[i]}})}})}),Object.freeze(e)}function Bl(e,...t){const o=e.style;return Z(t,function(i){i&&Z(i,function(a,l){o[l]=a})}),e}function _f(e,t,o){return arguments.length==2?e.getAttribute(t):(e.setAttribute(t,o),e)}const jf=Object.prototype.toString;function Vf(e){return new vt(e)}function vt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}vt.prototype.add=function(e){return this.list.add(e),this},vt.prototype.remove=function(e){return jf.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},vt.prototype.removeMatching=function(e){const t=this.array();for(let o=0;o<t.length;o++)e.test(t[o])&&this.remove(t[o]);return this},vt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},vt.prototype.array=function(){return Array.from(this.list)},vt.prototype.has=vt.prototype.contains=function(e){return this.list.contains(e)};function Tf(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Xo(e,t,o){var i=o?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}function Nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Un={},El;function $f(){if(El)return Un;El=1;var e,t,o;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",o=e!=="addEventListener"?"on":""}return Un.bind=function(a,l,r,s){return e||i(),a[e](o+l,r,s||!1),r},Un.unbind=function(a,l,r,s){return t||i(),a[t](o+l,r,s||!1),r},Un}var _l=$f(),Mf=Nf(_l),ke=Ef({__proto__:null,default:Mf},[_l]),jl=["focus","blur"];function Lf(e,t,o,i,a){return jl.indexOf(o)!==-1&&(a=!0),ke.bind(e,o,function(l){var r=l.target||l.srcElement;l.delegateTarget=Xo(r,t,!0),l.delegateTarget&&i.call(e,l)},a)}function Pf(e,t,o,i){return jl.indexOf(t)!==-1&&(i=!0),ke.unbind(e,t,o,i)}var Vl={bind:Lf,unbind:Pf};function mn(e,t){return t=t||document,t.querySelector(e)}function Rf(e,t){return t=t||document,t.querySelectorAll(e)}function gn(e,t){if(!e||!t)return-1;var o=e.indexOf(t);return o!==-1&&e.splice(o,1),o}function lt(e,t,o){if(!(!e||!t)){typeof o!="number"&&(o=-1);var i=e.indexOf(t);if(i!==-1){if(i===o)return;if(o!==-1)e.splice(i,1);else return}o!==-1?e.splice(o,0,t):e.push(t)}}function Zo(e,t){return!e||!t?-1:e.indexOf(t)}function Qo(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Af(e,t,o,i){if(!e||!t||!o)return!1;var a=(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x),l=Qo(e,t);return Math.abs(a/l)<=i}var Of=2;function Tl(e,t){var o=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[a,l]of Object.entries(i))if(Ff(a,o))return l;return!1}function Ff(e,t){const o=t[0];return fl(t,function(i){return Math.abs(o[e]-i[e])<=Of})}function Nl(e,t,o){return o=o||0,e.x>t.x-o&&e.y>t.y-o&&e.x<t.x+t.width+o&&e.y<t.y+t.height+o}var If=/,?([a-z]),?/gi,$l=parseFloat,je=Math,Ct=je.PI,Qe=je.min,et=je.max,Ml=je.pow,kt=je.abs,zf=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Df=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,Ll=Array.isArray||function(e){return e instanceof Array};function Hf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wf(e,t){for(var o=0,i=e.length;o<i;o++)if(e[o]===t)return e.push(e.splice(o,1)[0])}function Uf(e){function t(){var o=Array.prototype.slice.call(arguments,0),i=o.join("␀"),a=t.cache=t.cache||{},l=t.count=t.count||[];return Hf(a,i)?(Wf(l,i),a[i]):(l.length>=1e3&&delete a[l.shift()],l.push(i),a[i]=e(...arguments),a[i])}return t}function Jf(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return String(e).replace(zf,function(i,a,l){var r=[],s=a.toLowerCase();for(l.replace(Df,function(d,c){c&&r.push(+c)}),s=="m"&&r.length>2&&(o.push([a,...r.splice(0,2)]),s="l",a=a=="m"?"l":"L");r.length>=t[s]&&(o.push([a,...r.splice(0,t[s])]),!!t[s]););}),o.toString=ti,o}function Yf(e){for(var t=0,o=e.length;t<o;t++){var i=e[t][0];if(typeof i=="string"&&i!==i.toUpperCase())return!1}return!0}function qf(e){for(var t=0,o=e.length;t<o;t++){var i=e[t][0];if(i!=="M"&&i!=="C")return!1}return!0}function ei(e,t,o,i){return arguments.length===1&&(t=e.y,o=e.width,i=e.height,e=e.x),{x:e,y:t,width:o,height:i,x2:e+o,y2:t+i}}function ti(){return this.join(",").replace(If,"$1")}function Gf(e){for(var t=new Array(e.length),o=0,i=e.length;o<i;o++)for(var a=e[o],l=t[o]=new Array(a.length),r=0,s=a.length;r<s;r++)l[r]=a[r];return t.toString=ti,t}function Pl(e,t,o,i,a,l,r,s,d){var c=1-d,f=Ml(c,3),u=Ml(c,2),p=d*d,h=p*d,m=f*e+u*3*d*o+c*3*d*d*a+h*r,g=f*t+u*3*d*i+c*3*d*d*l+h*s;return{x:Jn(m),y:Jn(g)}}function Rl(e){var t=np(...e);return ei(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function xt(e,t,o){return t>=e.x&&t<=e.x+e.width&&o>=e.y&&o<=e.y+e.height}function Kf(e,t){return e=ei(e),t=ei(t),xt(t,e.x,e.y)||xt(t,e.x2,e.y)||xt(t,e.x,e.y2)||xt(t,e.x2,e.y2)||xt(e,t.x,t.y)||xt(e,t.x2,t.y)||xt(e,t.x,t.y2)||xt(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Al(e,t,o,i,a){var l=-3*t+9*o-9*i+3*a,r=e*l+6*t-12*o+6*i;return e*r-3*t+3*o}function Ol(e,t,o,i,a,l,r,s,d){d==null&&(d=1),d=d>1?1:d<0?0:d;for(var c=d/2,f=12,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;m<f;m++){var g=c*u[m]+c,b=Al(g,e,o,a,r),k=Al(g,t,i,l,s),v=b*b+k*k;h+=p[m]*je.sqrt(v)}return c*h}function Xf(e,t,o,i,a,l,r,s){if(!(et(e,o)<Qe(a,r)||Qe(e,o)>et(a,r)||et(t,i)<Qe(l,s)||Qe(t,i)>et(l,s))){var d=(e*i-t*o)*(a-r)-(e-o)*(a*s-l*r),c=(e*i-t*o)*(l-s)-(t-i)*(a*s-l*r),f=(e-o)*(l-s)-(t-i)*(a-r);if(f){var u=Jn(d/f),p=Jn(c/f),h=+u.toFixed(2),m=+p.toFixed(2);if(!(h<+Qe(e,o).toFixed(2)||h>+et(e,o).toFixed(2)||h<+Qe(a,r).toFixed(2)||h>+et(a,r).toFixed(2)||m<+Qe(t,i).toFixed(2)||m>+et(t,i).toFixed(2)||m<+Qe(l,s).toFixed(2)||m>+et(l,s).toFixed(2)))return{x:u,y:p}}}}function Jn(e){return Math.round(e*1e11)/1e11}function Zf(e,t,o){var i=Rl(e),a=Rl(t);if(!Kf(i,a))return[];var l=Ol(...e),r=Ol(...t),s=Fl(e)?1:~~(l/5)||1,d=Fl(t)?1:~~(r/5)||1,c=new Array(s+1),f=new Array(d+1),u={},p=[],h,m;for(h=0;h<s+1;h++){var g=Pl(...e,h/s);c[h]={x:g.x,y:g.y,t:h/s}}for(h=0;h<d+1;h++)g=Pl(...t,h/d),f[h]={x:g.x,y:g.y,t:h/d};for(h=0;h<s;h++)for(m=0;m<d;m++){var b=c[h],k=c[h+1],v=f[m],w=f[m+1],C=kt(k.x-b.x)<.01?"y":"x",S=kt(w.x-v.x)<.01?"y":"x",y=Xf(b.x,b.y,k.x,k.y,v.x,v.y,w.x,w.y),E;if(y){if(E=y.x.toFixed(9)+"#"+y.y.toFixed(9),u[E])continue;u[E]=!0;var B=b.t+kt((y[C]-b[C])/(k[C]-b[C]))*(k.t-b.t),_=v.t+kt((y[S]-v[S])/(w[S]-v[S]))*(w.t-v.t);B>=0&&B<=1&&_>=0&&_<=1&&p.push({x:y.x,y:y.y,t1:B,t2:_})}}return p}function Qf(e,t,o){e=Dl(e),t=Dl(t);for(var i,a,l,r,s,d,c,f,u,p,h=[],m=0,g=e.length;m<g;m++){var b=e[m];if(b[0]=="M")i=s=b[1],a=d=b[2];else{b[0]=="C"?(u=[i,a,...b.slice(1)],i=u[6],a=u[7]):(u=[i,a,i,a,s,d,s,d],i=s,a=d);for(var k=0,v=t.length;k<v;k++){var w=t[k];if(w[0]=="M")l=c=w[1],r=f=w[2];else{w[0]=="C"?(p=[l,r,...w.slice(1)],l=p[6],r=p[7]):(p=[l,r,l,r,c,f,c,f],l=c,r=f);var C=Zf(u,p);{for(var S=0,y=C.length;S<y;S++)C[S].segment1=m,C[S].segment2=k,C[S].bez1=u,C[S].bez2=p;h=h.concat(C)}}}}}return h}function ep(e){return Ll(e)&&Ll(e[0])}function tp(e){if(Yf(e))return e;var t=new Array(e.length),o=0,i=0,a=0,l=0,r=0,s;e[0][0]=="M"&&(o=+e[0][1],i=+e[0][2],a=o,l=i,r++,t[0]=["M",o,i]);for(var d,c,f=r,u=e.length;f<u;f++){if(c=e[f],s=c[0],t[f]=d=new Array(c.length),s!=s.toUpperCase())switch(d[0]=s.toUpperCase(),d[0]){case"A":d[1]=c[1],d[2]=c[2],d[3]=c[3],d[4]=c[4],d[5]=c[5],d[6]=+c[6]+o,d[7]=+c[7]+i;break;case"V":d[1]=+c[1]+i;break;case"H":d[1]=+c[1]+o;break;case"M":a=+c[1]+o,l=+c[2]+i;default:for(var p=1,h=c.length;p<h;p++)d[p]=+c[p]+(p%2?o:i)}else for(var m=0,g=c.length;m<g;m++)d[m]=c[m];switch(s=s.toUpperCase(),d[0]){case"Z":o=+a,i=+l;break;case"H":o=d[1];break;case"V":i=d[1];break;case"M":a=d[d.length-2],l=d[d.length-1];default:o=d[d.length-2],i=d[d.length-1]}}return t.toString=ti,t}function Fl(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Yn(e,t,o,i){return[e,t,o,i,o,i]}function Il(e,t,o,i,a,l){var r=.3333333333333333,s=2/3;return[r*e+s*o,r*t+s*i,r*a+s*o,r*l+s*i,a,l]}function zl(e,t,o,i,a,l,r,s,d,c){var f=Ct*120/180,u=Ct/180*(+a||0),p=[],h,m=Uf(function(se,xe,Ve){var H=se*je.cos(Ve)-xe*je.sin(Ve),X=se*je.sin(Ve)+xe*je.cos(Ve);return{x:H,y:X}});if(c)E=c[0],B=c[1],S=c[2],y=c[3];else{h=m(e,t,-u),e=h.x,t=h.y,h=m(s,d,-u),s=h.x,d=h.y;var g=(e-s)/2,b=(t-d)/2,k=g*g/(o*o)+b*b/(i*i);k>1&&(k=je.sqrt(k),o=k*o,i=k*i);var v=o*o,w=i*i,C=(l==r?-1:1)*je.sqrt(kt((v*w-v*b*b-w*g*g)/(v*b*b+w*g*g))),S=C*o*b/i+(e+s)/2,y=C*-i*g/o+(t+d)/2,E=je.asin(((t-y)/i).toFixed(9)),B=je.asin(((d-y)/i).toFixed(9));E=e<S?Ct-E:E,B=s<S?Ct-B:B,E<0&&(E=Ct*2+E),B<0&&(B=Ct*2+B),r&&E>B&&(E=E-Ct*2),!r&&B>E&&(B=B-Ct*2)}var _=B-E;if(kt(_)>f){var T=B,j=s,D=d;B=E+f*(r&&B>E?1:-1),s=S+o*je.cos(B),d=y+i*je.sin(B),p=zl(s,d,o,i,a,0,r,j,D,[B,T,S,y])}_=B-E;var A=je.cos(E),R=je.sin(E),V=je.cos(B),x=je.sin(B),L=je.tan(_/4),P=4/3*o*L,G=4/3*i*L,K=[e,t],ne=[e+P*R,t-G*A],pe=[s+P*x,d-G*V],fe=[s,d];if(ne[0]=2*K[0]-ne[0],ne[1]=2*K[1]-ne[1],c)return[ne,pe,fe].concat(p);p=[ne,pe,fe].concat(p).join().split(",");for(var Y=[],he=0,ae=p.length;he<ae;he++)Y[he]=he%2?m(p[he-1],p[he],u).y:m(p[he],p[he+1],u).x;return Y}function np(e,t,o,i,a,l,r,s){for(var d=[],c=[[],[]],f,u,p,h,m,g,b,k,v=0;v<2;++v){if(v==0?(u=6*e-12*o+6*a,f=-3*e+9*o-9*a+3*r,p=3*o-3*e):(u=6*t-12*i+6*l,f=-3*t+9*i-9*l+3*s,p=3*i-3*t),kt(f)<1e-12){if(kt(u)<1e-12)continue;h=-p/u,0<h&&h<1&&d.push(h);continue}b=u*u-4*p*f,k=je.sqrt(b),!(b<0)&&(m=(-u+k)/(2*f),0<m&&m<1&&d.push(m),g=(-u-k)/(2*f),0<g&&g<1&&d.push(g))}for(var w=d.length,C=w,S;w--;)h=d[w],S=1-h,c[0][w]=S*S*S*e+3*S*S*h*o+3*S*h*h*a+h*h*h*r,c[1][w]=S*S*S*t+3*S*S*h*i+3*S*h*h*l+h*h*h*s;return c[0][C]=e,c[1][C]=t,c[0][C+1]=r,c[1][C+1]=s,c[0].length=c[1].length=C+2,{x0:Qe(...c[0]),y0:Qe(...c[1]),x1:et(...c[0]),y1:et(...c[1])}}function Dl(e){if(ep(e)||(e=Jf(e)),qf(e))return e;for(var t=Gf(tp(e)),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(p,h,m){var g,b;if(!p)return["C",h.x,h.y,h.x,h.y,h.x,h.y];switch(!(p[0]in{T:1,Q:1})&&(h.qx=h.qy=null),p[0]){case"M":h.X=p[1],h.Y=p[2];break;case"A":p=["C",...zl(h.x,h.y,...p.slice(1))];break;case"S":m=="C"||m=="S"?(g=h.x*2-h.bx,b=h.y*2-h.by):(g=h.x,b=h.y),p=["C",g,b,...p.slice(1)];break;case"T":m=="Q"||m=="T"?(h.qx=h.x*2-h.qx,h.qy=h.y*2-h.qy):(h.qx=h.x,h.qy=h.y),p=["C",...Il(h.x,h.y,h.qx,h.qy,p[1],p[2])];break;case"Q":h.qx=p[1],h.qy=p[2],p=["C",...Il(h.x,h.y,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Yn(h.x,h.y,p[1],p[2])];break;case"H":p=["C",...Yn(h.x,h.y,p[1],h.y)];break;case"V":p=["C",...Yn(h.x,h.y,h.x,p[1])];break;case"Z":p=["C",...Yn(h.x,h.y,h.X,h.Y)];break}return p},a=function(p,h){if(p[h].length>7){p[h].shift();for(var m=p[h];m.length;)l[h]="A",p.splice(h++,0,["C",...m.splice(0,6)]);p.splice(h,1),c=t.length}},l=[],r="",s="",d=0,c=t.length;d<c;d++){t[d]&&(r=t[d][0]),r!="C"&&(l[d]=r,d&&(s=l[d-1])),t[d]=i(t[d],o,s),l[d]!="A"&&r=="C"&&(l[d]="C"),a(t,d);var f=t[d],u=f.length;o.x=f[u-2],o.y=f[u-1],o.bx=$l(f[u-4])||o.x,o.by=$l(f[u-3])||o.y}return t}function rt(e){return ht(e)&&Fo(e,"waypoints")}function Hl(e){return ht(e)&&Fo(e,"labelTarget")}function yn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function qn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function op(e){return yn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function ip(e){for(var t=e.waypoints,o=t.reduce(function(c,f,u){var p=t[u-1];if(p){var h=c[c.length-1],m=h&&h.endLength||0,g=rp(p,f);c.push({start:p,end:f,startLength:m,endLength:m+g,length:g})}return c},[]),i=o.reduce(function(c,f){return c+f.length},0),a=i/2,l=0,r=o[l];r.endLength<a;)r=o[++l];var s=(a-r.startLength)/r.length,d={x:r.start.x+(r.end.x-r.start.x)*s,y:r.start.y+(r.end.y-r.start.y)*s};return d}function tt(e){return rt(e)?ip(e):op(e)}function bn(e,t,o){o=o||0,ht(o)||(o={x:o,y:o});var i=qn(e),a=qn(t),l=i.bottom+o.y<=a.top,r=i.left-o.x>=a.right,s=i.top-o.y>=a.bottom,d=i.right+o.x<=a.left,c=l?"top":s?"bottom":null,f=d?"left":r?"right":null;return f&&c?c+"-"+f:f||c||"intersect"}function ap(e,t,o){var i=lp(e,t);return i.length===1||i.length===2&&Qo(i[0],i[1])<1?yn(i[0]):i.length>1?(i=hl(i,function(a){var l=Math.floor(a.t2*100)||1;return l=100-l,l=(l<10?"0":"")+l,a.segment2+"#"+l}),yn(i[o?0:i.length-1])):null}function lp(e,t){return Qf(e,t)}function rp(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gn(e,t){return Math.round(e*t)/t}function Wl(e){return We(e)?e+"px":e}function sp(e){for(;e.parent;)e=e.parent;return e}function cp(e){e=ie({},{width:"100%",height:"100%"},e);const t=e.container||document.body,o=document.createElement("div");return o.setAttribute("class","djs-container djs-parent"),Bl(o,{position:"relative",overflow:"hidden",width:Wl(e.width),height:Wl(e.height)}),t.appendChild(o),o}function Ul(e,t,o){const i=Se("g");Ge(i).add(t);const a=o!==void 0?o:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[a]||null),i}const dp="base",Jl=0,up=1,fp={shape:["x","y","width","height"],connection:["waypoints"]};function ee(e,t,o,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=o,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}ee.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ee.prototype._init=function(e){const t=this._eventBus,o=this._container=cp(e),i=this._svg=Se("svg");ce(i,{width:"100%",height:"100%"}),_f(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,l=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),Ee(o,i);const a=this._viewport=Ul(i,"viewport");e.deferUpdate&&(this._viewboxChanged=nf(Do(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:a})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ee.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ee.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},ee.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const o=Cf(t);o==="root"?this.removeRootElement(t):this._removeElement(t,o)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ee.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},ee.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},ee.prototype.isFocused=function(){return this._focused},ee.prototype.getDefaultLayer=function(){return this.getLayer(dp,Jl)},ee.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let o=this._layers[e];if(o||(o=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&o.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return o.group},ee.prototype._getChildIndex=function(e){return en(this._layers,function(t,o){return o.visible&&e>=o.index&&t++,t},0)},ee.prototype._createLayer=function(e,t){typeof t>"u"&&(t=up);const o=this._getChildIndex(t);return{group:Ul(this._viewport,"layer-"+e,o),index:t,visible:!0}},ee.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const o=this._viewport,i=t.group,a=t.index;if(t.visible)return i;const l=this._getChildIndex(a);return o.insertBefore(i,o.childNodes[l]||null),t.visible=!0,i},ee.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const o=t.group;return t.visible&&(Lt(o),t.visible=!1),o},ee.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Lt(t.group))},ee.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ee.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(sp(e))||{}).rootElement:void 0},ee.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ee.prototype._findPlaneForRoot=function(e){return gt(this._planes,function(t){return t.rootElement===e})},ee.prototype.getContainer=function(){return this._container},ee.prototype._updateMarker=function(e,t,o){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(Z([i.gfx,i.secondaryGfx],function(a){a&&(o?(e.markers.add(t),Ge(a).add(t)):(e.markers.delete(t),Ge(a).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!o}))},ee.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ee.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ee.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},ee.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ee.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ee.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const o=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(o,Jl);return this.hideLayer(o),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ee.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(o){return o.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},ee.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ee.prototype._removeRoot=function(e){const t=this._elementRegistry,o=this._eventBus;o.fire("root.remove",{element:e}),o.fire("root.removed",{element:e}),t.remove(e)},ee.prototype._addRoot=function(e,t){const o=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),o.add(e,t),i.fire("root.added",{element:e,gfx:t})},ee.prototype._setRoot=function(e,t){const o=this._rootElement;o&&(this._elementRegistry.updateGraphics(o,null,!0),this.hideLayer(o.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ee.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const o=fp[e];if(!fl(o,function(a){return typeof t[a]<"u"}))throw new Error("must supply { "+o.join(", ")+" } with "+e)},ee.prototype._setParent=function(e,t,o){lt(t.children,e,o),e.parent=t},ee.prototype._addElement=function(e,t,o,i){o=o||this.getRootElement();const a=this._eventBus,l=this._graphicsFactory;this._ensureValid(e,t),a.fire(e+".add",{element:t,parent:o}),this._setParent(t,o,i);const r=l.create(e,t,i);return this._elementRegistry.add(t,r),l.update(e,t,r),a.fire(e+".added",{element:t,gfx:r}),t},ee.prototype.addShape=function(e,t,o){return this._addElement("shape",e,t,o)},ee.prototype.addConnection=function(e,t,o){return this._addElement("connection",e,t,o)},ee.prototype._removeElement=function(e,t){const o=this._elementRegistry,i=this._graphicsFactory,a=this._eventBus;if(e=o.get(e.id||e),!!e)return a.fire(t+".remove",{element:e}),i.remove(e),gn(e.parent&&e.parent.children,e),e.parent=null,a.fire(t+".removed",{element:e}),o.remove(e),e},ee.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ee.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ee.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ee.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ee.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ee.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,o=this.getSize();let i,a,l,r,s,d,c;if(e)this._changeViewbox(function(){s=Math.min(o.width/e.width,o.height/e.height);const f=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Yo(t,f)});else return l=this._rootElement?this.getActiveLayer():null,i=l&&l.getBBox()||{},r=Yo(t),a=r?r.matrix:ff(),s=Gn(a.a,1e3),d=Gn(-a.e||0,1e3),c=Gn(-a.f||0,1e3),e=this._cachedViewbox={x:d?d/s:0,y:c?c/s:0,width:o.width/s,height:o.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:o},e;return e},ee.prototype.scroll=function(e){const t=this._viewport;let o=t.getCTM();return e&&this._changeViewbox(function(){e=ie({dx:0,dy:0},e||{}),o=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(o),Yl(t,o)}),{x:o.e,y:o.f}},ee.prototype.scrollToElement=function(e,t){let o=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),typeof t=="number"&&(o=t),t={top:t.top||o,right:t.right||o,bottom:t.bottom||o,left:t.left||o};const a=Wn(e),l=qn(a),r=this.viewbox(),s=this.zoom();let d,c;r.y+=t.top/s,r.x+=t.left/s,r.width-=(t.right+t.left)/s,r.height-=(t.bottom+t.top)/s;const f=qn(r);if(!(a.width<r.width&&a.height<r.height))d=a.x-r.x,c=a.y-r.y;else{const p=Math.max(0,l.right-f.right),h=Math.min(0,l.left-f.left),m=Math.max(0,l.bottom-f.bottom),g=Math.min(0,l.top-f.top);d=p||h,c=m||g}this.scroll({dx:-d*s,dy:-c*s})},ee.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let o,i;return this._changeViewbox(function(){typeof t!="object"&&(o=this.viewbox().outer,t={x:o.width/2,y:o.height/2}),i=this._setZoom(e,t)}),Gn(i.a,1e3)};function Yl(e,t){const o="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",o)}ee.prototype._fitViewport=function(e){const t=this.viewbox(),o=t.outer,i=t.inner;let a,l;return i.x>=0&&i.y>=0&&i.x+i.width<=o.width&&i.y+i.height<=o.height&&!e?l={x:0,y:0,width:Math.max(i.width+i.x,o.width),height:Math.max(i.height+i.y,o.height)}:(a=Math.min(1,o.width/i.width,o.height/i.height),l={x:i.x+(e?i.width/2-o.width/a/2:0),y:i.y+(e?i.height/2-o.height/a/2:0),width:o.width/a,height:o.height/a}),this.viewbox(l),this.viewbox(!1).scale},ee.prototype._setZoom=function(e,t){const o=this._svg,i=this._viewport,a=o.createSVGMatrix(),l=o.createSVGPoint();let r,s,d,c,f;d=i.getCTM();const u=d.a;return t?(r=ie(l,t),s=r.matrixTransform(d.inverse()),c=a.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),f=d.multiply(c)):f=a.scale(e),Yl(this._viewport,f),f},ee.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ee.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let o;e.waypoints?o=this.getGraphics(e).getBBox():o=e;const i=o.x*t.scale-t.x*t.scale,a=o.y*t.scale-t.y*t.scale,l=o.width*t.scale,r=o.height*t.scale;return{x:i,y:a,width:l,height:r}},ee.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var tn="data-element-id";function Ue(e){this._elements={},this._eventBus=e}Ue.$inject=["eventBus"],Ue.prototype.add=function(e,t,o){var i=e.id;this._validateId(i),ce(t,tn,i),o&&ce(o,tn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:o}},Ue.prototype.remove=function(e){var t=this._elements,o=e.id||e,i=o&&t[o];i&&(ce(i.gfx,tn,""),i.secondaryGfx&&ce(i.secondaryGfx,tn,""),delete t[o])},Ue.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var o=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,o,i)},Ue.prototype.updateGraphics=function(e,t,o){var i=e.id||e,a=this._elements[i];return o?a.secondaryGfx=t:a.gfx=t,t&&ce(t,tn,i),t},Ue.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&ce(e,tn);var o=this._elements[t];return o&&o.element},Ue.prototype.filter=function(e){var t=[];return this.forEach(function(o,i){e(o,i)&&t.push(o)}),t},Ue.prototype.find=function(e){for(var t=this._elements,o=Object.keys(t),i=0;i<o.length;i++){var a=o[i],l=t[a],r=l.element,s=l.gfx;if(e(r,s))return r}},Ue.prototype.getAll=function(){return this.filter(function(e){return e})},Ue.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(o){var i=t[o],a=i.element,l=i.gfx;return e(a,l)})},Ue.prototype.getGraphics=function(e,t){var o=e.id||e,i=this._elements[o];return i&&(t?i.secondaryGfx:i.gfx)},Ue.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function pp(e,t,o,i){var a=o.inverse;return Object.defineProperty(e,"remove",{value:function(l){var r=this.indexOf(l);return r!==-1&&(this.splice(r,1),t.unset(l,a,i)),l}}),Object.defineProperty(e,"contains",{value:function(l){return this.indexOf(l)!==-1}}),Object.defineProperty(e,"add",{value:function(l,r){var s=this.indexOf(l);if(typeof r>"u"){if(s!==-1)return;r=this.length}s!==-1&&this.splice(s,1),this.splice(r,0,l),s===-1&&t.set(l,a,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function hp(e){return e.__refs_collection===!0}function mp(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function ql(e,t,o){var i=pp(o[t.name]||[],e,t,o);Object.defineProperty(o,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(a){e.set(a,t.inverse,o)})}function gp(e,t,o){var i=t.inverse,a=o[t.name];Object.defineProperty(o,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return a},set:function(l){if(l!==a){var r=a;a=null,r&&e.unset(r,i,o),a=l,e.set(a,i,o)}}})}function qe(e,t){if(!(this instanceof qe))return new qe(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}qe.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?ql(this,t,e):gp(this,t,e)},qe.prototype.ensureRefsCollection=function(e,t){var o=e[t.name];return hp(o)||ql(this,t,e),o},qe.prototype.ensureBound=function(e,t){mp(e,t)||this.bind(e,t)},qe.prototype.unset=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(o):e[t.name]=void 0)},qe.prototype.set=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(o):e[t.name]=o)};var ni=new qe({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gl=new qe({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Kl=new qe({name:"attachers",collection:!0},{name:"host"}),Xl=new qe({name:"outgoing",collection:!0},{name:"source"}),Zl=new qe({name:"incoming",collection:!0},{name:"target"});function nn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,o=this.labels;!e&&t?o.remove(t):o.add(e,0)}}),ni.bind(this,"parent"),Gl.bind(this,"labels"),Xl.bind(this,"outgoing"),Zl.bind(this,"incoming")}function wn(){nn.call(this),ni.bind(this,"children"),Kl.bind(this,"host"),Kl.bind(this,"attachers")}Mt(wn,nn);function Ql(){nn.call(this),ni.bind(this,"children")}Mt(Ql,wn);function er(){wn.call(this),Gl.bind(this,"labelTarget")}Mt(er,wn);function tr(){nn.call(this),Xl.bind(this,"source"),Zl.bind(this,"target")}Mt(tr,nn);var yp={connection:tr,shape:wn,label:er,root:Ql};function bp(e,t){var o=yp[e];if(!o)throw new Error("unknown type: <"+e+">");return ie(new o,t)}function wp(e){return e instanceof nn}function st(){this._uid=12}st.prototype.createRoot=function(e){return this.create("root",e)},st.prototype.createLabel=function(e){return this.create("label",e)},st.prototype.createShape=function(e){return this.create("shape",e)},st.prototype.createConnection=function(e){return this.create("connection",e)},st.prototype.create=function(e,t){return t=ie({},t||{}),t.id||(t.id=e+"_"+this._uid++),bp(e,t)};var Kn="__fn",nr=1e3,vp=Array.prototype.slice;function ze(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ze.prototype.on=function(e,t,o,i){if(e=Ne(e)?e:[e],mt(t)&&(i=o,o=t,t=nr),!We(t))throw new Error("priority must be a number");var a=o;i&&(a=Do(o,i),a[Kn]=o[Kn]||o);var l=this;e.forEach(function(r){l._addListener(r,{priority:t,callback:a,next:null})})},ze.prototype.once=function(e,t,o,i){var a=this;if(mt(t)&&(i=o,o=t,t=nr),!We(t))throw new Error("priority must be a number");function l(){l.__isTomb=!0;var r=o.apply(i,arguments);return a.off(e,l),r}l[Kn]=o,this.on(e,t,l)},ze.prototype.off=function(e,t){e=Ne(e)?e:[e];var o=this;e.forEach(function(i){o._removeListener(i,t)})},ze.prototype.createEvent=function(e){var t=new vn;return t.init(e),t},ze.prototype.fire=function(e,t){var o,i,a,l;if(l=vp.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof vn?o=t:o=this.createEvent(t),l[0]=o;var r=o.type;e!==r&&(o.type=e);try{a=this._invokeListeners(o,l,i)}finally{e!==r&&(o.type=r)}return a===void 0&&o.defaultPrevented&&(a=!1),a}},ze.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},ze.prototype._destroy=function(){this._listeners={}},ze.prototype._invokeListeners=function(e,t,o){for(var i;o&&!e.cancelBubble;)i=this._invokeListener(e,t,o),o=o.next;return i},ze.prototype._invokeListener=function(e,t,o){var i;if(o.callback.__isTomb)return i;try{i=Cp(o.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(a){if(!this.handleError(a))throw console.error("unhandled error in event listener",a),a}return i},ze.prototype._addListener=function(e,t){var o=this._getListeners(e),i;if(!o){this._setListeners(e,t);return}for(;o;){if(o.priority<t.priority){t.next=o,i?i.next=t:this._setListeners(e,t);return}i=o,o=o.next}i.next=t},ze.prototype._getListeners=function(e){return this._listeners[e]},ze.prototype._setListeners=function(e,t){this._listeners[e]=t},ze.prototype._removeListener=function(e,t){var o=this._getListeners(e),i,a,l;if(!t){this._setListeners(e,null);return}for(;o;)i=o.next,l=o.callback,(l===t||l[Kn]===t)&&(a?a.next=i:this._setListeners(e,i)),a=o,o=i};function vn(){}vn.prototype.stopPropagation=function(){this.cancelBubble=!0},vn.prototype.preventDefault=function(){this.defaultPrevented=!0},vn.prototype.init=function(e){ie(this,e||{})};function Cp(e,t){return e.apply(null,t)}function Xn(e){return e.childNodes[0]}function kp(e){return e.parentNode.childNodes[1]}function Zn(e,t,o){var i=pf();i.setTranslate(t,o),Yo(e,i)}function Je(e,t){this._eventBus=e,this._elementRegistry=t}Je.$inject=["eventBus","elementRegistry"],Je.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),o;return e.parent?(o=kp(t),o||(o=Se("g"),Ge(o).add("djs-children"),Ee(t.parentNode,o))):o=t,o},Je.prototype._clear=function(e){var t=Xn(e);return Tf(t),t},Je.prototype._createContainer=function(e,t,o,i){var a=Se("g");Ge(a).add("djs-group"),typeof o<"u"?or(a,t,t.childNodes[o]):Ee(t,a);var l=Se("g");Ge(l).add("djs-element"),Ge(l).add("djs-"+e),i&&Ge(l).add("djs-frame"),Ee(a,l);var r=Se("g");return Ge(r).add("djs-visual"),Ee(l,r),l},Je.prototype.create=function(e,t,o){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,o,Sl(t))},Je.prototype.updateContainments=function(e){var t=this,o=this._elementRegistry,i;i=en(e,function(a,l){return l.parent&&(a[l.parent.id]=l.parent),a},{}),Z(i,function(a){var l=a.children;if(l){var r=t._getChildrenContainer(a);Z(l.slice().reverse(),function(s){var d=o.getGraphics(s);or(d.parentNode,r)})}})},Je.prototype.drawShape=function(e,t,o={}){var i=this._eventBus;return i.fire("render.shape",{gfx:e,element:t,attrs:o})},Je.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Je.prototype.drawConnection=function(e,t,o={}){var i=this._eventBus;return i.fire("render.connection",{gfx:e,element:t,attrs:o})},Je.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Je.prototype.update=function(e,t,o){if(t.parent){var i=this._clear(o);if(e==="shape")this.drawShape(i,t),Zn(o,t.x,t.y);else if(e==="connection")this.drawConnection(i,t);else throw new Error("unknown type: "+e);t.hidden?ce(o,"display","none"):ce(o,"display","block")}},Je.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Lt(t.parentNode)};function or(e,t,o){var i=o||t.firstChild;e!==i&&t.insertBefore(e,i)}const xp={__depends__:[Sf],__init__:["canvas"],canvas:["type",ee],elementRegistry:["type",Ue],elementFactory:["type",st],eventBus:["type",ze],graphicsFactory:["type",Je]};function Sp(e){var t=new ul(e);return t.init(),t}function Bp(e){e=e||{};var t={config:["value",e]},o=[t,xp].concat(e.modules||[]);return Sp(o)}function Cn(e,t){this._injector=t||Bp(e),this.get("eventBus").fire("diagram.init")}Cn.prototype.get=function(e,t){return this._injector.get(e,t)},Cn.prototype.invoke=function(e,t,o){return this._injector.invoke(e,t,o)},Cn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Cn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function ir(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Qn(e){return e.originalEvent||e.srcEvent}function oi(e){ir(e),ir(Qn(e))}function kn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}var ar=1500;function lr(e,t,o){var i=this,a=o.get("dragging",!1);function l(r){if(!r.hover){var s=r.originalEvent,d=i._findTargetGfx(s),c=d&&e.get(d);d&&c&&(r.stopPropagation(),a.hover({element:c,gfx:d}),a.move(s))}}a&&t.on("drag.start",function(r){t.once("drag.move",ar,function(s){l(s)})}),(function(){var r,s;t.on("element.hover",function(d){r=d.gfx,s=d.element}),t.on("element.hover",ar,function(d){s&&t.fire("element.out",{element:s,gfx:r})}),t.on("element.out",function(){r=null,s=null})})(),this._findTargetGfx=function(r){var s,d;if(r instanceof MouseEvent)return s=kn(r),d=document.elementFromPoint(s.x,s.y),Ep(d)}}lr.$inject=["elementRegistry","eventBus","injector"];function Ep(e){return Xo(e,"svg, .djs-element",!0)}const _p={__init__:["hoverFix"],hoverFix:["type",lr]};function jp(){return/mac/i.test(navigator.platform)}function rr(e,t){return(Qn(e)||e).button===t}function eo(e){return rr(e,0)}function Vp(e){return rr(e,1)}function Tp(e){var t=Qn(e)||e;return eo(e)&&t.shiftKey}function Np(e){return!0}function to(e){return eo(e)||Vp(e)}var sr=500;function cr(e,t,o){var i=this;function a(B,_,T){if(!s(B,_)){var j,D,A;T?D=t.getGraphics(T):(j=_.delegateTarget||_.target,j&&(D=j,T=t.get(D))),!(!D||!T)&&(A=e.fire(B,{element:T,gfx:D,originalEvent:_}),A===!1&&(_.stopPropagation(),_.preventDefault()))}}var l={};function r(B){return l[B]}function s(B,_){var T=c[B]||eo;return!T(_)}var d={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":Np,"element.mousedown":to,"element.mouseup":to,"element.click":to,"element.dblclick":to};function f(B,_,T){var j=d[B];if(!j)throw new Error("unmapped DOM event name <"+B+">");return a(j,_,T)}var u="svg, .djs-element";function p(B,_,T,j){var D=l[T]=function(A){a(T,A)};j&&(c[T]=j),D.$delegate=Vl.bind(B,u,_,D)}function h(B,_,T){var j=r(T);j&&Vl.unbind(B,_,j.$delegate)}function m(B){Z(d,function(_,T){p(B,T,_)})}function g(B){Z(d,function(_,T){h(B,T,_)})}e.on("canvas.destroy",function(B){g(B.svg)}),e.on("canvas.init",function(B){m(B.svg)}),e.on(["shape.added","connection.added"],function(B){var _=B.element,T=B.gfx;e.fire("interactionEvents.createHit",{element:_,gfx:T})}),e.on(["shape.changed","connection.changed"],sr,function(B){var _=B.element,T=B.gfx;e.fire("interactionEvents.updateHit",{element:_,gfx:T})}),e.on("interactionEvents.createHit",sr,function(B){var _=B.element,T=B.gfx;i.createDefaultHit(_,T)}),e.on("interactionEvents.updateHit",function(B){var _=B.element,T=B.gfx;i.updateDefaultHit(_,T)});var b=S("djs-hit djs-hit-stroke"),k=S("djs-hit djs-hit-click-stroke"),v=S("djs-hit djs-hit-all"),w=S("djs-hit djs-hit-no-move"),C={all:v,"click-stroke":k,stroke:b,"no-move":w};function S(B,_){return _=ie({stroke:"white",strokeWidth:15},_||{}),o.cls(B,["no-fill","no-border"],_)}function y(B,_){var T=C[_];if(!T)throw new Error("invalid hit type <"+_+">");return ce(B,T),B}function E(B,_){Ee(B,_)}this.removeHits=function(B){var _=Rf(".djs-hit",B);Z(_,Lt)},this.createDefaultHit=function(B,_){var T=B.waypoints,j=B.isFrame,D;return T?this.createWaypointsHit(_,T):(D=j?"stroke":"all",this.createBoxHit(_,D,{width:B.width,height:B.height}))},this.createWaypointsHit=function(B,_){var T=Ko(_);return y(T,"stroke"),E(B,T),T},this.createBoxHit=function(B,_,T){T=ie({x:0,y:0},T);var j=Se("rect");return y(j,_),ce(j,T),E(B,j),j},this.updateDefaultHit=function(B,_){var T=mn(".djs-hit",_);if(T)return B.waypoints?Cl(T,B.waypoints):ce(T,{width:B.width,height:B.height}),T},this.fire=a,this.triggerMouseEvent=f,this.mouseHandler=r,this.registerEvent=p,this.unregisterEvent=h}cr.$inject=["eventBus","elementRegistry","styles"];const $p={__init__:["interactionEvents"],interactionEvents:["type",cr]};function on(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var o=this;e.on(["shape.remove","connection.remove"],function(i){var a=i.element;o.deselect(a)}),e.on(["diagram.clear","root.set"],function(i){o.select(null)})}on.$inject=["eventBus","canvas"],on.prototype.deselect=function(e){var t=this._selectedElements,o=t.indexOf(e);if(o!==-1){var i=t.slice();t.splice(o,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},on.prototype.get=function(){return this._selectedElements},on.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},on.prototype.select=function(e,t){var o=this._selectedElements,i=o.slice();Ne(e)||(e=e?[e]:[]);var a=this._canvas,l=a.getRootElement();e=e.filter(function(r){var s=a.findRoot(r);return l===s}),t?Z(e,function(r){o.indexOf(r)===-1&&o.push(r)}):this._selectedElements=o=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:o})};var dr="hover",ur="selected";function fr(e,t){this._canvas=e;function o(a,l){e.addMarker(a,l)}function i(a,l){e.removeMarker(a,l)}t.on("element.hover",function(a){o(a.element,dr)}),t.on("element.out",function(a){i(a.element,dr)}),t.on("selection.changed",function(a){function l(c){i(c,ur)}function r(c){o(c,ur)}var s=a.oldSelection,d=a.newSelection;Z(s,function(c){d.indexOf(c)===-1&&l(c)}),Z(d,function(c){s.indexOf(c)===-1&&r(c)})})}fr.$inject=["canvas","eventBus"];function pr(e,t,o,i){e.on("create.end",500,function(a){var l=a.context,r=l.canExecute,s=l.elements,d=l.hints||{},c=d.autoSelect;if(r){if(c===!1)return;Ne(c)?t.select(c):t.select(s.filter(Mp))}}),e.on("connect.end",500,function(a){var l=a.context,r=l.connection;r&&t.select(r)}),e.on("shape.move.end",500,function(a){var l=a.previousSelection||[],r=i.get(a.context.shape.id),s=gt(l,function(d){return r.id===d.id});s||t.select(r)}),e.on("element.click",function(a){if(eo(a)){var l=a.element;l===o.getRootElement()&&(l=null);var r=t.isSelected(l),s=t.get().length>1,d=Tp(a);if(r&&s)return d?t.deselect(l):t.select(l);r?t.deselect(l):t.select(l,d)}})}pr.$inject=["eventBus","selection","canvas","elementRegistry"];function Mp(e){return!e.hidden}const no={__init__:["selectionVisuals","selectionBehavior"],__depends__:[$p],selection:["type",on],selectionVisuals:["type",fr],selectionBehavior:["type",pr]};var Lp=/^djs-cursor-.*$/;function ii(e){var t=Vf(document.body);t.removeMatching(Lp),e&&t.add("djs-cursor-"+e)}function hr(){ii(null)}var Pp=5e3;function mr(e,t){t=t||"element.click";function o(){return!1}return e.once(t,Pp,o),function(){e.off(t,o)}}function gr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function an(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rp(e,t){return e=Ne(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}var ln=Math.round,yr="djs-drag-active";function Rt(e){e.preventDefault()}function Ap(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Op(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function br(e,t,o,i){var a={threshold:5,trapClick:!0},l;function r(w){var C=t.viewbox(),S=t._container.getBoundingClientRect();return{x:C.x+(w.x-S.left)/C.scale,y:C.y+(w.y-S.top)/C.scale}}function s(w,C){C=C||l;var S=e.createEvent(ie({},C.payload,C.data,{isTouch:C.isTouch}));return e.fire("drag."+w,S)===!1?!1:e.fire(C.prefix+"."+w,S)}function d(w){var C=w.filter(function(S){return i.get(S.id)});C.length&&o.select(C)}function c(w,C){var S=l.payload,y=l.displacement,E=l.globalStart,B=kn(w),_=an(B,E),T=l.localStart,j=r(B),D=an(j,T);if(!l.active&&(C||Op(_)>l.threshold)){if(ie(S,{x:ln(T.x+y.x),y:ln(T.y+y.y),dx:0,dy:0},{originalEvent:w}),s("start")===!1)return b();l.active=!0,l.keepSelection||(S.previousSelection=o.get(),o.select(null)),l.cursor&&ii(l.cursor),t.addMarker(t.getRootElement(),yr)}oi(w),l.active&&(ie(S,{x:ln(j.x+y.x),y:ln(j.y+y.y),dx:ln(D.x),dy:ln(D.y)},{originalEvent:w}),s("move"))}function f(w){var C,S=!0;l.active&&(w&&(l.payload.originalEvent=w,oi(w)),S=s("end")),S===!1&&s("rejected"),C=k(S!==!0),s("ended",C)}function u(w){Rp("Escape",w)&&(Rt(w),b())}function p(w){var C;l.active&&(C=mr(e),setTimeout(C,400),Rt(w)),f(w)}function h(w){c(w)}function m(w){var C=l.payload;C.hoverGfx=w.gfx,C.hover=w.element,s("hover")}function g(w){s("out");var C=l.payload;C.hoverGfx=null,C.hover=null}function b(w){var C;if(l){var S=l.active;S&&s("cancel"),C=k(w),S&&s("canceled",C)}}function k(w){var C,S;s("cleanup"),hr(),l.trapClick?S=p:S=f,ke.unbind(document,"mousemove",c),ke.unbind(document,"dragstart",Rt),ke.unbind(document,"selectstart",Rt),ke.unbind(document,"mousedown",S,!0),ke.unbind(document,"mouseup",S,!0),ke.unbind(document,"keyup",u),ke.unbind(document,"touchstart",h,!0),ke.unbind(document,"touchcancel",b,!0),ke.unbind(document,"touchmove",c,!0),ke.unbind(document,"touchend",f,!0),e.off("element.hover",m),e.off("element.out",g),t.removeMarker(t.getRootElement(),yr);var y=l.payload.previousSelection;return w!==!1&&y&&!o.get().length&&d(y),C=l,l=null,C}function v(w,C,S,y){l&&b(!1),typeof C=="string"&&(y=S,S=C,C=null),y=ie({},a,y||{});var E=y.data||{},B,_,T,j,D;y.trapClick?j=p:j=f,w?(B=Qn(w)||w,_=kn(w),oi(w),B.type==="dragstart"&&Rt(B)):(B=null,_={x:0,y:0}),T=r(_),C||(C=T),D=Ap(B),l=ie({prefix:S,data:E,payload:{},globalStart:_,displacement:an(C,T),localStart:T,isTouch:D},y),y.manual||(D?(ke.bind(document,"touchstart",h,!0),ke.bind(document,"touchcancel",b,!0),ke.bind(document,"touchmove",c,!0),ke.bind(document,"touchend",f,!0)):(ke.bind(document,"mousemove",c),ke.bind(document,"dragstart",Rt),ke.bind(document,"selectstart",Rt),ke.bind(document,"mousedown",j,!0),ke.bind(document,"mouseup",j,!0)),ke.bind(document,"keyup",u),e.on("element.hover",m),e.on("element.out",g)),s("init"),y.autoActivate&&c(w,!0)}e.on("diagram.destroy",b),this.init=v,this.move=c,this.hover=m,this.out=g,this.end=f,this.cancel=b,this.context=function(){return l},this.setOptions=function(w){ie(a,w)}}br.$inject=["eventBus","canvas","selection","elementRegistry"];const wr={__depends__:[_p,no],dragging:["type",br]};function vr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}vr.prototype.next=function(){return this._prefix+ ++this._counter};const Fp=new vr("ps");var Ip=["marker-start","marker-mid","marker-end"],zp=["circle","ellipse","line","path","polygon","polyline","path","rect"];function St(e,t,o,i){this._elementRegistry=e,this._canvas=o,this._styles=i}St.$inject=["elementRegistry","eventBus","canvas","styles"],St.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},St.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},St.prototype.addDragger=function(e,t,o,i="djs-dragger"){o=o||this.getGfx(e);var a=yl(o),l=o.getBoundingClientRect();return this._cloneMarkers(Xn(a),i),ce(a,this._styles.cls(i,[],{x:l.top,y:l.left})),Ee(t,a),ce(a,"data-preview-support-element-id",e.id),a},St.prototype.addFrame=function(e,t){var o=Se("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ee(t,o),ce(o,"data-preview-support-element-id",e.id),o},St.prototype._cloneMarkers=function(e,t="djs-dragger",o=e){var i=this;e.childNodes&&e.childNodes.forEach(a=>{i._cloneMarkers(a,t,o)}),Up(e)&&Ip.forEach(function(a){if(ce(e,a)){var l=Dp(e,a,i._canvas.getContainer());l&&i._cloneMarker(o,e,l,a,t)}})},St.prototype._cloneMarker=function(e,t,o,i,a="djs-dragger"){var l=[o.id,a,Fp.next()].join("-"),r=mn("marker#"+o.id,e);e=e||this._canvas._svg;var s=r||yl(o);s.id=l,Ge(s).add(a);var d=mn(":scope > defs",e);d||(d=Se("defs"),Ee(e,d)),Ee(d,s);var c=Wp(s.id);ce(t,i,c)};function Dp(e,t,o){var i=Hp(ce(e,t));return mn("marker#"+i,o||document)}function Hp(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Wp(e){return"url(#"+e+")"}function Up(e){return zp.indexOf(e.nodeName)!==-1}const Jp={__init__:["previewSupport"],previewSupport:["type",St]};function ai(e){this._commandStack=e.get("commandStack",!1)}ai.$inject=["injector"],ai.prototype.allowed=function(e,t){var o=!0,i=this._commandStack;return i&&(o=i.canExecute(e,t)),o===void 0?!0:o};const Cr={__init__:["rules"],rules:["type",ai]};var Yp="drop-ok",kr="drop-not-ok",xr="attach-ok",Sr="new-parent",Br="create",qp=2e3;function Er(e,t,o,i,a){function l(d,c,f,u,p){if(!c)return!1;d=Qt(d,function(v){var w=v.labelTarget;return!v.parent&&!(Hl(v)&&d.indexOf(w)!==-1)});var h=gt(d,function(v){return!rt(v)}),m=!1,g=!1,b=!1;jr(d)&&(m=a.allowed("shape.attach",{position:f,shape:h,target:c})),m||(jr(d)?b=a.allowed("shape.create",{position:f,shape:h,source:u,target:c}):b=a.allowed("elements.create",{elements:d,position:f,target:c}));var k=p.connectionTarget;return b||m?(h&&u&&(g=a.allowed("connection.create",{source:k===u?h:u,target:k===u?u:h,hints:{targetParent:c,targetAttach:m}})),{attach:m,connect:g}):b===null||m===null?null:!1}function r(d,c){[xr,Yp,kr,Sr].forEach(function(f){f===c?e.addMarker(d,f):e.removeMarker(d,f)})}o.on(["create.move","create.hover"],function(d){var c=d.context,f=c.elements,u=d.hover,p=c.source,h=c.hints||{};if(!u){c.canExecute=!1,c.target=null;return}_r(d);var m={x:d.x,y:d.y},g=c.canExecute=u&&l(f,u,m,p,h);u&&g!==null&&(c.target=u,g&&g.attach?r(u,xr):r(u,g?Sr:kr))}),o.on(["create.end","create.out","create.cleanup"],function(d){var c=d.hover;c&&r(c,null)}),o.on("create.end",function(d){var c=d.context,f=c.source,u=c.shape,p=c.elements,h=c.target,m=c.canExecute,g=m&&m.attach,b=m&&m.connect,k=c.hints||{};if(m===!1||!h)return!1;_r(d);var v={x:d.x,y:d.y};b?u=i.appendShape(f,u,v,h,{attach:g,connection:b===!0?{}:b,connectionTarget:k.connectionTarget}):(p=i.createElements(p,v,h,ie({},k,{attach:g})),u=gt(p,function(w){return!rt(w)})),ie(c,{elements:p,shape:u}),ie(d,{elements:p,shape:u})});function s(){var d=t.context();d&&d.prefix===Br&&t.cancel()}o.on("create.init",function(){o.on("elements.changed",s),o.once(["create.cancel","create.end"],qp,function(){o.off("elements.changed",s)})}),this.start=function(d,c,f){Ne(c)||(c=[c]);var u=gt(c,function(m){return!rt(m)});if(u){f=ie({elements:c,hints:{},shape:u},f||{}),Z(c,function(m){We(m.x)||(m.x=0),We(m.y)||(m.y=0)});var p=Qt(c,function(m){return!m.hidden}),h=Wn(p);Z(c,function(m){rt(m)&&(m.waypoints=yt(m.waypoints,function(g){return{x:g.x-h.x-h.width/2,y:g.y-h.y-h.height/2}})),ie(m,{x:m.x-h.x-h.width/2,y:m.y-h.y-h.height/2})}),t.init(d,Br,{cursor:"grabbing",autoActivate:!0,data:{shape:u,elements:c,context:f}})}}}Er.$inject=["canvas","dragging","eventBus","modeling","rules"];function _r(e){var t=e.context,o=t.createConstraints;o&&(o.left&&(e.x=Math.max(e.x,o.left)),o.right&&(e.x=Math.min(e.x,o.right)),o.top&&(e.y=Math.max(e.y,o.top)),o.bottom&&(e.y=Math.min(e.y,o.bottom)))}function jr(e){return e&&e.length===1&&!rt(e[0])}var Gp=750;function Vr(e,t,o,i,a){function l(r){var s=Se("g");ce(s,a.cls("djs-drag-group",["no-events"]));var d=Se("g");return r.forEach(function(c){var f;c.hidden||(c.waypoints?(f=o._createContainer("connection",d),o.drawConnection(Xn(f),c)):(f=o._createContainer("shape",d),o.drawShape(Xn(f),c),Zn(f,c.x,c.y)),i.addDragger(c,s,f))}),s}t.on("create.move",Gp,function(r){var s=r.hover,d=r.context,c=d.elements,f=d.dragGroup;f||(f=d.dragGroup=l(c));var u;s?(f.parentNode||(u=e.getActiveLayer(),Ee(u,f)),Zn(f,r.x,r.y)):Lt(f)}),t.on("create.cleanup",function(r){var s=r.context,d=s.dragGroup;d&&Lt(d)})}Vr.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Kp={__depends__:[wr,Jp,Cr,no],__init__:["create","createPreview"],create:["type",Er],createPreview:["type",Vr]};function Tr(e,t,o,i){function a(r,s){return i.allowed("connection.create",{source:r,target:s})}function l(r,s){return a(s,r)}e.on("connect.hover",function(r){var s=r.context,d=s.start,c=r.hover,f;if(s.hover=c,f=s.canExecute=a(d,c),!Oo(f)){if(f!==!1){s.source=d,s.target=c;return}f=s.canExecute=l(d,c),!Oo(f)&&f!==!1&&(s.source=c,s.target=d)}}),e.on(["connect.out","connect.cleanup"],function(r){var s=r.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(r){var s=r.context,d=s.canExecute,c=s.connectionStart,f={x:r.x,y:r.y},u=s.source,p=s.target;if(!d)return!1;var h=null,m={connectionStart:li(s)?f:c,connectionEnd:li(s)?c:f};ht(d)&&(h=d),s.connection=o.connect(u,p,h,m)}),this.start=function(r,s,d,c){ht(d)||(c=d,d=tt(s)),t.init(r,"connect",{autoActivate:c,data:{shape:s,context:{start:s,connectionStart:d}}})}}Tr.$inject=["eventBus","dragging","modeling","rules"];function li(e){var t=e.hover,o=e.source,i=e.target;return t&&o&&t===o&&o!==i}var Xp=1100,Zp=900,Nr="connect-ok",$r="connect-not-ok";function Mr(e,t,o){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(a){var l=a.context,r=l.canExecute,s=l.hover,d=l.source,c=l.start,f=l.startPosition,u=l.target,p=l.connectionStart||f,h=l.connectionEnd||{x:a.x,y:a.y},m=p,g=h;li(l)&&(m=h,g=p),i.drawPreview(l,r,{source:d||c,target:u||s,connectionStart:m,connectionEnd:g})}),t.on("connect.hover",Zp,function(a){var l=a.context,r=a.hover,s=l.canExecute;s!==null&&o.addMarker(r,s?Nr:$r)}),t.on(["connect.out","connect.cleanup"],Xp,function(a){var l=a.hover;l&&(o.removeMarker(l,Nr),o.removeMarker(l,$r))}),i&&t.on("connect.cleanup",function(a){i.cleanUp(a.context)})}Mr.$inject=["injector","eventBus","canvas"];const Qp={__depends__:[no,Cr,wr],__init__:["connectPreview"],connect:["type",Tr],connectPreview:["type",Mr]};var eh=15;function Lr(e,t){var o;function i(s){return r(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)});function a(s){var d=o.start,c=o.button,f=kn(s),u=an(f,d);if(!o.dragging&&th(u)>eh&&(o.dragging=!0,c===0&&mr(e),ii("grab")),o.dragging){var p=o.last||o.start;u=an(f,p),t.scroll({dx:u.x,dy:u.y}),o.last=f}s.preventDefault()}function l(s){ke.unbind(document,"mousemove",a),ke.unbind(document,"mouseup",l),o=null,hr()}function r(s){if(!Xo(s.target,".djs-draggable")){var d=s.button;if(!(d>=2||s.ctrlKey||s.shiftKey||s.altKey))return o={button:d,start:kn(s)},ke.bind(document,"mousemove",a),ke.bind(document,"mouseup",l),!0}}this.isActive=function(){return!!o}}Lr.$inject=["eventBus","canvas"];function th(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const nh={__init__:["moveCanvas"],moveCanvas:["type",Lr]};function ri(e){return Math.log(e)/Math.log(10)}function Pr(e,t){var o=ri(e.min),i=ri(e.max),a=Math.abs(o)+Math.abs(i);return a/t}function oh(e,t){return Math.max(e.min,Math.min(e.max,t))}var ih=Math.sign||function(e){return e>=0?1:-1},si={min:.2,max:4},Rr=10,ah=.1,lh=.75;function nt(e,t,o){e=e||{},this._enabled=!1,this._canvas=o,this._container=o._container,this._handleWheel=Do(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||lh;var i=this;t.on("canvas.focus.changed",function(a){i._init(a.focused&&e.enabled!==!1)})}nt.$inject=["config.zoomScroll","eventBus","canvas"],nt.prototype.scroll=function(t){this._canvas.scroll(t)},nt.prototype.reset=function(){this._canvas.zoom("fit-viewport")},nt.prototype.zoom=function(t,o){var i=Pr(si,Rr*2);this._totalDelta+=t,Math.abs(this._totalDelta)>ah&&(this._zoom(t,o,i),this._totalDelta=0)},nt.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var o=this._container;t.preventDefault();var i=t.ctrlKey||jp()&&t.metaKey,a=t.shiftKey,l=-1*this._scale,r;if(i?l*=t.deltaMode===0?.02:.32:l*=t.deltaMode===0?1:16,i){var s=o.getBoundingClientRect(),d={x:t.clientX-s.left,y:t.clientY-s.top};r=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*ih(t.deltaY)*l,this.zoom(r,d)}else a?r={dx:l*t.deltaY,dy:0}:r={dx:l*t.deltaX,dy:l*t.deltaY},this.scroll(r)}},nt.prototype.stepZoom=function(t,o){var i=Pr(si,Rr);this._zoom(t,o,i)},nt.prototype._zoom=function(e,t,o){var i=this._canvas,a=e>0?1:-1,l=ri(i.zoom()),r=Math.round(l/o)*o;r+=o*a;var s=Math.pow(10,r);i.zoom(oh(si,s),t)},nt.prototype.toggle=function(t){var o=this._container,i=this._handleWheel,a=this._enabled;return typeof t>"u"&&(t=!a),a!==t&&ke[t?"bind":"unbind"](o,"wheel",i,!1),this._enabled=t,t},nt.prototype._init=function(e){this.toggle(e)};const rh={__init__:["zoomScroll"],zoomScroll:["type",nt]};function Be(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Be.$inject=["eventBus","injector"],Be.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const o={command:e,context:t};this._pushAction(o),this._internalExecute(o),this._popAction()},Be.prototype.canExecute=function(e,t){const o={command:e,context:t},i=this._getHandler(e);let a=this._fire(e,"canExecute",o);if(a===void 0){if(!i)return!1;i.canExecute&&(a=i.canExecute(t))}return a},Be.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Be.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Be.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Be.prototype.register=function(e,t){this._setHandler(e,t)},Be.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const o=this._injector.instantiate(t);this.register(e,o)},Be.prototype.canUndo=function(){return!!this._getUndoAction()},Be.prototype.canRedo=function(){return!!this._getRedoAction()},Be.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Be.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Be.prototype._internalUndo=function(e){const t=e.command,o=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(o)),this._revertedAction(e),this._fire(t,"reverted",e)})},Be.prototype._fire=function(e,t,o){arguments.length<3&&(o=t,t=null);const i=t?[e+"."+t,t]:[e];let a;o=this._eventBus.createEvent(o);for(const l of i)if(a=this._eventBus.fire("commandStack."+l,o),o.cancelBubble)break;return a},Be.prototype._createId=function(){return this._uid++},Be.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Be.prototype._internalExecute=function(e,t){const o=e.command,i=e.context,a=this._getHandler(o);if(!a)throw new Error("no command handler registered for <"+o+">");this._pushAction(e),t||(this._fire(o,"preExecute",e),a.preExecute&&a.preExecute(i),this._fire(o,"preExecuted",e)),this._atomicDo(()=>{this._fire(o,"execute",e),a.execute&&this._markDirty(a.execute(i)),this._executedAction(e,t),this._fire(o,"executed",e)}),t||(this._fire(o,"postExecute",e),a.postExecute&&a.postExecute(i),this._fire(o,"postExecuted",e)),this._popAction()},Be.prototype._pushAction=function(e){const t=this._currentExecution,o=t.actions,i=o[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),o.push(e)},Be.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,o=e.actions,i=e.dirty;o.pop(),o.length||(this._eventBus.fire("elements.changed",{elements:Qu("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Be.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=Ne(e)?e:[e],t.dirty=t.dirty.concat(e))},Be.prototype._executedAction=function(e,t){const o=++this._stackIdx;t||this._stack.splice(o,this._stack.length,e)},Be.prototype._revertedAction=function(e){this._stackIdx--},Be.prototype._getHandler=function(e){return this._handlerMap[e]},Be.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const sh={commandStack:["type",Be]};function rn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var o;o=e[0];)t(o);return e}}var ch=1e3;function Fe(e){this._eventBus=e}Fe.$inject=["eventBus"];function dh(e,t){return function(o){return e.call(t||null,o.context,o.command,o)}}Fe.prototype.on=function(e,t,o,i,a,l){if((mt(t)||We(t))&&(l=a,a=i,i=o,o=t,t=null),mt(o)&&(l=a,a=i,i=o,o=ch),ht(a)&&(l=a,a=!1),!mt(i))throw new Error("handlerFn must be a function");Ne(e)||(e=[e]);var r=this._eventBus;Z(e,function(s){var d=["commandStack",s,t].filter(function(c){return c}).join(".");r.on(d,o,a?dh(i,l):i,l)})},Fe.prototype.canExecute=ct("canExecute"),Fe.prototype.preExecute=ct("preExecute"),Fe.prototype.preExecuted=ct("preExecuted"),Fe.prototype.execute=ct("execute"),Fe.prototype.executed=ct("executed"),Fe.prototype.postExecute=ct("postExecute"),Fe.prototype.postExecuted=ct("postExecuted"),Fe.prototype.revert=ct("revert"),Fe.prototype.reverted=ct("reverted");function ct(e){return function(o,i,a,l,r){(mt(o)||We(o))&&(r=l,l=a,a=i,i=o,o=null),this.on(o,e,i,a,l,r)}}var uh=250,Ar=1400;function ci(e,t,o){Fe.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",Ar,function(a){var l=a.context,r=l.shapes,s=l.validatedShapes;l.shapes=Or(r),l.validatedShapes=Or(s)}),i&&t.on("shape.move.start",uh,function(a){var l=a.context,r=l.shapes,s=[];Z(r,function(d){Z(d.labels,function(c){!c.hidden&&l.shapes.indexOf(c)===-1&&s.push(c),d.labelTarget&&s.push(d)})}),Z(s,function(d){i.makeDraggable(l,d,!0)})}),this.preExecuted("elements.move",Ar,function(a){var l=a.context,r=l.closure,s=r.enclosedElements,d=[];Z(s,function(c){Z(c.labels,function(f){s[f.id]||d.push(f)})}),r.addAll(d)}),this.preExecute(["connection.delete","shape.delete"],function(a){var l=a.context,r=l.connection||l.shape;rn(r.labels,function(s){o.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(a){var l=a.context,r=l.shape,s=r.labelTarget;s&&(l.labelTargetIndex=Zo(s.labels,r),l.labelTarget=s,r.labelTarget=null)}),this.revert("shape.delete",function(a){var l=a.context,r=l.shape,s=l.labelTarget,d=l.labelTargetIndex;s&&(lt(s.labels,r,d),r.labelTarget=s)})}Mt(ci,Fe),ci.$inject=["injector","eventBus","modeling"];function Or(e){return Qt(e,function(t){return e.indexOf(t.labelTarget)===-1})}const fh={__init__:["labelSupport"],labelSupport:["type",ci]};function Fr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=Math.random()*16|0;return(t==="x"?o:o&3|8).toString(16)})}function Ir(e,t){if(t){let o=e;return Object.keys(t).forEach(i=>{o=o.replace(new RegExp(`{${i}}`,"g"),t[i])}),o}return e}function Ke(e,...t){if(typeof Object.assign=="function")return Object.assign(e,...t);if(e==null)throw new TypeError("Cannot convert undefined or null to object");const o=Object(e);for(let i=0;i<t.length;i++){const a=t[i];if(a!=null)for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&(o[l]=a[l])}return o}function zr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ph(e,t){Array.isArray(e)&&e.forEach(t)}var oo={exports:{}},Dr;function hh(){return Dr||(Dr=1,typeof Object.create=="function"?oo.exports=function(t,o){o&&(t.super_=o,t.prototype=Object.create(o.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:oo.exports=function(t,o){if(o){t.super_=o;var i=function(){};i.prototype=o.prototype,t.prototype=new i,t.prototype.constructor=t}}),oo.exports}var mh=hh();const xn=Bf(mh),gh={width:90,height:20};function At(){st.call(this),this._translate=Ir}xn(At,st),At.$inject=[],At.prototype.baseCreate=st.prototype.create,At.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,Ke({type:"label"},gh,t)):this.createFlowElement(e,t)},At.prototype.createFlowElement=function(e,t){if(t==null||t===void 0||t==="")return this.baseCreate(e,t);t.businessObject=t.businessObject||{id:Fr()},e==="connection"&&(t.type="myline");const{businessObject:o}=t;o.type=t.type;const i=this._getDefaultSize(o.type);return t=Ke({businessObject:o,id:o.id},i,t),this.baseCreate(e,t)},At.prototype._getDefaultSize=function(e){let t={width:100,height:80};switch(e){case"startEvent":case"endEvent":case"myEvent":t={width:36,height:36};break;case"gatewayAnd":case"gatewayXor":case"gatewayInclusive":t={width:50,height:50};break;case"subprocess":case"userTask":case"scriptTask":t={width:100,height:80};break}return t};function io(e,t){this._modeling=e,this._canvas=t}io.$inject=["modeling","canvas"],io.prototype.preExecute=function(e){var t=this._modeling,o=e.elements,i=e.alignment;Z(o,function(a){var l={x:0,y:0};Zt(i.left)?l.x=i.left-a.x:Zt(i.right)?l.x=i.right-a.width-a.x:Zt(i.center)?l.x=i.center-Math.round(a.width/2)-a.x:Zt(i.top)?l.y=i.top-a.y:Zt(i.bottom)?l.y=i.bottom-a.height-a.y:Zt(i.middle)&&(l.y=i.middle-Math.round(a.height/2)-a.y),t.moveElements([a],l,a.parent)})},io.prototype.postExecute=function(e){};function ao(e){this._modeling=e}ao.$inject=["modeling"],ao.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var o=e.target||t.parent,i=e.shape,a=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,o,{attach:a.attach}),e.shape=i},ao.prototype.postExecute=function(e){var t=e.hints||{};yh(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function yh(e,t){return Xu(e.outgoing,function(o){return o.target===t})}function lo(e,t){this._canvas=e,this._layouter=t}lo.$inject=["canvas","layouter"],lo.prototype.execute=function(e){var t=e.connection,o=e.source,i=e.target,a=e.parent,l=e.parentIndex,r=e.hints;if(!o||!i)throw new Error("source and target required");if(!a)throw new Error("parent required");return t.source=o,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,r)),this._canvas.addConnection(t,a,l),t},lo.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var ro=Math.round;function di(e){this._modeling=e}di.$inject=["modeling"],di.prototype.preExecute=function(e){var t=e.elements,o=e.parent,i=e.parentIndex,a=e.position,l=e.hints,r=this._modeling;Z(t,function(u){We(u.x)||(u.x=0),We(u.y)||(u.y=0)});var s=Qt(t,function(u){return!u.hidden}),d=Wn(s);Z(t,function(u){rt(u)&&(u.waypoints=yt(u.waypoints,function(p){return{x:ro(p.x-d.x-d.width/2+a.x),y:ro(p.y-d.y-d.height/2+a.y)}})),ie(u,{x:ro(u.x-d.x-d.width/2+a.x),y:ro(u.y-d.y-d.height/2+a.y)})});var c=wf(t),f={};Z(t,function(u){if(rt(u)){f[u.id]=We(i)?r.createConnection(f[u.source.id],f[u.target.id],i,u,u.parent||o,l):r.createConnection(f[u.source.id],f[u.target.id],u,u.parent||o,l);return}var p=ie({},l);c.indexOf(u)===-1&&(p.autoResize=!1),Hl(u)&&(p=of(p,["attach"])),f[u.id]=We(i)?r.createShape(u,Ho(u,["x","y","width","height"]),u.parent||o,i,p):r.createShape(u,Ho(u,["x","y","width","height"]),u.parent||o,p)}),e.elements=Zu(f)};var Hr=Math.round;function Bt(e){this._canvas=e}Bt.$inject=["canvas"],Bt.prototype.execute=function(e){var t=e.shape,o=e.position,i=e.parent,a=e.parentIndex;if(!i)throw new Error("parent required");if(!o)throw new Error("position required");return o.width!==void 0?ie(t,o):ie(t,{x:o.x-Hr(t.width/2),y:o.y-Hr(t.height/2)}),this._canvas.addShape(t,i,a),t},Bt.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Sn(e){Bt.call(this,e)}Mt(Sn,Bt),Sn.$inject=["canvas"];var bh=Bt.prototype.execute;Sn.prototype.execute=function(e){var t=e.shape;return vh(t),t.labelTarget=e.labelTarget,bh.call(this,e)};var wh=Bt.prototype.revert;Sn.prototype.revert=function(e){return e.shape.labelTarget=null,wh.call(this,e)};function vh(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function Bn(e,t){this._canvas=e,this._modeling=t}Bn.$inject=["canvas","modeling"],Bn.prototype.preExecute=function(e){var t=this._modeling,o=e.connection;rn(o.incoming,function(i){t.removeConnection(i,{nested:!0})}),rn(o.outgoing,function(i){t.removeConnection(i,{nested:!0})})},Bn.prototype.execute=function(e){var t=e.connection,o=t.parent;return e.parent=o,e.parentIndex=Zo(o.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Bn.prototype.revert=function(e){var t=e.connection,o=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,lt(o.children,t,i),this._canvas.addConnection(t,o),t};function ui(e,t){this._modeling=e,this._elementRegistry=t}ui.$inject=["modeling","elementRegistry"],ui.prototype.postExecute=function(e){var t=this._modeling,o=this._elementRegistry,i=e.elements;Z(i,function(a){o.get(a.id)&&(a.waypoints?t.removeConnection(a):t.removeShape(a))})};function En(e,t){this._canvas=e,this._modeling=t}En.$inject=["canvas","modeling"],En.prototype.preExecute=function(e){var t=this._modeling,o=e.shape;rn(o.incoming,function(i){t.removeConnection(i,{nested:!0})}),rn(o.outgoing,function(i){t.removeConnection(i,{nested:!0})}),rn(o.children,function(i){rt(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},En.prototype.execute=function(e){var t=this._canvas,o=e.shape,i=o.parent;return e.oldParent=i,e.oldParentIndex=Zo(i.children,o),t.removeShape(o),o},En.prototype.revert=function(e){var t=this._canvas,o=e.shape,i=e.oldParent,a=e.oldParentIndex;return lt(i.children,o,a),t.addShape(o,i),o};function so(e){this._modeling=e}so.$inject=["modeling"];var Wr={x:"y",y:"x"};so.prototype.preExecute=function(e){var t=this._modeling,o=e.groups,i=e.axis,a=e.dimension;function l(b,k){b.range.min=Math.min(k[i],b.range.min),b.range.max=Math.max(k[i]+k[a],b.range.max)}function r(b){return b[i]+b[a]/2}function s(b){return b.length-1}function d(b){return b.max-b.min}function c(b,k){var v={y:0};v[i]=b-r(k),v[i]&&(v[Wr[i]]=0,t.moveElements([k],v,k.parent))}var f=o[0],u=s(o),p=o[u],h,m,g=0;Z(o,function(b,k){var v,w,C;if(b.elements.length<2){k&&k!==o.length-1&&(l(b,b.elements[0]),g+=d(b.range));return}v=hl(b.elements,i),w=v[0],k===u&&(w=v[s(v)]),C=r(w),b.range=null,Z(v,function(S){if(c(C,S),b.range===null){b.range={min:S[i],max:S[i]+S[a]};return}l(b,S)}),k&&k!==o.length-1&&(g+=d(b.range))}),m=Math.abs(p.range.min-f.range.max),h=Math.round((m-g)/(o.length-1)),!(h<o.length-1)&&Z(o,function(b,k){var v={},w;b===f||b===p||(w=o[k-1],b.range.max=0,Z(b.elements,function(C,S){v[Wr[i]]=0,v[i]=w.range.max-C[i]+h,b.range.min!==C[i]&&(v[i]+=C[i]-b.range.min),v[i]&&t.moveElements([C],v,C.parent),b.range.max=Math.max(C[i]+C[a],S?b.range.max:0)}))})},so.prototype.postExecute=function(e){};function co(e,t){this._layouter=e,this._canvas=t}co.$inject=["layouter","canvas"],co.prototype.execute=function(e){var t=e.connection,o=t.waypoints;return ie(e,{oldWaypoints:o}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},co.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function fi(){}fi.prototype.execute=function(e){var t=e.connection,o=e.delta,i=e.newParent||t.parent,a=e.newParentIndex,l=t.parent;return e.oldParent=l,e.oldParentIndex=gn(l.children,t),lt(i.children,t,a),t.parent=i,Z(t.waypoints,function(r){r.x+=o.x,r.y+=o.y,r.original&&(r.original.x+=o.x,r.original.y+=o.y)}),t},fi.prototype.revert=function(e){var t=e.connection,o=t.parent,i=e.oldParent,a=e.oldParentIndex,l=e.delta;return gn(o.children,t),lt(i.children,t,a),t.parent=i,Z(t.waypoints,function(r){r.x-=l.x,r.y-=l.y,r.original&&(r.original.x-=l.x,r.original.y-=l.y)}),t};function uo(e,t,o){var i=gr(t),a=gr(o),l=an(e,i),r={x:l.x*(o.width/t.width),y:l.y*(o.height/t.height)};return yn({x:a.x+r.x,y:a.y+r.y})}function pi(e,t,o){var i=fo(e),a=Jr(i,t),l=i[0];return a.length?a[a.length-1]:uo(l.original||l,o,t)}function hi(e,t,o){var i=fo(e),a=Jr(i,t),l=i[i.length-1];return a.length?a[0]:uo(l.original||l,o,t)}function mi(e,t,o){var i=fo(e),a=Ur(t,o),l=i[0];return uo(l.original||l,a,t)}function gi(e,t,o){var i=fo(e),a=Ur(t,o),l=i[i.length-1];return uo(l.original||l,a,t)}function Ur(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function fo(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Jr(e,t){var o=yt(e,kh);return Qt(o,function(i){return Ch(i,t)})}function Ch(e,t){return bn(t,e,1)==="intersect"}function kh(e){return e.original||e}function yi(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}yi.prototype.add=function(e,t){return this.addAll([e],t)},yi.prototype.addAll=function(e,t){var o=vf(e,!!t,this);return ie(this,o),this};function _n(e){this._modeling=e}_n.prototype.moveRecursive=function(e,t,o){return e?this.moveClosure(this.getClosure(e),t,o):[]},_n.prototype.moveClosure=function(e,t,o,i,a){var l=this._modeling,r=e.allShapes,s=e.allConnections,d=e.enclosedConnections,c=e.topLevel,f=!1;a&&a.parent===o&&(f=!0),Z(r,function(u){l.moveShape(u,t,c[u.id]&&!f&&o,{recurse:!1,layout:!1})}),Z(s,function(u){var p=!!r[u.source.id],h=!!r[u.target.id];d[u.id]&&p&&h?l.moveConnection(u,t,c[u.id]&&!f&&o):l.layoutConnection(u,{connectionStart:p&&mi(u,u.source,t),connectionEnd:h&&gi(u,u.target,t)})})},_n.prototype.getClosure=function(e){return new yi().addAll(e,!0)};function po(e){this._helper=new _n(e)}po.$inject=["modeling"],po.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},po.prototype.postExecute=function(e){var t=e.hints,o;t&&t.primaryShape&&(o=t.primaryShape,t.oldParent=o.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,o)};function Ot(e){this._modeling=e,this._helper=new _n(e)}Ot.$inject=["modeling"],Ot.prototype.execute=function(e){var t=e.shape,o=e.delta,i=e.newParent||t.parent,a=e.newParentIndex,l=t.parent;return e.oldBounds=Ho(t,["x","y","width","height"]),e.oldParent=l,e.oldParentIndex=gn(l.children,t),lt(i.children,t,a),ie(t,{parent:i,x:t.x+o.x,y:t.y+o.y}),t},Ot.prototype.postExecute=function(e){var t=e.shape,o=e.delta,i=e.hints,a=this._modeling;i.layout!==!1&&(Z(t.incoming,function(l){a.layoutConnection(l,{connectionEnd:gi(l,t,o)})}),Z(t.outgoing,function(l){a.layoutConnection(l,{connectionStart:mi(l,t,o)})})),i.recurse!==!1&&this.moveChildren(e)},Ot.prototype.revert=function(e){var t=e.shape,o=e.oldParent,i=e.oldParentIndex,a=e.delta;return lt(o.children,t,i),ie(t,{parent:o,x:t.x-a.x,y:t.y-a.y}),t},Ot.prototype.moveChildren=function(e){var t=e.delta,o=e.shape;this._helper.moveRecursive(o.children,t,null)},Ot.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function jn(e){this._modeling=e}jn.$inject=["modeling"],jn.prototype.execute=function(e){var t=e.newSource,o=e.newTarget,i=e.connection,a=e.dockingOrPoints;if(!t&&!o)throw new Error("newSource or newTarget required");return Ne(a)&&(e.oldWaypoints=i.waypoints,i.waypoints=a),t&&(e.oldSource=i.source,i.source=t),o&&(e.oldTarget=i.target,i.target=o),i},jn.prototype.postExecute=function(e){var t=e.connection,o=e.newSource,i=e.newTarget,a=e.dockingOrPoints,l=e.hints||{},r={};l.connectionStart&&(r.connectionStart=l.connectionStart),l.connectionEnd&&(r.connectionEnd=l.connectionEnd),l.layoutConnection!==!1&&(o&&(!i||l.docking==="source")&&(r.connectionStart=r.connectionStart||Yr(Ne(a)?a[0]:a)),i&&(!o||l.docking==="target")&&(r.connectionEnd=r.connectionEnd||Yr(Ne(a)?a[a.length-1]:a)),l.newWaypoints&&(r.waypoints=l.newWaypoints),this._modeling.layoutConnection(t,r))},jn.prototype.revert=function(e){var t=e.oldSource,o=e.oldTarget,i=e.oldWaypoints,a=e.connection;return t&&(a.source=t),o&&(a.target=o),i&&(a.waypoints=i),a};function Yr(e){return e.original||e}function dt(e,t){this._modeling=e,this._rules=t}dt.$inject=["modeling","rules"],dt.prototype.preExecute=function(e){var t=this,o=this._modeling,i=this._rules,a=e.oldShape,l=e.newData,r=e.hints||{},s;function d(m,g,b){return i.allowed("connection.reconnect",{connection:b,source:m,target:g})}var c={x:l.x,y:l.y},f={x:a.x,y:a.y,width:a.width,height:a.height};s=e.newShape=e.newShape||t.createShape(l,c,a.parent,r),a.host&&o.updateAttachment(s,a.host);var u;r.moveChildren!==!1&&(u=a.children.slice(),o.moveElements(u,{x:0,y:0},s,r));var p=a.incoming.slice(),h=a.outgoing.slice();Z(p,function(m){var g=m.source,b=d(g,s,m);b&&t.reconnectEnd(m,s,hi(m,s,f),r)}),Z(h,function(m){var g=m.target,b=d(s,g,m);b&&t.reconnectStart(m,s,pi(m,s,f),r)})},dt.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},dt.prototype.execute=function(e){},dt.prototype.revert=function(e){},dt.prototype.createShape=function(e,t,o,i){return this._modeling.createShape(e,t,o,i)},dt.prototype.reconnectStart=function(e,t,o,i){this._modeling.reconnectStart(e,t,o,i)},dt.prototype.reconnectEnd=function(e,t,o,i){this._modeling.reconnectEnd(e,t,o,i)};function Vn(e){this._modeling=e}Vn.$inject=["modeling"],Vn.prototype.execute=function(e){var t=e.shape,o=e.newBounds,i=e.minBounds;if(o.x===void 0||o.y===void 0||o.width===void 0||o.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(o.width<i.width||o.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&o.width<10||o.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},ie(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t},Vn.prototype.postExecute=function(e){var t=this._modeling,o=e.shape,i=e.oldBounds,a=e.hints||{};a.layout!==!1&&(Z(o.incoming,function(l){t.layoutConnection(l,{connectionEnd:hi(l,o,i)})}),Z(o.outgoing,function(l){t.layoutConnection(l,{connectionStart:pi(l,o,i)})}))},Vn.prototype.revert=function(e){var t=e.shape,o=e.oldBounds;return ie(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t};function xh(e,t){var o=[];return Z(e.concat(t),function(i){var a=i.incoming,l=i.outgoing;Z(a.concat(l),function(r){var s=r.source,d=r.target;(Tn(e,s)||Tn(e,d)||Tn(t,s)||Tn(t,d))&&(Tn(o,r)||o.push(r))})}),o}function Tn(e,t){return e.indexOf(t)!==-1}function Sh(e,t,o){var i=e.x,a=e.y,l=e.width,r=e.height,s=o.x,d=o.y;switch(t){case"n":return{x:i,y:a+d,width:l,height:r-d};case"s":return{x:i,y:a,width:l,height:r+d};case"w":return{x:i+s,y:a,width:l-s,height:r};case"e":return{x:i,y:a,width:l+s,height:r};default:throw new Error("unknown direction: "+t)}}function Et(e){this._modeling=e}Et.$inject=["modeling"],Et.prototype.preExecute=function(e){var t=e.delta,o=e.direction,i=e.movingShapes,a=e.resizingShapes,l=e.start,r={};this.moveShapes(i,t),Z(a,function(s){r[s.id]=Eh(s)}),this.resizeShapes(a,t,o),this.updateConnectionWaypoints(xh(i,a),t,o,l,i,a,r)},Et.prototype.execute=function(){},Et.prototype.revert=function(){},Et.prototype.moveShapes=function(e,t){var o=this;Z(e,function(i){o._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Et.prototype.resizeShapes=function(e,t,o){var i=this;Z(e,function(a){var l=Sh(a,o,t);i._modeling.resizeShape(a,l,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Et.prototype.updateConnectionWaypoints=function(e,t,o,i,a,l,r){var s=this,d=a.concat(l);Z(e,function(c){var f=c.source,u=c.target,p=Bh(c),h=Gr(o),m={};_t(d,f)&&_t(d,u)?(p=yt(p,function(g){return Kr(g,i,o)&&(g[h]=g[h]+t[h]),g.original&&Kr(g.original,i,o)&&(g.original[h]=g.original[h]+t[h]),g}),s._modeling.updateWaypoints(c,p,{labelBehavior:!1})):(_t(d,f)||_t(d,u))&&(_t(a,f)?m.connectionStart=mi(c,f,t):_t(a,u)?m.connectionEnd=gi(c,u,t):_t(l,f)?m.connectionStart=pi(c,f,r[f.id]):_t(l,u)&&(m.connectionEnd=hi(c,u,r[u.id])),s._modeling.layoutConnection(c,m))})};function qr(e){return ie({},e)}function Bh(e){return yt(e.waypoints,function(t){return t=qr(t),t.original&&(t.original=qr(t.original)),t})}function Gr(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function Kr(e,t,o){var i=Gr(o);if(/e|s/.test(o))return e[i]>t;if(/n|w/.test(o))return e[i]<t}function _t(e,t){return e.indexOf(t)!==-1}function Eh(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function ho(e){this._modeling=e}ho.$inject=["modeling"],ho.prototype.execute=function(e){var t=e.shape,o=t.children;e.oldChildrenVisibility=Xr(o),t.collapsed=!t.collapsed;var i=Zr(o,t.collapsed);return[t].concat(i)},ho.prototype.revert=function(e){var t=e.shape,o=e.oldChildrenVisibility,i=t.children,a=Qr(i,o);return t.collapsed=!t.collapsed,[t].concat(a)};function Xr(e){var t={};return Z(e,function(o){t[o.id]=o.hidden,o.children&&(t=ie({},t,Xr(o.children)))}),t}function Zr(e,t){var o=[];return Z(e,function(i){i.hidden=t,o=o.concat(i),i.children&&(o=o.concat(Zr(i.children,i.collapsed||t)))}),o}function Qr(e,t){var o=[];return Z(e,function(i){i.hidden=t[i.id],o=o.concat(i),i.children&&(o=o.concat(Qr(i.children,t)))}),o}function mo(e){this._modeling=e}mo.$inject=["modeling"],mo.prototype.execute=function(e){var t=e.shape,o=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=es(i,t),ts(o,t),t.host=o,t},mo.prototype.revert=function(e){var t=e.shape,o=e.newHost,i=e.oldHost,a=e.attacherIdx;return t.host=i,es(o,t),ts(i,t,a),t};function es(e,t){return gn(e&&e.attachers,t)}function ts(e,t,o){if(e){var i=e.attachers;i||(e.attachers=i=[]),lt(i,t,o)}}function bi(){}bi.prototype.execute=function(e){var t=e.connection,o=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=o,t},bi.prototype.revert=function(e){var t=e.connection,o=e.oldWaypoints;return t.waypoints=o,t};function be(e,t,o){this._eventBus=e,this._elementFactory=t,this._commandStack=o;var i=this;e.on("diagram.init",function(){i.registerHandlers(o)})}be.$inject=["eventBus","elementFactory","commandStack"],be.prototype.getHandlers=function(){return{"shape.append":ao,"shape.create":Bt,"shape.delete":En,"shape.move":Ot,"shape.resize":Vn,"shape.replace":dt,"shape.toggleCollapse":ho,spaceTool:Et,"label.create":Sn,"connection.create":lo,"connection.delete":Bn,"connection.move":fi,"connection.layout":co,"connection.updateWaypoints":bi,"connection.reconnect":jn,"elements.create":di,"elements.move":po,"elements.delete":ui,"elements.distribute":so,"elements.align":io,"element.updateAttachment":mo}},be.prototype.registerHandlers=function(e){Z(this.getHandlers(),function(t,o){e.registerHandler(o,t)})},be.prototype.moveShape=function(e,t,o,i,a){typeof i=="object"&&(a=i,i=null);var l={shape:e,delta:t,newParent:o,newParentIndex:i,hints:a||{}};this._commandStack.execute("shape.move",l)},be.prototype.updateAttachment=function(e,t){var o={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",o)},be.prototype.moveElements=function(e,t,o,i){i=i||{};var a=i.attach,l=o,r;a===!0?(r=o,l=o.parent):a===!1&&(r=null);var s={shapes:e,delta:t,newParent:l,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},be.prototype.moveConnection=function(e,t,o,i,a){typeof i=="object"&&(a=i,i=void 0);var l={connection:e,delta:t,newParent:o,newParentIndex:i,hints:a||{}};this._commandStack.execute("connection.move",l)},be.prototype.layoutConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",o)},be.prototype.createConnection=function(e,t,o,i,a,l){typeof o=="object"&&(l=a,a=i,i=o,o=void 0),i=this._create("connection",i);var r={source:e,target:t,parent:a,parentIndex:o,connection:i,hints:l};return this._commandStack.execute("connection.create",r),r.connection},be.prototype.createShape=function(e,t,o,i,a){typeof i!="number"&&(a=i,i=void 0),a=a||{};var l=a.attach,r,s;e=this._create("shape",e),l?(r=o.parent,s=o):r=o;var d={position:t,shape:e,parent:r,parentIndex:i,host:s,hints:a};return this._commandStack.execute("shape.create",d),d.shape},be.prototype.createElements=function(e,t,o,i,a){Ne(e)||(e=[e]),typeof i!="number"&&(a=i,i=void 0),a=a||{};var l={position:t,elements:e,parent:o,parentIndex:i,hints:a};return this._commandStack.execute("elements.create",l),l.elements},be.prototype.createLabel=function(e,t,o,i){o=this._create("label",o);var a={labelTarget:e,position:t,parent:i||e.parent,shape:o};return this._commandStack.execute("label.create",a),a.shape},be.prototype.appendShape=function(e,t,o,i,a){a=a||{},t=this._create("shape",t);var l={source:e,position:o,target:i,shape:t,connection:a.connection,connectionParent:a.connectionParent,hints:a};return this._commandStack.execute("shape.append",l),l.shape},be.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},be.prototype.distributeElements=function(e,t,o){var i={groups:e,axis:t,dimension:o};this._commandStack.execute("elements.distribute",i)},be.prototype.removeShape=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",o)},be.prototype.removeConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",o)},be.prototype.replaceShape=function(e,t,o){var i={oldShape:e,newData:t,hints:o||{}};return this._commandStack.execute("shape.replace",i),i.newShape},be.prototype.alignElements=function(e,t){var o={elements:e,alignment:t};this._commandStack.execute("elements.align",o)},be.prototype.resizeShape=function(e,t,o,i){var a={shape:e,newBounds:t,minBounds:o,hints:i};this._commandStack.execute("shape.resize",a)},be.prototype.createSpace=function(e,t,o,i,a){var l={delta:o,direction:i,movingShapes:e,resizingShapes:t,start:a};this._commandStack.execute("spaceTool",l)},be.prototype.updateWaypoints=function(e,t,o){var i={connection:e,newWaypoints:t,hints:o||{}};this._commandStack.execute("connection.updateWaypoints",i)},be.prototype.reconnect=function(e,t,o,i,a){var l={connection:e,newSource:t,newTarget:o,dockingOrPoints:i,hints:a||{}};this._commandStack.execute("connection.reconnect",l)},be.prototype.reconnectStart=function(e,t,o,i){i||(i={}),this.reconnect(e,t,e.target,o,ie(i,{docking:"source"}))},be.prototype.reconnectEnd=function(e,t,o,i){i||(i={}),this.reconnect(e,e.source,t,o,ie(i,{docking:"target"}))},be.prototype.connect=function(e,t,o,i){return this.createConnection(e,t,o||{},e.parent,i)},be.prototype._create=function(e,t){return wp(t)?t:this._elementFactory.create(e,t)},be.prototype.toggleCollapse=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",o)};function wi(e){const t=e.businessObject;if(t)return t.name||""}function _h(e,t){const o=e.businessObject;return o.name=t,e}const jh={height:20},ns=15;function Vh(e){return["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(e.type)}function Th(e){return go(e.label)}function Nh(e){const t=e.length/2-1,o=e[Math.floor(t)],i=e[Math.ceil(t+.01)],a=$h(e),l=Math.atan((i.y-o.y)/(i.x-o.x));let{x:r,y:s}=a;return Math.abs(l)<Math.PI/2?s-=ns:r+=ns,{x:r,y:s}}function $h(e){const t=e.length/2-1,o=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:o.x+(i.x-o.x)/2,y:o.y+(i.y-o.y)/2}}function Mh(e){return e.waypoints?Nh(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+jh.height/2}}function go(e){return e&&!!e.labelTarget}const Lh={width:0,height:0};function os(e,t){function o(s,d){const c=s.label||s,f=s.labelTarget||s;return _h(c,d),[c,f]}function i(s){const{element:d,newLabel:c}=s,{businessObject:f}=d;if(!go(d)&&Vh(d)&&!Th(d)&&!is(c)){let p=Mh(d);p={x:p.x,y:p.y+7},e.createLabel(d,p,{id:f.id+"_label",businessObject:f})}}function a(s){return s.oldLabel=wi(s.element),o(s.element,s.newLabel)}function l(s){return o(s.element,s.oldLabel)}function r(s){const{element:d,newLabel:c}=s,f=d.label||d,u=s.hints||{};let{newBounds:p}=s;if(!go(f))return;if(go(f)&&is(c)){u.removeShape!==!1&&e.removeShape(f,{unsetLabel:!1});return}const h=wi(f);typeof p>"u"&&(p=t.getExternalLabelBounds(f,h)),p&&e.resizeShape(f,p,Lh)}this.preExecute=i,this.execute=a,this.revert=l,this.postExecute=r}os.$inject=["modeling","textRenderer"];function is(e){return!e||!e.trim()}function Nn(e,t,o){be.call(this,e,t,o)}xn(Nn,be),Nn.$inject=["eventBus","elementFactory","commandStack"],Nn.prototype.getHandlers=function(){const e=be.prototype.getHandlers.call(this);return e["element.updateLabel"]=os,e},Nn.prototype.updateLabel=function(e,t,o,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:o,hints:i||{}})};function vi(e,t){Fe.call(this,e);function o(i){const{context:a}=i,l=a.hints||{};let r;!a.cropped&&l.createElementsBehavior!==!1&&(r=a.connection,r.waypoints=t.getCroppedWaypoints(r),a.cropped=!0)}this.executed(["connection.layout","connection.create"],o)}xn(vi,Fe),vi.$inject=["eventBus","connectionDocking"];function as(){}as.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||tt(t.source||e.source),t.connectionEnd||tt(t.target||e.target)]};var yo=20,Ph=5,bo=Math.round,ls=20,Rh={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Ah(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function Oh(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function rs(e,t,o){var i=bn(t,e,Ph),a=o.split(":")[0],l=bo((t.x-e.x)/2+e.x),r=bo((t.y-e.y)/2+e.y),s,d,c=Oh(a,i),f=/h|r|l/.test(a),u=!1,p=!1;return c?(s=f?{x:l,y:e.y}:{x:e.x,y:r},d=f?"h:h":"v:v"):(u=Ah(i,a),d=f?"h:v":"v:h",u?f?(p=r===e.y,s={x:e.x+yo*(/l/.test(a)?-1:1),y:p?r+yo:r}):(p=l===e.x,s={x:p?l+yo:l,y:e.y+yo*(/t/.test(a)?-1:1)}):s={x:l,y:r}),{waypoints:Ci(e,s,d).concat(s),directions:d,turnNextDirections:p}}function Fh(e,t,o){return rs(e,t,o)}function Ih(e,t,o){var i=rs(t,e,ss(o));return{waypoints:i.waypoints.slice().reverse(),directions:ss(i.directions),turnNextDirections:i.turnNextDirections}}function zh(e,t){var o=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(o=o=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var a=o+":"+i,l=Ci(e.waypoints[e.waypoints.length-1],t.waypoints[0],a);return{waypoints:l,directions:a}}function ss(e){return e.split(":").reverse().join(":")}function Dh(e,t,o){var i=bo((t.x-e.x)/2+e.x),a=bo((t.y-e.y)/2+e.y);if(o==="h:v")return[{x:t.x,y:e.y}];if(o==="v:h")return[{x:e.x,y:t.y}];if(o==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(o==="v:v")return[{x:e.x,y:a},{x:t.x,y:a}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Ci(e,t,o){if(o=o||"h:h",!Xh(o))throw new Error("unknown directions: <"+o+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(ds(o)){var i=Fh(e,t,o),a=Ih(e,t,o),l=zh(i,a);return[].concat(i.waypoints,l.waypoints,a.waypoints)}return Dh(e,t,o)}function Hh(e,t,o){var i=Ci(e,t,o);return i.unshift(e),i.push(t),fs(i)}function Wh(e,t,o,i,a){var l=a&&a.preferredLayouts||[],r=Ku(l,"straight")[0]||"h:h",s=Rh[r]||0,d=bn(e,t,s),c=Kh(d,r);o=o||tt(e),i=i||tt(t);var f=c.split(":"),u=us(o,e,f[0],Zh(d)),p=us(i,t,f[1],d);return Hh(u,p,c)}function Uh(e,t,o,i,a,l){Ne(o)&&(a=o,l=i,o=tt(e),i=tt(t)),l=ie({preferredLayouts:[]},l),a=a||[];var r=l.preferredLayouts,s=r.indexOf("straight")!==-1,d;return d=s&&Yh(e,t,o,i,l),d||(d=l.connectionEnd&&Gh(t,e,i,a),d)||(d=l.connectionStart&&qh(e,t,o,a),d)?d:!l.connectionStart&&!l.connectionEnd&&a&&a.length?a:Wh(e,t,o,i,l)}function Jh(e,t,o){return e>=t&&e<=o}function cs(e,t,o){var i={x:"width",y:"height"};return Jh(t[e],o[e],o[e]+o[i[e]])}function Yh(e,t,o,i,a){var l={},r,s;return s=bn(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(r="x"),/left|right/.test(s)&&(r="y"),a.preserveDocking==="target"?cs(r,i,e)?(l[r]=i[r],[{x:l.x!==void 0?l.x:o.x,y:l.y!==void 0?l.y:o.y,original:{x:l.x!==void 0?l.x:o.x,y:l.y!==void 0?l.y:o.y}},{x:i.x,y:i.y}]):null:cs(r,o,t)?(l[r]=o[r],[{x:o.x,y:o.y},{x:l.x!==void 0?l.x:i.x,y:l.y!==void 0?l.y:i.y,original:{x:l.x!==void 0?l.x:i.x,y:l.y!==void 0?l.y:i.y}}]):null):null}function qh(e,t,o,i){return ki(e,t,o,i)}function Gh(e,t,o,i){var a=i.slice().reverse();return a=ki(e,t,o,a),a?a.reverse():null}function ki(e,t,o,i){function a(f){return f.length<3?!0:f.length>4?!1:!!gt(f,function(u,p){var h=f[p-1];return h&&Qo(u,h)<3})}function l(f,u,p){var h=Tl(u,f);switch(h){case"v":return{x:p.x,y:f.y};case"h":return{x:f.x,y:p.y}}return{x:f.x,y:f.y}}function r(f,u,p){var h;for(h=f.length-2;h!==0;h--)if(Nl(f[h],u,ls)||Nl(f[h],p,ls))return f.slice(h);return f}if(a(i))return null;var s=i[0],d=i.slice(),c;return d[0]=o,d[1]=l(d[1],s,o),c=r(d,e,t),c!==d&&(d=ki(e,t,o,c)),d&&Tl(d)?null:d}function Kh(e,t){if(ds(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function Xh(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function ds(e){return e&&/t|r|b|l/.test(e)}function Zh(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function us(e,t,o,i){if(o==="h"&&(o=/left/.test(i)?"l":"r"),o==="v"&&(o=/top/.test(i)?"t":"b"),o==="t")return{original:e,x:e.x,y:t.y};if(o==="r")return{original:e,x:t.x+t.width,y:e.y};if(o==="b")return{original:e,x:e.x,y:t.y+t.height};if(o==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+o+">")}function fs(e){return e.reduce(function(t,o,i){var a=t[t.length-1],l=e[i+1];return Af(a,l,o,0)||t.push(o),t},[])}function xi(){}xn(xi,as);const Ft=(e,t)=>e.type===t;xi.prototype.layoutConnection=function(e,t){t||(t={});const o=t.source||e.source,i=t.target||e.target,a=t.waypoints||e.waypoints;let{connectionStart:l,connectionEnd:r}=t,s,d;return r===void 0&&(l=wo(a&&a[0],o),r=wo(a&&a[a.length-1],i)),l||(l=wo(a&&a[0],o)),r||(r=wo(a&&a[a.length-1],i)),Ft(e,"myline")&&(o===i?s={preferredLayouts:Qh(o,e)}:Ft(o,"gatewayAnd")||Ft(o,"gatewayXor")||Ft(o,"gatewayInclusive")?s={preferredLayouts:["v:h"]}:Ft(i,"gatewayAnd")||Ft(i,"gatewayXor")||Ft(i,"gatewayInclusive")?s={preferredLayouts:["h:v"]}:s={preferredLayouts:["h:h"]}),s&&(s=Ke(s,t),d=fs(Uh(o,i,l,r,a,s))),d||[l,r]};function wo(e,t){return e?e.original||e:tt(t)}function Qh(e,t){const{waypoints:o}=t,i=o&&o.length&&bn(o[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function ps(e){return ie({original:e.point.original||e.point},e.actual)}function jt(e,t){this._elementRegistry=e,this._graphicsFactory=t}jt.$inject=["elementRegistry","graphicsFactory"],jt.prototype.getCroppedWaypoints=function(e,t,o){t=t||e.source,o=o||e.target;var i=this.getDockingPoint(e,t,!0),a=this.getDockingPoint(e,o),l=e.waypoints.slice(i.idx+1,a.idx);return l.unshift(ps(i)),l.push(ps(a)),l},jt.prototype.getDockingPoint=function(e,t,o){var i=e.waypoints,a,l,r;return a=o?0:i.length-1,l=i[a],r=this._getIntersection(t,e,o),{point:l,actual:r||l,idx:a}},jt.prototype._getIntersection=function(e,t,o){var i=this._getShapePath(e),a=this._getConnectionPath(t);return ap(i,a,o)},jt.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},jt.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},jt.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const em={__depends__:[sh,fh,no],__init__:["modeling","elementUpdater"],modeling:["type",Nn],layouter:["type",xi],elementUpdater:["type",vi],elementFactory:["type",At],connectionDocking:["type",jt]};function tm(e){return e.businessObject}function vo(e,t){return e.businessObject.strokeWidth||t||1}function Xe(e,t){return e.businessObject.fillColor||t||"var(--color-bg-container)"}function _e(e,t){return e.businessObject.strokeColor||t||"var(--color-text)"}function nm(e){const t=e.x+e.width/2,o=e.y+e.height/2,i=e.width/2,a=[["M",t,o],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return Pt(a)}function om(e,t){const{x:o,y:i,width:a,height:l}=e,r=[["M",o+t,i],["l",a-t*2,0],["a",t,t,0,0,1,t,t],["l",0,l-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-a,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-l],["a",t,t,0,0,1,t,-t],["z"]];return Pt(r)}function im(e){const{x:t,y:o,width:i,height:a}=e,l=i/2,r=a/2,s=[["M",t+l,o],["l",l,r],["l",-l,r],["l",-l,-r],["z"]];return Pt(s)}function am(e){const{x:t,y:o,width:i,height:a}=e,l=[["M",t,o],["l",i,0],["l",0,a],["l",-i,0],["z"]];return Pt(l)}const Si=10,Bi=.95,Vt=(e,t)=>e.type===t;function It(e,t,o,i,a,l,r){at.call(this,e,r);const s="var(--color-bg-container)",d="var(--color-text)",c={};Object.keys(l.palette).forEach(V=>{const x=l.palette[V];c[x.type]=x.options});const{computeStyle:f}=t;function u(V){return R[V]}function p(V){return t.computeStyle(V,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2})}function h(V){return t.computeStyle(V,{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2,fill:"white"})}function m(V,x,L,P){L=p(L);const G=Ko(x,L,P);return Ee(V,G),G}function g(V,x,L){return m(V,x,L,5)}function b(V,x,L,P,G){zr(P)&&(G=P,P=0),P=P||0,G=f(G,{stroke:d,strokeWidth:2,fill:s}),G.fill==="none"&&delete G.fillOpacity;const K=x/2,ne=L/2,pe=Se("circle");return ce(pe,{cx:K,cy:ne,r:Math.round((x+L)/4-P)}),ce(pe,G),Ee(V,pe),pe}function k(V,x,L,P,G,K){zr(G)&&(K=G,G=0),G=G||0,K=f(K,{stroke:d,strokeWidth:2,fill:s});const ne=Se("rect");return ce(ne,{x:G,y:G,width:x-G*2,height:L-G*2,rx:P,ry:P}),ce(ne,K),Ee(V,ne),ne}function v(V,x,L){L=f(L,["no-fill"],{strokeWidth:2,stroke:d});const P=Se("path");return ce(P,{d:x}),ce(P,L),Ee(V,P),P}function w(V,x,L,P){const G=x/2,K=L/2,pe=[{x:G,y:0},{x,y:K},{x:G,y:L},{x:0,y:K}].map(Y=>Y.x+","+Y.y).join(" ");P=f(P,{stroke:d,strokeWidth:2,fill:s});const fe=Se("polygon");return ce(fe,{points:pe}),ce(fe,P),Ee(V,fe),fe}function C(V,x,L,P){return v(x,L,Ke({"data-marker":V},P))}function S(V,x,L){L=Ke({size:{width:100}},L);const P=a.createText(x||"",L);return Ge(P).add("djs-label"),Ee(V,P),P}function y(V,x,L){const P=tm(x);return S(V,P.name,{box:x,align:L,padding:5,style:{fill:_e(x,d)}})}function E(V,x){const L={width:90,height:30,x:x.width/2+x.x,y:x.height/2+x.y};return S(V,wi(x),{box:L,fitBox:!0,style:Ke({},a.getExternalStyle(),{fill:_e(x,d)})})}function B(V,x,L){const P=L&&L.indexOf("SubProcessMarker")!==-1;let G;P?G={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:G={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},ph(L,K=>{u(K)(V,x,G)})}function _(V){return V.replace(/[^0-9a-zA-z]+/g,"_")}function T(V,x){const{ref:L={x:0,y:0},scale:P=1,element:G,parentGfx:K=i._svg}=x,ne=Se("marker",{id:V,viewBox:"0 0 20 20",refX:L.x,refY:L.y,markerWidth:20*P,markerHeight:20*P,orient:"auto"});Ee(ne,G);let pe=mn(":scope > defs",K);pe||(pe=Se("defs"),Ee(K,pe)),Ee(pe,ne)}function j(V,x,L,P){const G=x+"-"+_(L)+"-"+_(P)+"-"+Fr();return D(V,G,x,L,P),"url(#"+G+")"}function D(V,x,L,P,G){{const K=Se("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:G,stroke:G,strokeWidth:1})});T(x,{element:K,ref:{x:11,y:10},scale:.5,parentGfx:V})}}function A(V,x,L,P){const G=c[x.type]?.icon||x.icon;if(G){const K=o.getScaledPath(G,{abspos:{x:L,y:P}});v(V,K,{strokeWidth:0,fill:_e(x,c[x.type]?.iconFill||x.iconFill)})}}const R={event(V,x,L){return"fillOpacity"in L||(L.fillOpacity=Bi),b(V,x.width,x.height,L)},startEvent(V,x){const L={fill:Xe(x,c.startEvent?.fill||x.fill),stroke:_e(x,c.startEvent?.stroke||x.stroke),strokeWidth:vo(x,c.startEvent?.strokeWidth||x.strokeWidth)},P=u("event")(V,x,L);return A(V,x,18,18),P},endEvent(V,x){const L=u("event")(V,x,{strokeWidth:vo(x,c.endEvent?.strokeWidth||x.strokeWidth||4),fill:Xe(x,c.endEvent?.fill||x.fill),stroke:_e(x,c.endEvent?.stroke||x.stroke)});return A(V,x,18,18),L},gateway(V,x){const L={fillOpacity:Bi,strokeWidth:vo(x,c[x.type]?.strokeWidth||x.strokeWidth||4),fill:Xe(x,c[x.type]?.fill||x.fill),stroke:_e(x,c[x.type]?.stroke||x.stroke)};return w(V,x.width,x.height,L)},gatewayAnd(V,x){const L=u("gateway")(V,x),P=o.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:c[x.type]?.width||x.width,containerHeight:c[x.type]?.height||x.height,position:{mx:.47,my:.29}});return v(V,P,{strokeWidth:1,fill:_e(x,c[x.type]?.iconFill||x.iconFill),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},gatewayXor(V,x){const L=u("gateway")(V,x),P=o.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.32,my:.3}});return v(V,P,{strokeWidth:1,fill:_e(x,c[x.type]?.iconFill||x.iconFill),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},gatewayInclusive(V,x){const L=u("gateway")(V,x);return b(V,x.width,x.height,x.height*.24,{strokeWidth:2.5,fill:_e(x,s),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},activity(V,x,L){return L=L||{},"fillOpacity"in L||(L.fillOpacity=Bi),k(V,x.width,x.height,Si,L)},task(V,x){const L={fill:Xe(x,s),stroke:_e(x,d)},P=u("activity")(V,x,L);return y(V,x,"center-middle"),B(V,x),P},userTask(V,x){const L=u("task")(V,x),P=15,G=12,K=o.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:P,y:G}});v(V,K,{strokeWidth:.5,fill:Xe(x,s),stroke:_e(x,d)});const ne=o.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:P,y:G}});v(V,ne,{strokeWidth:.5,fill:Xe(x,s),stroke:_e(x,d)});const pe=o.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:P,y:G}});return v(V,pe,{strokeWidth:.5,fill:_e(x,d),stroke:_e(x,d)}),L},scriptTask(V,x){const L=u("task")(V,x),P=o.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return v(V,P,{strokeWidth:1,stroke:_e(x,d)}),L},SubProcessMarker(V,x){const L=k(V,14,14,0,{strokeWidth:1,fill:Xe(x,s),stroke:_e(x,d)});Zn(L,x.width/2-7.5,x.height-20);const P=o.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2-7.5)/x.width,my:(x.height-20)/x.height}});C("sub-process",V,P,{fill:Xe(x,s),stroke:_e(x,d)})},subprocess(V,x,L){L=Ke({fill:Xe(x,s),stroke:_e(x,d)},L);const P=u("activity")(V,x,L);return y(V,x,"center-middle"),B(V,x,["SubProcessMarker"]),P},label(V,x){return E(V,x)},myline(V,x){const L=Xe(x,l.lineStroke||s),P=_e(x,l.lineStroke||d);return g(V,x.waypoints,{markerEnd:j(V,"sequenceflow-end",L,P),stroke:P})},default(V,x){const L={strokeWidth:vo(x,c[x.type]?.strokeWidth||x.strokeWidth||1),fill:Xe(x,c[x.type]?.fill||x.fill),stroke:_e(x,c[x.type]?.stroke||x.stroke)},P=k(V,x.width,x.height,x.radius||Si,L);return y(V,x,"center-middle"),B(V,x),A(V,x,x.iconX,x.iconY),P}};this.handlers=R,this._drawPath=v}xn(It,at),It.$inject=["eventBus","styles","pathMap","canvas","textRenderer","myOptions"],It.prototype.canRender=function(){return!0},It.prototype.drawShape=function(e,t){const{type:o}=t;return(this.handlers[o]||this.handlers.default)(e,t)},It.prototype.drawConnection=function(e,t){const{type:o}=t,i=this.handlers[o];return i(e,t)},It.prototype.getShapePath=function(e){return Vt(e,"startEvent")||Vt(e,"endEvent")?nm(e):Vt(e,"userTask")||Vt(e,"scriptTask")||Vt(e,"subprocess")?om(e,Si):Vt(e,"gatewayAnd")||Vt(e,"gatewayXor")||Vt(e,"gatewayInclusive")?im(e):am(e)};var lm=0,rm={width:150,height:50};function sm(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function cm(e){return ht(e)?ie({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function dm(e,t){t.textContent=e;var o;try{var i,a=e==="";return t.textContent=a?"dummy":e,o=t.getBBox(),i={width:o.width+o.x*2,height:o.height},a&&(i.width=0),i}catch(l){return console.log(l),{width:0,height:0}}}function um(e,t,o){for(var i=e.shift(),a=i,l;;){if(l=dm(a,o),l.width=a?l.width:0,a===" "||a===""||l.width<Math.round(t)||a.length<2)return fm(e,a,i,l);a=hm(a,l.width,t)}}function fm(e,t,o,i){if(t.length<o.length){var a=o.slice(t.length).trim();e.unshift(a)}return{width:i.width,height:i.height,text:t}}var hs="­";function pm(e,t){var o=e.split(/(\s|-|\u00AD)/g),i,a=[],l=0;if(o.length>1)for(;i=o.shift();)if(i.length+l<t)a.push(i),l+=i.length;else{(i==="-"||i===hs)&&a.pop();break}var r=a[a.length-1];return r&&r===hs&&(a[a.length-1]="-"),a.join("")}function hm(e,t,o){var i=Math.max(e.length*(o/t),1),a=pm(e,i);return a||(a=e.slice(0,Math.max(Math.round(i-1),1))),a}function mm(){var e=document.getElementById("helper-svg");return e||(e=Se("svg"),ce(e,{id:"helper-svg"}),Bl(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function Co(e){this._config=ie({},{size:rm,padding:lm,style:{},align:"center-top"},e||{})}Co.prototype.createText=function(e,t){return this.layoutText(e,t).element},Co.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Co.prototype.layoutText=function(e,t){var o=ie({},this._config.size,t.box),i=ie({},this._config.style,t.style),a=sm(t.align||this._config.align),l=cm(t.padding!==void 0?t.padding:this._config.padding),r=t.fitBox||!1,s=gm(i),d=e.split(/\u00AD?\r?\n/),c=[],f=o.width-l.left-l.right,u=Se("text");ce(u,{x:0,y:0}),ce(u,i);var p=mm();for(Ee(p,u);d.length;)c.push(um(d,f,u));a.vertical==="middle"&&(l.top=l.bottom=0);var h=en(c,function(v,w,C){return v+(s||w.height)},0)+l.top+l.bottom,m=en(c,function(v,w,C){return w.width>v?w.width:v},0),g=l.top;a.vertical==="middle"&&(g+=(o.height-h)/2),g-=(s||c[0].height)/4;var b=Se("text");ce(b,i),Z(c,function(v){var w;switch(g+=s||v.height,a.horizontal){case"left":w=l.left;break;case"right":w=(r?m:f)-l.right-v.width;break;default:w=Math.max(((r?m:f)-v.width)/2+l.left,0)}var C=Se("tspan");ce(C,{x:w,y:g}),C.textContent=v.text,Ee(b,C)}),Lt(u);var k={width:m,height:h};return{dimensions:k,element:b}};function gm(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}const ym=12,bm=1.2,wm=30;function ms(e){const t=Ke({fontFamily:"Arial, sans-serif",fontSize:ym,fontWeight:"normal",lineHeight:bm},e&&e.defaultStyle||{}),o=parseInt(t.fontSize,10)-1,i=Ke({},t,{fontSize:o},e&&e.externalStyle||{}),a=new Co({style:t});this.getExternalLabelBounds=function(l,r){const s=a.getDimensions(r,{box:{width:90,height:30,x:l.width/2+l.x,y:l.height/2+l.y},style:i});return{x:Math.round(l.x+l.width/2-s.width/2),y:Math.round(l.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(l,r){const s=a.getDimensions(r,{box:l,style:t,align:"left-top",padding:5});return{x:l.x,y:l.y,width:l.width,height:Math.max(wm,Math.round(s.height))}},this.createText=function(l,r){return a.createText(l,r||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ms.$inject=["config.textRenderer"];function vm(){this.pathMap={GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,o){let i,a;o.abspos?(i=o.abspos.x,a=o.abspos.y):(i=o.containerWidth*o.position.mx,a=o.containerHeight*o.position.my);let l={};typeof t=="object"?(l=t,l.d.indexOf("{mx},{my}")===-1&&(l.d="m {mx},{my}"+l.d),l.width&&(i-=l.width/2),l.height&&(a-=l.height/2)):l=this.pathMap[t];const r={};if(o.position){const d=o.containerHeight/l.height*o.yScaleFactor,c=o.containerWidth/l.width*o.xScaleFactor;for(let f=0;f<l.heightElements.length;f++)r["y"+f]=l.heightElements[f]*d;for(let f=0;f<l.widthElements.length;f++)r["x"+f]=l.widthElements[f]*c}return Sm(l.d,{mx:i,my:a,e:r})}}const Cm=/\{([^}]+)\}/g,km=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function xm(e,t,o){let i=o;return t.replace(km,(a,l,r,s,d)=>{l=l||s,i&&(l in i&&(i=i[l]),typeof i=="function"&&d&&(i=i()))}),i=(i==null||i===o?e:i)+"",i}function Sm(e,t){return String(e).replace(Cm,(o,i)=>xm(o,i,t))}const Bm={__init__:["myRenderer"],myRenderer:["type",It],textRenderer:["type",ms],pathMap:["type",vm]};function gs(e,t){return Ke({id:e.id,type:e.type,businessObject:e},t)}function Em(e,t,o){const i=e.waypoint;return!i||i.length<2?[tt(t),tt(o)]:i.map(a=>({x:a.x,y:a.y}))}function Tt(e,t,o,i,a,l){this._eventBus=e,this._canvas=o,this._elementFactory=i,this._elementRegistry=a,this._translate=Ir,this._textRenderer=l,this._modeling=t}Tt.$inject=["eventBus","modeling","canvas","elementFactory","elementRegistry","textRenderer"],Tt.prototype.add=function(e){let t;const{label:o}=e;if(o&&(o.id=e.id,o.name=e.name,delete e.label),e.type==="myline"){const i=this._getSource(e),a=this._getTarget(e);t=this._elementFactory.createConnection(gs(e,{source:i,target:a,waypoints:Em(e,i,a)})),this._canvas.addConnection(t)}else{const i=this._elementFactory._getDefaultSize(e.type);t=this._elementFactory.createShape(gs(e,{x:Math.round(e.x),y:Math.round(e.y),width:i.width,height:i.height,isFrame:!1})),this._canvas.addShape(t)}return o&&t&&this.addLabel(o,t),t},Tt.prototype.addLabel=function(e,t){const o=this._elementFactory.createLabel({id:e.id+"_label",labelTarget:t,type:"label",x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),businessObject:e});return this._canvas.addShape(o,t.parent)},Tt.prototype.update=function(e,t){const o=this._elementRegistry.get(e);o.businessObject=Ke(o.businessObject,t),t.type==="myline"?(this._canvas.removeConnection(o),this._canvas.addConnection(o,o.parent)):(this._canvas.removeShape(o),this._canvas.addShape(o,o.parent));const i=this._elementRegistry.get(e+"_label");if(i)i.businessObject=o.businessObject,this._canvas.removeShape(i),this._canvas.addShape(i,o.parent);else{const{name:a}=t;if(a&&["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(t.type)){const l={x:t.x+12,y:t.y+42,width:10,height:10,name:a,id:e},r=this._textRenderer.getExternalLabelBounds(l,t.name);this._modeling.resizeShape(l,r,{width:0,height:0}),o&&this.addLabel(l,o)}}},Tt.prototype._getSource=function(e){return this._getElement(e.from)},Tt.prototype._getTarget=function(e){return this._getElement(e.to)},Tt.prototype._getElement=function(e){return this._elementRegistry.get(e)};const _m={myImporter:["type",Tt]},jm=e=>{const t=[];return e.forEach(o=>{if(o.type!==void 0){const i=o.businessObject;if(o.type==="myline")o.source&&o.target&&(i.from=o.source.id,i.to=o.target.id,i.waypoint=o.waypoints.map(a=>({x:a.x,y:a.y})),t.push(i));else if(o.type!=="label")i.x=o.x,i.y=o.y,t.push(i);else{const a=t.find(l=>l.id===i.id);a&&(a.name=i.name||"",a.label={x:o.x,y:o.y,height:o.height,width:o.width})}}}),t},Vm=(e,t)=>{const o=t.get("myImporter"),i=e.filter(l=>l.type!=="myline"),a=e.filter(l=>l.type==="myline");i.forEach(l=>{o.add(l)}),a.forEach(l=>{o.add(l)})},ys=te(n.defineComponent({name:"JWorkflowViewer",__name:"workflow-viewer",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let s,d=1;const c=()=>{d=1,s.get("canvas").zoom("fit-viewport")},f=()=>{const y=s.get("eventBus");y.on("element.dblclick",E=>{a("elementDblclick",E.element.businessObject)}),y.on("element.click",E=>{a("elementClick",E.element.businessObject)})},u=function(){return{palette:i.paletteOptions||r,lineStroke:i.lineStroke}},p=()=>{let y={__init__:["myOptions"],myOptions:["type",u]};s=new Cn({canvas:{container:l.value},modules:[Qp,Kp,em,nh,rh,y,Bm,_m]});const E=s.get("canvas"),B=s.get("elementFactory");c();const _=B.createRoot();E.setRootElement(_),f()};n.onMounted(()=>{p()});const h=y=>{const E=y==null?1:d+y;s.get("canvas").zoom(E),d=E},m=()=>{s.get("canvas").zoom(1);const y=s.get("elementRegistry").getAll();var E=jm(y);return E},g=y=>{s.clear(),c(),Vm(y,s)},b=y=>{s.get("myImporter").update(y.id,y)};return t({reset:()=>{c()},zoom:y=>{h(y)},getData:()=>m(),setData:y=>{g(y)},updateElemet:y=>{b(y)}}),(y,E)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:l,class:"lr-work-flow"},null,512))}})),Tm=[Li,na,oa,ia,aa,la,ra,sa,ca,da,ua,ma,ga,ya,ba,wa,va,Ca,ka,xa,Ba,_a,ja,Oa,Va,Ta,Na,$a,Ma,La,Pa,Ra,Aa,Za,Qa,el,tl,nl,ol,il,Fa,Ga,Xa,al,ll,rl,sl,cl,dl,Fu,ys],Nm={install:e=>{Tm.forEach(t=>{e.component(t.name,t)})}};M.EncryptionFactory=Qi,M.HashingFactory=nc,M.JAutoComplete=da,M.JBarcode=ja,M.JButton=Li,M.JButtonSelect=Za,M.JButtons=na,M.JCascaderSelect=ra,M.JCheckbox=sa,M.JCodeMirror=Oa,M.JCollapse=cl,M.JComp=el,M.JCount=Va,M.JCountUp=Ta,M.JDataPanel=Na,M.JDialog=ga,M.JDialogFull=ya,M.JDivider=$a,M.JDrawer=ba,M.JDynamicLayer=va,M.JEcharts=_a,M.JEditor=dl,M.JForm=tl,M.JFormItem=nl,M.JGuid=il,M.JHpanel=Ma,M.JIcon=ia,M.JInput=oa,M.JInputButton=La,M.JInputCode=Pa,M.JInputColor=Ra,M.JInputRows=al,M.JInputTag=Ca,M.JLayer=wa,M.JLayerForm=ll,M.JLayout=ua,M.JMenu=Ga,M.JNumber=ca,M.JPage=ol,M.JRadio=aa,M.JRate=ka,M.JSelect=la,M.JSlider=xa,M.JSliderCaptcha=Fa,M.JSwitch=rl,M.JTable=ma,M.JTablePanel=Xa,M.JTabs=sl,M.JTitle=Aa,M.JTree=Qa,M.JUpload=Ba,M.JWorkflowViewer=ys,M.buildShortUUID=Pn,M.buildUUID=dn,M.clearJson=cn,M.clone=Ln,M.deepClone=pt,M.default=Nm,M.formatToDate=pn,M.formatToDateTime=qi,M.fullScreenLoading=Ht,M.getCompConfig=$t,M.getCompType=No,M.getFunction=Vo,M.getIsInputComp=Rn,M.getIsTableInputComp=Ji,M.getLabel=Yi,M.getObjType=Pi,M.getTextWidth=fn,M.is=Mi,M.isArray=Mn,M.isNullOrEmpty=it,M.isObject=Ds,M.loadBMap=ta,M.lowerFirst=qs,M.myAesDecrypt=oc,M.numberToChinese=Ai,M.numberToThousandSeparator=Oi,M.pagination=Us,M.paginationEx=Js,M.set=Ri,M.setGroupMap=Ii,M.toArray=Di,M.toDecimal=un,M.toLeafArray=Ui,M.toSimpleTree=Ks,M.toTree=Gs,M.uniqueArray=Ys,M.upFirst=Fi,M.useSortable=ea,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));