@zhangqingcq/vgce 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -1
- package/dist/vgce.js +5 -12
- package/dist/vgce.umd.cjs +2 -2
- package/package.json +3 -2
- package/src/App.vue +11 -0
- package/src/assets/base.less +49 -0
- package/src/assets/icons/add.svg +1 -0
- package/src/assets/icons/delete.svg +12 -0
- package/src/assets/icons/export.svg +1 -0
- package/src/assets/icons/group.svg +13 -0
- package/src/assets/icons/import.svg +1 -0
- package/src/assets/icons/lock.svg +7 -0
- package/src/assets/icons/menu-fold.svg +9 -0
- package/src/assets/icons/menu-unfold.svg +9 -0
- package/src/assets/icons/preview.svg +6 -0
- package/src/assets/icons/redo.svg +8 -0
- package/src/assets/icons/return.svg +8 -0
- package/src/assets/icons/rotate.svg +1 -0
- package/src/assets/icons/save.svg +9 -0
- package/src/assets/icons/setting.svg +6 -0
- package/src/assets/icons/undo.svg +7 -0
- package/src/assets/icons/ungroup.svg +16 -0
- package/src/assets/icons/unlock.svg +7 -0
- package/src/assets/main.less +6 -0
- package/src/assets/svgs/alternator.svg +8 -0
- package/src/assets/svgs/bot-12.svg +1 -0
- package/src/assets/svgs/bot-2.svg +1 -0
- package/src/assets/svgs/bot-3.svg +1 -0
- package/src/assets/svgs/bot-7.svg +1 -0
- package/src/assets/svgs/bot-9.svg +94 -0
- package/src/assets/svgs/car.svg +1 -0
- package/src/assets/svgs/circuit-breaker.svg +11 -0
- package/src/assets/svgs/clock-a.svg +23 -0
- package/src/assets/svgs/common-table.svg +7 -0
- package/src/assets/svgs/el-button.svg +10 -0
- package/src/assets/svgs/el-tag.svg +13 -0
- package/src/assets/svgs/hospital.svg +1 -0
- package/src/assets/svgs/house.svg +1 -0
- package/src/assets/svgs/light.svg +24 -0
- package/src/assets/svgs/now-time.svg +9 -0
- package/src/assets/svgs/package.svg +1 -0
- package/src/assets/svgs/pie-charts.svg +10 -0
- package/src/assets/svgs/progress-a.svg +1 -0
- package/src/assets/svgs/reservoir.svg +10 -0
- package/src/assets/svgs/svg-text.svg +5 -0
- package/src/assets/svgs/switch-a.svg +5 -0
- package/src/assets/svgs/traction-transformer.svg +11 -0
- package/src/components/ace-edit/index.ts +27 -0
- package/src/components/config/index.ts +450 -0
- package/src/components/config/types.ts +25 -0
- package/src/components/svg-analysis/index.vue +11 -0
- package/src/components/svg-editor/center-panel/index.vue +867 -0
- package/src/components/svg-editor/center-panel/types.ts +11 -0
- package/src/components/svg-editor/component-tree/index.vue +33 -0
- package/src/components/svg-editor/connection-line/index.vue +125 -0
- package/src/components/svg-editor/connection-panel/index.vue +198 -0
- package/src/components/svg-editor/export-json/index.vue +37 -0
- package/src/components/svg-editor/handle-panel/index.vue +342 -0
- package/src/components/svg-editor/import-json/index.vue +37 -0
- package/src/components/svg-editor/index.vue +280 -0
- package/src/components/svg-editor/left-panel/index.vue +83 -0
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
- package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
- package/src/components/svg-editor/right-panel/condition.vue +101 -0
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
- package/src/components/svg-editor/right-panel/index.vue +304 -0
- package/src/components/svg-editor/right-panel/list.vue +86 -0
- package/src/components/svg-editor/top-panel/index.vue +139 -0
- package/src/components/svg-editor/types.ts +22 -0
- package/src/components/svg-viewer/index.vue +340 -0
- package/src/components/vue3-ruler-tool/index.vue +506 -0
- package/src/config/files/clock-a.vue +66 -0
- package/src/config/files/common-table.vue +49 -0
- package/src/config/files/light-a.vue +72 -0
- package/src/config/files/now-time.vue +53 -0
- package/src/config/files/pie-charts.vue +72 -0
- package/src/config/files/progress.vue +40 -0
- package/src/config/files/svg-text.vue +39 -0
- package/src/config/files/switch-a.vue +45 -0
- package/src/config/index.ts +28 -0
- package/src/config/svg/animation/index.ts +8 -0
- package/src/config/svg/animation/reservoir.ts +32 -0
- package/src/config/svg/custom/clock-a.ts +23 -0
- package/src/config/svg/custom/index.ts +11 -0
- package/src/config/svg/custom/light.ts +29 -0
- package/src/config/svg/custom/svg-text.ts +54 -0
- package/src/config/svg/custom/switch-a.ts +29 -0
- package/src/config/svg/index.ts +12 -0
- package/src/config/svg/stateful/circuit-breaker.ts +38 -0
- package/src/config/svg/stateful/index.ts +8 -0
- package/src/config/svg/stateless/alternator.ts +28 -0
- package/src/config/svg/stateless/bot-12.ts +22 -0
- package/src/config/svg/stateless/bot-2.ts +22 -0
- package/src/config/svg/stateless/bot-3.ts +22 -0
- package/src/config/svg/stateless/bot-7.ts +22 -0
- package/src/config/svg/stateless/bot-9.ts +22 -0
- package/src/config/svg/stateless/car.ts +22 -0
- package/src/config/svg/stateless/hospital.ts +22 -0
- package/src/config/svg/stateless/house.ts +22 -0
- package/src/config/svg/stateless/index.ts +30 -0
- package/src/config/svg/stateless/package.ts +22 -0
- package/src/config/svg/stateless/traction-transformer.ts +28 -0
- package/src/config/types.ts +126 -0
- package/src/config/vue/component/button.ts +57 -0
- package/src/config/vue/component/common-table.ts +124 -0
- package/src/config/vue/component/index.ts +13 -0
- package/src/config/vue/component/now-time.ts +29 -0
- package/src/config/vue/component/progress.ts +29 -0
- package/src/config/vue/component/tag.ts +46 -0
- package/src/config/vue/echarts/index.ts +8 -0
- package/src/config/vue/echarts/pie-charts.ts +60 -0
- package/src/config/vue/index.ts +5 -0
- package/src/hooks.ts +47 -0
- package/src/index.ts +14 -0
- package/src/main.ts +15 -0
- package/src/router.ts +24 -0
- package/src/stores/config/index.ts +44 -0
- package/src/stores/config/types.ts +27 -0
- package/src/stores/global/index.ts +109 -0
- package/src/stores/global/types.ts +115 -0
- package/src/stores/main.ts +10 -0
- package/src/stores/svg-edit-layout/index.ts +17 -0
- package/src/stores/svg-edit-layout/types.ts +8 -0
- package/src/stores/system/index.ts +174 -0
- package/src/stores/system/types.ts +43 -0
- package/src/utils/fetch.ts +351 -0
- package/src/utils/file-read-write.ts +26 -0
- package/src/utils/index.ts +397 -0
- package/src/utils/mqtt-net.ts +48 -0
- package/src/utils/proxy.ts +7 -0
- package/src/utils/scale-core.ts +214 -0
- package/src/utils/types.ts +13 -0
- package/src/views/EditorS.vue +18 -0
- package/src/views/Preview.vue +12 -0
package/dist/vgce.umd.cjs
CHANGED
@@ -289,7 +289,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
289
289
|
* Copyright(c) 2015 Andreas Lubbe
|
290
290
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
291
291
|
* MIT Licensed
|
292
|
-
*/var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,k="",V=0,$=0;for(V=r.index;V<n.length;V++){switch(n.charCodeAt(V)){case 34:g=""";break;case 38:g="&";break;case 39:g="'";break;case 60:g="<";break;case 62:g=">";break;default:continue}$!==V&&(k+=n.substring($,V)),$=V+1,k+=g}return $!==V?k+n.substring($,V):k}const escapeHtml$1=getDefaultExportFromCjs(escapeHtml_1),getCell=function(i){var n;return(n=i.target)==null?void 0:n.closest("td")},orderBy=function(i,n,r,g,k){if(!n&&!g&&(!k||Array.isArray(k)&&!k.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const V=g?null:function(oe,re){return k?(Array.isArray(k)||(k=[k]),k.map(Ce=>typeof Ce=="string"?get$1(oe,Ce):Ce(oe,re,i))):(n!=="$key"&&isObject$4(oe)&&"$value"in oe&&(oe=oe.$value),[isObject$4(oe)?get$1(oe,n):oe])},$=function(oe,re){if(g)return g(oe.value,re.value);for(let Ce=0,ie=oe.key.length;Ce<ie;Ce++){if(oe.key[Ce]<re.key[Ce])return-1;if(oe.key[Ce]>re.key[Ce])return 1}return 0};return i.map((oe,re)=>({value:oe,index:re,key:V?V(oe,re):null})).sort((oe,re)=>{let Ce=$(oe,re);return Ce||(Ce=oe.index-re.index),Ce*+r}).map(oe=>oe.value)},getColumnById=function(i,n){let r=null;return i.columns.forEach(g=>{g.id===n&&(r=g)}),r},getColumnByKey=function(i,n){let r=null;for(let g=0;g<i.columns.length;g++){const k=i.columns[g];if(k.columnKey===n){r=k;break}}return r||throwError$1("ElTable",`No column matching with column-key: ${n}`),r},getColumnByCell=function(i,n,r){const g=(n.className||"").match(new RegExp(`${r}-table_[^\\s]+`,"gm"));return g?getColumnById(i,g[0]):null},getRowIdentity=(i,n)=>{if(!i)throw new Error("Row is required when get row identity");if(typeof n=="string"){if(!n.includes("."))return`${i[n]}`;const r=n.split(".");let g=i;for(const k of r)g=g[k];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,k)=>{r[getRowIdentity(g,n)]={row:g,index:k}}),r};function mergeOptions(i,n){const r={};let g;for(g in i)r[g]=i[g];for(g in n)if(hasOwn$1(n,g)){const k=n[g];typeof k<"u"&&(r[g]=k)}return r}function parseWidth(i){return i===""||i!==void 0&&(i=Number.parseInt(i,10),Number.isNaN(i)&&(i="")),i}function parseMinWidth(i){return i===""||i!==void 0&&(i=parseWidth(i),Number.isNaN(i)&&(i=80)),i}function parseHeight(i){return typeof i=="number"?i:typeof i=="string"?/^\d+(?:px)?$/.test(i)?Number.parseInt(i,10):i:null}function compose(...i){return i.length===0?n=>n:i.length===1?i[0]:i.reduce((n,r)=>(...g)=>n(r(...g)))}function toggleRowStatus(i,n,r){let g=!1;const k=i.indexOf(n),V=k!==-1,$=oe=>{oe==="add"?i.push(n):i.splice(k,1),g=!0,isArray$3(n.children)&&n.children.forEach(re=>{toggleRowStatus(i,re,r??!V)})};return isBoolean(r)?r&&!V?$("add"):!r&&V&&$("remove"):$(V?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const k=$=>!(Array.isArray($)&&$.length);function V($,oe,re){n($,oe,re),oe.forEach(Ce=>{if(Ce[g]){n(Ce,null,re+1);return}const ie=Ce[r];k(ie)||V(Ce,ie,re+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const oe=$[r];k(oe)||V($,oe,0)})}let removePopper;function createTablePopper(i,n,r,g,k){k=merge$2({enterable:!0,showArrow:!0},k);const V=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${V}-scrollbar__wrap`);function oe(){const Ne=k.effect==="light",he=document.createElement("div");return he.className=[`${V}-popper`,Ne?"is-light":"is-dark",k.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function re(){const Ne=document.createElement("div");return Ne.className=`${V}-popper__arrow`,Ne}function Ce(){ie&&ie.update()}removePopper==null||removePopper(),removePopper=()=>{try{ie&&ie.destroy(),Ie&&(i==null||i.removeChild(Ie)),n.removeEventListener("mouseenter",ae),n.removeEventListener("mouseleave",le),$==null||$.removeEventListener("scroll",removePopper),removePopper=void 0}catch{}};let ie=null,ae=Ce,le=removePopper;k.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:k.showAfter,hideAfter:k.hideAfter,open:Ce,close:removePopper}));const Ie=oe();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(k.offset&&ue.push({name:"offset",options:{offset:[0,k.offset]}}),k.showArrow){const Ne=Ie.appendChild(re());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=k.popperOptions||{};return ie=yn(n,Ie,{placement:k.placement||"top",strategy:"fixed",...de,modifiers:de.modifiers?ue.concat(de.modifiers):ue}),n.addEventListener("mouseenter",ae),n.addEventListener("mouseleave",le),$==null||$.addEventListener("scroll",removePopper),ie}function getCurrentColumns(i){return i.children?flatMap(i.children,getCurrentColumns):[i]}function getColSpan(i,n){return i+n.colSpan}const isFixedColumn=(i,n,r,g)=>{let k=0,V=i;const $=r.states.columns.value;if(g){const re=getCurrentColumns(g[i]);k=$.slice(0,$.indexOf(re[0])).reduce(getColSpan,0),V=k+re.reduce(getColSpan,0)-1}else k=i;let oe;switch(n){case"left":V<r.states.fixedLeafColumnsLength.value&&(oe="left");break;case"right":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right");break;default:V<r.states.fixedLeafColumnsLength.value?oe="left":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right")}return oe?{direction:oe,start:k,after:V}:{}},getFixedColumnsClass=(i,n,r,g,k,V=0)=>{const $=[],{direction:oe,start:re,after:Ce}=isFixedColumn(n,r,g,k);if(oe){const ie=oe==="left";$.push(`${i}-fixed-column--${oe}`),ie&&Ce+V===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&re-V===g.states.columns.value.length-g.states.rightFixedLeafColumnsLength.value&&$.push("is-first-column")}return $};function getOffset(i,n){return i+(n.realWidth===null||Number.isNaN(n.realWidth)?Number(n.width):n.realWidth)}const getFixedColumnOffset=(i,n,r,g)=>{const{direction:k,start:V=0,after:$=0}=isFixedColumn(i,n,r,g);if(!k)return;const oe={},re=k==="left",Ce=r.states.columns.value;return re?oe.left=Ce.slice(0,V).reduce(getOffset,0):oe.right=Ce.slice($+1).reverse().reduce(getOffset,0),oe},ensurePosition=(i,n)=>{i&&(Number.isNaN(i[n])||(i[n]=`${i[n]}px`))};function useExpand(i){const n=vue.getCurrentInstance(),r=vue.ref(!1),g=vue.ref([]);return{updateExpandRows:()=>{const re=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=re.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=re.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(re,Ce)=>{toggleRowStatus(g.value,re,Ce)&&n.emit("expand-change",re,g.value.slice())},setExpandRowKeys:re=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=re.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:re=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(re,Ce)]:g.value.includes(re)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),k=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},V=()=>{r.value=null},$=Ce=>{const{data:ie,rowKey:ae}=i;let le=null;ae.value&&(le=(vue.unref(ie)||[]).find(Ie=>getRowIdentity(Ie,ae.value)===Ce)),g.value=le,n.emit("current-change",g.value,null)};return{setCurrentRowKey:k,restoreCurrentRowKey:V,setCurrentRowByKey:$,updateCurrentRow:Ce=>{const ie=g.value;if(Ce&&Ce!==ie){g.value=Ce,n.emit("current-change",g.value,ie);return}!Ce&&ie&&(g.value=null,n.emit("current-change",null,ie))},updateCurrentRowData:()=>{const Ce=i.rowKey.value,ie=i.data.value||[],ae=g.value;if(!ie.includes(ae)&&ae){if(Ce){const le=getRowIdentity(ae,Ce);$(le)}else g.value=null;g.value===null&&n.emit("current-change",null,ae)}else r.value&&($(r.value),V())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),k=vue.ref(!1),V=vue.ref({}),$=vue.ref("hasChildren"),oe=vue.ref("children"),re=vue.getCurrentInstance(),Ce=vue.computed(()=>{if(!i.rowKey.value)return{};const he=i.data.value||[];return ae(he)}),ie=vue.computed(()=>{const he=i.rowKey.value,pe=Object.keys(V.value),ze={};return pe.length&&pe.forEach(Fe=>{if(V.value[Fe].length){const xe={children:[]};V.value[Fe].forEach(_e=>{const Dt=getRowIdentity(_e,he);xe.children.push(Dt),_e[$.value]&&!ze[Dt]&&(ze[Dt]={children:[]})}),ze[Fe]=xe}}),ze}),ae=he=>{const pe=i.rowKey.value,ze={};return walkTreeNode(he,(Fe,xe,_e)=>{const Dt=getRowIdentity(Fe,pe);Array.isArray(xe)?ze[Dt]={children:xe.map($e=>getRowIdentity($e,pe)),level:_e}:k.value&&(ze[Dt]={children:[],lazy:!0,level:_e})},oe.value,$.value),ze},le=(he=!1,pe=(ze=>(ze=re.store)==null?void 0:ze.states.defaultExpandAll.value)())=>{var ze;const Fe=Ce.value,xe=ie.value,_e=Object.keys(Fe),Dt={};if(_e.length){const $e=vue.unref(r),Ue=[],Ve=(At,qe)=>{if(he)return n.value?pe||n.value.includes(qe):!!(pe||At!=null&&At.expanded);{const Lt=pe||n.value&&n.value.includes(qe);return!!(At!=null&&At.expanded||Lt)}};_e.forEach(At=>{const qe=$e[At],Lt={...Fe[At]};if(Lt.expanded=Ve(qe,At),Lt.lazy){const{loaded:kt=!1,loading:jt=!1}=qe||{};Lt.loaded=!!kt,Lt.loading=!!jt,Ue.push(At)}Dt[At]=Lt});const Oe=Object.keys(xe);k.value&&Oe.length&&Ue.length&&Oe.forEach(At=>{const qe=$e[At],Lt=xe[At].children;if(Ue.includes(At)){if(Dt[At].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Dt[At].children=Lt}else{const{loaded:kt=!1,loading:jt=!1}=qe||{};Dt[At]={lazy:!0,loaded:!!kt,loading:!!jt,expanded:Ve(qe,At),children:Lt,level:""}}})}r.value=Dt,(ze=re.store)==null||ze.updateTableScrollY()};vue.watch(()=>n.value,()=>{le(!0)}),vue.watch(()=>Ce.value,()=>{le()}),vue.watch(()=>ie.value,()=>{le()});const Ie=he=>{n.value=he,le()},ue=(he,pe)=>{re.store.assertRowKey();const ze=i.rowKey.value,Fe=getRowIdentity(he,ze),xe=Fe&&r.value[Fe];if(Fe&&xe&&"expanded"in xe){const _e=xe.expanded;pe=typeof pe>"u"?!xe.expanded:pe,r.value[Fe].expanded=pe,_e!==pe&&re.emit("expand-change",he,pe),re.store.updateTableScrollY()}},de=he=>{re.store.assertRowKey();const pe=i.rowKey.value,ze=getRowIdentity(he,pe),Fe=r.value[ze];k.value&&Fe&&"loaded"in Fe&&!Fe.loaded?Ne(he,ze,Fe):ue(he,void 0)},Ne=(he,pe,ze)=>{const{load:Fe}=re.props;Fe&&!r.value[pe].loaded&&(r.value[pe].loading=!0,Fe(he,ze,xe=>{if(!Array.isArray(xe))throw new TypeError("[ElTable] data must be an array");r.value[pe].loading=!1,r.value[pe].loaded=!0,r.value[pe].expanded=!0,xe.length&&(V.value[pe]=xe),re.emit("expand-change",he,!0)}))};return{loadData:Ne,loadOrToggle:de,toggleTreeExpansion:ue,updateTreeExpandKeys:Ie,updateTreeData:le,normalize:ae,states:{expandRowKeys:n,treeData:r,indent:g,lazy:k,lazyTreeNodeMap:V,lazyColumnIdentifier:$,childrenColumnName:oe}}}const sortData=(i,n)=>{const r=n.sortingColumn;return!r||typeof r.sortable=="string"?i:orderBy(i,n.sortProp,n.sortOrder,r.sortMethod,r.sortBy)},doFlattenColumns=i=>{const n=[];return i.forEach(r=>{r.children&&r.children.length>0?n.push.apply(n,doFlattenColumns(r.children)):n.push(r)}),n};function useWatcher$1(){var i;const n=vue.getCurrentInstance(),{size:r}=vue.toRefs((i=n.proxy)==null?void 0:i.$props),g=vue.ref(null),k=vue.ref([]),V=vue.ref([]),$=vue.ref(!1),oe=vue.ref([]),re=vue.ref([]),Ce=vue.ref([]),ie=vue.ref([]),ae=vue.ref([]),le=vue.ref([]),Ie=vue.ref([]),ue=vue.ref([]),de=[],Ne=vue.ref(0),he=vue.ref(0),pe=vue.ref(0),ze=vue.ref(!1),Fe=vue.ref([]),xe=vue.ref(!1),_e=vue.ref(!1),Dt=vue.ref(null),$e=vue.ref({}),Ue=vue.ref(null),Ve=vue.ref(null),Oe=vue.ref(null),At=vue.ref(null),qe=vue.ref(null);vue.watch(k,()=>n.state&&ti(!1),{deep:!0});const Lt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},kt=Oi=>{var xi;(xi=Oi.children)==null||xi.forEach(Li=>{Li.fixed=Oi.fixed,kt(Li)})},jt=()=>{oe.value.forEach(ki=>{kt(ki)}),ie.value=oe.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=oe.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&oe.value[0]&&oe.value[0].type==="selection"&&!oe.value[0].fixed&&(oe.value[0].fixed=!0,ie.value.unshift(oe.value[0]));const Oi=oe.value.filter(ki=>!ki.fixed);re.value=[].concat(ie.value).concat(Oi).concat(ae.value);const xi=doFlattenColumns(Oi),Li=doFlattenColumns(ie.value),Wi=doFlattenColumns(ae.value);Ne.value=xi.length,he.value=Li.length,pe.value=Wi.length,Ce.value=[].concat(Li).concat(xi).concat(Wi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,xi=!1)=>{Oi&&jt(),xi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Fe.value.includes(Oi),Pt=()=>{ze.value=!1,Fe.value.length&&(Fe.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const xi=getKeysMap(Fe.value,g.value),Li=getKeysMap(k.value,g.value);for(const Wi in xi)hasOwn$1(xi,Wi)&&!Li[Wi]&&Oi.push(xi[Wi].row)}else Oi=Fe.value.filter(xi=>!k.value.includes(xi));if(Oi.length){const xi=Fe.value.filter(Li=>!Oi.includes(Li));Fe.value=xi,n.emit("selection-change",xi.slice())}},gi=()=>(Fe.value||[]).slice(),di=(Oi,xi=void 0,Li=!0)=>{if(toggleRowStatus(Fe.value,Oi,xi)){const ki=(Fe.value||[]).slice();Li&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},li=()=>{var Oi,xi;const Li=_e.value?!ze.value:!(ze.value||Fe.value.length);ze.value=Li;let Wi=!1,ki=0;const Ri=(xi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:xi.rowKey.value;k.value.forEach((Ki,Ti)=>{const Di=Ti+ki;Dt.value?Dt.value.call(null,Ki,Di)&&toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0):toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0),ki+=pi(getRowIdentity(Ki,Ri))}),Wi&&n.emit("selection-change",Fe.value?Fe.value.slice():[]),n.emit("select-all",Fe.value)},ai=()=>{const Oi=getKeysMap(Fe.value,g.value);k.value.forEach(xi=>{const Li=getRowIdentity(xi,g.value),Wi=Oi[Li];Wi&&(Fe.value[Wi.index]=xi)})},ci=()=>{var Oi,xi,Li;if(((Oi=k.value)==null?void 0:Oi.length)===0){ze.value=!1;return}let Wi;g.value&&(Wi=getKeysMap(Fe.value,g.value));const ki=function(Di){return Wi?!!Wi[getRowIdentity(Di,g.value)]:Fe.value.includes(Di)};let Ri=!0,Ki=0,Ti=0;for(let Di=0,Bi=(k.value||[]).length;Di<Bi;Di++){const Vi=(Li=(xi=n==null?void 0:n.store)==null?void 0:xi.states)==null?void 0:Li.rowKey.value,Ei=Di+Ti,ji=k.value[Di],Ui=Dt.value&&Dt.value.call(null,ji,Ei);if(ki(ji))Ki++;else if(!Dt.value||Ui){Ri=!1;break}Ti+=pi(getRowIdentity(ji,Vi))}Ki===0&&(Ri=!1),ze.value=Ri},pi=Oi=>{var xi;if(!n||!n.store)return 0;const{treeData:Li}=n.store.states;let Wi=0;const ki=(xi=Li.value[Oi])==null?void 0:xi.children;return ki&&(Wi+=ki.length,ki.forEach(Ri=>{Wi+=pi(Ri)})),Wi},yi=(Oi,xi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Li={};return Oi.forEach(Wi=>{$e.value[Wi.id]=xi,Li[Wi.columnKey||Wi.id]=xi}),Li},Ai=(Oi,xi,Li)=>{Ve.value&&Ve.value!==Oi&&(Ve.value.order=null),Ve.value=Oi,Oe.value=xi,At.value=Li},hi=()=>{let Oi=vue.unref(V);Object.keys($e.value).forEach(xi=>{const Li=$e.value[xi];if(!Li||Li.length===0)return;const Wi=getColumnById({columns:Ce.value},xi);Wi&&Wi.filterMethod&&(Oi=Oi.filter(ki=>Li.some(Ri=>Wi.filterMethod.call(null,Ri,ki,Wi))))}),Ue.value=Oi},wi=()=>{k.value=sortData(Ue.value,{sortingColumn:Ve.value,sortProp:Oe.value,sortOrder:At.value})},Ci=(Oi=void 0)=>{Oi&&Oi.filter||hi(),wi()},mi=Oi=>{const{tableHeaderRef:xi}=n.refs;if(!xi)return;const Li=Object.assign({},xi.filterPanels),Wi=Object.keys(Li);if(Wi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Ri=>getColumnByKey({columns:Ce.value},Ri));Wi.forEach(Ri=>{const Ki=ki.find(Ti=>Ti.id===Ri);Ki&&(Ki.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Wi.forEach(ki=>{const Ri=Ce.value.find(Ki=>Ki.id===ki);Ri&&(Ri.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ve.value&&(Ai(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Mi,toggleRowExpansion:fi,updateExpandRows:zi,states:Si,isRowExpanded:si}=useExpand({data:k,rowKey:g}),{updateTreeExpandKeys:Ii,toggleTreeExpansion:oi,updateTreeData:Et,loadOrToggle:ii,states:ri}=useTree({data:k,rowKey:g}),{updateCurrentRowData:ui,updateCurrentRow:vi,setCurrentRowKey:bi,states:Zi}=useCurrent({data:k,rowKey:g});return{assertRowKey:Lt,updateColumns:jt,scheduleLayout:ti,isSelected:ei,clearSelection:Pt,cleanSelection:ni,getSelectionRows:gi,toggleRowSelection:di,_toggleAllSelection:li,toggleAllSelection:null,updateSelectionByRowKey:ai,updateAllSelected:ci,updateFilters:yi,updateCurrentRow:vi,updateSort:Ai,execFilter:hi,execSort:wi,execQuery:Ci,clearFilter:mi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{Mi(Oi),Ii(Oi)},setCurrentRowKey:bi,toggleRowExpansionAdapter:(Oi,xi)=>{Ce.value.some(({type:Wi})=>Wi==="expand")?fi(Oi,xi):oi(Oi,xi)},isRowExpanded:si,updateExpandRows:zi,updateCurrentRowData:ui,loadOrToggle:ii,updateTreeData:Et,states:{tableSize:r,rowKey:g,data:k,_data:V,isComplex:$,_columns:oe,originColumns:re,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:pe,isAllSelected:ze,selection:Fe,reserveSelection:xe,selectOnIndeterminate:_e,selectable:Dt,filters:$e,filteredData:Ue,sortingColumn:Ve,sortProp:Oe,sortOrder:At,hoverRow:qe,...Si,...ri,...Zi}}}function replaceColumn(i,n){return i.map(r=>{var g;return r.id===n.id?n:((g=r.children)!=null&&g.length&&(r.children=replaceColumn(r.children,n)),r)})}function sortColumn(i){i.forEach(n=>{var r,g;n.no=(r=n.getColumnIndex)==null?void 0:r.call(n),(g=n.children)!=null&&g.length&&sortColumn(n.children)}),i.sort((n,r)=>n.no-r.no)}function useStore(){const i=vue.getCurrentInstance(),n=useWatcher$1();return{ns:useNamespace("table"),...n,mutations:{setData($,oe){const re=vue.unref($._data)!==oe;$.data.value=oe,$._data.value=oe,i.store.execQuery(),i.store.updateCurrentRowData(),i.store.updateExpandRows(),i.store.updateTreeData(i.store.states.defaultExpandAll.value),vue.unref($.reserveSelection)?(i.store.assertRowKey(),i.store.updateSelectionByRowKey()):re?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,oe,re,Ce){const ie=vue.unref($._columns);let ae=[];re?(re&&!re.children&&(re.children=[]),re.children.push(oe),ae=replaceColumn(ie,re)):(ie.push(oe),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),oe.type==="selection"&&($.selectable.value=oe.selectable,$.reserveSelection.value=oe.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,oe){var re;((re=oe.getColumnIndex)==null?void 0:re.call(oe))!==oe.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,oe,re,Ce){const ie=vue.unref($._columns)||[];if(re)re.children.splice(re.children.findIndex(le=>le.id===oe.id),1),vue.nextTick(()=>{var le;((le=re.children)==null?void 0:le.length)===0&&delete re.children}),$._columns.value=replaceColumn(ie,re);else{const le=ie.indexOf(oe);le>-1&&(ie.splice(le,1),$._columns.value=ie)}const ae=$.updateOrderFns.indexOf(Ce);ae>-1&&$.updateOrderFns.splice(ae,1),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},sort($,oe){const{prop:re,order:Ce,init:ie}=oe;if(re){const ae=vue.unref($.columns).find(le=>le.property===re);ae&&(ae.order=Ce,i.store.updateSort(ae,re,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,oe){const{sortingColumn:re,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(re),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!oe||!(oe.silent||oe.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,oe){const{column:re,values:Ce,silent:ie}=oe,ae=i.store.updateFilters(re,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,oe){i.store.toggleRowSelection(oe),i.store.updateAllSelected()},setHoverRow($,oe){$.hoverRow.value=oe},setCurrentRow($,oe){i.store.updateCurrentRow(oe)}},commit:function($,...oe){const re=i.store.mutations;if(re[$])re[$].apply(i,[i.store.states].concat(oe));else throw new Error(`Action not found: ${$}`)},updateTableScrollY:function(){vue.nextTick(()=>i.layout.updateScrollY.apply(i.layout))}}}const InitialStateMap={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function createStore(i,n){if(!i)throw new Error("Table is required.");const r=useStore();return r.toggleAllSelection=debounce(r._toggleAllSelection,10),Object.keys(InitialStateMap).forEach(g=>{handleValue(getArrKeysValue(n,g),g,r)}),proxyTableProps(r,n),r}function proxyTableProps(i,n){Object.keys(InitialStateMap).forEach(r=>{vue.watch(()=>getArrKeysValue(n,r),g=>{handleValue(g,r,i)})})}function handleValue(i,n,r){let g=i,k=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(k=k.key,g=g||InitialStateMap[n].default),r.states[k].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(k=>{g=g[k]}),g}else return i[n]}class TableLayout{constructor(n){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=vue.ref(null),this.scrollX=vue.ref(!1),this.scrollY=vue.ref(!1),this.bodyWidth=vue.ref(null),this.fixedWidth=vue.ref(null),this.rightFixedWidth=vue.ref(null),this.gutterWidth=0;for(const r in n)hasOwn$1(n,r)&&(vue.isRef(this[r])?this[r].value=n[r]:this[r]=n[r]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const r=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(r!=null&&r.wrapRef)){let g=!0;const k=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,k!==g}return!1}setHeight(n,r="height"){if(!isClient)return;const g=this.table.vnode.el;if(n=parseHeight(n),this.height.value=Number(n),!g&&(n||n===0))return vue.nextTick(()=>this.setHeight(n,r));typeof n=="number"?(g.style[r]=`${n}px`,this.updateElsHeight()):typeof n=="string"&&(g.style[r]=n,this.updateElsHeight())}setMaxHeight(n){this.setHeight(n,"max-height")}getFlattenColumns(){const n=[];return this.table.store.states.columns.value.forEach(g=>{g.isColumnGroup?n.push.apply(n,g.columns):n.push(g)}),n}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(n){if(!n)return!0;let r=n;for(;r.tagName!=="DIV";){if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}updateColumnsWidth(){if(!isClient)return;const n=this.fit,r=this.table.vnode.el.clientWidth;let g=0;const k=this.getFlattenColumns(),V=k.filter(re=>typeof re.width!="number");if(k.forEach(re=>{typeof re.width=="number"&&re.realWidth&&(re.realWidth=null)}),V.length>0&&n){if(k.forEach(re=>{g+=Number(re.width||re.minWidth||80)}),g<=r){this.scrollX.value=!1;const re=r-g;if(V.length===1)V[0].realWidth=Number(V[0].minWidth||80)+re;else{const Ce=V.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=re/Ce;let ae=0;V.forEach((le,Ie)=>{if(Ie===0)return;const ue=Math.floor(Number(le.minWidth||80)*ie);ae+=ue,le.realWidth=Number(le.minWidth||80)+ue}),V[0].realWidth=Number(V[0].minWidth||80)+re-ae}}else this.scrollX.value=!0,V.forEach(re=>{re.realWidth=Number(re.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else k.forEach(re=>{!re.width&&!re.minWidth?re.realWidth=80:re.realWidth=Number(re.width||re.minWidth),g+=re.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let re=0;$.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=re}const oe=this.store.states.rightFixedColumns.value;if(oe.length>0){let re=0;oe.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=re}this.notifyObservers("columns")}addObserver(n){this.observers.push(n)}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&this.observers.splice(r,1)}notifyObservers(n){this.observers.forEach(g=>{var k,V;switch(n){case"columns":(k=g.state)==null||k.onColumnsChange(this);break;case"scrollable":(V=g.state)==null||V.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$D=vue.defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox,ElCheckboxGroup,ElScrollbar,ElTooltip,ElIcon,ArrowDown:arrow_down_default,ArrowUp:arrow_up_default},directives:{ClickOutside},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(i){const n=vue.getCurrentInstance(),{t:r}=useLocale(),g=useNamespace("table-filter"),k=n==null?void 0:n.parent;k.filterPanels.value[i.column.id]||(k.filterPanels.value[i.column.id]=n);const V=vue.ref(!1),$=vue.ref(null),oe=vue.computed(()=>i.column&&i.column.filters),re=vue.computed({get:()=>{var Fe;return(((Fe=i.column)==null?void 0:Fe.filteredValue)||[])[0]},set:Fe=>{Ce.value&&(typeof Fe<"u"&&Fe!==null?Ce.value.splice(0,1,Fe):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Fe){i.column&&i.upDataColumn("filteredValue",Fe)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Fe=>Fe.value===re.value,le=()=>{V.value=!1},Ie=Fe=>{Fe.stopPropagation(),V.value=!V.value},ue=()=>{V.value=!1},de=()=>{pe(Ce.value),le()},Ne=()=>{Ce.value=[],pe(Ce.value),le()},he=Fe=>{re.value=Fe,pe(typeof Fe<"u"&&Fe!==null?Ce.value:[]),le()},pe=Fe=>{i.store.commit("filterChange",{column:i.column,values:Fe}),i.store.updateAllSelected()};vue.watch(V,Fe=>{i.column&&i.upDataColumn("filterOpened",Fe)},{immediate:!0});const ze=vue.computed(()=>{var Fe,xe;return(xe=(Fe=$.value)==null?void 0:Fe.popperRef)==null?void 0:xe.contentRef});return{tooltipVisible:V,multiple:ie,filteredValue:Ce,filterValue:re,filters:oe,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:ze,tooltip:$}}}),_hoisted_1$s={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$5(i,n,r,g,k,V){const $=vue.resolveComponent("el-checkbox"),oe=vue.resolveComponent("el-checkbox-group"),re=vue.resolveComponent("el-scrollbar"),Ce=vue.resolveComponent("arrow-up"),ie=vue.resolveComponent("arrow-down"),ae=vue.resolveComponent("el-icon"),le=vue.resolveComponent("el-tooltip"),Ie=vue.resolveDirective("click-outside");return vue.openBlock(),vue.createBlock(le,{ref:"tooltip",visible:i.tooltipVisible,offset:0,placement:i.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":i.ns.b(),persistent:""},{content:vue.withCtx(()=>[i.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$s,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(re,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(oe,{modelValue:i.filteredValue,"onUpdate:modelValue":n[0]||(n[0]=ue=>i.filteredValue=ue),class:vue.normalizeClass(i.ns.e("checkbox-group"))},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createBlock($,{key:ue.value,label:ue.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("bottom"))},[vue.createElementVNode("button",{class:vue.normalizeClass({[i.ns.is("disabled")]:i.filteredValue.length===0}),disabled:i.filteredValue.length===0,type:"button",onClick:n[1]||(n[1]=(...ue)=>i.handleConfirm&&i.handleConfirm(...ue))},vue.toDisplayString(i.t("el.table.confirmFilter")),11,_hoisted_2$m),vue.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=(...ue)=>i.handleReset&&i.handleReset(...ue))},vue.toDisplayString(i.t("el.table.resetFilter")),1)],2)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,class:vue.normalizeClass(i.ns.e("list"))},[vue.createElementVNode("li",{class:vue.normalizeClass([i.ns.e("list-item"),{[i.ns.is("active")]:i.filterValue===void 0||i.filterValue===null}]),onClick:n[3]||(n[3]=ue=>i.handleSelect(null))},vue.toDisplayString(i.t("el.table.clearFilter")),3),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createElementBlock("li",{key:ue.value,class:vue.normalizeClass([i.ns.e("list-item"),i.ns.is("active",i.isActive(ue))]),label:ue.value,onClick:de=>i.handleSelect(ue.value)},vue.toDisplayString(ue.text),11,_hoisted_3$g))),128))],2))]),default:vue.withCtx(()=>[vue.withDirectives((vue.openBlock(),vue.createElementBlock("span",{class:vue.normalizeClass([`${i.ns.namespace.value}-table__column-filter-trigger`,`${i.ns.namespace.value}-none-outline`]),onClick:n[4]||(n[4]=(...ue)=>i.showFilterPanel&&i.showFilterPanel(...ue))},[vue.createVNode(ae,null,{default:vue.withCtx(()=>[i.column.filterOpened?(vue.openBlock(),vue.createBlock(Ce,{key:0})):(vue.openBlock(),vue.createBlock(ie,{key:1}))]),_:1})],2)),[[Ie,i.hideFilterPanel,i.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var FilterPanel=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$5],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function useLayoutObserver(i){const n=vue.getCurrentInstance();vue.onBeforeMount(()=>{r.value.addObserver(n)}),vue.onMounted(()=>{g(r.value),k(r.value)}),vue.onUpdated(()=>{g(r.value),k(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const V=i.layout;if(!V)throw new Error("Can not find table layout.");return V}),g=V=>{var $;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!oe.length)return;const re=V.getFlattenColumns(),Ce={};re.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=oe.length;ie<ae;ie++){const le=oe[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},k=V=>{var $,oe;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=re.length;ie<ae;ie++)re[ie].setAttribute("width",V.scrollY.value?V.gutterWidth:"0");const Ce=((oe=i.vnode.el)==null?void 0:oe.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=V.scrollY.value?`${V.gutterWidth}px`:"0",le.style.display=V.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:k}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=de=>{de.stopPropagation()},V=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&k(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},oe=vue.ref(null),re=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&oe.value&&i.border){re.value=!0;const he=g;n("set-drag-visible",!0);const ze=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Fe=r.vnode.el.querySelector(`th.${Ne.id}`),xe=Fe.getBoundingClientRect(),_e=xe.left-ze+30;addClass(Fe,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:xe.right-ze,startColumnLeft:xe.left-ze,tableLeft:ze};const Dt=he==null?void 0:he.refs.resizeProxy;Dt.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ve=>{const Oe=Ve.clientX-Ce.value.startMouseLeft,At=Ce.value.startLeft+Oe;Dt.style.left=`${Math.max(_e,At)}px`},Ue=()=>{if(re.value){const{startColumnLeft:Ve,startLeft:Oe}=Ce.value,qe=Number.parseInt(Dt.style.left,10)-Ve;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,Oe-Ve,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",re.value=!1,oe.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Ue),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Fe,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Ue)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const pe=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!re.value&&i.border){const ze=pe.getBoundingClientRect(),Fe=document.body.style;ze.width>12&&ze.right-de.pageX<8?(Fe.cursor="col-resize",hasClass(pe,"is-sortable")&&(pe.style.cursor="col-resize"),oe.value=Ne):re.value||(Fe.cursor="",hasClass(pe,"is-sortable")&&(pe.style.cursor="pointer"),oe.value=null)}},le=()=>{isClient&&(document.body.style.cursor="")},Ie=({order:de,sortOrders:Ne})=>{if(de==="")return Ne[0];const he=Ne.indexOf(de||null);return Ne[he>Ne.length-2?0:he+1]},ue=(de,Ne,he)=>{var pe;de.stopPropagation();const ze=Ne.order===he?null:he||Ie(Ne),Fe=(pe=de.target)==null?void 0:pe.closest("th");if(Fe&&hasClass(Fe,"noclick")){removeClass(Fe,"noclick");return}if(!Ne.sortable)return;const xe=i.store.states;let _e=xe.sortProp.value,Dt;const $e=xe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),xe.sortingColumn.value=Ne,_e=Ne.property),ze?Dt=Ne.order=ze:Dt=Ne.order=null,xe.sortProp.value=_e,xe.sortOrder.value=Dt,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:V,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:k}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:oe=>{const re=n==null?void 0:n.props.headerRowStyle;return typeof re=="function"?re.call(null,{rowIndex:oe}):re},getHeaderRowClass:oe=>{const re=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?re.push(Ce):typeof Ce=="function"&&re.push(Ce.call(null,{rowIndex:oe})),re.join(" ")},getHeaderCellStyle:(oe,re,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie}));const Ie=getFixedColumnOffset(re,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(oe,re,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),re,ie.fixed,i.store,Ce),le=[ie.id,ie.order,ie.headerAlign,ie.className,ie.labelClassName,...ae];ie.children||le.push("is-leaf"),ie.sortable&&le.push("is-sortable");const Ie=n==null?void 0:n.props.headerCellClassName;return typeof Ie=="string"?le.push(Ie):typeof Ie=="function"&&le.push(Ie.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie})),le.push(r.e("cell")),le.filter(ue=>!!ue).join(" ")}}}const getAllColumns=i=>{const n=[];return i.forEach(r=>{r.children?(n.push(r),n.push.apply(n,getAllColumns(r.children))):n.push(r)}),n},convertToRows=i=>{let n=1;const r=(V,$)=>{if($&&(V.level=$.level+1,n<V.level&&(n=V.level)),V.children){let oe=0;V.children.forEach(re=>{r(re,V),oe+=re.colSpan}),V.colSpan=oe}else V.colSpan=1};i.forEach(V=>{V.level=1,r(V,void 0)});const g=[];for(let V=0;V<n;V++)g.push([]);return getAllColumns(i).forEach(V=>{V.children?(V.rowSpan=1,V.children.forEach($=>$.isSubColumn=!0)):V.rowSpan=n-V.level+1,g[V.level-1].push(V)}),g};function useUtils$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.computed(()=>convertToRows(i.store.states.originColumns.value));return{isGroup:vue.computed(()=>{const V=r.value.length>1;return V&&n&&(n.state.isGroup.value=!0),V}),toggleAllSelection:V=>{V.stopPropagation(),n==null||n.store.commit("toggleAllSelection")},columnRows:r}}var TableHeader=vue.defineComponent({name:"ElTableHeader",components:{ElCheckbox},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i,{emit:n}){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=useNamespace("table"),V=vue.ref({}),{onColumnsChange:$,onScrollableChange:oe}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:Dt}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:Dt,init:!0})});const{handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:pe}=useStyle$2(i),{isGroup:ze,toggleAllSelection:Fe,columnRows:xe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:oe},r.filterPanels=V,{ns:k,filterPanels:V,onColumnsChange:$,onScrollableChange:oe,columnRows:xe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:pe,getHeaderCellStyle:he,handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:ze,toggleAllSelection:Fe}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:k,getHeaderRowClass:V,getHeaderRowStyle:$,handleHeaderClick:oe,handleHeaderContextMenu:re,handleMouseDown:Ce,handleMouseMove:ie,handleSortClick:ae,handleMouseOut:le,store:Ie,$parent:ue}=this;let de=1;return vue.h("thead",{class:{[i.is("group")]:n}},r.map((Ne,he)=>vue.h("tr",{class:V(he),key:he,style:$(he)},Ne.map((pe,ze)=>(pe.rowSpan>de&&(de=pe.rowSpan),vue.h("th",{class:k(he,ze,Ne,pe),colspan:pe.colSpan,key:`${pe.id}-thead`,rowspan:pe.rowSpan,style:g(he,ze,Ne,pe),onClick:Fe=>oe(Fe,pe),onContextmenu:Fe=>re(Fe,pe),onMousedown:Fe=>Ce(Fe,pe),onMousemove:Fe=>ie(Fe,pe),onMouseout:le},[vue.h("div",{class:["cell",pe.filteredValue&&pe.filteredValue.length>0?"highlight":""]},[pe.renderHeader?pe.renderHeader({column:pe,$index:ze,store:Ie,_self:ue}):pe.label,pe.sortable&&vue.h("span",{onClick:Fe=>ae(Fe,pe),class:"caret-wrapper"},[vue.h("i",{onClick:Fe=>ae(Fe,pe,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Fe=>ae(Fe,pe,"descending"),class:"sort-caret descending"})]),pe.filterable&&vue.h(FilterPanel,{store:Ie,placement:pe.filterPlacement||"bottom-start",column:pe,upDataColumn:(Fe,xe)=>{pe[Fe]=xe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:k}=useZIndex(),V=(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie);let ze;const Fe=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;pe&&(ze=getColumnByCell({columns:i.store.states.columns.value},pe,Fe),ze&&(he==null||he.emit(`cell-${de}`,ue,ze,pe,Ie))),he==null||he.emit(`row-${de}`,ue,ze,Ie)},$=(Ie,ue)=>{V(Ie,ue,"dblclick")},oe=(Ie,ue)=>{i.store.commit("setCurrentRow",ue),V(Ie,ue,"click")},re=(Ie,ue)=>{V(Ie,ue,"contextmenu")},Ce=debounce(Ie=>{i.store.commit("setHoverRow",Ie)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30);return{handleDoubleClick:$,handleClick:oe,handleContextMenu:re,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie),ze=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;if(pe){const $e=getColumnByCell({columns:i.store.states.columns.value},pe,ze),Ue=he.hoverState={cell:pe,column:$e,row:ue};he==null||he.emit("cell-mouse-enter",Ue.row,Ue.column,Ue.cell,Ie)}if(!de)return;const Fe=Ie.target.querySelector(".cell");if(!(hasClass(Fe,`${ze}-tooltip`)&&Fe.childNodes.length))return;const xe=document.createRange();xe.setStart(Fe,0),xe.setEnd(Fe,Fe.childNodes.length);const _e=Math.round(xe.getBoundingClientRect().width),Dt=(Number.parseInt(getStyle$1(Fe,"paddingLeft"),10)||0)+(Number.parseInt(getStyle$1(Fe,"paddingRight"),10)||0);(_e+Dt>Fe.offsetWidth||Fe.scrollWidth>Fe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,k,de)},handleCellMouseLeave:Ie=>{if(!getCell(Ie))return;const de=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",de==null?void 0:de.row,de==null?void 0:de.column,de==null?void 0:de.cell,Ie)},tooltipContent:r,tooltipTrigger:g}}function useStyles(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getRowStyle:(Ce,ie)=>{const ae=n==null?void 0:n.props.rowStyle;return typeof ae=="function"?ae.call(null,{row:Ce,rowIndex:ie}):ae||null},getRowClass:(Ce,ie)=>{const ae=[r.e("row")];n!=null&&n.props.highlightCurrentRow&&Ce===i.store.states.currentRow.value&&ae.push("current-row"),i.stripe&&ie%2===1&&ae.push(r.em("row","striped"));const le=n==null?void 0:n.props.rowClassName;return typeof le=="string"?ae.push(le):typeof le=="function"&&ae.push(le.call(null,{row:Ce,rowIndex:ie})),ae},getCellStyle:(Ce,ie,ae,le)=>{const Ie=n==null?void 0:n.props.cellStyle;let ue=Ie??{};typeof Ie=="function"&&(ue=Ie.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le}));const de=getFixedColumnOffset(ie,i==null?void 0:i.fixed,i.store);return ensurePosition(de,"left"),ensurePosition(de,"right"),Object.assign({},ue,de)},getCellClass:(Ce,ie,ae,le,Ie)=>{const ue=getFixedColumnsClass(r.b(),ie,i==null?void 0:i.fixed,i.store,void 0,Ie),de=[le.id,le.align,le.className,...ue],Ne=n==null?void 0:n.props.cellClassName;return typeof Ne=="string"?de.push(Ne):typeof Ne=="function"&&de.push(Ne.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le})),de.push(r.e("cell")),de.filter(he=>!!he).join(" ")},getSpan:(Ce,ie,ae,le)=>{let Ie=1,ue=1;const de=n==null?void 0:n.props.spanMethod;if(typeof de=="function"){const Ne=de({row:Ce,column:ie,rowIndex:ae,columnIndex:le});Array.isArray(Ne)?(Ie=Ne[0],ue=Ne[1]):typeof Ne=="object"&&(Ie=Ne.rowspan,ue=Ne.colspan)}return{rowspan:Ie,colspan:ue}},getColspanRealWidth:(Ce,ie,ae)=>{if(ie<1)return Ce[ae].realWidth;const le=Ce.map(({realWidth:Ie,width:ue})=>Ie||ue).slice(ae,ae+ie);return Number(le.reduce((Ie,ue)=>Number(Ie)+Number(ue),-1))}}}function useRender$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table"),{handleDoubleClick:g,handleClick:k,handleContextMenu:V,handleMouseEnter:$,handleMouseLeave:oe,handleCellMouseEnter:re,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),pe=vue.computed(()=>i.store.states.columns.value.findIndex(({type:Dt})=>Dt==="default")),ze=(Dt,$e)=>{const Ue=n.props.rowKey;return Ue?getRowIdentity(Dt,Ue):$e},Fe=(Dt,$e,Ue,Ve=!1)=>{const{tooltipEffect:Oe,tooltipOptions:At,store:qe}=i,{indent:Lt,columns:kt}=qe.states,jt=Ie(Dt,$e);let ti=!0;Ue&&(jt.push(r.em("row",`level-${Ue.level}`)),ti=Ue.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(Dt,$e)],class:jt,key:ze(Dt,$e),onDblclick:Pt=>g(Pt,Dt),onClick:Pt=>k(Pt,Dt),onContextmenu:Pt=>V(Pt,Dt),onMouseenter:()=>$($e),onMouseleave:oe},kt.value.map((Pt,ni)=>{const{rowspan:gi,colspan:di}=Ne(Dt,Pt,$e,ni);if(!gi||!di)return null;const li={...Pt};li.realWidth=he(kt.value,di,ni);const ai={store:i.store,_self:i.context||n,column:li,row:Dt,$index:$e,cellIndex:ni,expanded:Ve};ni===pe.value&&Ue&&(ai.treeNode={indent:Ue.level*Lt.value,level:Ue.level},typeof Ue.expanded=="boolean"&&(ai.treeNode.expanded=Ue.expanded,"loading"in Ue&&(ai.treeNode.loading=Ue.loading),"noLazyChildren"in Ue&&(ai.treeNode.noLazyChildren=Ue.noLazyChildren)));const ci=`${$e},${ni}`,pi=li.columnKey||li.rawColumnKey||"",yi=xe(ni,Pt,ai),Ai=Pt.showOverflowTooltip&&merge$2({effect:Oe},At,Pt.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,Dt,Pt),class:de($e,ni,Dt,Pt,di-1),key:`${pi}${ci}`,rowspan:gi,colspan:di,onMouseenter:hi=>re(hi,Dt,Ai),onMouseleave:Ce},[yi])}))},xe=(Dt,$e,Ue)=>$e.renderCell(Ue);return{wrappedRowRender:(Dt,$e)=>{const Ue=i.store,{isRowExpanded:Ve,assertRowKey:Oe}=Ue,{treeData:At,lazyTreeNodeMap:qe,childrenColumnName:Lt,rowKey:kt}=Ue.states,jt=Ue.states.columns.value;if(jt.some(({type:ei})=>ei==="expand")){const ei=Ve(Dt),Pt=Fe(Dt,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Pt,vue.h("tr",{key:`expanded-row__${Pt.key}`},[vue.h("td",{colspan:jt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:Dt,$index:$e,store:Ue,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Pt):[[Pt]]}else if(Object.keys(At.value).length){Oe();const ei=getRowIdentity(Dt,kt.value);let Pt=At.value[ei],ni=null;Pt&&(ni={expanded:Pt.expanded,level:Pt.level,display:!0},typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(ni.noLazyChildren=!(Pt.children&&Pt.children.length)),ni.loading=Pt.loading));const gi=[Fe(Dt,$e,ni)];if(Pt){let di=0;const li=(ci,pi)=>{ci&&ci.length&&pi&&ci.forEach(yi=>{const Ai={display:pi.display&&pi.expanded,level:pi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},hi=getRowIdentity(yi,kt.value);if(hi==null)throw new Error("For nested data item, row-key is required.");if(Pt={...At.value[hi]},Pt&&(Ai.expanded=Pt.expanded,Pt.level=Pt.level||Ai.level,Pt.display=!!(Pt.expanded&&Ai.display),typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(Ai.noLazyChildren=!(Pt.children&&Pt.children.length)),Ai.loading=Pt.loading)),di++,gi.push(Fe(yi,$e+di,Ai)),Pt){const wi=qe.value[hi]||yi[Lt.value];li(wi,Pt)}})};Pt.display=!0;const ai=qe.value[ei]||Dt[Lt.value];li(ai,Pt)}return gi}else return Fe(Dt,$e,void 0)},tooltipContent:ie,tooltipTrigger:ae}}const defaultProps$2={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var TableBody=vue.defineComponent({name:"ElTableBody",props:defaultProps$2,setup(i){const n=vue.getCurrentInstance(),r=vue.inject(TABLE_INJECTION_KEY),g=useNamespace("table"),{wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:oe,onScrollableChange:re}=useLayoutObserver(r);return vue.watch(i.store.states.hoverRow,(Ce,ie)=>{if(!i.store.states.isComplex.value||!isClient)return;let ae=window.requestAnimationFrame;ae||(ae=le=>window.setTimeout(le,16)),ae(()=>{const le=n==null?void 0:n.vnode.el,Ie=Array.from((le==null?void 0:le.children)||[]).filter(Ne=>Ne==null?void 0:Ne.classList.contains(`${g.e("row")}`)),ue=Ie[ie],de=Ie[Ce];ue&&removeClass(ue,"hover-row"),de&&addClass(de,"hover-row")})}),vue.onUnmounted(()=>{var Ce;(Ce=removePopper)==null||Ce()}),{ns:g,onColumnsChange:oe,onScrollableChange:re,wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,k)=>g.concat(i(k,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(k=>k.width===void 0)&&(r=[]);const g=k=>{const V={key:`${i.tableLayout}_${k.id}`,style:{},name:void 0};return n?V.style={width:`${k.width}px`}:V.name=k.id,V};return vue.h("colgroup",{},r.map(k=>vue.h("col",g(k))))}hColgroup.props=["columns","tableLayout"];function useMapState(){const i=vue.inject(TABLE_INJECTION_KEY),n=i==null?void 0:i.store,r=vue.computed(()=>n.states.fixedLeafColumnsLength.value),g=vue.computed(()=>n.states.rightFixedColumns.value.length),k=vue.computed(()=>n.states.columns.value.length),V=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:k,leftFixedCount:V,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(V,$)=>{const oe=V[$],re=[r.e("cell"),oe.id,oe.align,oe.labelClassName,...getFixedColumnsClass(r.b(),$,oe.fixed,i.store)];return oe.className&&re.push(oe.className),oe.children||re.push(r.is("leaf")),re},getCellStyles:(V,$)=>{const oe=getFixedColumnOffset($,V.fixed,i.store);return ensurePosition(oe,"left"),ensurePosition(oe,"right"),oe},columns:n}}var TableFooter=vue.defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i){const{getCellClasses:n,getCellStyles:r,columns:g}=useStyle$1(i);return{ns:useNamespace("table"),getCellClasses:n,getCellStyles:r,columns:g}},render(){const{columns:i,getCellStyles:n,getCellClasses:r,summaryMethod:g,sumText:k,ns:V}=this,$=this.store.states.data.value;let oe=[];return g?oe=g({columns:i,data:$}):i.forEach((re,Ce)=>{if(Ce===0){oe[Ce]=k;return}const ie=$.map(ue=>Number(ue[re.property])),ae=[];let le=!0;ie.forEach(ue=>{if(!Number.isNaN(+ue)){le=!1;const de=`${ue}`.split(".")[1];ae.push(de?de.length:0)}});const Ie=Math.max.apply(null,ae);le?oe[Ce]="":oe[Ce]=ie.reduce((ue,de)=>{const Ne=Number(de);return Number.isNaN(+Ne)?ue:Number.parseFloat((ue+de).toFixed(Math.min(Ie,20)))},0)}),vue.h("table",{class:V.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((re,Ce)=>vue.h("td",{key:Ce,colspan:re.colSpan,rowspan:re.rowSpan,class:r(i,Ce),style:n(re,Ce)},[vue.h("div",{class:["cell",re.labelClassName]},[oe[Ce]])]))])])])}});function useUtils(i){return{setCurrentRow:ie=>{i.commit("setCurrentRow",ie)},getSelectionRows:()=>i.getSelectionRows(),toggleRowSelection:(ie,ae)=>{i.toggleRowSelection(ie,ae,!1),i.updateAllSelected()},clearSelection:()=>{i.clearSelection()},clearFilter:ie=>{i.clearFilter(ie)},toggleAllSelection:()=>{i.commit("toggleAllSelection")},toggleRowExpansion:(ie,ae)=>{i.toggleRowExpansionAdapter(ie,ae)},clearSort:()=>{i.clearSort()},sort:(ie,ae)=>{i.commit("sort",{prop:ie,order:ae})}}}function useStyle(i,n,r,g){const k=vue.ref(!1),V=vue.ref(null),$=vue.ref(!1),oe=Pt=>{$.value=Pt},re=vue.ref({width:null,height:null,headerHeight:null}),Ce=vue.ref(!1),ie={display:"inline-block",verticalAlign:"middle"},ae=vue.ref(),le=vue.ref(0),Ie=vue.ref(0),ue=vue.ref(0),de=vue.ref(0),Ne=vue.ref(0);vue.watchEffect(()=>{n.setHeight(i.height)}),vue.watchEffect(()=>{n.setMaxHeight(i.maxHeight)}),vue.watch(()=>[i.currentRowKey,r.states.rowKey],([Pt,ni])=>{!vue.unref(ni)||!vue.unref(Pt)||r.setCurrentRowKey(`${Pt}`)},{immediate:!0}),vue.watch(()=>i.data,Pt=>{g.store.commit("setData",Pt)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},pe=(Pt,ni)=>{const{pixelX:gi,pixelY:di}=ni;Math.abs(gi)>=Math.abs(di)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},ze=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Fe=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),xe=()=>{ze.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Ue)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ve(),requestAnimationFrame(xe);const Pt=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Pt&&Pt.parentElement&&(Pt.parentElement.style.minWidth="0"),re.value={width:ae.value=Pt.offsetWidth,height:Pt.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(gi=>{gi.filteredValue&&gi.filteredValue.length&&g.store.commit("filterChange",{column:gi,values:gi.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Pt,ni)=>{if(!Pt)return;const gi=Array.from(Pt.classList).filter(di=>!di.startsWith("is-scrolling-"));gi.push(n.scrollX.value?ni:"is-scrolling-none"),Pt.className=gi.join(" ")},Dt=Pt=>{const{tableWrapper:ni}=g.refs;_e(ni,Pt)},$e=Pt=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Pt))},Ue=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const pi="is-scrolling-none";$e(pi)||Dt(pi);return}const Pt=g.refs.scrollBarRef.wrapRef;if(!Pt)return;const{scrollLeft:ni,offsetWidth:gi,scrollWidth:di}=Pt,{headerWrapper:li,footerWrapper:ai}=g.refs;li&&(li.scrollLeft=ni),ai&&(ai.scrollLeft=ni);const ci=di-gi-1;ni>=ci?Dt("is-scrolling-right"):Dt(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ve=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Ue,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,Oe):useEventListener(window,"resize",Oe),useResizeObserver(g.refs.bodyWrapper,()=>{var Pt,ni;Oe(),(ni=(Pt=g.refs)==null?void 0:Pt.scrollBarRef)==null||ni.update()}))},Oe=()=>{var Pt,ni,gi,di;const li=g.vnode.el;if(!g.$ready||!li)return;let ai=!1;const{width:ci,height:pi,headerHeight:yi}=re.value,Ai=ae.value=li.offsetWidth;ci!==Ai&&(ai=!0);const hi=li.offsetHeight;(i.height||ze.value)&&pi!==hi&&(ai=!0);const wi=i.tableLayout==="fixed"?g.refs.headerWrapper:(Pt=g.refs.tableHeaderRef)==null?void 0:Pt.$el;i.showHeader&&(wi==null?void 0:wi.offsetHeight)!==yi&&(ai=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(wi==null?void 0:wi.scrollHeight)||0,de.value=((gi=g.refs.footerWrapper)==null?void 0:gi.offsetHeight)||0,Ne.value=((di=g.refs.appendWrapper)==null?void 0:di.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,ai&&(re.value={width:Ai,height:hi,headerHeight:i.showHeader&&(wi==null?void 0:wi.offsetHeight)||0},xe())},At=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Pt,scrollY:ni,gutterWidth:gi}=n;return Pt.value?`${Pt.value-(ni.value?gi:0)}px`:""}),Lt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),kt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Pt="100%";i.height&&Ie.value&&(Pt=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Pt}}),jt=vue.computed(()=>i.height?{height:Number.isNaN(Number(i.height))?i.height:`${i.height}px`}:i.maxHeight?{maxHeight:Number.isNaN(Number(i.maxHeight))?i.maxHeight:`${i.maxHeight}px`}:{}),ti=vue.computed(()=>i.height?{height:"100%"}:i.maxHeight?Number.isNaN(Number(i.maxHeight))?{maxHeight:`calc(${i.maxHeight} - ${ue.value+de.value}px)`}:{maxHeight:`${i.maxHeight-ue.value-de.value}px`}:{});return{isHidden:k,renderExpanded:V,setDragVisible:oe,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:pe,tableSize:At,emptyBlockStyle:kt,handleFixedMousewheel:(Pt,ni)=>{const gi=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const di=gi.scrollTop;ni.pixelY<0&&di!==0&&Pt.preventDefault(),ni.pixelY>0&&gi.scrollHeight-gi.clientHeight>di&&Pt.preventDefault(),gi.scrollTop+=Math.ceil(ni.pixelY/5)}else gi.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:re,doLayout:xe,tableBodyStyles:Fe,tableLayout:Lt,scrollbarViewStyle:ie,tableInnerStyle:jt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const k=i.vnode.el.querySelector(".hidden-columns"),V={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(oe=>oe())}),n.value.observe(k,V)};vue.onMounted(()=>{r()}),vue.onUnmounted(()=>{var g;(g=n.value)==null||g.disconnect()})}var defaultProps$1={data:{type:Array,default:()=>[]},size:useSizeProp,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};const useScrollbar=()=>{const i=vue.ref(),n=(V,$)=>{const oe=i.value;oe&&oe.scrollTo(V,$)},r=(V,$)=>{const oe=i.value;oe&&isNumber$1($)&&["Top","Left"].includes(V)&&oe[`setScroll${V}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:V=>r("Top",V),setScrollLeft:V=>r("Left",V)}};let tableIdSeed=1;const _sfc_main$C=vue.defineComponent({name:"ElTable",directives:{Mousewheel},components:{TableHeader,TableBody,TableFooter,ElScrollbar,hColgroup},props:defaultProps$1,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(i){const{t:n}=useLocale(),r=useNamespace("table"),g=vue.getCurrentInstance();vue.provide(TABLE_INJECTION_KEY,g);const k=createStore(g,i);g.store=k;const V=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=V;const $=vue.computed(()=>(k.states.data.value||[]).length===0),{setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(k),{isHidden:Ne,renderExpanded:he,setDragVisible:pe,isGroup:ze,handleMouseLeave:Fe,handleHeaderFooterMousewheel:xe,tableSize:_e,emptyBlockStyle:Dt,handleFixedMousewheel:$e,resizeProxyVisible:Ue,bodyWidth:Ve,resizeState:Oe,doLayout:At,tableBodyStyles:qe,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti}=useStyle(i,V,k,g),{scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}=useScrollbar(),di=debounce(At,50),li=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=li,g.state={isGroup:ze,resizeState:Oe,doLayout:At,debouncedUpdateLayout:di};const ai=vue.computed(()=>i.sumText||n("el.table.sumText")),ci=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:V,store:k,handleHeaderFooterMousewheel:xe,handleMouseLeave:Fe,tableId:li,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Ue,resizeState:Oe,isGroup:ze,bodyWidth:Ve,tableBodyStyles:qe,emptyBlockStyle:Dt,debouncedUpdateLayout:di,handleFixedMousewheel:$e,setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:At,sort:de,t:n,setDragVisible:pe,context:g,computedSumText:ai,computedEmptyText:ci,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}}}),_hoisted_1$r=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$4(i,n,r,g,k,V){const $=vue.resolveComponent("hColgroup"),oe=vue.resolveComponent("table-header"),re=vue.resolveComponent("table-body"),Ce=vue.resolveComponent("el-scrollbar"),ie=vue.resolveComponent("table-footer"),ae=vue.resolveDirective("mousewheel");return vue.openBlock(),vue.createElementBlock("div",{ref:"tableWrapper",class:vue.normalizeClass([{[i.ns.m("fit")]:i.fit,[i.ns.m("striped")]:i.stripe,[i.ns.m("border")]:i.border||i.isGroup,[i.ns.m("hidden")]:i.isHidden,[i.ns.m("group")]:i.isGroup,[i.ns.m("fluid-height")]:i.maxHeight,[i.ns.m("scrollable-x")]:i.layout.scrollX.value,[i.ns.m("scrollable-y")]:i.layout.scrollY.value,[i.ns.m("enable-row-hover")]:!i.store.states.isComplex.value,[i.ns.m("enable-row-transition")]:(i.store.states.data.value||[]).length!==0&&(i.store.states.data.value||[]).length<100,"has-footer":i.showSummary},i.ns.m(i.tableSize),i.className,i.ns.b(),i.ns.m(`layout-${i.tableLayout}`)]),style:vue.normalizeStyle(i.style),"data-prefix":i.ns.namespace.value,onMouseleave:n[0]||(n[0]=(...le)=>i.handleMouseLeave&&i.handleMouseLeave(...le))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("inner-wrapper")),style:vue.normalizeStyle(i.tableInnerStyle)},[vue.createElementVNode("div",_hoisted_2$l,[vue.renderSlot(i.$slots,"default")],512),i.showHeader&&i.tableLayout==="fixed"?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerWrapper",class:vue.normalizeClass(i.ns.e("header-wrapper"))},[vue.createElementVNode("table",{ref:"tableHeader",class:vue.normalizeClass(i.ns.e("header")),style:vue.normalizeStyle(i.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),vue.createVNode(oe,{ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"bodyWrapper",class:vue.normalizeClass(i.ns.e("body-wrapper"))},[vue.createVNode(Ce,{ref:"scrollBarRef","view-style":i.scrollbarViewStyle,"wrap-style":i.scrollbarStyle,always:i.scrollbarAlwaysOn},{default:vue.withCtx(()=>[vue.createElementVNode("table",{ref:"tableBody",class:vue.normalizeClass(i.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:vue.normalizeStyle({width:i.bodyWidth,tableLayout:i.tableLayout})},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),i.showHeader&&i.tableLayout==="auto"?(vue.openBlock(),vue.createBlock(oe,{key:0,ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):vue.createCommentVNode("v-if",!0),vue.createVNode(re,{context:i.context,highlight:i.highlightCurrentRow,"row-class-name":i.rowClassName,"tooltip-effect":i.tooltipEffect,"tooltip-options":i.tooltipOptions,"row-style":i.rowStyle,store:i.store,stripe:i.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"])],6),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"emptyBlock",style:vue.normalizeStyle(i.emptyBlockStyle),class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(i.computedEmptyText),1)])],2)],6)):vue.createCommentVNode("v-if",!0),i.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"appendWrapper",class:vue.normalizeClass(i.ns.e("append-wrapper"))},[vue.renderSlot(i.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),i.showSummary?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"footerWrapper",class:vue.normalizeClass(i.ns.e("footer-wrapper"))},[vue.createVNode(ie,{border:i.border,"default-sort":i.defaultSort,store:i.store,style:vue.normalizeStyle(i.tableBodyStyles),"sum-text":i.computedSumText,"summary-method":i.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[vue.vShow,!i.isEmpty],[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),i.border||i.isGroup?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.ns.e("border-left-patch"))},null,2)):vue.createCommentVNode("v-if",!0)],6),vue.withDirectives(vue.createElementVNode("div",{ref:"resizeProxy",class:vue.normalizeClass(i.ns.e("column-resize-proxy"))},null,2),[[vue.vShow,i.resizeProxyVisible]])],46,_hoisted_1$r)}var Table=_export_sfc$1(_sfc_main$C,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const defaultClassNames={selection:"table-column--selection",expand:"table__expand-column"},cellStarts={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},getDefaultClassName=i=>defaultClassNames[i]||"",cellForced={selection:{renderHeader({store:i}){function n(){return i.states.data.value&&i.states.data.value.length===0}return vue.h(ElCheckbox,{disabled:n(),size:i.states.tableSize.value,indeterminate:i.states.selection.value.length>0&&!i.states.isAllSelected.value,"onUpdate:modelValue":i.toggleAllSelection,modelValue:i.states.isAllSelected.value})},renderCell({row:i,column:n,store:r,$index:g}){return vue.h(ElCheckbox,{disabled:n.selectable?!n.selectable.call(null,i,g):!1,size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",i)},onClick:k=>k.stopPropagation(),modelValue:r.isSelected(i)})},sortable:!1,resizable:!1},index:{renderHeader({column:i}){return i.label||"#"},renderCell({column:i,$index:n}){let r=n+1;const g=i.index;return typeof g=="number"?r=n+g:typeof g=="function"&&(r=g(n)),vue.h("div",{},[r])},sortable:!1},expand:{renderHeader({column:i}){return i.label||""},renderCell({row:i,store:n,expanded:r}){const{ns:g}=n,k=[g.e("expand-icon")];r&&k.push(g.em("expand-icon","expanded"));const V=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:k,onClick:V},{default:()=>[vue.h(ElIcon,null,{default:()=>[vue.h(arrow_right_default)]})]})},sortable:!1,resizable:!1}};function defaultRenderCell({row:i,column:n,$index:r}){var g;const k=n.property,V=k&&getProp(i,k).value;return n&&n.formatter?n.formatter(i,n,V,r):((g=V==null?void 0:V.toString)==null?void 0:g.call(V))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:k}=r;if(!n)return g?[vue.h("span",{class:k.e("placeholder")})]:null;const V=[],$=function(oe){oe.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&V.push(vue.h("span",{class:k.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const oe=[k.e("expand-icon"),n.expanded?k.em("expand-icon","expanded"):""];let re=arrow_right_default;n.loading&&(re=loading_default),V.push(vue.h("div",{class:oe,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[k.is("loading")]:n.loading}},{default:()=>[vue.h(re)]})]}))}else V.push(vue.h("span",{class:k.e("placeholder")}));return V}function getAllAliases(i,n){return i.reduce((r,g)=>(r[g]=g,r),n)}function useWatcher(i,n){const r=vue.getCurrentInstance();return{registerComplexWatchers:()=>{const V=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&re==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&re==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[re]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const V=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[re]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),k=vue.ref(""),V=vue.ref(!1),$=vue.ref(),oe=vue.ref(),re=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{oe.value=i.headerAlign?`is-${i.headerAlign}`:$.value,oe.value});const Ce=vue.computed(()=>{let Fe=g.vnode.vParent||g.parent;for(;Fe&&!Fe.tableId&&!Fe.columnId;)Fe=Fe.vnode.vParent||Fe.parent;return Fe}),ie=vue.computed(()=>{const{store:Fe}=g.parent;if(!Fe)return!1;const{treeData:xe}=Fe.states,_e=xe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Fe=>(ae.value&&(Fe.width=ae.value),le.value&&(Fe.minWidth=le.value),!ae.value&&le.value&&(Fe.width=void 0),Fe.minWidth||(Fe.minWidth=80),Fe.realWidth=Number(Fe.width===void 0?Fe.minWidth:Fe.width),Fe),ue=Fe=>{const xe=Fe.type,_e=cellForced[xe]||{};Object.keys(_e).forEach($e=>{const Ue=_e[$e];$e!=="className"&&Ue!==void 0&&(Fe[$e]=Ue)});const Dt=getDefaultClassName(xe);if(Dt){const $e=`${vue.unref(re.namespace)}-${Dt}`;Fe.className=Fe.className?`${Fe.className} ${$e}`:$e}return Fe},de=Fe=>{Array.isArray(Fe)?Fe.forEach(_e=>xe(_e)):xe(Fe);function xe(_e){var Dt;((Dt=_e==null?void 0:_e.type)==null?void 0:Dt.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:k,realAlign:$,isSubColumn:V,realHeaderAlign:oe,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Fe=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Fe.type!=="selection"&&(Fe.renderHeader=_e=>{g.columnConfig.value.label;const Dt=n.header;return Dt?Dt(_e):Fe.label});let xe=Fe.renderCell;return Fe.type==="expand"?(Fe.renderCell=_e=>vue.h("div",{class:"cell"},[xe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(xe=xe||defaultRenderCell,Fe.renderCell=_e=>{let Dt=null;if(n.default){const qe=n.default(_e);Dt=qe.some(Lt=>Lt.type!==vue.Comment)?qe:xe(_e)}else Dt=xe(_e);const{columns:$e}=r.value.store.states,Ue=$e.value.findIndex(qe=>qe.type==="default"),Ve=ie.value&&_e.cellIndex===Ue,Oe=treeCellPrefix(_e,Ve),At={class:"cell",style:{}};return Fe.showOverflowTooltip&&(At.class=`${At.class} ${vue.unref(re.namespace)}-tooltip`,At.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(Dt),vue.h("div",At,[Oe,Dt])}),Fe},getPropsData:(...Fe)=>Fe.reduce((xe,_e)=>(Array.isArray(_e)&&_e.forEach(Dt=>{xe[Dt]=i[Dt]}),xe),{}),getColumnElIndex:(Fe,xe)=>Array.prototype.indexOf.call(Fe,xe),updateColumnOrder:()=>{r.value.store.commit("updateColumnOrder",g.columnConfig.value)}}}var defaultProps={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:i=>i.every(n=>["ascending","descending",null].includes(n))}};let columnIdSeed=1;var ElTableColumn$1=vue.defineComponent({name:"ElTableColumn",components:{ElCheckbox},props:defaultProps,setup(i,{slots:n}){const r=vue.getCurrentInstance(),g=vue.ref({}),k=vue.computed(()=>{let ze=r.parent;for(;ze&&!ze.tableId;)ze=ze.parent;return ze}),{registerNormalWatchers:V,registerComplexWatchers:$}=useWatcher(k,i),{columnId:oe,isSubColumn:re,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,k),pe=ie.value;oe.value=`${pe.tableId||pe.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{re.value=k.value!==pe;const ze=i.type||"default",Fe=i.sortable===""?!0:i.sortable,xe=isUndefined(i.showOverflowTooltip)?pe.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[ze],id:oe.value,type:ze,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:xe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Fe,index:i.index,rawColumnKey:r.vnode.key};let Oe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);Oe=mergeOptions(_e,Oe),Oe=compose(Ie,ae,le)(Oe),g.value=Oe,V(),$()}),vue.onMounted(()=>{var ze;const Fe=ie.value,xe=re.value?Fe.vnode.el.children:(ze=Fe.refs.hiddenColumns)==null?void 0:ze.children,_e=()=>de(xe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&k.value.store.commit("insertColumn",g.value,re.value?Fe.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{k.value.store.commit("removeColumn",g.value,re.value?pe.columnConfig.value:null,he)}),r.columnId=oe.value,r.columnConfig=g},render(){var i,n,r;try{const g=(n=(i=this.$slots).default)==null?void 0:n.call(i,{row:{},column:{},$index:-1}),k=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?k.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(oe=>{(oe==null?void 0:oe.patchFlag)!==1024&&!isString$1(oe==null?void 0:oe.children)&&k.push(oe)});return vue.h("div",k)}catch{return vue.h("div",[])}}});const ElTable=withInstall(Table,{TableColumn:ElTableColumn$1}),ElTableColumn=withNoopInstall(ElTableColumn$1),tabsRootContextKey=Symbol("tabsRootContextKey"),tabBarProps=buildProps({tabs:{type:definePropType(Array),default:()=>mutable([])}}),COMPONENT_NAME$3="ElTabBar",__default__$6=vue.defineComponent({name:COMPONENT_NAME$3}),_sfc_main$B=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const V=useNamespace("tabs"),$=vue.ref(),oe=vue.ref(),re=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(k.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const pe=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!pe)return!1;if(!de.active)return!0;ie=pe[`offset${capitalize(ue)}`],ae=pe[`client${capitalize(le)}`];const ze=window.getComputedStyle(pe);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(ze.paddingLeft)+Number.parseFloat(ze.paddingRight)),ie+=Number.parseFloat(ze.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>oe.value=re();return vue.watch(()=>r.tabs,async()=>{await vue.nextTick(),Ce()},{immediate:!0}),useResizeObserver($,()=>Ce()),n({ref:$,update:Ce}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"barRef",ref:$,class:vue.normalizeClass([vue.unref(V).e("active-bar"),vue.unref(V).is(vue.unref(k).props.tabPosition)]),style:vue.normalizeStyle(oe.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$B,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const tabNavProps=buildProps({panes:{type:definePropType(Array),default:()=>mutable([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),tabNavEmits={tabClick:(i,n,r)=>r instanceof Event,tabRemove:(i,n)=>n instanceof Event},COMPONENT_NAME$2="ElTabNav",TabNav=vue.defineComponent({name:COMPONENT_NAME$2,props:tabNavProps,emits:tabNavEmits,setup(i,{expose:n,emit:r}){const g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const V=useNamespace("tabs"),$=useDocumentVisibility(),oe=useWindowFocus(),re=vue.ref(),Ce=vue.ref(),ie=vue.ref(),ae=vue.ref(),le=vue.ref(!1),Ie=vue.ref(0),ue=vue.ref(!1),de=vue.ref(!0),Ne=vue.computed(()=>["top","bottom"].includes(k.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),pe=()=>{if(!re.value)return;const Ue=re.value[`offset${capitalize(Ne.value)}`],Ve=Ie.value;if(!Ve)return;const Oe=Ve>Ue?Ve-Ue:0;Ie.value=Oe},ze=()=>{if(!re.value||!Ce.value)return;const Ue=Ce.value[`offset${capitalize(Ne.value)}`],Ve=re.value[`offset${capitalize(Ne.value)}`],Oe=Ie.value;if(Ue-Oe<=Ve)return;const At=Ue-Oe>Ve*2?Oe+Ve:Ue-Ve;Ie.value=At},Fe=async()=>{const Ue=Ce.value;if(!le.value||!ie.value||!re.value||!Ue)return;await vue.nextTick();const Ve=ie.value.querySelector(".is-active");if(!Ve)return;const Oe=re.value,At=["top","bottom"].includes(k.props.tabPosition),qe=Ve.getBoundingClientRect(),Lt=Oe.getBoundingClientRect(),kt=At?Ue.offsetWidth-Lt.width:Ue.offsetHeight-Lt.height,jt=Ie.value;let ti=jt;At?(qe.left<Lt.left&&(ti=jt-(Lt.left-qe.left)),qe.right>Lt.right&&(ti=jt+qe.right-Lt.right)):(qe.top<Lt.top&&(ti=jt-(Lt.top-qe.top)),qe.bottom>Lt.bottom&&(ti=jt+(qe.bottom-Lt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,kt)},xe=()=>{var Ue;if(!Ce.value||!re.value)return;i.stretch&&((Ue=ae.value)==null||Ue.update());const Ve=Ce.value[`offset${capitalize(Ne.value)}`],Oe=re.value[`offset${capitalize(Ne.value)}`],At=Ie.value;Oe<Ve?(le.value=le.value||{},le.value.prev=At,le.value.next=At+Oe<Ve,Ve-At<Oe&&(Ie.value=Ve-Oe)):(le.value=!1,At>0&&(Ie.value=0))},_e=Ue=>{const Ve=Ue.code,{up:Oe,down:At,left:qe,right:Lt}=EVENT_CODE;if(![Oe,At,qe,Lt].includes(Ve))return;const kt=Array.from(Ue.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),jt=kt.indexOf(Ue.target);let ti;Ve===qe||Ve===Oe?jt===0?ti=kt.length-1:ti=jt-1:jt<kt.length-1?ti=jt+1:ti=0,kt[ti].focus({preventScroll:!0}),kt[ti].click(),Dt()},Dt=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Ue=>{Ue==="hidden"?de.value=!1:Ue==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(oe,Ue=>{Ue?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,xe),vue.onMounted(()=>setTimeout(()=>Fe(),0)),vue.onUpdated(()=>xe()),n({scrollToActiveTab:Fe,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Ue=le.value?[vue.createVNode("span",{class:[V.e("nav-prev"),V.is("disabled",!le.value.prev)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[V.e("nav-next"),V.is("disabled",!le.value.next)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ve=i.panes.map((Oe,At)=>{var qe,Lt,kt,jt;const ti=Oe.uid,ei=Oe.props.disabled,Pt=(Lt=(qe=Oe.props.name)!=null?qe:Oe.index)!=null?Lt:`${At}`,ni=!ei&&(Oe.isClosable||i.editable);Oe.index=`${At}`;const gi=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:ai=>r("tabRemove",Oe,ai)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,di=((jt=(kt=Oe.slots).label)==null?void 0:jt.call(kt))||Oe.props.label,li=!ei&&Oe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[V.e("item"),V.is(k.props.tabPosition),V.is("active",Oe.active),V.is("disabled",ei),V.is("closable",ni),V.is("focus",ue.value)],id:`tab-${Pt}`,key:`tab-${ti}`,"aria-controls":`pane-${Pt}`,role:"tab","aria-selected":Oe.active,tabindex:li,onFocus:()=>Dt(),onBlur:()=>$e(),onClick:ai=>{$e(),r("tabClick",Oe,Pt,ai)},onKeydown:ai=>{ni&&(ai.code===EVENT_CODE.delete||ai.code===EVENT_CODE.backspace)&&r("tabRemove",Oe,ai)}},[di,gi])});return vue.createVNode("div",{ref:ie,class:[V.e("nav-wrap"),V.is("scrollable",!!le.value),V.is(k.props.tabPosition)]},[Ue,vue.createVNode("div",{class:V.e("nav-scroll"),ref:re},[vue.createVNode("div",{class:[V.e("nav"),V.is(k.props.tabPosition),V.is("stretch",i.stretch&&["top","bottom"].includes(k.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ve])])])}}}),tabsProps=buildProps({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:definePropType(Function),default:()=>!0},stretch:Boolean}),isPaneName=i=>isString$1(i)||isNumber$1(i),tabsEmits={[UPDATE_MODEL_EVENT]:i=>isPaneName(i),tabClick:(i,n)=>n instanceof Event,tabChange:i=>isPaneName(i),edit:(i,n)=>["remove","add"].includes(n),tabRemove:i=>isPaneName(i),tabAdd:()=>!0};var Tabs=vue.defineComponent({name:"ElTabs",props:tabsProps,emits:tabsEmits,setup(i,{emit:n,slots:r,expose:g}){var k,V;const $=useNamespace("tabs"),{children:oe,addChild:re,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((V=(k=i.modelValue)!=null?k:i.activeName)!=null?V:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var pe,ze,Fe;if(!(ae.value===he||isUndefined(he)))try{await((pe=i.beforeLeave)==null?void 0:pe.call(i,he,ae.value))!==!1&&(le(he),(Fe=(ze=ie.value)==null?void 0:ze.removeFocus)==null||Fe.call(ze))}catch{}},ue=(he,pe,ze)=>{he.props.disabled||(Ie(pe),n("tabClick",he,ze))},de=(he,pe)=>{he.props.disabled||isUndefined(he.props.name)||(pe.stopPropagation(),n("edit",he.props.name,"remove"),n("tabRemove",he.props.name))},Ne=()=>{n("edit",void 0,"add"),n("tabAdd")};return useDeprecated({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},vue.computed(()=>!!i.activeName)),vue.watch(()=>i.activeName,he=>Ie(he)),vue.watch(()=>i.modelValue,he=>Ie(he)),vue.watch(ae,async()=>{var he;await vue.nextTick(),(he=ie.value)==null||he.scrollToActiveTab()}),vue.provide(tabsRootContextKey,{props:i,currentName:ae,registerPane:re,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Fe=>{Fe.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,pe=vue.createVNode("div",{class:[$.e("header"),$.is(i.tabPosition)]},[he,vue.createVNode(TabNav,{ref:ie,currentName:ae.value,editable:i.editable,type:i.type,panes:oe.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),ze=vue.createVNode("div",{class:$.e("content")},[vue.renderSlot(r,"default")]);return vue.createVNode("div",{class:[$.b(),$.m(i.tabPosition),{[$.m("card")]:i.type==="card",[$.m("border-card")]:i.type==="border-card"}]},[...i.tabPosition!=="bottom"?[pe,ze]:[ze,pe]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$q=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$A=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const V=useNamespace("tab-pane"),$=vue.ref(),oe=vue.computed(()=>n.closable||k.props.closable),re=computedEager(()=>{var Ie;return k.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(re.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||re.value);vue.watch(re,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:re,index:$,isClosable:oe});return vue.onMounted(()=>{k.registerPane(le)}),vue.onUnmounted(()=>{k.unregisterPane(le.uid)}),(Ie,ue)=>vue.unref(ae)?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,id:`pane-${vue.unref(ie)}`,class:vue.normalizeClass(vue.unref(V).b()),role:"tabpanel","aria-hidden":!vue.unref(re),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$q)),[[vue.vShow,vue.unref(re)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$A,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ElTabs=withInstall(Tabs,{TabPane}),ElTabPane=withNoopInstall(TabPane),NODE_KEY="$treeNodeId",markNodeData=function(i,n){!n||n[NODE_KEY]||Object.defineProperty(n,NODE_KEY,{value:i.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=function(i,n){return i?n[i]:n[NODE_KEY]},handleCurrentChange=(i,n,r)=>{const g=i.value.currentNode;r();const k=i.value.currentNode;g!==k&&n("current-change",k?k.data:null,k)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let k=0,V=i.length;k<V;k++){const $=i[k];($.checked!==!0||$.indeterminate)&&(n=!1,$.disabled||(g=!1)),($.checked!==!1||$.indeterminate)&&(r=!1)}return{all:n,none:r,allWithoutDisable:g,half:!n&&!r}},reInitChecked=function(i){if(i.childNodes.length===0||i.loading)return;const{all:n,none:r,half:g}=getChildState(i.childNodes);n?(i.checked=!0,i.indeterminate=!1):g?(i.checked=!1,i.indeterminate=!0):r&&(i.checked=!1,i.indeterminate=!1);const k=i.parent;!k||k.level===0||i.store.checkStrictly||reInitChecked(k)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},k=r[n];if(typeof k=="function")return k(g,i);if(typeof k=="string")return g[k];if(typeof k>"u"){const V=g[n];return V===void 0?"":V}};let nodeIdSeed=0;class Node{constructor(n){this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const n=this.store;if(!n)throw new Error("[Node]store is required!");n.registerNode(this);const r=n.props;if(r&&typeof r.isLeaf<"u"){const V=getPropertyFromData(this,"isLeaf");typeof V=="boolean"&&(this.isLeafByUser=V)}if(n.lazy!==!0&&this.data?(this.setData(this.data),n.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||markNodeData(this,this.data),!this.data)return;const g=n.defaultExpandedKeys,k=n.key;k&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),k&&n.currentNodeKey!==void 0&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(n){Array.isArray(n)||markNodeData(this,n),this.data=n,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=getPropertyFromData(this,"children")||[];for(let g=0,k=r.length;g<k;g++)this.insertChild({data:r[g]})}get label(){return getPropertyFromData(this,"label")}get key(){const n=this.store.key;return this.data?this.data[n]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return n.childNodes[r+1]}return null}get previousSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return r>0?n.childNodes[r-1]:null}return null}contains(n,r=!0){return(this.childNodes||[]).some(g=>g===n||r&&g.contains(n))}remove(){const n=this.parent;n&&n.removeChild(this)}insertChild(n,r,g){if(!n)throw new Error("InsertChild error: child is required.");if(!(n instanceof Node)){if(!g){const k=this.getChildren(!0);k.includes(n.data)||(typeof r>"u"||r<0?k.push(n.data):k.splice(r,0,n.data))}Object.assign(n,{parent:this,store:this.store}),n=vue.reactive(new Node(n)),n instanceof Node&&n.initialize()}n.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),this.updateLeafState()}insertBefore(n,r){let g;r&&(g=this.childNodes.indexOf(r)),this.insertChild(n,g)}insertAfter(n,r){let g;r&&(g=this.childNodes.indexOf(r),g!==-1&&(g+=1)),this.insertChild(n,g)}removeChild(n){const r=this.getChildren()||[],g=r.indexOf(n.data);g>-1&&r.splice(g,1);const k=this.childNodes.indexOf(n);k>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(k,1)),this.updateLeafState()}removeChildByData(n){let r=null;for(let g=0;g<this.childNodes.length;g++)if(this.childNodes[g].data===n){r=this.childNodes[g];break}r&&this.removeChild(r)}expand(n,r){const g=()=>{if(r){let k=this.parent;for(;k.level>0;)k.expanded=!0,k=k.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(k=>{k.canFocus=!0})};this.shouldLoadData()?this.loadData(k=>{Array.isArray(k)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),g())}):g()}doCreateChildren(n,r={}){n.forEach(g=>{this.insertChild(Object.assign({data:g},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(n=>{n.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const n=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!n||n.length===0;return}this.isLeaf=!1}setChecked(n,r,g,k){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:oe}=getChildState(this.childNodes);!this.isLeaf&&!$&&oe&&(this.checked=!1,n=!1);const re=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];k=k||n!==!1;const de=ue.disabled?ue.checked:k;ue.setChecked(de,r,!0,k)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{re(),reInitChecked(this)},{checked:n!==!1});return}else re()}const V=this.parent;!V||V.level===0||g||reInitChecked(V)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let k="children";return g&&(k=g.children||"children"),r[k]===void 0&&(r[k]=null),n&&!r[k]&&(r[k]=[]),r[k]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(V=>V.data),g={},k=[];n.forEach((V,$)=>{const oe=V[NODE_KEY];!!oe&&r.findIndex(Ce=>Ce[NODE_KEY]===oe)>=0?g[oe]={index:$,data:V}:k.push({index:$,data:V})}),this.store.lazy||r.forEach(V=>{g[V[NODE_KEY]]||this.removeChildByData(V)}),k.forEach(({index:V,data:$})=>{this.insertChild({data:$},V)}),this.updateLeafState()}loadData(n,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const g=k=>{this.childNodes=[],this.doCreateChildren(k,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,k)};this.store.load(this,g)}else n&&n.call(this)}}class TreeStore{constructor(n){this.currentNode=null,this.currentNodeKey=null;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.nodesMap={}}initialize(){if(this.root=new Node({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const n=this.load;n(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(n){const r=this.filterNodeMethod,g=this.lazy,k=function(V){const $=V.root?V.root.childNodes:V.childNodes;if($.forEach(oe=>{oe.visible=r.call(oe,n,oe.data,oe),k(oe)}),!V.visible&&$.length){let oe=!0;oe=!$.some(re=>re.visible),V.root?V.root.visible=oe===!1:V.visible=oe===!1}n&&V.visible&&!V.isLeaf&&!g&&V.expand()};k(this)}setData(n){n!==this.root.data?(this.root.setData(n),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(n){if(n instanceof Node)return n;const r=isObject$4(n)?getNodeKey(this.key,n):n;return this.nodesMap[r]||null}insertBefore(n,r){const g=this.getNode(r);g.parent.insertBefore({data:n},g)}insertAfter(n,r){const g=this.getNode(r);g.parent.insertAfter({data:n},g)}remove(n){const r=this.getNode(n);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(n,r){const g=r?this.getNode(r):this.root;g&&g.insertChild({data:n})}_initDefaultCheckedNodes(){const n=this.defaultCheckedKeys||[],r=this.nodesMap;n.forEach(g=>{const k=r[g];k&&k.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(n){(this.defaultCheckedKeys||[]).includes(n.key)&&n.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(n){n!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=n,this._initDefaultCheckedNodes())}registerNode(n){const r=this.key;!n||!n.data||(r?n.key!==void 0&&(this.nodesMap[n.key]=n):this.nodesMap[n.id]=n)}deregisterNode(n){!this.key||!n||!n.data||(n.childNodes.forEach(g=>{this.deregisterNode(g)}),delete this.nodesMap[n.key])}getCheckedNodes(n=!1,r=!1){const g=[],k=function(V){(V.root?V.root.childNodes:V.childNodes).forEach(oe=>{(oe.checked||r&&oe.indeterminate)&&(!n||n&&oe.isLeaf)&&g.push(oe.data),k(oe)})};return k(this),g}getCheckedKeys(n=!1){return this.getCheckedNodes(n).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const n=[],r=function(g){(g.root?g.root.childNodes:g.childNodes).forEach(V=>{V.indeterminate&&n.push(V.data),r(V)})};return r(this),n}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(n=>(n||{})[this.key])}_getAllNodes(){const n=[],r=this.nodesMap;for(const g in r)hasOwn$1(r,g)&&n.push(r[g]);return n}updateChildren(n,r){const g=this.nodesMap[n];if(!g)return;const k=g.childNodes;for(let V=k.length-1;V>=0;V--){const $=k[V];this.remove($.data)}for(let V=0,$=r.length;V<$;V++){const oe=r[V];this.append(oe,g.data)}}_setCheckedKeys(n,r=!1,g){const k=this._getAllNodes().sort((oe,re)=>re.level-oe.level),V=Object.create(null),$=Object.keys(g);k.forEach(oe=>oe.setChecked(!1,!1));for(let oe=0,re=k.length;oe<re;oe++){const Ce=k[oe],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!V[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)V[le.data[n]]=!0,le=le.parent;if(Ce.isLeaf||this.checkStrictly){Ce.setChecked(!0,!1);continue}if(Ce.setChecked(!0,!0),r){Ce.setChecked(!1,!1);const Ie=function(ue){ue.childNodes.forEach(Ne=>{Ne.isLeaf||Ne.setChecked(!1,!1),Ie(Ne)})};Ie(Ce)}}}setCheckedNodes(n,r=!1){const g=this.key,k={};n.forEach(V=>{k[(V||{})[g]]=!0}),this._setCheckedKeys(g,r,k)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,k={};n.forEach(V=>{k[V]=!0}),this._setCheckedKeys(g,r,k)}setDefaultExpandedKeys(n){n=n||[],this.defaultExpandedKeys=n,n.forEach(r=>{const g=this.getNode(r);g&&g.expand(null,this.autoExpandParent)})}setChecked(n,r,g){const k=this.getNode(n);k&&k.setChecked(!!r,g)}getCurrentNode(){return this.currentNode}setCurrentNode(n){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=n,this.currentNode.isCurrent=!0}setUserCurrentNode(n,r=!0){const g=n[this.key],k=this.nodesMap[g];this.setCurrentNode(k),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(n,r=!0){if(n==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const g=this.getNode(n);g&&(this.setCurrentNode(g),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const _sfc_main$z=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(i){const n=useNamespace("tree"),r=vue.inject("NodeInstance"),g=vue.inject("RootTree");return()=>{const k=i.node,{data:V,store:$}=k;return i.renderContent?i.renderContent(vue.h,{_self:r,node:k,data:V,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:k,data:V}):vue.h("span",{class:n.be("node","label")},[k.label])}}});var NodeContent=_export_sfc$1(_sfc_main$z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function useNodeExpandEventBroadcast(i){const n=vue.inject("TreeNodeMap",null),r={treeNodeExpand:g=>{i.node!==g&&i.node.collapse()},children:[]};return n&&n.children.push(r),vue.provide("TreeNodeMap",r),{broadcastExpanded:g=>{if(i.accordion)for(const k of r.children)k.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:k}){const V=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),oe=({event:ie,treeNode:ae})=>{if(typeof i.allowDrag=="function"&&!i.allowDrag(ae.node))return ie.preventDefault(),!1;ie.dataTransfer.effectAllowed="move";try{ie.dataTransfer.setData("text/plain","")}catch{}$.value.draggingNode=ae,n.emit("node-drag-start",ae.node,ie)},re=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,V.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,pe=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),pe=Ne=i.allowDrop(ue.node,le.node,"inner"),he=i.allowDrop(ue.node,le.node,"next")),ie.dataTransfer.dropEffect=Ne||de||he?"move":"none",(de||Ne||he)&&(Ie==null?void 0:Ie.node.id)!==le.node.id&&(Ie&&n.emit("node-drag-leave",ue.node,Ie.node,ie),n.emit("node-drag-enter",ue.node,le.node,ie)),(de||Ne||he)&&($.value.dropNode=le),le.node.nextSibling===ue.node&&(he=!1),le.node.previousSibling===ue.node&&(de=!1),le.node.contains(ue.node,!1)&&(Ne=!1),(ue.node===le.node||ue.node.contains(le.node))&&(de=!1,Ne=!1,he=!1);const ze=le.$el.getBoundingClientRect(),Fe=r.value.getBoundingClientRect();let xe;const _e=de?Ne?.25:he?.45:1:-1,Dt=he?Ne?.75:de?.55:0:1;let $e=-9999;const Ue=ie.clientY-ze.top;Ue<ze.height*_e?xe="before":Ue>ze.height*Dt?xe="after":Ne?xe="inner":xe="none";const Ve=le.$el.querySelector(`.${V.be("node","expand-icon")}`).getBoundingClientRect(),Oe=g.value;xe==="before"?$e=Ve.top-Fe.top:xe==="after"&&($e=Ve.bottom-Fe.top),Oe.style.top=`${$e}px`,Oe.style.left=`${Ve.right-Fe.left}px`,xe==="inner"?addClass(le.$el,V.is("drop-inner")):removeClass(le.$el,V.is("drop-inner")),$.value.showDropIndicator=xe==="before"||xe==="after",$.value.allowDrop=$.value.showDropIndicator||pe,$.value.dropType=xe,n.emit("node-drag-over",ue.node,le.node,ie)},Ce=ie=>{const{draggingNode:ae,dropType:le,dropNode:Ie}=$.value;if(ie.preventDefault(),ie.dataTransfer.dropEffect="move",ae&&Ie){const ue={data:ae.node.data};le!=="none"&&ae.node.remove(),le==="before"?Ie.node.parent.insertBefore(ue,Ie.node):le==="after"?Ie.node.parent.insertAfter(ue,Ie.node):le==="inner"&&Ie.node.insertChild(ue),le!=="none"&&k.value.registerNode(ue),removeClass(Ie.$el,V.is("drop-inner")),n.emit("node-drag-end",ae.node,Ie.node,le,ie),le!=="none"&&n.emit("node-drop",ae.node,Ie.node,le,ie)}ae&&!Ie&&n.emit("node-drag-end",ae.node,null,le,ie),$.value.showDropIndicator=!1,$.value.draggingNode=null,$.value.dropNode=null,$.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:oe,treeNodeDragOver:re,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$y=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:_CollapseTransition,ElCheckbox,NodeContent,ElIcon,Loading:loading_default},props:{node:{type:Node,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(i,n){const r=useNamespace("tree"),{broadcastExpanded:g}=useNodeExpandEventBroadcast(i),k=vue.inject("RootTree"),V=vue.ref(!1),$=vue.ref(!1),oe=vue.ref(null),re=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),k||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(V.value=!0,$.value=!0);const le=k.props.children||"children";vue.watch(()=>{const Ue=i.node.data[le];return Ue&&[...Ue]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Ue=>{de(i.node.checked,Ue)}),vue.watch(()=>i.node.checked,Ue=>{de(Ue,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Ue=>{vue.nextTick(()=>V.value=Ue),Ue&&($.value=!0)});const Ie=Ue=>getNodeKey(k.props.nodeKey,Ue.data),ue=Ue=>{const Ve=i.props.class;if(!Ve)return{};let Oe;if(isFunction$2(Ve)){const{data:At}=Ue;Oe=Ve(At,Ue)}else Oe=Ve;return isString$1(Oe)?{[Oe]:!0}:Oe},de=(Ue,Ve)=>{(oe.value!==Ue||re.value!==Ve)&&k.ctx.emit("check-change",i.node.data,Ue,Ve),oe.value=Ue,re.value=Ve},Ne=Ue=>{handleCurrentChange(k.store,k.ctx.emit,()=>k.store.value.setCurrentNode(i.node)),k.currentNode.value=i.node,k.props.expandOnClickNode&&pe(),k.props.checkOnClickNode&&!i.node.disabled&&ze(null,{target:{checked:!i.node.checked}}),k.ctx.emit("node-click",i.node.data,i.node,ae,Ue)},he=Ue=>{k.instance.vnode.props.onNodeContextmenu&&(Ue.stopPropagation(),Ue.preventDefault()),k.ctx.emit("node-contextmenu",Ue,i.node.data,i.node,ae)},pe=()=>{i.node.isLeaf||(V.value?(k.ctx.emit("node-collapse",i.node.data,i.node,ae),i.node.collapse()):(i.node.expand(),n.emit("node-expand",i.node.data,i.node,ae)))},ze=(Ue,Ve)=>{i.node.setChecked(Ve.target.checked,!k.props.checkStrictly),vue.nextTick(()=>{const Oe=k.store.value;k.ctx.emit("check",i.node.data,{checkedNodes:Oe.getCheckedNodes(),checkedKeys:Oe.getCheckedKeys(),halfCheckedNodes:Oe.getHalfCheckedNodes(),halfCheckedKeys:Oe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:k,expanded:V,childNodeRendered:$,oldChecked:oe,oldIndeterminate:re,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:pe,handleCheckChange:ze,handleChildNodeExpand:(Ue,Ve,Oe)=>{g(Ve),k.ctx.emit("node-expand",Ue,Ve,Oe)},handleDragStart:Ue=>{k.props.draggable&&ie.treeNodeDragStart({event:Ue,treeNode:i})},handleDragOver:Ue=>{Ue.preventDefault(),k.props.draggable&&ie.treeNodeDragOver({event:Ue,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Ue=>{Ue.preventDefault()},handleDragEnd:Ue=>{k.props.draggable&&ie.treeNodeDragEnd(Ue)},CaretRight:caret_right_default}}}),_hoisted_1$p=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$3(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("loading"),Ce=vue.resolveComponent("node-content"),ie=vue.resolveComponent("el-tree-node"),ae=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([i.ns.b("node"),i.ns.is("expanded",i.expanded),i.ns.is("current",i.node.isCurrent),i.ns.is("hidden",!i.node.visible),i.ns.is("focusable",!i.node.disabled),i.ns.is("checked",!i.node.disabled&&i.node.checked),i.getNodeClass(i.node)]),role:"treeitem",tabindex:"-1","aria-expanded":i.expanded,"aria-disabled":i.node.disabled,"aria-checked":i.node.checked,draggable:i.tree.props.draggable,"data-key":i.getNodeKey(i.node),onClick:n[1]||(n[1]=vue.withModifiers((...le)=>i.handleClick&&i.handleClick(...le),["stop"])),onContextmenu:n[2]||(n[2]=(...le)=>i.handleContextMenu&&i.handleContextMenu(...le)),onDragstart:n[3]||(n[3]=vue.withModifiers((...le)=>i.handleDragStart&&i.handleDragStart(...le),["stop"])),onDragover:n[4]||(n[4]=vue.withModifiers((...le)=>i.handleDragOver&&i.handleDragOver(...le),["stop"])),onDragend:n[5]||(n[5]=vue.withModifiers((...le)=>i.handleDragEnd&&i.handleDragEnd(...le),["stop"])),onDrop:n[6]||(n[6]=vue.withModifiers((...le)=>i.handleDrop&&i.handleDrop(...le),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(i.node.level-1)*i.tree.props.indent+"px"})},[i.tree.props.icon||i.CaretRight?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.be("node","expand-icon"),i.ns.is("leaf",i.node.isLeaf),{expanded:!i.node.isLeaf&&i.expanded}]),onClick:vue.withModifiers(i.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.tree.props.icon||i.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.showCheckbox?(vue.openBlock(),vue.createBlock(oe,{key:1,"model-value":i.node.checked,indeterminate:i.node.indeterminate,disabled:!!i.node.disabled,onClick:n[0]||(n[0]=vue.withModifiers(()=>{},["stop"])),onChange:i.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),i.node.loading?(vue.openBlock(),vue.createBlock($,{key:2,class:vue.normalizeClass([i.ns.be("node","loading-icon"),i.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(re)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(Ce,{node:i.node,"render-content":i.renderContent},null,8,["node","render-content"])],6),vue.createVNode(ae,null,{default:vue.withCtx(()=>[!i.renderAfterExpand||i.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("node","children")),role:"group","aria-expanded":i.expanded},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.node.childNodes,le=>(vue.openBlock(),vue.createBlock(ie,{key:i.getNodeKey(le),"render-content":i.renderContent,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,node:le,accordion:i.accordion,props:i.props,onNodeExpand:i.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$k)),[[vue.vShow,i.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$p)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$y,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function useKeydown({el$:i},n){const r=useNamespace("tree"),g=vue.shallowRef([]),k=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(k,oe=>{oe.forEach(re=>{re.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",oe=>{const re=oe.target;if(!re.className.includes(r.b("node")))return;const Ce=oe.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(re);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(oe.preventDefault(),Ce===EVENT_CODE.up){ae=ie===-1?0:ie!==0?ie-1:g.value.length-1;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae--,ae===Ie){ae=-1;break}ae<0&&(ae=g.value.length-1)}}else{ae=ie===-1?0:ie<g.value.length-1?ie+1:0;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae++,ae===Ie){ae=-1;break}ae>=g.value.length&&(ae=0)}}ae!==-1&&g.value[ae].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(Ce)&&(oe.preventDefault(),re.click());const le=re.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(oe.preventDefault(),le.click())});const $=()=>{var oe;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const re=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(re.length){re[0].setAttribute("tabindex","0");return}(oe=g.value[0])==null||oe.setAttribute("tabindex","0")}}const _sfc_main$x=vue.defineComponent({name:"ElTree",components:{ElTreeNode},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(i,n){const{t:r}=useLocale(),g=useNamespace("tree"),k=vue.ref(new TreeStore({key:i.nodeKey,data:i.data,lazy:i.lazy,props:i.props,load:i.load,currentNodeKey:i.currentNodeKey,checkStrictly:i.checkStrictly,checkDescendants:i.checkDescendants,defaultCheckedKeys:i.defaultCheckedKeys,defaultExpandedKeys:i.defaultExpandedKeys,autoExpandParent:i.autoExpandParent,defaultExpandAll:i.defaultExpandAll,filterNodeMethod:i.filterNodeMethod}));k.value.initialize();const V=vue.ref(k.value.root),$=vue.ref(null),oe=vue.ref(null),re=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:oe,dropIndicator$:re,store:k});useKeydown({el$:oe},k);const ae=vue.computed(()=>{const{childNodes:ti}=V.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{k.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{k.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{k.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{k.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{k.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");k.value.filter(ti)},Ie=ti=>getNodeKey(i.nodeKey,ti.data),ue=ti=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const ei=k.value.getNode(ti);if(!ei)return[];const Pt=[ei.data];let ni=ei.parent;for(;ni&&ni!==V.value;)Pt.push(ni.data),ni=ni.parent;return Pt.reverse()},de=(ti,ei)=>k.value.getCheckedNodes(ti,ei),Ne=ti=>k.value.getCheckedKeys(ti),he=()=>{const ti=k.value.getCurrentNode();return ti?ti.data:null},pe=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},ze=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");k.value.setCheckedNodes(ti,ei)},Fe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");k.value.setCheckedKeys(ti,ei)},xe=(ti,ei,Pt)=>{k.value.setChecked(ti,ei,Pt)},_e=()=>k.value.getHalfCheckedNodes(),Dt=()=>k.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(k,n.emit,()=>k.value.setUserCurrentNode(ti,ei))},Ue=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(k,n.emit,()=>k.value.setCurrentNodeKey(ti,ei))},Ve=ti=>k.value.getNode(ti),Oe=ti=>{k.value.remove(ti)},At=(ti,ei)=>{k.value.append(ti,ei)},qe=(ti,ei)=>{k.value.insertBefore(ti,ei)},Lt=(ti,ei)=>{k.value.insertAfter(ti,ei)},kt=(ti,ei,Pt)=>{Ce(ei),n.emit("node-expand",ti,ei,Pt)},jt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");k.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:k,root:V,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:k,root:V,currentNode:$,dragState:ie,el$:oe,dropIndicator$:re,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:pe,setCheckedNodes:ze,setCheckedKeys:Fe,setChecked:xe,getHalfCheckedNodes:_e,getHalfCheckedKeys:Dt,setCurrentNode:$e,setCurrentKey:Ue,t:r,getNode:Ve,remove:Oe,append:At,insertBefore:qe,insertAfter:Lt,handleNodeExpand:kt,updateKeyChildren:jt}}});function _sfc_render$2(i,n,r,g,k,V){const $=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([i.ns.b(),i.ns.is("dragging",!!i.dragState.draggingNode),i.ns.is("drop-not-allow",!i.dragState.allowDrop),i.ns.is("drop-inner",i.dragState.dropType==="inner"),{[i.ns.m("highlight-current")]:i.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.root.childNodes,oe=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(oe),node:oe,props:i.props,accordion:i.accordion,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,"render-content":i.renderContent,onNodeExpand:i.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.renderSlot(i.$slots,"empty",{},()=>{var oe;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((oe=i.emptyText)!=null?oe:i.t("el.tree.emptyText")),3)]})],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(i.ns.e("drop-indicator"))},null,2),[[vue.vShow,i.dragState.showDropIndicator]])],2)}var Tree=_export_sfc$1(_sfc_main$x,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Tree.install=i=>{i.component(Tree.name,Tree)};const _Tree=Tree,ElTree=_Tree,uploadContextKey=Symbol("uploadContextKey"),SCOPE$1="ElUpload";class UploadAjaxError extends Error{constructor(n,r,g,k){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=k}}function getError(i,n,r){let g;return r.response?g=`${r.response.error||r.response}`:r.responseText?g=`${r.responseText}`:g=`fail to ${n.method} ${i} ${r.status}`,new UploadAjaxError(g,r.status,n.method,i)}function getBody(i){const n=i.responseText||i.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}const ajaxUpload=i=>{typeof XMLHttpRequest>"u"&&throwError$1(SCOPE$1,"XMLHttpRequest is undefined");const n=new XMLHttpRequest,r=i.action;n.upload&&n.upload.addEventListener("progress",V=>{const $=V;$.percent=V.total>0?V.loaded/V.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[V,$]of Object.entries(i.data))Array.isArray($)?g.append(V,...$):g.append(V,$);g.append(i.filename,i.file,i.file.name),n.addEventListener("error",()=>{i.onError(getError(r,i,n))}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300)return i.onError(getError(r,i,n));i.onSuccess(getBody(n))}),n.open(i.method,r,!0),i.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);const k=i.headers||{};if(k instanceof Headers)k.forEach((V,$)=>n.setRequestHeader($,V));else for(const[V,$]of Object.entries(k))isNil($)||n.setRequestHeader(V,String($));return n.send(g),n},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>mutable({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:Boolean,limit:Number}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:!1},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"}}),uploadListEmits={remove:i=>!!i},_hoisted_1$o=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$b=["title"],_hoisted_5$a=["onClick"],_hoisted_6$7=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$w=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),k=useNamespace("icon"),V=useNamespace("list"),$=useFormDisabled(),oe=vue.ref(!1),re=Ce=>{n("remove",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass([vue.unref(g).b("list"),vue.unref(g).bm("list",Ce.listType),vue.unref(g).is("disabled",vue.unref($))]),name:vue.unref(V).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.files,ae=>(vue.openBlock(),vue.createElementBlock("li",{key:ae.uid||ae.name,class:vue.normalizeClass([vue.unref(g).be("list","item"),vue.unref(g).is(ae.status),{focusing:oe.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&re(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>oe.value=!0),onBlur:ie[1]||(ie[1]=le=>oe.value=!1),onClick:ie[2]||(ie[2]=le=>oe.value=!1)},[vue.renderSlot(Ce.$slots,"default",{file:ae},()=>[Ce.listType==="picture"||ae.status!=="uploading"&&Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-thumbnail")),src:ae.url,alt:""},null,10,_hoisted_2$j)):vue.createCommentVNode("v-if",!0),ae.status==="uploading"||Ce.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(g).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(g).be("list","item-name")),onClick:vue.withModifiers(le=>Ce.handlePreview(ae),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-file-name")),title:ae.name},vue.toDisplayString(ae.name),11,_hoisted_4$b)],10,_hoisted_3$f),ae.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ce.listType==="picture-card"?"circle":"line","stroke-width":Ce.listType==="picture-card"?6:2,percentage:Number(ae.percentage),style:vue.normalizeStyle(Ce.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(g).be("list","item-status-label"))},[Ce.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ce.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).m("close")),onClick:le=>re(ae)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:2},1032,["class","onClick"])),vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),vue.createCommentVNode(" This is a bug which needs to be fixed "),vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(k).m("close-tip"))},vue.toDisplayString(vue.unref(r)("el.upload.deleteTip")),3)),Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(g).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-preview")),onClick:le=>Ce.handlePreview(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-delete")),onClick:le=>re(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$7))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$o))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$w,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const uploadDraggerProps=buildProps({disabled:{type:Boolean,default:!1}}),uploadDraggerEmits={file:i=>isArray$3(i)},_hoisted_1$n=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$v=vue.defineComponent({...__default__$3,props:uploadDraggerProps,emits:uploadDraggerEmits,setup(i,{emit:n}){const r=vue.inject(uploadContextKey);r||throwError$1(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const g=useNamespace("upload"),k=vue.ref(!1),V=useFormDisabled(),$=re=>{if(V.value)return;k.value=!1,re.stopPropagation();const Ce=Array.from(re.dataTransfer.files),ie=r.accept.value;if(!ie){n("file",Ce);return}const ae=Ce.filter(le=>{const{type:Ie,name:ue}=le,de=ue.includes(".")?`.${ue.split(".").pop()}`:"",Ne=Ie.replace(/\/.*$/,"");return ie.split(",").map(he=>he.trim()).filter(he=>he).some(he=>he.startsWith(".")?de===he:/\/\*$/.test(he)?Ne===he.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(he)?Ie===he:!1)});n("file",ae)},oe=()=>{V.value||(k.value=!0)};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",k.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(oe,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>k.value=!1,["prevent"]))},[vue.renderSlot(re.$slots,"default")],42,_hoisted_1$n))}});var UploadDragger=_export_sfc$1(_sfc_main$v,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),_hoisted_1$m=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$u=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),k=useFormDisabled(),V=vue.shallowRef({}),$=vue.shallowRef(),oe=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:pe,onStart:ze,onExceed:Fe}=r;if(Ne&&he.length+ue.length>Ne){Fe(ue,he);return}pe||(ue=ue.slice(0,1));for(const xe of ue){const _e=xe;_e.uid=genFileId(),ze(_e),de&&re(_e)}},re=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const pe=r.data,ze=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await ze,isObject$4(r.data)&&isEqual(pe,Ne)&&(Ne=cloneDeep(r.data))}catch{de=!1}if(de===!1){r.onRemove(ue);return}let he=ue;de instanceof Blob&&(de instanceof File?he=de:he=new File([de],ue.name,{type:ue.type})),Ce(Object.assign(he,{uid:ue.uid}),Ne)},Ce=(ue,de)=>{const{headers:Ne,data:he,method:pe,withCredentials:ze,name:Fe,action:xe,onProgress:_e,onSuccess:Dt,onError:$e,httpRequest:Ue}=r,{uid:Ve}=ue,Oe={headers:Ne||{},withCredentials:ze,file:ue,data:de??he,method:pe,filename:Fe,action:xe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{Dt(qe,ue),delete V.value[Ve]},onError:qe=>{$e(qe,ue),delete V.value[Ve]}},At=Ue(Oe);V.value[Ve]=At,At instanceof Promise&&At.then(Oe.onSuccess,Oe.onError)},ie=ue=>{const de=ue.target.files;de&&oe(Array.from(de))},ae=()=>{k.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(V.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete V.value[Ne]})},upload:re}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b(),vue.unref(g).m(ue.listType),vue.unref(g).is("drag",ue.drag)]),tabindex:"0",onClick:ae,onKeydown:vue.withKeys(vue.withModifiers(le,["self"]),["enter","space"])},[ue.drag?(vue.openBlock(),vue.createBlock(UploadDragger,{key:0,disabled:vue.unref(k),onFile:oe},{default:vue.withCtx(()=>[vue.renderSlot(ue.$slots,"default")]),_:3},8,["disabled"])):vue.renderSlot(ue.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:$,class:vue.normalizeClass(vue.unref(g).e("input")),name:ue.name,multiple:ue.multiple,accept:ue.accept,type:"file",onChange:ie,onClick:de[0]||(de[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$i)],42,_hoisted_1$m))}});var UploadContent=_export_sfc$1(_sfc_main$u,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const SCOPE="ElUpload",revokeObjectURL=i=>{var n;(n=i.url)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(i.url)},useHandlers=(i,n)=>{const r=useVModel(i,"fileList",void 0,{passive:!0}),g=le=>r.value.find(Ie=>Ie.uid===le.uid);function k(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function V(le=["ready","uploading","success","fail"]){r.value=r.value.filter(Ie=>!le.includes(Ie.status))}const $=(le,Ie)=>{const ue=g(Ie);ue&&(console.error(le),ue.status="fail",r.value.splice(r.value.indexOf(ue),1),i.onError(le,ue,r.value),i.onChange(ue,r.value))},oe=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},re=(le,Ie)=>{const ue=g(Ie);ue&&(ue.status="success",ue.response=le,i.onSuccess(le,ue,r.value),i.onChange(ue,r.value))},Ce=le=>{isNil(le.uid)&&(le.uid=genFileId());const Ie={name:le.name,percentage:0,status:"ready",size:le.size,raw:le,uid:le.uid};if(i.listType==="picture-card"||i.listType==="picture")try{Ie.url=URL.createObjectURL(le)}catch(ue){debugWarn(SCOPE,ue.message),i.onError(ue,Ie,r.value)}r.value=[...r.value,Ie],i.onChange(Ie,r.value)},ie=async le=>{const Ie=le instanceof File?g(le):le;Ie||throwError$1(SCOPE,"file to be removed not found");const ue=de=>{k(de);const Ne=r.value;Ne.splice(Ne.indexOf(de),1),i.onRemove(de,Ne),revokeObjectURL(de)};i.beforeRemove?await i.beforeRemove(Ie,r.value)!==!1&&ue(Ie):ue(Ie)};function ae(){r.value.filter(({status:le})=>le==="ready").forEach(({raw:le})=>{var Ie;return le&&((Ie=n.value)==null?void 0:Ie.upload(le))})}return vue.watch(()=>i.listType,le=>{le!=="picture-card"&&le!=="picture"||(r.value=r.value.map(Ie=>{const{raw:ue,url:de}=Ie;if(!de&&ue)try{Ie.url=URL.createObjectURL(ue)}catch(Ne){i.onError(Ne,Ie,r.value)}return Ie}))}),vue.watch(r,le=>{for(const Ie of le)Ie.uid||(Ie.uid=genFileId()),Ie.status||(Ie.status="success")},{immediate:!0,deep:!0}),{uploadFiles:r,abort:k,clearFiles:V,handleError:$,handleProgress:oe,handleStart:Ce,handleSuccess:re,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$t=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),k=useFormDisabled(),V=vue.shallowRef(),{abort:$,submit:oe,clearFiles:re,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,V),de=vue.computed(()=>r.listType==="picture-card"),Ne=vue.computed(()=>({...r,fileList:Ce.value,onStart:ie,onProgress:ue,onSuccess:Ie,onError:ae,onRemove:le}));return vue.onBeforeUnmount(()=>{Ce.value.forEach(({url:he})=>{he!=null&&he.startsWith("blob:")&&URL.revokeObjectURL(he)})}),vue.provide(uploadContextKey,{accept:vue.toRef(r,"accept")}),n({abort:$,submit:oe,clearFiles:re,handleStart:ie,handleRemove:le}),(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(UploadContent,vue.mergeProps({ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!vue.unref(de)||vue.unref(de)&&!he.showFileList?(vue.openBlock(),vue.createBlock(UploadContent,vue.mergeProps({key:1,ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),he.$slots.trigger?vue.renderSlot(he.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(he.$slots,"tip"),!vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:3,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$t,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const ElUpload=withInstall(Upload),messageTypes=["success","info","warning","error"],messageDefaults=mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},center:{type:Boolean,default:messageDefaults.center},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),required:!1},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},offset:{type:Number,default:messageDefaults.offset},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},instances$2=vue.shallowReactive([]),getInstance=i=>{const n=instances$2.findIndex(k=>k.id===i),r=instances$2[n];let g;return n>0&&(g=instances$2[n-1]),{current:r,prev:g}},getLastOffset=i=>{const{prev:n}=getInstance(i);return n?n.vm.exposed.bottom.value:0},getOffsetOrSpace=(i,n)=>instances$2.findIndex(g=>g.id===i)>0?20:n,_hoisted_1$l=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$s=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:k,zIndex:V}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:oe}=V,re=vue.ref(),Ce=vue.ref(!1),ie=vue.ref(0);let ae;const le=vue.computed(()=>r.type?r.type==="error"?"danger":r.type:"info"),Ie=vue.computed(()=>{const Dt=r.type;return{[k.bm("icon",Dt)]:Dt&&TypeComponentsMap[Dt]}}),ue=vue.computed(()=>r.icon||TypeComponentsMap[r.type]||""),de=vue.computed(()=>getLastOffset(r.id)),Ne=vue.computed(()=>getOffsetOrSpace(r.id,r.offset)+de.value),he=vue.computed(()=>ie.value+Ne.value),pe=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function ze(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{xe()},r.duration))}function Fe(){ae==null||ae()}function xe(){Ce.value=!1}function _e({code:Dt}){Dt===EVENT_CODE.esc&&xe()}return vue.onMounted(()=>{ze(),oe(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Fe(),ze()}),useEventListener(document,"keydown",_e),useResizeObserver(re,()=>{ie.value=re.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:xe}),(Dt,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(k).b("fade"),onBeforeLeave:Dt.onClose,onAfterLeave:$e[0]||($e[0]=Ue=>Dt.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Dt.id,ref_key:"messageRef",ref:re,class:vue.normalizeClass([vue.unref(k).b(),{[vue.unref(k).m(Dt.type)]:Dt.type&&!Dt.icon},vue.unref(k).is("center",Dt.center),vue.unref(k).is("closable",Dt.showClose),Dt.customClass]),style:vue.normalizeStyle(vue.unref(pe)),role:"alert",onMouseenter:Fe,onMouseleave:ze},[Dt.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Dt.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(k).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),vue.unref(ue)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).e("icon"),vue.unref(Ie)])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(ue))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Dt.$slots,"default",{},()=>[Dt.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(k).e("content")),innerHTML:Dt.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(k).e("content"))},vue.toDisplayString(Dt.message),3))]),Dt.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).e("closeBtn")),onClick:vue.withModifiers(xe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$l),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$s,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let seed=1;const normalizeOptions=i=>{const n=!i||isString$1(i)||vue.isVNode(i)||isFunction$2(i)?{message:i}:i,r={...messageDefaults,...n};if(!r.appendTo)r.appendTo=document.body;else if(isString$1(r.appendTo)){let g=document.querySelector(r.appendTo);isElement(g)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),g=document.body),r.appendTo=g}return r},closeMessage=i=>{const n=instances$2.indexOf(i);if(n===-1)return;instances$2.splice(n,1);const{handler:r}=i;r.close()},createMessage=({appendTo:i,...n},r)=>{const g=`message_${seed++}`,k=n.onClose,V=document.createElement("div"),$={...n,id:g,onClose:()=>{k==null||k(),closeMessage(ie)},onDestroy:()=>{vue.render(null,V)}},oe=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);oe.appContext=r||message._context,vue.render(oe,V),i.appendChild(V.firstElementChild);const re=oe.component,ie={id:g,vnode:oe,vm:re,handler:{close:()=>{re.exposed.visible.value=!1}},props:oe.component.props};return ie},message=(i={},n)=>{if(!isClient)return{close:()=>{}};if(isNumber$1(messageConfig.max)&&instances$2.length>=messageConfig.max)return{close:()=>{}};const r=normalizeOptions(i);if(r.grouping&&instances$2.length){const k=instances$2.find(({vnode:V})=>{var $;return(($=V.props)==null?void 0:$.message)===r.message});if(k)return k.props.repeatNum+=1,k.props.type=r.type,k.handler}const g=createMessage(r,n);return instances$2.push(g),g.handler};messageTypes.forEach(i=>{message[i]=(n={},r)=>{const g=normalizeOptions(n);return message({...g,type:i},r)}});function closeAll(i){for(const n of instances$2)(!i||i===n.props.type)&&n.handler.close()}message.closeAll=closeAll,message._context=null;const ElMessage=withInstallFunction(message,"$message"),_sfc_main$r=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:n}){const{locale:r,zIndex:g,ns:k,size:V}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:oe}=g,re=vue.ref(!1),Ce=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:oe()}),ie=vue.computed(()=>{const kt=Ce.type;return{[k.bm("icon",kt)]:kt&&TypeComponentsMap[kt]}}),ae=useId(),le=useId(),Ie=vue.computed(()=>Ce.icon||TypeComponentsMap[Ce.type]||""),ue=vue.computed(()=>!!Ce.message),de=vue.ref(),Ne=vue.ref(),he=vue.ref(),pe=vue.ref(),ze=vue.ref(),Fe=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async kt=>{await vue.nextTick(),i.boxType==="prompt"&&kt!==null&&Oe()},{immediate:!0}),vue.watch(()=>re.value,kt=>{var jt,ti;kt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(jt=ze.value)==null?void 0:jt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=oe()),i.boxType==="prompt"&&(kt?vue.nextTick().then(()=>{var ei;pe.value&&pe.value.$el&&(Ce.autofocus?he.value=(ei=At())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const xe=vue.computed(()=>i.draggable);useDraggable(de,Ne,xe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){re.value&&(re.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const Dt=()=>{i.closeOnClickModal&&Ve(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(Dt),Ue=kt=>{if(Ce.inputType!=="textarea")return kt.preventDefault(),Ve("confirm")},Ve=kt=>{var jt;i.boxType==="prompt"&&kt==="confirm"&&!Oe()||(Ce.action=kt,Ce.beforeClose?(jt=Ce.beforeClose)==null||jt.call(Ce,kt,Ce,_e):_e())},Oe=()=>{if(i.boxType==="prompt"){const kt=Ce.inputPattern;if(kt&&!kt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const jt=Ce.inputValidator;if(typeof jt=="function"){const ti=jt(Ce.inputValue);if(ti===!1)return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;if(typeof ti=="string")return Ce.editorErrorMessage=ti,Ce.validateError=!0,!1}}return Ce.editorErrorMessage="",Ce.validateError=!1,!0},At=()=>{const kt=pe.value.$refs;return kt.input||kt.textarea},qe=()=>{Ve("close")},Lt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(re),{...vue.toRefs(Ce),ns:k,overlayEvent:$e,visible:re,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:V,iconComponent:Ie,confirmButtonClasses:Fe,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:pe,confirmRef:ze,doClose:_e,handleClose:qe,onCloseRequested:Lt,handleWrapperClick:Dt,handleInputEnter:Ue,handleAction:Ve,t:$}}}),_hoisted_1$k=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render$1(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("close"),re=vue.resolveComponent("el-input"),Ce=vue.resolveComponent("el-button"),ie=vue.resolveComponent("el-focus-trap"),ae=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:n[11]||(n[11]=le=>i.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(ae,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:vue.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:n[8]||(n[8]=(...le)=>i.overlayEvent.onClick&&i.overlayEvent.onClick(...le)),onMousedown:n[9]||(n[9]=(...le)=>i.overlayEvent.onMousedown&&i.overlayEvent.onMousedown(...le)),onMouseup:n[10]||(n[10]=(...le)=>i.overlayEvent.onMouseup&&i.overlayEvent.onMouseup(...le))},[vue.createVNode(ie,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:vue.normalizeStyle(i.customStyle),tabindex:"-1",onClick:n[7]||(n[7]=vue.withModifiers(()=>{},["stop"]))},[i.title!==null&&i.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass(i.ns.e("header"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(i.title),1)],2),i.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:n[0]||(n[0]=le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel")),onKeydown:n[1]||(n[1]=vue.withKeys(vue.withModifiers(le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode($,{class:vue.normalizeClass(i.ns.e("close"))},{default:vue.withCtx(()=>[vue.createVNode(oe)]),_:1},8,["class"])],42,_hoisted_2$g)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:i.contentId,class:vue.normalizeClass(i.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.e("message"))},[vue.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("input"))},[vue.createVNode(re,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":n[2]||(n[2]=le=>i.inputValue=le),type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:vue.normalizeClass({invalid:i.validateError}),onKeydown:vue.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("errormsg")),style:vue.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(i.editorErrorMessage),7)],2),[[vue.vShow,i.showInput]])],10,_hoisted_3$e),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(vue.openBlock(),vue.createBlock(Ce,{key:0,loading:i.cancelButtonLoading,class:vue.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:n[3]||(n[3]=le=>i.handleAction("cancel")),onKeydown:n[4]||(n[4]=vue.withKeys(vue.withModifiers(le=>i.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(Ce,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,class:vue.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:n[5]||(n[5]=le=>i.handleAction("confirm")),onKeydown:n[6]||(n[6]=vue.withKeys(vue.withModifiers(le=>i.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[vue.vShow,i.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$k)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$r,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const messageInstance=new Map,getAppendToElement=i=>{let n=document.body;return i.appendTo&&(isString$1(i.appendTo)&&(n=document.querySelector(i.appendTo)),isElement(i.appendTo)&&(n=i.appendTo),isElement(n)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body)),n},initInstance=(i,n,r=null)=>{const g=vue.createVNode(MessageBoxConstructor,i,isFunction$2(i.message)||vue.isVNode(i.message)?{default:isFunction$2(i.message)?i.message:()=>i.message}:null);return g.appContext=r,vue.render(g,n),getAppendToElement(i).appendChild(n.firstElementChild),g.component},genContainer=()=>document.createElement("div"),showMessage=(i,n)=>{const r=genContainer();i.onVanish=()=>{vue.render(null,r),messageInstance.delete(k)},i.onAction=V=>{const $=messageInstance.get(k);let oe;i.showInput?oe={value:k.inputValue,action:V}:oe=V,i.callback?i.callback(oe,g.proxy):V==="cancel"||V==="close"?i.distinguishCancelAndClose&&V!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(oe)};const g=initInstance(i,r,n),k=g.proxy;for(const V in i)hasOwn$1(i,V)&&!hasOwn$1(k.$props,V)&&(k[V]=i[V]);return k.visible=!0,k};function MessageBox(i,n=null){if(!isClient)return Promise.reject();let r;return isString$1(i)||vue.isVNode(i)?i={message:i}:r=i.callback,new Promise((g,k)=>{const V=showMessage(i,n??MessageBox._context);messageInstance.set(V,{options:i,callback:r,resolve:g,reject:k})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(i=>{MessageBox[i]=messageBoxFactory(i)});function messageBoxFactory(i){return(n,r,g,k)=>{let V="";return isObject$4(r)?(g=r,V=""):isUndefined(r)?V="":V=r,MessageBox(Object.assign({title:V,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),k)}}MessageBox.close=()=>{messageInstance.forEach((i,n)=>{n.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=i=>{_MessageBox._context=i._context,i.config.globalProperties.$msgbox=_MessageBox,i.config.globalProperties.$messageBox=_MessageBox,i.config.globalProperties.$alert=_MessageBox.alert,i.config.globalProperties.$confirm=_MessageBox.confirm,i.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,index$3="",animate="";var ELineBindAnchors=(i=>(i.TopCenter="TopCenter",i.Left="Left",i.Right="Right",i.BottomCenter="BottomCenter",i))(ELineBindAnchors||{}),EConfigAnimationsType=(i=>(i.None="None",i.Electricity="Electricity",i.WaterDrop="WaterDrop",i.Track="Track",i))(EConfigAnimationsType||{}),EConfigItemPropsType=(i=>(i.Input="Input",i.Color="Color",i.InputNumber="InputNumber",i.Switch="Switch",i.JsonEdit="JsonEdit",i.Select="Select",i))(EConfigItemPropsType||{}),EDoneJsonType=(i=>(i.File="File",i.StraightLine="StraightLine",i.ConnectionLine="ConnectionLine",i.CustomSvg="CustomSvg",i.Vue="Vue",i))(EDoneJsonType||{}),EEventType=(i=>(i.Click="Click",i.Change="Change",i.Null="",i))(EEventType||{}),EEventAction=(i=>(i.ChangeAttr="ChangeAttr",i.JavaScript="JavaScript",i.Null="",i))(EEventAction||{}),EConditionType=(i=>(i.None="None",i.Relation="Relation",i))(EConditionType||{});const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let k=0;k<i;k++){let V=r;k===0&&(V=r-10),g+=n.charAt(Math.floor(Math.random()*V))}return g},isOfType=(i,n)=>i[n]!==void 0,getCoordinateOffset=(i,n)=>i/2*(n-1),angleToRadian=i=>i*Math.PI/180,calculateRotatedPointCoordinate=(i,n,r)=>({x:(i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x,y:(i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y}),getCenterPoint=(i,n)=>({x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2}),positionArrToPath=i=>{let n="";for(let r=0;r<i.length;r++)r===0?n+=`M ${i[r].x} ${i[r].y}`:n+=` L ${i[r].x} ${i[r].y}`;return n},getSvgNowPosition=(i,n,r)=>r+(n-i),objectDeepClone=(i,n={})=>i?JSON.parse(JSON.stringify(i)):n,setSvgActualInfo=(i,n)=>{const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let k=0,V=0,$=0,oe=0;if(i.type!==EDoneJsonType.Vue){const re=r.getBBox();console.log(re),k=re.x,V=re.y,$=re.width,oe=re.height}else{$=r.offsetWidth,oe=r.offsetHeight,$=$===0?100:$,oe=oe===0?100:oe,k=50-$/2,V=50-oe/2;const re=document.querySelector(`#foreign-object${i.id}`);re&&re.getAttribute("x")==="0"&&re.getAttribute("y")==="0"&&re.getAttribute("width")==="0"&&re.getAttribute("height")==="0"&&(re.setAttribute("x",k.toString()),re.setAttribute("y",V.toString()),re.setAttribute("width",$.toString()),re.setAttribute("height",oe.toString()))}g&&g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"&&(g.setAttribute("x",k.toString()),g.setAttribute("y",V.toString()),g.setAttribute("width",$.toString()),g.setAttribute("height",oe.toString())),(i.actual_bound.x===0&&i.actual_bound.y===0&&i.actual_bound.width===0&&i.actual_bound.height===0||n)&&(i.actual_bound={x:k,y:V,width:$,height:oe}),i.point_coordinate.tl={x:i.x-$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.tc={x:i.x,y:i.y-oe*i.scale_y/2},i.point_coordinate.tr={x:i.x+$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.l={x:i.x-$*i.scale_x/2,y:i.y},i.point_coordinate.r={x:i.x+$*i.scale_x/2,y:i.y},i.point_coordinate.bl={x:i.x-$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.point_coordinate.bc={x:i.x,y:i.y+oe*i.scale_y/2},i.point_coordinate.br={x:i.x+$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i)}},getAnchorPosByAnchorType=(i,n)=>i===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:i===ELineBindAnchors.Left?n.point_coordinate.l:i===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=i=>{i.point_coordinate={tl:calculateRotatedPointCoordinate(i.point_coordinate.tl,{x:i.x,y:i.y},i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,{x:i.x,y:i.y},i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,{x:i.x,y:i.y},i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,{x:i.x,y:i.y},i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,{x:i.x,y:i.y},i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,{x:i.x,y:i.y},i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,{x:i.x,y:i.y},i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,{x:i.x,y:i.y},i.rotate)}},prosToVBind=i=>{var r,g,k,V;let n={};if(i.state){for(const $ in i.state)if($==="OnOff")for(const oe in(r=i.state[$])==null?void 0:r.props)n={...n,[oe]:(g=i.state[$])!=null&&g.default?(k=i.state[$])==null?void 0:k.props[oe].openVal:(V=i.state[$])==null?void 0:V.props[oe].closeVal}}for(const $ in i.props)n={...n,[$]:i.props[$].val};return n},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(i=>i.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=i=>!i.common_animations||!i.common_animations.val?"":`common-ani animate__animated animate__${i.common_animations.val} animate__${i.common_animations.speed} animate__${i.common_animations.repeat} animate__${i.common_animations.delay}`,numberArray=i=>{let n=[];for(let r=0;r<i;r++)n.push(r);return n},getStringWidth=(i,n=12)=>{if(i.length>0){let r=document.createElement("span");r.style.fontSize=n+"px",r.style.fontFamily="inherit",r.innerHTML=i,r.style.opacity="0",r.style.position="fixed",r.style.top="3000px",document.body.append(r);const g=r.clientWidth;return document.body.removeChild(r),g}return 0},valFormat=i=>/false|true/.test(i)?i!=="false":/^\d+(\.\d+)?$/.test(i)?Number(i):i,straight_line_system=Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]}),connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#0a7ae2"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let i=JSON.parse(l);t=i.connection_line,s=i.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50},grid:!0,ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}}),circuit_breaker_svg_file={name:"circuit-breaker",title:"断路器",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},state:{OnOff:{title:"开关",default:!1,props:{fill:{openVal:"#00ff00",closeVal:"#ff0000"},"fill-opacity":{openVal:"0",closeVal:"1"}}}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态图标",list:[circuit_breaker_svg_file]},alternator_svg_file={name:"alternator",title:"发电机",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#00ff00"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},traction_transformer_svg_file={name:"traction-transformer",title:"牵引变",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_house={name:"house",title:"房子",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_car={name:"car",title:"轿车",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hospital={name:"hospital",title:"医院",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_package={name:"package",title:"组装线",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_2={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_3={name:"bot-3",title:"3号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_7={name:"bot-7",title:"7号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_9={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_12={name:"bot-12",title:"12号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateless_group={groupType:"stateless",title:"静态图标",list:[alternator_svg_file,traction_transformer_svg_file,svg_house,svg_car,svg_hospital,svg_package,svg_bot_2,svg_bot_3,svg_bot_7,svg_bot_9,svg_bot_12]},reservoir={name:"reservoir",title:"蓄水池",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"水流颜色",type:EConfigItemPropsType.Color,val:"#37cfe7"},stroke:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画图标",list:[reservoir]},svg_text={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Input,val:"文字"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:15},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_a={name:"switch-a",title:"开关",tag:"switch-a",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},light_a={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},clock_a={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_a,light_a,clock_a]},svg_config_center=Object.seal([stateless_group,stateful_group,animation_group,custom_svg_group]),el_button={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},common_table={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:null},"max-height":{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:null},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},now_time={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!1,actual_rect:!0},display:!0,props:{fontColor:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},el_tag={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},progress_a={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:10}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},components={groupType:"custom-vue",title:"VUE组件",list:[el_button,progress_a,common_table,now_time,el_tag]},pie_charts={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},echarts_group={groupType:"echarts",title:"图表",list:[pie_charts]},vue_config_center=Object.seal([components,echarts_group]),_sfc_main$q=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(i,{emit:n}){const r=i,g=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>r.percentage,()=>{n("onChange")}),(k,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$j=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M735.2 792.4H287.6C136.9 792.4 14.2 669.8 14.2 519c0-150.9 122.6-273.5 273.4-273.5h447.6c150.7 0 273.4 122.6 273.4 273.4 0 150.9-122.7 273.5-273.4 273.5zM287.6 300.2c-120.6 0-218.7 98.1-218.7 218.7 0 120.8 98.1 218.9 218.7 218.9h447.6c120.6 0 218.7-98.1 218.7-218.7 0-120.8-98.1-218.9-218.7-218.9H287.6z",fill:"#666666"},null,-1),_hoisted_4$a=vue.createElementVNode("path",{d:"M724.7 687.1c-92.7 0-168.1-75.4-168.1-168.1S632 350.9 724.7 350.9 892.8 426.3 892.8 519s-75.4 168.1-168.1 168.1z m0-278.6c-60.9 0-110.5 49.6-110.5 110.5s49.5 110.5 110.5 110.5S835.1 579.9 835.1 519s-49.5-110.5-110.4-110.5z",fill:"#666666"},null,-1),_hoisted_5$9=[_hoisted_3$d,_hoisted_4$a],_hoisted_6$6=["id"],_hoisted_7$6=vue.createElementVNode("path",{d:"M704 224H320C161.216 224 32 353.216 32 512c0 158.816 129.216 288 288 288h384c158.816 0 288-129.184 288-288 0-158.784-129.184-288-288-288z m0 512H320C196.48 736 96 635.488 96 512c0-123.52 100.48-224 224-224h384c123.488 0 224 100.48 224 224 0 123.488-100.512 224-224 224z"},null,-1),_hoisted_8$5=vue.createElementVNode("path",{d:"M320 320c-105.888 0-192 86.112-192 192s86.112 192 192 192 192-86.112 192-192-86.112-192-192-192z m0 320c-70.592 0-128-57.408-128-128s57.408-128 128-128 128 57.408 128 128-57.408 128-128 128z"},null,-1),_hoisted_9$4=[_hoisted_7$6,_hoisted_8$5],_hoisted_10$4=["xlink:href"],_hoisted_11$4=["xlink:href"],_sfc_main$p=vue.defineComponent({__name:"switch-a",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-open`},_hoisted_5$9,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-close`},_hoisted_9$4,8,_hoisted_6$6),r.isOpen?(vue.openBlock(),vue.createElementBlock("use",{key:0,"xlink:href":`#${r.id}switch-demo-open`,width:"100",height:"100"},null,8,_hoisted_10$4)):(vue.openBlock(),vue.createElementBlock("use",{key:1,"xlink:href":`#${r.id}switch-demo-close`,width:"100",height:"100"},null,8,_hoisted_11$4))],8,_hoisted_1$j))}}),_hoisted_1$i=["font-family","font-size","fill"],_sfc_main$o=vue.defineComponent({__name:"svg-text",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>[r.text,r.fontSize,r.fontFamily],()=>{vue.nextTick(function(){n("resize")})}),(g,k)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55","font-family":r.fontFamily,"font-size":r.fontSize,fill:r.fill},vue.toDisplayString(r.text),9,_hoisted_1$i))}}),_sfc_main$n=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(i){const n=i,r=vue.ref({});return vue.watchEffect(()=>{const{colConfig:g,...k}=n;r.value=k}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,V=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:V.prop},V),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$m=vue.defineComponent({__name:"now-time",props:{fontColor:{type:String,default:"#000000"}},setup(i){const n=i,r=vue.ref(new Date),g=vue.ref(),k=vue.computed(()=>{const oe=r.value.getFullYear(),re=r.value.getMonth()+1,Ce=r.value.getDate();return oe.toString()+"年"+re.toString()+"月"+Ce.toString()+"日"}),V=vue.computed(()=>{const oe=r.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),$=vue.computed(()=>{const oe=r.value.getHours(),re=r.value.getMinutes(),Ce=r.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(re<10?"0"+re.toString():re.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())});return vue.onMounted(()=>{g.value=setInterval(()=>{r.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(g.value)}),(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(k.value),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(V.value),5),vue.createElementVNode("div",{class:"text-12px font-bold ml-5px",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString($.value),5)])]))}});/*! *****************************************************************************
|
292
|
+
*/var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,k="",V=0,$=0;for(V=r.index;V<n.length;V++){switch(n.charCodeAt(V)){case 34:g=""";break;case 38:g="&";break;case 39:g="'";break;case 60:g="<";break;case 62:g=">";break;default:continue}$!==V&&(k+=n.substring($,V)),$=V+1,k+=g}return $!==V?k+n.substring($,V):k}const escapeHtml$1=getDefaultExportFromCjs(escapeHtml_1),getCell=function(i){var n;return(n=i.target)==null?void 0:n.closest("td")},orderBy=function(i,n,r,g,k){if(!n&&!g&&(!k||Array.isArray(k)&&!k.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const V=g?null:function(oe,re){return k?(Array.isArray(k)||(k=[k]),k.map(Ce=>typeof Ce=="string"?get$1(oe,Ce):Ce(oe,re,i))):(n!=="$key"&&isObject$4(oe)&&"$value"in oe&&(oe=oe.$value),[isObject$4(oe)?get$1(oe,n):oe])},$=function(oe,re){if(g)return g(oe.value,re.value);for(let Ce=0,ie=oe.key.length;Ce<ie;Ce++){if(oe.key[Ce]<re.key[Ce])return-1;if(oe.key[Ce]>re.key[Ce])return 1}return 0};return i.map((oe,re)=>({value:oe,index:re,key:V?V(oe,re):null})).sort((oe,re)=>{let Ce=$(oe,re);return Ce||(Ce=oe.index-re.index),Ce*+r}).map(oe=>oe.value)},getColumnById=function(i,n){let r=null;return i.columns.forEach(g=>{g.id===n&&(r=g)}),r},getColumnByKey=function(i,n){let r=null;for(let g=0;g<i.columns.length;g++){const k=i.columns[g];if(k.columnKey===n){r=k;break}}return r||throwError$1("ElTable",`No column matching with column-key: ${n}`),r},getColumnByCell=function(i,n,r){const g=(n.className||"").match(new RegExp(`${r}-table_[^\\s]+`,"gm"));return g?getColumnById(i,g[0]):null},getRowIdentity=(i,n)=>{if(!i)throw new Error("Row is required when get row identity");if(typeof n=="string"){if(!n.includes("."))return`${i[n]}`;const r=n.split(".");let g=i;for(const k of r)g=g[k];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,k)=>{r[getRowIdentity(g,n)]={row:g,index:k}}),r};function mergeOptions(i,n){const r={};let g;for(g in i)r[g]=i[g];for(g in n)if(hasOwn$1(n,g)){const k=n[g];typeof k<"u"&&(r[g]=k)}return r}function parseWidth(i){return i===""||i!==void 0&&(i=Number.parseInt(i,10),Number.isNaN(i)&&(i="")),i}function parseMinWidth(i){return i===""||i!==void 0&&(i=parseWidth(i),Number.isNaN(i)&&(i=80)),i}function parseHeight(i){return typeof i=="number"?i:typeof i=="string"?/^\d+(?:px)?$/.test(i)?Number.parseInt(i,10):i:null}function compose(...i){return i.length===0?n=>n:i.length===1?i[0]:i.reduce((n,r)=>(...g)=>n(r(...g)))}function toggleRowStatus(i,n,r){let g=!1;const k=i.indexOf(n),V=k!==-1,$=oe=>{oe==="add"?i.push(n):i.splice(k,1),g=!0,isArray$3(n.children)&&n.children.forEach(re=>{toggleRowStatus(i,re,r??!V)})};return isBoolean(r)?r&&!V?$("add"):!r&&V&&$("remove"):$(V?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const k=$=>!(Array.isArray($)&&$.length);function V($,oe,re){n($,oe,re),oe.forEach(Ce=>{if(Ce[g]){n(Ce,null,re+1);return}const ie=Ce[r];k(ie)||V(Ce,ie,re+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const oe=$[r];k(oe)||V($,oe,0)})}let removePopper;function createTablePopper(i,n,r,g,k){k=merge$2({enterable:!0,showArrow:!0},k);const V=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${V}-scrollbar__wrap`);function oe(){const Ne=k.effect==="light",he=document.createElement("div");return he.className=[`${V}-popper`,Ne?"is-light":"is-dark",k.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function re(){const Ne=document.createElement("div");return Ne.className=`${V}-popper__arrow`,Ne}function Ce(){ie&&ie.update()}removePopper==null||removePopper(),removePopper=()=>{try{ie&&ie.destroy(),Ie&&(i==null||i.removeChild(Ie)),n.removeEventListener("mouseenter",ae),n.removeEventListener("mouseleave",le),$==null||$.removeEventListener("scroll",removePopper),removePopper=void 0}catch{}};let ie=null,ae=Ce,le=removePopper;k.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:k.showAfter,hideAfter:k.hideAfter,open:Ce,close:removePopper}));const Ie=oe();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(k.offset&&ue.push({name:"offset",options:{offset:[0,k.offset]}}),k.showArrow){const Ne=Ie.appendChild(re());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=k.popperOptions||{};return ie=yn(n,Ie,{placement:k.placement||"top",strategy:"fixed",...de,modifiers:de.modifiers?ue.concat(de.modifiers):ue}),n.addEventListener("mouseenter",ae),n.addEventListener("mouseleave",le),$==null||$.addEventListener("scroll",removePopper),ie}function getCurrentColumns(i){return i.children?flatMap(i.children,getCurrentColumns):[i]}function getColSpan(i,n){return i+n.colSpan}const isFixedColumn=(i,n,r,g)=>{let k=0,V=i;const $=r.states.columns.value;if(g){const re=getCurrentColumns(g[i]);k=$.slice(0,$.indexOf(re[0])).reduce(getColSpan,0),V=k+re.reduce(getColSpan,0)-1}else k=i;let oe;switch(n){case"left":V<r.states.fixedLeafColumnsLength.value&&(oe="left");break;case"right":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right");break;default:V<r.states.fixedLeafColumnsLength.value?oe="left":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right")}return oe?{direction:oe,start:k,after:V}:{}},getFixedColumnsClass=(i,n,r,g,k,V=0)=>{const $=[],{direction:oe,start:re,after:Ce}=isFixedColumn(n,r,g,k);if(oe){const ie=oe==="left";$.push(`${i}-fixed-column--${oe}`),ie&&Ce+V===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&re-V===g.states.columns.value.length-g.states.rightFixedLeafColumnsLength.value&&$.push("is-first-column")}return $};function getOffset(i,n){return i+(n.realWidth===null||Number.isNaN(n.realWidth)?Number(n.width):n.realWidth)}const getFixedColumnOffset=(i,n,r,g)=>{const{direction:k,start:V=0,after:$=0}=isFixedColumn(i,n,r,g);if(!k)return;const oe={},re=k==="left",Ce=r.states.columns.value;return re?oe.left=Ce.slice(0,V).reduce(getOffset,0):oe.right=Ce.slice($+1).reverse().reduce(getOffset,0),oe},ensurePosition=(i,n)=>{i&&(Number.isNaN(i[n])||(i[n]=`${i[n]}px`))};function useExpand(i){const n=vue.getCurrentInstance(),r=vue.ref(!1),g=vue.ref([]);return{updateExpandRows:()=>{const re=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=re.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=re.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(re,Ce)=>{toggleRowStatus(g.value,re,Ce)&&n.emit("expand-change",re,g.value.slice())},setExpandRowKeys:re=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=re.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:re=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(re,Ce)]:g.value.includes(re)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),k=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},V=()=>{r.value=null},$=Ce=>{const{data:ie,rowKey:ae}=i;let le=null;ae.value&&(le=(vue.unref(ie)||[]).find(Ie=>getRowIdentity(Ie,ae.value)===Ce)),g.value=le,n.emit("current-change",g.value,null)};return{setCurrentRowKey:k,restoreCurrentRowKey:V,setCurrentRowByKey:$,updateCurrentRow:Ce=>{const ie=g.value;if(Ce&&Ce!==ie){g.value=Ce,n.emit("current-change",g.value,ie);return}!Ce&&ie&&(g.value=null,n.emit("current-change",null,ie))},updateCurrentRowData:()=>{const Ce=i.rowKey.value,ie=i.data.value||[],ae=g.value;if(!ie.includes(ae)&&ae){if(Ce){const le=getRowIdentity(ae,Ce);$(le)}else g.value=null;g.value===null&&n.emit("current-change",null,ae)}else r.value&&($(r.value),V())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),k=vue.ref(!1),V=vue.ref({}),$=vue.ref("hasChildren"),oe=vue.ref("children"),re=vue.getCurrentInstance(),Ce=vue.computed(()=>{if(!i.rowKey.value)return{};const he=i.data.value||[];return ae(he)}),ie=vue.computed(()=>{const he=i.rowKey.value,pe=Object.keys(V.value),ze={};return pe.length&&pe.forEach(Fe=>{if(V.value[Fe].length){const xe={children:[]};V.value[Fe].forEach(_e=>{const Dt=getRowIdentity(_e,he);xe.children.push(Dt),_e[$.value]&&!ze[Dt]&&(ze[Dt]={children:[]})}),ze[Fe]=xe}}),ze}),ae=he=>{const pe=i.rowKey.value,ze={};return walkTreeNode(he,(Fe,xe,_e)=>{const Dt=getRowIdentity(Fe,pe);Array.isArray(xe)?ze[Dt]={children:xe.map($e=>getRowIdentity($e,pe)),level:_e}:k.value&&(ze[Dt]={children:[],lazy:!0,level:_e})},oe.value,$.value),ze},le=(he=!1,pe=(ze=>(ze=re.store)==null?void 0:ze.states.defaultExpandAll.value)())=>{var ze;const Fe=Ce.value,xe=ie.value,_e=Object.keys(Fe),Dt={};if(_e.length){const $e=vue.unref(r),Ue=[],Ve=(At,qe)=>{if(he)return n.value?pe||n.value.includes(qe):!!(pe||At!=null&&At.expanded);{const Lt=pe||n.value&&n.value.includes(qe);return!!(At!=null&&At.expanded||Lt)}};_e.forEach(At=>{const qe=$e[At],Lt={...Fe[At]};if(Lt.expanded=Ve(qe,At),Lt.lazy){const{loaded:kt=!1,loading:jt=!1}=qe||{};Lt.loaded=!!kt,Lt.loading=!!jt,Ue.push(At)}Dt[At]=Lt});const Oe=Object.keys(xe);k.value&&Oe.length&&Ue.length&&Oe.forEach(At=>{const qe=$e[At],Lt=xe[At].children;if(Ue.includes(At)){if(Dt[At].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Dt[At].children=Lt}else{const{loaded:kt=!1,loading:jt=!1}=qe||{};Dt[At]={lazy:!0,loaded:!!kt,loading:!!jt,expanded:Ve(qe,At),children:Lt,level:""}}})}r.value=Dt,(ze=re.store)==null||ze.updateTableScrollY()};vue.watch(()=>n.value,()=>{le(!0)}),vue.watch(()=>Ce.value,()=>{le()}),vue.watch(()=>ie.value,()=>{le()});const Ie=he=>{n.value=he,le()},ue=(he,pe)=>{re.store.assertRowKey();const ze=i.rowKey.value,Fe=getRowIdentity(he,ze),xe=Fe&&r.value[Fe];if(Fe&&xe&&"expanded"in xe){const _e=xe.expanded;pe=typeof pe>"u"?!xe.expanded:pe,r.value[Fe].expanded=pe,_e!==pe&&re.emit("expand-change",he,pe),re.store.updateTableScrollY()}},de=he=>{re.store.assertRowKey();const pe=i.rowKey.value,ze=getRowIdentity(he,pe),Fe=r.value[ze];k.value&&Fe&&"loaded"in Fe&&!Fe.loaded?Ne(he,ze,Fe):ue(he,void 0)},Ne=(he,pe,ze)=>{const{load:Fe}=re.props;Fe&&!r.value[pe].loaded&&(r.value[pe].loading=!0,Fe(he,ze,xe=>{if(!Array.isArray(xe))throw new TypeError("[ElTable] data must be an array");r.value[pe].loading=!1,r.value[pe].loaded=!0,r.value[pe].expanded=!0,xe.length&&(V.value[pe]=xe),re.emit("expand-change",he,!0)}))};return{loadData:Ne,loadOrToggle:de,toggleTreeExpansion:ue,updateTreeExpandKeys:Ie,updateTreeData:le,normalize:ae,states:{expandRowKeys:n,treeData:r,indent:g,lazy:k,lazyTreeNodeMap:V,lazyColumnIdentifier:$,childrenColumnName:oe}}}const sortData=(i,n)=>{const r=n.sortingColumn;return!r||typeof r.sortable=="string"?i:orderBy(i,n.sortProp,n.sortOrder,r.sortMethod,r.sortBy)},doFlattenColumns=i=>{const n=[];return i.forEach(r=>{r.children&&r.children.length>0?n.push.apply(n,doFlattenColumns(r.children)):n.push(r)}),n};function useWatcher$1(){var i;const n=vue.getCurrentInstance(),{size:r}=vue.toRefs((i=n.proxy)==null?void 0:i.$props),g=vue.ref(null),k=vue.ref([]),V=vue.ref([]),$=vue.ref(!1),oe=vue.ref([]),re=vue.ref([]),Ce=vue.ref([]),ie=vue.ref([]),ae=vue.ref([]),le=vue.ref([]),Ie=vue.ref([]),ue=vue.ref([]),de=[],Ne=vue.ref(0),he=vue.ref(0),pe=vue.ref(0),ze=vue.ref(!1),Fe=vue.ref([]),xe=vue.ref(!1),_e=vue.ref(!1),Dt=vue.ref(null),$e=vue.ref({}),Ue=vue.ref(null),Ve=vue.ref(null),Oe=vue.ref(null),At=vue.ref(null),qe=vue.ref(null);vue.watch(k,()=>n.state&&ti(!1),{deep:!0});const Lt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},kt=Oi=>{var xi;(xi=Oi.children)==null||xi.forEach(Li=>{Li.fixed=Oi.fixed,kt(Li)})},jt=()=>{oe.value.forEach(ki=>{kt(ki)}),ie.value=oe.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=oe.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&oe.value[0]&&oe.value[0].type==="selection"&&!oe.value[0].fixed&&(oe.value[0].fixed=!0,ie.value.unshift(oe.value[0]));const Oi=oe.value.filter(ki=>!ki.fixed);re.value=[].concat(ie.value).concat(Oi).concat(ae.value);const xi=doFlattenColumns(Oi),Li=doFlattenColumns(ie.value),Wi=doFlattenColumns(ae.value);Ne.value=xi.length,he.value=Li.length,pe.value=Wi.length,Ce.value=[].concat(Li).concat(xi).concat(Wi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,xi=!1)=>{Oi&&jt(),xi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Fe.value.includes(Oi),Pt=()=>{ze.value=!1,Fe.value.length&&(Fe.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const xi=getKeysMap(Fe.value,g.value),Li=getKeysMap(k.value,g.value);for(const Wi in xi)hasOwn$1(xi,Wi)&&!Li[Wi]&&Oi.push(xi[Wi].row)}else Oi=Fe.value.filter(xi=>!k.value.includes(xi));if(Oi.length){const xi=Fe.value.filter(Li=>!Oi.includes(Li));Fe.value=xi,n.emit("selection-change",xi.slice())}},gi=()=>(Fe.value||[]).slice(),di=(Oi,xi=void 0,Li=!0)=>{if(toggleRowStatus(Fe.value,Oi,xi)){const ki=(Fe.value||[]).slice();Li&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},li=()=>{var Oi,xi;const Li=_e.value?!ze.value:!(ze.value||Fe.value.length);ze.value=Li;let Wi=!1,ki=0;const Ri=(xi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:xi.rowKey.value;k.value.forEach((Ki,Ti)=>{const Di=Ti+ki;Dt.value?Dt.value.call(null,Ki,Di)&&toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0):toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0),ki+=pi(getRowIdentity(Ki,Ri))}),Wi&&n.emit("selection-change",Fe.value?Fe.value.slice():[]),n.emit("select-all",Fe.value)},ai=()=>{const Oi=getKeysMap(Fe.value,g.value);k.value.forEach(xi=>{const Li=getRowIdentity(xi,g.value),Wi=Oi[Li];Wi&&(Fe.value[Wi.index]=xi)})},ci=()=>{var Oi,xi,Li;if(((Oi=k.value)==null?void 0:Oi.length)===0){ze.value=!1;return}let Wi;g.value&&(Wi=getKeysMap(Fe.value,g.value));const ki=function(Di){return Wi?!!Wi[getRowIdentity(Di,g.value)]:Fe.value.includes(Di)};let Ri=!0,Ki=0,Ti=0;for(let Di=0,Bi=(k.value||[]).length;Di<Bi;Di++){const Vi=(Li=(xi=n==null?void 0:n.store)==null?void 0:xi.states)==null?void 0:Li.rowKey.value,Ei=Di+Ti,ji=k.value[Di],Ui=Dt.value&&Dt.value.call(null,ji,Ei);if(ki(ji))Ki++;else if(!Dt.value||Ui){Ri=!1;break}Ti+=pi(getRowIdentity(ji,Vi))}Ki===0&&(Ri=!1),ze.value=Ri},pi=Oi=>{var xi;if(!n||!n.store)return 0;const{treeData:Li}=n.store.states;let Wi=0;const ki=(xi=Li.value[Oi])==null?void 0:xi.children;return ki&&(Wi+=ki.length,ki.forEach(Ri=>{Wi+=pi(Ri)})),Wi},yi=(Oi,xi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Li={};return Oi.forEach(Wi=>{$e.value[Wi.id]=xi,Li[Wi.columnKey||Wi.id]=xi}),Li},Ai=(Oi,xi,Li)=>{Ve.value&&Ve.value!==Oi&&(Ve.value.order=null),Ve.value=Oi,Oe.value=xi,At.value=Li},hi=()=>{let Oi=vue.unref(V);Object.keys($e.value).forEach(xi=>{const Li=$e.value[xi];if(!Li||Li.length===0)return;const Wi=getColumnById({columns:Ce.value},xi);Wi&&Wi.filterMethod&&(Oi=Oi.filter(ki=>Li.some(Ri=>Wi.filterMethod.call(null,Ri,ki,Wi))))}),Ue.value=Oi},wi=()=>{k.value=sortData(Ue.value,{sortingColumn:Ve.value,sortProp:Oe.value,sortOrder:At.value})},Ci=(Oi=void 0)=>{Oi&&Oi.filter||hi(),wi()},mi=Oi=>{const{tableHeaderRef:xi}=n.refs;if(!xi)return;const Li=Object.assign({},xi.filterPanels),Wi=Object.keys(Li);if(Wi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Ri=>getColumnByKey({columns:Ce.value},Ri));Wi.forEach(Ri=>{const Ki=ki.find(Ti=>Ti.id===Ri);Ki&&(Ki.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Wi.forEach(ki=>{const Ri=Ce.value.find(Ki=>Ki.id===ki);Ri&&(Ri.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ve.value&&(Ai(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Mi,toggleRowExpansion:fi,updateExpandRows:zi,states:Si,isRowExpanded:si}=useExpand({data:k,rowKey:g}),{updateTreeExpandKeys:Ii,toggleTreeExpansion:oi,updateTreeData:Et,loadOrToggle:ii,states:ri}=useTree({data:k,rowKey:g}),{updateCurrentRowData:ui,updateCurrentRow:vi,setCurrentRowKey:bi,states:Zi}=useCurrent({data:k,rowKey:g});return{assertRowKey:Lt,updateColumns:jt,scheduleLayout:ti,isSelected:ei,clearSelection:Pt,cleanSelection:ni,getSelectionRows:gi,toggleRowSelection:di,_toggleAllSelection:li,toggleAllSelection:null,updateSelectionByRowKey:ai,updateAllSelected:ci,updateFilters:yi,updateCurrentRow:vi,updateSort:Ai,execFilter:hi,execSort:wi,execQuery:Ci,clearFilter:mi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{Mi(Oi),Ii(Oi)},setCurrentRowKey:bi,toggleRowExpansionAdapter:(Oi,xi)=>{Ce.value.some(({type:Wi})=>Wi==="expand")?fi(Oi,xi):oi(Oi,xi)},isRowExpanded:si,updateExpandRows:zi,updateCurrentRowData:ui,loadOrToggle:ii,updateTreeData:Et,states:{tableSize:r,rowKey:g,data:k,_data:V,isComplex:$,_columns:oe,originColumns:re,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:pe,isAllSelected:ze,selection:Fe,reserveSelection:xe,selectOnIndeterminate:_e,selectable:Dt,filters:$e,filteredData:Ue,sortingColumn:Ve,sortProp:Oe,sortOrder:At,hoverRow:qe,...Si,...ri,...Zi}}}function replaceColumn(i,n){return i.map(r=>{var g;return r.id===n.id?n:((g=r.children)!=null&&g.length&&(r.children=replaceColumn(r.children,n)),r)})}function sortColumn(i){i.forEach(n=>{var r,g;n.no=(r=n.getColumnIndex)==null?void 0:r.call(n),(g=n.children)!=null&&g.length&&sortColumn(n.children)}),i.sort((n,r)=>n.no-r.no)}function useStore(){const i=vue.getCurrentInstance(),n=useWatcher$1();return{ns:useNamespace("table"),...n,mutations:{setData($,oe){const re=vue.unref($._data)!==oe;$.data.value=oe,$._data.value=oe,i.store.execQuery(),i.store.updateCurrentRowData(),i.store.updateExpandRows(),i.store.updateTreeData(i.store.states.defaultExpandAll.value),vue.unref($.reserveSelection)?(i.store.assertRowKey(),i.store.updateSelectionByRowKey()):re?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,oe,re,Ce){const ie=vue.unref($._columns);let ae=[];re?(re&&!re.children&&(re.children=[]),re.children.push(oe),ae=replaceColumn(ie,re)):(ie.push(oe),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),oe.type==="selection"&&($.selectable.value=oe.selectable,$.reserveSelection.value=oe.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,oe){var re;((re=oe.getColumnIndex)==null?void 0:re.call(oe))!==oe.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,oe,re,Ce){const ie=vue.unref($._columns)||[];if(re)re.children.splice(re.children.findIndex(le=>le.id===oe.id),1),vue.nextTick(()=>{var le;((le=re.children)==null?void 0:le.length)===0&&delete re.children}),$._columns.value=replaceColumn(ie,re);else{const le=ie.indexOf(oe);le>-1&&(ie.splice(le,1),$._columns.value=ie)}const ae=$.updateOrderFns.indexOf(Ce);ae>-1&&$.updateOrderFns.splice(ae,1),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},sort($,oe){const{prop:re,order:Ce,init:ie}=oe;if(re){const ae=vue.unref($.columns).find(le=>le.property===re);ae&&(ae.order=Ce,i.store.updateSort(ae,re,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,oe){const{sortingColumn:re,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(re),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!oe||!(oe.silent||oe.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,oe){const{column:re,values:Ce,silent:ie}=oe,ae=i.store.updateFilters(re,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,oe){i.store.toggleRowSelection(oe),i.store.updateAllSelected()},setHoverRow($,oe){$.hoverRow.value=oe},setCurrentRow($,oe){i.store.updateCurrentRow(oe)}},commit:function($,...oe){const re=i.store.mutations;if(re[$])re[$].apply(i,[i.store.states].concat(oe));else throw new Error(`Action not found: ${$}`)},updateTableScrollY:function(){vue.nextTick(()=>i.layout.updateScrollY.apply(i.layout))}}}const InitialStateMap={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function createStore(i,n){if(!i)throw new Error("Table is required.");const r=useStore();return r.toggleAllSelection=debounce(r._toggleAllSelection,10),Object.keys(InitialStateMap).forEach(g=>{handleValue(getArrKeysValue(n,g),g,r)}),proxyTableProps(r,n),r}function proxyTableProps(i,n){Object.keys(InitialStateMap).forEach(r=>{vue.watch(()=>getArrKeysValue(n,r),g=>{handleValue(g,r,i)})})}function handleValue(i,n,r){let g=i,k=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(k=k.key,g=g||InitialStateMap[n].default),r.states[k].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(k=>{g=g[k]}),g}else return i[n]}class TableLayout{constructor(n){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=vue.ref(null),this.scrollX=vue.ref(!1),this.scrollY=vue.ref(!1),this.bodyWidth=vue.ref(null),this.fixedWidth=vue.ref(null),this.rightFixedWidth=vue.ref(null),this.gutterWidth=0;for(const r in n)hasOwn$1(n,r)&&(vue.isRef(this[r])?this[r].value=n[r]:this[r]=n[r]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const r=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(r!=null&&r.wrapRef)){let g=!0;const k=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,k!==g}return!1}setHeight(n,r="height"){if(!isClient)return;const g=this.table.vnode.el;if(n=parseHeight(n),this.height.value=Number(n),!g&&(n||n===0))return vue.nextTick(()=>this.setHeight(n,r));typeof n=="number"?(g.style[r]=`${n}px`,this.updateElsHeight()):typeof n=="string"&&(g.style[r]=n,this.updateElsHeight())}setMaxHeight(n){this.setHeight(n,"max-height")}getFlattenColumns(){const n=[];return this.table.store.states.columns.value.forEach(g=>{g.isColumnGroup?n.push.apply(n,g.columns):n.push(g)}),n}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(n){if(!n)return!0;let r=n;for(;r.tagName!=="DIV";){if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}updateColumnsWidth(){if(!isClient)return;const n=this.fit,r=this.table.vnode.el.clientWidth;let g=0;const k=this.getFlattenColumns(),V=k.filter(re=>typeof re.width!="number");if(k.forEach(re=>{typeof re.width=="number"&&re.realWidth&&(re.realWidth=null)}),V.length>0&&n){if(k.forEach(re=>{g+=Number(re.width||re.minWidth||80)}),g<=r){this.scrollX.value=!1;const re=r-g;if(V.length===1)V[0].realWidth=Number(V[0].minWidth||80)+re;else{const Ce=V.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=re/Ce;let ae=0;V.forEach((le,Ie)=>{if(Ie===0)return;const ue=Math.floor(Number(le.minWidth||80)*ie);ae+=ue,le.realWidth=Number(le.minWidth||80)+ue}),V[0].realWidth=Number(V[0].minWidth||80)+re-ae}}else this.scrollX.value=!0,V.forEach(re=>{re.realWidth=Number(re.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else k.forEach(re=>{!re.width&&!re.minWidth?re.realWidth=80:re.realWidth=Number(re.width||re.minWidth),g+=re.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let re=0;$.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=re}const oe=this.store.states.rightFixedColumns.value;if(oe.length>0){let re=0;oe.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=re}this.notifyObservers("columns")}addObserver(n){this.observers.push(n)}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&this.observers.splice(r,1)}notifyObservers(n){this.observers.forEach(g=>{var k,V;switch(n){case"columns":(k=g.state)==null||k.onColumnsChange(this);break;case"scrollable":(V=g.state)==null||V.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$D=vue.defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox,ElCheckboxGroup,ElScrollbar,ElTooltip,ElIcon,ArrowDown:arrow_down_default,ArrowUp:arrow_up_default},directives:{ClickOutside},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(i){const n=vue.getCurrentInstance(),{t:r}=useLocale(),g=useNamespace("table-filter"),k=n==null?void 0:n.parent;k.filterPanels.value[i.column.id]||(k.filterPanels.value[i.column.id]=n);const V=vue.ref(!1),$=vue.ref(null),oe=vue.computed(()=>i.column&&i.column.filters),re=vue.computed({get:()=>{var Fe;return(((Fe=i.column)==null?void 0:Fe.filteredValue)||[])[0]},set:Fe=>{Ce.value&&(typeof Fe<"u"&&Fe!==null?Ce.value.splice(0,1,Fe):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Fe){i.column&&i.upDataColumn("filteredValue",Fe)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Fe=>Fe.value===re.value,le=()=>{V.value=!1},Ie=Fe=>{Fe.stopPropagation(),V.value=!V.value},ue=()=>{V.value=!1},de=()=>{pe(Ce.value),le()},Ne=()=>{Ce.value=[],pe(Ce.value),le()},he=Fe=>{re.value=Fe,pe(typeof Fe<"u"&&Fe!==null?Ce.value:[]),le()},pe=Fe=>{i.store.commit("filterChange",{column:i.column,values:Fe}),i.store.updateAllSelected()};vue.watch(V,Fe=>{i.column&&i.upDataColumn("filterOpened",Fe)},{immediate:!0});const ze=vue.computed(()=>{var Fe,xe;return(xe=(Fe=$.value)==null?void 0:Fe.popperRef)==null?void 0:xe.contentRef});return{tooltipVisible:V,multiple:ie,filteredValue:Ce,filterValue:re,filters:oe,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:ze,tooltip:$}}}),_hoisted_1$s={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$5(i,n,r,g,k,V){const $=vue.resolveComponent("el-checkbox"),oe=vue.resolveComponent("el-checkbox-group"),re=vue.resolveComponent("el-scrollbar"),Ce=vue.resolveComponent("arrow-up"),ie=vue.resolveComponent("arrow-down"),ae=vue.resolveComponent("el-icon"),le=vue.resolveComponent("el-tooltip"),Ie=vue.resolveDirective("click-outside");return vue.openBlock(),vue.createBlock(le,{ref:"tooltip",visible:i.tooltipVisible,offset:0,placement:i.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":i.ns.b(),persistent:""},{content:vue.withCtx(()=>[i.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$s,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(re,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(oe,{modelValue:i.filteredValue,"onUpdate:modelValue":n[0]||(n[0]=ue=>i.filteredValue=ue),class:vue.normalizeClass(i.ns.e("checkbox-group"))},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createBlock($,{key:ue.value,label:ue.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("bottom"))},[vue.createElementVNode("button",{class:vue.normalizeClass({[i.ns.is("disabled")]:i.filteredValue.length===0}),disabled:i.filteredValue.length===0,type:"button",onClick:n[1]||(n[1]=(...ue)=>i.handleConfirm&&i.handleConfirm(...ue))},vue.toDisplayString(i.t("el.table.confirmFilter")),11,_hoisted_2$m),vue.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=(...ue)=>i.handleReset&&i.handleReset(...ue))},vue.toDisplayString(i.t("el.table.resetFilter")),1)],2)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,class:vue.normalizeClass(i.ns.e("list"))},[vue.createElementVNode("li",{class:vue.normalizeClass([i.ns.e("list-item"),{[i.ns.is("active")]:i.filterValue===void 0||i.filterValue===null}]),onClick:n[3]||(n[3]=ue=>i.handleSelect(null))},vue.toDisplayString(i.t("el.table.clearFilter")),3),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createElementBlock("li",{key:ue.value,class:vue.normalizeClass([i.ns.e("list-item"),i.ns.is("active",i.isActive(ue))]),label:ue.value,onClick:de=>i.handleSelect(ue.value)},vue.toDisplayString(ue.text),11,_hoisted_3$g))),128))],2))]),default:vue.withCtx(()=>[vue.withDirectives((vue.openBlock(),vue.createElementBlock("span",{class:vue.normalizeClass([`${i.ns.namespace.value}-table__column-filter-trigger`,`${i.ns.namespace.value}-none-outline`]),onClick:n[4]||(n[4]=(...ue)=>i.showFilterPanel&&i.showFilterPanel(...ue))},[vue.createVNode(ae,null,{default:vue.withCtx(()=>[i.column.filterOpened?(vue.openBlock(),vue.createBlock(Ce,{key:0})):(vue.openBlock(),vue.createBlock(ie,{key:1}))]),_:1})],2)),[[Ie,i.hideFilterPanel,i.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var FilterPanel=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$5],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function useLayoutObserver(i){const n=vue.getCurrentInstance();vue.onBeforeMount(()=>{r.value.addObserver(n)}),vue.onMounted(()=>{g(r.value),k(r.value)}),vue.onUpdated(()=>{g(r.value),k(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const V=i.layout;if(!V)throw new Error("Can not find table layout.");return V}),g=V=>{var $;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!oe.length)return;const re=V.getFlattenColumns(),Ce={};re.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=oe.length;ie<ae;ie++){const le=oe[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},k=V=>{var $,oe;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=re.length;ie<ae;ie++)re[ie].setAttribute("width",V.scrollY.value?V.gutterWidth:"0");const Ce=((oe=i.vnode.el)==null?void 0:oe.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=V.scrollY.value?`${V.gutterWidth}px`:"0",le.style.display=V.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:k}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=de=>{de.stopPropagation()},V=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&k(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},oe=vue.ref(null),re=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&oe.value&&i.border){re.value=!0;const he=g;n("set-drag-visible",!0);const ze=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Fe=r.vnode.el.querySelector(`th.${Ne.id}`),xe=Fe.getBoundingClientRect(),_e=xe.left-ze+30;addClass(Fe,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:xe.right-ze,startColumnLeft:xe.left-ze,tableLeft:ze};const Dt=he==null?void 0:he.refs.resizeProxy;Dt.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ve=>{const Oe=Ve.clientX-Ce.value.startMouseLeft,At=Ce.value.startLeft+Oe;Dt.style.left=`${Math.max(_e,At)}px`},Ue=()=>{if(re.value){const{startColumnLeft:Ve,startLeft:Oe}=Ce.value,qe=Number.parseInt(Dt.style.left,10)-Ve;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,Oe-Ve,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",re.value=!1,oe.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Ue),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Fe,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Ue)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const pe=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!re.value&&i.border){const ze=pe.getBoundingClientRect(),Fe=document.body.style;ze.width>12&&ze.right-de.pageX<8?(Fe.cursor="col-resize",hasClass(pe,"is-sortable")&&(pe.style.cursor="col-resize"),oe.value=Ne):re.value||(Fe.cursor="",hasClass(pe,"is-sortable")&&(pe.style.cursor="pointer"),oe.value=null)}},le=()=>{isClient&&(document.body.style.cursor="")},Ie=({order:de,sortOrders:Ne})=>{if(de==="")return Ne[0];const he=Ne.indexOf(de||null);return Ne[he>Ne.length-2?0:he+1]},ue=(de,Ne,he)=>{var pe;de.stopPropagation();const ze=Ne.order===he?null:he||Ie(Ne),Fe=(pe=de.target)==null?void 0:pe.closest("th");if(Fe&&hasClass(Fe,"noclick")){removeClass(Fe,"noclick");return}if(!Ne.sortable)return;const xe=i.store.states;let _e=xe.sortProp.value,Dt;const $e=xe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),xe.sortingColumn.value=Ne,_e=Ne.property),ze?Dt=Ne.order=ze:Dt=Ne.order=null,xe.sortProp.value=_e,xe.sortOrder.value=Dt,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:V,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:k}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:oe=>{const re=n==null?void 0:n.props.headerRowStyle;return typeof re=="function"?re.call(null,{rowIndex:oe}):re},getHeaderRowClass:oe=>{const re=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?re.push(Ce):typeof Ce=="function"&&re.push(Ce.call(null,{rowIndex:oe})),re.join(" ")},getHeaderCellStyle:(oe,re,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie}));const Ie=getFixedColumnOffset(re,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(oe,re,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),re,ie.fixed,i.store,Ce),le=[ie.id,ie.order,ie.headerAlign,ie.className,ie.labelClassName,...ae];ie.children||le.push("is-leaf"),ie.sortable&&le.push("is-sortable");const Ie=n==null?void 0:n.props.headerCellClassName;return typeof Ie=="string"?le.push(Ie):typeof Ie=="function"&&le.push(Ie.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie})),le.push(r.e("cell")),le.filter(ue=>!!ue).join(" ")}}}const getAllColumns=i=>{const n=[];return i.forEach(r=>{r.children?(n.push(r),n.push.apply(n,getAllColumns(r.children))):n.push(r)}),n},convertToRows=i=>{let n=1;const r=(V,$)=>{if($&&(V.level=$.level+1,n<V.level&&(n=V.level)),V.children){let oe=0;V.children.forEach(re=>{r(re,V),oe+=re.colSpan}),V.colSpan=oe}else V.colSpan=1};i.forEach(V=>{V.level=1,r(V,void 0)});const g=[];for(let V=0;V<n;V++)g.push([]);return getAllColumns(i).forEach(V=>{V.children?(V.rowSpan=1,V.children.forEach($=>$.isSubColumn=!0)):V.rowSpan=n-V.level+1,g[V.level-1].push(V)}),g};function useUtils$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.computed(()=>convertToRows(i.store.states.originColumns.value));return{isGroup:vue.computed(()=>{const V=r.value.length>1;return V&&n&&(n.state.isGroup.value=!0),V}),toggleAllSelection:V=>{V.stopPropagation(),n==null||n.store.commit("toggleAllSelection")},columnRows:r}}var TableHeader=vue.defineComponent({name:"ElTableHeader",components:{ElCheckbox},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i,{emit:n}){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=useNamespace("table"),V=vue.ref({}),{onColumnsChange:$,onScrollableChange:oe}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:Dt}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:Dt,init:!0})});const{handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:pe}=useStyle$2(i),{isGroup:ze,toggleAllSelection:Fe,columnRows:xe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:oe},r.filterPanels=V,{ns:k,filterPanels:V,onColumnsChange:$,onScrollableChange:oe,columnRows:xe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:pe,getHeaderCellStyle:he,handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:ze,toggleAllSelection:Fe}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:k,getHeaderRowClass:V,getHeaderRowStyle:$,handleHeaderClick:oe,handleHeaderContextMenu:re,handleMouseDown:Ce,handleMouseMove:ie,handleSortClick:ae,handleMouseOut:le,store:Ie,$parent:ue}=this;let de=1;return vue.h("thead",{class:{[i.is("group")]:n}},r.map((Ne,he)=>vue.h("tr",{class:V(he),key:he,style:$(he)},Ne.map((pe,ze)=>(pe.rowSpan>de&&(de=pe.rowSpan),vue.h("th",{class:k(he,ze,Ne,pe),colspan:pe.colSpan,key:`${pe.id}-thead`,rowspan:pe.rowSpan,style:g(he,ze,Ne,pe),onClick:Fe=>oe(Fe,pe),onContextmenu:Fe=>re(Fe,pe),onMousedown:Fe=>Ce(Fe,pe),onMousemove:Fe=>ie(Fe,pe),onMouseout:le},[vue.h("div",{class:["cell",pe.filteredValue&&pe.filteredValue.length>0?"highlight":""]},[pe.renderHeader?pe.renderHeader({column:pe,$index:ze,store:Ie,_self:ue}):pe.label,pe.sortable&&vue.h("span",{onClick:Fe=>ae(Fe,pe),class:"caret-wrapper"},[vue.h("i",{onClick:Fe=>ae(Fe,pe,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Fe=>ae(Fe,pe,"descending"),class:"sort-caret descending"})]),pe.filterable&&vue.h(FilterPanel,{store:Ie,placement:pe.filterPlacement||"bottom-start",column:pe,upDataColumn:(Fe,xe)=>{pe[Fe]=xe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:k}=useZIndex(),V=(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie);let ze;const Fe=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;pe&&(ze=getColumnByCell({columns:i.store.states.columns.value},pe,Fe),ze&&(he==null||he.emit(`cell-${de}`,ue,ze,pe,Ie))),he==null||he.emit(`row-${de}`,ue,ze,Ie)},$=(Ie,ue)=>{V(Ie,ue,"dblclick")},oe=(Ie,ue)=>{i.store.commit("setCurrentRow",ue),V(Ie,ue,"click")},re=(Ie,ue)=>{V(Ie,ue,"contextmenu")},Ce=debounce(Ie=>{i.store.commit("setHoverRow",Ie)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30);return{handleDoubleClick:$,handleClick:oe,handleContextMenu:re,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie),ze=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;if(pe){const $e=getColumnByCell({columns:i.store.states.columns.value},pe,ze),Ue=he.hoverState={cell:pe,column:$e,row:ue};he==null||he.emit("cell-mouse-enter",Ue.row,Ue.column,Ue.cell,Ie)}if(!de)return;const Fe=Ie.target.querySelector(".cell");if(!(hasClass(Fe,`${ze}-tooltip`)&&Fe.childNodes.length))return;const xe=document.createRange();xe.setStart(Fe,0),xe.setEnd(Fe,Fe.childNodes.length);const _e=Math.round(xe.getBoundingClientRect().width),Dt=(Number.parseInt(getStyle$1(Fe,"paddingLeft"),10)||0)+(Number.parseInt(getStyle$1(Fe,"paddingRight"),10)||0);(_e+Dt>Fe.offsetWidth||Fe.scrollWidth>Fe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,k,de)},handleCellMouseLeave:Ie=>{if(!getCell(Ie))return;const de=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",de==null?void 0:de.row,de==null?void 0:de.column,de==null?void 0:de.cell,Ie)},tooltipContent:r,tooltipTrigger:g}}function useStyles(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getRowStyle:(Ce,ie)=>{const ae=n==null?void 0:n.props.rowStyle;return typeof ae=="function"?ae.call(null,{row:Ce,rowIndex:ie}):ae||null},getRowClass:(Ce,ie)=>{const ae=[r.e("row")];n!=null&&n.props.highlightCurrentRow&&Ce===i.store.states.currentRow.value&&ae.push("current-row"),i.stripe&&ie%2===1&&ae.push(r.em("row","striped"));const le=n==null?void 0:n.props.rowClassName;return typeof le=="string"?ae.push(le):typeof le=="function"&&ae.push(le.call(null,{row:Ce,rowIndex:ie})),ae},getCellStyle:(Ce,ie,ae,le)=>{const Ie=n==null?void 0:n.props.cellStyle;let ue=Ie??{};typeof Ie=="function"&&(ue=Ie.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le}));const de=getFixedColumnOffset(ie,i==null?void 0:i.fixed,i.store);return ensurePosition(de,"left"),ensurePosition(de,"right"),Object.assign({},ue,de)},getCellClass:(Ce,ie,ae,le,Ie)=>{const ue=getFixedColumnsClass(r.b(),ie,i==null?void 0:i.fixed,i.store,void 0,Ie),de=[le.id,le.align,le.className,...ue],Ne=n==null?void 0:n.props.cellClassName;return typeof Ne=="string"?de.push(Ne):typeof Ne=="function"&&de.push(Ne.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le})),de.push(r.e("cell")),de.filter(he=>!!he).join(" ")},getSpan:(Ce,ie,ae,le)=>{let Ie=1,ue=1;const de=n==null?void 0:n.props.spanMethod;if(typeof de=="function"){const Ne=de({row:Ce,column:ie,rowIndex:ae,columnIndex:le});Array.isArray(Ne)?(Ie=Ne[0],ue=Ne[1]):typeof Ne=="object"&&(Ie=Ne.rowspan,ue=Ne.colspan)}return{rowspan:Ie,colspan:ue}},getColspanRealWidth:(Ce,ie,ae)=>{if(ie<1)return Ce[ae].realWidth;const le=Ce.map(({realWidth:Ie,width:ue})=>Ie||ue).slice(ae,ae+ie);return Number(le.reduce((Ie,ue)=>Number(Ie)+Number(ue),-1))}}}function useRender$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table"),{handleDoubleClick:g,handleClick:k,handleContextMenu:V,handleMouseEnter:$,handleMouseLeave:oe,handleCellMouseEnter:re,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),pe=vue.computed(()=>i.store.states.columns.value.findIndex(({type:Dt})=>Dt==="default")),ze=(Dt,$e)=>{const Ue=n.props.rowKey;return Ue?getRowIdentity(Dt,Ue):$e},Fe=(Dt,$e,Ue,Ve=!1)=>{const{tooltipEffect:Oe,tooltipOptions:At,store:qe}=i,{indent:Lt,columns:kt}=qe.states,jt=Ie(Dt,$e);let ti=!0;Ue&&(jt.push(r.em("row",`level-${Ue.level}`)),ti=Ue.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(Dt,$e)],class:jt,key:ze(Dt,$e),onDblclick:Pt=>g(Pt,Dt),onClick:Pt=>k(Pt,Dt),onContextmenu:Pt=>V(Pt,Dt),onMouseenter:()=>$($e),onMouseleave:oe},kt.value.map((Pt,ni)=>{const{rowspan:gi,colspan:di}=Ne(Dt,Pt,$e,ni);if(!gi||!di)return null;const li={...Pt};li.realWidth=he(kt.value,di,ni);const ai={store:i.store,_self:i.context||n,column:li,row:Dt,$index:$e,cellIndex:ni,expanded:Ve};ni===pe.value&&Ue&&(ai.treeNode={indent:Ue.level*Lt.value,level:Ue.level},typeof Ue.expanded=="boolean"&&(ai.treeNode.expanded=Ue.expanded,"loading"in Ue&&(ai.treeNode.loading=Ue.loading),"noLazyChildren"in Ue&&(ai.treeNode.noLazyChildren=Ue.noLazyChildren)));const ci=`${$e},${ni}`,pi=li.columnKey||li.rawColumnKey||"",yi=xe(ni,Pt,ai),Ai=Pt.showOverflowTooltip&&merge$2({effect:Oe},At,Pt.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,Dt,Pt),class:de($e,ni,Dt,Pt,di-1),key:`${pi}${ci}`,rowspan:gi,colspan:di,onMouseenter:hi=>re(hi,Dt,Ai),onMouseleave:Ce},[yi])}))},xe=(Dt,$e,Ue)=>$e.renderCell(Ue);return{wrappedRowRender:(Dt,$e)=>{const Ue=i.store,{isRowExpanded:Ve,assertRowKey:Oe}=Ue,{treeData:At,lazyTreeNodeMap:qe,childrenColumnName:Lt,rowKey:kt}=Ue.states,jt=Ue.states.columns.value;if(jt.some(({type:ei})=>ei==="expand")){const ei=Ve(Dt),Pt=Fe(Dt,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Pt,vue.h("tr",{key:`expanded-row__${Pt.key}`},[vue.h("td",{colspan:jt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:Dt,$index:$e,store:Ue,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Pt):[[Pt]]}else if(Object.keys(At.value).length){Oe();const ei=getRowIdentity(Dt,kt.value);let Pt=At.value[ei],ni=null;Pt&&(ni={expanded:Pt.expanded,level:Pt.level,display:!0},typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(ni.noLazyChildren=!(Pt.children&&Pt.children.length)),ni.loading=Pt.loading));const gi=[Fe(Dt,$e,ni)];if(Pt){let di=0;const li=(ci,pi)=>{ci&&ci.length&&pi&&ci.forEach(yi=>{const Ai={display:pi.display&&pi.expanded,level:pi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},hi=getRowIdentity(yi,kt.value);if(hi==null)throw new Error("For nested data item, row-key is required.");if(Pt={...At.value[hi]},Pt&&(Ai.expanded=Pt.expanded,Pt.level=Pt.level||Ai.level,Pt.display=!!(Pt.expanded&&Ai.display),typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(Ai.noLazyChildren=!(Pt.children&&Pt.children.length)),Ai.loading=Pt.loading)),di++,gi.push(Fe(yi,$e+di,Ai)),Pt){const wi=qe.value[hi]||yi[Lt.value];li(wi,Pt)}})};Pt.display=!0;const ai=qe.value[ei]||Dt[Lt.value];li(ai,Pt)}return gi}else return Fe(Dt,$e,void 0)},tooltipContent:ie,tooltipTrigger:ae}}const defaultProps$2={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var TableBody=vue.defineComponent({name:"ElTableBody",props:defaultProps$2,setup(i){const n=vue.getCurrentInstance(),r=vue.inject(TABLE_INJECTION_KEY),g=useNamespace("table"),{wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:oe,onScrollableChange:re}=useLayoutObserver(r);return vue.watch(i.store.states.hoverRow,(Ce,ie)=>{if(!i.store.states.isComplex.value||!isClient)return;let ae=window.requestAnimationFrame;ae||(ae=le=>window.setTimeout(le,16)),ae(()=>{const le=n==null?void 0:n.vnode.el,Ie=Array.from((le==null?void 0:le.children)||[]).filter(Ne=>Ne==null?void 0:Ne.classList.contains(`${g.e("row")}`)),ue=Ie[ie],de=Ie[Ce];ue&&removeClass(ue,"hover-row"),de&&addClass(de,"hover-row")})}),vue.onUnmounted(()=>{var Ce;(Ce=removePopper)==null||Ce()}),{ns:g,onColumnsChange:oe,onScrollableChange:re,wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,k)=>g.concat(i(k,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(k=>k.width===void 0)&&(r=[]);const g=k=>{const V={key:`${i.tableLayout}_${k.id}`,style:{},name:void 0};return n?V.style={width:`${k.width}px`}:V.name=k.id,V};return vue.h("colgroup",{},r.map(k=>vue.h("col",g(k))))}hColgroup.props=["columns","tableLayout"];function useMapState(){const i=vue.inject(TABLE_INJECTION_KEY),n=i==null?void 0:i.store,r=vue.computed(()=>n.states.fixedLeafColumnsLength.value),g=vue.computed(()=>n.states.rightFixedColumns.value.length),k=vue.computed(()=>n.states.columns.value.length),V=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:k,leftFixedCount:V,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(V,$)=>{const oe=V[$],re=[r.e("cell"),oe.id,oe.align,oe.labelClassName,...getFixedColumnsClass(r.b(),$,oe.fixed,i.store)];return oe.className&&re.push(oe.className),oe.children||re.push(r.is("leaf")),re},getCellStyles:(V,$)=>{const oe=getFixedColumnOffset($,V.fixed,i.store);return ensurePosition(oe,"left"),ensurePosition(oe,"right"),oe},columns:n}}var TableFooter=vue.defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i){const{getCellClasses:n,getCellStyles:r,columns:g}=useStyle$1(i);return{ns:useNamespace("table"),getCellClasses:n,getCellStyles:r,columns:g}},render(){const{columns:i,getCellStyles:n,getCellClasses:r,summaryMethod:g,sumText:k,ns:V}=this,$=this.store.states.data.value;let oe=[];return g?oe=g({columns:i,data:$}):i.forEach((re,Ce)=>{if(Ce===0){oe[Ce]=k;return}const ie=$.map(ue=>Number(ue[re.property])),ae=[];let le=!0;ie.forEach(ue=>{if(!Number.isNaN(+ue)){le=!1;const de=`${ue}`.split(".")[1];ae.push(de?de.length:0)}});const Ie=Math.max.apply(null,ae);le?oe[Ce]="":oe[Ce]=ie.reduce((ue,de)=>{const Ne=Number(de);return Number.isNaN(+Ne)?ue:Number.parseFloat((ue+de).toFixed(Math.min(Ie,20)))},0)}),vue.h("table",{class:V.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((re,Ce)=>vue.h("td",{key:Ce,colspan:re.colSpan,rowspan:re.rowSpan,class:r(i,Ce),style:n(re,Ce)},[vue.h("div",{class:["cell",re.labelClassName]},[oe[Ce]])]))])])])}});function useUtils(i){return{setCurrentRow:ie=>{i.commit("setCurrentRow",ie)},getSelectionRows:()=>i.getSelectionRows(),toggleRowSelection:(ie,ae)=>{i.toggleRowSelection(ie,ae,!1),i.updateAllSelected()},clearSelection:()=>{i.clearSelection()},clearFilter:ie=>{i.clearFilter(ie)},toggleAllSelection:()=>{i.commit("toggleAllSelection")},toggleRowExpansion:(ie,ae)=>{i.toggleRowExpansionAdapter(ie,ae)},clearSort:()=>{i.clearSort()},sort:(ie,ae)=>{i.commit("sort",{prop:ie,order:ae})}}}function useStyle(i,n,r,g){const k=vue.ref(!1),V=vue.ref(null),$=vue.ref(!1),oe=Pt=>{$.value=Pt},re=vue.ref({width:null,height:null,headerHeight:null}),Ce=vue.ref(!1),ie={display:"inline-block",verticalAlign:"middle"},ae=vue.ref(),le=vue.ref(0),Ie=vue.ref(0),ue=vue.ref(0),de=vue.ref(0),Ne=vue.ref(0);vue.watchEffect(()=>{n.setHeight(i.height)}),vue.watchEffect(()=>{n.setMaxHeight(i.maxHeight)}),vue.watch(()=>[i.currentRowKey,r.states.rowKey],([Pt,ni])=>{!vue.unref(ni)||!vue.unref(Pt)||r.setCurrentRowKey(`${Pt}`)},{immediate:!0}),vue.watch(()=>i.data,Pt=>{g.store.commit("setData",Pt)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},pe=(Pt,ni)=>{const{pixelX:gi,pixelY:di}=ni;Math.abs(gi)>=Math.abs(di)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},ze=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Fe=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),xe=()=>{ze.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Ue)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ve(),requestAnimationFrame(xe);const Pt=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Pt&&Pt.parentElement&&(Pt.parentElement.style.minWidth="0"),re.value={width:ae.value=Pt.offsetWidth,height:Pt.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(gi=>{gi.filteredValue&&gi.filteredValue.length&&g.store.commit("filterChange",{column:gi,values:gi.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Pt,ni)=>{if(!Pt)return;const gi=Array.from(Pt.classList).filter(di=>!di.startsWith("is-scrolling-"));gi.push(n.scrollX.value?ni:"is-scrolling-none"),Pt.className=gi.join(" ")},Dt=Pt=>{const{tableWrapper:ni}=g.refs;_e(ni,Pt)},$e=Pt=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Pt))},Ue=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const pi="is-scrolling-none";$e(pi)||Dt(pi);return}const Pt=g.refs.scrollBarRef.wrapRef;if(!Pt)return;const{scrollLeft:ni,offsetWidth:gi,scrollWidth:di}=Pt,{headerWrapper:li,footerWrapper:ai}=g.refs;li&&(li.scrollLeft=ni),ai&&(ai.scrollLeft=ni);const ci=di-gi-1;ni>=ci?Dt("is-scrolling-right"):Dt(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ve=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Ue,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,Oe):useEventListener(window,"resize",Oe),useResizeObserver(g.refs.bodyWrapper,()=>{var Pt,ni;Oe(),(ni=(Pt=g.refs)==null?void 0:Pt.scrollBarRef)==null||ni.update()}))},Oe=()=>{var Pt,ni,gi,di;const li=g.vnode.el;if(!g.$ready||!li)return;let ai=!1;const{width:ci,height:pi,headerHeight:yi}=re.value,Ai=ae.value=li.offsetWidth;ci!==Ai&&(ai=!0);const hi=li.offsetHeight;(i.height||ze.value)&&pi!==hi&&(ai=!0);const wi=i.tableLayout==="fixed"?g.refs.headerWrapper:(Pt=g.refs.tableHeaderRef)==null?void 0:Pt.$el;i.showHeader&&(wi==null?void 0:wi.offsetHeight)!==yi&&(ai=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(wi==null?void 0:wi.scrollHeight)||0,de.value=((gi=g.refs.footerWrapper)==null?void 0:gi.offsetHeight)||0,Ne.value=((di=g.refs.appendWrapper)==null?void 0:di.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,ai&&(re.value={width:Ai,height:hi,headerHeight:i.showHeader&&(wi==null?void 0:wi.offsetHeight)||0},xe())},At=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Pt,scrollY:ni,gutterWidth:gi}=n;return Pt.value?`${Pt.value-(ni.value?gi:0)}px`:""}),Lt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),kt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Pt="100%";i.height&&Ie.value&&(Pt=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Pt}}),jt=vue.computed(()=>i.height?{height:Number.isNaN(Number(i.height))?i.height:`${i.height}px`}:i.maxHeight?{maxHeight:Number.isNaN(Number(i.maxHeight))?i.maxHeight:`${i.maxHeight}px`}:{}),ti=vue.computed(()=>i.height?{height:"100%"}:i.maxHeight?Number.isNaN(Number(i.maxHeight))?{maxHeight:`calc(${i.maxHeight} - ${ue.value+de.value}px)`}:{maxHeight:`${i.maxHeight-ue.value-de.value}px`}:{});return{isHidden:k,renderExpanded:V,setDragVisible:oe,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:pe,tableSize:At,emptyBlockStyle:kt,handleFixedMousewheel:(Pt,ni)=>{const gi=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const di=gi.scrollTop;ni.pixelY<0&&di!==0&&Pt.preventDefault(),ni.pixelY>0&&gi.scrollHeight-gi.clientHeight>di&&Pt.preventDefault(),gi.scrollTop+=Math.ceil(ni.pixelY/5)}else gi.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:re,doLayout:xe,tableBodyStyles:Fe,tableLayout:Lt,scrollbarViewStyle:ie,tableInnerStyle:jt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const k=i.vnode.el.querySelector(".hidden-columns"),V={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(oe=>oe())}),n.value.observe(k,V)};vue.onMounted(()=>{r()}),vue.onUnmounted(()=>{var g;(g=n.value)==null||g.disconnect()})}var defaultProps$1={data:{type:Array,default:()=>[]},size:useSizeProp,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};const useScrollbar=()=>{const i=vue.ref(),n=(V,$)=>{const oe=i.value;oe&&oe.scrollTo(V,$)},r=(V,$)=>{const oe=i.value;oe&&isNumber$1($)&&["Top","Left"].includes(V)&&oe[`setScroll${V}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:V=>r("Top",V),setScrollLeft:V=>r("Left",V)}};let tableIdSeed=1;const _sfc_main$C=vue.defineComponent({name:"ElTable",directives:{Mousewheel},components:{TableHeader,TableBody,TableFooter,ElScrollbar,hColgroup},props:defaultProps$1,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(i){const{t:n}=useLocale(),r=useNamespace("table"),g=vue.getCurrentInstance();vue.provide(TABLE_INJECTION_KEY,g);const k=createStore(g,i);g.store=k;const V=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=V;const $=vue.computed(()=>(k.states.data.value||[]).length===0),{setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(k),{isHidden:Ne,renderExpanded:he,setDragVisible:pe,isGroup:ze,handleMouseLeave:Fe,handleHeaderFooterMousewheel:xe,tableSize:_e,emptyBlockStyle:Dt,handleFixedMousewheel:$e,resizeProxyVisible:Ue,bodyWidth:Ve,resizeState:Oe,doLayout:At,tableBodyStyles:qe,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti}=useStyle(i,V,k,g),{scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}=useScrollbar(),di=debounce(At,50),li=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=li,g.state={isGroup:ze,resizeState:Oe,doLayout:At,debouncedUpdateLayout:di};const ai=vue.computed(()=>i.sumText||n("el.table.sumText")),ci=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:V,store:k,handleHeaderFooterMousewheel:xe,handleMouseLeave:Fe,tableId:li,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Ue,resizeState:Oe,isGroup:ze,bodyWidth:Ve,tableBodyStyles:qe,emptyBlockStyle:Dt,debouncedUpdateLayout:di,handleFixedMousewheel:$e,setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:At,sort:de,t:n,setDragVisible:pe,context:g,computedSumText:ai,computedEmptyText:ci,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}}}),_hoisted_1$r=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$4(i,n,r,g,k,V){const $=vue.resolveComponent("hColgroup"),oe=vue.resolveComponent("table-header"),re=vue.resolveComponent("table-body"),Ce=vue.resolveComponent("el-scrollbar"),ie=vue.resolveComponent("table-footer"),ae=vue.resolveDirective("mousewheel");return vue.openBlock(),vue.createElementBlock("div",{ref:"tableWrapper",class:vue.normalizeClass([{[i.ns.m("fit")]:i.fit,[i.ns.m("striped")]:i.stripe,[i.ns.m("border")]:i.border||i.isGroup,[i.ns.m("hidden")]:i.isHidden,[i.ns.m("group")]:i.isGroup,[i.ns.m("fluid-height")]:i.maxHeight,[i.ns.m("scrollable-x")]:i.layout.scrollX.value,[i.ns.m("scrollable-y")]:i.layout.scrollY.value,[i.ns.m("enable-row-hover")]:!i.store.states.isComplex.value,[i.ns.m("enable-row-transition")]:(i.store.states.data.value||[]).length!==0&&(i.store.states.data.value||[]).length<100,"has-footer":i.showSummary},i.ns.m(i.tableSize),i.className,i.ns.b(),i.ns.m(`layout-${i.tableLayout}`)]),style:vue.normalizeStyle(i.style),"data-prefix":i.ns.namespace.value,onMouseleave:n[0]||(n[0]=(...le)=>i.handleMouseLeave&&i.handleMouseLeave(...le))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("inner-wrapper")),style:vue.normalizeStyle(i.tableInnerStyle)},[vue.createElementVNode("div",_hoisted_2$l,[vue.renderSlot(i.$slots,"default")],512),i.showHeader&&i.tableLayout==="fixed"?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerWrapper",class:vue.normalizeClass(i.ns.e("header-wrapper"))},[vue.createElementVNode("table",{ref:"tableHeader",class:vue.normalizeClass(i.ns.e("header")),style:vue.normalizeStyle(i.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),vue.createVNode(oe,{ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"bodyWrapper",class:vue.normalizeClass(i.ns.e("body-wrapper"))},[vue.createVNode(Ce,{ref:"scrollBarRef","view-style":i.scrollbarViewStyle,"wrap-style":i.scrollbarStyle,always:i.scrollbarAlwaysOn},{default:vue.withCtx(()=>[vue.createElementVNode("table",{ref:"tableBody",class:vue.normalizeClass(i.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:vue.normalizeStyle({width:i.bodyWidth,tableLayout:i.tableLayout})},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),i.showHeader&&i.tableLayout==="auto"?(vue.openBlock(),vue.createBlock(oe,{key:0,ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):vue.createCommentVNode("v-if",!0),vue.createVNode(re,{context:i.context,highlight:i.highlightCurrentRow,"row-class-name":i.rowClassName,"tooltip-effect":i.tooltipEffect,"tooltip-options":i.tooltipOptions,"row-style":i.rowStyle,store:i.store,stripe:i.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"])],6),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"emptyBlock",style:vue.normalizeStyle(i.emptyBlockStyle),class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(i.computedEmptyText),1)])],2)],6)):vue.createCommentVNode("v-if",!0),i.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"appendWrapper",class:vue.normalizeClass(i.ns.e("append-wrapper"))},[vue.renderSlot(i.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),i.showSummary?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"footerWrapper",class:vue.normalizeClass(i.ns.e("footer-wrapper"))},[vue.createVNode(ie,{border:i.border,"default-sort":i.defaultSort,store:i.store,style:vue.normalizeStyle(i.tableBodyStyles),"sum-text":i.computedSumText,"summary-method":i.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[vue.vShow,!i.isEmpty],[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),i.border||i.isGroup?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.ns.e("border-left-patch"))},null,2)):vue.createCommentVNode("v-if",!0)],6),vue.withDirectives(vue.createElementVNode("div",{ref:"resizeProxy",class:vue.normalizeClass(i.ns.e("column-resize-proxy"))},null,2),[[vue.vShow,i.resizeProxyVisible]])],46,_hoisted_1$r)}var Table=_export_sfc$1(_sfc_main$C,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const defaultClassNames={selection:"table-column--selection",expand:"table__expand-column"},cellStarts={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},getDefaultClassName=i=>defaultClassNames[i]||"",cellForced={selection:{renderHeader({store:i}){function n(){return i.states.data.value&&i.states.data.value.length===0}return vue.h(ElCheckbox,{disabled:n(),size:i.states.tableSize.value,indeterminate:i.states.selection.value.length>0&&!i.states.isAllSelected.value,"onUpdate:modelValue":i.toggleAllSelection,modelValue:i.states.isAllSelected.value})},renderCell({row:i,column:n,store:r,$index:g}){return vue.h(ElCheckbox,{disabled:n.selectable?!n.selectable.call(null,i,g):!1,size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",i)},onClick:k=>k.stopPropagation(),modelValue:r.isSelected(i)})},sortable:!1,resizable:!1},index:{renderHeader({column:i}){return i.label||"#"},renderCell({column:i,$index:n}){let r=n+1;const g=i.index;return typeof g=="number"?r=n+g:typeof g=="function"&&(r=g(n)),vue.h("div",{},[r])},sortable:!1},expand:{renderHeader({column:i}){return i.label||""},renderCell({row:i,store:n,expanded:r}){const{ns:g}=n,k=[g.e("expand-icon")];r&&k.push(g.em("expand-icon","expanded"));const V=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:k,onClick:V},{default:()=>[vue.h(ElIcon,null,{default:()=>[vue.h(arrow_right_default)]})]})},sortable:!1,resizable:!1}};function defaultRenderCell({row:i,column:n,$index:r}){var g;const k=n.property,V=k&&getProp(i,k).value;return n&&n.formatter?n.formatter(i,n,V,r):((g=V==null?void 0:V.toString)==null?void 0:g.call(V))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:k}=r;if(!n)return g?[vue.h("span",{class:k.e("placeholder")})]:null;const V=[],$=function(oe){oe.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&V.push(vue.h("span",{class:k.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const oe=[k.e("expand-icon"),n.expanded?k.em("expand-icon","expanded"):""];let re=arrow_right_default;n.loading&&(re=loading_default),V.push(vue.h("div",{class:oe,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[k.is("loading")]:n.loading}},{default:()=>[vue.h(re)]})]}))}else V.push(vue.h("span",{class:k.e("placeholder")}));return V}function getAllAliases(i,n){return i.reduce((r,g)=>(r[g]=g,r),n)}function useWatcher(i,n){const r=vue.getCurrentInstance();return{registerComplexWatchers:()=>{const V=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&re==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&re==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[re]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const V=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[re]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),k=vue.ref(""),V=vue.ref(!1),$=vue.ref(),oe=vue.ref(),re=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{oe.value=i.headerAlign?`is-${i.headerAlign}`:$.value,oe.value});const Ce=vue.computed(()=>{let Fe=g.vnode.vParent||g.parent;for(;Fe&&!Fe.tableId&&!Fe.columnId;)Fe=Fe.vnode.vParent||Fe.parent;return Fe}),ie=vue.computed(()=>{const{store:Fe}=g.parent;if(!Fe)return!1;const{treeData:xe}=Fe.states,_e=xe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Fe=>(ae.value&&(Fe.width=ae.value),le.value&&(Fe.minWidth=le.value),!ae.value&&le.value&&(Fe.width=void 0),Fe.minWidth||(Fe.minWidth=80),Fe.realWidth=Number(Fe.width===void 0?Fe.minWidth:Fe.width),Fe),ue=Fe=>{const xe=Fe.type,_e=cellForced[xe]||{};Object.keys(_e).forEach($e=>{const Ue=_e[$e];$e!=="className"&&Ue!==void 0&&(Fe[$e]=Ue)});const Dt=getDefaultClassName(xe);if(Dt){const $e=`${vue.unref(re.namespace)}-${Dt}`;Fe.className=Fe.className?`${Fe.className} ${$e}`:$e}return Fe},de=Fe=>{Array.isArray(Fe)?Fe.forEach(_e=>xe(_e)):xe(Fe);function xe(_e){var Dt;((Dt=_e==null?void 0:_e.type)==null?void 0:Dt.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:k,realAlign:$,isSubColumn:V,realHeaderAlign:oe,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Fe=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Fe.type!=="selection"&&(Fe.renderHeader=_e=>{g.columnConfig.value.label;const Dt=n.header;return Dt?Dt(_e):Fe.label});let xe=Fe.renderCell;return Fe.type==="expand"?(Fe.renderCell=_e=>vue.h("div",{class:"cell"},[xe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(xe=xe||defaultRenderCell,Fe.renderCell=_e=>{let Dt=null;if(n.default){const qe=n.default(_e);Dt=qe.some(Lt=>Lt.type!==vue.Comment)?qe:xe(_e)}else Dt=xe(_e);const{columns:$e}=r.value.store.states,Ue=$e.value.findIndex(qe=>qe.type==="default"),Ve=ie.value&&_e.cellIndex===Ue,Oe=treeCellPrefix(_e,Ve),At={class:"cell",style:{}};return Fe.showOverflowTooltip&&(At.class=`${At.class} ${vue.unref(re.namespace)}-tooltip`,At.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(Dt),vue.h("div",At,[Oe,Dt])}),Fe},getPropsData:(...Fe)=>Fe.reduce((xe,_e)=>(Array.isArray(_e)&&_e.forEach(Dt=>{xe[Dt]=i[Dt]}),xe),{}),getColumnElIndex:(Fe,xe)=>Array.prototype.indexOf.call(Fe,xe),updateColumnOrder:()=>{r.value.store.commit("updateColumnOrder",g.columnConfig.value)}}}var defaultProps={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:i=>i.every(n=>["ascending","descending",null].includes(n))}};let columnIdSeed=1;var ElTableColumn$1=vue.defineComponent({name:"ElTableColumn",components:{ElCheckbox},props:defaultProps,setup(i,{slots:n}){const r=vue.getCurrentInstance(),g=vue.ref({}),k=vue.computed(()=>{let ze=r.parent;for(;ze&&!ze.tableId;)ze=ze.parent;return ze}),{registerNormalWatchers:V,registerComplexWatchers:$}=useWatcher(k,i),{columnId:oe,isSubColumn:re,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,k),pe=ie.value;oe.value=`${pe.tableId||pe.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{re.value=k.value!==pe;const ze=i.type||"default",Fe=i.sortable===""?!0:i.sortable,xe=isUndefined(i.showOverflowTooltip)?pe.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[ze],id:oe.value,type:ze,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:xe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Fe,index:i.index,rawColumnKey:r.vnode.key};let Oe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);Oe=mergeOptions(_e,Oe),Oe=compose(Ie,ae,le)(Oe),g.value=Oe,V(),$()}),vue.onMounted(()=>{var ze;const Fe=ie.value,xe=re.value?Fe.vnode.el.children:(ze=Fe.refs.hiddenColumns)==null?void 0:ze.children,_e=()=>de(xe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&k.value.store.commit("insertColumn",g.value,re.value?Fe.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{k.value.store.commit("removeColumn",g.value,re.value?pe.columnConfig.value:null,he)}),r.columnId=oe.value,r.columnConfig=g},render(){var i,n,r;try{const g=(n=(i=this.$slots).default)==null?void 0:n.call(i,{row:{},column:{},$index:-1}),k=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?k.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(oe=>{(oe==null?void 0:oe.patchFlag)!==1024&&!isString$1(oe==null?void 0:oe.children)&&k.push(oe)});return vue.h("div",k)}catch{return vue.h("div",[])}}});const ElTable=withInstall(Table,{TableColumn:ElTableColumn$1}),ElTableColumn=withNoopInstall(ElTableColumn$1),tabsRootContextKey=Symbol("tabsRootContextKey"),tabBarProps=buildProps({tabs:{type:definePropType(Array),default:()=>mutable([])}}),COMPONENT_NAME$3="ElTabBar",__default__$6=vue.defineComponent({name:COMPONENT_NAME$3}),_sfc_main$B=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const V=useNamespace("tabs"),$=vue.ref(),oe=vue.ref(),re=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(k.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const pe=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!pe)return!1;if(!de.active)return!0;ie=pe[`offset${capitalize(ue)}`],ae=pe[`client${capitalize(le)}`];const ze=window.getComputedStyle(pe);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(ze.paddingLeft)+Number.parseFloat(ze.paddingRight)),ie+=Number.parseFloat(ze.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>oe.value=re();return vue.watch(()=>r.tabs,async()=>{await vue.nextTick(),Ce()},{immediate:!0}),useResizeObserver($,()=>Ce()),n({ref:$,update:Ce}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"barRef",ref:$,class:vue.normalizeClass([vue.unref(V).e("active-bar"),vue.unref(V).is(vue.unref(k).props.tabPosition)]),style:vue.normalizeStyle(oe.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$B,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const tabNavProps=buildProps({panes:{type:definePropType(Array),default:()=>mutable([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),tabNavEmits={tabClick:(i,n,r)=>r instanceof Event,tabRemove:(i,n)=>n instanceof Event},COMPONENT_NAME$2="ElTabNav",TabNav=vue.defineComponent({name:COMPONENT_NAME$2,props:tabNavProps,emits:tabNavEmits,setup(i,{expose:n,emit:r}){const g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const V=useNamespace("tabs"),$=useDocumentVisibility(),oe=useWindowFocus(),re=vue.ref(),Ce=vue.ref(),ie=vue.ref(),ae=vue.ref(),le=vue.ref(!1),Ie=vue.ref(0),ue=vue.ref(!1),de=vue.ref(!0),Ne=vue.computed(()=>["top","bottom"].includes(k.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),pe=()=>{if(!re.value)return;const Ue=re.value[`offset${capitalize(Ne.value)}`],Ve=Ie.value;if(!Ve)return;const Oe=Ve>Ue?Ve-Ue:0;Ie.value=Oe},ze=()=>{if(!re.value||!Ce.value)return;const Ue=Ce.value[`offset${capitalize(Ne.value)}`],Ve=re.value[`offset${capitalize(Ne.value)}`],Oe=Ie.value;if(Ue-Oe<=Ve)return;const At=Ue-Oe>Ve*2?Oe+Ve:Ue-Ve;Ie.value=At},Fe=async()=>{const Ue=Ce.value;if(!le.value||!ie.value||!re.value||!Ue)return;await vue.nextTick();const Ve=ie.value.querySelector(".is-active");if(!Ve)return;const Oe=re.value,At=["top","bottom"].includes(k.props.tabPosition),qe=Ve.getBoundingClientRect(),Lt=Oe.getBoundingClientRect(),kt=At?Ue.offsetWidth-Lt.width:Ue.offsetHeight-Lt.height,jt=Ie.value;let ti=jt;At?(qe.left<Lt.left&&(ti=jt-(Lt.left-qe.left)),qe.right>Lt.right&&(ti=jt+qe.right-Lt.right)):(qe.top<Lt.top&&(ti=jt-(Lt.top-qe.top)),qe.bottom>Lt.bottom&&(ti=jt+(qe.bottom-Lt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,kt)},xe=()=>{var Ue;if(!Ce.value||!re.value)return;i.stretch&&((Ue=ae.value)==null||Ue.update());const Ve=Ce.value[`offset${capitalize(Ne.value)}`],Oe=re.value[`offset${capitalize(Ne.value)}`],At=Ie.value;Oe<Ve?(le.value=le.value||{},le.value.prev=At,le.value.next=At+Oe<Ve,Ve-At<Oe&&(Ie.value=Ve-Oe)):(le.value=!1,At>0&&(Ie.value=0))},_e=Ue=>{const Ve=Ue.code,{up:Oe,down:At,left:qe,right:Lt}=EVENT_CODE;if(![Oe,At,qe,Lt].includes(Ve))return;const kt=Array.from(Ue.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),jt=kt.indexOf(Ue.target);let ti;Ve===qe||Ve===Oe?jt===0?ti=kt.length-1:ti=jt-1:jt<kt.length-1?ti=jt+1:ti=0,kt[ti].focus({preventScroll:!0}),kt[ti].click(),Dt()},Dt=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Ue=>{Ue==="hidden"?de.value=!1:Ue==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(oe,Ue=>{Ue?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,xe),vue.onMounted(()=>setTimeout(()=>Fe(),0)),vue.onUpdated(()=>xe()),n({scrollToActiveTab:Fe,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Ue=le.value?[vue.createVNode("span",{class:[V.e("nav-prev"),V.is("disabled",!le.value.prev)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[V.e("nav-next"),V.is("disabled",!le.value.next)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ve=i.panes.map((Oe,At)=>{var qe,Lt,kt,jt;const ti=Oe.uid,ei=Oe.props.disabled,Pt=(Lt=(qe=Oe.props.name)!=null?qe:Oe.index)!=null?Lt:`${At}`,ni=!ei&&(Oe.isClosable||i.editable);Oe.index=`${At}`;const gi=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:ai=>r("tabRemove",Oe,ai)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,di=((jt=(kt=Oe.slots).label)==null?void 0:jt.call(kt))||Oe.props.label,li=!ei&&Oe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[V.e("item"),V.is(k.props.tabPosition),V.is("active",Oe.active),V.is("disabled",ei),V.is("closable",ni),V.is("focus",ue.value)],id:`tab-${Pt}`,key:`tab-${ti}`,"aria-controls":`pane-${Pt}`,role:"tab","aria-selected":Oe.active,tabindex:li,onFocus:()=>Dt(),onBlur:()=>$e(),onClick:ai=>{$e(),r("tabClick",Oe,Pt,ai)},onKeydown:ai=>{ni&&(ai.code===EVENT_CODE.delete||ai.code===EVENT_CODE.backspace)&&r("tabRemove",Oe,ai)}},[di,gi])});return vue.createVNode("div",{ref:ie,class:[V.e("nav-wrap"),V.is("scrollable",!!le.value),V.is(k.props.tabPosition)]},[Ue,vue.createVNode("div",{class:V.e("nav-scroll"),ref:re},[vue.createVNode("div",{class:[V.e("nav"),V.is(k.props.tabPosition),V.is("stretch",i.stretch&&["top","bottom"].includes(k.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ve])])])}}}),tabsProps=buildProps({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:definePropType(Function),default:()=>!0},stretch:Boolean}),isPaneName=i=>isString$1(i)||isNumber$1(i),tabsEmits={[UPDATE_MODEL_EVENT]:i=>isPaneName(i),tabClick:(i,n)=>n instanceof Event,tabChange:i=>isPaneName(i),edit:(i,n)=>["remove","add"].includes(n),tabRemove:i=>isPaneName(i),tabAdd:()=>!0};var Tabs=vue.defineComponent({name:"ElTabs",props:tabsProps,emits:tabsEmits,setup(i,{emit:n,slots:r,expose:g}){var k,V;const $=useNamespace("tabs"),{children:oe,addChild:re,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((V=(k=i.modelValue)!=null?k:i.activeName)!=null?V:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var pe,ze,Fe;if(!(ae.value===he||isUndefined(he)))try{await((pe=i.beforeLeave)==null?void 0:pe.call(i,he,ae.value))!==!1&&(le(he),(Fe=(ze=ie.value)==null?void 0:ze.removeFocus)==null||Fe.call(ze))}catch{}},ue=(he,pe,ze)=>{he.props.disabled||(Ie(pe),n("tabClick",he,ze))},de=(he,pe)=>{he.props.disabled||isUndefined(he.props.name)||(pe.stopPropagation(),n("edit",he.props.name,"remove"),n("tabRemove",he.props.name))},Ne=()=>{n("edit",void 0,"add"),n("tabAdd")};return useDeprecated({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},vue.computed(()=>!!i.activeName)),vue.watch(()=>i.activeName,he=>Ie(he)),vue.watch(()=>i.modelValue,he=>Ie(he)),vue.watch(ae,async()=>{var he;await vue.nextTick(),(he=ie.value)==null||he.scrollToActiveTab()}),vue.provide(tabsRootContextKey,{props:i,currentName:ae,registerPane:re,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Fe=>{Fe.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,pe=vue.createVNode("div",{class:[$.e("header"),$.is(i.tabPosition)]},[he,vue.createVNode(TabNav,{ref:ie,currentName:ae.value,editable:i.editable,type:i.type,panes:oe.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),ze=vue.createVNode("div",{class:$.e("content")},[vue.renderSlot(r,"default")]);return vue.createVNode("div",{class:[$.b(),$.m(i.tabPosition),{[$.m("card")]:i.type==="card",[$.m("border-card")]:i.type==="border-card"}]},[...i.tabPosition!=="bottom"?[pe,ze]:[ze,pe]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$q=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$A=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const V=useNamespace("tab-pane"),$=vue.ref(),oe=vue.computed(()=>n.closable||k.props.closable),re=computedEager(()=>{var Ie;return k.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(re.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||re.value);vue.watch(re,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:re,index:$,isClosable:oe});return vue.onMounted(()=>{k.registerPane(le)}),vue.onUnmounted(()=>{k.unregisterPane(le.uid)}),(Ie,ue)=>vue.unref(ae)?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,id:`pane-${vue.unref(ie)}`,class:vue.normalizeClass(vue.unref(V).b()),role:"tabpanel","aria-hidden":!vue.unref(re),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$q)),[[vue.vShow,vue.unref(re)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$A,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ElTabs=withInstall(Tabs,{TabPane}),ElTabPane=withNoopInstall(TabPane),NODE_KEY="$treeNodeId",markNodeData=function(i,n){!n||n[NODE_KEY]||Object.defineProperty(n,NODE_KEY,{value:i.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=function(i,n){return i?n[i]:n[NODE_KEY]},handleCurrentChange=(i,n,r)=>{const g=i.value.currentNode;r();const k=i.value.currentNode;g!==k&&n("current-change",k?k.data:null,k)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let k=0,V=i.length;k<V;k++){const $=i[k];($.checked!==!0||$.indeterminate)&&(n=!1,$.disabled||(g=!1)),($.checked!==!1||$.indeterminate)&&(r=!1)}return{all:n,none:r,allWithoutDisable:g,half:!n&&!r}},reInitChecked=function(i){if(i.childNodes.length===0||i.loading)return;const{all:n,none:r,half:g}=getChildState(i.childNodes);n?(i.checked=!0,i.indeterminate=!1):g?(i.checked=!1,i.indeterminate=!0):r&&(i.checked=!1,i.indeterminate=!1);const k=i.parent;!k||k.level===0||i.store.checkStrictly||reInitChecked(k)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},k=r[n];if(typeof k=="function")return k(g,i);if(typeof k=="string")return g[k];if(typeof k>"u"){const V=g[n];return V===void 0?"":V}};let nodeIdSeed=0;class Node{constructor(n){this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const n=this.store;if(!n)throw new Error("[Node]store is required!");n.registerNode(this);const r=n.props;if(r&&typeof r.isLeaf<"u"){const V=getPropertyFromData(this,"isLeaf");typeof V=="boolean"&&(this.isLeafByUser=V)}if(n.lazy!==!0&&this.data?(this.setData(this.data),n.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||markNodeData(this,this.data),!this.data)return;const g=n.defaultExpandedKeys,k=n.key;k&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),k&&n.currentNodeKey!==void 0&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(n){Array.isArray(n)||markNodeData(this,n),this.data=n,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=getPropertyFromData(this,"children")||[];for(let g=0,k=r.length;g<k;g++)this.insertChild({data:r[g]})}get label(){return getPropertyFromData(this,"label")}get key(){const n=this.store.key;return this.data?this.data[n]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return n.childNodes[r+1]}return null}get previousSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return r>0?n.childNodes[r-1]:null}return null}contains(n,r=!0){return(this.childNodes||[]).some(g=>g===n||r&&g.contains(n))}remove(){const n=this.parent;n&&n.removeChild(this)}insertChild(n,r,g){if(!n)throw new Error("InsertChild error: child is required.");if(!(n instanceof Node)){if(!g){const k=this.getChildren(!0);k.includes(n.data)||(typeof r>"u"||r<0?k.push(n.data):k.splice(r,0,n.data))}Object.assign(n,{parent:this,store:this.store}),n=vue.reactive(new Node(n)),n instanceof Node&&n.initialize()}n.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),this.updateLeafState()}insertBefore(n,r){let g;r&&(g=this.childNodes.indexOf(r)),this.insertChild(n,g)}insertAfter(n,r){let g;r&&(g=this.childNodes.indexOf(r),g!==-1&&(g+=1)),this.insertChild(n,g)}removeChild(n){const r=this.getChildren()||[],g=r.indexOf(n.data);g>-1&&r.splice(g,1);const k=this.childNodes.indexOf(n);k>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(k,1)),this.updateLeafState()}removeChildByData(n){let r=null;for(let g=0;g<this.childNodes.length;g++)if(this.childNodes[g].data===n){r=this.childNodes[g];break}r&&this.removeChild(r)}expand(n,r){const g=()=>{if(r){let k=this.parent;for(;k.level>0;)k.expanded=!0,k=k.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(k=>{k.canFocus=!0})};this.shouldLoadData()?this.loadData(k=>{Array.isArray(k)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),g())}):g()}doCreateChildren(n,r={}){n.forEach(g=>{this.insertChild(Object.assign({data:g},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(n=>{n.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const n=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!n||n.length===0;return}this.isLeaf=!1}setChecked(n,r,g,k){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:oe}=getChildState(this.childNodes);!this.isLeaf&&!$&&oe&&(this.checked=!1,n=!1);const re=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];k=k||n!==!1;const de=ue.disabled?ue.checked:k;ue.setChecked(de,r,!0,k)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{re(),reInitChecked(this)},{checked:n!==!1});return}else re()}const V=this.parent;!V||V.level===0||g||reInitChecked(V)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let k="children";return g&&(k=g.children||"children"),r[k]===void 0&&(r[k]=null),n&&!r[k]&&(r[k]=[]),r[k]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(V=>V.data),g={},k=[];n.forEach((V,$)=>{const oe=V[NODE_KEY];!!oe&&r.findIndex(Ce=>Ce[NODE_KEY]===oe)>=0?g[oe]={index:$,data:V}:k.push({index:$,data:V})}),this.store.lazy||r.forEach(V=>{g[V[NODE_KEY]]||this.removeChildByData(V)}),k.forEach(({index:V,data:$})=>{this.insertChild({data:$},V)}),this.updateLeafState()}loadData(n,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const g=k=>{this.childNodes=[],this.doCreateChildren(k,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,k)};this.store.load(this,g)}else n&&n.call(this)}}class TreeStore{constructor(n){this.currentNode=null,this.currentNodeKey=null;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.nodesMap={}}initialize(){if(this.root=new Node({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const n=this.load;n(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(n){const r=this.filterNodeMethod,g=this.lazy,k=function(V){const $=V.root?V.root.childNodes:V.childNodes;if($.forEach(oe=>{oe.visible=r.call(oe,n,oe.data,oe),k(oe)}),!V.visible&&$.length){let oe=!0;oe=!$.some(re=>re.visible),V.root?V.root.visible=oe===!1:V.visible=oe===!1}n&&V.visible&&!V.isLeaf&&!g&&V.expand()};k(this)}setData(n){n!==this.root.data?(this.root.setData(n),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(n){if(n instanceof Node)return n;const r=isObject$4(n)?getNodeKey(this.key,n):n;return this.nodesMap[r]||null}insertBefore(n,r){const g=this.getNode(r);g.parent.insertBefore({data:n},g)}insertAfter(n,r){const g=this.getNode(r);g.parent.insertAfter({data:n},g)}remove(n){const r=this.getNode(n);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(n,r){const g=r?this.getNode(r):this.root;g&&g.insertChild({data:n})}_initDefaultCheckedNodes(){const n=this.defaultCheckedKeys||[],r=this.nodesMap;n.forEach(g=>{const k=r[g];k&&k.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(n){(this.defaultCheckedKeys||[]).includes(n.key)&&n.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(n){n!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=n,this._initDefaultCheckedNodes())}registerNode(n){const r=this.key;!n||!n.data||(r?n.key!==void 0&&(this.nodesMap[n.key]=n):this.nodesMap[n.id]=n)}deregisterNode(n){!this.key||!n||!n.data||(n.childNodes.forEach(g=>{this.deregisterNode(g)}),delete this.nodesMap[n.key])}getCheckedNodes(n=!1,r=!1){const g=[],k=function(V){(V.root?V.root.childNodes:V.childNodes).forEach(oe=>{(oe.checked||r&&oe.indeterminate)&&(!n||n&&oe.isLeaf)&&g.push(oe.data),k(oe)})};return k(this),g}getCheckedKeys(n=!1){return this.getCheckedNodes(n).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const n=[],r=function(g){(g.root?g.root.childNodes:g.childNodes).forEach(V=>{V.indeterminate&&n.push(V.data),r(V)})};return r(this),n}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(n=>(n||{})[this.key])}_getAllNodes(){const n=[],r=this.nodesMap;for(const g in r)hasOwn$1(r,g)&&n.push(r[g]);return n}updateChildren(n,r){const g=this.nodesMap[n];if(!g)return;const k=g.childNodes;for(let V=k.length-1;V>=0;V--){const $=k[V];this.remove($.data)}for(let V=0,$=r.length;V<$;V++){const oe=r[V];this.append(oe,g.data)}}_setCheckedKeys(n,r=!1,g){const k=this._getAllNodes().sort((oe,re)=>re.level-oe.level),V=Object.create(null),$=Object.keys(g);k.forEach(oe=>oe.setChecked(!1,!1));for(let oe=0,re=k.length;oe<re;oe++){const Ce=k[oe],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!V[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)V[le.data[n]]=!0,le=le.parent;if(Ce.isLeaf||this.checkStrictly){Ce.setChecked(!0,!1);continue}if(Ce.setChecked(!0,!0),r){Ce.setChecked(!1,!1);const Ie=function(ue){ue.childNodes.forEach(Ne=>{Ne.isLeaf||Ne.setChecked(!1,!1),Ie(Ne)})};Ie(Ce)}}}setCheckedNodes(n,r=!1){const g=this.key,k={};n.forEach(V=>{k[(V||{})[g]]=!0}),this._setCheckedKeys(g,r,k)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,k={};n.forEach(V=>{k[V]=!0}),this._setCheckedKeys(g,r,k)}setDefaultExpandedKeys(n){n=n||[],this.defaultExpandedKeys=n,n.forEach(r=>{const g=this.getNode(r);g&&g.expand(null,this.autoExpandParent)})}setChecked(n,r,g){const k=this.getNode(n);k&&k.setChecked(!!r,g)}getCurrentNode(){return this.currentNode}setCurrentNode(n){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=n,this.currentNode.isCurrent=!0}setUserCurrentNode(n,r=!0){const g=n[this.key],k=this.nodesMap[g];this.setCurrentNode(k),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(n,r=!0){if(n==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const g=this.getNode(n);g&&(this.setCurrentNode(g),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const _sfc_main$z=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(i){const n=useNamespace("tree"),r=vue.inject("NodeInstance"),g=vue.inject("RootTree");return()=>{const k=i.node,{data:V,store:$}=k;return i.renderContent?i.renderContent(vue.h,{_self:r,node:k,data:V,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:k,data:V}):vue.h("span",{class:n.be("node","label")},[k.label])}}});var NodeContent=_export_sfc$1(_sfc_main$z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function useNodeExpandEventBroadcast(i){const n=vue.inject("TreeNodeMap",null),r={treeNodeExpand:g=>{i.node!==g&&i.node.collapse()},children:[]};return n&&n.children.push(r),vue.provide("TreeNodeMap",r),{broadcastExpanded:g=>{if(i.accordion)for(const k of r.children)k.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:k}){const V=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),oe=({event:ie,treeNode:ae})=>{if(typeof i.allowDrag=="function"&&!i.allowDrag(ae.node))return ie.preventDefault(),!1;ie.dataTransfer.effectAllowed="move";try{ie.dataTransfer.setData("text/plain","")}catch{}$.value.draggingNode=ae,n.emit("node-drag-start",ae.node,ie)},re=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,V.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,pe=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),pe=Ne=i.allowDrop(ue.node,le.node,"inner"),he=i.allowDrop(ue.node,le.node,"next")),ie.dataTransfer.dropEffect=Ne||de||he?"move":"none",(de||Ne||he)&&(Ie==null?void 0:Ie.node.id)!==le.node.id&&(Ie&&n.emit("node-drag-leave",ue.node,Ie.node,ie),n.emit("node-drag-enter",ue.node,le.node,ie)),(de||Ne||he)&&($.value.dropNode=le),le.node.nextSibling===ue.node&&(he=!1),le.node.previousSibling===ue.node&&(de=!1),le.node.contains(ue.node,!1)&&(Ne=!1),(ue.node===le.node||ue.node.contains(le.node))&&(de=!1,Ne=!1,he=!1);const ze=le.$el.getBoundingClientRect(),Fe=r.value.getBoundingClientRect();let xe;const _e=de?Ne?.25:he?.45:1:-1,Dt=he?Ne?.75:de?.55:0:1;let $e=-9999;const Ue=ie.clientY-ze.top;Ue<ze.height*_e?xe="before":Ue>ze.height*Dt?xe="after":Ne?xe="inner":xe="none";const Ve=le.$el.querySelector(`.${V.be("node","expand-icon")}`).getBoundingClientRect(),Oe=g.value;xe==="before"?$e=Ve.top-Fe.top:xe==="after"&&($e=Ve.bottom-Fe.top),Oe.style.top=`${$e}px`,Oe.style.left=`${Ve.right-Fe.left}px`,xe==="inner"?addClass(le.$el,V.is("drop-inner")):removeClass(le.$el,V.is("drop-inner")),$.value.showDropIndicator=xe==="before"||xe==="after",$.value.allowDrop=$.value.showDropIndicator||pe,$.value.dropType=xe,n.emit("node-drag-over",ue.node,le.node,ie)},Ce=ie=>{const{draggingNode:ae,dropType:le,dropNode:Ie}=$.value;if(ie.preventDefault(),ie.dataTransfer.dropEffect="move",ae&&Ie){const ue={data:ae.node.data};le!=="none"&&ae.node.remove(),le==="before"?Ie.node.parent.insertBefore(ue,Ie.node):le==="after"?Ie.node.parent.insertAfter(ue,Ie.node):le==="inner"&&Ie.node.insertChild(ue),le!=="none"&&k.value.registerNode(ue),removeClass(Ie.$el,V.is("drop-inner")),n.emit("node-drag-end",ae.node,Ie.node,le,ie),le!=="none"&&n.emit("node-drop",ae.node,Ie.node,le,ie)}ae&&!Ie&&n.emit("node-drag-end",ae.node,null,le,ie),$.value.showDropIndicator=!1,$.value.draggingNode=null,$.value.dropNode=null,$.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:oe,treeNodeDragOver:re,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$y=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:_CollapseTransition,ElCheckbox,NodeContent,ElIcon,Loading:loading_default},props:{node:{type:Node,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(i,n){const r=useNamespace("tree"),{broadcastExpanded:g}=useNodeExpandEventBroadcast(i),k=vue.inject("RootTree"),V=vue.ref(!1),$=vue.ref(!1),oe=vue.ref(null),re=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),k||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(V.value=!0,$.value=!0);const le=k.props.children||"children";vue.watch(()=>{const Ue=i.node.data[le];return Ue&&[...Ue]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Ue=>{de(i.node.checked,Ue)}),vue.watch(()=>i.node.checked,Ue=>{de(Ue,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Ue=>{vue.nextTick(()=>V.value=Ue),Ue&&($.value=!0)});const Ie=Ue=>getNodeKey(k.props.nodeKey,Ue.data),ue=Ue=>{const Ve=i.props.class;if(!Ve)return{};let Oe;if(isFunction$2(Ve)){const{data:At}=Ue;Oe=Ve(At,Ue)}else Oe=Ve;return isString$1(Oe)?{[Oe]:!0}:Oe},de=(Ue,Ve)=>{(oe.value!==Ue||re.value!==Ve)&&k.ctx.emit("check-change",i.node.data,Ue,Ve),oe.value=Ue,re.value=Ve},Ne=Ue=>{handleCurrentChange(k.store,k.ctx.emit,()=>k.store.value.setCurrentNode(i.node)),k.currentNode.value=i.node,k.props.expandOnClickNode&&pe(),k.props.checkOnClickNode&&!i.node.disabled&&ze(null,{target:{checked:!i.node.checked}}),k.ctx.emit("node-click",i.node.data,i.node,ae,Ue)},he=Ue=>{k.instance.vnode.props.onNodeContextmenu&&(Ue.stopPropagation(),Ue.preventDefault()),k.ctx.emit("node-contextmenu",Ue,i.node.data,i.node,ae)},pe=()=>{i.node.isLeaf||(V.value?(k.ctx.emit("node-collapse",i.node.data,i.node,ae),i.node.collapse()):(i.node.expand(),n.emit("node-expand",i.node.data,i.node,ae)))},ze=(Ue,Ve)=>{i.node.setChecked(Ve.target.checked,!k.props.checkStrictly),vue.nextTick(()=>{const Oe=k.store.value;k.ctx.emit("check",i.node.data,{checkedNodes:Oe.getCheckedNodes(),checkedKeys:Oe.getCheckedKeys(),halfCheckedNodes:Oe.getHalfCheckedNodes(),halfCheckedKeys:Oe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:k,expanded:V,childNodeRendered:$,oldChecked:oe,oldIndeterminate:re,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:pe,handleCheckChange:ze,handleChildNodeExpand:(Ue,Ve,Oe)=>{g(Ve),k.ctx.emit("node-expand",Ue,Ve,Oe)},handleDragStart:Ue=>{k.props.draggable&&ie.treeNodeDragStart({event:Ue,treeNode:i})},handleDragOver:Ue=>{Ue.preventDefault(),k.props.draggable&&ie.treeNodeDragOver({event:Ue,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Ue=>{Ue.preventDefault()},handleDragEnd:Ue=>{k.props.draggable&&ie.treeNodeDragEnd(Ue)},CaretRight:caret_right_default}}}),_hoisted_1$p=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$3(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("loading"),Ce=vue.resolveComponent("node-content"),ie=vue.resolveComponent("el-tree-node"),ae=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([i.ns.b("node"),i.ns.is("expanded",i.expanded),i.ns.is("current",i.node.isCurrent),i.ns.is("hidden",!i.node.visible),i.ns.is("focusable",!i.node.disabled),i.ns.is("checked",!i.node.disabled&&i.node.checked),i.getNodeClass(i.node)]),role:"treeitem",tabindex:"-1","aria-expanded":i.expanded,"aria-disabled":i.node.disabled,"aria-checked":i.node.checked,draggable:i.tree.props.draggable,"data-key":i.getNodeKey(i.node),onClick:n[1]||(n[1]=vue.withModifiers((...le)=>i.handleClick&&i.handleClick(...le),["stop"])),onContextmenu:n[2]||(n[2]=(...le)=>i.handleContextMenu&&i.handleContextMenu(...le)),onDragstart:n[3]||(n[3]=vue.withModifiers((...le)=>i.handleDragStart&&i.handleDragStart(...le),["stop"])),onDragover:n[4]||(n[4]=vue.withModifiers((...le)=>i.handleDragOver&&i.handleDragOver(...le),["stop"])),onDragend:n[5]||(n[5]=vue.withModifiers((...le)=>i.handleDragEnd&&i.handleDragEnd(...le),["stop"])),onDrop:n[6]||(n[6]=vue.withModifiers((...le)=>i.handleDrop&&i.handleDrop(...le),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(i.node.level-1)*i.tree.props.indent+"px"})},[i.tree.props.icon||i.CaretRight?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.be("node","expand-icon"),i.ns.is("leaf",i.node.isLeaf),{expanded:!i.node.isLeaf&&i.expanded}]),onClick:vue.withModifiers(i.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.tree.props.icon||i.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.showCheckbox?(vue.openBlock(),vue.createBlock(oe,{key:1,"model-value":i.node.checked,indeterminate:i.node.indeterminate,disabled:!!i.node.disabled,onClick:n[0]||(n[0]=vue.withModifiers(()=>{},["stop"])),onChange:i.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),i.node.loading?(vue.openBlock(),vue.createBlock($,{key:2,class:vue.normalizeClass([i.ns.be("node","loading-icon"),i.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(re)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(Ce,{node:i.node,"render-content":i.renderContent},null,8,["node","render-content"])],6),vue.createVNode(ae,null,{default:vue.withCtx(()=>[!i.renderAfterExpand||i.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("node","children")),role:"group","aria-expanded":i.expanded},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.node.childNodes,le=>(vue.openBlock(),vue.createBlock(ie,{key:i.getNodeKey(le),"render-content":i.renderContent,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,node:le,accordion:i.accordion,props:i.props,onNodeExpand:i.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$k)),[[vue.vShow,i.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$p)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$y,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function useKeydown({el$:i},n){const r=useNamespace("tree"),g=vue.shallowRef([]),k=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(k,oe=>{oe.forEach(re=>{re.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",oe=>{const re=oe.target;if(!re.className.includes(r.b("node")))return;const Ce=oe.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(re);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(oe.preventDefault(),Ce===EVENT_CODE.up){ae=ie===-1?0:ie!==0?ie-1:g.value.length-1;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae--,ae===Ie){ae=-1;break}ae<0&&(ae=g.value.length-1)}}else{ae=ie===-1?0:ie<g.value.length-1?ie+1:0;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae++,ae===Ie){ae=-1;break}ae>=g.value.length&&(ae=0)}}ae!==-1&&g.value[ae].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(Ce)&&(oe.preventDefault(),re.click());const le=re.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(oe.preventDefault(),le.click())});const $=()=>{var oe;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const re=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(re.length){re[0].setAttribute("tabindex","0");return}(oe=g.value[0])==null||oe.setAttribute("tabindex","0")}}const _sfc_main$x=vue.defineComponent({name:"ElTree",components:{ElTreeNode},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(i,n){const{t:r}=useLocale(),g=useNamespace("tree"),k=vue.ref(new TreeStore({key:i.nodeKey,data:i.data,lazy:i.lazy,props:i.props,load:i.load,currentNodeKey:i.currentNodeKey,checkStrictly:i.checkStrictly,checkDescendants:i.checkDescendants,defaultCheckedKeys:i.defaultCheckedKeys,defaultExpandedKeys:i.defaultExpandedKeys,autoExpandParent:i.autoExpandParent,defaultExpandAll:i.defaultExpandAll,filterNodeMethod:i.filterNodeMethod}));k.value.initialize();const V=vue.ref(k.value.root),$=vue.ref(null),oe=vue.ref(null),re=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:oe,dropIndicator$:re,store:k});useKeydown({el$:oe},k);const ae=vue.computed(()=>{const{childNodes:ti}=V.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{k.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{k.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{k.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{k.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{k.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");k.value.filter(ti)},Ie=ti=>getNodeKey(i.nodeKey,ti.data),ue=ti=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const ei=k.value.getNode(ti);if(!ei)return[];const Pt=[ei.data];let ni=ei.parent;for(;ni&&ni!==V.value;)Pt.push(ni.data),ni=ni.parent;return Pt.reverse()},de=(ti,ei)=>k.value.getCheckedNodes(ti,ei),Ne=ti=>k.value.getCheckedKeys(ti),he=()=>{const ti=k.value.getCurrentNode();return ti?ti.data:null},pe=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},ze=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");k.value.setCheckedNodes(ti,ei)},Fe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");k.value.setCheckedKeys(ti,ei)},xe=(ti,ei,Pt)=>{k.value.setChecked(ti,ei,Pt)},_e=()=>k.value.getHalfCheckedNodes(),Dt=()=>k.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(k,n.emit,()=>k.value.setUserCurrentNode(ti,ei))},Ue=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(k,n.emit,()=>k.value.setCurrentNodeKey(ti,ei))},Ve=ti=>k.value.getNode(ti),Oe=ti=>{k.value.remove(ti)},At=(ti,ei)=>{k.value.append(ti,ei)},qe=(ti,ei)=>{k.value.insertBefore(ti,ei)},Lt=(ti,ei)=>{k.value.insertAfter(ti,ei)},kt=(ti,ei,Pt)=>{Ce(ei),n.emit("node-expand",ti,ei,Pt)},jt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");k.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:k,root:V,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:k,root:V,currentNode:$,dragState:ie,el$:oe,dropIndicator$:re,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:pe,setCheckedNodes:ze,setCheckedKeys:Fe,setChecked:xe,getHalfCheckedNodes:_e,getHalfCheckedKeys:Dt,setCurrentNode:$e,setCurrentKey:Ue,t:r,getNode:Ve,remove:Oe,append:At,insertBefore:qe,insertAfter:Lt,handleNodeExpand:kt,updateKeyChildren:jt}}});function _sfc_render$2(i,n,r,g,k,V){const $=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([i.ns.b(),i.ns.is("dragging",!!i.dragState.draggingNode),i.ns.is("drop-not-allow",!i.dragState.allowDrop),i.ns.is("drop-inner",i.dragState.dropType==="inner"),{[i.ns.m("highlight-current")]:i.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.root.childNodes,oe=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(oe),node:oe,props:i.props,accordion:i.accordion,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,"render-content":i.renderContent,onNodeExpand:i.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.renderSlot(i.$slots,"empty",{},()=>{var oe;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((oe=i.emptyText)!=null?oe:i.t("el.tree.emptyText")),3)]})],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(i.ns.e("drop-indicator"))},null,2),[[vue.vShow,i.dragState.showDropIndicator]])],2)}var Tree=_export_sfc$1(_sfc_main$x,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Tree.install=i=>{i.component(Tree.name,Tree)};const _Tree=Tree,ElTree=_Tree,uploadContextKey=Symbol("uploadContextKey"),SCOPE$1="ElUpload";class UploadAjaxError extends Error{constructor(n,r,g,k){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=k}}function getError(i,n,r){let g;return r.response?g=`${r.response.error||r.response}`:r.responseText?g=`${r.responseText}`:g=`fail to ${n.method} ${i} ${r.status}`,new UploadAjaxError(g,r.status,n.method,i)}function getBody(i){const n=i.responseText||i.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}const ajaxUpload=i=>{typeof XMLHttpRequest>"u"&&throwError$1(SCOPE$1,"XMLHttpRequest is undefined");const n=new XMLHttpRequest,r=i.action;n.upload&&n.upload.addEventListener("progress",V=>{const $=V;$.percent=V.total>0?V.loaded/V.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[V,$]of Object.entries(i.data))Array.isArray($)?g.append(V,...$):g.append(V,$);g.append(i.filename,i.file,i.file.name),n.addEventListener("error",()=>{i.onError(getError(r,i,n))}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300)return i.onError(getError(r,i,n));i.onSuccess(getBody(n))}),n.open(i.method,r,!0),i.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);const k=i.headers||{};if(k instanceof Headers)k.forEach((V,$)=>n.setRequestHeader($,V));else for(const[V,$]of Object.entries(k))isNil($)||n.setRequestHeader(V,String($));return n.send(g),n},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>mutable({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:Boolean,limit:Number}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:!1},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"}}),uploadListEmits={remove:i=>!!i},_hoisted_1$o=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$b=["title"],_hoisted_5$a=["onClick"],_hoisted_6$7=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$w=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),k=useNamespace("icon"),V=useNamespace("list"),$=useFormDisabled(),oe=vue.ref(!1),re=Ce=>{n("remove",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass([vue.unref(g).b("list"),vue.unref(g).bm("list",Ce.listType),vue.unref(g).is("disabled",vue.unref($))]),name:vue.unref(V).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.files,ae=>(vue.openBlock(),vue.createElementBlock("li",{key:ae.uid||ae.name,class:vue.normalizeClass([vue.unref(g).be("list","item"),vue.unref(g).is(ae.status),{focusing:oe.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&re(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>oe.value=!0),onBlur:ie[1]||(ie[1]=le=>oe.value=!1),onClick:ie[2]||(ie[2]=le=>oe.value=!1)},[vue.renderSlot(Ce.$slots,"default",{file:ae},()=>[Ce.listType==="picture"||ae.status!=="uploading"&&Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-thumbnail")),src:ae.url,alt:""},null,10,_hoisted_2$j)):vue.createCommentVNode("v-if",!0),ae.status==="uploading"||Ce.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(g).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(g).be("list","item-name")),onClick:vue.withModifiers(le=>Ce.handlePreview(ae),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-file-name")),title:ae.name},vue.toDisplayString(ae.name),11,_hoisted_4$b)],10,_hoisted_3$f),ae.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ce.listType==="picture-card"?"circle":"line","stroke-width":Ce.listType==="picture-card"?6:2,percentage:Number(ae.percentage),style:vue.normalizeStyle(Ce.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(g).be("list","item-status-label"))},[Ce.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ce.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).m("close")),onClick:le=>re(ae)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:2},1032,["class","onClick"])),vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),vue.createCommentVNode(" This is a bug which needs to be fixed "),vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(k).m("close-tip"))},vue.toDisplayString(vue.unref(r)("el.upload.deleteTip")),3)),Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(g).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-preview")),onClick:le=>Ce.handlePreview(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-delete")),onClick:le=>re(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$7))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$o))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$w,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const uploadDraggerProps=buildProps({disabled:{type:Boolean,default:!1}}),uploadDraggerEmits={file:i=>isArray$3(i)},_hoisted_1$n=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$v=vue.defineComponent({...__default__$3,props:uploadDraggerProps,emits:uploadDraggerEmits,setup(i,{emit:n}){const r=vue.inject(uploadContextKey);r||throwError$1(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const g=useNamespace("upload"),k=vue.ref(!1),V=useFormDisabled(),$=re=>{if(V.value)return;k.value=!1,re.stopPropagation();const Ce=Array.from(re.dataTransfer.files),ie=r.accept.value;if(!ie){n("file",Ce);return}const ae=Ce.filter(le=>{const{type:Ie,name:ue}=le,de=ue.includes(".")?`.${ue.split(".").pop()}`:"",Ne=Ie.replace(/\/.*$/,"");return ie.split(",").map(he=>he.trim()).filter(he=>he).some(he=>he.startsWith(".")?de===he:/\/\*$/.test(he)?Ne===he.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(he)?Ie===he:!1)});n("file",ae)},oe=()=>{V.value||(k.value=!0)};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",k.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(oe,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>k.value=!1,["prevent"]))},[vue.renderSlot(re.$slots,"default")],42,_hoisted_1$n))}});var UploadDragger=_export_sfc$1(_sfc_main$v,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),_hoisted_1$m=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$u=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),k=useFormDisabled(),V=vue.shallowRef({}),$=vue.shallowRef(),oe=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:pe,onStart:ze,onExceed:Fe}=r;if(Ne&&he.length+ue.length>Ne){Fe(ue,he);return}pe||(ue=ue.slice(0,1));for(const xe of ue){const _e=xe;_e.uid=genFileId(),ze(_e),de&&re(_e)}},re=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const pe=r.data,ze=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await ze,isObject$4(r.data)&&isEqual(pe,Ne)&&(Ne=cloneDeep(r.data))}catch{de=!1}if(de===!1){r.onRemove(ue);return}let he=ue;de instanceof Blob&&(de instanceof File?he=de:he=new File([de],ue.name,{type:ue.type})),Ce(Object.assign(he,{uid:ue.uid}),Ne)},Ce=(ue,de)=>{const{headers:Ne,data:he,method:pe,withCredentials:ze,name:Fe,action:xe,onProgress:_e,onSuccess:Dt,onError:$e,httpRequest:Ue}=r,{uid:Ve}=ue,Oe={headers:Ne||{},withCredentials:ze,file:ue,data:de??he,method:pe,filename:Fe,action:xe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{Dt(qe,ue),delete V.value[Ve]},onError:qe=>{$e(qe,ue),delete V.value[Ve]}},At=Ue(Oe);V.value[Ve]=At,At instanceof Promise&&At.then(Oe.onSuccess,Oe.onError)},ie=ue=>{const de=ue.target.files;de&&oe(Array.from(de))},ae=()=>{k.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(V.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete V.value[Ne]})},upload:re}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b(),vue.unref(g).m(ue.listType),vue.unref(g).is("drag",ue.drag)]),tabindex:"0",onClick:ae,onKeydown:vue.withKeys(vue.withModifiers(le,["self"]),["enter","space"])},[ue.drag?(vue.openBlock(),vue.createBlock(UploadDragger,{key:0,disabled:vue.unref(k),onFile:oe},{default:vue.withCtx(()=>[vue.renderSlot(ue.$slots,"default")]),_:3},8,["disabled"])):vue.renderSlot(ue.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:$,class:vue.normalizeClass(vue.unref(g).e("input")),name:ue.name,multiple:ue.multiple,accept:ue.accept,type:"file",onChange:ie,onClick:de[0]||(de[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$i)],42,_hoisted_1$m))}});var UploadContent=_export_sfc$1(_sfc_main$u,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const SCOPE="ElUpload",revokeObjectURL=i=>{var n;(n=i.url)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(i.url)},useHandlers=(i,n)=>{const r=useVModel(i,"fileList",void 0,{passive:!0}),g=le=>r.value.find(Ie=>Ie.uid===le.uid);function k(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function V(le=["ready","uploading","success","fail"]){r.value=r.value.filter(Ie=>!le.includes(Ie.status))}const $=(le,Ie)=>{const ue=g(Ie);ue&&(console.error(le),ue.status="fail",r.value.splice(r.value.indexOf(ue),1),i.onError(le,ue,r.value),i.onChange(ue,r.value))},oe=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},re=(le,Ie)=>{const ue=g(Ie);ue&&(ue.status="success",ue.response=le,i.onSuccess(le,ue,r.value),i.onChange(ue,r.value))},Ce=le=>{isNil(le.uid)&&(le.uid=genFileId());const Ie={name:le.name,percentage:0,status:"ready",size:le.size,raw:le,uid:le.uid};if(i.listType==="picture-card"||i.listType==="picture")try{Ie.url=URL.createObjectURL(le)}catch(ue){debugWarn(SCOPE,ue.message),i.onError(ue,Ie,r.value)}r.value=[...r.value,Ie],i.onChange(Ie,r.value)},ie=async le=>{const Ie=le instanceof File?g(le):le;Ie||throwError$1(SCOPE,"file to be removed not found");const ue=de=>{k(de);const Ne=r.value;Ne.splice(Ne.indexOf(de),1),i.onRemove(de,Ne),revokeObjectURL(de)};i.beforeRemove?await i.beforeRemove(Ie,r.value)!==!1&&ue(Ie):ue(Ie)};function ae(){r.value.filter(({status:le})=>le==="ready").forEach(({raw:le})=>{var Ie;return le&&((Ie=n.value)==null?void 0:Ie.upload(le))})}return vue.watch(()=>i.listType,le=>{le!=="picture-card"&&le!=="picture"||(r.value=r.value.map(Ie=>{const{raw:ue,url:de}=Ie;if(!de&&ue)try{Ie.url=URL.createObjectURL(ue)}catch(Ne){i.onError(Ne,Ie,r.value)}return Ie}))}),vue.watch(r,le=>{for(const Ie of le)Ie.uid||(Ie.uid=genFileId()),Ie.status||(Ie.status="success")},{immediate:!0,deep:!0}),{uploadFiles:r,abort:k,clearFiles:V,handleError:$,handleProgress:oe,handleStart:Ce,handleSuccess:re,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$t=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),k=useFormDisabled(),V=vue.shallowRef(),{abort:$,submit:oe,clearFiles:re,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,V),de=vue.computed(()=>r.listType==="picture-card"),Ne=vue.computed(()=>({...r,fileList:Ce.value,onStart:ie,onProgress:ue,onSuccess:Ie,onError:ae,onRemove:le}));return vue.onBeforeUnmount(()=>{Ce.value.forEach(({url:he})=>{he!=null&&he.startsWith("blob:")&&URL.revokeObjectURL(he)})}),vue.provide(uploadContextKey,{accept:vue.toRef(r,"accept")}),n({abort:$,submit:oe,clearFiles:re,handleStart:ie,handleRemove:le}),(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(UploadContent,vue.mergeProps({ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!vue.unref(de)||vue.unref(de)&&!he.showFileList?(vue.openBlock(),vue.createBlock(UploadContent,vue.mergeProps({key:1,ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),he.$slots.trigger?vue.renderSlot(he.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(he.$slots,"tip"),!vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:3,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$t,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const ElUpload=withInstall(Upload),messageTypes=["success","info","warning","error"],messageDefaults=mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},center:{type:Boolean,default:messageDefaults.center},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),required:!1},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},offset:{type:Number,default:messageDefaults.offset},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},instances$2=vue.shallowReactive([]),getInstance=i=>{const n=instances$2.findIndex(k=>k.id===i),r=instances$2[n];let g;return n>0&&(g=instances$2[n-1]),{current:r,prev:g}},getLastOffset=i=>{const{prev:n}=getInstance(i);return n?n.vm.exposed.bottom.value:0},getOffsetOrSpace=(i,n)=>instances$2.findIndex(g=>g.id===i)>0?20:n,_hoisted_1$l=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$s=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:k,zIndex:V}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:oe}=V,re=vue.ref(),Ce=vue.ref(!1),ie=vue.ref(0);let ae;const le=vue.computed(()=>r.type?r.type==="error"?"danger":r.type:"info"),Ie=vue.computed(()=>{const Dt=r.type;return{[k.bm("icon",Dt)]:Dt&&TypeComponentsMap[Dt]}}),ue=vue.computed(()=>r.icon||TypeComponentsMap[r.type]||""),de=vue.computed(()=>getLastOffset(r.id)),Ne=vue.computed(()=>getOffsetOrSpace(r.id,r.offset)+de.value),he=vue.computed(()=>ie.value+Ne.value),pe=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function ze(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{xe()},r.duration))}function Fe(){ae==null||ae()}function xe(){Ce.value=!1}function _e({code:Dt}){Dt===EVENT_CODE.esc&&xe()}return vue.onMounted(()=>{ze(),oe(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Fe(),ze()}),useEventListener(document,"keydown",_e),useResizeObserver(re,()=>{ie.value=re.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:xe}),(Dt,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(k).b("fade"),onBeforeLeave:Dt.onClose,onAfterLeave:$e[0]||($e[0]=Ue=>Dt.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Dt.id,ref_key:"messageRef",ref:re,class:vue.normalizeClass([vue.unref(k).b(),{[vue.unref(k).m(Dt.type)]:Dt.type&&!Dt.icon},vue.unref(k).is("center",Dt.center),vue.unref(k).is("closable",Dt.showClose),Dt.customClass]),style:vue.normalizeStyle(vue.unref(pe)),role:"alert",onMouseenter:Fe,onMouseleave:ze},[Dt.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Dt.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(k).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),vue.unref(ue)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).e("icon"),vue.unref(Ie)])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(ue))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Dt.$slots,"default",{},()=>[Dt.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(k).e("content")),innerHTML:Dt.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(k).e("content"))},vue.toDisplayString(Dt.message),3))]),Dt.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).e("closeBtn")),onClick:vue.withModifiers(xe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$l),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$s,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let seed=1;const normalizeOptions=i=>{const n=!i||isString$1(i)||vue.isVNode(i)||isFunction$2(i)?{message:i}:i,r={...messageDefaults,...n};if(!r.appendTo)r.appendTo=document.body;else if(isString$1(r.appendTo)){let g=document.querySelector(r.appendTo);isElement(g)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),g=document.body),r.appendTo=g}return r},closeMessage=i=>{const n=instances$2.indexOf(i);if(n===-1)return;instances$2.splice(n,1);const{handler:r}=i;r.close()},createMessage=({appendTo:i,...n},r)=>{const g=`message_${seed++}`,k=n.onClose,V=document.createElement("div"),$={...n,id:g,onClose:()=>{k==null||k(),closeMessage(ie)},onDestroy:()=>{vue.render(null,V)}},oe=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);oe.appContext=r||message._context,vue.render(oe,V),i.appendChild(V.firstElementChild);const re=oe.component,ie={id:g,vnode:oe,vm:re,handler:{close:()=>{re.exposed.visible.value=!1}},props:oe.component.props};return ie},message=(i={},n)=>{if(!isClient)return{close:()=>{}};if(isNumber$1(messageConfig.max)&&instances$2.length>=messageConfig.max)return{close:()=>{}};const r=normalizeOptions(i);if(r.grouping&&instances$2.length){const k=instances$2.find(({vnode:V})=>{var $;return(($=V.props)==null?void 0:$.message)===r.message});if(k)return k.props.repeatNum+=1,k.props.type=r.type,k.handler}const g=createMessage(r,n);return instances$2.push(g),g.handler};messageTypes.forEach(i=>{message[i]=(n={},r)=>{const g=normalizeOptions(n);return message({...g,type:i},r)}});function closeAll(i){for(const n of instances$2)(!i||i===n.props.type)&&n.handler.close()}message.closeAll=closeAll,message._context=null;const ElMessage=withInstallFunction(message,"$message"),_sfc_main$r=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:n}){const{locale:r,zIndex:g,ns:k,size:V}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:oe}=g,re=vue.ref(!1),Ce=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:oe()}),ie=vue.computed(()=>{const kt=Ce.type;return{[k.bm("icon",kt)]:kt&&TypeComponentsMap[kt]}}),ae=useId(),le=useId(),Ie=vue.computed(()=>Ce.icon||TypeComponentsMap[Ce.type]||""),ue=vue.computed(()=>!!Ce.message),de=vue.ref(),Ne=vue.ref(),he=vue.ref(),pe=vue.ref(),ze=vue.ref(),Fe=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async kt=>{await vue.nextTick(),i.boxType==="prompt"&&kt!==null&&Oe()},{immediate:!0}),vue.watch(()=>re.value,kt=>{var jt,ti;kt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(jt=ze.value)==null?void 0:jt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=oe()),i.boxType==="prompt"&&(kt?vue.nextTick().then(()=>{var ei;pe.value&&pe.value.$el&&(Ce.autofocus?he.value=(ei=At())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const xe=vue.computed(()=>i.draggable);useDraggable(de,Ne,xe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){re.value&&(re.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const Dt=()=>{i.closeOnClickModal&&Ve(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(Dt),Ue=kt=>{if(Ce.inputType!=="textarea")return kt.preventDefault(),Ve("confirm")},Ve=kt=>{var jt;i.boxType==="prompt"&&kt==="confirm"&&!Oe()||(Ce.action=kt,Ce.beforeClose?(jt=Ce.beforeClose)==null||jt.call(Ce,kt,Ce,_e):_e())},Oe=()=>{if(i.boxType==="prompt"){const kt=Ce.inputPattern;if(kt&&!kt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const jt=Ce.inputValidator;if(typeof jt=="function"){const ti=jt(Ce.inputValue);if(ti===!1)return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;if(typeof ti=="string")return Ce.editorErrorMessage=ti,Ce.validateError=!0,!1}}return Ce.editorErrorMessage="",Ce.validateError=!1,!0},At=()=>{const kt=pe.value.$refs;return kt.input||kt.textarea},qe=()=>{Ve("close")},Lt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(re),{...vue.toRefs(Ce),ns:k,overlayEvent:$e,visible:re,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:V,iconComponent:Ie,confirmButtonClasses:Fe,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:pe,confirmRef:ze,doClose:_e,handleClose:qe,onCloseRequested:Lt,handleWrapperClick:Dt,handleInputEnter:Ue,handleAction:Ve,t:$}}}),_hoisted_1$k=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render$1(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("close"),re=vue.resolveComponent("el-input"),Ce=vue.resolveComponent("el-button"),ie=vue.resolveComponent("el-focus-trap"),ae=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:n[11]||(n[11]=le=>i.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(ae,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:vue.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:n[8]||(n[8]=(...le)=>i.overlayEvent.onClick&&i.overlayEvent.onClick(...le)),onMousedown:n[9]||(n[9]=(...le)=>i.overlayEvent.onMousedown&&i.overlayEvent.onMousedown(...le)),onMouseup:n[10]||(n[10]=(...le)=>i.overlayEvent.onMouseup&&i.overlayEvent.onMouseup(...le))},[vue.createVNode(ie,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:vue.normalizeStyle(i.customStyle),tabindex:"-1",onClick:n[7]||(n[7]=vue.withModifiers(()=>{},["stop"]))},[i.title!==null&&i.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass(i.ns.e("header"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(i.title),1)],2),i.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:n[0]||(n[0]=le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel")),onKeydown:n[1]||(n[1]=vue.withKeys(vue.withModifiers(le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode($,{class:vue.normalizeClass(i.ns.e("close"))},{default:vue.withCtx(()=>[vue.createVNode(oe)]),_:1},8,["class"])],42,_hoisted_2$g)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:i.contentId,class:vue.normalizeClass(i.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.e("message"))},[vue.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("input"))},[vue.createVNode(re,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":n[2]||(n[2]=le=>i.inputValue=le),type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:vue.normalizeClass({invalid:i.validateError}),onKeydown:vue.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("errormsg")),style:vue.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(i.editorErrorMessage),7)],2),[[vue.vShow,i.showInput]])],10,_hoisted_3$e),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(vue.openBlock(),vue.createBlock(Ce,{key:0,loading:i.cancelButtonLoading,class:vue.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:n[3]||(n[3]=le=>i.handleAction("cancel")),onKeydown:n[4]||(n[4]=vue.withKeys(vue.withModifiers(le=>i.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(Ce,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,class:vue.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:n[5]||(n[5]=le=>i.handleAction("confirm")),onKeydown:n[6]||(n[6]=vue.withKeys(vue.withModifiers(le=>i.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[vue.vShow,i.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$k)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$r,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const messageInstance=new Map,getAppendToElement=i=>{let n=document.body;return i.appendTo&&(isString$1(i.appendTo)&&(n=document.querySelector(i.appendTo)),isElement(i.appendTo)&&(n=i.appendTo),isElement(n)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body)),n},initInstance=(i,n,r=null)=>{const g=vue.createVNode(MessageBoxConstructor,i,isFunction$2(i.message)||vue.isVNode(i.message)?{default:isFunction$2(i.message)?i.message:()=>i.message}:null);return g.appContext=r,vue.render(g,n),getAppendToElement(i).appendChild(n.firstElementChild),g.component},genContainer=()=>document.createElement("div"),showMessage=(i,n)=>{const r=genContainer();i.onVanish=()=>{vue.render(null,r),messageInstance.delete(k)},i.onAction=V=>{const $=messageInstance.get(k);let oe;i.showInput?oe={value:k.inputValue,action:V}:oe=V,i.callback?i.callback(oe,g.proxy):V==="cancel"||V==="close"?i.distinguishCancelAndClose&&V!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(oe)};const g=initInstance(i,r,n),k=g.proxy;for(const V in i)hasOwn$1(i,V)&&!hasOwn$1(k.$props,V)&&(k[V]=i[V]);return k.visible=!0,k};function MessageBox(i,n=null){if(!isClient)return Promise.reject();let r;return isString$1(i)||vue.isVNode(i)?i={message:i}:r=i.callback,new Promise((g,k)=>{const V=showMessage(i,n??MessageBox._context);messageInstance.set(V,{options:i,callback:r,resolve:g,reject:k})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(i=>{MessageBox[i]=messageBoxFactory(i)});function messageBoxFactory(i){return(n,r,g,k)=>{let V="";return isObject$4(r)?(g=r,V=""):isUndefined(r)?V="":V=r,MessageBox(Object.assign({title:V,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),k)}}MessageBox.close=()=>{messageInstance.forEach((i,n)=>{n.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=i=>{_MessageBox._context=i._context,i.config.globalProperties.$msgbox=_MessageBox,i.config.globalProperties.$messageBox=_MessageBox,i.config.globalProperties.$alert=_MessageBox.alert,i.config.globalProperties.$confirm=_MessageBox.confirm,i.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,index$3="",animate="";var ELineBindAnchors=(i=>(i.TopCenter="TopCenter",i.Left="Left",i.Right="Right",i.BottomCenter="BottomCenter",i))(ELineBindAnchors||{}),EConfigAnimationsType=(i=>(i.None="None",i.Electricity="Electricity",i.WaterDrop="WaterDrop",i.Track="Track",i))(EConfigAnimationsType||{}),EConfigItemPropsType=(i=>(i.Input="Input",i.Color="Color",i.InputNumber="InputNumber",i.Switch="Switch",i.JsonEdit="JsonEdit",i.Select="Select",i))(EConfigItemPropsType||{}),EDoneJsonType=(i=>(i.File="File",i.StraightLine="StraightLine",i.ConnectionLine="ConnectionLine",i.CustomSvg="CustomSvg",i.Vue="Vue",i))(EDoneJsonType||{}),EEventType=(i=>(i.Click="Click",i.Change="Change",i.Null="",i))(EEventType||{}),EEventAction=(i=>(i.ChangeAttr="ChangeAttr",i.JavaScript="JavaScript",i.Null="",i))(EEventAction||{}),EConditionType=(i=>(i.None="None",i.Relation="Relation",i))(EConditionType||{});const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let k=0;k<i;k++){let V=r;k===0&&(V=r-10),g+=n.charAt(Math.floor(Math.random()*V))}return g},isOfType=(i,n)=>i[n]!==void 0,getCoordinateOffset=(i,n)=>i/2*(n-1),angleToRadian=i=>i*Math.PI/180,calculateRotatedPointCoordinate=(i,n,r)=>({x:(i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x,y:(i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y}),getCenterPoint=(i,n)=>({x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2}),positionArrToPath=i=>{let n="";for(let r=0;r<i.length;r++)r===0?n+=`M ${i[r].x} ${i[r].y}`:n+=` L ${i[r].x} ${i[r].y}`;return n},getSvgNowPosition=(i,n,r)=>r+(n-i),objectDeepClone=(i,n={})=>i?JSON.parse(JSON.stringify(i)):n,setSvgActualInfo=(i,n)=>{const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let k=0,V=0,$=0,oe=0;if(i.type!==EDoneJsonType.Vue){const re=r.getBBox();console.log(re),k=re.x,V=re.y,$=re.width,oe=re.height}else{$=r.offsetWidth,oe=r.offsetHeight,$=$===0?100:$,oe=oe===0?100:oe,k=50-$/2,V=50-oe/2;const re=document.querySelector(`#foreign-object${i.id}`);re&&re.getAttribute("x")==="0"&&re.getAttribute("y")==="0"&&re.getAttribute("width")==="0"&&re.getAttribute("height")==="0"&&(re.setAttribute("x",k.toString()),re.setAttribute("y",V.toString()),re.setAttribute("width",$.toString()),re.setAttribute("height",oe.toString()))}g&&g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"&&(g.setAttribute("x",k.toString()),g.setAttribute("y",V.toString()),g.setAttribute("width",$.toString()),g.setAttribute("height",oe.toString())),(i.actual_bound.x===0&&i.actual_bound.y===0&&i.actual_bound.width===0&&i.actual_bound.height===0||n)&&(i.actual_bound={x:k,y:V,width:$,height:oe}),i.point_coordinate.tl={x:i.x-$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.tc={x:i.x,y:i.y-oe*i.scale_y/2},i.point_coordinate.tr={x:i.x+$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.l={x:i.x-$*i.scale_x/2,y:i.y},i.point_coordinate.r={x:i.x+$*i.scale_x/2,y:i.y},i.point_coordinate.bl={x:i.x-$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.point_coordinate.bc={x:i.x,y:i.y+oe*i.scale_y/2},i.point_coordinate.br={x:i.x+$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i)}},getAnchorPosByAnchorType=(i,n)=>i===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:i===ELineBindAnchors.Left?n.point_coordinate.l:i===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=i=>{i.point_coordinate={tl:calculateRotatedPointCoordinate(i.point_coordinate.tl,{x:i.x,y:i.y},i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,{x:i.x,y:i.y},i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,{x:i.x,y:i.y},i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,{x:i.x,y:i.y},i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,{x:i.x,y:i.y},i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,{x:i.x,y:i.y},i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,{x:i.x,y:i.y},i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,{x:i.x,y:i.y},i.rotate)}},prosToVBind=i=>{var r,g,k,V;let n={};if(i.state){for(const $ in i.state)if($==="OnOff")for(const oe in(r=i.state[$])==null?void 0:r.props)n={...n,[oe]:(g=i.state[$])!=null&&g.default?(k=i.state[$])==null?void 0:k.props[oe].openVal:(V=i.state[$])==null?void 0:V.props[oe].closeVal}}for(const $ in i.props)n={...n,[$]:i.props[$].val};return n},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(i=>i.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=i=>!i.common_animations||!i.common_animations.val?"":`common-ani animate__animated animate__${i.common_animations.val} animate__${i.common_animations.speed} animate__${i.common_animations.repeat} animate__${i.common_animations.delay}`,numberArray=i=>{let n=[];for(let r=0;r<i;r++)n.push(r);return n},getStringWidth=(i,n=12)=>{if(i.length>0){let r=document.createElement("span");r.style.fontSize=n+"px",r.style.fontFamily="inherit",r.innerHTML=i,r.style.opacity="0",r.style.position="fixed",r.style.top="3000px",document.body.append(r);const g=r.clientWidth;return document.body.removeChild(r),g}return 0},valFormat=i=>/false|true/.test(i)?i!=="false":/^\d+(\.\d+)?$/.test(i)?Number(i):i,straight_line_system=Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]}),connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#0a7ae2"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let i=JSON.parse(l);t=i.connection_line,s=i.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50},grid:!0,ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}}),circuit_breaker_svg_file={name:"circuit-breaker",title:"断路器",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},state:{OnOff:{title:"开关",default:!1,props:{fill:{openVal:"#00ff00",closeVal:"#ff0000"},"fill-opacity":{openVal:"0",closeVal:"1"}}}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态图标",list:[circuit_breaker_svg_file]},alternator_svg_file={name:"alternator",title:"发电机",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#00ff00"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},traction_transformer_svg_file={name:"traction-transformer",title:"牵引变",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_house={name:"house",title:"房子",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_car={name:"car",title:"轿车",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hospital={name:"hospital",title:"医院",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_package={name:"package",title:"组装线",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_2={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_3={name:"bot-3",title:"3号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_7={name:"bot-7",title:"7号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_9={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_12={name:"bot-12",title:"12号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateless_group={groupType:"stateless",title:"静态图标",list:[alternator_svg_file,traction_transformer_svg_file,svg_house,svg_car,svg_hospital,svg_package,svg_bot_2,svg_bot_3,svg_bot_7,svg_bot_9,svg_bot_12]},reservoir={name:"reservoir",title:"蓄水池",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"水流颜色",type:EConfigItemPropsType.Color,val:"#37cfe7"},stroke:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画图标",list:[reservoir]},svg_text={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Input,val:"文字"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:15},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_a={name:"switch-a",title:"开关",tag:"switch-a",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},light_a={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},clock_a={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_a,light_a,clock_a]},svg_config=Object.seal([stateless_group,stateful_group,animation_group,custom_svg_group]),el_button={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},common_table={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:null},"max-height":{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:null},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},now_time={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!1,actual_rect:!0},display:!0,props:{fontColor:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},el_tag={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},progress_a={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:10}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},components={groupType:"custom-vue",title:"VUE组件",list:[el_button,progress_a,common_table,now_time,el_tag]},pie_charts={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},echarts_group={groupType:"echarts",title:"图表",list:[pie_charts]},vue_config=Object.seal([components,echarts_group]),_sfc_main$q=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(i,{emit:n}){const r=i,g=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>r.percentage,()=>{n("onChange")}),(k,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$j=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M735.2 792.4H287.6C136.9 792.4 14.2 669.8 14.2 519c0-150.9 122.6-273.5 273.4-273.5h447.6c150.7 0 273.4 122.6 273.4 273.4 0 150.9-122.7 273.5-273.4 273.5zM287.6 300.2c-120.6 0-218.7 98.1-218.7 218.7 0 120.8 98.1 218.9 218.7 218.9h447.6c120.6 0 218.7-98.1 218.7-218.7 0-120.8-98.1-218.9-218.7-218.9H287.6z",fill:"#666666"},null,-1),_hoisted_4$a=vue.createElementVNode("path",{d:"M724.7 687.1c-92.7 0-168.1-75.4-168.1-168.1S632 350.9 724.7 350.9 892.8 426.3 892.8 519s-75.4 168.1-168.1 168.1z m0-278.6c-60.9 0-110.5 49.6-110.5 110.5s49.5 110.5 110.5 110.5S835.1 579.9 835.1 519s-49.5-110.5-110.4-110.5z",fill:"#666666"},null,-1),_hoisted_5$9=[_hoisted_3$d,_hoisted_4$a],_hoisted_6$6=["id"],_hoisted_7$6=vue.createElementVNode("path",{d:"M704 224H320C161.216 224 32 353.216 32 512c0 158.816 129.216 288 288 288h384c158.816 0 288-129.184 288-288 0-158.784-129.184-288-288-288z m0 512H320C196.48 736 96 635.488 96 512c0-123.52 100.48-224 224-224h384c123.488 0 224 100.48 224 224 0 123.488-100.512 224-224 224z"},null,-1),_hoisted_8$5=vue.createElementVNode("path",{d:"M320 320c-105.888 0-192 86.112-192 192s86.112 192 192 192 192-86.112 192-192-86.112-192-192-192z m0 320c-70.592 0-128-57.408-128-128s57.408-128 128-128 128 57.408 128 128-57.408 128-128 128z"},null,-1),_hoisted_9$4=[_hoisted_7$6,_hoisted_8$5],_hoisted_10$4=["xlink:href"],_hoisted_11$4=["xlink:href"],_sfc_main$p=vue.defineComponent({__name:"switch-a",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-open`},_hoisted_5$9,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-close`},_hoisted_9$4,8,_hoisted_6$6),r.isOpen?(vue.openBlock(),vue.createElementBlock("use",{key:0,"xlink:href":`#${r.id}switch-demo-open`,width:"100",height:"100"},null,8,_hoisted_10$4)):(vue.openBlock(),vue.createElementBlock("use",{key:1,"xlink:href":`#${r.id}switch-demo-close`,width:"100",height:"100"},null,8,_hoisted_11$4))],8,_hoisted_1$j))}}),_hoisted_1$i=["font-family","font-size","fill"],_sfc_main$o=vue.defineComponent({__name:"svg-text",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>[r.text,r.fontSize,r.fontFamily],()=>{vue.nextTick(function(){n("resize")})}),(g,k)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55","font-family":r.fontFamily,"font-size":r.fontSize,fill:r.fill},vue.toDisplayString(r.text),9,_hoisted_1$i))}}),_sfc_main$n=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(i){const n=i,r=vue.ref({});return vue.watchEffect(()=>{const{colConfig:g,...k}=n;r.value=k}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,V=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:V.prop},V),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$m=vue.defineComponent({__name:"now-time",props:{fontColor:{type:String,default:"#000000"}},setup(i){const n=i,r=vue.ref(new Date),g=vue.ref(),k=vue.computed(()=>{const oe=r.value.getFullYear(),re=r.value.getMonth()+1,Ce=r.value.getDate();return oe.toString()+"年"+re.toString()+"月"+Ce.toString()+"日"}),V=vue.computed(()=>{const oe=r.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),$=vue.computed(()=>{const oe=r.value.getHours(),re=r.value.getMinutes(),Ce=r.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(re<10?"0"+re.toString():re.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())});return vue.onMounted(()=>{g.value=setInterval(()=>{r.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(g.value)}),(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(k.value),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(V.value),5),vue.createElementVNode("div",{class:"text-12px font-bold ml-5px",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString($.value),5)])]))}});/*! *****************************************************************************
|
293
293
|
Copyright (c) Microsoft Corporation.
|
294
294
|
|
295
295
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -350,7 +350,7 @@ echarts.use([`+At+"]);":"Unknown series "+Oe))}return}if(ae==="tooltip"){if(ze){
|
|
350
350
|
if (customElements.get(tag) == null) {
|
351
351
|
customElements.define(tag, EChartsElement);
|
352
352
|
}
|
353
|
-
`)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_2dc3e6cb_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-2dc3e6cb"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},config=[...svg_config_center,...vue_config_center];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolbar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e00305dc_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e00305dc"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-b0d244b1"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"36a85969":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
|
353
|
+
`)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_2dc3e6cb_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-2dc3e6cb"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},config=[...svg_config,...vue_config];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{},props:{default:()=>({})}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolbar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e00305dc_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e00305dc"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-b0d244b1"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"36a85969":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
|
354
354
|
${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((Lt=vue.unref(r).handle_svg_info)==null?void 0:Lt.info.id)==Oe.id?"svg-item-move":""} ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((kt=vue.unref(r).handle_svg_info)==null?void 0:kt.info.id)==Oe.id?"svg-item-select":""}`}),null,16,_hoisted_9)):vue.createCommentVNode("",!0),((jt=vue.unref(r).handle_svg_info)==null?void 0:jt.info.id)===Oe.id&&ie.handle_panel&&Oe.config.can_zoom?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0),((ti=ie.select_item.info)==null?void 0:ti.id)==Oe.id&&ie.connection_panel&&Oe.config.have_anchor&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Oe.id!==((ei=vue.unref(r).handle_svg_info)==null?void 0:ei.info.id))?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:7,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_5$2)],2)],8,_hoisted_4$3)),[[vue.vShow,Oe.display]])}),128))],8,_hoisted_3$5)],4)),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:oe,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Oe,At)=>(vue.openBlock(),vue.createElementBlock("li",{key:Oe.title,onClick:qe=>vue.unref($).onContextMenuClick(At)},[vue.createElementVNode("p",{class:vue.normalizeClass(Oe.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Oe.title)+" ",1),vue.createElementVNode("span",_hoisted_11,vue.toDisplayString(Oe.hot_key),1)],2)],8,_hoisted_10))),128))],512),[[vue.vShow,vue.unref($).display]])],544))}}),index_vue_vue_type_style_index_0_scoped_b0d244b1_lang="",CenterPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-b0d244b1"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var k=function(ie,ae,le){if(typeof ie!="string"){k.original?k.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),k.modules[ie]||(k.payloads[ie]=le,k.modules[ie]=null)};k.modules={},k.payloads={};var V=function(ie,ae,le){if(typeof ae=="string"){var Ie=re(ie,ae);if(Ie!=null)return le&&le(),Ie}else if(Object.prototype.toString.call(ae)==="[object Array]"){for(var ue=[],de=0,Ne=ae.length;de<Ne;++de){var he=re(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=V("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},oe=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return oe(ie,le[0])+"!"+oe(ie,le[1])}if(ae.charAt(0)=="."){var Ie=ie.split("/").slice(0,-1).join("/");for(ae=Ie+"/"+ae;ae.indexOf(".")!==-1&&ue!=ae;){var ue=ae;ae=ae.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return ae},re=function(ie,ae){ae=oe(ie,ae);var le=k.modules[ae];if(!le){if(le=k.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,pe){return V(ae,he,pe)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,k.modules[ae]=Ie,delete k.payloads[ae]}le=k.modules[ae]=Ie||le}return le};function Ce(ie){var ae=g;ie&&(g[ie]||(g[ie]={}),ae=g[ie]),(!ae.define||!ae.define.packaged)&&(k.original=ae.define,ae.define=k,ae.define.packaged=!0),(!ae.require||!ae.require.packaged)&&($.original=ae.require,ae.require=$,ae.require.packaged=!0)}Ce(r)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(r,g,k){function V($,oe,re){Object.defineProperty($,oe,{value:re,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||V(String.prototype,"startsWith",function($,oe){return oe=oe||0,this.lastIndexOf($,oe)===oe}),String.prototype.endsWith||V(String.prototype,"endsWith",function($,oe){var re=this;(oe===void 0||oe>re.length)&&(oe=re.length),oe-=$.length;var Ce=re.indexOf($,oe);return Ce!==-1&&Ce===oe}),String.prototype.repeat||V(String.prototype,"repeat",function($){for(var oe="",re=this;$>0;)$&1&&(oe+=re),($>>=1)&&(re+=re);return oe}),String.prototype.includes||V(String.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var oe=Object($),re=1;re<arguments.length;re++){var Ce=arguments[re];Ce!=null&&Object.keys(Ce).forEach(function(ie){oe[ie]=Ce[ie]})}return oe}),Object.values||(Object.values=function($){return Object.keys($).map(function(oe){return $[oe]})}),Array.prototype.find||V(Array.prototype,"find",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return ie}}),Array.prototype.findIndex||V(Array.prototype,"findIndex",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return Ce}}),Array.prototype.includes||V(Array.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Array.prototype.fill||V(Array.prototype,"fill",function($){for(var oe=this,re=oe.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(re+ie,0):Math.min(ie,re),le=arguments[2],Ie=le===void 0?re:le>>0,ue=Ie<0?Math.max(re+Ie,0):Math.min(Ie,re);ae<ue;)oe[ae]=$,ae++;return oe}),Array.of||V(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,k){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,k){g.last=function(oe){return oe[oe.length-1]},g.stringReverse=function(oe){return oe.split("").reverse().join("")},g.stringRepeat=function(oe,re){for(var Ce="";re>0;)re&1&&(Ce+=oe),(re>>=1)&&(oe+=oe);return Ce};var V=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(oe){return oe.replace(V,"")},g.stringTrimRight=function(oe){return oe.replace($,"")},g.copyObject=function(oe){var re={};for(var Ce in oe)re[Ce]=oe[Ce];return re},g.copyArray=function(oe){for(var re=[],Ce=0,ie=oe.length;Ce<ie;Ce++)oe[Ce]&&typeof oe[Ce]=="object"?re[Ce]=this.copyObject(oe[Ce]):re[Ce]=oe[Ce];return re},g.deepCopy=function oe(re){if(typeof re!="object"||!re)return re;var Ce;if(Array.isArray(re)){Ce=[];for(var ie=0;ie<re.length;ie++)Ce[ie]=oe(re[ie]);return Ce}if(Object.prototype.toString.call(re)!=="[object Object]")return re;Ce={};for(var ie in re)Ce[ie]=oe(re[ie]);return Ce},g.arrayToMap=function(oe){for(var re={},Ce=0;Ce<oe.length;Ce++)re[oe[Ce]]=1;return re},g.createMap=function(oe){var re=Object.create(null);for(var Ce in oe)re[Ce]=oe[Ce];return re},g.arrayRemove=function(oe,re){for(var Ce=0;Ce<=oe.length;Ce++)re===oe[Ce]&&oe.splice(Ce,1)},g.escapeRegExp=function(oe){return oe.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(oe){return(""+oe).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},g.getMatchOffsets=function(oe,re){var Ce=[];return oe.replace(re,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(oe){var re=null,Ce=function(){re=null,oe()},ie=function(ae){return ie.cancel(),re=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),oe(),ie},ie.cancel=function(){return clearTimeout(re),re=null,ie},ie.isPending=function(){return re},ie},g.delayedCall=function(oe,re){var Ce=null,ie=function(){Ce=null,oe()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||re))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||re)},ae.schedule=ae,ae.call=function(){this.cancel(),oe()},ae.cancel=function(){Ce&&clearTimeout(Ce),Ce=null},ae.isPending=function(){return Ce},ae}}),ace.define("ace/lib/oop",["require","exports","module"],function(r,g,k){g.inherits=function(V,$){V.super_=$,V.prototype=Object.create($.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(V,$){for(var oe in $)V[oe]=$[oe];return V},g.implement=function(V,$){g.mixin(V,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,k){g.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},g.getOS=function(){return g.isMac?g.OS.MAC:g.isLinux?g.OS.LINUX:g.OS.WINDOWS};var V=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(V.platform)||["other"])[0].toLowerCase(),oe=V.userAgent||"",re=V.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=re=="Microsoft Internet Explorer"||re.indexOf("MSAppHost")>=0?parseFloat((oe.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((oe.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=oe.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(oe.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(oe.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(oe.split(" Edge/")[1])||void 0,g.isAIR=oe.indexOf("AdobeAIR")>=0,g.isAndroid=oe.indexOf("Android")>=0,g.isChromeOS=oe.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(oe)&&!window.MSStream,g.isIOS&&(g.isMac=!0),g.isMobile=g.isIOS||g.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(r,g,k){var V=r("./useragent"),$="http://www.w3.org/1999/xhtml";g.buildDom=function le(Ie,ue,de){if(typeof Ie=="string"&&Ie){var Ne=document.createTextNode(Ie);return ue&&ue.appendChild(Ne),Ne}if(!Array.isArray(Ie))return Ie&&Ie.appendChild&&ue&&ue.appendChild(Ie),Ie;if(typeof Ie[0]!="string"||!Ie[0]){for(var he=[],pe=0;pe<Ie.length;pe++){var ze=le(Ie[pe],ue,de);ze&&he.push(ze)}return he}var Fe=document.createElement(Ie[0]),xe=Ie[1],_e=1;xe&&typeof xe=="object"&&!Array.isArray(xe)&&(_e=2);for(var pe=_e;pe<Ie.length;pe++)le(Ie[pe],Fe,de);return _e==2&&Object.keys(xe).forEach(function(Dt){var $e=xe[Dt];Dt==="class"?Fe.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||Dt=="value"||Dt[0]=="$"?Fe[Dt]=$e:Dt==="ref"?de&&(de[$e]=Fe):Dt==="style"?typeof $e=="string"&&(Fe.style.cssText=$e):$e!=null&&Fe.setAttribute(Dt,$e)}),ue&&ue.appendChild(Fe),Fe},g.getDocumentHead=function(le){return le||(le=document),le.head||le.getElementsByTagName("head")[0]||le.documentElement},g.createElement=function(le,Ie){return document.createElementNS?document.createElementNS(Ie||$,le):document.createElement(le)},g.removeChildren=function(le){le.innerHTML=""},g.createTextNode=function(le,Ie){var ue=Ie?Ie.ownerDocument:document;return ue.createTextNode(le)},g.createFragment=function(le){var Ie=le?le.ownerDocument:document;return Ie.createDocumentFragment()},g.hasCssClass=function(le,Ie){var ue=(le.className+"").split(/\s+/g);return ue.indexOf(Ie)!==-1},g.addCssClass=function(le,Ie){g.hasCssClass(le,Ie)||(le.className+=" "+Ie)},g.removeCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g);;){var de=ue.indexOf(Ie);if(de==-1)break;ue.splice(de,1)}le.className=ue.join(" ")},g.toggleCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g),de=!0;;){var Ne=ue.indexOf(Ie);if(Ne==-1)break;de=!1,ue.splice(Ne,1)}return de&&ue.push(Ie),le.className=ue.join(" "),de},g.setCssClass=function(le,Ie,ue){ue?g.addCssClass(le,Ie):g.removeCssClass(le,Ie)},g.hasCssString=function(le,Ie){var ue=0,de;if(Ie=Ie||document,de=Ie.querySelectorAll("style")){for(;ue<de.length;)if(de[ue++].id===le)return!0}},g.removeElementById=function(le,Ie){Ie=Ie||document,Ie.getElementById(le)&&Ie.getElementById(le).remove()};var oe,re=[];g.useStrictCSP=function(le){oe=le,le==!1?Ce():re||(re=[])};function Ce(){var le=re;re=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(re){if(ue)Ce();else if(ue===!1)return re.push([le,Ie])}if(!oe){var de=ue;!ue||!ue.getRootNode?de=document:(de=ue.getRootNode(),(!de||de==ue)&&(de=document));var Ne=de.ownerDocument||de;if(Ie&&g.hasCssString(Ie,de))return null;Ie&&(le+=`
|
355
355
|
/*# sourceURL=ace/css/`+Ie+" */");var he=g.createElement("style");he.appendChild(Ne.createTextNode(le)),Ie&&(he.id=Ie),de==Ne&&(de=g.getDocumentHead(Ne)),de.insertBefore(he,de.firstChild)}}}if(g.importCssString=ie,g.importCssStylsheet=function(le,Ie){g.buildDom(["link",{rel:"stylesheet",href:le}],g.getDocumentHead(Ie))},g.scrollbarWidth=function(le){var Ie=g.createElement("ace_inner");Ie.style.width="100%",Ie.style.minWidth="0px",Ie.style.height="200px",Ie.style.display="block";var ue=g.createElement("ace_outer"),de=ue.style;de.position="absolute",de.left="-10000px",de.overflow="hidden",de.width="200px",de.minWidth="0px",de.height="150px",de.display="block",ue.appendChild(Ie);var Ne=le&&le.documentElement||document&&document.documentElement;if(!Ne)return 0;Ne.appendChild(ue);var he=Ie.offsetWidth;de.overflow="scroll";var pe=Ie.offsetWidth;return he===pe&&(pe=ue.clientWidth),Ne.removeChild(ue),he-pe},g.computedStyle=function(le,Ie){return window.getComputedStyle(le,"")||{}},g.setStyle=function(le,Ie,ue){le[Ie]!==ue&&(le[Ie]=ue)},g.HAS_CSS_ANIMATION=!1,g.HAS_CSS_TRANSFORMS=!1,g.HI_DPI=V.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,V.isChromeOS&&(g.HI_DPI=!1),typeof document<"u"){var ae=document.createElement("div");g.HI_DPI&&ae.style.transform!==void 0&&(g.HAS_CSS_TRANSFORMS=!0),!V.isEdge&&typeof ae.style.animationName<"u"&&(g.HAS_CSS_ANIMATION=!0),ae=null}g.HAS_CSS_TRANSFORMS?g.translate=function(le,Ie,ue){le.style.transform="translate("+Math.round(Ie)+"px, "+Math.round(ue)+"px)"}:g.translate=function(le,Ie,ue){le.style.top=Math.round(ue)+"px",le.style.left=Math.round(Ie)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(r,g,k){/*
|
356
356
|
* based on code from:
|