(function(y,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue"),require("ant-design-vue"),require("lodash-es"),require("dayjs"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","ant-design-vue","lodash-es","dayjs","@vueuse/core"],c):(y=typeof globalThis<"u"?globalThis:y||self,c(y.index={},y.Vue,y.antDesignVue,null,null,y.core))})(this,function(y,c,w,nt,ot,Se){"use strict";var et=Object.defineProperty;var tt=(y,c,w)=>c in y?et(y,c,{enumerable:!0,configurable:!0,writable:!0,value:w}):y[c]=w;var ve=(y,c,w)=>(tt(y,typeof c!="symbol"?c+"":c,w),w);function E(e,t){const n={},o=Object.keys(t);return o.forEach(i=>{n[i]=e.style[i]}),o.forEach(i=>{e.style[i]=t[i]}),n}function V(e,t){return e.classList?e.classList.contains(t):` ${e.className} `.indexOf(` ${t} `)>-1}function Y(e,t){e.classList?e.classList.add(t):V(e,t)||(e.className=`${e.className} ${t}`)}function F(e,t){if(e.classList)e.classList.remove(t);else if(V(e,t)){const n=e.className;e.className=` ${n} `.replace(` ${t} `," ")}}function I(e){return{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,originalEvent:e}}function W(e,t,n){e.addEventListener&&e.addEventListener(t,n)}function G(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)}function Q(e){var i;const t=(i=e==null?void 0:e.target)==null?void 0:i.resizeProps;if(!t)return;function n(r){t.onDragEvent(I(r))}function o(r){G(document,"mousemove",n),G(document,"mouseup",o),t.onReleaseEvent(I(r))}W(document,"mousemove",n),W(document,"mouseup",o),t.onPressEvent(I(e))}function be(e){W(e,"mousedown",Q)}const Te={mounted(e,{value:t}){e.resizeProps=t,t.enableResize&&be(e)},unmounted(e,{value:t}){t.enableResize&&G(e,"mousedown",Q)}},Pe={index:{type:Number},orientation:{type:String,required:!0},splitBarSize:{type:String,required:!0},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean}},ee="g";function A(e,t,n){let o=e;return t&&(o+=`__${t}`),n&&(o+=`--${n}`),o}function H(e,t=!1){const n=t?`.${ee}-${e}`:`${ee}-${e}`;return{b:()=>A(n),e:a=>a?A(n,a):"",m:a=>a?A(n,"",a):"",em:(a,d)=>a&&d?A(n,a,d):""}}const ze=typeof window<"u",K="G",te=e=>ze&&"HTMLElement"in window&&e instanceof HTMLElement;for(let e=0;e<=15;e++)e.toString(16);/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */function ne(e){return Object.prototype.toString.call(e)==="[object Object]"}function we(e){var t,n;return ne(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!(ne(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},L.apply(this,arguments)}function oe(e,t){if(e==null)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)t.indexOf(n=r[o])>=0||(i[n]=e[n]);return i}const J={silent:!1,logLevel:"warn"},Oe=["validator"],ie=Object.prototype,re=ie.toString,_e=ie.hasOwnProperty,ae=/^\s*function (\w+)/;function se(e){var t;const n=(t=e==null?void 0:e.type)!==null&&t!==void 0?t:e;if(n){const o=n.toString().match(ae);return o?o[1]:""}return""}const j=we,le=e=>e;let x=le;process.env.NODE_ENV!=="production"&&(x=typeof console<"u"?function(t,n=J.logLevel){J.silent===!1&&console[n](`[VueTypes warn]: ${t}`)}:le);const N=(e,t)=>_e.call(e,t),je=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},B=Array.isArray||function(e){return re.call(e)==="[object Array]"},M=e=>re.call(e)==="[object Function]",U=e=>j(e)&&N(e,"_vueTypes_name"),ce=e=>j(e)&&(N(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>N(e,t)));function Z(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function C(e,t,n=!1){let o,i=!0,r="";o=j(e)?e:{type:e};const s=U(o)?o._vueTypes_name+" - ":"";if(ce(o)&&o.type!==null){if(o.type===void 0||o.type===!0||!o.required&&t===void 0)return i;B(o.type)?(i=o.type.some(a=>C(a,t,!0)===!0),r=o.type.map(a=>se(a)).join(" or ")):(r=se(o),i=r==="Array"?B(t):r==="Object"?j(t):r==="String"||r==="Number"||r==="Boolean"||r==="Function"?function(a){if(a==null)return"";const d=a.constructor.toString().match(ae);return d?d[1]:""}(t)===r:t instanceof o.type)}if(!i){const a=`${s}value "${t}" should be of type "${r}"`;return n===!1?(x(a),!1):a}if(N(o,"validator")&&M(o.validator)){const a=x,d=[];if(x=u=>{d.push(u)},i=o.validator(t),x=a,!i){const u=(d.length>1?"* ":"")+d.join(`
* `);return d.length=0,n===!1?(x(u),i):u}}return i}function S(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(i){return i===void 0?(N(this,"default")&&delete this.default,this):M(i)||C(this,i,!0)===!0?(this.default=B(i)?()=>[...i]:j(i)?()=>Object.assign({},i):i,this):(x(`${this._vueTypes_name} - invalid default value: "${i}"`),this)}}}),{validator:o}=n;return M(o)&&(n.validator=Z(o,n)),n}function P(e,t){const n=S(e,t);return Object.defineProperty(n,"validate",{value(o){return M(this.validator)&&x(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`),this.validator=Z(o,this),this}})}function de(e,t,n){const o=function(d){const u={};return Object.getOwnPropertyNames(d).forEach(h=>{u[h]=Object.getOwnPropertyDescriptor(d,h)}),Object.defineProperties({},u)}(t);if(o._vueTypes_name=e,!j(n))return o;const{validator:i}=n,r=oe(n,Oe);if(M(i)){let{validator:d}=o;d&&(d=(a=(s=d).__original)!==null&&a!==void 0?a:s),o.validator=Z(d?function(u){return d.call(this,u)&&i.call(this,u)}:i,o)}var s,a;return Object.assign(o,r)}function q(e){return e.replace(/^(?!\s*$)/gm,"  ")}const Ce=()=>P("any",{}),$e=()=>P("function",{type:Function}),Ne=()=>P("boolean",{type:Boolean}),Be=()=>P("string",{type:String}),Me=()=>P("number",{type:Number}),ke=()=>P("array",{type:Array}),De=()=>P("object",{type:Object}),Ee=()=>S("integer",{type:Number,validator:e=>je(e)}),Fe=()=>S("symbol",{validator:e=>typeof e=="symbol"});function Le(e,t="custom validation failed"){if(typeof e!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return S(e.name||"<<anonymous function>>",{type:null,validator(n){const o=e(n);return o||x(`${this._vueTypes_name} - ${t}`),o}})}function Re(e){if(!B(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.join('", "')}".`,n=e.reduce((o,i)=>{if(i!=null){const r=i.constructor;o.indexOf(r)===-1&&o.push(r)}return o},[]);return S("oneOf",{type:n.length>0?n:void 0,validator(o){const i=e.indexOf(o)!==-1;return i||x(t),i}})}function Ye(e){if(!B(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=[];for(let i=0;i<e.length;i+=1){const r=e[i];if(ce(r)){if(U(r)&&r._vueTypes_name==="oneOf"&&r.type){n=n.concat(r.type);continue}if(M(r.validator)&&(t=!0),r.type===!0||!r.type){x('oneOfType - invalid usage of "true" or "null" as types.');continue}n=n.concat(r.type)}else n.push(r)}n=n.filter((i,r)=>n.indexOf(i)===r);const o=n.length>0?n:null;return S("oneOfType",t?{type:o,validator(i){const r=[],s=e.some(a=>{const d=C(U(a)&&a._vueTypes_name==="oneOf"?a.type||null:a,i,!0);return typeof d=="string"&&r.push(d),d===!0});return s||x(`oneOfType - provided value does not match any of the ${r.length} passed-in validators:
${q(r.join(`
`))}`),s}}:{type:o})}function Ae(e){return S("arrayOf",{type:Array,validator(t){let n="";const o=t.every(i=>(n=C(e,i,!0),n===!0));return o||x(`arrayOf - value validation error:
${q(n)}`),o}})}function Ue(e){return S("instanceOf",{type:e})}function qe(e){return S("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every(i=>(n=C(e,t[i],!0),n===!0));return o||x(`objectOf - value validation error:
${q(n)}`),o}})}function Xe(e){const t=Object.keys(e),n=t.filter(i=>{var r;return!((r=e[i])===null||r===void 0||!r.required)}),o=S("shape",{type:Object,validator(i){if(!j(i))return!1;const r=Object.keys(i);if(n.length>0&&n.some(s=>r.indexOf(s)===-1)){const s=n.filter(a=>r.indexOf(a)===-1);return x(s.length===1?`shape - required property "${s[0]}" is not defined.`:`shape - required properties "${s.join('", "')}" are not defined.`),!1}return r.every(s=>{if(t.indexOf(s)===-1)return this._vueTypes_isLoose===!0||(x(`shape - shape definition does not include a "${s}" property. Allowed keys: "${t.join('", "')}".`),!1);const a=C(e[s],i[s],!0);return typeof a=="string"&&x(`shape - "${s}" property validation error:
 ${q(a)}`),a===!0})}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const Ve=["name","validate","getter"],Ie=(()=>{var e;return(e=class{static get any(){return Ce()}static get func(){return $e().def(this.defaults.func)}static get bool(){return Ne().def(this.defaults.bool)}static get string(){return Be().def(this.defaults.string)}static get number(){return Me().def(this.defaults.number)}static get array(){return ke().def(this.defaults.array)}static get object(){return De().def(this.defaults.object)}static get integer(){return Ee().def(this.defaults.integer)}static get symbol(){return Fe()}static get nullable(){return{type:null}}static extend(t){if(B(t))return t.forEach(d=>this.extend(d)),this;const{name:n,validate:o=!1,getter:i=!1}=t,r=oe(t,Ve);if(N(this,n))throw new TypeError(`[VueTypes error]: Type "${n}" already defined`);const{type:s}=r;if(U(s))return delete r.type,Object.defineProperty(this,n,i?{get:()=>de(n,s,r)}:{value(...d){const u=de(n,s,r);return u.validator&&(u.validator=u.validator.bind(u,...d)),u}});let a;return a=i?{get(){const d=Object.assign({},r);return o?P(n,d):S(n,d)},enumerable:!0}:{value(...d){const u=Object.assign({},r);let h;return h=o?P(n,u):S(n,u),u.validator&&(h.validator=u.validator.bind(h,...d)),h},enumerable:!0},Object.defineProperty(this,n,a)}}).defaults={},e.sensibleDefaults=void 0,e.config=J,e.custom=Le,e.oneOf=Re,e.instanceOf=Ue,e.oneOfType=Ye,e.arrayOf=Ae,e.objectOf=qe,e.shape=Xe,e.utils={validate:(t,n)=>C(n,t,!0)===!0,toType:(t,n,o=!1)=>o?P(t,n):S(t,n)},e})();function ue(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var t;return(t=class extends Ie{static get sensibleDefaults(){return L({},this.defaults)}static set sensibleDefaults(n){this.defaults=n!==!1?L({},n!==!0?n:e):{}}}).defaults=L({},e),t}class it extends ue(){}ue({func:void 0,bool:void 0,string:void 0,number:void 0,object:void 0,integer:void 0}).extend([{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VNodeChild",getter:!0,type:void 0}]);const at="",pe=Object.assign({"./lang/en.ts":Object.freeze(Object.defineProperty({__proto__:null,default:{pagination:{totalItemText:"Total",goToText:"Go to"},accordion:{loading:"loading",noData:"No Data"},autoCompleteDropdown:{latestInput:"Latest input"},cascaderList:{noData:"No data"},colorPicker:{foundationPanel:"Foundation panel",advancedPanel:"Advanced panel"},datePickerPro:{ok:"OK",placeholder:"select date",month1:"Jan",month2:"Feb",month3:"Mar",month4:"Apr",month5:"May",month6:"June",month7:"July",month8:"Aug",month9:"Sep",month10:"Oct",month11:"Nov",month12:"Dec",year:"年",startPlaceholder:"select start date",endPlaceholder:"select end date",getWeekDays(){return["Sun","Mon","Tue","Wed","Thur","Fri","Sat"]},getTimeArr(){return["Hr","Min","Sec"]},getYearMonthStr(e,t){return`${e} - ${t}`}},editableSelect:{noRelatedRecords:"No related records found",noData:"No data"},input:{placeholder:"Please enter"},splitterBar:{collapse:"Collapse",expand:"Expand"},stepsGuide:{previous:"Previous",continue:"Continue",ok:"OK"},table:{selectAll:"Select all",ok:"OK"},timePopup:{ok:"OK"},transfer:{unit:"",panelUnit:"",headerUnit:"",noData:"No Data",placeholder:"Please enter keywords"},tree:{loading:"Loading",newNode:"New node",selectPlaceholder:"Please select"},upload:{save:"Save",upload:"Upload",imgUpload:"ImageUpload",uploaded:"Uploaded",operating:"Operating",del:"Delete",download:"download",saveWarn:"Please wait for the file to upload and save!",saveError:"There is no file successfully uploaded and cannot be saved!",preview:"Preview",choose:"Select the file",accept:"Support {0} format",acceptUpload:"Only upload files in {0} format",maxSize:"A single file does not exceed {0}MB ",maxSizeMultiple:"Only upload files up to {0}MB!",maxNumber:"Only upload up to {0} files",legend:"Legend",fileName:"File name",fileSize:"File size",fileStatue:"File status",startUpload:"Start upload",uploadSuccess:"Upload successfully",uploadError:"Upload failed",uploading:"Uploading",uploadWait:"Please wait for the file upload to finish",reUploadFailed:"Re-upload failed files",noFile:"The file does not exist!"},search:{placeholder:"Enter a keyword"},select:{placeholder:"Please select",noDataText:"No data",noMatchText:"No related records found",loadingText:"Loading..."},tagInput:{maxTagsText:"Maximum number reached: "},timeSelect:{placeholder:"Please select time"},modal:{cancelText:"Close",okText:"Confirm",close:"Close",maximize:"Maximize",restore:"Restore"},excel:{exportModalTitle:"Export data",fileType:"File type",fileName:"File name"},form:{putAway:"Put away",unfold:"Unfold",maxTip:"The number of characters should be less than {0}",apiSelectNotFound:"Wait for data loading to complete..."},previewFile:{notSupport:"The file does not support preview",download:"download"},signature:{deleteSelectedSignature:"Delete selected signature",deleteAllSignature:"Delete all signatures",page:"page",jumpTo:"jump to",dragTip:"Please select the following signature and drag it to the left file",selectTip:"Please select the signature",smallTip:"The signature can't be any smaller",deleteTip:"Please select the signature you want to delete",addSignature:"Add Signature"},common:{preview:"Preview",download:"Download",okText:"OK",closeText:"Close",cancelText:"Cancel",loadingText:"Loading...",saveText:"Save",submitText:"Submit",delText:"Delete",resetText:"Reset",searchText:"Search",queryText:"Search",inputText:"Please enter",chooseText:"Please choose",redo:"Refresh",back:"Back",light:"Light",dark:"Dark",zoomIn:"Zoom In",zoomOut:"Zoom Out",reset:"reset",enterFullScreen:"Full Screen",exitFullScreen:"Exit Full Screen"}}},Symbol.toStringTag,{value:"Module"})),"./lang/zh_cn.ts":Object.freeze(Object.defineProperty({__proto__:null,default:{pagination:{totalItemText:"所有条目",goToText:"跳至",perPage:"条/页"},accordion:{loading:"加载中",noData:"没有数据"},autoCompleteDropdown:{latestInput:"最近输入"},cascaderList:{noData:"没有数据"},colorPicker:{foundationPanel:"基础面板",advancedPanel:"高级面板"},datePickerPro:{ok:"确定",placeholder:"请选择日期",month1:"1月",month2:"2月",month3:"3月",month4:"4月",month5:"5月",month6:"6月",month7:"7月",month8:"8月",month9:"9月",month10:"10月",month11:"11月",month12:"12月",year:"年",startPlaceholder:"请选择开始日期",endPlaceholder:"请选择结束日期",getWeekDays(){return["日","一","二","三","四","五","六"]},getTimeArr(){return["时","分","秒"]},getYearMonthStr(e,t){return`${e}年${t}月`}},editableSelect:{noRelatedRecords:"找不到相关记录",noData:"没有数据"},input:{placeholder:"请输入"},splitterBar:{collapse:"收起",expand:"展开"},stepsGuide:{previous:"上一步",continue:"我知道啦，继续",ok:"我知道啦"},table:{selectAll:"全选",ok:"确定"},timePopup:{ok:"确定"},transfer:{unit:"项",panelUnit:"项",headerUnit:"项",noData:"暂无数据",placeholder:"请输入关键词搜索"},tree:{loading:"加载中",newNode:"新节点",selectPlaceholder:"请选择"},upload:{save:"保存",upload:"上传",imgUpload:"图片上传",uploaded:"已上传",operating:"操作",del:"删除",download:"下载",saveWarn:"请等待文件上传后，保存!",saveError:"没有上传成功的文件，无法保存!",preview:"预览",choose:"选择文件",accept:"支持{0}格式",acceptUpload:"只能上传{0}格式文件",maxSize:"单个文件不超过{0}MB",maxSizeMultiple:"只能上传不超过{0}MB的文件!",maxNumber:"最多只能上传{0}个文件",legend:"略缩图",fileName:"文件名",fileSize:"文件大小",fileStatue:"状态",startUpload:"开始上传",uploadSuccess:"上传成功",uploadError:"上传失败",uploading:"上传中",uploadWait:"请等待文件上传结束后操作",reUploadFailed:"重新上传失败文件",import:"导入",startImport:"开始导入",importing:"导入中",reImportFailed:"重新导入失败文件",noFile:"文件不存在！"},search:{placeholder:"请输入关键字"},select:{placeholder:"请选择",noDataText:"无数据",noMatchText:"找不到相关记录",loadingText:"加载中..."},tagInput:{maxTagsText:"已达到最大个数："},timeSelect:{placeholder:"请选择时间"},modal:{cancelText:"关闭",okText:"确认",close:"关闭",maximize:"最大化",restore:"还原"},excel:{exportModalTitle:"导出数据",fileType:"文件类型",fileName:"文件名"},form:{putAway:"收起",unfold:"展开",maxTip:"字符数应小于{0}位",apiSelectNotFound:"请等待数据加载完成..."},previewFile:{notSupport:"该文件不支持预览",download:"下载"},signature:{deleteSelectedSignature:"删除选中签名",deleteAllSignature:"删除全部签名",page:"页",jumpTo:"跳至",dragTip:"请选择以下签名并将其拖到左侧文件",selectTip:"请选择签名",smallTip:"已经最小了",deleteTip:"请选中你要删除的签名",addSignature:"新建电子签章"},common:{preview:"预览",download:"下载",okText:"确认",closeText:"关闭",cancelText:"取消",loadingText:"加载中...",saveText:"保存",submitText:"提交",delText:"删除",resetText:"重置",searchText:"搜索",queryText:"查询",inputText:"请输入",chooseText:"请选择",redo:"刷新",back:"返回",light:"亮色主题",dark:"黑暗主题",zoomIn:"放大",zoomOut:"缩小",reset:"还原",enterFullScreen:"全屏",exitFullScreen:"退出全屏"}}},Symbol.toStringTag,{value:"Module"}))}),fe={};Object.keys(pe).forEach(e=>{const t=pe[e].default||{};fe[e]=t});const me=c.ref("zh_cn"),We=()=>{const e=c.reactive({langMessages:fe}),t=()=>me.value.toLocaleLowerCase();return{getLang:t,setLang:i=>{me.value=i},getMessages:()=>{const i=`./lang/${t()}.ts`;return e.langMessages[i]}}};function Ge(e,t){const n=t.split(".");let o=e;return n.forEach(i=>{o=o[i]??""}),o}function He(){return e=>{const t=We().getMessages();return Ge(t,e)}}const Ke=c.defineComponent({name:`${K}SplitterBar`,components:{Tooltip:w.Tooltip},props:Pe,setup(e){const t=He(),n=H("splitter"),o=c.inject("splitterStore"),i=c.reactive({wrapperClass:`${n.e("bar")} ${n.em("bar",e.orientation)} `}),r=c.ref();c.watch([()=>e.splitBarSize,r],([l,g])=>{te(g)&&E(g,{flexBasis:l})},{immediate:!0}),c.watch([()=>o==null?void 0:o.state.panes,r],([,l])=>{!o||!e||e.index===void 0||(o.isStaticBar(e.index)?l&&E(l,{flexBasis:e.disabledBarSize}):i.wrapperClass+=" resizable")},{deep:!0});const s=(l,g)=>{if(!o)return{};const z=o.getPane(l),v=o.getPane(g);return{pane:z,nearPane:v}},a=(l,g,z)=>{var _,he,ye,xe;const v=((he=(_=l==null?void 0:l.component)==null?void 0:_.props)==null?void 0:he.collapsible)&&z,b=(xe=(ye=l==null?void 0:l.component)==null?void 0:ye.props)==null?void 0:xe.collapsed,$=g==null?void 0:g.collapsed;return{[n.e("collapse")]:v,collapsed:b,hidden:$}},d=c.computed(()=>{var v,b;if(!e||e.index===void 0)return{};const{pane:l,nearPane:g}=s(e.index,e.index+1),z=((b=(v=l==null?void 0:l.component)==null?void 0:v.props)==null?void 0:b.collapseDirection)!=="after"||e.index===0;return a(l,g,z)}),u=c.computed(()=>{var v,b;if(!o||!e||e.index===void 0)return{};const{pane:l,nearPane:g}=s(e.index+1,e.index),z=((b=(v=l==null?void 0:l.component)==null?void 0:v.props)==null?void 0:b.collapseDirection)!=="before"||e.index+1===o.state.paneCount-1;return a(l,g,z)}),h=()=>{var v,b,$,_;if(!r.value||!e||e.index===void 0)return;const{pane:l,nearPane:g}=s(e.index,e.index+1);((b=(v=l==null?void 0:l.component)==null?void 0:v.props)==null?void 0:b.collapsed)||((_=($=g==null?void 0:g.component)==null?void 0:$.props)==null?void 0:_.collapsed)?Y(r.value,"none-resizable"):F(r.value,"none-resizable")},T=l=>{!o||!e||e.index===void 0||(o.tooglePane(e.index,e.index+1,l),h())},f=l=>{!o||!e||e.index===void 0||(o.tooglePane(e.index+1,e.index,l),h())},m=()=>{T(!0),f(!0)},p={pageX:0,pageY:0,originalX:0,originalY:0};let O;const X={enableResize:!0,onPressEvent:function({originalEvent:l}){l.stopPropagation(),!(!o||!e||e.index===void 0)&&o.isResizable(e.index)&&(O=o.dragState(e.index),p.originalX=l.pageX,p.originalY=l.pageY)},onDragEvent:function({originalEvent:l}){if(l.stopPropagation(),!o||!e||e.index===void 0||!o.isResizable(e.index))return;p.pageX=l.pageX,p.pageY=l.pageY;let g;e.orientation==="vertical"?g=p.pageY-p.originalY:g=p.pageX-p.originalX,o.setSize(O,g)},onReleaseEvent:function({originalEvent:l}){if(l.stopPropagation(),!o||!e||e.index===void 0||!o.isResizable(e.index))return;p.pageX=l.pageX,p.pageY=l.pageY;let g;e.orientation==="vertical"?g=p.pageY-p.originalY:g=p.pageX-p.originalX,o.setSize(O,g)}};c.onMounted(()=>{m()});const R=()=>{var v,b,$,_;if(!e||e.index===void 0)return t("splitterBar.collapse");const{pane:l,nearPane:g}=s(e.index,e.index+1),z=((b=(v=l==null?void 0:l.component)==null?void 0:v.props)==null?void 0:b.collapsed)||((_=($=g==null?void 0:g.component)==null?void 0:$.props)==null?void 0:_.collapsed);return t(z?"splitterBar.expand":"splitterBar.collapse")};return()=>c.withDirectives(c.createVNode("div",{class:i.wrapperClass,ref:r},[e.showCollapseButton&&c.createVNode(w.Tooltip,{title:R()},{default:()=>[c.createVNode("div",{class:["prev",d.value],onClick:()=>{T()}},null)]}),e.showCollapseButton&&c.createVNode(w.Tooltip,{title:R()},{default:()=>[c.createVNode("div",{class:["next",u.value],onClick:()=>f()},null)]})]),[[Te,X]])}});class Je{constructor(){ve(this,"state");this.state=c.reactive({panes:[],splitterContainerSize:0,paneCount:0})}setPanes({panes:t}){this.state.panes=t.map((n,o)=>{var i;return n.component&&(n.component.exposed.order.value=o*2),n.getPaneSize=(i=n==null?void 0:n.component)==null?void 0:i.exposed.getPaneSize,n}),this.state.paneCount=t.length}setSplitter({containerSize:t}){this.state.splitterContainerSize=t}getPane(t){if(!this.state.panes||t<0||t>=this.state.panes.length)throw new Error("no pane can return.");return this.state.panes[t]}dragState(t){const n=this.getPane(t),o=this.getPane(t+1),i=n.getPaneSize()+o.getPaneSize();return{prev:{index:t,initialSize:n.getPaneSize(),minSize:this.toPixels(n.component.props.minSize)||i-this.toPixels(o.component.props.maxSize)||0,maxSize:this.toPixels(n.component.props.maxSize)||i-this.toPixels(o.component.props.minSize)||i},next:{index:t+1,initialSize:o.getPaneSize(),minSize:this.toPixels(o.component.props.minSize)||i-this.toPixels(n.component.props.maxSize)||0,maxSize:this.toPixels(o.component.props.maxSize)||i-this.toPixels(n.component.props.minSize)||i}}}clamp(t,n,o){return Math.min(n,Math.max(t,o))}resize(t,n){const o=this.getPane(t.index),i=this.state.splitterContainerSize,r=this.clamp(t.minSize,t.maxSize,t.initialSize+n);let s="";this.isPercent(o.component.props.size)?s=r/i*100+"%":s=r+"px",o.component.props.size=s,o.component.emit("sizeChange",s)}isResizable(t){var r,s,a,d,u,h,T,f;const n=this.getPane(t),o=this.getPane(t+1),i=((s=(r=n==null?void 0:n.component)==null?void 0:r.props)==null?void 0:s.collapsed)||((d=(a=o==null?void 0:o.component)==null?void 0:a.props)==null?void 0:d.collapsed);return((h=(u=n==null?void 0:n.component)==null?void 0:u.props)==null?void 0:h.resizable)&&((f=(T=o==null?void 0:o.component)==null?void 0:T.props)==null?void 0:f.resizable)&&!i}isStaticBar(t){var i,r,s,a;const n=this.getPane(t),o=this.getPane(t+1);return!((r=(i=n==null?void 0:n.component)==null?void 0:i.props)!=null&&r.resizable&&((a=(s=o==null?void 0:o.component)==null?void 0:s.props)!=null&&a.resizable))}isPercent(t){return/%$/.test(t)}toPixels(t){let n=parseFloat(t);return this.isPercent(t)&&(n=this.state.splitterContainerSize*n/100),n}tooglePane(t,n,o){var s,a,d,u,h,T,f,m,p,O,X,R,l;const i=this.getPane(t),r=this.getPane(n);(a=(s=i==null?void 0:i.component)==null?void 0:s.props)!=null&&a.collapsible&&(i.component.props.collapsed=o?(u=(d=i==null?void 0:i.component)==null?void 0:d.props)==null?void 0:u.collapsed:!((T=(h=i==null?void 0:i.component)==null?void 0:h.props)!=null&&T.collapsed),(O=(f=r==null?void 0:r.component)==null?void 0:f.exposed)==null||O.toggleNearPaneFlexGrow((p=(m=i==null?void 0:i.component)==null?void 0:m.props)==null?void 0:p.collapsed),(l=i==null?void 0:i.component)==null||l.emit("collapsedChange",(R=(X=i==null?void 0:i.component)==null?void 0:X.props)==null?void 0:R.collapsed))}setSize(t,n){const o=this.getPane(t.prev.index),i=this.getPane(t.next.index);o.component.props.size&&i.component.props.size?(this.resize(t.prev,n),this.resize(t.next,-n)):i.component.props.size?this.resize(t.next,-n):this.resize(t.prev,n)}}const ge={orientation:{type:String,default:"horizontal"},splitBarSize:{type:String,default:"2px"},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean,default:!0}},ut="",k=c.defineComponent({name:`${K}Splitter`,components:{GSplitterBar:Ke},props:ge,emits:[],setup(e,t){var a,d;const n=new Je,o=c.reactive({panes:[]}),i=H("splitter");o.panes=((d=(a=t.slots).DSplitterPane)==null?void 0:d.call(a))||[],n.setPanes({panes:o.panes}),c.provide("orientation",e.orientation),c.provide("splitterStore",n);const r=c.ref(),s=()=>{if(!r.value)return;let u=0;e.orientation==="vertical"?u=r.value.clientHeight:u=r.value.clientWidth,n.setSplitter({containerSize:u})};return Se.useResizeObserver(r,s),()=>{const{splitBarSize:u,orientation:h,showCollapseButton:T}=e,f=[i.b(),i.m(h)];return c.createVNode("div",{class:f,ref:r},[o.panes,o.panes.filter((m,p,O)=>p!==O.length-1).map((m,p)=>c.createVNode(c.resolveComponent("g-splitter-bar"),{key:p,style:`order: ${p*2+1}`,splitBarSize:u,orientation:h,index:p,showCollapseButton:T},null))])}}}),Ze={size:{type:String},minSize:{type:String},maxSize:{type:String},resizable:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},collapseDirection:{type:String,default:"both"},shrink:{type:Boolean,default:!1},shrinkWidth:{type:Number,default:36}},pt="",D=c.defineComponent({name:`${K}SplitterPane`,props:Ze,emits:["sizeChange","collapsedChange"],setup(e,{slots:t,expose:n}){const o=c.inject("splitterStore"),i=c.ref(),r=c.ref(),s=H("splitter");c.watch([r,i],([f,m])=>{m&&E(m,{order:f})});const a=(f,m)=>{if(!m)return;m.style.flexBasis=f;const p=s.em("pane","fixed");f?Y(m,p):F(m,p)};c.watch([()=>e.size,i],([f,m])=>{f&&m&&a(f,m)},{immediate:!0});const d=c.inject("orientation");let u="";c.onMounted(()=>{e.size&&(u=e.size),o&&o.setPanes({panes:o.state.panes})}),c.onUpdated(()=>{o&&o.setPanes({panes:o.state.panes})});const h=()=>{const f=i.value;return f?d==="vertical"?f.offsetHeight:f.offsetWidth:0};return c.watch([()=>e.collapsed,i],([f,m])=>{if(!m)return;const p=s.em("pane","hidden");f?Y(m,p):F(m,p),f&&e.shrink?(F(m,p),E(m,{flexBasis:`${e.shrinkWidth}px`})):E(m,{flexBasis:u})},{immediate:!0}),n({order:r,getPaneSize:h,toggleNearPaneFlexGrow:f=>{const m=i.value;if(!te(m))return;const p=s.em("pane","grow");V(m,p)?F(m,p):f&&Y(m,p)}}),()=>{var f;return c.createVNode("div",{class:s.e("pane"),ref:i},[(f=t.default)==null?void 0:f.call(t)])}}});k.install=function(e,t){e.component(t||k.name,k)},D.install=function(e,t){e.component(t||D.name,D)};const Qe={title:"Splitter 分割器",category:"布局",status:"100%",install(e){e.component(k.name,k),e.component(D.name,D)}};y.Splitter=k,y.SplitterPane=D,y.default=Qe,y.splitterProps=ge,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
