@archbiz/element-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@archbiz/core-v2"),w=require("@archbiz/utils");var Ur=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-select",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-select",e.$attrs,!1),[e._l(e.options,function(n,i){return[e.hasGroup(n)?r("el-option-group",{key:`group-${i}-${n.label}`,attrs:{label:n.label}},e._l(e.trueArray(n.options),function(s,o){return r("el-option",e._b({key:`group-${i}-${o}-${s.value}`},"el-option",s,!1))}),1):[e.showValue?r("el-option",{key:`${i}-${n.value}`,class:n.class,attrs:{label:n.label,value:n.value}},[r("span",{staticClass:"p-option__left"},[e._v(e._s(n.label))]),r("span",{staticClass:"p-option__right"},[e._v(e._s(n.value))])]):e.showKey||e.showCode?r("el-option",{key:`${i}-${n.value}`,class:n.class,attrs:{label:n.label,value:n.value}},[r("span",{staticClass:"p-option__left"},[e._v(e._s(n.label))]),e.showKey?r("span",{staticClass:"p-option__right"},[e._v(e._s(n.key))]):e._e(),e.showCode?r("span",{staticClass:"p-option__right"},[e._v(e._s(n.code))]):e._e()]):r("el-option",{key:`${i}-${n.value}`,attrs:{label:n.label,value:n.value}})]]}),e._t("default")],2)},Wr=[];function _(e,t,r,n,i,s,o,l){var a=typeof e=="function"?e.options:e;t&&(a.render=t,a.staticRenderFns=r,a._compiled=!0),n&&(a.functional=!0),s&&(a._scopeId="data-v-"+s);var u;if(o?(u=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__<"u"&&(f=__VUE_SSR_CONTEXT__),i&&i.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(o)},a._ssrRegister=u):i&&(u=l?function(){i.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(a.functional){a._injectStyles=u;var c=a.render;a.render=function(p,h){return u.call(h),c(p,h)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:a}}const Gr={name:"AbSelect",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String,showValue:Boolean,showKey:{type:Boolean,default:!0},showCode:{type:Boolean,default:!0}},computed:{options(){const e=this.abFormInject&&this.abFormInject.options;return Array.isArray(e)?e:[]},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},mounted(){this.$emit("fc.el",this.$refs.el)},methods:{hasGroup(e){return!!e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"options")},trueArray(e){return Array.isArray(e)?e:[]},handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},nt={};var Qr=_(Gr,Ur,Wr,!1,Jr,null,null,null);function Jr(e){for(let t in nt)this[t]=nt[t]}const Vt=function(){return Qr.exports}();var Xr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-radio-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-radio-group",e.$attrs,!1),[e._l(e.optionsList,function(n,i){var s,o,l,a;return[e.type==="button"?r("el-radio-button",e._b({key:`button-${i}-${n.value}`,attrs:{label:n.value}},"el-radio-button",e.optionProps(n),!1),[e._v(" "+e._s((s=(o=n.label)!==null&&o!==void 0?o:n.value)!==null&&s!==void 0?s:"")+" ")]):r("el-radio",e._b({key:`radio-${i}-${n.value}`,attrs:{label:n.value}},"el-radio",e.optionProps(n),!1),[e._v(" "+e._s((l=(a=n.label)!==null&&a!==void 0?a:n.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},Zr=[];const en={name:"AbRadio",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[String,Number,Boolean],default:void 0},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const{value:t,label:r,...n}=e||{};return n},handleInput(e){this.$emit("input",e)}}},it={};var tn=_(en,Xr,Zr,!1,rn,null,null,null);function rn(e){for(let t in it)this[t]=it[t]}const nn=function(){return tn.exports}();var sn=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-checkbox-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-checkbox-group",e.$attrs,!1),[e._l(e.optionsList,function(n,i){var s,o,l,a;return[e.type==="button"?r("el-checkbox-button",e._b({key:`button-${i}-${n.value}`,attrs:{label:n.value}},"el-checkbox-button",e.optionProps(n),!1),[e._v(" "+e._s((s=(o=n.label)!==null&&o!==void 0?o:n.value)!==null&&s!==void 0?s:"")+" ")]):r("el-checkbox",e._b({key:`checkbox-${i}-${n.value}`,attrs:{label:n.value}},"el-checkbox",e.optionProps(n),!1),[e._v(" "+e._s((l=(a=n.label)!==null&&a!==void 0?a:n.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},on=[];const an={name:"AbCheckbox",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const{value:t,label:r,...n}=e||{};return n},handleInput(e){this.$emit("input",e)}}},st={};var ln=_(an,sn,on,!1,cn,null,null,null);function cn(e){for(let t in st)this[t]=st[t]}const un=function(){return ln.exports}();/**
1
+ "use strict";var tr=Object.defineProperty,nr=Object.defineProperties;var rr=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var ut=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var ct=(e,t,n)=>t in e?tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))ut.call(t,n)&&ct(e,n,t[n]);if(he)for(var n of he(t))dt.call(t,n)&&ct(e,n,t[n]);return e},g=(e,t)=>nr(e,rr(t));var me=(e,t)=>{var n={};for(var r in e)ut.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&he)for(var r of he(e))t.indexOf(r)<0&&dt.call(e,r)&&(n[r]=e[r]);return n};var P=(e,t,n)=>new Promise((r,i)=>{var s=a=>{try{l(n.next(a))}catch(c){i(c)}},o=a=>{try{l(n.throw(a))}catch(c){i(c)}},l=a=>a.done?r(a.value):Promise.resolve(a.value).then(s,o);l((n=n.apply(e,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@archbiz/core-v2"),F=require("@archbiz/utils");var ir=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-select",e.$attrs,!1),[e._l(e.options,function(r,i){return[e.hasGroup(r)?n("el-option-group",{key:`group-${i}-${r.label}`,attrs:{label:r.label}},e._l(e.trueArray(r.options),function(s,o){return n("el-option",e._b({key:`group-${i}-${o}-${s.value}`},"el-option",s,!1))}),1):[e.showValue?n("el-option",{key:`${i}-${r.value}`,class:r.class,attrs:{label:r.label,value:r.value}},[n("span",{staticClass:"p-option__left"},[e._v(e._s(r.label))]),n("span",{staticClass:"p-option__right"},[e._v(e._s(r.value))])]):e.showKey||e.showCode?n("el-option",{key:`${i}-${r.value}`,class:r.class,attrs:{label:r.label,value:r.value}},[n("span",{staticClass:"p-option__left"},[e._v(e._s(r.label))]),e.showKey?n("span",{staticClass:"p-option__right"},[e._v(e._s(r.key))]):e._e(),e.showCode?n("span",{staticClass:"p-option__right"},[e._v(e._s(r.code))]):e._e()]):n("el-option",{key:`${i}-${r.value}`,attrs:{label:r.label,value:r.value}})]]}),e._t("default")],2)},sr=[];function $(e,t,n,r,i,s,o,l){var a=typeof e=="function"?e.options:e;t&&(a.render=t,a.staticRenderFns=n,a._compiled=!0),r&&(a.functional=!0),s&&(a._scopeId="data-v-"+s);var c;if(o?(c=function(d){d=d||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!d&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(d=__VUE_SSR_CONTEXT__),i&&i.call(this,d),d&&d._registeredComponents&&d._registeredComponents.add(o)},a._ssrRegister=c):i&&(c=l?function(){i.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(a.functional){a._injectStyles=c;var u=a.render;a.render=function(y,h){return c.call(h),u(y,h)}}else{var f=a.beforeCreate;a.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:a}}const or={name:"AbSelect",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String,showValue:Boolean,showKey:{type:Boolean,default:!0},showCode:{type:Boolean,default:!0}},computed:{options(){const e=this.abFormInject&&this.abFormInject.options;return Array.isArray(e)?e:[]},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},mounted(){this.$emit("fc.el",this.$refs.el)},methods:{hasGroup(e){return!!e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"options")},trueArray(e){return Array.isArray(e)?e:[]},handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},ft={};var ar=$(or,ir,sr,!1,lr,null,null,null);function lr(e){for(let t in ft)this[t]=ft[t]}const en=function(){return ar.exports}();var cr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-radio-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-radio-group",e.$attrs,!1),[e._l(e.optionsList,function(r,i){var s,o,l,a;return[e.type==="button"?n("el-radio-button",e._b({key:`button-${i}-${r.value}`,attrs:{label:r.value}},"el-radio-button",e.optionProps(r),!1),[e._v(" "+e._s((s=(o=r.label)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:"")+" ")]):n("el-radio",e._b({key:`radio-${i}-${r.value}`,attrs:{label:r.value}},"el-radio",e.optionProps(r),!1),[e._v(" "+e._s((l=(a=r.label)!==null&&a!==void 0?a:r.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},ur=[];const dr={name:"AbRadio",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[String,Number,Boolean],default:void 0},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const i=e||{},{value:t,label:n}=i;return me(i,["value","label"])},handleInput(e){this.$emit("input",e)}}},pt={};var fr=$(dr,cr,ur,!1,pr,null,null,null);function pr(e){for(let t in pt)this[t]=pt[t]}const hr=function(){return fr.exports}();var mr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-checkbox-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-checkbox-group",e.$attrs,!1),[e._l(e.optionsList,function(r,i){var s,o,l,a;return[e.type==="button"?n("el-checkbox-button",e._b({key:`button-${i}-${r.value}`,attrs:{label:r.value}},"el-checkbox-button",e.optionProps(r),!1),[e._v(" "+e._s((s=(o=r.label)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:"")+" ")]):n("el-checkbox",e._b({key:`checkbox-${i}-${r.value}`,attrs:{label:r.value}},"el-checkbox",e.optionProps(r),!1),[e._v(" "+e._s((l=(a=r.label)!==null&&a!==void 0?a:r.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},yr=[];const gr={name:"AbCheckbox",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const i=e||{},{value:t,label:n}=i;return me(i,["value","label"])},handleInput(e){this.$emit("input",e)}}},ht={};var br=$(gr,mr,yr,!1,_r,null,null,null);function _r(e){for(let t in ht)this[t]=ht[t]}const vr=function(){return br.exports}();/**
2
2
  * (c) Iconify
3
3
  *
4
4
  * For the full copyright and license information, please view the license.txt or license.gpl.txt
@@ -8,5 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  * @version 3.1.1
11
- */const Ut=Object.freeze({left:0,top:0,width:16,height:16}),be=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ne=Object.freeze({...Ut,...be}),Be=Object.freeze({...ne,body:"",hidden:!1});function dn(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}function ot(e,t){const r=dn(e,t);for(const n in Be)n in be?n in e&&!(n in r)&&(r[n]=be[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function fn(e,t){const r=e.icons,n=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(r[o])return i[o]=[];if(!(o in i)){i[o]=null;const l=n[o]&&n[o].parent,a=l&&s(l);a&&(i[o]=[l].concat(a))}return i[o]}return(t||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function pn(e,t,r){const n=e.icons,i=e.aliases||Object.create(null);let s={};function o(l){s=ot(n[l]||i[l],s)}return o(t),r.forEach(o),ot(e,s)}function Wt(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),r.push(i)});const n=fn(e);for(const i in n){const s=n[i];s&&(t(i,pn(e,i,s)),r.push(i))}return r}const W=/^[a-z0-9]+(-[a-z0-9]+)*$/,q=(e,t,r,n="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),a=i.pop(),u={provider:i.length>0?i[0]:n,prefix:a,name:l};return t&&!pe(u)?null:u}const s=i[0],o=s.split("-");if(o.length>1){const l={provider:n,prefix:o.shift(),name:o.join("-")};return t&&!pe(l)?null:l}if(r&&n===""){const l={provider:n,prefix:"",name:s};return t&&!pe(l,r)?null:l}return null},pe=(e,t)=>e?!!((e.provider===""||e.provider.match(W))&&(t&&e.prefix===""||e.prefix.match(W))&&e.name.match(W)):!1,hn={provider:"",aliases:{},not_found:{},...Ut};function Ae(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Gt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Ae(e,hn))return null;const r=t.icons;for(const i in r){const s=r[i];if(!i.match(W)||typeof s.body!="string"||!Ae(s,Be))return null}const n=t.aliases||Object.create(null);for(const i in n){const s=n[i],o=s.parent;if(!i.match(W)||typeof o!="string"||!r[o]&&!n[o]||!Ae(s,Be))return null}return t}const ge=Object.create(null);function mn(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function F(e,t){const r=ge[e]||(ge[e]=Object.create(null));return r[t]||(r[t]=mn(e,t))}function Je(e,t){return Gt(t)?Wt(t,(r,n)=>{n?e.icons[r]=n:e.missing.add(r)}):[]}function bn(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}function gn(e,t){let r=[];return(typeof e=="string"?[e]:Object.keys(ge)).forEach(i=>{(typeof i=="string"&&typeof t=="string"?[t]:Object.keys(ge[i]||{})).forEach(o=>{const l=F(i,o);r=r.concat(Object.keys(l.icons).map(a=>(i!==""?"@"+i+":":"")+o+":"+a))})}),r}let X=!1;function yn(e){return typeof e=="boolean"&&(X=e),X}function ie(e){const t=typeof e=="string"?q(e,!0,X):e;if(t){const r=F(t.provider,t.prefix),n=t.name;return r.icons[n]||(r.missing.has(n)?null:void 0)}}function Qt(e,t){const r=q(e,!0,X);if(!r)return!1;const n=F(r.provider,r.prefix);return bn(n,r.name,t)}function Jt(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),X&&!t&&!e.prefix){let i=!1;return Gt(e)&&(e.prefix="",Wt(e,(s,o)=>{o&&Qt(s,o)&&(i=!0)})),i}const r=e.prefix;if(!pe({provider:t,prefix:r,name:"a"}))return!1;const n=F(t,r);return!!Je(n,e)}function _n(e){return!!ie(e)}function vn(e){const t=ie(e);return t?{...ne,...t}:null}const Xt=Object.freeze({width:null,height:null}),Zt=Object.freeze({...Xt,...be}),xn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,wn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ze(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const n=e.split(xn);if(n===null||!n.length)return e;const i=[];let s=n.shift(),o=wn.test(s);for(;;){if(o){const l=parseFloat(s);isNaN(l)?i.push(s):i.push(Math.ceil(l*t*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");o=!o}}const $n=e=>e==="unset"||e==="undefined"||e==="none";function we(e,t){const r={...ne,...e},n={...Zt,...t},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(h=>{const b=[],y=h.hFlip,z=h.vFlip;let $=h.rotate;y?z?$+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):z&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let S;switch($<0&&($-=Math.floor($/4)*4),$=$%4,$){case 1:S=i.height/2+i.top,b.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,b.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}$%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),b.length&&(s='<g transform="'+b.join(" ")+'">'+s+"</g>")});const o=n.width,l=n.height,a=i.width,u=i.height;let c,d;o===null?(d=l===null?"1em":l==="auto"?u:l,c=ze(d,a/u)):(c=o==="auto"?a:o,d=l===null?ze(c,u/a):l==="auto"?u:l);const f={},p=(h,b)=>{$n(b)||(f[h]=b.toString())};return p("width",c),p("height",d),f.viewBox=i.left.toString()+" "+i.top.toString()+" "+a.toString()+" "+u.toString(),{attributes:f,body:s}}const Sn=/\sid="(\S+)"/g,Cn="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Tn=0;function er(e,t=Cn){const r=[];let n;for(;n=Sn.exec(e);)r.push(n[1]);if(!r.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(s=>{const o=typeof t=="function"?t(s):t+(Tn++).toString(),l=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const M={local:!0,session:!0},tr={local:new Set,session:new Set};let Xe=!1;function kn(e){Xe=e}const at="iconify2",Z="iconify",rr=Z+"-count",lt=Z+"-version",nr=36e5,Fn=168;function Le(e,t){try{return e.getItem(t)}catch{}}function Ze(e,t,r){try{return e.setItem(t,r),!0}catch{}}function ct(e,t){try{e.removeItem(t)}catch{}}function qe(e,t){return Ze(e,rr,t.toString())}function Ye(e){return parseInt(Le(e,rr))||0}let ce=typeof window>"u"?{}:window;function ir(e){const t=e+"Storage";try{if(ce&&ce[t]&&typeof ce[t].length=="number")return ce[t]}catch{}M[e]=!1}function sr(e,t){const r=ir(e);if(!r)return;const n=Le(r,lt);if(n!==at){if(n){const l=Ye(r);for(let a=0;a<l;a++)ct(r,Z+a.toString())}Ze(r,lt,at),qe(r,0);return}const i=Math.floor(Date.now()/nr)-Fn,s=l=>{const a=Z+l.toString(),u=Le(r,a);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,l))return!0}catch{}ct(r,a)}};let o=Ye(r);for(let l=o-1;l>=0;l--)s(l)||(l===o-1?(o--,qe(r,o)):tr[e].add(l))}function or(){if(!Xe){kn(!0);for(const e in M)sr(e,t=>{const r=t.data,n=t.provider,i=r.prefix,s=F(n,i);if(!Je(s,r).length)return!1;const o=r.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function ar(e,t){switch(e){case"local":case"session":M[e]=t;break;case"all":for(const r in M)M[r]=t;break}}const Ke=Object.create(null);function lr(e,t){Ke[e]=t}function Ve(e){return Ke[e]||Ke[""]}function et(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const $e=Object.create(null),K=["https://api.simplesvg.com","https://api.unisvg.com"],he=[];for(;K.length>0;)K.length===1||Math.random()>.5?he.push(K.shift()):he.push(K.pop());$e[""]=et({resources:["https://api.iconify.design"].concat(he)});function cr(e,t){const r=et(t);return r===null?!1:($e[e]=r,!0)}function Se(e){return $e[e]}function An(){return Object.keys($e)}const Pn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ye=Pn();function En(e){ye=e}function In(){return ye}function Dn(e,t){const r=Se(e);if(!r)return 0;let n;if(!r.maxURL)n=0;else{let i=0;r.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";n=r.maxURL-i-r.path.length-s.length}return n}function Rn(e){return e===404}const Nn=(e,t,r)=>{const n=[],i=Dn(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},l=0;return r.forEach((a,u)=>{l+=a.length+1,l>=i&&u>0&&(n.push(o),o={type:s,provider:e,prefix:t,icons:[]},l=a.length),o.icons.push(a)}),n.push(o),n};function jn(e){if(typeof e=="string"){const t=Se(e);if(t)return t.path}return"/"}const On=(e,t,r)=>{if(!ye){r("abort",424);return}let n=jn(t.provider);switch(t.type){case"icons":{const s=t.prefix,l=t.icons.join(","),a=new URLSearchParams({icons:l});n+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:r("abort",400);return}let i=503;ye(e+n).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{r(Rn(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?r("abort",s):r("next",i)});return}setTimeout(()=>{r("success",s)})}).catch(()=>{r("next",i)})},Mn={prepare:Nn,send:On};function Hn(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return e.forEach(i=>{if(n.name===i.name&&n.prefix===i.prefix&&n.provider===i.provider)return;n=i;const s=i.provider,o=i.prefix,l=i.name,a=r[s]||(r[s]=Object.create(null)),u=a[o]||(a[o]=F(s,o));let c;l in u.icons?c=t.loaded:o===""||u.missing.has(l)?c=t.missing:c=t.pending;const d={provider:s,prefix:o,name:l};c.push(d)}),t}function ur(e,t){e.forEach(r=>{const n=r.loaderCallbacks;n&&(r.loaderCallbacks=n.filter(i=>i.id!==t))})}function Bn(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const n=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,l=o.pending.length;o.pending=o.pending.filter(a=>{if(a.prefix!==i)return!0;const u=a.name;if(e.icons[u])o.loaded.push({provider:n,prefix:i,name:u});else if(e.missing.has(u))o.missing.push({provider:n,prefix:i,name:u});else return r=!0,!0;return!1}),o.pending.length!==l&&(r||ur([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let zn=0;function Ln(e,t,r){const n=zn++,i=ur.bind(null,r,n);if(!t.pending.length)return i;const s={id:n,icons:t,callback:e,abort:i};return r.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function qn(e,t=!0,r=!1){const n=[];return e.forEach(i=>{const s=typeof i=="string"?q(i,t,r):i;s&&n.push(s)}),n}var Yn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Kn(e,t,r,n){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let g=e.resources.slice(0);for(o=[];g.length>1;){const T=Math.floor(Math.random()*g.length);o.push(g[T]),g=g.slice(0,T).concat(g.slice(T+1))}o=o.concat(g)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const l=Date.now();let a="pending",u=0,c,d=null,f=[],p=[];typeof n=="function"&&p.push(n);function h(){d&&(clearTimeout(d),d=null)}function b(){a==="pending"&&(a="aborted"),h(),f.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),f=[]}function y(g,T){T&&(p=[]),typeof g=="function"&&p.push(g)}function z(){return{startTime:l,payload:t,status:a,queriesSent:u,queriesPending:f.length,subscribe:y,abort:b}}function $(){a="failed",p.forEach(g=>{g(void 0,c)})}function S(){f.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),f=[]}function Vr(g,T,Y){const le=T!=="success";switch(f=f.filter(j=>j!==g),a){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(T==="abort"){c=Y,$();return}if(le){c=Y,f.length||(o.length?Fe():$());return}if(h(),S(),!e.random){const j=e.resources.indexOf(g.resource);j!==-1&&j!==e.index&&(e.index=j)}a="completed",p.forEach(j=>{j(Y)})}function Fe(){if(a!=="pending")return;h();const g=o.shift();if(g===void 0){if(f.length){d=setTimeout(()=>{h(),a==="pending"&&(S(),$())},e.timeout);return}$();return}const T={status:"pending",resource:g,callback:(Y,le)=>{Vr(T,Y,le)}};f.push(T),u++,d=setTimeout(Fe,e.rotate),r(g,t,T.callback)}return setTimeout(Fe),z}function dr(e){const t={...Yn,...e};let r=[];function n(){r=r.filter(l=>l().status==="pending")}function i(l,a,u){const c=Kn(t,l,a,(d,f)=>{n(),u&&u(d,f)});return r.push(c),c}function s(l){return r.find(a=>l(a))||null}return{query:i,find:s,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:n}}function ut(){}const Pe=Object.create(null);function Vn(e){if(!Pe[e]){const t=Se(e);if(!t)return;const r=dr(t),n={config:t,redundancy:r};Pe[e]=n}return Pe[e]}function fr(e,t,r){let n,i;if(typeof e=="string"){const s=Ve(e);if(!s)return r(void 0,424),ut;i=s.send;const o=Vn(e);o&&(n=o.redundancy)}else{const s=et(e);if(s){n=dr(s);const o=e.resources?e.resources[0]:"",l=Ve(o);l&&(i=l.send)}}return!n||!i?(r(void 0,424),ut):n.query(t,i,r)().abort}function Un(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const n in M)sr(n,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Wn(e,t){Xe||or();function r(n){let i;if(!M[n]||!(i=ir(n)))return;const s=tr[n];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=Ye(i),!qe(i,o+1))return;const l={cached:Math.floor(Date.now()/nr),provider:e.provider,data:t};return Ze(i,Z+o.toString(),JSON.stringify(l))}t.lastModified&&!Un(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function dt(){}function Gn(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Bn(e)}))}function Qn(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:r,prefix:n}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=Ve(r)))return;s.prepare(r,n,i).forEach(l=>{fr(r,l,a=>{if(typeof a!="object")l.icons.forEach(u=>{e.missing.add(u)});else try{const u=Je(e,a);if(!u.length)return;const c=e.pendingIcons;c&&u.forEach(d=>{c.delete(d)}),Wn(e,a)}catch(u){console.error(u)}Gn(e)})})}))}const Jn=e=>{const r=F(e.provider,e.prefix).pendingIcons;return!!(r&&r.has(e.name))},tt=(e,t)=>{const r=qn(e,!0,yn()),n=Hn(r);if(!n.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(n.loaded,n.missing,n.pending,dt)}),()=>{a=!1}}const i=Object.create(null),s=[];let o,l;return n.pending.forEach(a=>{const{provider:u,prefix:c}=a;if(c===l&&u===o)return;o=u,l=c,s.push(F(u,c));const d=i[u]||(i[u]=Object.create(null));d[c]||(d[c]=[])}),n.pending.forEach(a=>{const{provider:u,prefix:c,name:d}=a,f=F(u,c),p=f.pendingIcons||(f.pendingIcons=new Set);p.has(d)||(p.add(d),i[u][c].push(d))}),s.forEach(a=>{const{provider:u,prefix:c}=a;i[u][c].length&&Qn(a,i[u][c])}),t?Ln(t,n,s):dt},Xn=e=>new Promise((t,r)=>{const n=typeof e=="string"?q(e,!0):e;if(!n){r(e);return}tt([n||e],i=>{if(i.length&&n){const s=ie(n);if(s){t({...ne,...s});return}}r(e)})});function pr(e,t){const r={...e};for(const n in t){const i=t[n],s=typeof i;n in Xt?(i===null||i&&(s==="string"||s==="number"))&&(r[n]=i):s===typeof r[n]&&(r[n]=n==="rotate"?i%4:i)}return r}const Ce={...Zt,inline:!1},Ee="iconify",Ue="iconify-inline",R="iconifyData"+Date.now();let H=[];function se(e){for(let t=0;t<H.length;t++){const r=H[t];if((typeof r.node=="function"?r.node():r.node)===e)return r}}function hr(e,t=!1){let r=se(e);return r?(r.temporary&&(r.temporary=t),r):(r={node:e,temporary:t},H.push(r),r)}function Zn(){if(document.documentElement)return hr(document.documentElement);H.push({node:()=>document.documentElement})}function ei(e){H=H.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function oe(){return H}function ti(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let G=null;const ri={childList:!0,subtree:!0,attributes:!0};function mr(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,G&&G(e)}))}function ni(e,t){if(!e.observer)return;const r=e.observer;if(!r.pendingScan)for(let n=0;n<t.length;n++){const i=t[n];if(i.addedNodes&&i.addedNodes.length>0||i.type==="attributes"&&i.target[R]!==void 0){r.paused||mr(e);return}}}function br(e,t){e.observer.instance.observe(t,ri)}function _e(e){let t=e.observer;if(t&&t.instance)return;const r=typeof e.node=="function"?e.node():e.node;!r||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(ni.bind(null,e)),br(e,r),t.paused||mr(e))}function ft(){oe().forEach(_e)}function gr(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function ii(e){const t=G!==null;if(G!==e&&(G=e,t&&oe().forEach(gr)),t){ft();return}ti(ft)}function We(e){(e?[e]:oe()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const r=t.observer;if(r.paused++,r.paused>1||!r.instance)return;r.instance.disconnect()})}function si(e){if(e){const t=se(e);t&&We(t)}else We()}function Ge(e){(e?[e]:oe()).forEach(t=>{if(!t.observer){_e(t);return}const r=t.observer;if(r.paused&&(r.paused--,!r.paused)){const n=typeof t.node=="function"?t.node():t.node;if(n)r.instance?br(t,n):_e(t);else return}})}function oi(e){if(e){const t=se(e);t&&Ge(t)}else Ge()}function yr(e,t=!1){const r=hr(e,t);return _e(r),r}function _r(e){const t=se(e);t&&(gr(t),ei(e))}function ai(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const r=e.customisations,n=t.customisations;for(const i in Ce)if(r[i]!==n[i])return!0;return!1}function li(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function n(i){for(;i<0;)i+=4;return i%4}if(r===""){const i=parseInt(e);return isNaN(i)?0:n(i)}else if(r!==e){let i=0;switch(r){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-r.length));return isNaN(s)?0:(s=s/i,s%1===0?n(s):0)}}return t}const ci=/[\s,]+/;function ui(e,t){t.split(ci).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const di=["width","height"],fi=["inline","hFlip","vFlip"];function pi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function hi(e){const t=e.getAttribute("data-icon"),r=typeof t=="string"&&q(t,!0);if(!r)return null;const n={...Ce,inline:e.classList&&e.classList.contains(Ue)};di.forEach(l=>{const a=e.getAttribute("data-"+l);a&&(n[l]=a)});const i=e.getAttribute("data-rotate");typeof i=="string"&&(n.rotate=li(i));const s=e.getAttribute("data-flip");typeof s=="string"&&ui(n,s),fi.forEach(l=>{const a="data-"+l,u=pi(e.getAttribute(a),a);typeof u=="boolean"&&(n[l]=u)});const o=e.getAttribute("data-mode");return{name:t,icon:r,customisations:n,mode:o}}const mi="svg."+Ee+", i."+Ee+", span."+Ee+", i."+Ue+", span."+Ue;function bi(e){const t=[];return e.querySelectorAll(mi).forEach(r=>{const n=r[R]||r.tagName.toLowerCase()!=="svg"?hi(r):null;n&&t.push({node:r,props:n})}),t}function vr(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)r+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}let Q;function gi(){try{Q=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Q=null}}function yi(e){return Q===void 0&&gi(),Q?Q.createHTML(e):e}function xr(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(r=>{e[r]&&t.add("iconify--"+e[r])}),t}function wr(e,t,r,n){const i=e.classList;if(n){const o=n.classList;Array.from(o).forEach(l=>{i.add(l)})}const s=[];return t.forEach(o=>{i.contains(o)?r.has(o)&&s.push(o):(i.add(o),s.push(o))}),r.forEach(o=>{t.has(o)||i.remove(o)}),s}function $r(e,t,r){const n=e.style;(r||[]).forEach(s=>{n.removeProperty(s)});const i=[];for(const s in t)n.getPropertyValue(s)||(i.push(s),n.setProperty(s,t[s]));return i}function Sr(e,t,r){let n;try{n=document.createElement("span")}catch{return e}const i=t.customisations,s=we(r,i),o=e[R],l=vr(er(s.body),{"aria-hidden":"true",role:"img",...s.attributes});n.innerHTML=yi(l);const a=n.childNodes[0],u=e.attributes;for(let h=0;h<u.length;h++){const b=u.item(h),y=b.name;y!=="class"&&!a.hasAttribute(y)&&a.setAttribute(y,b.value)}const c=xr(t.icon),d=wr(a,c,new Set(o&&o.addedClasses),e),f=$r(a,i.inline?{"vertical-align":"-0.125em"}:{},o&&o.addedStyles),p={...t,status:"loaded",addedClasses:d,addedStyles:f};return a[R]=p,e.parentNode&&e.parentNode.replaceChild(a,e),a}function _i(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function vi(e){return"data:image/svg+xml,"+_i(e)}function xi(e){return'url("'+vi(e)+'")'}const wi={display:"inline-block"},Qe={"background-color":"currentColor"},Cr={"background-color":"transparent"},pt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ht={"-webkit-mask":Qe,mask:Qe,background:Cr};for(const e in ht){const t=ht[e];for(const r in pt)t[e+"-"+r]=pt[r]}function mt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function $i(e,t,r,n){const i=t.customisations,s=we(r,i),o=s.attributes,l=e[R],a=vr(s.body,{...o,width:r.width+"",height:r.height+""}),u=xr(t.icon),c=wr(e,u,new Set(l&&l.addedClasses)),f={"--svg":xi(a),width:mt(o.width),height:mt(o.height),...wi,...n?Qe:Cr};i.inline&&(f["vertical-align"]="-0.125em");const p=$r(e,f,l&&l.addedStyles),h={...t,status:"loaded",addedClasses:c,addedStyles:p};return e[R]=h,e}let ue=!1;function Si(){ue||(ue=!0,setTimeout(()=>{ue&&(ue=!1,L())}))}function L(e,t=!1){const r=Object.create(null);function n(i,s){const{provider:o,prefix:l,name:a}=i,u=F(o,l),c=u.icons[a];if(c)return{status:"loaded",icon:c};if(u.missing.has(a))return{status:"missing"};if(s&&!Jn(i)){const d=r[o]||(r[o]=Object.create(null));(d[l]||(d[l]=new Set)).add(a)}return{status:"loading"}}(e?[e]:oe()).forEach(i=>{const s=typeof i.node=="function"?i.node():i.node;if(!s||!s.querySelectorAll)return;let o=!1,l=!1;function a(u,c,d){if(l||(l=!0,We(i)),u.tagName.toUpperCase()!=="SVG"){const f=c.mode,p=f==="mask"||(f==="bg"?!1:f==="style"?d.body.indexOf("currentColor")!==-1:null);if(typeof p=="boolean"){$i(u,c,{...ne,...d},p);return}}Sr(u,c,d)}bi(s).forEach(({node:u,props:c})=>{const d=u[R];if(!d){const{status:p,icon:h}=n(c.icon,!0);if(h){a(u,c,h);return}o=o||p==="loading",u[R]={...c,status:p};return}let f;if(ai(d,c)){if(f=n(c.icon,d.name!==c.name),!f.icon){o=o||f.status==="loading",Object.assign(d,{...c,status:f.status});return}}else{if(d.status!=="loading")return;if(f=n(c.icon,!1),!f.icon){d.status=f.status;return}}a(u,c,f.icon)}),i.temporary&&!o?_r(s):t&&o?yr(s,!0):l&&i.observer&&Ge(i)});for(const i in r){const s=r[i];for(const o in s){const l=s[o];tt(Array.from(l).map(a=>({provider:i,prefix:o,name:a})),Si)}}}function Ci(e){const t=se(e);t?L(t):L({node:e,temporary:!0},!0)}function Tr(e,t,r=!1){const n=ie(e);if(!n)return null;const i=q(e),s=pr(Ce,t||{}),o=Sr(document.createElement("span"),{name:e,icon:i,customisations:s},n);return r?o.outerHTML:o}function Ti(){return"3.1.1"}function ki(e,t){return Tr(e,t,!1)}function Fi(e,t){return Tr(e,t,!0)}function Ai(e,t){const r=ie(e);if(!r)return null;const n=pr(Ce,t||{});return we(r,n)}function Pi(e){e?Ci(e):L()}if(typeof document<"u"&&typeof window<"u"){Zn();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!Jt(n))&&console.error(r)}catch{console.error(r)}})}setTimeout(()=>{ii(L),L()})}function Ei(e,t){ar(e,t!==!1)}function Ii(e){ar(e,!0)}lr("",Mn);if(typeof document<"u"&&typeof window<"u"){or();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const r in t){const n="IconifyProviders["+r+"] is invalid.";try{const i=t[r];if(typeof i!="object"||!i||i.resources===void 0)continue;cr(r,i)||console.error(n)}catch{console.error(n)}}}}const Di={getAPIConfig:Se,setAPIModule:lr,sendAPIQuery:fr,setFetch:En,getFetch:In,listAPIProviders:An},me={_api:Di,addAPIProvider:cr,loadIcons:tt,loadIcon:Xn,iconExists:_n,getIcon:vn,listIcons:gn,addIcon:Qt,addCollection:Jt,replaceIDs:er,calculateSize:ze,buildIcon:we,getVersion:Ti,renderSVG:ki,renderHTML:Fi,renderIcon:Ai,scan:Pi,observe:yr,stopObserving:_r,pauseObserver:si,resumeObserver:oi,enableCache:Ei,disableCache:Ii};try{self.Iconify===void 0&&(self.Iconify=me)}catch{}var Ri=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("span",{staticClass:"ab-icon",style:e.wrapperStyle},[e.isLocal?r("svg",{class:e.svgClassNames,attrs:{"aria-hidden":"true"}},[r("use",{attrs:{"xlink:href":e.symbolId}})]):r("span",{ref:"elRef",class:e.svgClassNames,attrs:{"data-icon":e.symbolId}})])},Ni=[];const ji={name:"AbIcon",props:{icon:{type:String,default:void 0},color:{type:String,default:void 0},size:{type:Number,default:16},svgClass:{type:String,default:void 0}},computed:{isLocal(){return!!(this.icon&&this.icon.startsWith("svg-icon:"))},symbolId(){return this.isLocal?`#icon-${this.icon.split("svg-icon:")[1]}`:this.icon},svgClassNames(){return`iconify ${this.svgClass||""}`.trim()},wrapperStyle(){return{fontSize:`${this.size}px`,height:"1em",color:this.color}}},watch:{icon(e){this.updateIcon(e)}},mounted(){this.updateIcon(this.icon)},methods:{async updateIcon(e){if(this.isLocal||typeof document>"u")return;const t=this.$refs.elRef;if(!t||(await this.$nextTick(),!e))return;const r=me&&typeof me.renderSVG=="function"?me.renderSVG(e,{}):null;if(r)t.textContent="",t.appendChild(r);else{const n=document.createElement("span");n.className="iconify",n.dataset.icon=e,t.textContent="",t.appendChild(n)}}}},bt={};var Oi=_(ji,Ri,Ni,!1,Mi,null,null,null);function Mi(e){for(let t in bt)this[t]=bt[t]}const rt=function(){return Oi.exports}();var Hi=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-popover",{ref:"popover",attrs:{placement:"bottom-start",width:"320",disabled:e.disabled,trigger:"manual","popper-class":"ab-tree-select__popper"},on:{show:e.onShow,hide:e.onHide},model:{value:e.visible,callback:function(n){e.visible=n},expression:"visible"}},[r("div",{staticClass:"ab-tree-select__dropdown",on:{mouseenter:e.onDropdownEnter,mouseleave:e.onDropdownLeave}},[e.filterable?r("div",{staticClass:"ab-tree-select__filter"},[r("el-input",{staticClass:"ab-tree-select__filter-input",attrs:{size:"small",placeholder:"搜索..."},on:{keydown:[function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"]))return null;n.stopPropagation()},function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"tab",9,n.key,"Tab"))return null;n.stopPropagation()}],click:function(n){n.stopPropagation()}},model:{value:e.filterText,callback:function(n){e.filterText=n},expression:"filterText"}},[r("template",{slot:"prefix"},[r("i",{staticClass:"el-icon-search"})]),e.filterText?r("template",{slot:"suffix"},[r("i",{staticClass:"el-icon-circle-close",on:{click:function(n){n.stopPropagation(),e.filterText=""}}})]):e._e()],2)],1):e._e(),r("el-tree",{ref:"tree",staticStyle:{"max-height":"300px",overflow:"auto"},attrs:{data:e.filteredData,props:e.treeProps,"node-key":e.treeProps.value,"default-expanded-keys":e.defaultExpandedKeysInternal,"show-checkbox":e.multiple,"check-strictly":e.checkStrictly,"highlight-current":!e.multiple,"default-checked-keys":e.getDefaultCheckedKeys(),"filter-node-method":e.filterNodeMethod},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange,"current-change":e.handleCurrentChange}}),e.filteredData.length===0&&e.filterText?r("div",{staticClass:"ab-tree-select__empty"},[e._v("无匹配数据")]):e._e()],1),r("template",{slot:"reference"},[r("div",{staticClass:"ab-tree-select__reference"},[e.multiple?r("div",{staticClass:"ab-tree-select__tags-wrapper",on:{click:e.handleClick}},[r("input",{ref:"input",attrs:{type:"hidden",name:e.$attrs.name},domProps:{value:Array.isArray(e.value)?e.value.join(","):e.value||""}}),r("div",{staticClass:"ab-tree-select__tags"},[e.displayLabels.length===1?r("el-tag",{staticClass:"ab-tree-select__tag",attrs:{size:"small",type:"info"},on:{close:function(n){return n.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]):e.displayLabels.length>1?r("span",{staticClass:"ab-tree-select__tag-multiple"},[r("el-tag",{staticClass:"ab-tree-select__first-tag",attrs:{size:"small",type:"info"},on:{close:function(n){return n.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]),r("el-tag",{staticClass:"ab-tree-select__count-tag",attrs:{size:"small",type:"info"}},[e._v(" +"+e._s(e.displayLabels.length-1)+" ")])],1):r("span",{staticClass:"ab-tree-select__placeholder"},[e._v(e._s(e.placeholder))]),r("i",{staticClass:"el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})],1)]):r("el-input",e._b({ref:"input",staticClass:"ab-tree-select__input",attrs:{value:e.displayValue,size:e.currentSize,disabled:e.disabled,readonly:!0,placeholder:e.placeholder},on:{focus:e.handleFocus,blur:e.handleBlur}},"el-input",e.$attrs,!1),[r("template",{slot:"suffix"},[r("i",{staticClass:"el-input__suffix-inner el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})])],2)],1)])],2)},Bi=[];const zi={name:"AbTreeSelect",inheritAttrs:!1,props:{value:{type:[Array,String,Number,Boolean,Object],default:void 0},data:{type:Array,default:()=>[]},props:{type:Object,default:()=>({})},multiple:Boolean,checkStrictly:Boolean,filterable:Boolean,disabled:Boolean,placeholder:String,size:String,defaultExpandedKeys:Array,showValue:Boolean,showKey:Boolean,showCode:Boolean,abFormInject:Object},data(){return{visible:!1,filterText:"",dropdownHovering:!1,inputHovering:!1,currentNodeKey:null,defaultExpandedKeysInternal:[]}},computed:{currentSize(){return this.size||this.$ELEMENT&&this.$ELEMENT.size||"default"},treeData(){return this.data||this.abFormInject&&this.abFormInject.options||[]},treeProps(){const e=this.props||{};return{value:e.valueKey||e.nodeKey||"value",label:e.label||"label",children:e.children||"children",disabled:e.disabled||"disabled",leaf:e.leaf||"isLeaf",...e}},filteredData(){if(!this.filterText)return this.treeData;const e=this.filterText.toLowerCase(),t=r=>r.map(n=>{const s=String(n[this.treeProps.label]||"").toLowerCase().includes(e),o=n[this.treeProps.children],l=o?t(o):[];return s||l.length?{...n,[this.treeProps.children]:l}:null}).filter(Boolean);return t(this.treeData)},displayLabels(){if(!this.multiple||!this.value||!Array.isArray(this.value)||!this.value.length)return[];const e=this.treeProps.value,t=this.treeProps.label,r=(n,i)=>{for(const s of n||[]){if(s[e]===i)return s;const o=r(s[this.treeProps.children],i);if(o)return o}return null};return this.value.map(n=>{const i=r(this.treeData,n);return i?{value:n,label:i[t]}:{value:n,label:String(n)}})},displayValue(){if(this.value===void 0||this.value===null||this.value==="")return"";const e=Array.isArray(this.value)?this.value:[this.value],t=this.treeProps.value,r=this.treeProps.label,n=(s,o)=>{for(const l of s||[]){if(l[t]===o)return l[r];const a=n(l[this.treeProps.children],o);if(a)return a}return null};return e.map(s=>n(this.treeData,s)).filter(Boolean).join(", ")}},watch:{visible(e){e&&(this.filterText="",this.$nextTick(()=>{this.$refs.tree&&(this.multiple&&Array.isArray(this.value)?this.$refs.tree.setCheckedKeys(this.value):!this.multiple&&this.value!==void 0&&this.value!==null&&this.$refs.tree.setCurrentKey(this.value))}))},value(e){this.visible&&this.$refs.tree&&(this.multiple&&Array.isArray(e)?this.$refs.tree.setCheckedKeys(e):!this.multiple&&e!==void 0&&e!==null&&this.$refs.tree.setCurrentKey(e))},treeData(e){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const t=[],r=n=>{for(const i of n||[])i[this.treeProps.children]&&i[this.treeProps.children].length&&(t.push(i[this.treeProps.value]),r(i[this.treeProps.children]))};r(e),this.defaultExpandedKeysInternal=t}}},mounted(){this.$emit("fc.el",this.$refs.input),document.addEventListener("click",this.handleOutsideClick,!0),this.updateDefaultExpandedKeys()},beforeDestroy(){document.removeEventListener("click",this.handleOutsideClick,!0)},methods:{filterNodeMethod(e,t){return this.filterText?String(t[this.treeProps.label]||"").toLowerCase().includes(this.filterText.toLowerCase()):!0},getDefaultCheckedKeys(){if(!this.multiple)return[];const e=this.treeProps.value;if(this.checkStrictly)return Array.isArray(this.value)?this.value:this.value?[this.value]:[];const t=[],r=n=>{for(const i of n||[])!i[this.treeProps.children]||!i[this.treeProps.children].length?t.push(i[e]):r(i[this.treeProps.children])};return r(this.treeData),t.filter(n=>Array.isArray(this.value)?this.value.includes(n):this.value===n)},handleNodeClick(e,t,r){if(this.multiple)return;const n=this.treeProps.value,i=e[n];this.$emit("input",i),this.$emit("change",i),this.visible=!1},handleCheckChange(e,t){if(!this.multiple)return;const r=this.treeProps.value,n=this.$refs.tree.getCheckedKeys();let i;this.checkStrictly?i=n:i=this.$refs.tree.getCheckedNodes().filter(o=>o.isLeaf).map(o=>o[r]),this.$emit("input",i),this.$emit("change",i)},handleCurrentChange(e){e&&(this.currentNodeKey=e[this.treeProps.value])},handleFocus(){!this.disabled&&!this.multiple&&(this.inputHovering=!0)},handleBlur(){this.multiple||(this.inputHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},150))},handleClick(e){if(!this.disabled){if(e.target.closest(".ab-tree-select__tag"))return;this.visible=!this.visible}},onDropdownEnter(){this.dropdownHovering=!0},onDropdownLeave(){this.dropdownHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},100)},onShow(){this.$emit("visible-change",!0)},onHide(){this.$emit("visible-change",!1)},handleOutsideClick(e){if(this.$refs.popover&&this.$refs.popover.popperElm){const t=this.$refs.popover.popperElm,r=this.$refs.popover.referenceElm||this.$el.querySelector(".ab-tree-select__reference");!t.contains(e.target)&&(!r||!r.contains(e.target))&&(this.visible=!1)}},removeTag(e){if(this.disabled)return;let t;this.multiple&&Array.isArray(this.value)&&(t=this.value.filter(r=>r!==e)),this.$emit("input",t),this.$emit("change",t)},updateDefaultExpandedKeys(){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const e=[],t=r=>{for(const n of r||[])n[this.treeProps.children]&&n[this.treeProps.children].length&&(e.push(n[this.treeProps.value]),t(n[this.treeProps.children]))};t(this.treeData),this.defaultExpandedKeysInternal=e}}}},gt={};var Li=_(zi,Hi,Bi,!1,qi,"2bf84bb8",null,null);function qi(e){for(let t in gt)this[t]=gt[t]}const kr=function(){return Li.exports}();var Yi=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-input",e._b({ref:"el",staticClass:"ab-input-number",attrs:{type:"number",value:e.displayValue,size:e.size,disabled:e.disabled,readonly:e.readonly,placeholder:e.placeholder},on:{input:e.handleInput}},"el-input",e.$attrs,!1),[e.prefix?r("span",{staticClass:"ab-input-number__prefix",attrs:{slot:"prefix"},slot:"prefix"},[e._v(e._s(e.prefix))]):e._e(),e.suffix?r("span",{staticClass:"ab-input-number__suffix",attrs:{slot:"suffix"},slot:"suffix"},[e._v(e._s(e.suffix))]):e._e()])},Ki=[];const Vi={name:"AbInputNumber",inheritAttrs:!1,props:{value:{type:[String,Number],default:void 0},prefix:{type:String,default:void 0},suffix:{type:String,default:void 0},size:{type:String,default:void 0},disabled:Boolean,readonly:Boolean,placeholder:String,abFormInject:{type:Object,default:void 0}},computed:{displayValue(){return this.value===null||this.value===void 0?"":this.value}},methods:{handleInput(e){if(e===""||e===null||e===void 0){this.$emit("input",void 0);return}const t=Number(e);this.$emit("input",Number.isNaN(t)?void 0:t)}}},yt={};var Ui=_(Vi,Yi,Ki,!1,Wi,null,null,null);function Wi(e){for(let t in yt)this[t]=yt[t]}const Gi=function(){return Ui.exports}();var Qi=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ab-input-range"},[e.prefix?r("span",{staticClass:"range-prefix"},[e._v(e._s(e.prefix))]):e._e(),e.isReadonly?[e._v(" "+e._s(e.range[0])+" ~ "+e._s(e.range[1])+" ")]:[r("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[0]===null?"":e.range[0],size:e.currentSize,placeholder:"最小",clearable:e.clearable},on:{input:function(n){return e.updateRange(0,n)},change:function(n){return e.emitChange(0,n)}}}),r("span",{staticClass:"range-splitter"},[e._v(" ~ ")]),r("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[1]===null?"":e.range[1],size:e.currentSize,placeholder:"最大",clearable:e.clearable},on:{input:function(n){return e.updateRange(1,n)},change:function(n){return e.emitChange(1,n)}}})],e.suffix?r("span",{staticClass:"range-suffix"},[e._v(e._s(e.suffix))]):e._e()],2)},Ji=[];const Xi={name:"AbInputRange",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},prefix:{type:[String,Number],default:void 0},suffix:{type:[String,Number],default:void 0},clearable:{type:Boolean,default:!0},readonly:Boolean},computed:{range(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===void 0?null:e[0],e[1]===void 0?null:e[1]]},isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},methods:{rangeWithValue(e,t){const r=[...this.range];return r[e]=t===""?null:t,r},updateRange(e,t){this.$emit("input",this.rangeWithValue(e,t))},emitChange(e,t){this.$emit("change",this.rangeWithValue(e,t))}}},_t={};var Zi=_(Xi,Qi,Ji,!1,es,null,null,null);function es(e){for(let t in _t)this[t]=_t[t]}const ts=function(){return Zi.exports}();var rs=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ab-time-period w-full"},[r("div",{staticClass:"start-time"},[e._v(e._s(e.period[0]||"--:--"))]),e.isReadonly?r("div",[e._v("~")]):r("el-slider",{class:{"is-empty":!e.period[0]&&!e.period[1]},attrs:{value:e.sliderValue,range:"",step:30,min:e.bounds[0],max:e.bounds[1],"format-tooltip":e.formatTime},on:{input:e.updatePeriod,change:e.handleChange}}),r("div",{staticClass:"end-time"},[e._v(e._s(e.period[1]||"--:--"))])],1)},ns=[];function de(e){const t=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(String(e||"").trim());if(!t)return 0;const r=Number(t[1]),n=Number(t[2]),i=t[3]?Number(t[3]):0;return r*3600+n*60+i}function Ie(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=e%60,i=`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return n?`${i}:${String(n).padStart(2,"0")}`:i}const is={name:"AbTimePeriod",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},startTime:{type:String,default:"08:00"},endTime:{type:String,default:"18:00"},readonly:Boolean},computed:{isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},bounds(){const e=de(this.startTime),t=de(this.endTime);return e<t?[e,t]:[0,86400]},period(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===""||e[0]===void 0?null:e[0],e[1]===""||e[1]===void 0?null:e[1]]},selected(){const[e,t]=this.bounds,r=this.period[0]===null?e:de(this.period[0]),n=this.period[1]===null?t:de(this.period[1]);return r<=n?[r,n]:[e,t]},sliderValue(){const e=t=>Math.min(this.bounds[1],Math.max(this.bounds[0],t));return[e(this.selected[0]),e(this.selected[1])]}},methods:{formatTime:Ie,toPeriod(e){const t=Array.isArray(e)?e:[];return[this.period[0]!==null&&t[0]===this.sliderValue[0]?this.period[0]:Ie(t[0]),this.period[1]!==null&&t[1]===this.sliderValue[1]?this.period[1]:Ie(t[1])]},updatePeriod(e){this.$emit("input",this.toPeriod(e))},handleChange(e){this.$emit("change",this.toPeriod(e))}}},vt={};var ss=_(is,rs,ns,!1,os,null,null,null);function os(e){for(let t in vt)this[t]=vt[t]}const as=function(){return ss.exports}(),C=(e="localStorage")=>({wsCache:e==="localStorage"?window.localStorage:window.sessionStorage,setLang:ls,getLang:Fr,isZhCN:Ar,setTheme:cs,getTheme:us,isDark:ds,setCurrentSize:fs,getCurrentSize:ps,setUser:hs,getUser:ms}),N={IS_DARK:"isDark",LANG:"lang",THEME:"theme",LAYOUT:"layout",CURRENT_SIZE:"currentSize",USER:"user"},ls=(e="")=>{const{wsCache:t}=C();t.setItem(N.LANG,e)},Fr=()=>{const{wsCache:e}=C();return e.getItem(N.LANG)},Ar=()=>{const e=Fr()||"";return!e||String(e).toLowerCase()==="zh-cn"},cs=e=>{const{wsCache:t}=C();t.setItem(N.THEME,JSON.stringify(e||"{}"))},us=()=>{const{wsCache:e}=C(),t=e.getItem(N.THEME);return t?JSON.parse(t):void 0},ds=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,fs=(e="")=>{const{wsCache:t}=C();t.setItem(N.CURRENT_SIZE,e)},ps=()=>{const{wsCache:e}=C();return e.getItem(N.CURRENT_SIZE)},hs=e=>{const{wsCache:t}=C();t.setItem(N.USER,JSON.stringify(e||"{}"))},ms=()=>{const{wsCache:e}=C(),t=e.getItem(N.USER),r=t?JSON.parse(t):{};return r.permissions=new Set(r.permissions||[]),r};var bs=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-time-picker",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-time-picker",e.$attrs,!1))},gs=[];const ys={name:"AbTimePicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=C(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},xt={};var _s=_(ys,bs,gs,!1,vs,null,null,null);function vs(e){for(let t in xt)this[t]=xt[t]}const xs=function(){return _s.exports}();var ws=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-color-picker",e._b({ref:"el",staticClass:"ab-color-picker",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-color-picker",e.$attrs,!1))},$s=[];const Ss={name:"AbColorPicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=C(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},wt={};var Cs=_(Ss,ws,$s,!1,Ts,null,null,null);function Ts(e){for(let t in wt)this[t]=wt[t]}const ks=function(){return Cs.exports}();var Fs=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ab-upload-file"},[e.currentDisabled?e._e():r("el-upload",{attrs:{action:"","show-file-list":!1,drag:e.drag,multiple:e.currentLimit>1,accept:e.accept,"before-upload":e.beforeUpload,"http-request":e.uploadRequest}},[r("el-button",{attrs:{type:"primary",size:"small"}},[e._v("选择文件")]),e.isShowTip?r("div",{staticClass:"ab-upload-file__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 支持 "+e._s(e.fileTypes.join("/"))+",单个不超过 "+e._s(e.fileSize)+" MB ")]):e._e()],1),r("ul",{staticClass:"ab-upload-file__list"},e._l(e.files,function(n){return r("li",{key:n.uid,staticClass:"ab-upload-file__item"},[r("span",{staticClass:"ab-upload-file__name"},[e._v(e._s(n.name))]),n.status==="uploading"?r("span",{staticClass:"ab-upload-file__tip"},[e._v("上传中...")]):e._e(),n.error?r("span",{staticClass:"ab-upload-file__error"},[e._v(e._s(n.error))]):e._e(),n.url&&e.preEnabled?r("el-button",{attrs:{type:"text"},on:{click:function(i){return e.preview(n)}}},[e._v("预览")]):e._e(),n.url&&e.dowEnabled?r("el-link",{attrs:{href:n.url,target:"_blank",download:""}},[e._v("下载")]):e._e(),!e.currentDisabled&&e.delEnabled&&n.status!=="uploading"?r("el-button",{attrs:{type:"text"},on:{click:function(i){return e.removeFile(n)}}},[e._v(" 删除 ")]):e._e()],1)}),0)],1)},As=[];const Ps=["png","jpg","jpeg","gif","webp","bmp","svg"],Es=["doc","xls","txt","pdf"];function Is(e){const t=String(e).split(/[?#]/,1)[0].split("/").pop()||e;try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function Ds(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()&&e!=="new")return e}const Rs={name:"AbUploadFile",props:{value:{type:Array,default:()=>[]},apis:{type:Object,default:void 0},abFormInject:{type:Object,default:void 0},idFieldTable:{type:String,default:void 0},businessCode:{type:String,default:void 0},uploadType:{type:String,default:void 0},maxLength:{type:[Number,String],default:void 0},fileType:{type:Array,default:void 0},fileSize:{type:Number,default:5},limit:{type:Number,default:void 0},drag:Boolean,isShowTip:{type:Boolean,default:!0},readonly:Boolean,disabled:Boolean,delEnabled:{type:Boolean,default:!0},preEnabled:{type:Boolean,default:!0},dowEnabled:{type:Boolean,default:!0},coverEnabled:Boolean,autoCover:Boolean},data(){return{uid:0,files:[]}},computed:{currentDisabled(){return this.disabled||this.readonly||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentLimit(){return this.limit!=null?Number(this.limit):this.maxLength!=null?Number(this.maxLength):5},fileTypes(){return Array.isArray(this.fileType)&&this.fileType.length?this.fileType:this.uploadType==="image"?Ps:Es},accept(){return this.fileTypes.map(e=>`.${String(e).replace(/^\./,"")}`).join(",")},apisClient(){return this.apis||this.$abUploadApis}},watch:{value:{handler(e){this.syncFromValue(e)},immediate:!0,deep:!0}},methods:{syncFromValue(e){const t=Array.isArray(e)?e:[],r=[...this.files],n=t.map(i=>{const s=r.findIndex(o=>o.url===i);return s>-1?r.splice(s,1)[0]:{uid:++this.uid,name:Is(i),url:i,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"linked"}});this.files=[...n,...this.files.filter(i=>i.status==="uploading"||i.status==="failed")]},publish(){this.$emit("input",this.files.filter(e=>e.url).map(e=>e.url))},beforeUpload(e){if(this.files.filter(i=>i.status==="uploading"||i.status==="linked").length>=this.currentLimit)return this.$message.error(`最多上传 ${this.currentLimit} 个文件`),!1;const r=e.name||"",n=r.includes(".")?r.slice(r.lastIndexOf(".")+1).toLowerCase():"";return this.fileTypes.length&&!this.fileTypes.some(i=>String(i).toLowerCase().replace(/^\./,"")===n)?(this.$message.error(`仅支持 ${this.fileTypes.join("/")} 格式`),!1):e.size>this.fileSize*1024*1024?(this.$message.error(`文件大小不能超过 ${this.fileSize} MB`),!1):!0},uploadRequest(e){const t=this.apisClient;if(!t||typeof t.upload!="function"){const n=new Error("未配置上传接口");return this.$message.error(n.message),this.$emit("error",n),Promise.reject(n)}const r={uid:++this.uid,name:e.file&&e.file.name,url:void 0,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"uploading"};return this.files.push(r),Promise.resolve().then(()=>t.upload({file:e.file})).then(n=>{const i=n&&n.data?n.data:n;if(!i||i.id==null||typeof i.url!="string"||!i.url)throw new TypeError("上传接口需返回 id、name、url");return this.$set(r,"id",i.id),this.$set(r,"fileId",i.id),this.$set(r,"url",i.url),this.$set(r,"name",i.name||e.file&&e.file.name||i.url),this.$set(r,"size",i.size),this.$set(r,"status","linked"),this.publish(),n}).catch(n=>{throw this.$set(r,"status","failed"),this.$set(r,"error",this.errorMessage(n)),this.$emit("error",n),n})},handleUploadError(e){this.$emit("error",e)},removeFile(e){const t=this.apisClient,r=this.businessId(),n=()=>{this.files=this.files.filter(i=>i.uid!==e.uid),this.publish()};if(t&&typeof t.remove=="function"&&e.fileId!=null&&r!==void 0){Promise.resolve(t.remove({...this.businessParams(r),fileId:e.fileId})).then(n).catch(i=>{this.$message.error(this.errorMessage(i)),this.$emit("error",i)});return}n()},preview(e){const t=e.name||"",r=t.includes(".")?t.slice(t.lastIndexOf(".")+1).toLowerCase():"";this.$emit("preview",{url:e.url,name:t,extension:r,fileId:e.fileId})},businessId(){const e=this.abFormInject,t=e&&e.formValue&&e.idField?e.formValue[e.idField]:void 0;return Ds(t)},businessParams(e){return{businessType:this.idFieldTable||this.abFormInject&&this.abFormInject.idFieldTable,businessCode:this.businessCode,businessId:e}},errorMessage(e){return e instanceof Error?e.message:String(e)}}},$t={};var Ns=_(Rs,Fs,As,!1,js,"0306328f",null,null);function js(e){for(let t in $t)this[t]=$t[t]}const Os=function(){return Ns.exports}();function Pr(e){return typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"}function Er(e){return typeof e=="string"||typeof e=="function"||Pr(e)}function De(e){return e==null||typeof e=="string"||typeof e=="number"?e:String(e)}function St(e){if(e!=null)return typeof e=="string"||typeof e=="number"?e:String(e)}function Ms(e,t,r){if(t==null||t==="")return;if(typeof e=="function")return e(r);if(typeof e=="string")return{name:e,query:{id:De(t)}};if(!Pr(e))return;const n={name:e.name},i=e.query;typeof i=="string"?n.query={[i]:De(t)}:i&&(n.query={},Object.keys(i).forEach(o=>{const l=i[o];n.query[o]=De(r[l])}));const s=e.params;if(typeof s=="string"){const o=St(t);o!==void 0&&(n.params={[s]:o})}else s&&(n.params={},Object.keys(s).forEach(o=>{const l=s[o],a=St(r[l]);a!==void 0&&(n.params[o]=a)}));return n}var Hs=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("span",{staticClass:"ab-router-link"},[r("ab-icon",{attrs:{icon:"ep:link",size:16,color:e.primaryColor}}),e.to?r("router-link",{staticClass:"ab-router-link__anchor",attrs:{to:e.to}},[e._t("default")],2):e._t("default")],2)},Bs=[];const zs={name:"AbRouterLink",props:{link:{type:[String,Function,Object],default:void 0},value:{default:void 0},row:{type:Object,default:()=>({})}},computed:{to(){return Ms(this.link,this.value,this.row)},primaryColor(){const e=getComputedStyle(document.documentElement);return(e==null?void 0:e.getPropertyValue("--el-color-primary").trim())||"#1890ff"}}},Ct={};var Ls=_(zs,Hs,Bs,!1,qs,"973bb136",null,null);function qs(e){for(let t in Ct)this[t]=Ct[t]}const ae=function(){return Ls.exports}(),Ys=[Vt,nn,un,rt,kr,Gi,ts,as,xs,ks,Os,ae],Ks="checkbox",Vs={name:Ks,parser:m.BaseParser},Us="colorPicker";let Ws=class extends m.BaseParser{render(t){const r=this.vm&&this.vm.$createElement;if(this.vm&&this.vm.readonly===!0&&r){const n=this.$handle.getFormData(this),i=typeof n=="string"?n:void 0;return r("span",{class:"ab-color-picker__readonly",style:{backgroundColor:i,color:i?w.Color.getContrast(i):w.ColorsEnum.black||"#000000"},attrs:{title:i||""}},[String(n??"")])}return this.$render.defaultRender(this,t)}};const Gs={name:Us,parser:Ws},Qs="datePicker",Tt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd HH:mm:ss",week:"yyyywWW",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",monthrange:"yyyy-MM",datetimerange:"yyyy-MM-dd HH:mm:ss",year:"yyyy"};let Js=class extends m.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat=Tt[t.type]||Tt.date)}};const Xs={name:Qs,parser:Js},Zs="frame";let eo=class extends m.BaseParser{render(t){const r=this.$render.inputVData(this).props("field",this.field);return this.vNode.frame(r,t)}closeModel(){this.el.closeModel&&this.el.closeModel()}};const to={name:Zs,parser:eo},ro="hidden";let no=class extends m.BaseParser{render(){return[]}};const io={name:ro,parser:no},so="input";let oo=class extends m.BaseParser{init(){const{props:t}=this.rule;t&&t.autosize&&t.autosize.minRows&&w.$set(t,"rows",t.autosize.minRows||2)}};const ao={name:so,parser:oo};function lo(){if(typeof window>"u")return"¥";try{return Ar()?"¥":"$"}catch{return"¥"}}class kt extends m.BaseParser{}class co extends m.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.prefix===void 0&&(t.prefix=lo()),t.align===void 0&&(t.align="right")}}class uo extends m.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.suffix===void 0&&(t.suffix="%"),t.align===void 0&&(t.align="right")}}const fo="radio",po={name:fo,parser:m.BaseParser},ho="select";let mo=class extends m.BaseParser{toFormValue(t){return this.rule.props.multiple&&!Array.isArray(t)?w.toArray(t):t}};const bo={name:ho,parser:mo},go="slider";let yo=class extends m.BaseParser{toFormValue(t){const r=this.rule,n=Array.isArray(t),i=r.props,s=i.min||0;let o;return i.range===!0?o=n?t:[s,parseFloat(t)||s]:o=n?parseFloat(t[0])||s:parseFloat(t),o}};const _o={name:go,parser:yo},vo="switch";let xo=class extends m.BaseParser{render(t){return this.vNode.switch(this.$render.inputVData(this).get(),t)}};const wo={name:vo,parser:xo},V=e=>String(e).padStart(2,"0");function E(e){return typeof e>"u"||e==="undefined"||e==="null"||e===null||e===""||typeof e=="number"&&isNaN(e)}function $o(e){return E(e)?e:new Intl.NumberFormat("zh-CN",{style:"currency",currency:"CNY"}).format(e)}function So(e){return E(e)?e:(Math.round(e*100)/100).toLocaleString()}function Co(e){return E(e)?e:Math.round(e*100)/100+" %"}function ee(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e=="string"){const t=e.trim();return/^\d+$/.test(t)?new Date(Number(t)):new Date(t)}return new Date(e)}function Ir(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);const n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return{year:t.getUTCFullYear(),week:Math.ceil(((t-n)/864e5+1)/7)}}function A(e,t="YYYY-MM-DD"){if(e==null||e==="")return e;const r=ee(e);if(isNaN(r.getTime()))return e;const n=Ir(r),i={YYYY:String(r.getFullYear()),MM:V(r.getMonth()+1),DD:V(r.getDate()),HH:V(r.getHours()),mm:V(r.getMinutes()),ss:V(r.getSeconds()),Q:String(Math.floor(r.getMonth()/3)+1),W:String(n.week),GGGG:String(n.year)};return t.replace(/YYYY|MM|DD|HH|mm|ss|Q|W|GGGG/g,s=>i[s])}function To(e,t,r="label",n){if(Array.isArray(t)&&!t.length)return"";let i=t;if(Array.isArray(i)?i=i.map(l=>String(l).trim()):i!=null&&(i=String(i).trim()),!e||!e.length)return E(i)?"":i;const s=l=>!Array.isArray(n)||!n.length?!0:n.some(a=>!a||typeof a!="object"?!0:Object.entries(a).every(([u,c])=>{const d=l?l[u]:void 0;return c==null?d===c:Array.isArray(c)?c.some(f=>String(d)===String(f)):Array.isArray(d)?d.some(f=>String(f)===String(c)):String(d)===String(c)})),o=Array.isArray(i)?e.filter(l=>i.includes(String(l.value))&&s(l)):e.filter(l=>(l.value===i||String(l.value)===String(i))&&s(l));if(o.length){const l=o.map(a=>a[r]).filter(a=>a!=null&&a!=="");return[...new Set(l)].join("、")}return Array.isArray(i)||E(i)?"":i}const Ft=({cellValue:e}={},t="YYYY-MM-DD HH:mm")=>A(e,t),Re=({cellValue:e}={},t="YYYY")=>A(e,t),Ne=({cellValue:e}={},t="Q")=>e==null||e===""||isNaN(ee(e).getTime())?e:`${A(e,"YYYY")}年${A(e,t)}季度`,je=({cellValue:e}={},t="MM")=>e==null||e===""||isNaN(ee(e).getTime())?e:`${A(e,"YYYY")}年 ${A(e,t)}月`,ko=({cellValue:e}={},t="W")=>{if(e==null||e==="")return e;const r=typeof e=="string"?/^(\d{4})-(\d{1,2})(?:st|nd|rd|th|周)$/i.exec(e):null;if(!r&&isNaN(ee(e).getTime()))return e;const n=Ir(ee(e));return`${r?r[1]:n.year}年第${r?r[2]:A(e,t)}周`},Fo=({cellValue:e,itemValue:t}={})=>{const r=e??t;return E(r)?r:So(r)},Ao=({cellValue:e}={})=>E(e)?e:Co(e),Po=({cellValue:e,itemValue:t}={})=>{const r=E(e)?t:e;return E(r)?r:$o(r)};function te(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,n)=>te(r,t[n]));if(e&&t&&typeof e=="object"&&typeof t=="object"){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(n=>te(e[n],t[n]))}return!1}function Dr(e,t,{valueField:r="value",childrenField:n="children"}={}){for(const i of e||[]){if(te(i?i[r]:void 0,t))return i;const s=Dr(i?i[n]:void 0,t,{valueField:r,childrenField:n});if(s)return s}}function At(e){var r;const t=((r=e.props)==null?void 0:r.options)||e.options;return({cellValue:n})=>n==null||n===""?"":(Array.isArray(n)?n:[n]).map(s=>{const o=Array.isArray(t)?t.find(l=>l&&l.value===s):void 0;return o&&o.label!==void 0?o.label:s??""}).join("、")}function Eo(e){return({cellValue:t})=>{const{activeValue:r=!0,inactiveValue:n=!1,activeText:i,inactiveText:s}=e.props||{};return t===r?i||"开启":t===n?s||"关闭":t??""}}function Io(e){const t=e.props||{},r=t.props||{},n=e.optionsTo==="props.data"&&Array.isArray(e.options)?e.options:t.data,i=r.value??t.nodeKey??t.valueKey??"value",s=r.label??"label",o=r.children??"children";return({cellValue:l})=>l==null||l===""?"":(Array.isArray(l)?l:[l]).map(u=>{const c=Array.isArray(n)?Dr(n,u,{valueField:i,childrenField:o}):void 0;return c&&c[s]!==void 0?c[s]:u}).join("、")}function Rr(e,t,r,n){for(const i of e||[]){if(te(i[r],t))return[i];const s=Rr(i[n],t,r,n);if(s)return[i,...s]}}function Do(e){const t=e.props||{},r=t.props||{},n=e.optionsTo==="props.options"&&Array.isArray(e.options)?e.options:t.options,i=r.value??"value",s=r.label??"label",o=r.children??"children",l=Array.isArray(n)?n:[],a=t.separator??" / ",u=t.showAllLevels!==!1;function c(d){let f;if(r.emitPath===!1){const p=Rr(l,d,i,o);f=p?p.map(h=>h[s]??h[i]):[d]}else{const p=Array.isArray(d)?d:[d];let h=l;f=p.map(b=>{const y=h.find(z=>te(z[i],b));return h=y&&Array.isArray(y[o])?y[o]:[],y&&y[s]!==void 0?y[s]:b})}return(u?f:f.slice(-1)).join(a)}return({cellValue:d})=>d==null||d===""?"":r.multiple===!0?(Array.isArray(d)?d:[d]).map(c).join("、"):c(d)}const Ro={year:Re,years:Re,yearrange:Re,quarter:Ne,quarters:Ne,quarterrange:Ne,month:je,months:je,monthrange:je,week:ko,datetime:Ft,datetimerange:Ft},No=/YYYY|MM|DD|HH|mm|ss/g,jo=/[.*+?^${}()|[\]\\]/g;function Nr(e,t){if(typeof e!="string"||typeof t!="string"||t==="YYYY-wo")return e;if(t==="x"||t==="X"){const l=Number(e);return Number.isFinite(l)?new Date(t==="X"?l*1e3:l):e}const r=[],n=t.replace(jo,"\\$&").replace(No,l=>(r.push(l),"\\d{1,4}")),i=new RegExp(`^${n}$`).exec(e);if(!i)return e;const s={YYYY:1970,MM:1,DD:1,HH:0,mm:0,ss:0};r.forEach((l,a)=>{s[l]=Number(i[a+1])});const o=new Date(s.YYYY,s.MM-1,s.DD,s.HH,s.mm,s.ss);return isNaN(o.getTime())?e:o}function Oo(e){var n;const t=((n=e.props)==null?void 0:n.type)??"date",r=i=>{var l,a;if(i==null||i==="")return"";const s=Nr(i,(l=e.props)==null?void 0:l.valueFormat);if((a=e.props)!=null&&a.format)return A(s,e.props.format);const o=Ro[t];return o?o({cellValue:s}):A(s)};return({cellValue:i})=>{var o;if(!Array.isArray(i))return r(i);if(i.every(l=>l==null||l===""))return"";const s=t.endsWith("range")?((o=e.props)==null?void 0:o.rangeSeparator)??" - ":"、";return i.map(r).join(s)}}function Mo(e){const t=r=>{var i,s;if(r==null||r==="")return"";const n=Nr(r,((i=e.props)==null?void 0:i.valueFormat)??"HH:mm");return A(n,((s=e.props)==null?void 0:s.format)??"HH:mm")};return({cellValue:r})=>{var n;return Array.isArray(r)?r.every(i=>i==null||i==="")?"":r.map(t).join(((n=e.props)==null?void 0:n.rangeSeparator)??" - "):t(r)}}const Ho=new Map([["radio",At],["checkbox",At],["switch",Eo],["treeSelect",Io],["cascader",Do],["inputNumber",()=>Fo],["inputCurrency",()=>Po],["inputPercent",()=>Ao],["datePicker",Oo],["timePicker",Mo]]);function Te(e){if(typeof e.formatter=="function")return{...e,formatter:e.formatter};const t=Ho.get(e.type??"");let r;return t?r=t(e):Array.isArray(e.options)&&e.options.length>0&&(r=Bo(e)),{...e,formatter:r}}function Bo(e){return({cellValue:t})=>To(e.options,t)}const zo="text";let Lo=class extends m.BaseParser{render(){const r=this.rule.field!==void 0?this.$handle.getFormData(this):this.rule.value,n=this.$handle&&this.$handle.fCreateApi?this.$handle.fCreateApi.formData():{},i=Te({...this.rule,props:this.rule.props||{}}).formatter,s=typeof i=="function"?i({cellValue:r,column:this.rule,row:n}):r,o=String(s??""),l=this.rule.link;return Er(l)?this.vNode.make(ae,{props:{link:l,value:r,row:n}},[o]):this.vNode.make("span",{domProps:{textContent:o}})}};const qo={name:zo,parser:Lo},Yo="timePicker";let Ko=class extends m.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}};const Vo={name:Yo,parser:Ko},Uo="tree";let Wo=class extends m.BaseParser{init(){const t=this.rule.props;w.isUndef(t.nodeKey)&&w.$set(t,"nodeKey","id"),w.isUndef(t.props)&&w.$set(t,"props",{label:"title"})}render(t){const r=this.$render.parserToData(this).get();return this.vNode.tree({props:{ctx:r,children:t,value:this.$handle.getFormData(this),type:r.props.type},ref:this.refName,key:this.key,on:{input:n=>{this.$render.onInput(this,n)}}})}};const Go={name:Uo,parser:Wo},Qo="upload";class Jo extends m.BaseParser{render(t){const r=this.$render.parserToData(this).get(),{key:n,refName:i}=this;delete r.props.fileList;const s={uploadType:r.props.uploadType,maxLength:r.props.limit,modalTitle:r.props.modalTitle,handleIcon:r.props.handleIcon,onHandle:r.props.onHandle,allowRemove:r.props.allowRemove,previewMask:r.props.previewMask,value:this.$handle.getFormData(this),ctx:r,children:t};return this.vNode.upload({props:s,key:n,ref:i,on:{input:o=>{this.$render.onInput(this,o)}}})}}const Xo={name:Qo,parser:Jo},Zo=[Vs,Gs,Xs,to,io,ao,po,bo,_o,wo,qo,Vo,Go,Xo,{name:"number",parser:kt},{name:"inputNumber",parser:kt},{name:"inputCurrency",parser:co},{name:"inputPercent",parser:uo}];function ea(){return{form:{inline:!0,labelPosition:"right",labelSuffix:void 0,hideRequiredAsterisk:!1,labelWidth:"120px",fieldWidth:"238px",showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,disabled:!1,size:void 0},row:{gutter:0,type:void 0,align:void 0,justify:void 0,tag:"div"},info:{type:"popover",trigger:"hover",placement:"top-start",icon:"el-icon-warning"},submitBtn:{type:"primary",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-upload",width:"100%",autofocus:!1,nativeType:"button",innerText:"提交",show:!1,col:void 0,click:void 0},resetBtn:{type:"default",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-refresh",width:"100%",autofocus:!1,nativeType:"button",innerText:"重置",show:!1,col:void 0,click:void 0}}}const v="el",ta={input:`${v}-input`,password:`${v}-input`,textarea:`${v}-input`,text:"span",hidden:"span",divider:`${v}-divider`,number:`${v}-input-number`,inputNumber:`${v}-input-number`,inputCurrency:"ab-input-number",inputPercent:"ab-input-number",select:"ab-select",radio:"ab-radio",checkbox:"ab-checkbox",switch:`${v}-switch`,datePicker:`${v}-date-picker`,timePicker:"ab-time-picker",slider:`${v}-slider`,rate:`${v}-rate`,colorPicker:"ab-color-picker",cascader:`${v}-cascader`,treeSelect:"ab-tree-select",inputRange:"ab-input-range",timePeriod:"ab-time-period",uploadFile:"ab-upload-file",upload:"ab-upload-file",form:`${v}-form`,formItem:`${v}-form-item`,ElButton:`${v}-button`,button:`${v}-button`,icon:"ab-icon",row:`${v}-row`,col:`${v}-col`},ra=`:root{--el-color-primary: #1890ff;--el-color-success: #13ce66;--el-color-warning: #ffba00;--el-color-danger: #ff4949;--el-card-padding: 12px}::-webkit-scrollbar{width:7px;height:7px}::-webkit-scrollbar:horizontal{height:7px}::-webkit-scrollbar:vertical{height:7px}::-webkit-scrollbar-thumb{background-color:#0000004d;border-radius:4px}::-webkit-scrollbar-track{background-color:transparent}.el-card .el-card__body{padding:var(--el-card-padding)}.w-full{width:100%}.sticky{position:sticky}.top-0{top:0}.z-9{z-index:9}.flex{display:flex}.justify-end{justify-content:flex-end}.items-center{align-items:center}.ab-form,.ab-form .el-row{width:100%;display:flex;flex-direction:row;flex-wrap:wrap}.ab-form .el-form-item{--el-form-item-margin-bottom: 6px;margin-bottom:var(--el-form-item-margin-bottom)!important;margin-right:0!important}.ab-form .el-form-item.w-full{display:flex}.ab-form .ab-search__operates{margin-left:auto}.ab-form .ab-search__operates .el-form-item__content{flex:1 1 auto!important;display:flex;justify-content:flex-end}.ab-form .force-newline{flex-basis:100%}.ab-form .el-divider{width:100%;flex-basis:100%}.ab-form .el-form-item .el-input,.ab-form .el-form-item .el-input-number,.ab-form .el-form-item .el-select,.ab-form .el-form-item .el-date-editor,.ab-form .el-form-item .el-color-picker,.ab-form .el-form-item .el-color-picker__trigger,.ab-form .el-form-item .el-cascader,.ab-form .el-form-item .ab-upload-file{width:100%}.ab-form .el-form-item>.el-form-item__content{flex:0 0 var(--ab-field-width);width:var(--ab-field-width)}.ab-form.is-preview .ab-clock,.ab-form .ab-none,.ab-form.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.ab-form.is-preview .el-form-item.is-required>.el-form-item__label:before{display:none!important}.ab-form .el-color-picker__color-inner{display:flex;justify-content:flex-end;align-items:center;padding-right:6px;box-sizing:border-box}.ab-form .el-form-item .el-color-picker__empty,.ab-form .el-form-item .el-color-picker__icon{left:initial;right:0}.ab-form .el-form-item .ab-color-picker__readonly{display:flex;align-items:center;width:100%;min-height:var(--el-component-size-small);border-radius:5px;box-sizing:border-box;padding:0 12px}.ab-router-link{color:var(--el-color-primary);display:flex;align-items:center;text-decoration:none}.ab-router-link:hover{text-decoration:underline}.ab-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.ab-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.ab-wrap-top.el-form-item{display:block}.ab-wrap-top.el-form-item>.el-form-item__label{display:block;height:auto;line-height:22px;margin-bottom:8px;text-align:left;float:unset}.el-form--large .ab-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .ab-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .ab-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.ab-form-footer{margin-top:12px}.ab-form.is-numbered{counter-reset:q}.ab-form.is-numbered .ab-form-title{counter-increment:q}.ab-form.is-numbered .ab-form-title:before{content:counter(q) ". ";color:var(--ab-number-color, inherit);font-weight:600}.ab-form.is-numbered.is-number-chinese .ab-form-title:before{content:counter(q,simp-chinese-informal) "、"}.el-select-dropdown__item{display:flex;justify-content:space-between;align-items:center;padding:0;margin:0 20px}.el-select-dropdown__item .p-option__left{flex:1 1 auto;padding:0 32px 0 0}.el-select-dropdown__item .p-option__right{min-width:60px;flex:0 0 auto;text-align:right}.ab-form .w-full .el-form-item__label{flex:0 0 auto}.ab-form .w-full .el-form-item__content{width:100%;flex:1 1 auto}.ab-form .w-full .el-upload{width:100%;text-align:right}.ab-detail__header .ab-detail__title{width:50%}.ab-detail__header .ab-detail__opr .el-row{justify-content:flex-end}.ab-table{height:calc(100% - 40px)}.ab-toolbar__title{font-size:1.6em}.ab-toolbar .ab-form{margin-right:8px}.ab-detail__header,.ab-detail__header .el-card__body{width:100%;display:flex;justify-content:space-between;align-items:center;padding-left:var(--el-card-padding);margin:0;box-sizing:border-box}.ab-detail__title{flex:1 1 auto;white-space:nowrap}.ab-detail__opr{flex:1 1 auto;display:flex;justify-content:flex-end;align-items:center}.ab-detail__form{margin-top:1em}.ab-table .vxe-table--footer-wrapper .vxe-footer--column{background-color:var(--vxe-ui-table-header-background-color);color:var(--el-color-primary-dark-2);font-weight:700}.ab-table .vxe-body--column.warning,.ab-table .vxe-cell .ab-icon.warning{color:var(--el-color-warning)}.ab-table .vxe-body--column.success,.ab-table .vxe-cell .ab-icon.success{color:var(--el-color-success)}.ab-table .vxe-body--column.info,.ab-table .vxe-cell .ab-icon.info{color:var(--el-color-info)}.ab-table .vxe-body--column.danger,.ab-table .vxe-cell .ab-icon.danger{color:var(--el-color-danger)}.ab-table .vxe-body--column.primary,.ab-table .vxe-cell .ab-icon.primary{color:var(--el-color-primary)}.ab-table .vxe-cell .ab-icon{margin:0 0 0 6px}.ab-table .items-center .vxe-cell--wrapper{display:flex;align-items:center;justify-content:flex-end}.el-button--text.primary:not(.is-disabled){color:var(--el-color-primary, #409eff)}.el-button--text.success:not(.is-disabled){color:var(--el-color-success, #67c23a)}.el-button--text.warning:not(.is-disabled){color:var(--el-color-warning, #e6a23c)}.el-button--text.danger:not(.is-disabled){color:var(--el-color-danger, #ff4949)}.el-button--text.info:not(.is-disabled){color:var(--el-color-info, #909399)}.ab-input-number .el-input__inner{text-align:right}
12
- `,Pt=ra,na=new Set(["select","treeselect","radio","checkbox","inputrange","timeperiod","tree","upload","uploadfile","frame"]),ia=new Set(["input","password","textarea","number","inputnumber","inputcurrency","inputpercent","select","radio","checkbox","switch","datepicker","timepicker","slider","rate","cascader","treeselect","text"]);function Et(e){return e.type==="tooltip"}class sa extends m.BaseForm{get injectTypes(){return na}readonlyRender(t){if(!this.$handle.vm||!this.$handle.vm.readonly||!t.isDef||t.rule.component||!ia.has(t.type))return;const r=t.rule,n=this.$handle.getFormData(t),i=this.$handle.formData||{},s=Te({...r,props:r.props||{}}).formatter,o=typeof s=="function"?s({cellValue:n,column:r,row:i}):n,l=String(o??""),a=r.link;return Er(a)?this.vNode.make(ae,{props:{link:a,value:n,row:i}},[l]):this.vNode.make("span",{domProps:{textContent:l}})}inputVData(t){const r=t.rule.props||{};t.vData.attrs({...r}),!r.size&&this.options.form.size&&t.vData.props("size",this.options.form.size)}validate(t){this.getFormRef().validate(r=>{t&&t(r)})}validateField(t,r){this.getFormRef().validateField(t,r)}resetField(t){this.vm.$refs[t.formItemRefName].resetField()}clearValidateState(t){const r=this.vm.$refs[t.formItemRefName];r&&(r.validateMessage="",r.validateState="")}beforeRender(){this.propsData=this.vData.props(this.options.form).props({model:this.$handle.formData,rules:this.$handle.validate,key:"form"+this.unique}).ref(this.refName).nativeOn({submit:w.preventDefault}).class(this.options.form.className).class("form-create",!0).class("ab-form",!0).key(this.unique).get()}render(t){return t.length>0&&t.push(this.makeFormBtn()),this.vNode.form(this.propsData,[this.options.row===!1?t:this.makeRow(t)])}makeRow(t){const r={},n=this.options.row||{};return n.class&&(r[n.class]=!0),this.vNode.row({props:n||{},key:"fr"+this.unique,class:r},t)}container(t,r){return this.makeFormItem(r,t)}makeFormItem(t,r){let n=`fItem${t.key}${this.unique}`,{rule:i,field:s,formItemRefName:o}=t,l=this.getGetCol(t),a=!l.labelWidth&&!i.title?0:l.labelWidth,u=t.isDef?this.options.form&&this.options.form.fieldWidth:"",{inline:c,col:d}=this.propsData.props,f=this.vData.props({prop:s,rules:i.validate,labelWidth:w.toString(a),required:i.props.required}).key(n).ref(o).class(i.className).style(u?{"--ab-field-width":w.toString(u)}:void 0).get(),p=this.vNode.formItem(f,[r,this.makeFormPop(t,n)]);return c===!0||d===!1?p:this.makeCol(l,t,n,[p])}makeFormPop({rule:t},r){if(t.title){const n=w.isString(t.title)?{title:t.title}:t.title,i=this.options.info||{},s=[n.title||""];return t.info&&s.push(this.vNode.make(Et(i)?"el-tooltip":"el-popover",{props:{...i,content:t.info},key:`pop${r}`},[this.vNode.icon({class:[i.icon||"el-icon-warning"],slot:Et(i)?"default":"reference"})])),this.vNode.make("span",{...n,slot:"label"},s)}}makeCol(t,r,n,i){t.span===void 0&&(t.span=24);const s={[Pt.__fc_h]:!!r.rule.hidden,[Pt.__fc_v]:!!r.rule.visibility};return t.class&&(s[t.class]=!0),this.vNode.col({props:t,class:s,key:`${n}col1`},i)}makeFormBtn(){let t=[],r=this.vm.buttonProps!==!1&&this.vm.buttonProps.show!==!1,n=this.vm.resetProps!==!1&&this.vm.resetProps.show!==!1;return r&&t.push(this.makeSubmitBtn(n?19:24)),n&&t.push(this.makeResetBtn(4)),this.propsData.props.inline===!0?t:t.length?this.vNode.col({props:{span:24},key:`${this.unique}col2`},t):[]}makeResetBtn(t){const r=this.vm.resetProps,n=r.col||{span:t,push:1};return this.vNode.col({props:n,key:`${this.unique}col3`},[this.vNode.button({key:`frsbtn${this.unique}`,props:r,on:{click:()=>{const i=this.$handle.fCreateApi;w.isFunction(r.click)?r.click(i):i.resetFields()}},style:{width:r.width}},[r.innerText])])}makeSubmitBtn(t){const r=this.vm.buttonProps,n=r.col||{span:t};return this.vNode.col({props:n,key:`${this.unique}col4`},[this.vNode.button({key:`fbtn${this.unique}`,props:r,on:{click:()=>{const i=this.$handle.fCreateApi;w.isFunction(r.click)?r.click(i):i.submit()}},style:{width:r.width}},[r.innerText])])}}const oa="datePicker",aa=["year","month","date","dates","week","datetime","datetimeRange","dateRange"].reduce((e,t)=>(e[t]=m.creatorTypeFactory(oa,t.toLowerCase()),e),{}),la="frame",Oe={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},B=Object.keys(Oe).reduce((e,t)=>(e[t]=m.creatorTypeFactory(la,r=>r.props({type:Oe[t][0],maxLength:Oe[t][1]})),e),{});B.frameInput=B.frameInputs;B.frameFile=B.frameFiles;B.frameImage=B.frameImages;const jr="input",Or=["password","url","email","text","textarea"].reduce((e,t)=>(e[t]=m.creatorTypeFactory(jr,t),e),{});Or.idate=m.creatorTypeFactory(jr,"date");const It="select",ca={selectMultiple:m.creatorTypeFactory(It,!0,"multiple"),selectOne:m.creatorTypeFactory(It,!1,"multiple")},ua="slider",da={sliderRange:m.creatorTypeFactory(ua,!0,"range")},Dt="timePicker",fa={time:m.creatorTypeFactory(Dt,e=>e.props({isRange:!1})),timeRange:m.creatorTypeFactory(Dt,e=>e.props({isRange:!0}))},pa="tree",Rt={treeSelected:"selected",treeChecked:"checked"},ha=Object.keys(Rt).reduce((e,t)=>(e[t]=m.creatorTypeFactory(pa,Rt[t]),e),{}),ma="upload",Me={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},re=Object.keys(Me).reduce((e,t)=>(e[t]=m.creatorTypeFactory(ma,r=>r.props({uploadType:Me[t][0],maxLength:Me[t][1]})),e),{});re.uploadImage=re.image;re.uploadFile=re.file;const I={...aa,...B,...Or,...ca,...da,...fa,...ha,...re},ba=["autoComplete","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate","group"];ba.forEach(e=>{I[e]=m.creatorFactory(e)});I.auto=I.autoComplete;I.number=I.inputNumber;I.color=I.colorPicker;I.hidden=(e,t)=>m.creatorFactory("hidden")("",e,t);const ga=24*60*60*1e3,k={today:"今天",yesterday:"昨天",lastWeek:"上周",last7:"近7天",last30:"近30天",thisMonth:"本月",thisYear:"今年"},ya=["rgba(1, 1, 1, 0)","#45b787","#21532fff","#6e9bc5","#2775b6","#F26666","#D95970","#ECD2B9","#BF9D8A","#ECDEC0","#D0AC57","#e0e0e0","#beb6b6","#918883","#F2F2F2","#ececec","#2E3032","#182327","rgba(0, 0, 0, 0.5)"];function fe(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function U(e,...t){const r=fe(e)?{...e}:{};for(const n of t)if(fe(n))for(const i of Object.keys(n)){const s=n[i];r[i]=fe(s)?U(fe(r[i])?r[i]:{},s):s}return r}function Nt(e,t,r){let n=e;for(const i of t.split(".")){if(n==null)return r;n=n[i]}return n===void 0?r:n}function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function O(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function Mr(e){const t=P(e);return t.setDate(t.getDate()-t.getDay()),t}function _a(e){const t=P(e);return t.setDate(t.getDate()-t.getDay()+6),O(t)}function va(e){const t=P(e);return t.setDate(1),t}function xa(e){return new Date(new Date(e).getFullYear(),0,1,0,0,0,0)}function D(e,t){return new Date(e.getTime()+t*ga)}const wa=[{text:k.today,value:()=>P(new Date).getTime()},{text:k.yesterday,value:()=>P(D(new Date,-1)).getTime()},{text:k.lastWeek,value:()=>Mr(D(new Date,-7)).getTime()}],$a=[{text:k.today,value:()=>[P(new Date).getTime(),O(new Date).getTime()]},{text:k.yesterday,value:()=>[P(D(new Date,-1)).getTime(),O(D(new Date,-1)).getTime()]},{text:k.lastWeek,value:()=>[Mr(D(new Date,-7)).getTime(),_a(D(new Date,-7)).getTime()]},{text:k.last7,value:()=>[P(D(new Date,-7)).getTime(),O(new Date).getTime()]},{text:k.last30,value:()=>[P(D(new Date,-30)).getTime(),O(new Date).getTime()]},{text:k.thisMonth,value:()=>[va(new Date).getTime(),O(new Date).getTime()]},{text:k.thisYear,value:()=>[xa(new Date).getTime(),O(new Date).getTime()]}];function Sa(e){return e.getTime()>Date.now()}const jt={hidden:{hidden:!0},datePicker:{props:{valueFormat:"timestamp"}},timePicker:{props:{format:"HH:mm",valueFormat:"HH:mm"}},select:{props:{showKey:!0,showCode:!0}},treeSelect:{props:{defaultExpandAll:!0,expandOnClickNode:!1}},treeSelectMultiple:{props:{multiple:!0,type:"checked",showCheckbox:!0}},inputNumber:{align:"right"},inputCurrency:{align:"right"},inputPercent:{align:"right"},switch:{align:"center"},colorPicker:{props:{showAlpha:!0,predefine:ya}},divider:{props:{contentPosition:"left"}}};function Ca(e,t){if(t===void 0)return e;if(!Array.isArray(t))return t;const r=new Set(t.map(n=>n&&n.slot).filter(Boolean));return[...e.filter(n=>!n.slot||!r.has(n.slot)),...t]}function Hr(e,t={}){const{type:r,disabledDate:n,shortcuts:i}=e||{};let s=jt[r||""];if(r==="datePicker"){if(n===!0&&(s=U({},s,{props:{disabledDate:Sa}})),i===!0){const d=Nt(e,"props.type")==="daterange";s=U({},s,{props:{shortcuts:d?$a:wa}})}}else r==="treeSelect"&&Nt(e,"props.multiple")&&(s=U({},s,jt.treeSelectMultiple));if(!s)return e;const o=t.includeChildren!==!1,{children:l,...a}=s,c=U({},o?s:a,e);return o&&l?{...c,children:Ca(l,e.children)}:c}function Ta(){m.VNode.use(ta);const{AbForm:e}=m({ui:"element-ui",version:"0.1.1",formRender:sa,components:Ys,parsers:Zo,makers:I,getConfig:ea,mergeRule:t=>Hr(t)});return e}function ka(e,t={}){const{AbForm:r}=t||{};r&&(e.use(r),e.component("ab-icon",rt),e.component("ab-router-link",ae))}var Fa=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{class:["ab-search",e.compactMode?"compact":""]},[r("ab-form",{ref:"visibleForm",attrs:{rule:e.visibleRule,option:e.formOption},on:{change:e.handleFormChange}}),r("transition",{staticClass:"ab-search__expanded",attrs:{mode:"out-in",appear:""}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}]},[r("ab-form",{ref:"hiddenForm",attrs:{rule:e.hiddenRule,option:e.formOption},on:{change:e.handleFormChange}})],1)])],1)},Aa=[];const Pa={name:"AbSearch",props:{rule:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})},option:{type:Object,default:()=>({})},compactMode:{type:Boolean,default:!1}},data(){return{expanded:!1,opr:this.createOperatesRule()}},computed:{formOption(){const{getCurrentSize:e}=C(),t=e();return{...this.option,formData:this.value,form:{...this.option&&this.option.form,size:t}}},visibleRule(){return[...this.rule.filter(e=>!this.isHidden(e)),this.opr]},hiddenRule(){return this.rule.filter(e=>this.isHidden(e)).map(e=>({...this.getRule(e),hidden:!1}))}},watch:{value:{handler(e){this.syncValue(e)},deep:!0}},mounted(){this.syncValue(this.value)},methods:{createOperatesRule(){return{type:"formItem",native:!0,class:"ab-form-item ab-search__operates",children:[{type:"ElButton",native:!0,children:["搜索"],props:{type:"primary",icon:"el-icon-search"},on:{click:()=>this.handleSearch()}},{type:"ElButton",native:!0,children:["重置"],props:{icon:"el-icon-refresh"},on:{click:()=>this.handleReset()}},{type:"ElButton",native:!0,children:["展开"],props:{type:"text",icon:"el-icon-arrow-down"},on:{click:()=>this.toggleExpand()}}]}},updateOperatesRule(){const e=this.opr.children[2];e.children=[this.expanded?"收起":"展开"],e.props.icon=this.expanded?"el-icon-arrow-up":"el-icon-arrow-down"},getRule(e){return e&&typeof e.getRule=="function"?e.getRule():e},isHidden(e){const t=this.getRule(e);return!!(t&&t.hidden)},forms(){return[this.$refs.visibleForm,this.$refs.hiddenForm]},collectFormData(){const e={...this.value};return this.forms().forEach(t=>{const r=t&&t.$f;r&&Object.assign(e,r.formData())}),e},syncValue(e){this.forms().forEach(t=>{const r=t&&t.$f;r&&Object.keys(e||{}).forEach(n=>r.setValue(n,e[n]))})},handleFormChange(){this.$emit("input",this.collectFormData())},toggleExpand(){this.expanded=!this.expanded,this.updateOperatesRule()},handleSearch(){const e=this.collectFormData();this.$emit("input",e),this.$emit("search",e)},handleReset(){this.forms().forEach(e=>{const t=e&&e.$f;t&&t.resetFields()}),this.$emit("input",{}),this.$emit("reset",{})}}},Ot={};var Ea=_(Pa,Fa,Aa,!1,Ia,"6f06c64a",null,null);function Ia(e){for(let t in Ot)this[t]=Ot[t]}const Br=function(){return Ea.exports}();function Da(e){e.component("ab-search",Br)}var Ra=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-drawer",{attrs:{visible:e.currentVisible,"with-header":!1,"show-close":!1,"append-to-body":"","close-on-click-modal":"","close-on-press-escape":"","destroy-on-close":"",size:e.drawerSize},on:{"update:visible":function(n){e.currentVisible=n}}},[e._t("default")],2)},Na=[];const ja={name:"AbDrawer",model:{prop:"visible",event:"update:visible"},props:{visible:{type:Boolean,default:!1},detailLevel:{type:Number,default:1}},computed:{currentVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}},drawerSize(){return this.detailLevel&&this.detailLevel<5?`${100-24-this.detailLevel*8}%`:"32%"}}},Mt={};var Oa=_(ja,Ra,Na,!1,Ma,null,null,null);function Ma(e){for(let t in Mt)this[t]=Mt[t]}const zr=function(){return Oa.exports}();function Ha(e){e.component("ab-drawer",zr)}function Lr(e,t,r=[]){const n=e.filter(i=>{var s;return i.field||i.expand||((s=i.children)==null?void 0:s.length)}).filter(i=>i.tableVisible!==!1).map((i,s)=>{var l;const o=Hr({...i},{includeChildren:!1});return o.children&&o.field!=="OPERATE"&&(o.children=Lr(o.children,t,[...r,i.field?`field:${i.field}`:`index:${s}`])),o.field!=="operate"&&!((l=o.children)!=null&&l.length)&&(o.sortFieldTable===void 0&&t&&(o.sortFieldTable=t),o.width===void 0&&o.minWidth===void 0&&(o.width=120)),o});return Ba(n,r)}function Ba(e,t=[]){const r=[],n=new Map;for(const i of e){const s=typeof i.group=="string"?i.group?[i.group]:[]:i.group??[];if(!Array.isArray(s)||s.some(u=>typeof u!="string"||!u.trim()))throw new TypeError("Table column group must be a non-empty name or an array of non-empty names.");if(!s.length){r.push(i);continue}let o=r;const l=[];let a;for(const u of s){l.push(u);const c=JSON.stringify(l);let d=n.get(c);d||(d={field:`__ab_table_group__${encodeURIComponent(JSON.stringify([t,l]))}`,title:u,children:[]},n.set(c,d),o.push(d)),a=d,o=d.children}a&&i.groupAlign!==void 0&&(a.groupAlign=i.groupAlign),o.push(i)}return r}function za(e,t){const r=e.sortData;if(!r)return e;const n=new Map,i=new Set;function s(c,d){var f;for(const p of c){const h=p.getKey?p.getKey():p.field;h&&(n.set(h,d),p.defaultVisible===!1&&i.add(h),(f=p.children)!=null&&f.length&&s(p.children,h))}}s(t,null);const o=new Set;function l(c,d){return c.some(f=>{if(!f||typeof f.k!="string"||f.c!==void 0&&!Array.isArray(f.c))return!0;const{k:p,c:h}=f;return o.has(p)||n.has(p)&&n.get(p)!==d?!0:(o.add(p),h?l(h,p):!1)})}if(!(Array.isArray(r)?l(r,null):typeof r!="object"||Object.keys(r).some(c=>n.has(c)&&n.get(c)!==null)))return e;const u=e.visibleData&&{...e.visibleData};if(u)for(const c of i)u[c]===!0&&delete u[c];return{...e,sortData:void 0,visibleData:u}}function qr(e,t){for(const r of e){if(r.field===t)return r;if(r.children){const n=qr(r.children,t);if(n)return n}}}function La(e,t,r,n){if(!r)return e;const i=r.footerFormatter||Te(r).formatter;return i?i({cellValue:e,row:t,column:n||r}):e}function qa(e,t,r,n,i){if(typeof e.labelField!="string"||!e.labelField.trim()||!Array.isArray(e.fields))throw new TypeError("AbTable footerSummary requires a labelField and a fields array.");const s=["__proto__","constructor","prototype"],o=new Set([e.labelField]),l=[],a=[],u=p=>{if(!p.trim()||o.has(p)||s.includes(p))throw new TypeError(`AbTable footerSummary has an invalid or duplicate field: "${p}".`);o.add(p)};if(s.includes(e.labelField))throw new TypeError("AbTable footerSummary has an invalid labelField.");for(const p of e.fields)if(typeof p=="string")u(p),l.push(p);else{if(!p||typeof p!="object"||Array.isArray(p)||!Object.keys(p).length)throw new TypeError("AbTable footerSummary fields must be field names or objects of callbacks.");for(const[h,b]of Object.entries(p)){if(u(h),typeof b!="function")throw new TypeError(`AbTable footerSummary handler for "${h}" must be a function.`);a.push([h,b])}}const c={};for(const p of l){let h=null;for(const b of t){const y=b[p];if(!(y==null||typeof y=="string"&&!y.trim())){if(typeof y!="number"&&typeof y!="string"||!Number.isFinite(Number(y)))throw new TypeError(`AbTable footerSummary field "${p}" must contain numbers or numeric strings.`);if(h=(h??0)+Number(y),!Number.isFinite(h))throw new RangeError(`AbTable footerSummary total for "${p}" is not finite.`)}}c[p]=h}for(const[p,h]of a){const b=t.length?h({rows:t,totals:Object.freeze({...c})}):null;if(b!==null&&(typeof b!="number"||!Number.isFinite(b)))throw new TypeError(`AbTable footerSummary handler for "${p}" must return a finite number or null.`);c[p]=b}const d={[e.labelField]:e.label??n,...c},f={...d};for(const[p,h]of Object.entries(c))f[p]=h===null?"-":La(h,d,qr(r,p),i(p));return f}const x={DETAIL:"detail",DEL:"del",ADD:"add",EDIT:"edit",SAVE:"save",CREATE:"create",READ:"read",UPDATE:"update",EXPORT:"export",OPERATE:"OPERATE"};function He(e,t){return!(e!=null&&e.length)&&!(t!=null&&t.length),!0}function Ya(e){return e==null?[]:Array.isArray(e)?e:[e]}function Yr(e="default"){return e==="large"?"medium":e==="default"?"small":"mini"}function Ka(e){let t=0;for(const r of e)r.group&&(t=Math.max(t,Ya(r.group).length));return t+1}const Ht={mini:36,small:40,medium:44,large:48},Va={name:"AbTable",provide(){return{abTableRef:{value:this},abTableDetailRef:{value:this}}},props:{id:{type:[String,Number],default:void 0},title:String,rule:{type:Array,default:()=>[]},queryHandler:Function,query:{type:Object,default:()=>({})},pagerEnable:{type:Boolean,default:!0},pagerConfig:{type:Object,default:()=>({})},locale:{type:String,default:"zh-cn"},idField:{type:String,default:"id"},idFieldTable:String,permiPrefix:String,compactMode:Boolean,parentIdField:String,accordion:Boolean,hasChildField:{type:String,default:"hasChildren"},lazyMethod:Function,isCurrent:Boolean,dragable:Boolean,absDragable:Boolean,rowClassName:Function,headerCellClassName:Function,cellClassName:Function,rowStyle:[String,Object,Function],editable:Boolean,singleSelect:Boolean,multiSelect:Boolean,validRules:Object,sortable:{type:Boolean,default:!0},sortLocally:Boolean,footerSummary:Object,maxHeight:Number,offsetTop:Number,autoHeight:Boolean,readonly:{type:Boolean,default:!0},size:{type:String,default:"default"}},data(){return{currentValue:[],loading:!1,pageNo:1,pageSize:10,currentPageSizes:[10,15,20,50,100],total:0,sortFieldTable:"",sortField:"",sortType:"",maxH:this.maxHeight||0,requestVersion:0,sortParams:void 0}},computed:{currentRule(){return Lr(this.rule,this.idFieldTable)},tableId(){return this.id||`ab-table-${this._uid}`},vxeCurrentSize(){return Yr(this.size)},pagerFields(){return{pageNo:this.pagerConfig.pageNoField??"pageNo",pageSize:this.pagerConfig.pageSizeField??"pageSize",sortFieldTable:this.pagerConfig.sortFieldTableField??"sortFieldTable",sortField:this.pagerConfig.sortFieldField??"sortField",sortType:this.pagerConfig.sortTypeField??"sortType"}},sortConfig(){return{trigger:"cell",remote:!this.sortLocally}},currentFooterData(){if(!this.footerSummary)return[];const e=this.$refs.table,t=r=>e&&e.getColumnByField?e.getColumnByField(r):void 0;return[qa(this.footerSummary,this.currentValue,this.currentRule,"合计",t)]},currentReadonly(){return!(!this.readonly||this.multiSelect||this.singleSelect)}},watch:{query:{handler(){this.reload()},deep:!0},vxeCurrentSize:{handler(){this.$nextTick(()=>this.calculateTableHeight())}},compactMode:{handler(){this.$nextTick(()=>this.calculateTableHeight())}}},created(){this.initializePager()},mounted(){this.calculateTableHeight(),this.init()},methods:{initializePager(){const e=this.pagerFields;this.pageNo=Number(this.query[e.pageNo]??1),this.pageSize=Number(this.query[e.pageSize]??10),this.sortFieldTable=this.query[e.sortFieldTable]??"",this.sortField=this.query[e.sortField]??"",this.sortType=this.query[e.sortType]??""},calculateTableHeight(){var u,c;if(!this.autoHeight){this.maxH=this.maxHeight||0;return}const e=this.$refs.table,t=((u=e==null?void 0:e.cellConfig)==null?void 0:u.height)||Ht[this.vxeCurrentSize]||Ht.medium,r=this.$el&&this.$el.parentElement,n=((c=r==null?void 0:r.querySelector(".ab-toolbar"))==null?void 0:c.getBoundingClientRect().height)||0,i=this.$refs.pager&&this.$refs.pager.$el,s=(i==null?void 0:i.getBoundingClientRect().height)||0,o=Ka(this.rule)*t,l=((r==null?void 0:r.getBoundingClientRect().height)||500)-n-s;if(this.maxH=this.offsetTop?Math.max(l,window.innerHeight-this.offsetTop):l,this.maxH<=0)return;let a=Math.min(Math.max(Math.round((this.maxH-o-t*1.5)/t),10),100);this.footerSummary&&(a-=1),this.currentPageSizes.includes(a)||(this.currentPageSizes=[...this.currentPageSizes,a].sort((d,f)=>d-f)),this.pageSize=a},async init(){if(typeof this.queryHandler!="function")return;const e=++this.requestVersion;this.loading=!0;try{const t=this.pagerFields,r={...this.query,[t.pageNo]:this.pageNo,[t.pageSize]:this.pageSize,[t.sortFieldTable]:this.sortFieldTable,[t.sortField]:this.sortField,[t.sortType]:this.sortType},n=await this.queryHandler(r);if(e!==this.requestVersion)return;const i=Array.isArray(n)?n:(n==null?void 0:n.data)??(n==null?void 0:n.list);if(!Array.isArray(i))throw new TypeError("AbTable queryHandler must return an array or an object containing a data or list array.");this.currentValue=i,this.total=Array.isArray(n)?n.length:n.total??i.length}finally{e===this.requestVersion&&(this.loading=!1)}},async reload(){this.pageNo=1,await this.init()},async refresh(){await this.init()},resize(){this.calculateTableHeight()},remove(e){const t=this.currentValue.indexOf(e);t>=0&&this.currentValue.splice(t,1),this.total=Math.max(0,this.total-1)},async exportData(e){const t=this.$refs.table;!t||typeof t.exportData!="function"||await t.exportData({filename:e||this.title,columns:this.currentRule.filter(r=>r.field&&r.field!==x.OPERATE&&!r.hidden)})},handlePageChange({currentPage:e,pageSize:t}){this.pageNo=e,this.pageSize=t,this.init()},handleSortChanged({field:e,order:t,column:r}){var n,i;t?(this.sortFieldTable=((n=r==null?void 0:r.params)==null?void 0:n.sortFieldTable)??this.idFieldTable??"",this.sortField=(((i=r==null?void 0:r.params)==null?void 0:i.sortField)||e).replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`),this.sortType=t):(this.sortFieldTable=this.idFieldTable??"",this.sortField=this.idField||"id",this.sortType="desc"),this.refresh()},handleCellClick({row:e,column:t}){var n,i;if((t==null?void 0:t.field)===x.OPERATE)return;const r=this.$refs.table;!this.editable||this.currentReadonly?(n=r==null?void 0:r.clearCheckboxRow)==null||n.call(r):(i=r==null?void 0:r.setCheckboxRow)==null||i.call(r,e,!0),this.$emit("cellClick",{row:e,column:t})},columnProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){const t={id:this.tableId,data:this.currentValue,stripe:!this.parentIdField,border:!0,size:this.vxeCurrentSize,loading:this.loading,showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,autoResize:!0,sortConfig:this.sortConfig,showFooter:!!this.footerSummary,footerData:this.currentFooterData,cellClassName:this.cellClassName,headerCellClassName:this.headerCellClassName,rowClassName:this.rowClassName,rowStyle:this.rowStyle,customConfig:{immediate:!0,storage:!0,restoreStore:(i={})=>{const s=i.storeData,o=i.$table||this.$refs.table;return!s||!o||typeof o.getFullColumns!="function"?s:za(s,o.getFullColumns())}}};this.maxH&&(t.maxHeight=this.maxH),this.compactMode&&(t.cellConfig={padding:!1,height:30});const r=this.currentRule.map((i,s)=>e("ab-table-columns",{props:this.columnProps(i,s),on:{refresh:this.refresh},key:i.field||s})),n=[e("vxe-table",{props:t,ref:"table",on:{"sort-change":this.handleSortChanged,"cell-click":this.handleCellClick}},r)];if(this.pagerEnable){const i={currentPage:this.pageNo,pageSize:this.pageSize,pageSizes:this.currentPageSizes,total:this.total};this.pagerConfig.layouts&&(i.layouts=this.pagerConfig.layouts),n.push(e("vxe-pager",{props:i,ref:"pager",on:{"page-change":this.handlePageChange}}))}return e("div",{class:"ab-table"},n)}};let Ua,Wa;const Bt={};var Ga=_(Va,Ua,Wa,!1,Qa,null,null,null);function Qa(e){for(let t in Bt)this[t]=Bt[t]}const Ja=function(){return Ga.exports}(),Xa={name:"AbTableColumns",props:{rule:{type:Object,required:!0},idx:{type:[Number,String],default:0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},computed:{isGroup(){var t;const e=this.rule||{};return!!((t=e.children)!=null&&t.length)&&(e.field?e.field!==x.OPERATE:!e.type&&!!e.title)}},methods:{childProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){return this.isGroup?e("vxe-colgroup",{props:{field:this.rule.field,title:this.rule.title,headerAlign:this.rule.groupAlign||this.rule.align||"center"}},(this.rule.children||[]).map((t,r)=>e("ab-table-columns",{props:this.childProps(t,r),on:{refresh:()=>this.$emit("refresh")},key:t.field||`${this.idx}_${r}`}))):e("ab-table-column",{props:this.childProps(this.rule,this.idx),on:{refresh:()=>this.$emit("refresh")}})}};let Za,el;const zt={};var tl=_(Xa,Za,el,!1,rl,null,null,null);function rl(e){for(let t in zt)this[t]=zt[t]}const nl=function(){return tl.exports}();function il(e,t){if(!e||typeof e.options!="function")return;if(e.__abOptionsPromise)return e.__abOptionsPromise;const r=e.options;return e.__abOptionsPromise=Promise.resolve().then(()=>r()).then(n=>(e.options=Array.isArray(n)?n:[],t&&t(e.options),e.options)).catch(()=>(e.options=[],t&&t(e.options),e.options)),e.__abOptionsPromise}const sl={name:"AbTableColumn",props:{rule:{type:Object,required:!0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},data(){return{loadedOptions:void 0}},created(){il(this.rule,e=>{this.loadedOptions=e})},computed:{effectiveRule(){return this.loadedOptions?{...this.rule,options:this.loadedOptions}:this.rule},isVisible(){return!this.rule.hidden},ruleSortable(){return this.sortable!==!1&&this.rule.sortable!==!1&&this.rule.sortFieldTable!==!1&&(this.rule.sortable===!0||this.rule.sortFieldTable!==void 0||!!this.idFieldTable)},ruleParams(){var e,t;return{...this.rule.params||{},sortField:this.rule.sortField??((e=this.rule.params)==null?void 0:e.sortField),sortFieldTable:typeof this.rule.sortFieldTable=="string"?this.rule.sortFieldTable:((t=this.rule.params)==null?void 0:t.sortFieldTable)??this.idFieldTable??""}},formatter(){return Te(this.effectiveRule).formatter}},methods:{changeHandler({cellValue:e,row:t,column:r}){var n,i;typeof((i=(n=this.rule)==null?void 0:n.on)==null?void 0:i.change)=="function"&&this.rule.on.change({cellValue:e,row:t,column:r})},formattedValue(e){const t=e.row?e.row[this.rule.field]:void 0;return this.formatter?this.formatter({cellValue:t,column:e.column,row:e.row}):t??""},renderCell(e,t){const r=this.rule.field,n=t.row?t.row[r]:void 0,i=[];if(this.rule.type==="ElRow"&&r===x.OPERATE?i.push(e("ab-table-operate",{props:{idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,rule:this.rule,modelValue:t.row,deleteHandler:this.deleteHandler,readonly:this.readonly,link:!0},on:{refresh:()=>this.$emit("refresh")}})):this.rule.cellRender&&this.rule.type==="switch"?i.push(e("el-switch",{props:{...this.rule.props||{},value:n},on:{change:s=>{t.row[r]=s,this.changeHandler({cellValue:s,row:t.row,column:t.column})}}})):this.rule.cellRender?i.push(this.rule.type||""):this.rule.link?i.push(e("ab-router-link",{props:{link:this.rule.link,value:n,row:t.row}},[String(this.formattedValue(t)??"")])):i.push(String(this.formattedValue(t)??"")),this.rule.cellArrow){const s=Number(n)<0;i.push(e("ab-icon",{props:{icon:s?"streamline:graph-arrow-decrease":"streamline:graph-arrow-increase"},class:s?"danger":"success"}))}return i}},render(e){if(!this.rule.field)return e("span");const t={title:this.rule.title,field:this.rule.field,sortable:this.ruleSortable,params:this.ruleParams,width:this.rule.width||"auto",minWidth:this.rule.minWidth,align:this.rule.align,fixed:this.rule.fixed,visible:this.isVisible,className:this.rule.cellArrow?"items-center":""};return e("vxe-column",{props:t,scopedSlots:{default:r=>this.renderCell(e,r)}})}};let ol,al;const Lt={};var ll=_(sl,ol,al,!1,cl,null,null,null);function cl(e){for(let t in Lt)this[t]=Lt[t]}const ul=function(){return ll.exports}(),ve=e=>{if(Array.isArray(e))return e.map(ve);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(r=>{t[r]=ve(e[r])}),t}return e},dl=(...e)=>{const t=[],r=new Set,n=i=>{if(i){if(typeof i=="string"){if(r.has(i))return;r.add(i)}t.push(i)}};return e.forEach(i=>{i&&(Array.isArray(i)?i.forEach(n):n(i))}),t},fl={name:"AbTableOperate",inject:{abTableRef:{default:()=>({})},abTableDetailRef:{default:()=>({})}},props:{rule:{type:[Object,Array],default:void 0},modelValue:{type:Object,default:()=>({})},idField:String,idFieldTable:String,permiPrefix:String,link:Boolean,plain:Boolean,deleteHandler:Function,readonly:Boolean},computed:{formOption(){const{getCurrentSize:e}=C(),t=e();return{formData:this.value,form:{size:t}}},rules(){var t,r,n,i,s,o,l;if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=Array.isArray(this.rule)?{type:"ElRow",children:ve(this.rule),native:!0}:{...ve(this.rule),native:!0};delete e.field;for(const a of e.children||[])if(a.props=this.buttonProps(((t=a.props)==null?void 0:t.type)||"primary",a),a.field===x.CREATE?(a.children=[{type:"icon",props:{icon:"ep:plus"}},"新增"],a.props=this.buttonProps("primary",a),(r=a.on)!=null&&r.click||(a.on={...a.on||{},click:this.createHandler}),this.permiPrefix&&!((n=a.computed)!=null&&n.hidden)&&(a.computed={...a.computed||{},hidden:this.createEnabled})):a.field===x.DETAIL?(a.children=[{type:"icon",props:{icon:"ep:view"}},"详情"],a.props=this.buttonProps("primary",a),(i=a.on)!=null&&i.click||(a.on={...a.on||{},click:this.detailHandler})):a.field===x.DEL?(a.children=[{type:"icon",props:{icon:"ep:delete"}},"删除"],a.props=this.buttonProps("danger",a),(s=a.on)!=null&&s.click||(a.on={...a.on||{},click:this.delHandler}),this.permiPrefix&&!((o=a.computed)!=null&&o.hidden)&&(a.computed={...a.computed||{},hidden:this.deleteEnabled})):a.field===x.EXPORT&&(a.children=[{type:"icon",props:{icon:"ep:download"}},"导出"],a.props=this.buttonProps("warning",a),this.permiPrefix&&!((l=a.computed)!=null&&l.hidden)&&(a.computed={...a.computed||{},hidden:this.exportEnabled})),a.native=!0,a.computed&&a.computed.hidden!==void 0&&(a.hidden=typeof a.computed.hidden=="function"?!!a.computed.hidden():!!a.computed.hidden),a.inject&&a.on&&typeof a.on.click=="function"){const u=a.on.click,c=this.modelValue;a.on.click=d=>u({api:{getValue:f=>(c||{})[f]},row:c,...d&&typeof d=="object"?d:{}})}return[e]}},methods:{buttonProps(e,t){const r={plain:this.plain,size:"mini"};return this.link?(r.type="text",t&&(t.class=dl(t.class,`${e}`))):r.type=e,r},createEnabled(){return!He([`${this.permiPrefix}:create`],["admin"])},deleteEnabled(){return!He([`${this.permiPrefix}:delete`],["admin"])},exportEnabled(){return!He([`${this.permiPrefix}:export`],["admin"])},toggleDetail(e){const t=this.abTableDetailRef&&this.abTableDetailRef.value;t&&typeof t.toggle=="function"&&t.toggle(!0,this.modelValue,e)},createHandler(){this.toggleDetail(!1)},detailHandler(){this.toggleDetail(this.readonly)},async delHandler(){typeof this.deleteHandler=="function"&&this.idField&&await this.deleteHandler(this.modelValue[this.idField]);const e=this.abTableRef&&this.abTableRef.value;e&&typeof e.remove=="function"&&e.remove(this.modelValue),this.$emit("refresh")}},render(e){return this.rules?e("ab-form",{props:{rule:this.rules,value:this.modelValue,inline:!0},on:{refresh:()=>this.$emit("refresh"),input:t=>this.$emit("input",t)}}):e("span")}};let pl,hl;const qt={};var ml=_(fl,pl,hl,!1,bl,null,null,null);function bl(e){for(let t in qt)this[t]=qt[t]}const gl=function(){return ml.exports}();function yl(e){e.component("ab-table",Ja),e.component("ab-table-columns",nl),e.component("ab-table-column",ul),e.component("ab-table-operate",gl),e.component("ab-router-link",ae)}var _l=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"ab-detail"},[r("el-card",{staticClass:"ab-detail__header w-full",attrs:{shadow:"never"}},[r("div",{staticClass:"ab-detail__title"},[e._v(e._s(e.currentTitle))]),r("ab-table-operate",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"ab-detail__opr",attrs:{"permi-prefix":e.permiPrefix,rule:e.operationRule,"model-value":e.currentValue,plain:"",readonly:e.currentReadonly},on:{input:function(n){e.oapi=n}}})],1),r("el-card",{staticClass:"ab-detail__form",attrs:{shadow:"never"}},[r("ab-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"formRef",attrs:{option:e.formOption,rule:e.formRules,"id-field":e.idField,"id-field-table":e.idFieldTable,readonly:e.currentReadonly},on:{input:e.handleFormApi,change:e.handleFormChange}})],1)],1)},vl=[];function xl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.render=="function"}function J(e){if(xl(e))return e;if(Array.isArray(e))return e.map(J);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(r=>{t[r]=J(e[r])}),t}return e}const wl={name:"AbDetail",provide(){return{abTableDetailRef:{value:this}}},props:{title:String,id:{type:[String,Number],default:void 0},idField:{type:String,default:"id"},idFieldTable:String,value:{type:Object,default:()=>({})},rule:{type:Array,default:()=>[]},validRules:Object,permiPrefix:String,getHandler:Function,createHandler:Function,updateHandler:Function,deleteHandler:Function,vertical:Boolean,detailLevel:{type:Number,default:1},editable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!0}},data(){return{currentValue:{},currentReadonly:this.readonly,loading:!1,fapi:void 0,oapi:void 0}},computed:{formOption(){const{getCurrentSize:e}=C();return{form:{size:e()}}},isCreate(){const e=this.currentValue?this.currentValue[this.idField]:void 0;return!e||e==="new"},currentTitle(){const e=this.title||this.$route&&this.$route.meta&&this.$route.meta.title||"";return this.isCreate?`新增 - ${e}`:this.currentReadonly?`详情 - ${e}`:`编辑 - ${e}`},rules(){return(this.rule||[]).map(e=>e&&typeof e.getRule=="function"?e.getRule():e)},operationRule(){const e=this.rules.find(n=>n.type!==x.OPERATE&&n.field===x.OPERATE),t=e?J(e):{type:"ElRow",field:x.OPERATE,title:"操作",width:260,fixed:"right",children:[]};t.children=(t.children||[]).filter(n=>n.field!==x.DETAIL);const r=this;return t.children.push({type:"ElButton",hidden:!this.currentReadonly,children:[{type:"icon",props:{icon:"ep:edit-pen"}},"编辑"],props:{type:"primary"},on:{click:()=>r.editHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:check"}},"保存"],props:{type:"success",plain:!0},on:{click:()=>r.saveHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:refresh-right"}},"取消"],on:{click:()=>r.cancelHandler()}},{type:"ElButton",children:[{type:"icon",props:{icon:"ep:back"}},"返回"],on:{click:()=>r.returnHandler()}}),t},formRules(){return this.rules.filter(e=>e.type!==x.OPERATE&&e.field!==x.OPERATE).map(e=>J(e))}},watch:{value:{handler(e){this.currentValue={...e},this.syncFormData(e)},immediate:!0,deep:!0},readonly(e){this.currentReadonly=e},id(e){this.init(e)}},mounted(){this.init(this.id)},methods:{formApi(){return this.fapi||this.$refs.formRef&&this.$refs.formRef.$f},handleFormApi(e){this.fapi=e},handleFormChange(){const e=this.formApi(),t=e?e.formData():{...this.currentValue};this.currentValue=t,this.$emit("input",t)},resetFormData(){const e=this.formApi();e&&typeof e.resetFields=="function"&&e.resetFields()},syncFormData(e){const t=this.formApi();!t||!e||Object.keys(e).forEach(r=>t.setValue(r,e[r]))},refreshForm(){const e=this.formApi();e&&typeof e.refresh=="function"&&e.refresh()},async init(e){this.loading=!0;let t;e!=null&&typeof this.getHandler=="function"?t=await this.getHandler(e)||{}:t={},this.currentValue=t,await this.$nextTick(),this.resetFormData(),this.syncFormData(t),this.refreshForm(),this.loading=!1,this.$emit("input",this.currentValue)},editHandler(){this.currentReadonly=!1,this.refreshForm()},async saveHandler(){if(this.loading=!0,this.isCreate&&typeof this.createHandler=="function"){const e=await this.createHandler(this.currentValue);e&&(this.currentValue[this.idField]=e),await this.$nextTick(),this.$emit("input",this.currentValue)}else!this.isCreate&&typeof this.updateHandler=="function"&&await this.updateHandler(this.currentValue);this.loading=!1,this.close()},cancelHandler(){this.currentReadonly=!0,this.refreshForm()},returnHandler(){this.close()},async open(e=void 0,t=!1){this.currentReadonly=t,this.loading=!0;let r;typeof this.getHandler=="function"&&e&&e[this.idField]?r=await this.getHandler(e[this.idField])||{}:(r=J(e)||{},this.rules.forEach(n=>{n.field&&n.field!==x.OPERATE&&typeof r[n.field]>"u"&&typeof n.edit>"u"&&typeof n.itemRender>"u"&&(r[n.field]="")})),this.currentValue=r,await this.$nextTick(),this.resetFormData(),this.syncFormData(r),this.refreshForm(),this.loading=!1,this.$emit("open",this.currentValue),this.$emit("input",this.currentValue)},close(){this.currentReadonly=!0,this.currentValue={},this.resetFormData(),this.$emit("close")},toggle(e=!1,t=void 0,r=!1){return e?this.open(t,r):this.close()},async reload(){if(typeof this.getHandler!="function"||!this.currentValue[this.idField]){console.error("abTableDetail.reload: no getHandler or no idField!");return}const e=await this.getHandler(this.currentValue[this.idField]);this.open(e,this.currentReadonly)}}},Yt={};var $l=_(wl,_l,vl,!1,Sl,null,null,null);function Sl(e){for(let t in Yt)this[t]=Yt[t]}const Kr=function(){return $l.exports}();function Cl(e){e.component("ab-detail",Kr)}const Tl=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),kl={name:"AbToolbar",inject:{abTableRef:{default:()=>({})}},props:{title:String,permiPrefix:String,rule:{type:[Object,Array],default:void 0},queryHandler:Function,refreshEnable:{type:Boolean,default:!0},exportEnable:{type:Boolean,default:!1},settingEnable:{type:Boolean,default:!0},btnTreeEnable:Boolean,classNmae:String,vertical:{type:Boolean,default:!1}},data(){return{loading:!1}},computed:{vxeCurrentSize(){return Yr("default")},currentRule(){if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=Tl(this.rule);return Array.isArray(e)?{type:"ElRow",children:[...e]}:e},refreshHandler(){if(this.queryHandler)return this.queryHandler;const e=this.abTableRef&&this.abTableRef.value;if(e&&typeof e.reload=="function")return e.reload}},mounted(){const e=this.abTableRef&&this.abTableRef.value,t=this.$refs.toolbar&&(this.$refs.toolbar.$el?this.$refs.toolbar:this.$refs.toolbar);e&&e.tableRef&&t&&typeof e.tableRef.connect=="function"&&e.tableRef.connect(t)},methods:{getTitle(){return this.title},renderButtons(e){var t,r;return this.title?e("div",{class:"ab-toolbar__title"},[this.$slots.icon,this.title]):this.$slots.buttons?this.$slots.buttons:e("div",{class:"ab-toolbar__title"},[((r=(t=this.$route)==null?void 0:t.meta)==null?void 0:r.title)||""])},renderTools(e){const t=[...this.$slots.tools||[]];return this.currentRule&&t.push(e("ab-table-operate",{props:{permiPrefix:this.permiPrefix,rule:this.currentRule,plain:!0}})),t}},render(e){return e("vxe-toolbar",{class:"ab-toolbar",ref:"toolbar",props:{className:this.classNmae,size:this.vxeCurrentSize,loading:this.loading,export:this.exportEnable,refresh:this.refreshEnable,refreshOptions:this.refreshEnable&&this.refreshHandler?{queryMethod:this.refreshHandler}:void 0,custom:!!this.settingEnable,vertical:this.vertical},scopedSlots:{buttons:()=>this.renderButtons(e),tools:()=>this.renderTools(e)}})}};let Fl,Al;const Kt={};var Pl=_(kl,Fl,Al,!1,El,null,null,null);function El(e){for(let t in Kt)this[t]=Kt[t]}const Il=function(){return Pl.exports}();function Dl(e){e.component("ab-toolbar",Il)}const ke=Ta();typeof window<"u"&&(window.abForm=ke);function xe(e,t={}){t&&t.upload&&(e.prototype.$abUploadApis=t.upload),!xe.installed&&(xe.installed=!0,ka(e,{AbForm:ke}),Da(e),Ha(e),yl(e),Cl(e),Dl(e))}const Rl=ke.maker,Nl={install:xe};exports.AbDetail=Kr;exports.AbDrawer=zr;exports.AbForm=ke;exports.AbIcon=rt;exports.AbSearch=Br;exports.AbSelect=Vt;exports.AbTreeSelect=kr;exports.default=Nl;exports.maker=Rl;exports.setupArchbizKit=xe;
11
+ */const tn=Object.freeze({left:0,top:0,width:16,height:16}),Se=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),le=Object.freeze(p(p({},tn),Se)),Ue=Object.freeze(g(p({},le),{body:"",hidden:!1}));function $r(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function mt(e,t){const n=$r(e,t);for(const r in Ue)r in Se?r in e&&!(r in n)&&(n[r]=Se[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function wr(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(n[o])return i[o]=[];if(!(o in i)){i[o]=null;const l=r[o]&&r[o].parent,a=l&&s(l);a&&(i[o]=[l].concat(a))}return i[o]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),i}function Sr(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function o(l){s=mt(r[l]||i[l],s)}return o(t),n.forEach(o),mt(e,s)}function nn(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=wr(e);for(const i in r){const s=r[i];s&&(t(i,Sr(e,i,s)),n.push(i))}return n}const Z=/^[a-z0-9]+(-[a-z0-9]+)*$/,V=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),a=i.pop(),c={provider:i.length>0?i[0]:r,prefix:a,name:l};return t&&!ve(c)?null:c}const s=i[0],o=s.split("-");if(o.length>1){const l={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!ve(l)?null:l}if(n&&r===""){const l={provider:r,prefix:"",name:s};return t&&!ve(l,n)?null:l}return null},ve=(e,t)=>e?!!((e.provider===""||e.provider.match(Z))&&(t&&e.prefix===""||e.prefix.match(Z))&&e.name.match(Z)):!1,xr=p({provider:"",aliases:{},not_found:{}},tn);function Ne(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function rn(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Ne(e,xr))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Z)||typeof s.body!="string"||!Ne(s,Ue))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],o=s.parent;if(!i.match(Z)||typeof o!="string"||!n[o]&&!r[o]||!Ne(s,Ue))return null}return t}const xe=Object.create(null);function Cr(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function I(e,t){const n=xe[e]||(xe[e]=Object.create(null));return n[t]||(n[t]=Cr(e,t))}function rt(e,t){return rn(t)?nn(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Tr(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=p({},n),!0}catch(r){}return!1}function Fr(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(xe)).forEach(i=>{(typeof i=="string"&&typeof t=="string"?[t]:Object.keys(xe[i]||{})).forEach(o=>{const l=I(i,o);n=n.concat(Object.keys(l.icons).map(a=>(i!==""?"@"+i+":":"")+o+":"+a))})}),n}let re=!1;function Ar(e){return typeof e=="boolean"&&(re=e),re}function ce(e){const t=typeof e=="string"?V(e,!0,re):e;if(t){const n=I(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function sn(e,t){const n=V(e,!0,re);if(!n)return!1;const r=I(n.provider,n.prefix);return Tr(r,n.name,t)}function on(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),re&&!t&&!e.prefix){let i=!1;return rn(e)&&(e.prefix="",nn(e,(s,o)=>{o&&sn(s,o)&&(i=!0)})),i}const n=e.prefix;if(!ve({provider:t,prefix:n,name:"a"}))return!1;const r=I(t,n);return!!rt(r,e)}function kr(e){return!!ce(e)}function Pr(e){const t=ce(e);return t?p(p({},le),t):null}const an=Object.freeze({width:null,height:null}),ln=Object.freeze(p(p({},an),Se)),Er=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ir=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ve(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Er);if(r===null||!r.length)return e;const i=[];let s=r.shift(),o=Ir.test(s);for(;;){if(o){const l=parseFloat(s);isNaN(l)?i.push(s):i.push(Math.ceil(l*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");o=!o}}const Dr=e=>e==="unset"||e==="undefined"||e==="none";function ke(e,t){const n=p(p({},le),e),r=p(p({},ln),t),i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(h=>{const m=[],v=h.hFlip,x=h.vFlip;let w=h.rotate;v?x?w+=2:(m.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),m.push("scale(-1 1)"),i.top=i.left=0):x&&(m.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),m.push("scale(1 -1)"),i.top=i.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=i.height/2+i.top,m.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:m.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:S=i.width/2+i.left,m.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(i.left!==i.top&&(S=i.left,i.left=i.top,i.top=S),i.width!==i.height&&(S=i.width,i.width=i.height,i.height=S)),m.length&&(s='<g transform="'+m.join(" ")+'">'+s+"</g>")});const o=r.width,l=r.height,a=i.width,c=i.height;let u,f;o===null?(f=l===null?"1em":l==="auto"?c:l,u=Ve(f,a/c)):(u=o==="auto"?a:o,f=l===null?Ve(u,c/a):l==="auto"?c:l);const d={},y=(h,m)=>{Dr(m)||(d[h]=m.toString())};return y("width",u),y("height",f),d.viewBox=i.left.toString()+" "+i.top.toString()+" "+a.toString()+" "+c.toString(),{attributes:d,body:s}}const Rr=/\sid="(\S+)"/g,Nr="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Or=0;function cn(e,t=Nr){const n=[];let r;for(;r=Rr.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Or++).toString(),l=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const q={local:!0,session:!0},un={local:new Set,session:new Set};let it=!1;function jr(e){it=e}const yt="iconify2",ie="iconify",dn=ie+"-count",gt=ie+"-version",fn=36e5,Mr=168;function We(e,t){try{return e.getItem(t)}catch(n){}}function st(e,t,n){try{return e.setItem(t,n),!0}catch(r){}}function bt(e,t){try{e.removeItem(t)}catch(n){}}function Ge(e,t){return st(e,dn,t.toString())}function Qe(e){return parseInt(We(e,dn))||0}let ye=typeof window=="undefined"?{}:window;function pn(e){const t=e+"Storage";try{if(ye&&ye[t]&&typeof ye[t].length=="number")return ye[t]}catch(n){}q[e]=!1}function hn(e,t){const n=pn(e);if(!n)return;const r=We(n,gt);if(r!==yt){if(r){const l=Qe(n);for(let a=0;a<l;a++)bt(n,ie+a.toString())}st(n,gt,yt),Ge(n,0);return}const i=Math.floor(Date.now()/fn)-Mr,s=l=>{const a=ie+l.toString(),c=We(n,a);if(typeof c=="string"){try{const u=JSON.parse(c);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>i&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,l))return!0}catch(u){}bt(n,a)}};let o=Qe(n);for(let l=o-1;l>=0;l--)s(l)||(l===o-1?(o--,Ge(n,o)):un[e].add(l))}function mn(){if(!it){jr(!0);for(const e in q)hn(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=I(r,i);if(!rt(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function yn(e,t){switch(e){case"local":case"session":q[e]=t;break;case"all":for(const n in q)q[n]=t;break}}const Je=Object.create(null);function gn(e,t){Je[e]=t}function Xe(e){return Je[e]||Je[""]}function ot(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Pe=Object.create(null),Q=["https://api.simplesvg.com","https://api.unisvg.com"],$e=[];for(;Q.length>0;)Q.length===1||Math.random()>.5?$e.push(Q.shift()):$e.push(Q.pop());Pe[""]=ot({resources:["https://api.iconify.design"].concat($e)});function bn(e,t){const n=ot(t);return n===null?!1:(Pe[e]=n,!0)}function Ee(e){return Pe[e]}function Hr(){return Object.keys(Pe)}const Br=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch(t){}};let Ce=Br();function Lr(e){Ce=e}function zr(){return Ce}function qr(e,t){const n=Ee(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Yr(e){return e===404}const Kr=(e,t,n)=>{const r=[],i=qr(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},l=0;return n.forEach((a,c)=>{l+=a.length+1,l>=i&&c>0&&(r.push(o),o={type:s,provider:e,prefix:t,icons:[]},l=a.length),o.icons.push(a)}),r.push(o),r};function Ur(e){if(typeof e=="string"){const t=Ee(e);if(t)return t.path}return"/"}const Vr=(e,t,n)=>{if(!Ce){n("abort",424);return}let r=Ur(t.provider);switch(t.type){case"icons":{const s=t.prefix,l=t.icons.join(","),a=new URLSearchParams({icons:l});r+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;Ce(e+r).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Yr(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},Wr={prepare:Kr,send:Vr};function Gr(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,o=i.prefix,l=i.name,a=n[s]||(n[s]=Object.create(null)),c=a[o]||(a[o]=I(s,o));let u;l in c.icons?u=t.loaded:o===""||c.missing.has(l)?u=t.missing:u=t.pending;const f={provider:s,prefix:o,name:l};u.push(f)}),t}function _n(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Qr(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,l=o.pending.length;o.pending=o.pending.filter(a=>{if(a.prefix!==i)return!0;const c=a.name;if(e.icons[c])o.loaded.push({provider:r,prefix:i,name:c});else if(e.missing.has(c))o.missing.push({provider:r,prefix:i,name:c});else return n=!0,!0;return!1}),o.pending.length!==l&&(n||_n([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let Jr=0;function Xr(e,t,n){const r=Jr++,i=_n.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function Zr(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?V(i,t,n):i;s&&r.push(s)}),r}var ei={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ti(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let _=e.resources.slice(0);for(o=[];_.length>1;){const k=Math.floor(Math.random()*_.length);o.push(_[k]),_=_.slice(0,k).concat(_.slice(k+1))}o=o.concat(_)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const l=Date.now();let a="pending",c=0,u,f=null,d=[],y=[];typeof r=="function"&&y.push(r);function h(){f&&(clearTimeout(f),f=null)}function m(){a==="pending"&&(a="aborted"),h(),d.forEach(_=>{_.status==="pending"&&(_.status="aborted")}),d=[]}function v(_,k){k&&(y=[]),typeof _=="function"&&y.push(_)}function x(){return{startTime:l,payload:t,status:a,queriesSent:c,queriesPending:d.length,subscribe:v,abort:m}}function w(){a="failed",y.forEach(_=>{_(void 0,u)})}function S(){d.forEach(_=>{_.status==="pending"&&(_.status="aborted")}),d=[]}function j(_,k,G){const pe=k!=="success";switch(d=d.filter(L=>L!==_),a){case"pending":break;case"failed":if(pe||!e.dataAfterTimeout)return;break;default:return}if(k==="abort"){u=G,w();return}if(pe){u=G,d.length||(o.length?W():w());return}if(h(),S(),!e.random){const L=e.resources.indexOf(_.resource);L!==-1&&L!==e.index&&(e.index=L)}a="completed",y.forEach(L=>{L(G)})}function W(){if(a!=="pending")return;h();const _=o.shift();if(_===void 0){if(d.length){f=setTimeout(()=>{h(),a==="pending"&&(S(),w())},e.timeout);return}w();return}const k={status:"pending",resource:_,callback:(G,pe)=>{j(k,G,pe)}};d.push(k),c++,f=setTimeout(W,e.rotate),n(_,t,k.callback)}return setTimeout(W),x}function vn(e){const t=p(p({},ei),e);let n=[];function r(){n=n.filter(l=>l().status==="pending")}function i(l,a,c){const u=ti(t,l,a,(f,d)=>{r(),c&&c(f,d)});return n.push(u),u}function s(l){return n.find(a=>l(a))||null}return{query:i,find:s,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:r}}function _t(){}const Oe=Object.create(null);function ni(e){if(!Oe[e]){const t=Ee(e);if(!t)return;const n=vn(t),r={config:t,redundancy:n};Oe[e]=r}return Oe[e]}function $n(e,t,n){let r,i;if(typeof e=="string"){const s=Xe(e);if(!s)return n(void 0,424),_t;i=s.send;const o=ni(e);o&&(r=o.redundancy)}else{const s=ot(e);if(s){r=vn(s);const o=e.resources?e.resources[0]:"",l=Xe(o);l&&(i=l.send)}}return!r||!i?(n(void 0,424),_t):r.query(t,i,n)().abort}function ri(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in q)hn(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function ii(e,t){it||mn();function n(r){let i;if(!q[r]||!(i=pn(r)))return;const s=un[r];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=Qe(i),!Ge(i,o+1))return;const l={cached:Math.floor(Date.now()/fn),provider:e.provider,data:t};return st(i,ie+o.toString(),JSON.stringify(l))}t.lastModified&&!ri(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function vt(){}function si(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Qr(e)}))}function oi(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=Xe(n)))return;s.prepare(n,r,i).forEach(l=>{$n(n,l,a=>{if(typeof a!="object")l.icons.forEach(c=>{e.missing.add(c)});else try{const c=rt(e,a);if(!c.length)return;const u=e.pendingIcons;u&&c.forEach(f=>{u.delete(f)}),ii(e,a)}catch(c){console.error(c)}si(e)})})}))}const ai=e=>{const n=I(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},at=(e,t)=>{const n=Zr(e,!0,Ar()),r=Gr(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,vt)}),()=>{a=!1}}const i=Object.create(null),s=[];let o,l;return r.pending.forEach(a=>{const{provider:c,prefix:u}=a;if(u===l&&c===o)return;o=c,l=u,s.push(I(c,u));const f=i[c]||(i[c]=Object.create(null));f[u]||(f[u]=[])}),r.pending.forEach(a=>{const{provider:c,prefix:u,name:f}=a,d=I(c,u),y=d.pendingIcons||(d.pendingIcons=new Set);y.has(f)||(y.add(f),i[c][u].push(f))}),s.forEach(a=>{const{provider:c,prefix:u}=a;i[c][u].length&&oi(a,i[c][u])}),t?Xr(t,r,s):vt},li=e=>new Promise((t,n)=>{const r=typeof e=="string"?V(e,!0):e;if(!r){n(e);return}at([r||e],i=>{if(i.length&&r){const s=ce(r);if(s){t(p(p({},le),s));return}}n(e)})});function wn(e,t){const n=p({},e);for(const r in t){const i=t[r],s=typeof i;r in an?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Ie=g(p({},ln),{inline:!1}),je="iconify",Ze="iconify-inline",H="iconifyData"+Date.now();let Y=[];function ue(e){for(let t=0;t<Y.length;t++){const n=Y[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Sn(e,t=!1){let n=ue(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},Y.push(n),n)}function ci(){if(document.documentElement)return Sn(document.documentElement);Y.push({node:()=>document.documentElement})}function ui(e){Y=Y.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function de(){return Y}function di(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let ee=null;const fi={childList:!0,subtree:!0,attributes:!0};function xn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,ee&&ee(e)}))}function pi(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const i=t[r];if(i.addedNodes&&i.addedNodes.length>0||i.type==="attributes"&&i.target[H]!==void 0){n.paused||xn(e);return}}}function Cn(e,t){e.observer.instance.observe(t,fi)}function Te(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(pi.bind(null,e)),Cn(e,n),t.paused||xn(e))}function $t(){de().forEach(Te)}function Tn(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function hi(e){const t=ee!==null;if(ee!==e&&(ee=e,t&&de().forEach(Tn)),t){$t();return}di($t)}function et(e){(e?[e]:de()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function mi(e){if(e){const t=ue(e);t&&et(t)}else et()}function tt(e){(e?[e]:de()).forEach(t=>{if(!t.observer){Te(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Cn(t,r):Te(t);else return}})}function yi(e){if(e){const t=ue(e);t&&tt(t)}else tt()}function Fn(e,t=!1){const n=Sn(e,t);return Te(n),n}function An(e){const t=ue(e);t&&(Tn(t),ui(e))}function gi(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const i in Ie)if(n[i]!==r[i])return!0;return!1}function bi(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}const _i=/[\s,]+/;function vi(e,t){t.split(_i).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const $i=["width","height"],wi=["inline","hFlip","vFlip"];function Si(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function xi(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&V(t,!0);if(!n)return null;const r=g(p({},Ie),{inline:e.classList&&e.classList.contains(Ze)});$i.forEach(l=>{const a=e.getAttribute("data-"+l);a&&(r[l]=a)});const i=e.getAttribute("data-rotate");typeof i=="string"&&(r.rotate=bi(i));const s=e.getAttribute("data-flip");typeof s=="string"&&vi(r,s),wi.forEach(l=>{const a="data-"+l,c=Si(e.getAttribute(a),a);typeof c=="boolean"&&(r[l]=c)});const o=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:o}}const Ci="svg."+je+", i."+je+", span."+je+", i."+Ze+", span."+Ze;function Ti(e){const t=[];return e.querySelectorAll(Ci).forEach(n=>{const r=n[H]||n.tagName.toLowerCase()!=="svg"?xi(n):null;r&&t.push({node:n,props:r})}),t}function kn(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let te;function Fi(){try{te=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){te=null}}function Ai(e){return te===void 0&&Fi(),te?te.createHTML(e):e}function Pn(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function En(e,t,n,r){const i=e.classList;if(r){const o=r.classList;Array.from(o).forEach(l=>{i.add(l)})}const s=[];return t.forEach(o=>{i.contains(o)?n.has(o)&&s.push(o):(i.add(o),s.push(o))}),n.forEach(o=>{t.has(o)||i.remove(o)}),s}function In(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const i=[];for(const s in t)r.getPropertyValue(s)||(i.push(s),r.setProperty(s,t[s]));return i}function Dn(e,t,n){let r;try{r=document.createElement("span")}catch(h){return e}const i=t.customisations,s=ke(n,i),o=e[H],l=kn(cn(s.body),p({"aria-hidden":"true",role:"img"},s.attributes));r.innerHTML=Ai(l);const a=r.childNodes[0],c=e.attributes;for(let h=0;h<c.length;h++){const m=c.item(h),v=m.name;v!=="class"&&!a.hasAttribute(v)&&a.setAttribute(v,m.value)}const u=Pn(t.icon),f=En(a,u,new Set(o&&o.addedClasses),e),d=In(a,i.inline?{"vertical-align":"-0.125em"}:{},o&&o.addedStyles),y=g(p({},t),{status:"loaded",addedClasses:f,addedStyles:d});return a[H]=y,e.parentNode&&e.parentNode.replaceChild(a,e),a}function ki(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Pi(e){return"data:image/svg+xml,"+ki(e)}function Ei(e){return'url("'+Pi(e)+'")'}const Ii={display:"inline-block"},nt={"background-color":"currentColor"},Rn={"background-color":"transparent"},wt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},St={"-webkit-mask":nt,mask:nt,background:Rn};for(const e in St){const t=St[e];for(const n in wt)t[e+"-"+n]=wt[n]}function xt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Di(e,t,n,r){const i=t.customisations,s=ke(n,i),o=s.attributes,l=e[H],a=kn(s.body,g(p({},o),{width:n.width+"",height:n.height+""})),c=Pn(t.icon),u=En(e,c,new Set(l&&l.addedClasses)),f=Ei(a),d=p(p({"--svg":f,width:xt(o.width),height:xt(o.height)},Ii),r?nt:Rn);i.inline&&(d["vertical-align"]="-0.125em");const y=In(e,d,l&&l.addedStyles),h=g(p({},t),{status:"loaded",addedClasses:u,addedStyles:y});return e[H]=h,e}let ge=!1;function Ri(){ge||(ge=!0,setTimeout(()=>{ge&&(ge=!1,U())}))}function U(e,t=!1){const n=Object.create(null);function r(i,s){const{provider:o,prefix:l,name:a}=i,c=I(o,l),u=c.icons[a];if(u)return{status:"loaded",icon:u};if(c.missing.has(a))return{status:"missing"};if(s&&!ai(i)){const f=n[o]||(n[o]=Object.create(null));(f[l]||(f[l]=new Set)).add(a)}return{status:"loading"}}(e?[e]:de()).forEach(i=>{const s=typeof i.node=="function"?i.node():i.node;if(!s||!s.querySelectorAll)return;let o=!1,l=!1;function a(c,u,f){if(l||(l=!0,et(i)),c.tagName.toUpperCase()!=="SVG"){const d=u.mode,y=d==="mask"||(d==="bg"?!1:d==="style"?f.body.indexOf("currentColor")!==-1:null);if(typeof y=="boolean"){Di(c,u,p(p({},le),f),y);return}}Dn(c,u,f)}Ti(s).forEach(({node:c,props:u})=>{const f=c[H];if(!f){const{status:y,icon:h}=r(u.icon,!0);if(h){a(c,u,h);return}o=o||y==="loading",c[H]=g(p({},u),{status:y});return}let d;if(gi(f,u)){if(d=r(u.icon,f.name!==u.name),!d.icon){o=o||d.status==="loading",Object.assign(f,g(p({},u),{status:d.status}));return}}else{if(f.status!=="loading")return;if(d=r(u.icon,!1),!d.icon){f.status=d.status;return}}a(c,u,d.icon)}),i.temporary&&!o?An(s):t&&o?Fn(s,!0):l&&i.observer&&tt(i)});for(const i in n){const s=n[i];for(const o in s){const l=s[o];at(Array.from(l).map(a=>({provider:i,prefix:o,name:a})),Ri)}}}function Ni(e){const t=ue(e);t?U(t):U({node:e,temporary:!0},!0)}function Nn(e,t,n=!1){const r=ce(e);if(!r)return null;const i=V(e),s=wn(Ie,t||{}),o=Dn(document.createElement("span"),{name:e,icon:i,customisations:s},r);return n?o.outerHTML:o}function Oi(){return"3.1.1"}function ji(e,t){return Nn(e,t,!1)}function Mi(e,t){return Nn(e,t,!0)}function Hi(e,t){const n=ce(e);if(!n)return null;const r=wn(Ie,t||{});return ke(n,r)}function Bi(e){e?Ni(e):U()}if(typeof document!="undefined"&&typeof window!="undefined"){ci();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!on(r))&&console.error(n)}catch(i){console.error(n)}})}setTimeout(()=>{hi(U),U()})}function Li(e,t){yn(e,t!==!1)}function zi(e){yn(e,!0)}gn("",Wr);if(typeof document!="undefined"&&typeof window!="undefined"){mn();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;bn(n,i)||console.error(r)}catch(i){console.error(r)}}}}const qi={getAPIConfig:Ee,setAPIModule:gn,sendAPIQuery:$n,setFetch:Lr,getFetch:zr,listAPIProviders:Hr},we={_api:qi,addAPIProvider:bn,loadIcons:at,loadIcon:li,iconExists:kr,getIcon:Pr,listIcons:Fr,addIcon:sn,addCollection:on,replaceIDs:cn,calculateSize:Ve,buildIcon:ke,getVersion:Oi,renderSVG:ji,renderHTML:Mi,renderIcon:Hi,scan:Bi,observe:Fn,stopObserving:An,pauseObserver:mi,resumeObserver:yi,enableCache:Li,disableCache:zi};try{self.Iconify===void 0&&(self.Iconify=we)}catch(e){}var Yi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"ab-icon",style:e.wrapperStyle},[e.isLocal?n("svg",{class:e.svgClassNames,attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":e.symbolId}})]):n("span",{ref:"elRef",class:e.svgClassNames,attrs:{"data-icon":e.symbolId}})])},Ki=[];const Ui={name:"AbIcon",props:{icon:{type:String,default:void 0},color:{type:String,default:void 0},size:{type:Number,default:16},svgClass:{type:String,default:void 0}},computed:{isLocal(){return!!(this.icon&&this.icon.startsWith("svg-icon:"))},symbolId(){return this.isLocal?`#icon-${this.icon.split("svg-icon:")[1]}`:this.icon},svgClassNames(){return`iconify ${this.svgClass||""}`.trim()},wrapperStyle(){return{fontSize:`${this.size}px`,height:"1em",color:this.color}}},watch:{icon(e){this.updateIcon(e)}},mounted(){this.updateIcon(this.icon)},methods:{updateIcon(e){return P(this,null,function*(){if(this.isLocal||typeof document=="undefined")return;const t=this.$refs.elRef;if(!t||(yield this.$nextTick(),!e))return;const n=we&&typeof we.renderSVG=="function"?we.renderSVG(e,{}):null;if(n)t.textContent="",t.appendChild(n);else{const r=document.createElement("span");r.className="iconify",r.dataset.icon=e,t.textContent="",t.appendChild(r)}})}}},Ct={};var Vi=$(Ui,Yi,Ki,!1,Wi,null,null,null);function Wi(e){for(let t in Ct)this[t]=Ct[t]}const lt=function(){return Vi.exports}();var Gi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-popover",{ref:"popover",attrs:{placement:"bottom-start",width:"320",disabled:e.disabled,trigger:"manual","popper-class":"ab-tree-select__popper"},on:{show:e.onShow,hide:e.onHide},model:{value:e.visible,callback:function(r){e.visible=r},expression:"visible"}},[n("div",{staticClass:"ab-tree-select__dropdown",on:{mouseenter:e.onDropdownEnter,mouseleave:e.onDropdownLeave}},[e.filterable?n("div",{staticClass:"ab-tree-select__filter"},[n("el-input",{staticClass:"ab-tree-select__filter-input",attrs:{size:"small",placeholder:"搜索..."},on:{keydown:[function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;r.stopPropagation()},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"tab",9,r.key,"Tab"))return null;r.stopPropagation()}],click:function(r){r.stopPropagation()}},model:{value:e.filterText,callback:function(r){e.filterText=r},expression:"filterText"}},[n("template",{slot:"prefix"},[n("i",{staticClass:"el-icon-search"})]),e.filterText?n("template",{slot:"suffix"},[n("i",{staticClass:"el-icon-circle-close",on:{click:function(r){r.stopPropagation(),e.filterText=""}}})]):e._e()],2)],1):e._e(),n("el-tree",{ref:"tree",staticStyle:{"max-height":"300px",overflow:"auto"},attrs:{data:e.filteredData,props:e.treeProps,"node-key":e.treeProps.value,"default-expanded-keys":e.defaultExpandedKeysInternal,"show-checkbox":e.multiple,"check-strictly":e.checkStrictly,"highlight-current":!e.multiple,"default-checked-keys":e.getDefaultCheckedKeys(),"filter-node-method":e.filterNodeMethod},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange,"current-change":e.handleCurrentChange}}),e.filteredData.length===0&&e.filterText?n("div",{staticClass:"ab-tree-select__empty"},[e._v("无匹配数据")]):e._e()],1),n("template",{slot:"reference"},[n("div",{staticClass:"ab-tree-select__reference"},[e.multiple?n("div",{staticClass:"ab-tree-select__tags-wrapper",on:{click:e.handleClick}},[n("input",{ref:"input",attrs:{type:"hidden",name:e.$attrs.name},domProps:{value:Array.isArray(e.value)?e.value.join(","):e.value||""}}),n("div",{staticClass:"ab-tree-select__tags"},[e.displayLabels.length===1?n("el-tag",{staticClass:"ab-tree-select__tag",attrs:{size:"small",type:"info"},on:{close:function(r){return r.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]):e.displayLabels.length>1?n("span",{staticClass:"ab-tree-select__tag-multiple"},[n("el-tag",{staticClass:"ab-tree-select__first-tag",attrs:{size:"small",type:"info"},on:{close:function(r){return r.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]),n("el-tag",{staticClass:"ab-tree-select__count-tag",attrs:{size:"small",type:"info"}},[e._v(" +"+e._s(e.displayLabels.length-1)+" ")])],1):n("span",{staticClass:"ab-tree-select__placeholder"},[e._v(e._s(e.placeholder))]),n("i",{staticClass:"el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})],1)]):n("el-input",e._b({ref:"input",staticClass:"ab-tree-select__input",attrs:{value:e.displayValue,size:e.currentSize,disabled:e.disabled,readonly:!0,placeholder:e.placeholder},on:{focus:e.handleFocus,blur:e.handleBlur}},"el-input",e.$attrs,!1),[n("template",{slot:"suffix"},[n("i",{staticClass:"el-input__suffix-inner el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})])],2)],1)])],2)},Qi=[];const Ji={name:"AbTreeSelect",inheritAttrs:!1,props:{value:{type:[Array,String,Number,Boolean,Object],default:void 0},data:{type:Array,default:()=>[]},props:{type:Object,default:()=>({})},multiple:Boolean,checkStrictly:Boolean,filterable:Boolean,disabled:Boolean,placeholder:String,size:String,defaultExpandedKeys:Array,showValue:Boolean,showKey:Boolean,showCode:Boolean,abFormInject:Object},data(){return{visible:!1,filterText:"",dropdownHovering:!1,inputHovering:!1,currentNodeKey:null,defaultExpandedKeysInternal:[]}},computed:{currentSize(){return this.size||this.$ELEMENT&&this.$ELEMENT.size||"default"},treeData(){return this.data||this.abFormInject&&this.abFormInject.options||[]},treeProps(){const e=this.props||{};return p({value:e.valueKey||e.nodeKey||"value",label:e.label||"label",children:e.children||"children",disabled:e.disabled||"disabled",leaf:e.leaf||"isLeaf"},e)},filteredData(){if(!this.filterText)return this.treeData;const e=this.filterText.toLowerCase(),t=n=>n.map(r=>{const s=String(r[this.treeProps.label]||"").toLowerCase().includes(e),o=r[this.treeProps.children],l=o?t(o):[];return s||l.length?g(p({},r),{[this.treeProps.children]:l}):null}).filter(Boolean);return t(this.treeData)},displayLabels(){if(!this.multiple||!this.value||!Array.isArray(this.value)||!this.value.length)return[];const e=this.treeProps.value,t=this.treeProps.label,n=(r,i)=>{for(const s of r||[]){if(s[e]===i)return s;const o=n(s[this.treeProps.children],i);if(o)return o}return null};return this.value.map(r=>{const i=n(this.treeData,r);return i?{value:r,label:i[t]}:{value:r,label:String(r)}})},displayValue(){if(this.value===void 0||this.value===null||this.value==="")return"";const e=Array.isArray(this.value)?this.value:[this.value],t=this.treeProps.value,n=this.treeProps.label,r=(s,o)=>{for(const l of s||[]){if(l[t]===o)return l[n];const a=r(l[this.treeProps.children],o);if(a)return a}return null};return e.map(s=>r(this.treeData,s)).filter(Boolean).join(", ")}},watch:{visible(e){e&&(this.filterText="",this.$nextTick(()=>{this.$refs.tree&&(this.multiple&&Array.isArray(this.value)?this.$refs.tree.setCheckedKeys(this.value):!this.multiple&&this.value!==void 0&&this.value!==null&&this.$refs.tree.setCurrentKey(this.value))}))},value(e){this.visible&&this.$refs.tree&&(this.multiple&&Array.isArray(e)?this.$refs.tree.setCheckedKeys(e):!this.multiple&&e!==void 0&&e!==null&&this.$refs.tree.setCurrentKey(e))},treeData(e){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const t=[],n=r=>{for(const i of r||[])i[this.treeProps.children]&&i[this.treeProps.children].length&&(t.push(i[this.treeProps.value]),n(i[this.treeProps.children]))};n(e),this.defaultExpandedKeysInternal=t}}},mounted(){this.$emit("fc.el",this.$refs.input),document.addEventListener("click",this.handleOutsideClick,!0),this.updateDefaultExpandedKeys()},beforeDestroy(){document.removeEventListener("click",this.handleOutsideClick,!0)},methods:{filterNodeMethod(e,t){return this.filterText?String(t[this.treeProps.label]||"").toLowerCase().includes(this.filterText.toLowerCase()):!0},getDefaultCheckedKeys(){if(!this.multiple)return[];const e=this.treeProps.value;if(this.checkStrictly)return Array.isArray(this.value)?this.value:this.value?[this.value]:[];const t=[],n=r=>{for(const i of r||[])!i[this.treeProps.children]||!i[this.treeProps.children].length?t.push(i[e]):n(i[this.treeProps.children])};return n(this.treeData),t.filter(r=>Array.isArray(this.value)?this.value.includes(r):this.value===r)},handleNodeClick(e,t,n){if(this.multiple)return;const r=this.treeProps.value,i=e[r];this.$emit("input",i),this.$emit("change",i),this.visible=!1},handleCheckChange(e,t){if(!this.multiple)return;const n=this.treeProps.value,r=this.$refs.tree.getCheckedKeys();let i;this.checkStrictly?i=r:i=this.$refs.tree.getCheckedNodes().filter(o=>o.isLeaf).map(o=>o[n]),this.$emit("input",i),this.$emit("change",i)},handleCurrentChange(e){e&&(this.currentNodeKey=e[this.treeProps.value])},handleFocus(){!this.disabled&&!this.multiple&&(this.inputHovering=!0)},handleBlur(){this.multiple||(this.inputHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},150))},handleClick(e){if(!this.disabled){if(e.target.closest(".ab-tree-select__tag"))return;this.visible=!this.visible}},onDropdownEnter(){this.dropdownHovering=!0},onDropdownLeave(){this.dropdownHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},100)},onShow(){this.$emit("visible-change",!0)},onHide(){this.$emit("visible-change",!1)},handleOutsideClick(e){if(this.$refs.popover&&this.$refs.popover.popperElm){const t=this.$refs.popover.popperElm,n=this.$refs.popover.referenceElm||this.$el.querySelector(".ab-tree-select__reference");!t.contains(e.target)&&(!n||!n.contains(e.target))&&(this.visible=!1)}},removeTag(e){if(this.disabled)return;let t;this.multiple&&Array.isArray(this.value)&&(t=this.value.filter(n=>n!==e)),this.$emit("input",t),this.$emit("change",t)},updateDefaultExpandedKeys(){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const e=[],t=n=>{for(const r of n||[])r[this.treeProps.children]&&r[this.treeProps.children].length&&(e.push(r[this.treeProps.value]),t(r[this.treeProps.children]))};t(this.treeData),this.defaultExpandedKeysInternal=e}}}},Tt={};var Xi=$(Ji,Gi,Qi,!1,Zi,"2bf84bb8",null,null);function Zi(e){for(let t in Tt)this[t]=Tt[t]}const On=function(){return Xi.exports}();var es=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-input",e._b({ref:"el",staticClass:"ab-input-number",attrs:{type:"number",value:e.displayValue,size:e.size,disabled:e.disabled,readonly:e.readonly,placeholder:e.placeholder},on:{input:e.handleInput}},"el-input",e.$attrs,!1),[e.prefix?n("span",{staticClass:"ab-input-number__prefix",attrs:{slot:"prefix"},slot:"prefix"},[e._v(e._s(e.prefix))]):e._e(),e.suffix?n("span",{staticClass:"ab-input-number__suffix",attrs:{slot:"suffix"},slot:"suffix"},[e._v(e._s(e.suffix))]):e._e()])},ts=[];const ns={name:"AbInputNumber",inheritAttrs:!1,props:{value:{type:[String,Number],default:void 0},prefix:{type:String,default:void 0},suffix:{type:String,default:void 0},size:{type:String,default:void 0},disabled:Boolean,readonly:Boolean,placeholder:String,abFormInject:{type:Object,default:void 0}},computed:{displayValue(){return this.value===null||this.value===void 0?"":this.value}},methods:{handleInput(e){if(e===""||e===null||e===void 0){this.$emit("input",void 0);return}const t=Number(e);this.$emit("input",Number.isNaN(t)?void 0:t)}}},Ft={};var rs=$(ns,es,ts,!1,is,null,null,null);function is(e){for(let t in Ft)this[t]=Ft[t]}const ss=function(){return rs.exports}();var os=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-input-range"},[e.prefix?n("span",{staticClass:"range-prefix"},[e._v(e._s(e.prefix))]):e._e(),e.isReadonly?[e._v(" "+e._s(e.range[0])+" ~ "+e._s(e.range[1])+" ")]:[n("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[0]===null?"":e.range[0],size:e.currentSize,placeholder:"最小",clearable:e.clearable},on:{input:function(r){return e.updateRange(0,r)},change:function(r){return e.emitChange(0,r)}}}),n("span",{staticClass:"range-splitter"},[e._v(" ~ ")]),n("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[1]===null?"":e.range[1],size:e.currentSize,placeholder:"最大",clearable:e.clearable},on:{input:function(r){return e.updateRange(1,r)},change:function(r){return e.emitChange(1,r)}}})],e.suffix?n("span",{staticClass:"range-suffix"},[e._v(e._s(e.suffix))]):e._e()],2)},as=[];const ls={name:"AbInputRange",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},prefix:{type:[String,Number],default:void 0},suffix:{type:[String,Number],default:void 0},clearable:{type:Boolean,default:!0},readonly:Boolean},computed:{range(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===void 0?null:e[0],e[1]===void 0?null:e[1]]},isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},methods:{rangeWithValue(e,t){const n=[...this.range];return n[e]=t===""?null:t,n},updateRange(e,t){this.$emit("input",this.rangeWithValue(e,t))},emitChange(e,t){this.$emit("change",this.rangeWithValue(e,t))}}},At={};var cs=$(ls,os,as,!1,us,null,null,null);function us(e){for(let t in At)this[t]=At[t]}const ds=function(){return cs.exports}();var fs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-time-period w-full"},[n("div",{staticClass:"start-time"},[e._v(e._s(e.period[0]||"--:--"))]),e.isReadonly?n("div",[e._v("~")]):n("el-slider",{class:{"is-empty":!e.period[0]&&!e.period[1]},attrs:{value:e.sliderValue,range:"",step:30,min:e.bounds[0],max:e.bounds[1],"format-tooltip":e.formatTime},on:{input:e.updatePeriod,change:e.handleChange}}),n("div",{staticClass:"end-time"},[e._v(e._s(e.period[1]||"--:--"))])],1)},ps=[];function be(e){const t=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(String(e||"").trim());if(!t)return 0;const n=Number(t[1]),r=Number(t[2]),i=t[3]?Number(t[3]):0;return n*3600+r*60+i}function Me(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,i=`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return r?`${i}:${String(r).padStart(2,"0")}`:i}const hs={name:"AbTimePeriod",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},startTime:{type:String,default:"08:00"},endTime:{type:String,default:"18:00"},readonly:Boolean},computed:{isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},bounds(){const e=be(this.startTime),t=be(this.endTime);return e<t?[e,t]:[0,86400]},period(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===""||e[0]===void 0?null:e[0],e[1]===""||e[1]===void 0?null:e[1]]},selected(){const[e,t]=this.bounds,n=this.period[0]===null?e:be(this.period[0]),r=this.period[1]===null?t:be(this.period[1]);return n<=r?[n,r]:[e,t]},sliderValue(){const e=t=>Math.min(this.bounds[1],Math.max(this.bounds[0],t));return[e(this.selected[0]),e(this.selected[1])]}},methods:{formatTime:Me,toPeriod(e){const t=Array.isArray(e)?e:[];return[this.period[0]!==null&&t[0]===this.sliderValue[0]?this.period[0]:Me(t[0]),this.period[1]!==null&&t[1]===this.sliderValue[1]?this.period[1]:Me(t[1])]},updatePeriod(e){this.$emit("input",this.toPeriod(e))},handleChange(e){this.$emit("change",this.toPeriod(e))}}},kt={};var ms=$(hs,fs,ps,!1,ys,null,null,null);function ys(e){for(let t in kt)this[t]=kt[t]}const gs=function(){return ms.exports}(),A=(e="localStorage")=>({wsCache:e==="localStorage"?window.localStorage:window.sessionStorage,setLang:bs,getLang:jn,isZhCN:Mn,setTheme:_s,getTheme:vs,isDark:$s,setCurrentSize:ws,getCurrentSize:Ss,setUser:xs,getUser:Cs}),B={IS_DARK:"isDark",LANG:"lang",THEME:"theme",LAYOUT:"layout",CURRENT_SIZE:"currentSize",USER:"user"},bs=(e="")=>{const{wsCache:t}=A();t.setItem(B.LANG,e)},jn=()=>{const{wsCache:e}=A();return e.getItem(B.LANG)},Mn=()=>{const e=jn()||"";return!e||String(e).toLowerCase()==="zh-cn"},_s=e=>{const{wsCache:t}=A();t.setItem(B.THEME,JSON.stringify(e||"{}"))},vs=()=>{const{wsCache:e}=A(),t=e.getItem(B.THEME);return t?JSON.parse(t):void 0},$s=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,ws=(e="")=>{const{wsCache:t}=A();t.setItem(B.CURRENT_SIZE,e)},Ss=()=>{const{wsCache:e}=A();return e.getItem(B.CURRENT_SIZE)},xs=e=>{const{wsCache:t}=A();t.setItem(B.USER,JSON.stringify(e||"{}"))},Cs=()=>{const{wsCache:e}=A(),t=e.getItem(B.USER),n=t?JSON.parse(t):{};return n.permissions=new Set(n.permissions||[]),n};var Ts=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-time-picker",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-time-picker",e.$attrs,!1))},Fs=[];const As={name:"AbTimePicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=A(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},Pt={};var ks=$(As,Ts,Fs,!1,Ps,null,null,null);function Ps(e){for(let t in Pt)this[t]=Pt[t]}const Es=function(){return ks.exports}();var Is=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-color-picker",e._b({ref:"el",staticClass:"ab-color-picker",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-color-picker",e.$attrs,!1))},Ds=[];const Rs={name:"AbColorPicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=A(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},Et={};var Ns=$(Rs,Is,Ds,!1,Os,null,null,null);function Os(e){for(let t in Et)this[t]=Et[t]}const js=function(){return Ns.exports}();var Ms=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-upload-file"},[e.currentDisabled?e._e():n("el-upload",{attrs:{action:"","show-file-list":!1,drag:e.drag,multiple:e.currentLimit>1,accept:e.accept,"before-upload":e.beforeUpload,"http-request":e.uploadRequest}},[n("el-button",{attrs:{type:"primary",size:"small"}},[e._v("选择文件")]),e.isShowTip?n("div",{staticClass:"ab-upload-file__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 支持 "+e._s(e.fileTypes.join("/"))+",单个不超过 "+e._s(e.fileSize)+" MB ")]):e._e()],1),n("ul",{staticClass:"ab-upload-file__list"},e._l(e.files,function(r){return n("li",{key:r.uid,staticClass:"ab-upload-file__item"},[n("span",{staticClass:"ab-upload-file__name"},[e._v(e._s(r.name))]),r.status==="uploading"?n("span",{staticClass:"ab-upload-file__tip"},[e._v("上传中...")]):e._e(),r.error?n("span",{staticClass:"ab-upload-file__error"},[e._v(e._s(r.error))]):e._e(),r.url&&e.preEnabled?n("el-button",{attrs:{type:"text"},on:{click:function(i){return e.preview(r)}}},[e._v("预览")]):e._e(),r.url&&e.dowEnabled?n("el-link",{attrs:{href:r.url,target:"_blank",download:""}},[e._v("下载")]):e._e(),!e.currentDisabled&&e.delEnabled&&r.status!=="uploading"?n("el-button",{attrs:{type:"text"},on:{click:function(i){return e.removeFile(r)}}},[e._v(" 删除 ")]):e._e()],1)}),0)],1)},Hs=[];const Bs=["png","jpg","jpeg","gif","webp","bmp","svg"],Ls=["doc","xls","txt","pdf"];function zs(e){const t=String(e).split(/[?#]/,1)[0].split("/").pop()||e;try{return decodeURIComponent(t)}catch(n){if(n instanceof URIError)return t;throw n}}function qs(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()&&e!=="new")return e}const Ys={name:"AbUploadFile",props:{value:{type:Array,default:()=>[]},apis:{type:Object,default:void 0},abFormInject:{type:Object,default:void 0},idFieldTable:{type:String,default:void 0},businessCode:{type:String,default:void 0},uploadType:{type:String,default:void 0},maxLength:{type:[Number,String],default:void 0},fileType:{type:Array,default:void 0},fileSize:{type:Number,default:5},limit:{type:Number,default:void 0},drag:Boolean,isShowTip:{type:Boolean,default:!0},readonly:Boolean,disabled:Boolean,delEnabled:{type:Boolean,default:!0},preEnabled:{type:Boolean,default:!0},dowEnabled:{type:Boolean,default:!0},coverEnabled:Boolean,autoCover:Boolean},data(){return{uid:0,files:[]}},computed:{currentDisabled(){return this.disabled||this.readonly||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentLimit(){return this.limit!=null?Number(this.limit):this.maxLength!=null?Number(this.maxLength):5},fileTypes(){return Array.isArray(this.fileType)&&this.fileType.length?this.fileType:this.uploadType==="image"?Bs:Ls},accept(){return this.fileTypes.map(e=>`.${String(e).replace(/^\./,"")}`).join(",")},apisClient(){return this.apis||this.$abUploadApis}},watch:{value:{handler(e){this.syncFromValue(e)},immediate:!0,deep:!0}},methods:{syncFromValue(e){const t=Array.isArray(e)?e:[],n=[...this.files],r=t.map(i=>{const s=n.findIndex(o=>o.url===i);return s>-1?n.splice(s,1)[0]:{uid:++this.uid,name:zs(i),url:i,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"linked"}});this.files=[...r,...this.files.filter(i=>i.status==="uploading"||i.status==="failed")]},publish(){this.$emit("input",this.files.filter(e=>e.url).map(e=>e.url))},beforeUpload(e){if(this.files.filter(i=>i.status==="uploading"||i.status==="linked").length>=this.currentLimit)return this.$message.error(`最多上传 ${this.currentLimit} 个文件`),!1;const n=e.name||"",r=n.includes(".")?n.slice(n.lastIndexOf(".")+1).toLowerCase():"";return this.fileTypes.length&&!this.fileTypes.some(i=>String(i).toLowerCase().replace(/^\./,"")===r)?(this.$message.error(`仅支持 ${this.fileTypes.join("/")} 格式`),!1):e.size>this.fileSize*1024*1024?(this.$message.error(`文件大小不能超过 ${this.fileSize} MB`),!1):!0},uploadRequest(e){const t=this.apisClient;if(!t||typeof t.upload!="function"){const r=new Error("未配置上传接口");return this.$message.error(r.message),this.$emit("error",r),Promise.reject(r)}const n={uid:++this.uid,name:e.file&&e.file.name,url:void 0,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"uploading"};return this.files.push(n),Promise.resolve().then(()=>t.upload({file:e.file})).then(r=>{const i=r&&r.data?r.data:r;if(!i||i.id==null||typeof i.url!="string"||!i.url)throw new TypeError("上传接口需返回 id、name、url");return this.$set(n,"id",i.id),this.$set(n,"fileId",i.id),this.$set(n,"url",i.url),this.$set(n,"name",i.name||e.file&&e.file.name||i.url),this.$set(n,"size",i.size),this.$set(n,"status","linked"),this.publish(),r}).catch(r=>{throw this.$set(n,"status","failed"),this.$set(n,"error",this.errorMessage(r)),this.$emit("error",r),r})},handleUploadError(e){this.$emit("error",e)},removeFile(e){const t=this.apisClient,n=this.businessId(),r=()=>{this.files=this.files.filter(i=>i.uid!==e.uid),this.publish()};if(t&&typeof t.remove=="function"&&e.fileId!=null&&n!==void 0){Promise.resolve(t.remove(g(p({},this.businessParams(n)),{fileId:e.fileId}))).then(r).catch(i=>{this.$message.error(this.errorMessage(i)),this.$emit("error",i)});return}r()},preview(e){const t=e.name||"",n=t.includes(".")?t.slice(t.lastIndexOf(".")+1).toLowerCase():"";this.$emit("preview",{url:e.url,name:t,extension:n,fileId:e.fileId})},businessId(){const e=this.abFormInject,t=e&&e.formValue&&e.idField?e.formValue[e.idField]:void 0;return qs(t)},businessParams(e){return{businessType:this.idFieldTable||this.abFormInject&&this.abFormInject.idFieldTable,businessCode:this.businessCode,businessId:e}},errorMessage(e){return e instanceof Error?e.message:String(e)}}},It={};var Ks=$(Ys,Ms,Hs,!1,Us,"0306328f",null,null);function Us(e){for(let t in It)this[t]=It[t]}const Vs=function(){return Ks.exports}();function Hn(e){return typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"}function Bn(e){return typeof e=="string"||typeof e=="function"||Hn(e)}function He(e){return e==null||typeof e=="string"||typeof e=="number"?e:String(e)}function Dt(e){if(e!=null)return typeof e=="string"||typeof e=="number"?e:String(e)}function Ws(e,t,n){if(t==null||t==="")return;if(typeof e=="function")return e(n);if(typeof e=="string")return{name:e,query:{id:He(t)}};if(!Hn(e))return;const r={name:e.name},i=e.query;typeof i=="string"?r.query={[i]:He(t)}:i&&(r.query={},Object.keys(i).forEach(o=>{const l=i[o];r.query[o]=He(n[l])}));const s=e.params;if(typeof s=="string"){const o=Dt(t);o!==void 0&&(r.params={[s]:o})}else s&&(r.params={},Object.keys(s).forEach(o=>{const l=s[o],a=Dt(n[l]);a!==void 0&&(r.params[o]=a)}));return r}var Gs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"ab-router-link"},[n("ab-icon",{attrs:{icon:"ep:link",size:16,color:e.primaryColor}}),e.to?n("router-link",{staticClass:"ab-router-link__anchor",attrs:{to:e.to}},[e._t("default")],2):e._t("default")],2)},Qs=[];const Js={name:"AbRouterLink",props:{link:{type:[String,Function,Object],default:void 0},value:{default:void 0},row:{type:Object,default:()=>({})}},computed:{to(){return Ws(this.link,this.value,this.row)},primaryColor(){const e=getComputedStyle(document.documentElement);return(e==null?void 0:e.getPropertyValue("--el-color-primary").trim())||"#1890ff"}}},Rt={};var Xs=$(Js,Gs,Qs,!1,Zs,"973bb136",null,null);function Zs(e){for(let t in Rt)this[t]=Rt[t]}const fe=function(){return Xs.exports}(),eo=[en,hr,vr,lt,On,ss,ds,gs,Es,js,Vs,fe],to="checkbox",no={name:to,parser:b.BaseParser},ro="colorPicker";let io=class extends b.BaseParser{render(t){const n=this.vm&&this.vm.$createElement;if(this.vm&&this.vm.readonly===!0&&n){const r=this.$handle.getFormData(this),i=typeof r=="string"?r:void 0;return n("span",{class:"ab-color-picker__readonly",style:{backgroundColor:i,color:i?F.Color.getContrast(i):F.ColorsEnum.black||"#000000"},attrs:{title:i||""}},[String(r!=null?r:"")])}return this.$render.defaultRender(this,t)}};const so={name:ro,parser:io},oo="datePicker",Nt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd HH:mm:ss",week:"yyyywWW",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",monthrange:"yyyy-MM",datetimerange:"yyyy-MM-dd HH:mm:ss",year:"yyyy"};let ao=class extends b.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat=Nt[t.type]||Nt.date)}};const lo={name:oo,parser:ao},co="frame";let uo=class extends b.BaseParser{render(t){const n=this.$render.inputVData(this).props("field",this.field);return this.vNode.frame(n,t)}closeModel(){this.el.closeModel&&this.el.closeModel()}};const fo={name:co,parser:uo},po="hidden";let ho=class extends b.BaseParser{render(){return[]}};const mo={name:po,parser:ho},yo="input";let go=class extends b.BaseParser{init(){const{props:t}=this.rule;t&&t.autosize&&t.autosize.minRows&&F.$set(t,"rows",t.autosize.minRows||2)}};const bo={name:yo,parser:go};function _o(){if(typeof window=="undefined")return"¥";try{return Mn()?"¥":"$"}catch(e){return"¥"}}class Ot extends b.BaseParser{}class vo extends b.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.prefix===void 0&&(t.prefix=_o()),t.align===void 0&&(t.align="right")}}class $o extends b.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.suffix===void 0&&(t.suffix="%"),t.align===void 0&&(t.align="right")}}const wo="radio",So={name:wo,parser:b.BaseParser},xo="select";let Co=class extends b.BaseParser{toFormValue(t){return this.rule.props.multiple&&!Array.isArray(t)?F.toArray(t):t}};const To={name:xo,parser:Co},Fo="slider";let Ao=class extends b.BaseParser{toFormValue(t){const n=this.rule,r=Array.isArray(t),i=n.props,s=i.min||0;let o;return i.range===!0?o=r?t:[s,parseFloat(t)||s]:o=r?parseFloat(t[0])||s:parseFloat(t),o}};const ko={name:Fo,parser:Ao},Po="switch";let Eo=class extends b.BaseParser{render(t){return this.vNode.switch(this.$render.inputVData(this).get(),t)}};const Io={name:Po,parser:Eo},J=e=>String(e).padStart(2,"0");function N(e){return typeof e=="undefined"||e==="undefined"||e==="null"||e===null||e===""||typeof e=="number"&&isNaN(e)}function Do(e){return N(e)?e:new Intl.NumberFormat("zh-CN",{style:"currency",currency:"CNY"}).format(e)}function Ro(e){return N(e)?e:(Math.round(e*100)/100).toLocaleString()}function No(e){return N(e)?e:Math.round(e*100)/100+" %"}function se(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e=="string"){const t=e.trim();return/^\d+$/.test(t)?new Date(Number(t)):new Date(t)}return new Date(e)}function Ln(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),n=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-n);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return{year:t.getUTCFullYear(),week:Math.ceil(((t-r)/864e5+1)/7)}}function D(e,t="YYYY-MM-DD"){if(e==null||e==="")return e;const n=se(e);if(isNaN(n.getTime()))return e;const r=Ln(n),i={YYYY:String(n.getFullYear()),MM:J(n.getMonth()+1),DD:J(n.getDate()),HH:J(n.getHours()),mm:J(n.getMinutes()),ss:J(n.getSeconds()),Q:String(Math.floor(n.getMonth()/3)+1),W:String(r.week),GGGG:String(r.year)};return t.replace(/YYYY|MM|DD|HH|mm|ss|Q|W|GGGG/g,s=>i[s])}function Oo(e,t,n="label",r){if(Array.isArray(t)&&!t.length)return"";let i=t;if(Array.isArray(i)?i=i.map(l=>String(l).trim()):i!=null&&(i=String(i).trim()),!e||!e.length)return N(i)?"":i;const s=l=>!Array.isArray(r)||!r.length?!0:r.some(a=>!a||typeof a!="object"?!0:Object.entries(a).every(([c,u])=>{const f=l?l[c]:void 0;return u==null?f===u:Array.isArray(u)?u.some(d=>String(f)===String(d)):Array.isArray(f)?f.some(d=>String(d)===String(u)):String(f)===String(u)})),o=Array.isArray(i)?e.filter(l=>i.includes(String(l.value))&&s(l)):e.filter(l=>(l.value===i||String(l.value)===String(i))&&s(l));if(o.length){const l=o.map(a=>a[n]).filter(a=>a!=null&&a!=="");return[...new Set(l)].join("、")}return Array.isArray(i)||N(i)?"":i}const jt=({cellValue:e}={},t="YYYY-MM-DD HH:mm")=>D(e,t),Be=({cellValue:e}={},t="YYYY")=>D(e,t),Le=({cellValue:e}={},t="Q")=>e==null||e===""||isNaN(se(e).getTime())?e:`${D(e,"YYYY")}年${D(e,t)}季度`,ze=({cellValue:e}={},t="MM")=>e==null||e===""||isNaN(se(e).getTime())?e:`${D(e,"YYYY")}年 ${D(e,t)}月`,jo=({cellValue:e}={},t="W")=>{if(e==null||e==="")return e;const n=typeof e=="string"?/^(\d{4})-(\d{1,2})(?:st|nd|rd|th|周)$/i.exec(e):null;if(!n&&isNaN(se(e).getTime()))return e;const r=Ln(se(e));return`${n?n[1]:r.year}年第${n?n[2]:D(e,t)}周`},Mo=({cellValue:e,itemValue:t}={})=>{const n=e==null?t:e;return N(n)?n:Ro(n)},Ho=({cellValue:e}={})=>N(e)?e:No(e),Bo=({cellValue:e,itemValue:t}={})=>{const n=N(e)?t:e;return N(n)?n:Do(n)};function oe(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>oe(n,t[r]));if(e&&t&&typeof e=="object"&&typeof t=="object"){const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(r=>oe(e[r],t[r]))}return!1}function zn(e,t,{valueField:n="value",childrenField:r="children"}={}){for(const i of e||[]){if(oe(i?i[n]:void 0,t))return i;const s=zn(i?i[r]:void 0,t,{valueField:n,childrenField:r});if(s)return s}}function Mt(e){var n;const t=((n=e.props)==null?void 0:n.options)||e.options;return({cellValue:r})=>r==null||r===""?"":(Array.isArray(r)?r:[r]).map(s=>{const o=Array.isArray(t)?t.find(l=>l&&l.value===s):void 0;return o&&o.label!==void 0?o.label:s!=null?s:""}).join("、")}function Lo(e){return({cellValue:t})=>{const{activeValue:n=!0,inactiveValue:r=!1,activeText:i,inactiveText:s}=e.props||{};return t===n?i||"开启":t===r?s||"关闭":t!=null?t:""}}function zo(e){var l,a,c,u,f;const t=e.props||{},n=t.props||{},r=e.optionsTo==="props.data"&&Array.isArray(e.options)?e.options:t.data,i=(c=(a=(l=n.value)!=null?l:t.nodeKey)!=null?a:t.valueKey)!=null?c:"value",s=(u=n.label)!=null?u:"label",o=(f=n.children)!=null?f:"children";return({cellValue:d})=>d==null||d===""?"":(Array.isArray(d)?d:[d]).map(h=>{const m=Array.isArray(r)?zn(r,h,{valueField:i,childrenField:o}):void 0;return m&&m[s]!==void 0?m[s]:h}).join("、")}function qn(e,t,n,r){for(const i of e||[]){if(oe(i[n],t))return[i];const s=qn(i[r],t,n,r);if(s)return[i,...s]}}function qo(e){var f,d,y,h;const t=e.props||{},n=t.props||{},r=e.optionsTo==="props.options"&&Array.isArray(e.options)?e.options:t.options,i=(f=n.value)!=null?f:"value",s=(d=n.label)!=null?d:"label",o=(y=n.children)!=null?y:"children",l=Array.isArray(r)?r:[],a=(h=t.separator)!=null?h:" / ",c=t.showAllLevels!==!1;function u(m){let v;if(n.emitPath===!1){const x=qn(l,m,i,o);v=x?x.map(w=>{var S;return(S=w[s])!=null?S:w[i]}):[m]}else{const x=Array.isArray(m)?m:[m];let w=l;v=x.map(S=>{const j=w.find(W=>oe(W[i],S));return w=j&&Array.isArray(j[o])?j[o]:[],j&&j[s]!==void 0?j[s]:S})}return(c?v:v.slice(-1)).join(a)}return({cellValue:m})=>m==null||m===""?"":n.multiple===!0?(Array.isArray(m)?m:[m]).map(u).join("、"):u(m)}const Yo={year:Be,years:Be,yearrange:Be,quarter:Le,quarters:Le,quarterrange:Le,month:ze,months:ze,monthrange:ze,week:jo,datetime:jt,datetimerange:jt},Ko=/YYYY|MM|DD|HH|mm|ss/g,Uo=/[.*+?^${}()|[\]\\]/g;function Yn(e,t){if(typeof e!="string"||typeof t!="string"||t==="YYYY-wo")return e;if(t==="x"||t==="X"){const l=Number(e);return Number.isFinite(l)?new Date(t==="X"?l*1e3:l):e}const n=[],r=t.replace(Uo,"\\$&").replace(Ko,l=>(n.push(l),"\\d{1,4}")),i=new RegExp(`^${r}$`).exec(e);if(!i)return e;const s={YYYY:1970,MM:1,DD:1,HH:0,mm:0,ss:0};n.forEach((l,a)=>{s[l]=Number(i[a+1])});const o=new Date(s.YYYY,s.MM-1,s.DD,s.HH,s.mm,s.ss);return isNaN(o.getTime())?e:o}function Vo(e){var r,i;const t=(i=(r=e.props)==null?void 0:r.type)!=null?i:"date",n=s=>{var a,c;if(s==null||s==="")return"";const o=Yn(s,(a=e.props)==null?void 0:a.valueFormat);if((c=e.props)!=null&&c.format)return D(o,e.props.format);const l=Yo[t];return l?l({cellValue:o}):D(o)};return({cellValue:s})=>{var l,a;if(!Array.isArray(s))return n(s);if(s.every(c=>c==null||c===""))return"";const o=t.endsWith("range")?(a=(l=e.props)==null?void 0:l.rangeSeparator)!=null?a:" - ":"、";return s.map(n).join(o)}}function Wo(e){const t=n=>{var i,s,o,l;if(n==null||n==="")return"";const r=Yn(n,(s=(i=e.props)==null?void 0:i.valueFormat)!=null?s:"HH:mm");return D(r,(l=(o=e.props)==null?void 0:o.format)!=null?l:"HH:mm")};return({cellValue:n})=>{var r,i;return Array.isArray(n)?n.every(s=>s==null||s==="")?"":n.map(t).join((i=(r=e.props)==null?void 0:r.rangeSeparator)!=null?i:" - "):t(n)}}const Go=new Map([["radio",Mt],["checkbox",Mt],["switch",Lo],["treeSelect",zo],["cascader",qo],["inputNumber",()=>Mo],["inputCurrency",()=>Bo],["inputPercent",()=>Ho],["datePicker",Vo],["timePicker",Wo]]);function De(e){var r;if(typeof e.formatter=="function")return g(p({},e),{formatter:e.formatter});const t=Go.get((r=e.type)!=null?r:"");let n;return t?n=t(e):Array.isArray(e.options)&&e.options.length>0&&(n=Qo(e)),g(p({},e),{formatter:n})}function Qo(e){return({cellValue:t})=>Oo(e.options,t)}const Jo="text";let Xo=class extends b.BaseParser{render(){const n=this.rule.field!==void 0?this.$handle.getFormData(this):this.rule.value,r=this.$handle&&this.$handle.fCreateApi?this.$handle.fCreateApi.formData():{},i=De(g(p({},this.rule),{props:this.rule.props||{}})).formatter,s=typeof i=="function"?i({cellValue:n,column:this.rule,row:r}):n,o=String(s!=null?s:""),l=this.rule.link;return Bn(l)?this.vNode.make(fe,{props:{link:l,value:n,row:r}},[o]):this.vNode.make("span",{domProps:{textContent:o}})}};const Zo={name:Jo,parser:Xo},ea="timePicker";let ta=class extends b.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}};const na={name:ea,parser:ta},ra="tree";let ia=class extends b.BaseParser{init(){const t=this.rule.props;F.isUndef(t.nodeKey)&&F.$set(t,"nodeKey","id"),F.isUndef(t.props)&&F.$set(t,"props",{label:"title"})}render(t){const n=this.$render.parserToData(this).get();return this.vNode.tree({props:{ctx:n,children:t,value:this.$handle.getFormData(this),type:n.props.type},ref:this.refName,key:this.key,on:{input:r=>{this.$render.onInput(this,r)}}})}};const sa={name:ra,parser:ia},oa="upload";class aa extends b.BaseParser{render(t){const n=this.$render.parserToData(this).get(),{key:r,refName:i}=this;delete n.props.fileList;const s={uploadType:n.props.uploadType,maxLength:n.props.limit,modalTitle:n.props.modalTitle,handleIcon:n.props.handleIcon,onHandle:n.props.onHandle,allowRemove:n.props.allowRemove,previewMask:n.props.previewMask,value:this.$handle.getFormData(this),ctx:n,children:t};return this.vNode.upload({props:s,key:r,ref:i,on:{input:o=>{this.$render.onInput(this,o)}}})}}const la={name:oa,parser:aa},ca=[no,so,lo,fo,mo,bo,So,To,ko,Io,Zo,na,sa,la,{name:"number",parser:Ot},{name:"inputNumber",parser:Ot},{name:"inputCurrency",parser:vo},{name:"inputPercent",parser:$o}];function ua(){return{form:{inline:!0,labelPosition:"right",labelSuffix:void 0,hideRequiredAsterisk:!1,labelWidth:"120px",fieldWidth:"238px",showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,disabled:!1,size:void 0},row:{gutter:0,type:void 0,align:void 0,justify:void 0,tag:"div"},info:{type:"popover",trigger:"hover",placement:"top-start",icon:"el-icon-warning"},submitBtn:{type:"primary",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-upload",width:"100%",autofocus:!1,nativeType:"button",innerText:"提交",show:!1,col:void 0,click:void 0},resetBtn:{type:"default",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-refresh",width:"100%",autofocus:!1,nativeType:"button",innerText:"重置",show:!1,col:void 0,click:void 0}}}const C="el",da={input:`${C}-input`,password:`${C}-input`,textarea:`${C}-input`,text:"span",hidden:"span",divider:`${C}-divider`,number:`${C}-input-number`,inputNumber:`${C}-input-number`,inputCurrency:"ab-input-number",inputPercent:"ab-input-number",select:"ab-select",radio:"ab-radio",checkbox:"ab-checkbox",switch:`${C}-switch`,datePicker:`${C}-date-picker`,timePicker:"ab-time-picker",slider:`${C}-slider`,rate:`${C}-rate`,colorPicker:"ab-color-picker",cascader:`${C}-cascader`,treeSelect:"ab-tree-select",inputRange:"ab-input-range",timePeriod:"ab-time-period",uploadFile:"ab-upload-file",upload:"ab-upload-file",form:`${C}-form`,formItem:`${C}-form-item`,ElButton:`${C}-button`,button:`${C}-button`,icon:"ab-icon",row:`${C}-row`,col:`${C}-col`};const fa=new Set(["select","treeselect","radio","checkbox","inputrange","timeperiod","tree","upload","uploadfile","frame"]),pa=new Set(["input","password","textarea","number","inputnumber","inputcurrency","inputpercent","select","radio","checkbox","switch","datepicker","timepicker","slider","rate","cascader","treeselect","text"]);function Ht(e){return e.type==="tooltip"}class ha extends b.BaseForm{get injectTypes(){return fa}readonlyRender(t){if(!this.$handle.vm||!this.$handle.vm.readonly||!t.isDef||t.rule.component||!pa.has(t.type))return;const n=t.rule,r=this.$handle.getFormData(t),i=this.$handle.formData||{},s=De(g(p({},n),{props:n.props||{}})).formatter,o=typeof s=="function"?s({cellValue:r,column:n,row:i}):r,l=String(o!=null?o:""),a=n.link;return Bn(a)?this.vNode.make(fe,{props:{link:a,value:r,row:i}},[l]):this.vNode.make("span",{domProps:{textContent:l}})}inputVData(t){const n=t.rule.props||{};t.vData.attrs(p({},n)),!n.size&&this.options.form.size&&t.vData.props("size",this.options.form.size)}validate(t){this.getFormRef().validate(n=>{t&&t(n)})}validateField(t,n){this.getFormRef().validateField(t,n)}resetField(t){this.vm.$refs[t.formItemRefName].resetField()}clearValidateState(t){const n=this.vm.$refs[t.formItemRefName];n&&(n.validateMessage="",n.validateState="")}beforeRender(){this.propsData=this.vData.props(this.options.form).props({model:this.$handle.formData,rules:this.$handle.validate,key:"form"+this.unique}).ref(this.refName).nativeOn({submit:F.preventDefault}).class(this.options.form.className).class("form-create",!0).class("ab-form",!0).key(this.unique).get()}render(t){return t.length>0&&t.push(this.makeFormBtn()),this.vNode.form(this.propsData,[this.options.row===!1?t:this.makeRow(t)])}makeRow(t){const n={},r=this.options.row||{};return r.class&&(n[r.class]=!0),this.vNode.row({props:r||{},key:"fr"+this.unique,class:n},t)}container(t,n){return this.makeFormItem(n,t)}makeFormItem(t,n){let r=`fItem${t.key}${this.unique}`,{rule:i,field:s,formItemRefName:o}=t,l=this.getGetCol(t),a=!l.labelWidth&&!i.title?0:l.labelWidth,c=t.isDef?this.options.form&&this.options.form.fieldWidth:"",{inline:u,col:f}=this.propsData.props,d=this.vData.props({prop:s,rules:i.validate,labelWidth:F.toString(a),required:i.props.required}).key(r).ref(o).class(i.className).style(c?{"--ab-field-width":F.toString(c)}:void 0).get(),y=this.vNode.formItem(d,[n,this.makeFormPop(t,r)]);return u===!0||f===!1?y:this.makeCol(l,t,r,[y])}makeFormPop({rule:t},n){if(t.title){const r=F.isString(t.title)?{title:t.title}:t.title,i=this.options.info||{},s=[r.title||""];return t.info&&s.push(this.vNode.make(Ht(i)?"el-tooltip":"el-popover",{props:g(p({},i),{content:t.info}),key:`pop${n}`},[this.vNode.icon({class:[i.icon||"el-icon-warning"],slot:Ht(i)?"default":"reference"})])),this.vNode.make("span",g(p({},r),{slot:"label"}),s)}}makeCol(t,n,r,i){t.span===void 0&&(t.span=24);const s={};return t.class&&(s[t.class]=!0),this.vNode.col({props:t,class:s,key:`${r}col1`},i)}makeFormBtn(){let t=[],n=this.vm.buttonProps!==!1&&this.vm.buttonProps.show!==!1,r=this.vm.resetProps!==!1&&this.vm.resetProps.show!==!1;return n&&t.push(this.makeSubmitBtn(r?19:24)),r&&t.push(this.makeResetBtn(4)),this.propsData.props.inline===!0?t:t.length?this.vNode.col({props:{span:24},key:`${this.unique}col2`},t):[]}makeResetBtn(t){const n=this.vm.resetProps,r=n.col||{span:t,push:1};return this.vNode.col({props:r,key:`${this.unique}col3`},[this.vNode.button({key:`frsbtn${this.unique}`,props:n,on:{click:()=>{const i=this.$handle.fCreateApi;F.isFunction(n.click)?n.click(i):i.resetFields()}},style:{width:n.width}},[n.innerText])])}makeSubmitBtn(t){const n=this.vm.buttonProps,r=n.col||{span:t};return this.vNode.col({props:r,key:`${this.unique}col4`},[this.vNode.button({key:`fbtn${this.unique}`,props:n,on:{click:()=>{const i=this.$handle.fCreateApi;F.isFunction(n.click)?n.click(i):i.submit()}},style:{width:n.width}},[n.innerText])])}}const ma="datePicker",ya=["year","month","date","dates","week","datetime","datetimeRange","dateRange"].reduce((e,t)=>(e[t]=b.creatorTypeFactory(ma,t.toLowerCase()),e),{}),ga="frame",qe={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},K=Object.keys(qe).reduce((e,t)=>(e[t]=b.creatorTypeFactory(ga,n=>n.props({type:qe[t][0],maxLength:qe[t][1]})),e),{});K.frameInput=K.frameInputs;K.frameFile=K.frameFiles;K.frameImage=K.frameImages;const Kn="input",Un=["password","url","email","text","textarea"].reduce((e,t)=>(e[t]=b.creatorTypeFactory(Kn,t),e),{});Un.idate=b.creatorTypeFactory(Kn,"date");const Bt="select",ba={selectMultiple:b.creatorTypeFactory(Bt,!0,"multiple"),selectOne:b.creatorTypeFactory(Bt,!1,"multiple")},_a="slider",va={sliderRange:b.creatorTypeFactory(_a,!0,"range")},Lt="timePicker",$a={time:b.creatorTypeFactory(Lt,e=>e.props({isRange:!1})),timeRange:b.creatorTypeFactory(Lt,e=>e.props({isRange:!0}))},wa="tree",zt={treeSelected:"selected",treeChecked:"checked"},Sa=Object.keys(zt).reduce((e,t)=>(e[t]=b.creatorTypeFactory(wa,zt[t]),e),{}),xa="upload",Ye={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},ae=Object.keys(Ye).reduce((e,t)=>(e[t]=b.creatorTypeFactory(xa,n=>n.props({uploadType:Ye[t][0],maxLength:Ye[t][1]})),e),{});ae.uploadImage=ae.image;ae.uploadFile=ae.file;const O=p(p(p(p(p(p(p(p({},ya),K),Un),ba),va),$a),Sa),ae),Ca=["autoComplete","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate","group"];Ca.forEach(e=>{O[e]=b.creatorFactory(e)});O.auto=O.autoComplete;O.number=O.inputNumber;O.color=O.colorPicker;O.hidden=(e,t)=>b.creatorFactory("hidden")("",e,t);const Ta=24*60*60*1e3,E={today:"今天",yesterday:"昨天",lastWeek:"上周",last7:"近7天",last30:"近30天",thisMonth:"本月",thisYear:"今年"},Fa=["rgba(1, 1, 1, 0)","#45b787","#21532fff","#6e9bc5","#2775b6","#F26666","#D95970","#ECD2B9","#BF9D8A","#ECDEC0","#D0AC57","#e0e0e0","#beb6b6","#918883","#F2F2F2","#ececec","#2E3032","#182327","rgba(0, 0, 0, 0.5)"];function _e(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function X(e,...t){const n=_e(e)?p({},e):{};for(const r of t)if(_e(r))for(const i of Object.keys(r)){const s=r[i];n[i]=_e(s)?X(_e(n[i])?n[i]:{},s):s}return n}function qt(e,t,n){let r=e;for(const i of t.split(".")){if(r==null)return n;r=r[i]}return r===void 0?n:r}function R(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function z(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function Vn(e){const t=R(e);return t.setDate(t.getDate()-t.getDay()),t}function Aa(e){const t=R(e);return t.setDate(t.getDate()-t.getDay()+6),z(t)}function ka(e){const t=R(e);return t.setDate(1),t}function Pa(e){return new Date(new Date(e).getFullYear(),0,1,0,0,0,0)}function M(e,t){return new Date(e.getTime()+t*Ta)}const Ea=[{text:E.today,value:()=>R(new Date).getTime()},{text:E.yesterday,value:()=>R(M(new Date,-1)).getTime()},{text:E.lastWeek,value:()=>Vn(M(new Date,-7)).getTime()}],Ia=[{text:E.today,value:()=>[R(new Date).getTime(),z(new Date).getTime()]},{text:E.yesterday,value:()=>[R(M(new Date,-1)).getTime(),z(M(new Date,-1)).getTime()]},{text:E.lastWeek,value:()=>[Vn(M(new Date,-7)).getTime(),Aa(M(new Date,-7)).getTime()]},{text:E.last7,value:()=>[R(M(new Date,-7)).getTime(),z(new Date).getTime()]},{text:E.last30,value:()=>[R(M(new Date,-30)).getTime(),z(new Date).getTime()]},{text:E.thisMonth,value:()=>[ka(new Date).getTime(),z(new Date).getTime()]},{text:E.thisYear,value:()=>[Pa(new Date).getTime(),z(new Date).getTime()]}];function Da(e){return e.getTime()>Date.now()}const Yt={hidden:{hidden:!0},datePicker:{props:{valueFormat:"timestamp"}},timePicker:{props:{format:"HH:mm",valueFormat:"HH:mm"}},select:{props:{showKey:!0,showCode:!0}},treeSelect:{props:{defaultExpandAll:!0,expandOnClickNode:!1}},treeSelectMultiple:{props:{multiple:!0,type:"checked",showCheckbox:!0}},inputNumber:{align:"right"},inputCurrency:{align:"right"},inputPercent:{align:"right"},switch:{align:"center"},colorPicker:{props:{showAlpha:!0,predefine:Fa}},divider:{props:{contentPosition:"left"}}};function Ra(e,t){if(t===void 0)return e;if(!Array.isArray(t))return t;const n=new Set(t.map(r=>r&&r.slot).filter(Boolean));return[...e.filter(r=>!r.slot||!n.has(r.slot)),...t]}function Wn(e,t={}){const{type:n,disabledDate:r,shortcuts:i}=e||{};let s=Yt[n||""];if(n==="datePicker"){if(r===!0&&(s=X({},s,{props:{disabledDate:Da}})),i===!0){const d=qt(e,"props.type")==="daterange";s=X({},s,{props:{shortcuts:d?Ia:Ea}})}}else n==="treeSelect"&&qt(e,"props.multiple")&&(s=X({},s,Yt.treeSelectMultiple));if(!s)return e;const o=t.includeChildren!==!1,f=s,{children:l}=f,a=me(f,["children"]),u=X({},o?s:a,e);return o&&l?g(p({},u),{children:Ra(l,e.children)}):u}function Na(){b.VNode.use(da);const{AbForm:e}=b({ui:"element-ui",version:"0.1.2",formRender:ha,components:eo,parsers:ca,makers:O,getConfig:ua,mergeRule:t=>Wn(t)});return e}function Oa(e,t={}){const{AbForm:n}=t||{};n&&(e.use(n),e.component("ab-icon",lt),e.component("ab-router-link",fe))}var ja=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["ab-search",e.compactMode?"compact":""]},[n("ab-form",{ref:"visibleForm",attrs:{rule:e.visibleRule,option:e.formOption},on:{change:e.handleFormChange}}),n("transition",{staticClass:"ab-search__expanded",attrs:{mode:"out-in",appear:""}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}]},[n("ab-form",{ref:"hiddenForm",attrs:{rule:e.hiddenRule,option:e.formOption},on:{change:e.handleFormChange}})],1)])],1)},Ma=[];const Ha={name:"AbSearch",props:{rule:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})},option:{type:Object,default:()=>({})},compactMode:{type:Boolean,default:!1}},data(){return{expanded:!1,opr:this.createOperatesRule()}},computed:{formOption(){const{getCurrentSize:e}=A(),t=e();return g(p({},this.option),{formData:this.value,form:g(p({},this.option&&this.option.form),{size:t})})},visibleRule(){return[...this.rule.filter(e=>!this.isHidden(e)),this.opr]},hiddenRule(){return this.rule.filter(e=>this.isHidden(e)).map(e=>g(p({},this.getRule(e)),{hidden:!1}))}},watch:{value:{handler(e){this.syncValue(e)},deep:!0}},mounted(){this.syncValue(this.value)},methods:{createOperatesRule(){return{type:"formItem",native:!0,class:"ab-form-item ab-search__operates",children:[{type:"ElButton",native:!0,children:["搜索"],props:{type:"primary",icon:"el-icon-search"},on:{click:()=>this.handleSearch()}},{type:"ElButton",native:!0,children:["重置"],props:{icon:"el-icon-refresh"},on:{click:()=>this.handleReset()}},{type:"ElButton",native:!0,children:["展开"],props:{type:"text",icon:"el-icon-arrow-down"},on:{click:()=>this.toggleExpand()}}]}},updateOperatesRule(){const e=this.opr.children[2];e.children=[this.expanded?"收起":"展开"],e.props.icon=this.expanded?"el-icon-arrow-up":"el-icon-arrow-down"},getRule(e){return e&&typeof e.getRule=="function"?e.getRule():e},isHidden(e){const t=this.getRule(e);return!!(t&&t.hidden)},forms(){return[this.$refs.visibleForm,this.$refs.hiddenForm]},collectFormData(){const e=p({},this.value);return this.forms().forEach(t=>{const n=t&&t.$f;n&&Object.assign(e,n.formData())}),e},syncValue(e){this.forms().forEach(t=>{const n=t&&t.$f;n&&Object.keys(e||{}).forEach(r=>n.setValue(r,e[r]))})},handleFormChange(){this.$emit("input",this.collectFormData())},toggleExpand(){this.expanded=!this.expanded,this.updateOperatesRule()},handleSearch(){const e=this.collectFormData();this.$emit("input",e),this.$emit("search",e)},handleReset(){this.forms().forEach(e=>{const t=e&&e.$f;t&&t.resetFields()}),this.$emit("input",{}),this.$emit("reset",{})}}},Kt={};var Ba=$(Ha,ja,Ma,!1,La,"6f06c64a",null,null);function La(e){for(let t in Kt)this[t]=Kt[t]}const Gn=function(){return Ba.exports}();function za(e){e.component("ab-search",Gn)}var qa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-drawer",{attrs:{visible:e.currentVisible,"with-header":!1,"show-close":!1,"append-to-body":"","close-on-click-modal":"","close-on-press-escape":"","destroy-on-close":"",size:e.drawerSize},on:{"update:visible":function(r){e.currentVisible=r}}},[e._t("default")],2)},Ya=[];const Ka={name:"AbDrawer",model:{prop:"visible",event:"update:visible"},props:{visible:{type:Boolean,default:!1},detailLevel:{type:Number,default:1}},computed:{currentVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}},drawerSize(){return this.detailLevel&&this.detailLevel<5?`${100-24-this.detailLevel*8}%`:"32%"}}},Ut={};var Ua=$(Ka,qa,Ya,!1,Va,null,null,null);function Va(e){for(let t in Ut)this[t]=Ut[t]}const Qn=function(){return Ua.exports}();function Wa(e){e.component("ab-drawer",Qn)}function Jn(e,t,n=[]){const r=e.filter(i=>{var s;return i.field||i.expand||((s=i.children)==null?void 0:s.length)}).filter(i=>i.tableVisible!==!1).map((i,s)=>{var l;const o=Wn(p({},i),{includeChildren:!1});return o.children&&o.field!=="OPERATE"&&(o.children=Jn(o.children,t,[...n,i.field?`field:${i.field}`:`index:${s}`])),o.field!=="operate"&&!((l=o.children)!=null&&l.length)&&(o.sortFieldTable===void 0&&t&&(o.sortFieldTable=t),o.width===void 0&&o.minWidth===void 0&&(o.width=120)),o});return Ga(r,n)}function Ga(e,t=[]){var i;const n=[],r=new Map;for(const s of e){const o=typeof s.group=="string"?s.group?[s.group]:[]:(i=s.group)!=null?i:[];if(!Array.isArray(o)||o.some(u=>typeof u!="string"||!u.trim()))throw new TypeError("Table column group must be a non-empty name or an array of non-empty names.");if(!o.length){n.push(s);continue}let l=n;const a=[];let c;for(const u of o){a.push(u);const f=JSON.stringify(a);let d=r.get(f);d||(d={field:`__ab_table_group__${encodeURIComponent(JSON.stringify([t,a]))}`,title:u,children:[]},r.set(f,d),l.push(d)),c=d,l=d.children}c&&s.groupAlign!==void 0&&(c.groupAlign=s.groupAlign),l.push(s)}return n}function Qa(e,t){const n=e.sortData;if(!n)return e;const r=new Map,i=new Set;function s(u,f){var d;for(const y of u){const h=y.getKey?y.getKey():y.field;h&&(r.set(h,f),y.defaultVisible===!1&&i.add(h),(d=y.children)!=null&&d.length&&s(y.children,h))}}s(t,null);const o=new Set;function l(u,f){return u.some(d=>{if(!d||typeof d.k!="string"||d.c!==void 0&&!Array.isArray(d.c))return!0;const{k:y,c:h}=d;return o.has(y)||r.has(y)&&r.get(y)!==f?!0:(o.add(y),h?l(h,y):!1)})}if(!(Array.isArray(n)?l(n,null):typeof n!="object"||Object.keys(n).some(u=>r.has(u)&&r.get(u)!==null)))return e;const c=e.visibleData&&p({},e.visibleData);if(c)for(const u of i)c[u]===!0&&delete c[u];return g(p({},e),{sortData:void 0,visibleData:c})}function Xn(e,t){for(const n of e){if(n.field===t)return n;if(n.children){const r=Xn(n.children,t);if(r)return r}}}function Ja(e,t,n,r){if(!n)return e;const i=n.footerFormatter||De(n).formatter;return i?i({cellValue:e,row:t,column:r||n}):e}function Xa(e,t,n,r,i){var y;if(typeof e.labelField!="string"||!e.labelField.trim()||!Array.isArray(e.fields))throw new TypeError("AbTable footerSummary requires a labelField and a fields array.");const s=["__proto__","constructor","prototype"],o=new Set([e.labelField]),l=[],a=[],c=h=>{if(!h.trim()||o.has(h)||s.includes(h))throw new TypeError(`AbTable footerSummary has an invalid or duplicate field: "${h}".`);o.add(h)};if(s.includes(e.labelField))throw new TypeError("AbTable footerSummary has an invalid labelField.");for(const h of e.fields)if(typeof h=="string")c(h),l.push(h);else{if(!h||typeof h!="object"||Array.isArray(h)||!Object.keys(h).length)throw new TypeError("AbTable footerSummary fields must be field names or objects of callbacks.");for(const[m,v]of Object.entries(h)){if(c(m),typeof v!="function")throw new TypeError(`AbTable footerSummary handler for "${m}" must be a function.`);a.push([m,v])}}const u={};for(const h of l){let m=null;for(const v of t){const x=v[h];if(!(x==null||typeof x=="string"&&!x.trim())){if(typeof x!="number"&&typeof x!="string"||!Number.isFinite(Number(x)))throw new TypeError(`AbTable footerSummary field "${h}" must contain numbers or numeric strings.`);if(m=(m!=null?m:0)+Number(x),!Number.isFinite(m))throw new RangeError(`AbTable footerSummary total for "${h}" is not finite.`)}}u[h]=m}for(const[h,m]of a){const v=t.length?m({rows:t,totals:Object.freeze(p({},u))}):null;if(v!==null&&(typeof v!="number"||!Number.isFinite(v)))throw new TypeError(`AbTable footerSummary handler for "${h}" must return a finite number or null.`);u[h]=v}const f=p({[e.labelField]:(y=e.label)!=null?y:r},u),d=p({},f);for(const[h,m]of Object.entries(u))d[h]=m===null?"-":Ja(m,f,Xn(n,h),i(h));return d}const T={DETAIL:"detail",DEL:"del",ADD:"add",EDIT:"edit",SAVE:"save",CREATE:"create",READ:"read",UPDATE:"update",EXPORT:"export",OPERATE:"OPERATE"};function Ke(e,t){return!(e!=null&&e.length)&&!(t!=null&&t.length),!0}function Za(e){return e==null?[]:Array.isArray(e)?e:[e]}function Zn(e="default"){return e==="large"?"medium":e==="default"?"small":"mini"}function el(e){let t=0;for(const n of e)n.group&&(t=Math.max(t,Za(n.group).length));return t+1}const Vt={mini:36,small:40,medium:44,large:48},tl={name:"AbTable",provide(){return{abTableRef:{value:this},abTableDetailRef:{value:this}}},props:{id:{type:[String,Number],default:void 0},title:String,rule:{type:Array,default:()=>[]},queryHandler:Function,query:{type:Object,default:()=>({})},pagerEnable:{type:Boolean,default:!0},pagerConfig:{type:Object,default:()=>({})},locale:{type:String,default:"zh-cn"},idField:{type:String,default:"id"},idFieldTable:String,permiPrefix:String,compactMode:Boolean,parentIdField:String,accordion:Boolean,hasChildField:{type:String,default:"hasChildren"},lazyMethod:Function,isCurrent:Boolean,dragable:Boolean,absDragable:Boolean,rowClassName:Function,headerCellClassName:Function,cellClassName:Function,rowStyle:[String,Object,Function],editable:Boolean,singleSelect:Boolean,multiSelect:Boolean,validRules:Object,sortable:{type:Boolean,default:!0},sortLocally:Boolean,footerSummary:Object,maxHeight:Number,offsetTop:Number,autoHeight:Boolean,readonly:{type:Boolean,default:!0},size:{type:String,default:"default"}},data(){return{currentValue:[],loading:!1,pageNo:1,pageSize:10,currentPageSizes:[10,15,20,50,100],total:0,sortFieldTable:"",sortField:"",sortType:"",maxH:this.maxHeight||0,requestVersion:0,sortParams:void 0}},computed:{currentRule(){return Jn(this.rule,this.idFieldTable)},tableId(){return this.id||`ab-table-${this._uid}`},vxeCurrentSize(){return Zn(this.size)},pagerFields(){var e,t,n,r,i;return{pageNo:(e=this.pagerConfig.pageNoField)!=null?e:"pageNo",pageSize:(t=this.pagerConfig.pageSizeField)!=null?t:"pageSize",sortFieldTable:(n=this.pagerConfig.sortFieldTableField)!=null?n:"sortFieldTable",sortField:(r=this.pagerConfig.sortFieldField)!=null?r:"sortField",sortType:(i=this.pagerConfig.sortTypeField)!=null?i:"sortType"}},sortConfig(){return{trigger:"cell",remote:!this.sortLocally}},currentFooterData(){if(!this.footerSummary)return[];const e=this.$refs.table,t=n=>e&&e.getColumnByField?e.getColumnByField(n):void 0;return[Xa(this.footerSummary,this.currentValue,this.currentRule,"合计",t)]},currentReadonly(){return!(!this.readonly||this.multiSelect||this.singleSelect)}},watch:{query:{handler(){this.reload()},deep:!0},vxeCurrentSize:{handler(){this.$nextTick(()=>this.calculateTableHeight())}},compactMode:{handler(){this.$nextTick(()=>this.calculateTableHeight())}}},created(){this.initializePager()},mounted(){this.calculateTableHeight(),this.init()},methods:{initializePager(){var t,n,r,i,s;const e=this.pagerFields;this.pageNo=Number((t=this.query[e.pageNo])!=null?t:1),this.pageSize=Number((n=this.query[e.pageSize])!=null?n:10),this.sortFieldTable=(r=this.query[e.sortFieldTable])!=null?r:"",this.sortField=(i=this.query[e.sortField])!=null?i:"",this.sortType=(s=this.query[e.sortType])!=null?s:""},calculateTableHeight(){var c,u;if(!this.autoHeight){this.maxH=this.maxHeight||0;return}const e=this.$refs.table,t=((c=e==null?void 0:e.cellConfig)==null?void 0:c.height)||Vt[this.vxeCurrentSize]||Vt.medium,n=this.$el&&this.$el.parentElement,r=((u=n==null?void 0:n.querySelector(".ab-toolbar"))==null?void 0:u.getBoundingClientRect().height)||0,i=this.$refs.pager&&this.$refs.pager.$el,s=(i==null?void 0:i.getBoundingClientRect().height)||0,o=el(this.rule)*t,l=((n==null?void 0:n.getBoundingClientRect().height)||500)-r-s;if(this.maxH=this.offsetTop?Math.max(l,window.innerHeight-this.offsetTop):l,this.maxH<=0)return;let a=Math.min(Math.max(Math.round((this.maxH-o-t*1.5)/t),10),100);this.footerSummary&&(a-=1),this.currentPageSizes.includes(a)||(this.currentPageSizes=[...this.currentPageSizes,a].sort((f,d)=>f-d)),this.pageSize=a},init(){return P(this,null,function*(){var t,n;if(typeof this.queryHandler!="function")return;const e=++this.requestVersion;this.loading=!0;try{const r=this.pagerFields,i=g(p({},this.query),{[r.pageNo]:this.pageNo,[r.pageSize]:this.pageSize,[r.sortFieldTable]:this.sortFieldTable,[r.sortField]:this.sortField,[r.sortType]:this.sortType}),s=yield this.queryHandler(i);if(e!==this.requestVersion)return;const o=Array.isArray(s)?s:(t=s==null?void 0:s.data)!=null?t:s==null?void 0:s.list;if(!Array.isArray(o))throw new TypeError("AbTable queryHandler must return an array or an object containing a data or list array.");this.currentValue=o,this.total=Array.isArray(s)?s.length:(n=s.total)!=null?n:o.length}finally{e===this.requestVersion&&(this.loading=!1)}})},reload(){return P(this,null,function*(){this.pageNo=1,yield this.init()})},refresh(){return P(this,null,function*(){yield this.init()})},resize(){this.calculateTableHeight()},remove(e){const t=this.currentValue.indexOf(e);t>=0&&this.currentValue.splice(t,1),this.total=Math.max(0,this.total-1)},exportData(e){return P(this,null,function*(){const t=this.$refs.table;!t||typeof t.exportData!="function"||(yield t.exportData({filename:e||this.title,columns:this.currentRule.filter(n=>n.field&&n.field!==T.OPERATE&&!n.hidden)}))})},handlePageChange({currentPage:e,pageSize:t}){this.pageNo=e,this.pageSize=t,this.init()},handleSortChanged({field:e,order:t,column:n}){var r,i,s,o,l;t?(this.sortFieldTable=(o=(s=(i=n==null?void 0:n.params)==null?void 0:i.sortFieldTable)!=null?s:this.idFieldTable)!=null?o:"",this.sortField=(((l=n==null?void 0:n.params)==null?void 0:l.sortField)||e).replace(/[A-Z]/g,a=>`_${a.toLowerCase()}`),this.sortType=t):(this.sortFieldTable=(r=this.idFieldTable)!=null?r:"",this.sortField=this.idField||"id",this.sortType="desc"),this.refresh()},handleCellClick({row:e,column:t}){var r,i;if((t==null?void 0:t.field)===T.OPERATE)return;const n=this.$refs.table;!this.editable||this.currentReadonly?(r=n==null?void 0:n.clearCheckboxRow)==null||r.call(n):(i=n==null?void 0:n.setCheckboxRow)==null||i.call(n,e,!0),this.$emit("cellClick",{row:e,column:t})},columnProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){const t={id:this.tableId,data:this.currentValue,stripe:!this.parentIdField,border:!0,size:this.vxeCurrentSize,loading:this.loading,showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,autoResize:!0,sortConfig:this.sortConfig,showFooter:!!this.footerSummary,footerData:this.currentFooterData,cellClassName:this.cellClassName,headerCellClassName:this.headerCellClassName,rowClassName:this.rowClassName,rowStyle:this.rowStyle,customConfig:{immediate:!0,storage:!0,restoreStore:(i={})=>{const s=i.storeData,o=i.$table||this.$refs.table;return!s||!o||typeof o.getFullColumns!="function"?s:Qa(s,o.getFullColumns())}}};this.maxH&&(t.maxHeight=this.maxH),this.compactMode&&(t.cellConfig={padding:!1,height:30});const n=this.currentRule.map((i,s)=>e("ab-table-columns",{props:this.columnProps(i,s),on:{refresh:this.refresh},key:i.field||s})),r=[e("vxe-table",{props:t,ref:"table",on:{"sort-change":this.handleSortChanged,"cell-click":this.handleCellClick}},n)];if(this.pagerEnable){const i={currentPage:this.pageNo,pageSize:this.pageSize,pageSizes:this.currentPageSizes,total:this.total};this.pagerConfig.layouts&&(i.layouts=this.pagerConfig.layouts),r.push(e("vxe-pager",{props:i,ref:"pager",on:{"page-change":this.handlePageChange}}))}return e("div",{class:"ab-table"},r)}};let nl,rl;const Wt={};var il=$(tl,nl,rl,!1,sl,null,null,null);function sl(e){for(let t in Wt)this[t]=Wt[t]}const ol=function(){return il.exports}(),al={name:"AbTableColumns",props:{rule:{type:Object,required:!0},idx:{type:[Number,String],default:0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},computed:{isGroup(){var t;const e=this.rule||{};return!!((t=e.children)!=null&&t.length)&&(e.field?e.field!==T.OPERATE:!e.type&&!!e.title)}},methods:{childProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){return this.isGroup?e("vxe-colgroup",{props:{field:this.rule.field,title:this.rule.title,headerAlign:this.rule.groupAlign||this.rule.align||"center"}},(this.rule.children||[]).map((t,n)=>e("ab-table-columns",{props:this.childProps(t,n),on:{refresh:()=>this.$emit("refresh")},key:t.field||`${this.idx}_${n}`}))):e("ab-table-column",{props:this.childProps(this.rule,this.idx),on:{refresh:()=>this.$emit("refresh")}})}};let ll,cl;const Gt={};var ul=$(al,ll,cl,!1,dl,null,null,null);function dl(e){for(let t in Gt)this[t]=Gt[t]}const fl=function(){return ul.exports}();function pl(e,t){if(!e||typeof e.options!="function")return;if(e.__abOptionsPromise)return e.__abOptionsPromise;const n=e.options;return e.__abOptionsPromise=Promise.resolve().then(()=>n()).then(r=>(e.options=Array.isArray(r)?r:[],t&&t(e.options),e.options)).catch(()=>(e.options=[],t&&t(e.options),e.options)),e.__abOptionsPromise}const hl={name:"AbTableColumn",props:{rule:{type:Object,required:!0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},data(){return{loadedOptions:void 0}},created(){pl(this.rule,e=>{this.loadedOptions=e})},computed:{effectiveRule(){return this.loadedOptions?g(p({},this.rule),{options:this.loadedOptions}):this.rule},isVisible(){return!this.rule.hidden},ruleSortable(){return this.sortable!==!1&&this.rule.sortable!==!1&&this.rule.sortFieldTable!==!1&&(this.rule.sortable===!0||this.rule.sortFieldTable!==void 0||!!this.idFieldTable)},ruleParams(){var e,t,n,r,i;return g(p({},this.rule.params||{}),{sortField:(t=this.rule.sortField)!=null?t:(e=this.rule.params)==null?void 0:e.sortField,sortFieldTable:typeof this.rule.sortFieldTable=="string"?this.rule.sortFieldTable:(i=(r=(n=this.rule.params)==null?void 0:n.sortFieldTable)!=null?r:this.idFieldTable)!=null?i:""})},formatter(){return De(this.effectiveRule).formatter}},methods:{changeHandler({cellValue:e,row:t,column:n}){var r,i;typeof((i=(r=this.rule)==null?void 0:r.on)==null?void 0:i.change)=="function"&&this.rule.on.change({cellValue:e,row:t,column:n})},formattedValue(e){const t=e.row?e.row[this.rule.field]:void 0;return this.formatter?this.formatter({cellValue:t,column:e.column,row:e.row}):t==null?"":t},renderCell(e,t){var s,o;const n=this.rule.field,r=t.row?t.row[n]:void 0,i=[];if(this.rule.type==="ElRow"&&n===T.OPERATE?i.push(e("ab-table-operate",{props:{idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,rule:this.rule,modelValue:t.row,deleteHandler:this.deleteHandler,readonly:this.readonly,link:!0},on:{refresh:()=>this.$emit("refresh")}})):this.rule.cellRender&&this.rule.type==="switch"?i.push(e("el-switch",{props:g(p({},this.rule.props||{}),{value:r}),on:{change:l=>{t.row[n]=l,this.changeHandler({cellValue:l,row:t.row,column:t.column})}}})):this.rule.cellRender?i.push(this.rule.type||""):this.rule.link?i.push(e("ab-router-link",{props:{link:this.rule.link,value:r,row:t.row}},[String((s=this.formattedValue(t))!=null?s:"")])):i.push(String((o=this.formattedValue(t))!=null?o:"")),this.rule.cellArrow){const l=Number(r)<0;i.push(e("ab-icon",{props:{icon:l?"streamline:graph-arrow-decrease":"streamline:graph-arrow-increase"},class:l?"danger":"success"}))}return i}},render(e){if(!this.rule.field)return e("span");const t={title:this.rule.title,field:this.rule.field,sortable:this.ruleSortable,params:this.ruleParams,width:this.rule.width||"auto",minWidth:this.rule.minWidth,align:this.rule.align,fixed:this.rule.fixed,visible:this.isVisible,className:this.rule.cellArrow?"items-center":""};return e("vxe-column",{props:t,scopedSlots:{default:n=>this.renderCell(e,n)}})}};let ml,yl;const Qt={};var gl=$(hl,ml,yl,!1,bl,null,null,null);function bl(e){for(let t in Qt)this[t]=Qt[t]}const _l=function(){return gl.exports}(),Fe=e=>{if(Array.isArray(e))return e.map(Fe);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(n=>{t[n]=Fe(e[n])}),t}return e},vl=(...e)=>{const t=[],n=new Set,r=i=>{if(i){if(typeof i=="string"){if(n.has(i))return;n.add(i)}t.push(i)}};return e.forEach(i=>{i&&(Array.isArray(i)?i.forEach(r):r(i))}),t},$l={name:"AbTableOperate",inject:{abTableRef:{default:()=>({})},abTableDetailRef:{default:()=>({})}},props:{rule:{type:[Object,Array],default:void 0},modelValue:{type:Object,default:()=>({})},idField:String,idFieldTable:String,permiPrefix:String,link:Boolean,plain:Boolean,deleteHandler:Function,readonly:Boolean},computed:{formOption(){const{getCurrentSize:e}=A(),t=e();return{formData:this.value,form:{size:t}}},rules(){var t,n,r,i,s,o,l;if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=Array.isArray(this.rule)?{type:"ElRow",children:Fe(this.rule),native:!0}:g(p({},Fe(this.rule)),{native:!0});delete e.field;for(const a of e.children||[])if(a.props=this.buttonProps(((t=a.props)==null?void 0:t.type)||"primary",a),a.field===T.CREATE?(a.children=[{type:"icon",props:{icon:"ep:plus"}},"新增"],a.props=this.buttonProps("primary",a),(n=a.on)!=null&&n.click||(a.on=g(p({},a.on||{}),{click:this.createHandler})),this.permiPrefix&&!((r=a.computed)!=null&&r.hidden)&&(a.computed=g(p({},a.computed||{}),{hidden:this.createEnabled}))):a.field===T.DETAIL?(a.children=[{type:"icon",props:{icon:"ep:view"}},"详情"],a.props=this.buttonProps("primary",a),(i=a.on)!=null&&i.click||(a.on=g(p({},a.on||{}),{click:this.detailHandler}))):a.field===T.DEL?(a.children=[{type:"icon",props:{icon:"ep:delete"}},"删除"],a.props=this.buttonProps("danger",a),(s=a.on)!=null&&s.click||(a.on=g(p({},a.on||{}),{click:this.delHandler})),this.permiPrefix&&!((o=a.computed)!=null&&o.hidden)&&(a.computed=g(p({},a.computed||{}),{hidden:this.deleteEnabled}))):a.field===T.EXPORT&&(a.children=[{type:"icon",props:{icon:"ep:download"}},"导出"],a.props=this.buttonProps("warning",a),this.permiPrefix&&!((l=a.computed)!=null&&l.hidden)&&(a.computed=g(p({},a.computed||{}),{hidden:this.exportEnabled}))),a.native=!0,a.computed&&a.computed.hidden!==void 0&&(a.hidden=typeof a.computed.hidden=="function"?!!a.computed.hidden():!!a.computed.hidden),a.inject&&a.on&&typeof a.on.click=="function"){const c=a.on.click,u=this.modelValue;a.on.click=f=>c(p({api:{getValue:d=>(u||{})[d]},row:u},f&&typeof f=="object"?f:{}))}return[e]}},methods:{buttonProps(e,t){const n={plain:this.plain,size:"mini"};return this.link?(n.type="text",t&&(t.class=vl(t.class,`${e}`))):n.type=e,n},createEnabled(){return!Ke([`${this.permiPrefix}:create`],["admin"])},deleteEnabled(){return!Ke([`${this.permiPrefix}:delete`],["admin"])},exportEnabled(){return!Ke([`${this.permiPrefix}:export`],["admin"])},toggleDetail(e){const t=this.abTableDetailRef&&this.abTableDetailRef.value;t&&typeof t.toggle=="function"&&t.toggle(!0,this.modelValue,e)},createHandler(){this.toggleDetail(!1)},detailHandler(){this.toggleDetail(this.readonly)},delHandler(){return P(this,null,function*(){typeof this.deleteHandler=="function"&&this.idField&&(yield this.deleteHandler(this.modelValue[this.idField]));const e=this.abTableRef&&this.abTableRef.value;e&&typeof e.remove=="function"&&e.remove(this.modelValue),this.$emit("refresh")})}},render(e){return this.rules?e("ab-form",{props:{rule:this.rules,value:this.modelValue,inline:!0},on:{refresh:()=>this.$emit("refresh"),input:t=>this.$emit("input",t)}}):e("span")}};let wl,Sl;const Jt={};var xl=$($l,wl,Sl,!1,Cl,null,null,null);function Cl(e){for(let t in Jt)this[t]=Jt[t]}const Tl=function(){return xl.exports}();function Fl(e){e.component("ab-table",ol),e.component("ab-table-columns",fl),e.component("ab-table-column",_l),e.component("ab-table-operate",Tl),e.component("ab-router-link",fe)}var Al=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-detail"},[n("el-card",{staticClass:"ab-detail__header w-full",attrs:{shadow:"never"}},[n("div",{staticClass:"ab-detail__title"},[e._v(e._s(e.currentTitle))]),n("ab-table-operate",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"ab-detail__opr",attrs:{"permi-prefix":e.permiPrefix,rule:e.operationRule,"model-value":e.currentValue,plain:"",readonly:e.currentReadonly},on:{input:function(r){e.oapi=r}}})],1),n("el-card",{staticClass:"ab-detail__form",attrs:{shadow:"never"}},[n("ab-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"formRef",attrs:{option:e.formOption,rule:e.formRules,"id-field":e.idField,"id-field-table":e.idFieldTable,readonly:e.currentReadonly},on:{input:e.handleFormApi,change:e.handleFormChange}})],1)],1)},kl=[];function Pl(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.render=="function"}function ne(e){if(Pl(e))return e;if(Array.isArray(e))return e.map(ne);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(n=>{t[n]=ne(e[n])}),t}return e}const El={name:"AbDetail",provide(){return{abTableDetailRef:{value:this}}},props:{title:String,id:{type:[String,Number],default:void 0},idField:{type:String,default:"id"},idFieldTable:String,value:{type:Object,default:()=>({})},rule:{type:Array,default:()=>[]},validRules:Object,permiPrefix:String,getHandler:Function,createHandler:Function,updateHandler:Function,deleteHandler:Function,vertical:Boolean,detailLevel:{type:Number,default:1},editable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!0}},data(){return{currentValue:{},currentReadonly:this.readonly,loading:!1,fapi:void 0,oapi:void 0}},computed:{formOption(){const{getCurrentSize:e}=A();return{form:{size:e()}}},isCreate(){const e=this.currentValue?this.currentValue[this.idField]:void 0;return!e||e==="new"},currentTitle(){const e=this.title||this.$route&&this.$route.meta&&this.$route.meta.title||"";return this.isCreate?`新增 - ${e}`:this.currentReadonly?`详情 - ${e}`:`编辑 - ${e}`},rules(){return(this.rule||[]).map(e=>e&&typeof e.getRule=="function"?e.getRule():e)},operationRule(){const e=this.rules.find(r=>r.type!==T.OPERATE&&r.field===T.OPERATE),t=e?ne(e):{type:"ElRow",field:T.OPERATE,title:"操作",width:260,fixed:"right",children:[]};t.children=(t.children||[]).filter(r=>r.field!==T.DETAIL);const n=this;return t.children.push({type:"ElButton",hidden:!this.currentReadonly,children:[{type:"icon",props:{icon:"ep:edit-pen"}},"编辑"],props:{type:"primary"},on:{click:()=>n.editHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:check"}},"保存"],props:{type:"success",plain:!0},on:{click:()=>n.saveHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:refresh-right"}},"取消"],on:{click:()=>n.cancelHandler()}},{type:"ElButton",children:[{type:"icon",props:{icon:"ep:back"}},"返回"],on:{click:()=>n.returnHandler()}}),t},formRules(){return this.rules.filter(e=>e.type!==T.OPERATE&&e.field!==T.OPERATE).map(e=>ne(e))}},watch:{value:{handler(e){this.currentValue=p({},e),this.syncFormData(e)},immediate:!0,deep:!0},readonly(e){this.currentReadonly=e},id(e){this.init(e)}},mounted(){this.init(this.id)},methods:{formApi(){return this.fapi||this.$refs.formRef&&this.$refs.formRef.$f},handleFormApi(e){this.fapi=e},handleFormChange(){const e=this.formApi(),t=e?e.formData():p({},this.currentValue);this.currentValue=t,this.$emit("input",t)},resetFormData(){const e=this.formApi();e&&typeof e.resetFields=="function"&&e.resetFields()},syncFormData(e){const t=this.formApi();!t||!e||Object.keys(e).forEach(n=>t.setValue(n,e[n]))},refreshForm(){const e=this.formApi();e&&typeof e.refresh=="function"&&e.refresh()},init(e){return P(this,null,function*(){this.loading=!0;let t;e!=null&&typeof this.getHandler=="function"?t=(yield this.getHandler(e))||{}:t={},this.currentValue=t,yield this.$nextTick(),this.resetFormData(),this.syncFormData(t),this.refreshForm(),this.loading=!1,this.$emit("input",this.currentValue)})},editHandler(){this.currentReadonly=!1,this.refreshForm()},saveHandler(){return P(this,null,function*(){if(this.loading=!0,this.isCreate&&typeof this.createHandler=="function"){const e=yield this.createHandler(this.currentValue);e&&(this.currentValue[this.idField]=e),yield this.$nextTick(),this.$emit("input",this.currentValue)}else!this.isCreate&&typeof this.updateHandler=="function"&&(yield this.updateHandler(this.currentValue));this.loading=!1,this.close()})},cancelHandler(){this.currentReadonly=!0,this.refreshForm()},returnHandler(){this.close()},open(e=void 0,t=!1){return P(this,null,function*(){this.currentReadonly=t,this.loading=!0;let n;typeof this.getHandler=="function"&&e&&e[this.idField]?n=(yield this.getHandler(e[this.idField]))||{}:(n=ne(e)||{},this.rules.forEach(r=>{r.field&&r.field!==T.OPERATE&&typeof n[r.field]=="undefined"&&typeof r.edit=="undefined"&&typeof r.itemRender=="undefined"&&(n[r.field]="")})),this.currentValue=n,yield this.$nextTick(),this.resetFormData(),this.syncFormData(n),this.refreshForm(),this.loading=!1,this.$emit("open",this.currentValue),this.$emit("input",this.currentValue)})},close(){this.currentReadonly=!0,this.currentValue={},this.resetFormData(),this.$emit("close")},toggle(e=!1,t=void 0,n=!1){return e?this.open(t,n):this.close()},reload(){return P(this,null,function*(){if(typeof this.getHandler!="function"||!this.currentValue[this.idField]){console.error("abTableDetail.reload: no getHandler or no idField!");return}const e=yield this.getHandler(this.currentValue[this.idField]);this.open(e,this.currentReadonly)})}}},Xt={};var Il=$(El,Al,kl,!1,Dl,null,null,null);function Dl(e){for(let t in Xt)this[t]=Xt[t]}const er=function(){return Il.exports}();function Rl(e){e.component("ab-detail",er)}const Nl=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),Ol={name:"AbToolbar",inject:{abTableRef:{default:()=>({})}},props:{title:String,permiPrefix:String,rule:{type:[Object,Array],default:void 0},queryHandler:Function,refreshEnable:{type:Boolean,default:!0},exportEnable:{type:Boolean,default:!1},settingEnable:{type:Boolean,default:!0},btnTreeEnable:Boolean,classNmae:String,vertical:{type:Boolean,default:!1}},data(){return{loading:!1}},computed:{vxeCurrentSize(){return Zn("default")},currentRule(){if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=Nl(this.rule);return Array.isArray(e)?{type:"ElRow",children:[...e]}:e},refreshHandler(){if(this.queryHandler)return this.queryHandler;const e=this.abTableRef&&this.abTableRef.value;if(e&&typeof e.reload=="function")return e.reload}},mounted(){const e=this.abTableRef&&this.abTableRef.value,t=this.$refs.toolbar&&(this.$refs.toolbar.$el?this.$refs.toolbar:this.$refs.toolbar);e&&e.tableRef&&t&&typeof e.tableRef.connect=="function"&&e.tableRef.connect(t)},methods:{getTitle(){return this.title},renderButtons(e){var t,n;return this.title?e("div",{class:"ab-toolbar__title"},[this.$slots.icon,this.title]):this.$slots.buttons?this.$slots.buttons:e("div",{class:"ab-toolbar__title"},[((n=(t=this.$route)==null?void 0:t.meta)==null?void 0:n.title)||""])},renderTools(e){const t=[...this.$slots.tools||[]];return this.currentRule&&t.push(e("ab-table-operate",{props:{permiPrefix:this.permiPrefix,rule:this.currentRule,plain:!0}})),t}},render(e){return e("vxe-toolbar",{class:"ab-toolbar",ref:"toolbar",props:{className:this.classNmae,size:this.vxeCurrentSize,loading:this.loading,export:this.exportEnable,refresh:this.refreshEnable?this.refreshHandler?{query:this.refreshHandler}:!0:!1,custom:!!this.settingEnable,vertical:this.vertical},scopedSlots:{buttons:()=>this.renderButtons(e),tools:()=>this.renderTools(e)}})}};let jl,Ml;const Zt={};var Hl=$(Ol,jl,Ml,!1,Bl,null,null,null);function Bl(e){for(let t in Zt)this[t]=Zt[t]}const Ll=function(){return Hl.exports}();function zl(e){e.component("ab-toolbar",Ll)}const Re=Na();typeof window!="undefined"&&(window.abForm=Re);function Ae(e,t={}){t&&t.upload&&(e.prototype.$abUploadApis=t.upload),!Ae.installed&&(Ae.installed=!0,Oa(e,{AbForm:Re}),za(e),Wa(e),Fl(e),Rl(e),zl(e))}const ql=Re.maker,Yl={install:Ae};exports.AbDetail=er;exports.AbDrawer=Qn;exports.AbForm=Re;exports.AbIcon=lt;exports.AbSearch=Gn;exports.AbSelect=en;exports.AbTreeSelect=On;exports.default=Yl;exports.maker=ql;exports.setupArchbizKit=Ae;