xiaodao-spreader 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(le,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(le=typeof globalThis<"u"?globalThis:le||self,a(le.XiaoDaoSpreader={},le.Vue))})(this,function(le,a){"use strict";const al={"zh-CN":{insert:"插入",delete:"删除",rename:"重命名",moveLeft:"左移",moveRight:"右移",cut:"剪切",copy:"复制",paste:"粘贴",addSheet:"新建工作表",moveSheetLeft:"左移",moveSheetRight:"右移",scrollUp:"向上滚动",scrollDown:"向下滚动",scrollLeft:"向左滚动",scrollRight:"向右滚动",calculate:"计算",sum:"求和"},"en-US":{insert:"Insert",delete:"Delete",rename:"Rename",moveLeft:"Move Left",moveRight:"Move Right",cut:"Cut",copy:"Copy",paste:"Paste",addSheet:"Add new sheet",moveSheetLeft:"Move Left",moveSheetRight:"Move Right",scrollUp:"Scroll up",scrollDown:"Scroll down",scrollLeft:"Scroll left",scrollRight:"Scroll right",calculate:"Calculate",sum:"Sum"}};function B(s,d){var i;return((i=al[s])==null?void 0:i[d])??d}const rl={bg:"#f4f4f4",gridBg:"#ffffff",headerBg:"#e8e8e8",headerBorder:"#c8c8c8",headerText:"#444",headerSep:"#b0b0b0",cornerBg:"#e0e0e0",gridLine:"#e0e0e0",selectionBg:"rgba(0, 120, 215, 0.12)",activeCellBorder:"#0078d7",cellText:"#1a1a1a",scrollTrack:"rgba(0,0,0,0.08)",scrollThumb:"rgba(0,0,0,0.25)",formulaBarBg:"#f0f0f0",formulaBarBorder:"#c8c8c8",formulaBarLabelText:"#333",formulaBarLabelBg:"#fff",formulaBarLabelBorder:"#c0c0c0",formulaBarInputBg:"#fff",formulaBarInputBorder:"#c0c0c0",formulaBarInputText:"#1a1a1a",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.3)",wrapperBg:"#e8e8e8",cellEditorBorder:"#0078d7",cellEditorText:"#1a1a1a",cellEditorBg:"#fff",cellEditorShadow:"#0078d7",tabBarBg:"#e8e8e8",tabBarBorder:"#c0c0c0",tabActiveBg:"#ffffff",tabActiveText:"#1a1a1a",tabActiveBorder:"#0078d7",tabInactiveBg:"#dfdfdf",tabInactiveText:"#666",tabInactiveBorder:"transparent",tabHoverBg:"#e0e0e0",tabAddBtnColor:"#555",tabAddBtnHoverBg:"#d0d0d0",tabScrollBtnColor:"#888",tabScrollBtnHoverBg:"#d0d0d0",scrollbarThumb:"rgba(0,0,0,0.25)",scrollbarThumbHover:"rgba(0,0,0,0.4)",scrollBtnBg:"#e8e8e8",scrollBtnColor:"#666",scrollBtnHoverBg:"#d0d0d0",scrollBtnActiveBg:"#c0c0c0",scrollTrackBg:"rgba(0,0,0,0.06)"},cl={bg:"#1e1e1e",gridBg:"#252526",headerBg:"#252525",headerBorder:"#3e3e3e",headerText:"#999",headerSep:"#3e3e3e",cornerBg:"#2a2a2a",gridLine:"#3e3e3e",selectionBg:"rgba(0, 120, 215, 0.25)",activeCellBorder:"#0078d7",cellText:"#d4d4d4",scrollTrack:"rgba(255,255,255,0.06)",scrollThumb:"rgba(255,255,255,0.2)",formulaBarBg:"#2d2d2d",formulaBarBorder:"#3e3e3e",formulaBarLabelText:"#ccc",formulaBarLabelBg:"#3c3c3c",formulaBarLabelBorder:"#555",formulaBarInputBg:"#3c3c3c",formulaBarInputBorder:"#555",formulaBarInputText:"#d4d4d4",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.4)",wrapperBg:"#1e1e1e",cellEditorBorder:"#0078d7",cellEditorText:"#d4d4d4",cellEditorBg:"#3c3c3c",cellEditorShadow:"#0078d7",tabBarBg:"#2a2a2a",tabBarBorder:"#3e3e3e",tabActiveBg:"#1e1e1e",tabActiveText:"#e0e0e0",tabActiveBorder:"#0078d7",tabInactiveBg:"#333333",tabInactiveText:"#888",tabInactiveBorder:"transparent",tabHoverBg:"#3a3a3a",tabAddBtnColor:"#999",tabAddBtnHoverBg:"#3a3a3a",tabScrollBtnColor:"#777",tabScrollBtnHoverBg:"#3a3a3a",scrollbarThumb:"rgba(255,255,255,0.2)",scrollbarThumbHover:"rgba(255,255,255,0.35)",scrollBtnBg:"#2d2d2d",scrollBtnColor:"#999",scrollBtnHoverBg:"#3d3d3d",scrollBtnActiveBg:"#4d4d4d",scrollTrackBg:"rgba(255,255,255,0.05)"};function Y(s){let d="",i=s;do d=String.fromCharCode(65+i%26)+d,i=Math.floor(i/26)-1;while(i>=0);return d}function Qe(s){let d=0;for(let i=0;i<s.length;i++)d=d*26+(s.toUpperCase().charCodeAt(i)-64);return d-1}function ae(s){if(s==null)return null;if(typeof s=="number")return s;if(typeof s=="string"){const d=parseFloat(s);return s.endsWith("%")||isNaN(d)?null:d}return null}function et(s){navigator.clipboard.writeText(s).catch(()=>{const d=document.createElement("textarea");d.value=s,d.style.position="fixed",d.style.opacity="0",document.body.appendChild(d),d.select(),document.execCommand("copy"),document.body.removeChild(d)})}function me(s,d){return`${s},${d}`}function $e(s,d,i){const u=s.match(/^\$?([A-Z]+)\$?(\d+)$/i);if(!u)return null;const c=Qe(u[1]),E=parseInt(u[2],10)-1;return c<0||c>=d||E<0||E>=i?null:{col:c,row:E}}function re(s,d){if(!d)return{x:0,y:0};const i=d.getBoundingClientRect();return{x:s.clientX-i.left,y:s.clientY-i.top}}function sl(s,d,i){const u=s.split(":");if(u.length!==2)return null;const c=$e(u[0],d,i),E=$e(u[1],d,i);return!c||!E?null:{sc:Math.min(c.col,E.col),sr:Math.min(c.row,E.row),ec:Math.max(c.col,E.col),er:Math.max(c.row,E.row)}}function il(s,d,i,u,c){const E=i[me(s,d)];if(!E)return 0;const T=E.value;if(T.startsWith("="))return _t(me(s,d),i,u,c)??0;const b=parseFloat(T);return isNaN(b)?0:b}const be=new Map;function kt(){be.clear()}function _t(s,d,i,u){return ul(s,d,i,u)}function ul(s,d,i,u,c){if(be.has(s))return NaN;be.set(s,NaN);const E=d[s];if(!E)return NaN;const T=E.value;if(!T.startsWith("=")){const g=parseFloat(T),p=isNaN(g)?0:g;return be.set(s,p),p}const b=T.slice(1).trim();if(b.toUpperCase().startsWith("SUM(")&&b.endsWith(")")){const g=b.slice(4,-1).trim(),p=sl(g,i,u);if(p){let D=0;for(let N=p.sc;N<=p.ec;N++)for(let _=p.sr;_<=p.er;_++)D+=il(N,_,d,i,u);return isNaN(D)?NaN:(be.set(s,D),D)}return NaN}return NaN}function St(s,d,i){const u=[],c=/(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;let E;for(;(E=c.exec(s))!==null;){const T=$e(E[1],d,i);if(T)if(E[2]){const b=$e(E[2],d,i);if(!b)continue;for(let L=Math.min(T.col,b.col);L<=Math.max(T.col,b.col);L++)for(let g=Math.min(T.row,b.row);g<=Math.max(T.row,b.row);g++)u.push(me(L,g))}else u.push(me(T.col,T.row))}return u}function fl(s,d,i,u,c){const E=i[me(s,d)];if(!E)return"";const T=E.value;if(!T.startsWith("="))return T;const b=_t(me(s,d),i,u,c);return isNaN(b)?"#ERROR":String(b)}function dl(s,d,i,u,c,E){return d===0&&i===0?s:s.replace(/(\$?)([A-Z]+)(\$?)(\d+)/gi,(T,b,L,g,p)=>{const D=b?Qe(L):Qe(L)+d,N=g?parseInt(p,10)-1:parseInt(p,10)-1+i;let _;D<0?_="A":D>=u?_=E(u-1):_=E(D);let C;return N<0?C="1":N>=c?C=String(c):C=String(N+1),(b||"")+_+(g||"")+C})}class vl{constructor(){this.deps=new Map,this.rev=new Map,this.dirty=new Set}clear(d){var u;const i=this.deps.get(d);if(i){for(const c of i)(u=this.rev.get(c))==null||u.delete(d);this.deps.delete(d)}}set(d,i){if(this.clear(d),i.length!==0){this.deps.set(d,i);for(const u of i)this.rev.has(u)||this.rev.set(u,new Set),this.rev.get(u).add(d)}}markDirty(d){const i=[d];for(;i.length>0;){const u=i.pop(),c=this.rev.get(u);if(c)for(const E of c)this.dirty.has(E)||(this.dirty.add(E),i.push(E))}}getDirtyAndClear(){const d=this.dirty;return this.dirty=new Set,d}rebuild(d,i,u){this.deps.clear(),this.rev.clear(),this.dirty.clear(),be.clear();for(const[c,E]of Object.entries(d))if(E.value.startsWith("=")){const T=St(E.value.slice(1),i,u);this.set(c,T)}}}function hl(s,d,i,u){const c={},E=u(d),T=u(i);return E!=null&&(c.width=`${E}px`),T!=null&&(c.height=`${T}px`),c["--sp-formula-bar-bg"]=s.formulaBarBg,c["--sp-formula-bar-border"]=s.formulaBarBorder,c["--sp-formula-bar-label-color"]=s.formulaBarLabelText,c["--sp-formula-bar-label-bg"]=s.formulaBarLabelBg,c["--sp-formula-bar-label-border"]=s.formulaBarLabelBorder,c["--sp-formula-bar-input-bg"]=s.formulaBarInputBg,c["--sp-formula-bar-input-border"]=s.formulaBarInputBorder,c["--sp-formula-bar-input-color"]=s.formulaBarInputText,c["--sp-formula-bar-input-focus-border"]=s.formulaBarInputFocusBorder,c["--sp-formula-bar-input-focus-shadow"]=s.formulaBarInputFocusShadow,c["--sp-wrapper-bg"]=s.wrapperBg,c["--sp-cell-editor-border"]=s.cellEditorBorder,c["--sp-cell-editor-color"]=s.cellEditorText,c["--sp-cell-editor-bg"]=s.cellEditorBg,c["--sp-cell-editor-shadow"]=s.cellEditorShadow,c["--sp-tab-bar-bg"]=s.tabBarBg,c["--sp-tab-bar-border"]=s.tabBarBorder,c["--sp-tab-active-bg"]=s.tabActiveBg,c["--sp-tab-active-color"]=s.tabActiveText,c["--sp-tab-active-border"]=s.tabActiveBorder,c["--sp-tab-inactive-bg"]=s.tabInactiveBg,c["--sp-tab-inactive-color"]=s.tabInactiveText,c["--sp-tab-inactive-border"]=s.tabInactiveBorder,c["--sp-tab-hover-bg"]=s.tabHoverBg,c["--sp-tab-add-btn-color"]=s.tabAddBtnColor,c["--sp-tab-add-btn-hover-bg"]=s.tabAddBtnHoverBg,c["--sp-tab-scroll-btn-color"]=s.tabScrollBtnColor,c["--sp-tab-scroll-btn-hover-bg"]=s.tabScrollBtnHoverBg,c["--sp-scroll-thumb"]=s.scrollbarThumb,c["--sp-scroll-thumb-hover"]=s.scrollbarThumbHover,c["--sp-scroll-btn-bg"]=s.scrollBtnBg,c["--sp-scroll-btn-color"]=s.scrollBtnColor,c["--sp-scroll-btn-hover-bg"]=s.scrollBtnHoverBg,c["--sp-scroll-btn-active-bg"]=s.scrollBtnActiveBg,c["--sp-scroll-track-bg"]=s.scrollTrackBg,c}const pl={class:"tab-list"},ml=["onClick","onDblclick","onContextmenu"],bl=["value"],El={key:1,class:"tab-item__name"},gl=["title"],Hl={class:"formula-bar"},wl={class:"formula-bar__cell-label"},Bl=["value"],yl=["value"],Tl=["title"],Dl=["title"],Rl=["title"],xl=["title"],kl={key:2,class:"sb-corner"},_l=["onClick","onMouseenter"],Sl={class:"context-menu__label"},Cl={key:0,class:"context-menu__arrow"},Il=["onClick"],Ct=((s,d)=>{const i=s.__vccOpts||s;for(const[u,c]of d)i[u]=c;return i})(a.defineComponent({__name:"spreader",props:a.mergeModels({rowCount:{default:200},colCount:{default:26},width:{},height:{},theme:{default:"light"},locale:{default:"zh-CN"}},{data:{default:()=>[]},dataModifiers:{}}),emits:["update:data"],setup(s){const d=s,i=a.computed(()=>d.locale==="zh-CN"?"zh-CN":"en-US"),u=d.colCount,c=d.rowCount,E=a.useModel(s,"data");let T="";const b=a.reactive({}),L=new vl,g=a.ref(null),p=a.ref({col:0,row:0}),D=a.ref(null),N=a.ref(""),_=a.ref(new Array(u).fill(100)),C=a.ref(new Array(c).fill(24)),R=a.ref(0),x=a.ref(0),ce=a.computed(()=>{const e=[0];for(let t=0;t<u;t++)e.push(e[t]+_.value[t]);return e}),se=a.computed(()=>{const e=[0];for(let t=0;t<c;t++)e.push(e[t]+C.value[t]);return e}),tt=a.computed(()=>ce.value[u]),lt=a.computed(()=>se.value[c]);function j(e,t){p.value={col:e,row:t},g.value={startCol:e,startRow:t,endCol:e,endRow:t}}function K(e,t,n,l){p.value={col:e,row:t},g.value={startCol:Math.min(e,n),startRow:Math.min(t,l),endCol:Math.max(e,n),endRow:Math.max(t,l)}}function nt(){K(0,0,u-1,c-1)}function It(e,t){const n=g.value;return n?e>=n.startCol&&e<=n.endCol&&t>=n.startRow&&t<=n.endRow:!1}function M(e,t){return`${e},${t}`}function $(e){Reflect.deleteProperty(b,e)}function Ee(e,t){var n;return((n=b[M(e,t)])==null?void 0:n.value)??""}function Al(e,t){return kt(),fl(e,t,b,u,c)}function ge(e,t,n){var h;const l=M(e,t);if(kt(),n===""||n==null){L.clear(l),$(l),L.markDirty(l);return}const o=String(n),r=((h=b[l])==null?void 0:h.style)??null;b[l]={value:o,style:r},o.startsWith("=")?L.set(l,St(o.slice(1),u,c)):L.clear(l),L.markDirty(l)}function At(e,t,n,l){for(let o=e;o<=t;o++)for(let r=n;r<=l;r++){const h=M(o,r);L.clear(h),$(h),L.markDirty(h)}}function ne(e){D.value||(D.value={...p.value},N.value=e??Ee(p.value.col,p.value.row))}function ie(){D.value&&(ge(D.value.col,D.value.row,N.value),D.value=null,N.value="")}function ue(){D.value=null,N.value=""}function ee(e,t){j(Math.max(0,Math.min(u-1,p.value.col+e)),Math.max(0,Math.min(c-1,p.value.row+t)))}function I(e,t){const n=Math.max(0,G.w-52-11),l=Math.max(0,G.h-24-11),o=ce.value[e],r=se.value[t],h=_.value[e],m=C.value[t];let H=R.value,y=x.value;o<H?H=o:o+h>H+n&&(H=o+h-n),r<y?y=r:r+m>y+l&&(y=r+m-l),V(H,y)}function P(e){const t=ce.value;if(e<0||e>=t[u])return-1;let n=0,l=u-1;for(;n<l;){const o=n+l+1>>1;t[o]<=e?n=o:l=o-1}return n}function Z(e){const t=se.value;if(e<0||e>=t[c])return-1;let n=0,l=c-1;for(;n<l;){const o=n+l+1>>1;t[o]<=e?n=o:l=o-1}return n}const oe=a.ref([]),Le=a.ref([]);function ot(){const e={};for(const[t,n]of Object.entries(b))e[t]={value:n.value,style:n.style};return{cells:e,colWidths:[..._.value],rowHeights:[...C.value]}}function Mt(e){Object.keys(b).forEach(t=>$(t)),Object.assign(b,e.cells),_.value=e.colWidths,C.value=e.rowHeights,L.rebuild(b,u,c)}function F(){const e=ot(),t=oe.value[oe.value.length-1];t&&JSON.stringify(t)===JSON.stringify(e)||(oe.value.push(e),Le.value=[],oe.value.length>50&&oe.value.shift())}function Ml(){oe.value.length&&(Le.value.push(ot()),Mt(oe.value.pop()),g.value=null,v())}function Wl(){Le.value.length&&(oe.value.push(ot()),Mt(Le.value.pop()),g.value=null,v())}let Wt=null;function Ge(){const e=g.value;if(!e)return;Wt={...e};const t=[];for(let n=e.startRow;n<=e.endRow;n++){const l=[];for(let o=e.startCol;o<=e.endCol;o++)l.push(Ee(o,n));t.push(l.join(" "))}et(t.join(`
2
- `))}function Fe(){const e=g.value;if(e){if(e.startCol===0&&e.endCol===u-1){const t=[];for(let n=e.startRow;n<=e.endRow;n++){const l=[];for(let o=0;o<u;o++)l.push(Ee(o,n));t.push(l.join(" "))}et(t.join(`
3
- `))}else if(e.startRow===0&&e.endRow===c-1){const t=[];for(let n=0;n<c;n++){const l=[];for(let o=e.startCol;o<=e.endCol;o++)l.push(Ee(o,n));t.push(l.join(" "))}et(t.join(`
4
- `))}}}async function Ce(){let e="";try{e=await navigator.clipboard.readText()}catch{return}if(!e&&e!=="")return;const t=e.split(/\r?\n/),n=p.value,l=Wt;for(let o=0;o<t.length;o++){const r=t[o].split(" ");for(let h=0;h<r.length;h++){const m=n.col+h,H=n.row+o;if(m<u&&H<c){let y=r[h];y.startsWith("=")&&l&&(y=dl(y,m-(l.startCol+h),H-(l.startRow+o),u,c,Y)),ge(m,H,y)}}}}function at(){if(Ge(),g.value){const e=g.value;At(e.startCol,e.endCol,e.startRow,e.endRow),v()}}function rt(){if(g.value){const e=g.value;At(e.startCol,e.endCol,e.startRow,e.endRow),v()}}function Nl(){const e=g.value;if(!e)return;F();const t=e.startCol,n=e.startRow,l=e.endCol,o=e.endRow;if(n===o)if(l+1<u){const r=`${Y(t)}${n+1}:${Y(l)}${n+1}`;ge(l+1,n,`=SUM(${r})`)}else{const r=`${Y(t)}${n+1}:${Y(l-1)}${n+1}`;ge(l,n,`=SUM(${r})`)}else for(let r=t;r<=l;r++)if(o+1<c){const h=`${Y(r)}${n+1}:${Y(r)}${o+1}`;ge(r,o+1,`=SUM(${h})`)}else{const h=`${Y(r)}${n+1}:${Y(r)}${o}`;ge(r,o,`=SUM(${h})`)}v(),A()}function $l(e,t){const n=t-e+1;for(let l=e;l<=t;l++)for(let o=0;o<u;o++)$(M(o,l));for(let l=e;l<c-n;l++){for(let o=0;o<u;o++){const r=M(o,l+n),h=M(o,l);b[r]?(b[h]=b[r],$(r)):$(h)}C.value[l]=C.value[l+n]}for(let l=c-n;l<c;l++){for(let o=0;o<u;o++)$(M(o,l));C.value[l]=24}}function Ll(e,t){const n=t-e+1;if(!(t>=c-1)){for(let l=c-1;l>t;l--){for(let o=0;o<u;o++){const r=M(o,l-n),h=M(o,l);b[r]?b[h]=b[r]:$(h)}C.value[l]=C.value[l-n]}for(let l=t+1;l<=t+n;l++){for(let o=0;o<u;o++)$(M(o,l));C.value[l]=24}}}function Gl(e,t){const n=t-e+1;if(!(t>=u-1)){for(let l=u-1;l>t;l--){for(let o=0;o<c;o++){const r=M(l-n,o),h=M(l,o);b[r]?b[h]=b[r]:$(h)}_.value[l]=_.value[l-n]}for(let l=t+1;l<=t+n;l++){for(let o=0;o<c;o++)$(M(l,o));_.value[l]=100}}}function Fl(e,t){const n=t-e+1;for(let l=e;l<=t;l++)for(let o=0;o<c;o++)$(M(l,o));for(let l=e;l<u-n;l++){for(let o=0;o<c;o++){const r=M(l+n,o),h=M(l,o);b[r]?(b[h]=b[r],$(r)):$(h)}_.value[l]=_.value[l+n]}for(let l=u-n;l<u;l++){for(let o=0;o<c;o++)$(M(l,o));_.value[l]=100}}let Nt=0;function $t(){return Nt++,`s_${Nt}`}function Ve(e){return{id:$t(),name:e,cells:{},selection:{startCol:0,startRow:0,endCol:0,endRow:0},activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:new Array(u).fill(100),rowHeights:new Array(c).fill(24)}}const k=a.ref([Ve("Sheet1")]),U=a.ref(0);function Ie(){const e=k.value[U.value];e&&(e.cells={...b},e.selection=g.value?{...g.value}:null,e.activeCell={...p.value},e.scrollX=R.value,e.scrollY=x.value,e.colWidths=[..._.value],e.rowHeights=[...C.value])}function fe(e){const t=k.value[e];t&&(Object.keys(b).forEach(n=>$(n)),Object.assign(b,t.cells),g.value=t.selection?{...t.selection}:null,p.value={...t.activeCell},R.value=t.scrollX,x.value=t.scrollY,_.value=[...t.colWidths],C.value=[...t.rowHeights],U.value=e)}function Vl(e){e===U.value||e<0||e>=k.value.length||(ue(),Ie(),fe(e))}function ct(e){return ue(),Ie(),k.value.push(Ve(`Sheet${k.value.length+1}`)),fe(k.value.length-1),k.value.length-1}function Ol(e){return k.value.length<=1||(ue(),k.value.splice(e,1),fe(Math.min(e,k.value.length-1))),U.value}function Ul(e,t){k.value[e]&&t.trim()&&(k.value[e].name=t.trim())}function Xl(e){ue(),Ie();const t=k.value[e];if(!t)return e;let n=t.name;const l=n.match(/^(.*?)\s*\((\d+)\)$/);let o=l?parseInt(l[2],10)+1:2;l&&(n=l[1]);let r=`${n} (${o})`;const h=new Set(k.value.map(H=>H.name));for(;h.has(r);)o++,r=`${n} (${o})`;const m={id:$t(),name:r,cells:{...t.cells},selection:t.selection?{...t.selection}:null,activeCell:t.activeCell?{...t.activeCell}:{col:0,row:0},scrollX:t.scrollX,scrollY:t.scrollY,colWidths:[...t.colWidths],rowHeights:[...t.rowHeights]};return k.value.splice(e+1,0,m),fe(e+1),e+1}function Lt(e,t){const n=e+t;if(n<0||n>=k.value.length)return;const l=U.value,o=k.value.splice(e,1)[0];k.value.splice(n,0,o),l===e?U.value=n:e<l&&n>=l?U.value=l-1:e>l&&n<=l&&(U.value=l+1),v()}const zl=a.computed(()=>k.value.length);function A(){Ie();const e=k.value.map(n=>{const l={};for(const[m,H]of Object.entries(n.cells))l[m]={value:H.value},H.style&&(l[m].style=H.style);const o={name:n.name,cells:l},r={};for(let m=0;m<n.colWidths.length;m++)n.colWidths[m]!==100&&(r[m]=n.colWidths[m]);Object.keys(r).length&&(o.colWidths=r);const h={};for(let m=0;m<n.rowHeights.length;m++)n.rowHeights[m]!==24&&(h[m]=n.rowHeights[m]);return Object.keys(h).length&&(o.rowHeights=h),o}),t=JSON.stringify(e);t!==T&&(T=t,E.value=e)}let st=!1;function Gt(){st||(st=!0,Promise.resolve().then(()=>{st=!1,A()}))}const Ft=a.computed(()=>d.theme==="dark"?cl:rl),Yl=a.computed(()=>hl(Ft.value,d.width,d.height,ae)),de=a.ref(null),J=a.ref(null),it=a.ref(null),ut=a.ref(null),G=a.reactive({w:800,h:600}),He=a.computed(()=>Math.max(0,tt.value-Math.max(0,G.w-52-11))),we=a.computed(()=>Math.max(0,lt.value-Math.max(0,G.h-24-11)));function V(e,t){const n=Math.max(0,G.w-52-11),l=Math.max(0,G.h-24-11);R.value=Math.max(0,Math.min(e??R.value,Math.max(0,tt.value-n))),x.value=Math.max(0,Math.min(t??x.value,Math.max(0,lt.value-l)))}function jl(){var e;return typeof window>"u"?!1:!((e=window.matchMedia)!=null&&e.call(window,"(hover: none) and (pointer: coarse)").matches)}function O(e=!1){a.nextTick(()=>{const t=it.value;if(t){if(!D.value&&!jl()){document.activeElement===t&&t.blur();return}t.focus(),e&&t.select()}})}function Kl(){O()}let ft=!1,f=null,Ae=1;function v(){ft||(ft=!0,requestAnimationFrame(()=>{ft=!1,Pl()}))}function Pl(){const e=J.value;if(!e)return;const t=de.value;if(!t||(f=e.getContext("2d"),!f))return;Ae=window.devicePixelRatio||1;const n=t.getBoundingClientRect(),l=n.width,o=n.height;G.w=l,G.h=o,e.width=l*Ae,e.height=o*Ae,e.style.width=l+"px",e.style.height=o+"px",f.setTransform(Ae,0,0,Ae,0,0);const r=R.value,h=x.value,m=52,H=24,y=Ft.value,Dt=ce.value,Rt=se.value,qt=_.value,Qt=C.value,Je=Math.max(0,P(r));let el=Je;for(let w=Je;w<u&&!(m+Dt[w]-r>=l);w++)el=w;const tl=el,qe=Math.max(0,Z(h));let ll=qe;for(let w=qe;w<c&&!(H+Rt[w]-h>=o);w++)ll=w;const nl=ll;f.fillStyle=y.bg,f.fillRect(0,0,l,o),f.fillStyle=y.gridBg,f.fillRect(m,H,l-m,o-H),f.save(),f.beginPath(),f.rect(m+.5,H+.5,l-m-1,o-H-1),f.clip();const z=g.value,xt=D.value;for(let w=qe;w<=nl;w++)for(let S=Je;S<=tl;S++){const W=m+Dt[S]-r,pe=H+Rt[w]-h,Ne=qt[S],Se=Qt[w];if(!(W+Ne<m||pe+Se<H||W>l||pe>o)&&(It(S,w)&&(f.fillStyle=y.selectionBg,f.fillRect(W,pe,Ne,Se)),p.value.col===S&&p.value.row===w&&(f.strokeStyle=y.activeCellBorder,f.lineWidth=2,f.strokeRect(W+1,pe+1,Ne-2,Se-2)),f.strokeStyle=y.gridLine,f.lineWidth=.5,f.strokeRect(W+.25,pe+.25,Ne-.5,Se-.5),!(xt&&xt.col===S&&xt.row===w))){const ol=Al(S,w);ol&&(f.fillStyle=y.cellText,f.font='13px -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif',f.textBaseline="middle",f.save(),f.beginPath(),f.rect(W+5,pe+1,Ne-10,Se-2),f.clip(),f.fillText(ol,W+5,pe+Se/2+.5),f.restore())}}f.restore(),f.fillStyle=y.headerBg,f.fillRect(m,0,l-m,H);for(let w=Je;w<=tl;w++){const S=m+Dt[w]-r,W=qt[w];S+W<m||S>l||(z&&w>=z.startCol&&w<=z.endCol&&(f.fillStyle=y.selectionBg,f.fillRect(S,0,W,H)),f.strokeStyle=y.headerBorder,f.lineWidth=.5,f.strokeRect(S+.25,.25,W-.5,H-.5),z&&w>=z.startCol&&w<=z.endCol&&(f.strokeStyle=y.activeCellBorder,f.lineWidth=2,f.beginPath(),f.moveTo(S,H-1),f.lineTo(S+W,H-1),f.stroke()),f.fillStyle=y.headerText,f.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',f.textAlign="center",f.textBaseline="middle",f.fillText(Y(w),S+W/2,H/2))}f.strokeStyle=y.headerSep,f.lineWidth=1,f.beginPath(),f.moveTo(m,H+.5),f.lineTo(l,H+.5),f.stroke(),f.fillStyle=y.headerBg,f.fillRect(0,H,m,o-H);for(let w=qe;w<=nl;w++){const S=H+Rt[w]-h,W=Qt[w];S+W<H||S>o||(z&&w>=z.startRow&&w<=z.endRow&&(f.fillStyle=y.selectionBg,f.fillRect(0,S,m,W)),f.strokeStyle=y.headerBorder,f.lineWidth=.5,f.strokeRect(.25,S+.25,m-.5,W-.5),z&&w>=z.startRow&&w<=z.endRow&&(f.strokeStyle=y.activeCellBorder,f.lineWidth=2,f.beginPath(),f.moveTo(m-1,S),f.lineTo(m-1,S+W),f.stroke()),f.fillStyle=y.headerText,f.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',f.textAlign="center",f.textBaseline="middle",f.fillText(String(w+1),m/2,S+W/2+.5))}f.strokeStyle=y.headerSep,f.lineWidth=1,f.beginPath(),f.moveTo(m+.5,H),f.lineTo(m+.5,o),f.stroke(),f.fillStyle=y.headerBg,f.fillRect(0,0,m,H),f.strokeStyle=y.headerSep,f.lineWidth=1,f.strokeRect(.5,.5,m-.5,H-.5)}const Zl=a.computed(()=>Y(p.value.col)+String(p.value.row+1)),Jl=a.computed(()=>D.value?N.value:Ee(p.value.col,p.value.row));function ql(){D.value||(I(p.value.col,p.value.row),N.value=Ee(p.value.col,p.value.row),ne(),v())}function Ql(e){N.value=e.target.value}function en(e){var t,n;e.key==="Enter"?(e.preventDefault(),ie(),ee(0,1),I(p.value.col,p.value.row),(t=ut.value)==null||t.blur(),v(),O()):e.key==="Escape"&&(e.preventDefault(),ue(),(n=ut.value)==null||n.blur(),v(),O())}function tn(){setTimeout(()=>{D.value&&(ie(),v())},0)}const ve=a.ref(null),Be=a.ref("");function ln(e){ve.value===null&&(Vl(e),v())}function Vt(e){e!==U.value&&(Ie(),fe(e),v()),ve.value=e,Be.value=k.value[e].name,a.nextTick(()=>{const t=document.querySelector(".tab-rename-input");t==null||t.focus(),t==null||t.select()})}function Ot(){ve.value!==null&&(Ul(ve.value,Be.value),a.nextTick(A)),ve.value=null,Be.value=""}function nn(){ve.value=null,Be.value=""}function on(e){e.key==="Enter"?(e.preventDefault(),Ot()):e.key==="Escape"&&(e.preventDefault(),nn())}const te=a.ref(null);let Me=null;function Ut(){Me&&(document.removeEventListener("click",Me),Me=null)}function ye(e,t,n){Ut();const l=140,o=n.length*28+8,r=window.innerWidth,h=window.innerHeight;e+l>r&&(e-=l),t+o>h&&(t-=o),te.value={x:e,y:t,items:n},Me=()=>{te.value=null,Ut()},setTimeout(()=>document.addEventListener("click",Me,{once:!0}),0)}const Oe=a.ref(!1);function an(e,t){if(!t.children){Oe.value=!1;return}const l=e.currentTarget.querySelector(".context-submenu");if(!l){Oe.value=!1;return}const o=l.getBoundingClientRect();Oe.value=o.right>window.innerWidth}function rn(e,t){e.preventDefault(),e.stopPropagation(),ye(e.clientX,e.clientY,[{label:B(i.value,"insert"),action:()=>{ct(),v()}},{label:B(i.value,"copy"),action:()=>{Xl(t)}},{label:B(i.value,"rename"),action:()=>{Vt(t)}},{label:B(i.value,"delete"),action:()=>{Ol(t),v()},disabled:zl.value<=1},{label:B(i.value,"moveSheetLeft"),action:()=>{Lt(t,-1)},disabled:t===0},{label:B(i.value,"moveSheetRight"),action:()=>{Lt(t,1)},disabled:t===k.value.length-1}])}function cn(e){e.preventDefault(),!(e.target.closest(".tab-item")||e.target.closest(".tab-bar__add-btn"))&&ye(e.clientX,e.clientY,[{label:B(i.value,"insert"),action:()=>{ct(),v()}}])}function sn(e){e.preventDefault(),nt(),v(),ye(e.clientX,e.clientY,[{label:B(i.value,"cut"),action:()=>{at(),A()}},{label:B(i.value,"copy"),action:()=>Ge()},{label:B(i.value,"paste"),action:()=>{F(),Ce().then(()=>{v(),a.nextTick(A)})}},{label:B(i.value,"delete"),action:()=>{F(),rt();for(let t=0;t<u;t++)_.value[t]=100;for(let t=0;t<c;t++)C.value[t]=24;v(),A()}}])}function un(e,t){e.preventDefault();const n=g.value;n&&n.startCol===0&&n.endCol===u-1&&t>=n.startRow&&t<=n.endRow||(K(0,t,u-1,t),v());const l=g.value;ye(e.clientX,e.clientY,[{label:B(i.value,"insert"),action:()=>{F(),Ll(l.startRow,l.endRow),v(),A()},disabled:l.endRow>=c-1},{label:B(i.value,"cut"),action:()=>{F(),Fe();for(let o=l.startRow;o<=l.endRow;o++)for(let r=0;r<u;r++)$(M(r,o));v(),A()}},{label:B(i.value,"copy"),action:()=>Fe()},{label:B(i.value,"paste"),action:()=>{F(),Ce().then(()=>{v(),a.nextTick(A)})}},{label:B(i.value,"delete"),action:()=>{F(),$l(l.startRow,l.endRow),v(),A()}}])}function fn(e,t){e.preventDefault();const n=g.value;n&&n.startRow===0&&n.endRow===c-1&&t>=n.startCol&&t<=n.endCol||(K(t,0,t,c-1),v());const l=g.value;ye(e.clientX,e.clientY,[{label:B(i.value,"insert"),action:()=>{F(),Gl(l.startCol,l.endCol),v(),A()},disabled:l.endCol>=u-1},{label:B(i.value,"cut"),action:()=>{F(),Fe();for(let o=l.startCol;o<=l.endCol;o++)for(let r=0;r<c;r++)$(M(o,r));v(),A()}},{label:B(i.value,"copy"),action:()=>Fe()},{label:B(i.value,"paste"),action:()=>{F(),Ce().then(()=>{v(),a.nextTick(A)})}},{label:B(i.value,"delete"),action:()=>{F(),Fl(l.startCol,l.endCol),v(),A()}}])}function dn(e,t,n){e.preventDefault(),It(t,n)||(j(t,n),v());const l=g.value,o=!!(l&&l.startCol===l.endCol&&l.startRow===l.endRow);ye(e.clientX,e.clientY,[{label:B(i.value,"cut"),action:()=>{at(),A()}},{label:B(i.value,"copy"),action:()=>Ge()},{label:B(i.value,"paste"),action:()=>{F(),Ce().then(()=>{v(),a.nextTick(A)})}},{label:B(i.value,"delete"),action:()=>{F(),rt(),v(),A()}},{label:B(i.value,"calculate"),children:[{label:B(i.value,"sum"),action:Nl,disabled:o}]}])}const vn=a.computed(()=>{const e=!D.value,t=D.value??p.value,n=t.col,l=t.row;return{left:`${52+ce.value[n]-R.value}px`,top:`${24+se.value[l]-x.value}px`,width:`${_.value[n]}px`,height:`${C.value[l]}px`,opacity:e?0:1,pointerEvents:e?"none":"auto",color:e?"transparent":void 0,caretColor:e?"transparent":void 0,borderColor:e?"transparent":void 0,background:e?"transparent":void 0,boxShadow:e?"none":void 0}}),hn=a.computed(()=>Math.max(0,G.w-52-11)),pn=a.computed(()=>Math.max(0,G.h-24-11)),Ue=a.computed(()=>Math.max(0,hn.value-11*2)),Xe=a.computed(()=>Math.max(0,pn.value-11*2));function dt(){return Math.max(0,G.w-52-11)}function vt(){return Math.max(0,G.h-24-11)}const ze=a.computed(()=>He.value<=0?Ue.value:Math.max(24,dt()/tt.value*Ue.value)),ht=a.computed(()=>He.value<=0?0:R.value/He.value*(Ue.value-ze.value)),Ye=a.computed(()=>we.value<=0?Xe.value:Math.max(24,vt()/lt.value*Xe.value)),pt=a.computed(()=>we.value<=0?0:x.value/we.value*(Xe.value-Ye.value));let he=null,je=0,Ke=0;function mn(e){e.preventDefault(),he="v",je=e.clientY,Ke=x.value,document.addEventListener("mousemove",mt),document.addEventListener("mouseup",bt)}function bn(e){e.preventDefault(),he="h",je=e.clientX,Ke=R.value,document.addEventListener("mousemove",mt),document.addEventListener("mouseup",bt)}function mt(e){if(he==="v"){const n=(e.clientY-je)/(Xe.value-Ye.value);V(null,Ke+n*we.value),v()}else if(he==="h"){const n=(e.clientX-je)/(Ue.value-ze.value);V(Ke+n*He.value,null),v()}}function bt(){he=null,document.removeEventListener("mousemove",mt),document.removeEventListener("mouseup",bt)}function En(e){if(he)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top;n<pt.value?V(null,x.value-vt()):n>pt.value+Ye.value&&V(null,x.value+vt()),v()}function gn(e){if(he)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left;n<ht.value?V(R.value-dt(),null):n>ht.value+ze.value&&V(R.value+dt(),null),v()}let Te=!1,q=0,Q=0,De=!1,Re=!1,Xt=0,zt=0,xe=0,Pe=0,Et=0,gt=0,Yt=0,jt=0,We=!1,Ht=!1,ke=0,_e=0,wt=0,Kt=-1,Pt=-1;function Hn(e){if(e.button!==0)return;e.preventDefault(),te.value=null;const t=re(e,J.value);if(t.y<24&&t.x>=52){const o=t.x-52+R.value,r=P(o);if(r>=0&&Math.abs(t.x-(52+ce.value[r+1]-R.value))<=4){De=!0,Xt=r,xe=_.value[r],Pe=o,v();return}}if(t.x<52&&t.y>=24){const o=t.y-24+x.value,r=Z(o);if(r>=0&&Math.abs(t.y-(24+se.value[r+1]-x.value))<=4){Re=!0,zt=r,xe=C.value[r],Pe=o,v();return}}if(t.x<52||t.y<24){if(t.y<24&&t.x>=52){const o=P(t.x-52+R.value);o>=0&&(K(o,0,o,c-1),Te=!0,q=o,Q=0)}else if(t.x<52&&t.y>=24){const o=Z(t.y-24+x.value);o>=0&&(K(0,o,u-1,o),Te=!0,q=0,Q=o)}else t.x<52&&t.y<24&&nt();v();return}const n=P(t.x-52+R.value),l=Z(t.y-24+x.value);if(!(n<0||l<0)){if(ie(),e.shiftKey&&g.value){const o=g.value;K(o.startCol,o.startRow,n,l)}else j(n,l);Te=!0,q=n,Q=l,O(),v()}}function wn(e){if(De){const r=re(e,J.value).x-52+R.value-Pe;xe+r>=30&&(_.value[Xt]=xe+r),v();return}if(Re){const r=re(e,J.value).y-24+x.value-Pe;xe+r>=24&&(C.value[zt]=xe+r),v();return}if(!Te){const o=J.value;if(!o)return;const r=re(e,o);if(r.y<24&&r.x>=52){const h=P(r.x-52+R.value);if(h>=0&&Math.abs(r.x-(52+ce.value[h+1]-R.value))<=4){o.style.cursor="col-resize";return}}if(r.x<52&&r.y>=24){const h=Z(r.y-24+x.value);if(h>=0&&Math.abs(r.y-(24+se.value[h+1]-x.value))<=4){o.style.cursor="row-resize";return}}o.style.cursor="cell";return}const t=re(e,J.value);if(q<0||Q<0)return;if(t.x<52||t.y<24){if(t.y<24&&t.x>=52){const o=P(t.x-52+R.value);o>=0&&K(Math.min(q,o),0,Math.max(q,o),c-1)}else if(t.x<52&&t.y>=24){const o=Z(t.y-24+x.value);o>=0&&K(0,Math.min(Q,o),u-1,Math.max(Q,o))}v();return}const n=P(t.x-52+R.value),l=Z(t.y-24+x.value);n<0||l<0||(Q===0&&q>=0&&g.value&&g.value.startRow===0&&g.value.endRow===c-1?K(Math.min(q,n),0,Math.max(q,n),c-1):q===0&&Q>=0&&g.value&&g.value.startCol===0&&g.value.endCol===u-1?K(0,Math.min(Q,l),u-1,Math.max(Q,l)):K(q,Q,n,l),v())}function Bn(){const e=De||Re;Te=!1,De=!1,Re=!1,e&&Gt()}function yn(){const e=De||Re;Te=!1,De=!1,Re=!1,e&&Gt()}function Tn(e){e.preventDefault();const t=re(e,J.value);if(t.x<52&&t.y<24){sn(e);return}if(t.y<24&&t.x>=52){const n=P(t.x-52+R.value);n>=0&&fn(e,n);return}if(t.x<52&&t.y>=24){const n=Z(t.y-24+x.value);n>=0&&un(e,n);return}if(t.x>=52&&t.y>=24){const n=P(t.x-52+R.value),l=Z(t.y-24+x.value);n>=0&&l>=0&&dn(e,n,l)}}function Dn(e){const t=re(e,J.value);if(t.x<52||t.y<24)return;const n=P(t.x-52+R.value),l=Z(t.y-24+x.value);n<0||l<0||(j(n,l),I(n,l),ne(),v(),O())}function Rn(e){V(R.value+e.deltaX,x.value+e.deltaY),v()}function xn(e){if(e.touches.length!==1){We=!1;return}const t=e.touches[0],n=J.value;if(!n)return;const l=n.getBoundingClientRect(),o=t.clientX-l.left,r=t.clientY-l.top;o>=52&&r>=24&&(e.preventDefault(),We=!0,Ht=!1,Et=o,gt=r,Yt=R.value,jt=x.value,ke=P(o-52+R.value),_e=Z(r-24+x.value))}function kn(e){if(!We||e.touches.length!==1)return;const t=e.touches[0],n=J.value;if(!n)return;const l=n.getBoundingClientRect(),o=t.clientX-l.left,r=t.clientY-l.top;(Math.abs(o-Et)>8||Math.abs(r-gt)>8)&&(Ht=!0,e.preventDefault(),V(Yt+(Et-o),jt+(gt-r)),v())}function _n(){if(We&&(We=!1,!Ht&&ke>=0&&_e>=0)){const e=Date.now();ke===Kt&&_e===Pt&&e-wt<300?(j(ke,_e),ne(),v(),O(),wt=0):(ie(),j(ke,_e),v(),wt=e),Kt=ke,Pt=_e,O()}}function Bt(e){return e.isComposing||e.key==="Process"||e.keyCode===229}function Zt(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Jt(e){if(D.value)return;const t=e.ctrlKey||e.metaKey,n=e.shiftKey;switch(!0){case(t&&(e.key==="c"||e.key==="C")):e.preventDefault(),Ge();return;case(t&&(e.key==="x"||e.key==="X")):e.preventDefault(),at();return;case(t&&(e.key==="z"||e.key==="Z")):e.preventDefault(),Ml();return;case(t&&(e.key==="y"||e.key==="Y")):e.preventDefault(),Wl();return;case(t&&(e.key==="v"||e.key==="V")):e.preventDefault(),F(),Ce().then(()=>{v(),a.nextTick(A)});return;case(t&&(e.key==="a"||e.key==="A")):e.preventDefault(),nt(),v();return;case(t&&e.key==="Home"):e.preventDefault(),j(0,0),I(0,0),v();return;case(t&&e.key==="End"):e.preventDefault(),j(u-1,c-1),I(u-1,c-1),v();return;case e.key==="Home":e.preventDefault(),j(0,p.value.row),I(0,p.value.row),v();return;case e.key==="End":e.preventDefault(),j(u-1,p.value.row),I(u-1,p.value.row),v();return;case e.key==="ArrowUp":e.preventDefault(),ee(0,-1),I(p.value.col,p.value.row),v();return;case e.key==="ArrowDown":e.preventDefault(),ee(0,1),I(p.value.col,p.value.row),v();return;case e.key==="ArrowLeft":e.preventDefault(),ee(-1,0),I(p.value.col,p.value.row),v();return;case e.key==="ArrowRight":e.preventDefault(),ee(1,0),I(p.value.col,p.value.row),v();return;case e.key==="Tab":e.preventDefault(),ee(n?-1:1,0),I(p.value.col,p.value.row),v();return;case e.key==="Enter":e.preventDefault(),ee(0,n?-1:1),I(p.value.col,p.value.row),v();return;case e.key==="F2":e.preventDefault(),I(p.value.col,p.value.row),ne(),v(),O();return;case e.key==="Delete":case e.key==="Backspace":e.preventDefault(),F(),rt(),v();return;case e.key==="Escape":e.preventDefault(),ue(),v();return;case Zt(e):if(Bt(e)){I(p.value.col,p.value.row),ne(""),v(),O();return}e.preventDefault(),I(p.value.col,p.value.row),ne(e.key),v(),a.nextTick(()=>{const l=it.value;l&&(l.focus(),l.setSelectionRange(1,1))});return}}let yt=!1,Tt=!1;function Sn(e){const t=e.target.value;if(!D.value){I(p.value.col,p.value.row),ne(t),v();return}N.value=t}function Cn(){yt=!0,D.value||(I(p.value.col,p.value.row),ne(""),v())}function In(e){yt=!1,Tt=!0,setTimeout(()=>{Tt=!1},0),N.value=e.target.value}function An(e){if(!D.value){if(Zt(e)||Bt(e))return;Jt(e);return}yt||Bt(e)||Tt&&(e.key==="Enter"||e.key==="Escape")||(e.key==="Enter"?(e.preventDefault(),ie(),ee(0,1),I(p.value.col,p.value.row),v(),O()):e.key==="Tab"?(e.preventDefault(),ie(),ee(e.shiftKey?-1:1,0),I(p.value.col,p.value.row),v(),O()):e.key==="Escape"&&(e.preventDefault(),ue(),v(),O()))}function Mn(){setTimeout(()=>{D.value&&(ie(),v())},0)}function Ze(){var t;const e=(t=de.value)==null?void 0:t.getBoundingClientRect();if(e){const n=ae(d.width),l=ae(d.height);n!=null?G.w=n:G.w=e.width,l!=null?G.h=l:G.h=e.height}V(null,null),v()}let X=null;return a.onMounted(()=>{const e=ae(d.width),t=ae(d.height);(e==null||t==null)&&(X=new ResizeObserver(()=>Ze()),de.value&&X.observe(de.value)),a.nextTick(()=>{Ze(),O()}),j(0,0),E.value&&E.value.length>0&&(T=JSON.stringify(E.value),k.value=E.value.map(n=>{const l=Ve(n.name);for(const[o,r]of Object.entries(n.cells))l.cells[o]={value:r.value,style:r.style??null};if(n.colWidths)for(const[o,r]of Object.entries(n.colWidths)){const h=Number(o);h>=0&&h<u&&r>=30&&(l.colWidths[h]=r)}if(n.rowHeights)for(const[o,r]of Object.entries(n.rowHeights)){const h=Number(o);h>=0&&h<c&&r>=24&&(l.rowHeights[h]=r)}return l}),k.value.length>0&&fe(0))}),a.watch(()=>[d.width,d.height],()=>{const e=ae(d.width),t=ae(d.height);e!=null&&t!=null?(X==null||X.disconnect(),X=null):!X&&de.value&&(X=new ResizeObserver(()=>Ze()),X.observe(de.value)),a.nextTick(()=>Ze())}),a.watch(()=>d.theme,()=>v()),a.watch(()=>({...b}),()=>a.nextTick(A),{deep:!1}),a.watch(U,()=>a.nextTick(A)),a.watch(()=>E.value,e=>{if(!e||e.length===0)return;const t=JSON.stringify(e);t!==T&&(T=t,k.value=e.map(n=>{const l=Ve(n.name);for(const[o,r]of Object.entries(n.cells))l.cells[o]={value:r.value,style:r.style??null};if(n.colWidths)for(const[o,r]of Object.entries(n.colWidths)){const h=Number(o);h>=0&&h<u&&r>=30&&(l.colWidths[h]=r)}if(n.rowHeights)for(const[o,r]of Object.entries(n.rowHeights)){const h=Number(o);h>=0&&h<c&&r>=24&&(l.rowHeights[h]=r)}return l}),k.value.length>0&&fe(0),v())},{deep:!0}),a.onBeforeUnmount(()=>{X==null||X.disconnect()}),(e,t)=>(a.openBlock(),a.createElementBlock("div",{class:"spreadsheet-outer",style:a.normalizeStyle(Yl.value)},[a.createElementVNode("div",{class:"tab-bar",onContextmenu:cn},[a.createElementVNode("div",pl,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(k.value,(n,l)=>(a.openBlock(),a.createElementBlock("div",{key:n.id,class:a.normalizeClass(["tab-item",{"tab-item--active":l===U.value}]),onClick:o=>ln(l),onDblclick:a.withModifiers(o=>Vt(l),["prevent"]),onContextmenu:o=>rn(o,l)},[ve.value===l?(a.openBlock(),a.createElementBlock("input",{key:0,class:"tab-rename-input",value:Be.value,onInput:t[0]||(t[0]=o=>Be.value=o.target.value),onKeydown:on,onBlur:Ot,onClick:t[1]||(t[1]=a.withModifiers(()=>{},["stop"]))},null,40,bl)):(a.openBlock(),a.createElementBlock("span",El,a.toDisplayString(n.name),1))],42,ml))),128))]),a.createElementVNode("button",{class:"tab-bar__add-btn",title:a.unref(B)(i.value,"addSheet"),onClick:t[2]||(t[2]=n=>{ct(),v()})}," + ",8,gl)],32),a.createElementVNode("div",Hl,[a.createElementVNode("div",wl,a.toDisplayString(Zl.value),1),a.createElementVNode("input",{ref_key:"formulaBarRef",ref:ut,class:"formula-bar__input",value:Jl.value,onFocus:ql,onInput:Ql,onKeydown:en,onBlur:tn},null,40,Bl)]),a.createElementVNode("div",{ref_key:"wrapperRef",ref:de,class:"spreadsheet-wrapper"},[a.createElementVNode("canvas",{ref_key:"canvasRef",ref:J,class:"grid-canvas",tabindex:"0",onMousedown:Hn,onMousemove:wn,onMouseup:Bn,onMouseleave:yn,onDblclick:Dn,onWheel:a.withModifiers(Rn,["prevent"]),onFocus:Kl,onKeydown:Jt,onContextmenu:Tn,onTouchstart:a.withModifiers(xn,["prevent"]),onTouchmove:a.withModifiers(kn,["prevent"]),onTouchend:_n},null,544),a.createElementVNode("input",{ref_key:"editInputRef",ref:it,class:"cell-editor",value:N.value,style:a.normalizeStyle(vn.value),onInput:Sn,onKeydown:An,onCompositionstart:Cn,onCompositionend:In,onBlur:Mn},null,44,yl),we.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:"v-scrollbar",style:a.normalizeStyle({top:a.unref(24)+"px",height:`calc(100% - ${a.unref(24)+a.unref(11)}px)`})},[a.createElementVNode("button",{class:"sb-btn sb-btn--up",title:a.unref(B)(i.value,"scrollUp"),onMousedown:t[3]||(t[3]=a.withModifiers(n=>{V(null,x.value-50),v()},["prevent"]))},[...t[8]||(t[8]=[a.createElementVNode("span",{class:"sb-arrow sb-arrow--up"},null,-1)])],40,Tl),a.createElementVNode("div",{class:"sb-track sb-track--v",onMousedown:En},[a.createElementVNode("div",{class:"sb-thumb sb-thumb--v",style:a.normalizeStyle({top:pt.value+"px",height:Ye.value+"px"}),onMousedown:mn},null,36)],32),a.createElementVNode("button",{class:"sb-btn sb-btn--down",title:a.unref(B)(i.value,"scrollDown"),onMousedown:t[4]||(t[4]=a.withModifiers(n=>{V(null,x.value+50),v()},["prevent"]))},[...t[9]||(t[9]=[a.createElementVNode("span",{class:"sb-arrow sb-arrow--down"},null,-1)])],40,Dl)],4)):a.createCommentVNode("",!0),He.value>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:"h-scrollbar",style:a.normalizeStyle({left:a.unref(52)+"px",width:`calc(100% - ${a.unref(52)+a.unref(11)}px)`})},[a.createElementVNode("button",{class:"sb-btn sb-btn--left",title:a.unref(B)(i.value,"scrollLeft"),onMousedown:t[5]||(t[5]=a.withModifiers(n=>{V(R.value-50,null),v()},["prevent"]))},[...t[10]||(t[10]=[a.createElementVNode("span",{class:"sb-arrow sb-arrow--left"},null,-1)])],40,Rl),a.createElementVNode("div",{class:"sb-track sb-track--h",onMousedown:gn},[a.createElementVNode("div",{class:"sb-thumb sb-thumb--h",style:a.normalizeStyle({left:ht.value+"px",width:ze.value+"px"}),onMousedown:bn},null,36)],32),a.createElementVNode("button",{class:"sb-btn sb-btn--right",title:a.unref(B)(i.value,"scrollRight"),onMousedown:t[6]||(t[6]=a.withModifiers(n=>{V(R.value+50,null),v()},["prevent"]))},[...t[11]||(t[11]=[a.createElementVNode("span",{class:"sb-arrow sb-arrow--right"},null,-1)])],40,xl)],4)):a.createCommentVNode("",!0),He.value>0&&we.value>0?(a.openBlock(),a.createElementBlock("div",kl)):a.createCommentVNode("",!0)],512),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[te.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"context-menu",style:a.normalizeStyle({left:te.value.x+"px",top:te.value.y+"px"}),onClick:t[7]||(t[7]=a.withModifiers(()=>{},["stop"]))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(te.value.items,(n,l)=>(a.openBlock(),a.createElementBlock("div",{key:l,class:a.normalizeClass(["context-menu__item",{"context-menu__item--disabled":n.disabled}]),onClick:o=>!n.disabled&&n.action&&(n.action(),te.value=null),onMouseenter:o=>an(o,n)},[a.createElementVNode("span",Sl,a.toDisplayString(n.label),1),n.children?(a.openBlock(),a.createElementBlock("span",Cl)):a.createCommentVNode("",!0),n.children?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["context-submenu",{"context-submenu--left":Oe.value}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.children,(o,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:a.normalizeClass(["context-menu__item",{"context-menu__item--disabled":o.disabled}]),onClick:a.withModifiers(h=>!o.disabled&&o.action&&(o.action(),te.value=null),["stop"])},a.toDisplayString(o.label),11,Il))),128))],2)):a.createCommentVNode("",!0)],42,_l))),128))],4)):a.createCommentVNode("",!0)]))],4))}}),[["__scopeId","data-v-5100e6d6"]]);le.Spreader=Ct,le.default=Ct,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(De,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(De=typeof globalThis<"u"?globalThis:De||self,e(De.XiaoDaoSpreader={},De.Vue))})(this,function(De,e){"use strict";const fl={"zh-CN":{insert:"插入",delete:"删除",rename:"重命名",moveLeft:"左移",moveRight:"右移",cut:"剪切",copy:"复制",paste:"粘贴",addSheet:"新建工作表",moveSheetLeft:"左移",moveSheetRight:"右移",scrollUp:"向上滚动",scrollDown:"向下滚动",scrollLeft:"向左滚动",scrollRight:"向右滚动",calculate:"计算",sum:"求和",undo:"撤销",redo:"重做",paintFormat:"格式刷",clearFormat:"清除格式",fontFamily:"字体",fontSize:"字号",fontSizeIncrease:"增大字号",fontSizeDecrease:"减小字号",bold:"加粗",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontColor:"文字颜色",fillColor:"填充颜色",borders:"边框",borderBottom:"下框线",borderTop:"上框线",borderLeft:"左框线",borderRight:"右框线",borderNone:"无框线",borderAll:"所有框线",borderOuter:"外框线",borderThickOuter:"粗外框线",fontDefault:"默认",rowHeight:"行高",colWidth:"列宽",defaultRowHeight:"默认行高",defaultColWidth:"默认列宽",ok:"确定",cancel:"取消",dimNumberError:"请输入数字",dimRangeError:"请输入 {min}~{max} 之间的数值",colorAutomatic:"自动",colorNoFill:"无填充",colorWhite:"白色",colorBlack:"黑色",colorLightGray:"浅灰",colorLightBlue:"浅蓝",colorLightOrange:"浅橙",colorLightYellow:"浅黄",colorLightGreen:"浅绿",colorPaleBlue:"淡蓝",colorPaleOrange:"淡橙",colorPaleYellow:"淡黄",colorPaleGreen:"淡绿",colorSilver:"银色",colorSkyBlue:"天蓝",colorCoral:"珊瑚",colorGold:"金色",colorMint:"薄荷",colorGray:"灰色",colorMediumBlue:"中蓝",colorOrange:"橙色",colorAmber:"琥珀",colorMediumGreen:"中绿",colorDarkGray:"深灰",colorRoyalBlue:"宝蓝",colorRed:"红色",colorDarkGold:"深金",colorDarkGreen:"深绿",colorCharcoal:"炭灰",colorDeepBlue:"深蓝",colorDarkRed:"深红",colorOlive:"橄榄",colorForest:"森林",colorSlate:"石板灰",colorNavy:"藏青",colorCrimson:"绯红",colorDarkOlive:"深橄榄",colorDeepForest:"深林",colorDarkSlate:"深石板灰",colorMidnight:"午夜蓝",colorMaroon:"栗色",colorCoffee:"咖啡色",colorEvergreen:"常青",colorDarkNavy:"深藏青",colorDarkMaroon:"深栗",colorDarkCoffee:"深咖",colorInkGreen:"墨绿"},"en-US":{insert:"Insert",delete:"Delete",rename:"Rename",moveLeft:"Move Left",moveRight:"Move Right",cut:"Cut",copy:"Copy",paste:"Paste",addSheet:"Add new sheet",moveSheetLeft:"Move Left",moveSheetRight:"Move Right",scrollUp:"Scroll up",scrollDown:"Scroll down",scrollLeft:"Scroll left",scrollRight:"Scroll right",calculate:"Calculate",sum:"Sum",undo:"Undo",redo:"Redo",paintFormat:"Paint Format",clearFormat:"Clear Format",fontFamily:"Font Family",fontSize:"Font Size",fontSizeIncrease:"Increase Font Size",fontSizeDecrease:"Decrease Font Size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontColor:"Font Color",fillColor:"Fill Color",borders:"Borders",borderBottom:"Bottom Border",borderTop:"Top Border",borderLeft:"Left Border",borderRight:"Right Border",borderNone:"No Border",borderAll:"All Borders",borderOuter:"Outside Borders",borderThickOuter:"Thick Box Border",fontDefault:"Default",rowHeight:"Row Height",colWidth:"Column Width",defaultRowHeight:"Default Row Height",defaultColWidth:"Default Column Width",ok:"OK",cancel:"Cancel",dimNumberError:"Please enter a number",dimRangeError:"Please enter a value between {min} and {max}",colorAutomatic:"Automatic",colorNoFill:"No Fill",colorWhite:"White",colorBlack:"Black",colorLightGray:"Light Gray",colorLightBlue:"Light Blue",colorLightOrange:"Light Orange",colorLightYellow:"Light Yellow",colorLightGreen:"Light Green",colorPaleBlue:"Pale Blue",colorPaleOrange:"Pale Orange",colorPaleYellow:"Pale Yellow",colorPaleGreen:"Pale Green",colorSilver:"Silver",colorSkyBlue:"Sky Blue",colorCoral:"Coral",colorGold:"Gold",colorMint:"Mint",colorGray:"Gray",colorMediumBlue:"Medium Blue",colorOrange:"Orange",colorAmber:"Amber",colorMediumGreen:"Medium Green",colorDarkGray:"Dark Gray",colorRoyalBlue:"Royal Blue",colorRed:"Red",colorDarkGold:"Dark Gold",colorDarkGreen:"Dark Green",colorCharcoal:"Charcoal",colorDeepBlue:"Deep Blue",colorDarkRed:"Dark Red",colorOlive:"Olive",colorForest:"Forest",colorSlate:"Slate",colorNavy:"Navy",colorCrimson:"Crimson",colorDarkOlive:"Dark Olive",colorDeepForest:"Deep Forest",colorDarkSlate:"Dark Slate",colorMidnight:"Midnight",colorMaroon:"Maroon",colorCoffee:"Coffee",colorEvergreen:"Evergreen",colorDarkNavy:"Dark Navy",colorDarkMaroon:"Dark Maroon",colorDarkCoffee:"Dark Coffee",colorInkGreen:"Ink Green"}};function B(a,h){var c;return((c=fl[a])==null?void 0:c[h])??h}const vo='-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif',Fe=10,ml=[{label:"",value:""},{label:"微软雅黑",value:'"Microsoft YaHei", "微软雅黑", sans-serif'},{label:"宋体",value:'"SimSun", "宋体", serif'},{label:"黑体",value:'"SimHei", "黑体", sans-serif'},{label:"楷体",value:'"KaiTi", "楷体", serif'},{label:"Arial",value:"Arial, sans-serif"},{label:"Arial Black",value:'"Arial Black", sans-serif'},{label:"Times New Roman",value:'"Times New Roman", serif'},{label:"Courier New",value:'"Courier New", monospace'},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Trebuchet MS",value:'"Trebuchet MS", sans-serif'},{label:"Comic Sans MS",value:'"Comic Sans MS", cursive'}],pl=[{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"20",value:20},{label:"24",value:24},{label:"28",value:28},{label:"32",value:32},{label:"36",value:36},{label:"48",value:48},{label:"72",value:72}],bl={bg:"#f4f4f4",gridBg:"#ffffff",headerBg:"#e8e8e8",headerBorder:"#c8c8c8",headerText:"#444",headerSep:"#b0b0b0",cornerBg:"#e0e0e0",gridLine:"#e0e0e0",selectionBg:"rgba(0, 120, 215, 0.12)",activeCellBorder:"#0078d7",cellText:"#1a1a1a",scrollTrack:"rgba(0,0,0,0.08)",scrollThumb:"rgba(0,0,0,0.25)",formulaBarBg:"#f0f0f0",formulaBarBorder:"#c8c8c8",formulaBarLabelText:"#333",formulaBarLabelBg:"#fff",formulaBarLabelBorder:"#c0c0c0",formulaBarInputBg:"#fff",formulaBarInputBorder:"#c0c0c0",formulaBarInputText:"#1a1a1a",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.3)",wrapperBg:"#e8e8e8",cellEditorBorder:"#0078d7",cellEditorText:"#1a1a1a",cellEditorBg:"#fff",cellEditorShadow:"#0078d7",tabBarBg:"#e8e8e8",tabBarBorder:"#c0c0c0",tabActiveBg:"#ffffff",tabActiveText:"#1a1a1a",tabActiveBorder:"#0078d7",tabInactiveBg:"#dfdfdf",tabInactiveText:"#666",tabInactiveBorder:"transparent",tabHoverBg:"#e0e0e0",tabAddBtnColor:"#555",tabAddBtnHoverBg:"#d0d0d0",tabScrollBtnColor:"#888",tabScrollBtnHoverBg:"#d0d0d0",scrollbarThumb:"rgba(0,0,0,0.25)",scrollbarThumbHover:"rgba(0,0,0,0.4)",scrollBtnBg:"#e8e8e8",scrollBtnColor:"#666",scrollBtnHoverBg:"#d0d0d0",scrollBtnActiveBg:"#c0c0c0",scrollTrackBg:"rgba(0,0,0,0.06)",toolbarBg:"#f7f7f7",toolbarBorder:"#d8d8d8",toolbarBtnColor:"#444",toolbarBtnHoverBg:"#e6e6e6",toolbarBtnDisabledColor:"#b0b0b0",toolbarBtnActiveColor:"#0078d7"},hl={bg:"#1e1e1e",gridBg:"#252526",headerBg:"#252525",headerBorder:"#3e3e3e",headerText:"#999",headerSep:"#3e3e3e",cornerBg:"#2a2a2a",gridLine:"#3e3e3e",selectionBg:"rgba(0, 120, 215, 0.25)",activeCellBorder:"#0078d7",cellText:"#d4d4d4",scrollTrack:"rgba(255,255,255,0.06)",scrollThumb:"rgba(255,255,255,0.2)",formulaBarBg:"#2d2d2d",formulaBarBorder:"#3e3e3e",formulaBarLabelText:"#ccc",formulaBarLabelBg:"#3c3c3c",formulaBarLabelBorder:"#555",formulaBarInputBg:"#3c3c3c",formulaBarInputBorder:"#555",formulaBarInputText:"#d4d4d4",formulaBarInputFocusBorder:"#0078d7",formulaBarInputFocusShadow:"rgba(0, 120, 215, 0.4)",wrapperBg:"#1e1e1e",cellEditorBorder:"#0078d7",cellEditorText:"#d4d4d4",cellEditorBg:"#3c3c3c",cellEditorShadow:"#0078d7",tabBarBg:"#2a2a2a",tabBarBorder:"#3e3e3e",tabActiveBg:"#1e1e1e",tabActiveText:"#e0e0e0",tabActiveBorder:"#0078d7",tabInactiveBg:"#333333",tabInactiveText:"#888",tabInactiveBorder:"transparent",tabHoverBg:"#3a3a3a",tabAddBtnColor:"#999",tabAddBtnHoverBg:"#3a3a3a",tabScrollBtnColor:"#777",tabScrollBtnHoverBg:"#3a3a3a",scrollbarThumb:"rgba(255,255,255,0.2)",scrollbarThumbHover:"rgba(255,255,255,0.35)",scrollBtnBg:"#2d2d2d",scrollBtnColor:"#999",scrollBtnHoverBg:"#3d3d3d",scrollBtnActiveBg:"#4d4d4d",scrollTrackBg:"rgba(255,255,255,0.05)",toolbarBg:"#2a2a2a",toolbarBorder:"#3e3e3e",toolbarBtnColor:"#ccc",toolbarBtnHoverBg:"#3a3a3a",toolbarBtnDisabledColor:"#666",toolbarBtnActiveColor:"#4ea1ff"},vl=["title"],gl={class:"sp-dropdown__value"},yl=["disabled"],kl=["onClick"],El=["disabled"],wl=e.defineComponent({__name:"dropdown",props:{modelValue:{},options:{},width:{default:"auto"},visibleCount:{default:8},title:{default:""},modelOpen:{type:Boolean,default:void 0},hideTrigger:{type:Boolean,default:!1}},emits:["update:modelValue","change","update:modelOpen"],setup(a,{emit:h}){const c=a,m=h,s=e.ref(!1),C=e.ref(0),D=e.ref(null),v=e.ref(null),F=e.ref(null),E=e.ref({left:0,top:0,up:!1}),g=e.ref(0),H=e.ref(!1),L=e.computed(()=>c.options.find(p=>String(p.value)===String(c.modelValue))),M=e.computed(()=>Math.min(c.visibleCount,c.options.length)),W=e.computed(()=>c.options.slice(C.value,C.value+M.value)),x=e.computed(()=>C.value>0),R=e.computed(()=>C.value+M.value<c.options.length);function A(p){C.value=Math.max(0,Math.min(c.options.length-M.value,C.value+p))}function G(){s.value=!0,c.modelOpen!==void 0&&m("update:modelOpen",!0);const p=D.value;if(!p)return;const w=p.getBoundingClientRect(),I=M.value*26+2*15+8,ze=window.innerHeight-w.bottom-4<I&&w.top-4>I;E.value={left:w.left,top:ze?w.top-I-4:w.bottom+4,up:ze};const ie=c.options.findIndex(Te=>String(Te.value)===String(c.modelValue));C.value=ie>=0?Math.max(0,Math.min(ie-Math.floor(M.value/2),c.options.length-M.value)):0}function z(){s.value=!1,c.modelOpen!==void 0&&m("update:modelOpen",!1)}function J(){s.value?z():G()}function j(p){m("update:modelValue",p.value),m("change",p.value),z()}function Q(p){var I,Y;if(!s.value)return;const w=p.target;(I=D.value)!=null&&I.contains(w)||(Y=F.value)!=null&&Y.contains(w)||z()}function ke(p){s.value&&(p.preventDefault(),A(p.deltaY>0?1:-1))}e.watch(s,p=>{e.nextTick(()=>{var w,I;p?(w=v.value)==null||w.addEventListener("wheel",ke,{passive:!1}):(I=v.value)==null||I.removeEventListener("wheel",ke)})}),e.watch(()=>c.modelOpen,p=>{p!==void 0&&p!==s.value&&(p?G():z())});function Ve(p){s.value&&(g.value=p.touches[0].clientY,H.value=!0)}function N(p){if(!s.value||!H.value)return;const w=p.touches[0].clientY-g.value;Math.abs(w)>5&&(A(w<0?1:-1),g.value=p.touches[0].clientY)}function V(){H.value=!1}function d(p){p.key==="Escape"&&z()}return e.onMounted(()=>{document.addEventListener("mousedown",Q),window.addEventListener("resize",z),window.addEventListener("scroll",z,!0)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Q),window.removeEventListener("resize",z),window.removeEventListener("scroll",z,!0)}),(p,w)=>{var I;return e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:D,class:"sp-dropdown",style:e.normalizeStyle(typeof a.width=="number"?{width:a.width+"px"}:{width:a.width})},[a.hideTrigger?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["sp-dropdown__trigger",{"sp-dropdown__trigger--open":s.value}]),title:a.title,onClick:J},[e.createElementVNode("span",gl,e.toDisplayString(((I=L.value)==null?void 0:I.label)??""),1),w[2]||(w[2]=e.createElementVNode("svg",{class:"sp-dropdown__caret",viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1))],10,vl)),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"menuRef",ref:F,class:e.normalizeClass(["sp-dropdown__menu",{"sp-dropdown__menu--up":E.value.up}]),style:e.normalizeStyle({left:E.value.left+"px",top:E.value.top+"px",width:typeof a.width=="number"?a.width+"px":a.width}),onKeydown:d},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!x.value}]),disabled:!x.value,onClick:w[0]||(w[0]=Y=>A(-1))},[...w[3]||(w[3]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z"})],-1)])],10,yl),e.createElementVNode("div",{ref_key:"listRef",ref:v,class:"sp-dropdown__list",onTouchstart:Ve,onTouchmove:N,onTouchend:V},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,Y=>(e.openBlock(),e.createElementBlock("button",{key:String(Y.value),type:"button",class:e.normalizeClass(["sp-dropdown__item",{"sp-dropdown__item--active":String(Y.value)===String(a.modelValue)}]),onClick:ze=>j(Y)},e.toDisplayString(Y.label),11,kl))),128))],544),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sp-dropdown__nav",{"sp-dropdown__nav--disabled":!R.value}]),disabled:!R.value,onClick:w[1]||(w[1]=Y=>A(1))},[...w[4]||(w[4]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],10,El)],38)):e.createCommentVNode("",!0)]),_:1})]))],4)}}}),Ye=(a,h)=>{const c=a.__vccOpts||a;for(const[m,s]of h)c[m]=s;return c},go=Ye(wl,[["__scopeId","data-v-47e5c681"]]),Bl=["title","onClick"],yo=Ye(e.defineComponent({__name:"colorPicker",props:{modelOpen:{type:Boolean,default:void 0},colorKey:{default:"text"},currentColor:{default:""},locale:{default:"zh-CN"}},emits:["update:modelValue","change","update:modelOpen"],setup(a,{expose:h,emit:c}){const m=a,s=c,C=[[{key:"colorAutomatic",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorSlate",value:"#595959"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorBlack",value:"#000000"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],D=[[{key:"colorNoFill",value:""},{key:"colorLightBlue",value:"#DEEBF7"},{key:"colorLightOrange",value:"#FCE4D6"},{key:"colorLightYellow",value:"#FFE79A"},{key:"colorLightGreen",value:"#E2EFDA"}],[{key:"colorWhite",value:"#FFFFFF"},{key:"colorPaleBlue",value:"#BDD7EE"},{key:"colorPaleOrange",value:"#F8CBAD"},{key:"colorPaleYellow",value:"#FFD966"},{key:"colorPaleGreen",value:"#C6EFCE"}],[{key:"colorLightGray",value:"#F2F2F2"},{key:"colorSkyBlue",value:"#9BC2E6"},{key:"colorCoral",value:"#F4B183"},{key:"colorGold",value:"#FFC000"},{key:"colorMint",value:"#A9D18E"}],[{key:"colorSilver",value:"#D9D9D9"},{key:"colorMediumBlue",value:"#6FA8DC"},{key:"colorOrange",value:"#ED7D31"},{key:"colorAmber",value:"#F1C232"},{key:"colorMediumGreen",value:"#70AD47"}],[{key:"colorGray",value:"#BFBFBF"},{key:"colorRoyalBlue",value:"#4A86E8"},{key:"colorRed",value:"#E06666"},{key:"colorDarkGold",value:"#BF8F00"},{key:"colorDarkGreen",value:"#548235"}],[{key:"colorDarkGray",value:"#A5A5A5"},{key:"colorDeepBlue",value:"#2E75B6"},{key:"colorDarkRed",value:"#CC4125"},{key:"colorOlive",value:"#806000"},{key:"colorForest",value:"#375623"}],[{key:"colorCharcoal",value:"#808080"},{key:"colorNavy",value:"#1F4E79"},{key:"colorCrimson",value:"#993300"},{key:"colorDarkOlive",value:"#5C4500"},{key:"colorDeepForest",value:"#2D6A4F"}],[{key:"colorSlate",value:"#595959"},{key:"colorMidnight",value:"#17375E"},{key:"colorMaroon",value:"#5A1E00"},{key:"colorCoffee",value:"#3D3000"},{key:"colorEvergreen",value:"#1B4332"}],[{key:"colorDarkSlate",value:"#404040"},{key:"colorDarkNavy",value:"#0C2340"},{key:"colorDarkMaroon",value:"#2E0A00"},{key:"colorDarkCoffee",value:"#1F1800"},{key:"colorInkGreen",value:"#081C15"}]],v=e.computed(()=>m.colorKey==="fill"?D:C);function F(A){return B(m.locale,A)}function E(A){const G=m.currentColor;return!G&&!A?!0:G?G.toLowerCase()===A.toLowerCase():!1}const g=e.ref(!1),H=e.ref(null),L=e.ref(null);e.watch(()=>m.modelOpen,A=>{A!==void 0&&A!==g.value&&(A?W():x())});function M(A){const G=H.value;G&&!G.contains(A.target)&&x()}function W(){g.value=!0,m.modelOpen!==void 0&&s("update:modelOpen",!0),e.nextTick(()=>{document.addEventListener("mousedown",M)})}function x(){g.value=!1,m.modelOpen!==void 0&&s("update:modelOpen",!1),document.removeEventListener("mousedown",M)}function R(A){s("update:modelValue",A),s("change",A),x()}return e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",M)}),h({open:g,openMenu:W,close:x}),(A,G)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:H,class:"color-picker"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"menuRef",ref:L,class:"color-picker__menu",onMousedown:G[0]||(G[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(z,J)=>(e.openBlock(),e.createElementBlock("div",{key:J,class:"color-picker__row"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z,j=>(e.openBlock(),e.createElementBlock("button",{key:j.value,class:e.normalizeClass(["color-picker__swatch",{"color-picker__swatch--selected":E(j.value)}]),title:F(j.key),style:e.normalizeStyle({background:j.value||"transparent",border:j.value?"1px solid rgba(0,0,0,0.15)":"1px dashed #999"}),onClick:Q=>R(j.value)},null,14,Bl))),128))]))),128))],544)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-c262a5e5"]]),Cl=["title","onClick"],xl={viewBox:"0 0 30 30",class:"border-picker__icon"},Sl=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],Dl={class:"border-picker__label"},Tl=Ye(e.defineComponent({__name:"borderPicker",props:{modelOpen:{type:Boolean,default:void 0},locale:{default:"zh-CN"},currentBorder:{default:"none"}},emits:["update:modelOpen","change"],setup(a,{expose:h,emit:c}){const m=a,s=c,C=[{key:"bottom",i18nKey:"borderBottom"},{key:"top",i18nKey:"borderTop"},{key:"left",i18nKey:"borderLeft"},{key:"right",i18nKey:"borderRight"},{key:"none",i18nKey:"borderNone"},{key:"all",i18nKey:"borderAll"},{key:"outer",i18nKey:"borderOuter"},{key:"thickOuter",i18nKey:"borderThickOuter"}],D=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],v={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},F={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function E(R,A){return F[R].includes(A)?"thick":v[R].includes(A)?"solid":"dashed"}const g=e.ref(!1),H=e.ref(null);e.watch(()=>m.modelOpen,R=>{R!==void 0&&R!==g.value&&(R?M():W())});function L(R){const A=H.value;A&&!A.contains(R.target)&&W()}function M(){g.value=!0,m.modelOpen!==void 0&&s("update:modelOpen",!0),e.nextTick(()=>{document.addEventListener("mousedown",L)})}function W(){g.value=!1,m.modelOpen!==void 0&&s("update:modelOpen",!1),document.removeEventListener("mousedown",L)}function x(R){s("change",R),W()}return e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",L)}),h({open:g,openMenu:M,close:W}),(R,A)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:H,class:"border-picker"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"border-picker__menu",onMousedown:A[0]||(A[0]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(C,G=>e.createElementVNode("button",{key:G.key,class:"border-picker__item",title:e.unref(B)(a.locale,G.i18nKey),onClick:z=>x(G.key)},[(e.openBlock(),e.createElementBlock("svg",xl,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(D,z=>e.createElementVNode("line",{key:z.name,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:"currentColor","stroke-width":E(G.key,z.name)==="thick"?3:1.5,"stroke-dasharray":E(G.key,z.name)==="dashed"?"0 4":"none","stroke-linecap":E(G.key,z.name)==="dashed"?"round":"square"},null,8,Sl)),64))])),e.createElementVNode("span",Dl,e.toDisplayString(e.unref(B)(a.locale,G.i18nKey)),1)],8,Cl)),64))],32)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-c9b0ba80"]]),Hl={class:"tb-item","data-key":"undo"},Rl=["title","disabled"],Ml={class:"tb-item","data-key":"redo"},Nl=["title","disabled"],Fl={class:"tb-item","data-key":"paint"},Il=["title","disabled"],Al={class:"tb-item","data-key":"clear"},Vl=["title","disabled"],zl={class:"tb-item","data-key":"font"},Ol={class:"tb-item","data-key":"fontSize"},Ll={class:"toolbar-font-size"},Wl=["value","title"],$l=["title"],_l=["title","disabled"],Gl=["title","disabled"],Pl={class:"tb-item","data-key":"bold"},Ul=["title","disabled"],Yl={class:"tb-item","data-key":"italic"},Kl=["title","disabled"],Xl={class:"tb-item","data-key":"underline"},jl=["title","disabled"],Zl={class:"tb-item","data-key":"strike"},ql=["title","disabled"],Jl={class:"tb-item","data-key":"textColor"},Ql={class:"toolbar-split"},en=["title","disabled"],tn={viewBox:"0 0 1024 1024",fill:"currentColor"},on=["fill"],ln=["title","disabled"],nn={class:"tb-item","data-key":"fillColor"},rn={class:"toolbar-split"},an=["title","disabled"],sn={viewBox:"0 0 1024 1024",fill:"currentColor"},cn=["fill"],dn=["title","disabled"],un={class:"tb-item","data-key":"border"},fn={class:"toolbar-split"},mn=["title","disabled"],pn={viewBox:"0 0 30 30",fill:"none",stroke:"currentColor"},bn=["x1","y1","x2","y2","stroke-width","stroke-dasharray","stroke-linecap"],hn=["title","disabled"],Ot=2,vn=6,gn=34,yn=Ye(e.defineComponent({__name:"toolbar",props:{locale:{},canUndo:{type:Boolean},canRedo:{type:Boolean},paintFmtActive:{type:Boolean},hasSelection:{type:Boolean},fontFamilyOptions:{},fontSizeOptions:{},selFontFamily:{},selFontSize:{},fontSizeInput:{},fontSizeMenuOpen:{type:Boolean},selFontWeight:{type:Boolean},selFontStyle:{type:Boolean},selUnderline:{type:Boolean},selStrikethrough:{type:Boolean},selTextColor:{},textColorMenuOpen:{type:Boolean},selFillColor:{},fillColorMenuOpen:{type:Boolean},cachedTextColor:{},cachedFillColor:{},borderMenuOpen:{type:Boolean},cachedBorder:{}},emits:["undo","redo","paint-format","clear-format","font-family-change","font-size-input","font-size-blur","font-size-keydown","font-size-change","update:font-size-menu-open","font-size-toggle","font-size-step-up","font-size-step-down","bold-toggle","italic-toggle","underline-toggle","strikethrough-toggle","text-color-change","update:text-color-menu-open","fill-color-change","update:fill-color-menu-open","apply-text-color","apply-fill-color","update:border-menu-open","border-change","apply-border"],setup(a,{emit:h}){const c=[{name:"top",x1:4,y1:4,x2:26,y2:4},{name:"bottom",x1:4,y1:26,x2:26,y2:26},{name:"left",x1:4,y1:4,x2:4,y2:26},{name:"right",x1:26,y1:4,x2:26,y2:26},{name:"vMid",x1:15,y1:4,x2:15,y2:26},{name:"hMid",x1:4,y1:15,x2:26,y2:15}],m={bottom:["bottom"],top:["top"],left:["left"],right:["right"],none:[],all:["top","bottom","left","right","vMid","hMid"],outer:["top","bottom","left","right"],thickOuter:["top","bottom","left","right"]},s={bottom:[],top:[],left:[],right:[],none:[],all:[],outer:[],thickOuter:["top","bottom","left","right"]};function C(V,d){return s[V].includes(d)?"thick":m[V].includes(d)?"solid":"dashed"}const D=["undo","redo","paint","clear","sep1","font","fontSize","sep2","bold","italic","underline","strike","sep3","textColor","fillColor","border"],v=e.ref(null),F=e.ref(null),E=e.ref(null),g=e.ref(new Set),H=e.ref(!1),L=e.ref(!1),M=new Map,W=e.computed(()=>g.value.size>0);function x(V){return g.value.has(V)}function R(){if(!v.value)return;v.value.querySelectorAll(".tb-item").forEach(d=>{const p=d.dataset.key;p&&M.set(p,d.offsetWidth)})}function A(V,d){if(V.size!==d.size)return!1;for(const p of V)if(!d.has(p))return!1;return!0}function G(){if(!v.value)return;const V=v.value.clientWidth-vn*2;if(V<=0)return;M.size===0&&R();let d=0;for(const w of D)d+=(M.get(w)??0)+Ot;const p=new Set;if(d>V){const w=V-gn-Ot;let I=0;for(let Y=0;Y<D.length;Y++){const ze=D[Y],ie=(M.get(ze)??0)+Ot;if(I+ie>w){for(let Te=Y;Te<D.length;Te++)p.add(D[Te]);break}I+=ie}}A(p,g.value)||(g.value=p,p.size===0&&(H.value=!1))}let z=null;const J=e.ref(0),j=e.computed(()=>{const V=E.value;if(!V)return{position:"fixed",top:"0px",right:"0px"};J.value;const d=V.getBoundingClientRect();return{position:"fixed",top:`${d.bottom+4}px`,right:`${window.innerWidth-d.right}px`}});function Q(){H.value&&(J.value++,e.nextTick(()=>G()))}function ke(V){var p,w;if(!H.value)return;const d=V.target;(p=F.value)!=null&&p.contains(d)||(w=E.value)!=null&&w.contains(d)||(L.value=!0,H.value=!1,e.nextTick(()=>{L.value=!1}))}function Ve(){H.value=!H.value}e.onMounted(()=>{e.nextTick(()=>{R(),G()}),v.value&&(z=new ResizeObserver(()=>{H.value||G()}),z.observe(v.value)),document.addEventListener("mousedown",ke,!0),window.addEventListener("resize",Q)}),e.onBeforeUnmount(()=>{z==null||z.disconnect(),document.removeEventListener("mousedown",ke,!0),window.removeEventListener("resize",Q)});const N=h;return(V,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"rootEl",ref:v,class:"toolbar"},[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("undo"),to:F.value??void 0},[e.createElementVNode("div",Hl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!a.canUndo}]),title:e.unref(B)(a.locale,"undo"),disabled:!a.canUndo,onClick:d[0]||(d[0]=p=>N("undo"))},[...d[32]||(d[32]=[e.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Rl)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("redo"),to:F.value??void 0},[e.createElementVNode("div",Ml,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!a.canRedo}]),title:e.unref(B)(a.locale,"redo"),disabled:!a.canRedo,onClick:d[1]||(d[1]=p=>N("redo"))},[...d[33]||(d[33]=[e.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{transform:"translate(1024, 0) scale(-1, 1)",d:"M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"})],-1)])],10,Nl)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("paint"),to:F.value??void 0},[e.createElementVNode("div",Fl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--active":a.paintFmtActive}]),title:e.unref(B)(a.locale,"paintFormat"),disabled:!a.hasSelection,onClick:d[2]||(d[2]=p=>N("paint-format"))},[...d[34]||(d[34]=[e.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M722.285714 438.857143a36.571429 36.571429 0 0 1-36.571428 36.571428h-512a36.571429 36.571429 0 0 1-36.571429-36.571428V164.571429a36.571429 36.571429 0 0 1 36.571429-36.571429h512a36.571429 36.571429 0 0 1 36.571428 36.571429V256h128a36.571429 36.571429 0 0 1 36.571429 36.571429v294.4a36.571429 36.571429 0 0 1-31.890286 36.278857L448 675.766857V859.428571a36.571429 36.571429 0 0 1-32.292571 36.315429l-4.278858 0.256a36.571429 36.571429 0 0 1-36.571428-36.571429v-215.771428a36.571429 36.571429 0 0 1 31.890286-36.278857l406.966857-52.553143V329.142857h-91.428572v109.714286z m-73.142857-237.714286h-438.857143V402.285714h438.857143V201.142857z"})],-1)])],10,Il)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("clear"),to:F.value??void 0},[e.createElementVNode("div",Al,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--disabled":!a.hasSelection}]),title:e.unref(B)(a.locale,"clearFormat"),disabled:!a.hasSelection,onClick:d[3]||(d[3]=p=>N("clear-format"))},[...d[35]||(d[35]=[e.createElementVNode("svg",{class:"toolbar-btn__icon",viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M672.748 105.674c-3.666-3.799-8.778-5.949-14.125-5.949-5.341 0-10.459 2.15-14.119 5.949L10.418 754.633c-7.789 8.163-7.789 20.798 0 28.967l123.353 126.213c7.782 7.979 23.113 14.461 34.111 14.461h395.042c12.774-0.742 24.882-5.854 34.162-14.461l416.525-426.362c7.751-8.163 7.751-20.76 0-28.916l-340.92-348.861h0.057zM557.85 832.801c-9.273 8.582-21.343 13.707-34.111 14.461H217.888c-12.781-0.742-24.882-5.867-34.162-14.461l-58.074-59.482c-7.782-8.163-7.782-20.804 0-28.967l232.333-237.87c3.666-3.799 8.778-5.949 14.125-5.949s10.453 2.15 14.119 5.949l231.102 236.551c7.744 8.157 7.744 20.753 0 28.916l-59.539 60.909 0.058-0.057z m0 0"})],-1)])],10,Vl)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("sep1"),to:F.value??void 0},[d[36]||(d[36]=e.createElementVNode("div",{class:"tb-item","data-key":"sep1"},[e.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("font"),to:F.value??void 0},[e.createElementVNode("div",zl,[e.createVNode(go,{class:"toolbar-font","model-value":a.selFontFamily,options:a.fontFamilyOptions,width:110,"visible-count":8,title:e.unref(B)(a.locale,"fontFamily"),onChange:d[4]||(d[4]=p=>N("font-family-change",p))},null,8,["model-value","options","title"])])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("fontSize"),to:F.value??void 0},[e.createElementVNode("div",Ol,[e.createElementVNode("div",Ll,[e.createElementVNode("input",{class:"toolbar-font-size__input",type:"text",value:a.fontSizeInput,title:e.unref(B)(a.locale,"fontSize"),onInput:d[5]||(d[5]=p=>N("font-size-input",p.target.value)),onBlur:d[6]||(d[6]=p=>N("font-size-blur")),onKeydown:d[7]||(d[7]=p=>N("font-size-keydown",p))},null,40,Wl),e.createVNode(go,{class:"toolbar-font-size__dropdown","model-value":a.selFontSize,options:a.fontSizeOptions,width:56,"visible-count":9,title:e.unref(B)(a.locale,"fontSize"),"hide-trigger":!0,"model-open":a.fontSizeMenuOpen,"onUpdate:modelOpen":d[8]||(d[8]=p=>N("update:font-size-menu-open",p)),onChange:d[9]||(d[9]=p=>N("font-size-change",p))},null,8,["model-value","options","title","model-open"]),e.createElementVNode("button",{class:"toolbar-font-size__btn",type:"button",title:e.unref(B)(a.locale,"fontSize"),onMousedown:d[10]||(d[10]=e.withModifiers(()=>{},["prevent"])),onClick:d[11]||(d[11]=p=>N("font-size-toggle"))},[...d[37]||(d[37]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z"})],-1)])],40,$l),e.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:e.unref(B)(a.locale,"fontSizeDecrease"),disabled:!a.hasSelection,onMousedown:d[12]||(d[12]=e.withModifiers(()=>{},["prevent"])),onClick:d[13]||(d[13]=p=>N("font-size-step-down"))},[...d[38]||(d[38]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-177c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h177c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z"})],-1)])],40,_l),e.createElementVNode("button",{class:"toolbar-btn toolbar-btn--step",type:"button",title:e.unref(B)(a.locale,"fontSizeIncrease"),disabled:!a.hasSelection,onMousedown:d[14]||(d[14]=e.withModifiers(()=>{},["prevent"])),onClick:d[15]||(d[15]=p=>N("font-size-step-up"))},[...d[39]||(d[39]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-59v-59c0-16.29-13.21-29.5-29.5-29.5s-29.5 13.21-29.5 29.5v59h-59c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h59v59c0 16.29 13.21 29.5 29.5 29.5s29.5-13.21 29.5-29.5v-59h59c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z"})],-1)])],40,Gl)])])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("sep2"),to:F.value??void 0},[d[40]||(d[40]=e.createElementVNode("div",{class:"tb-item","data-key":"sep2"},[e.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("bold"),to:F.value??void 0},[e.createElementVNode("div",Pl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--active":a.selFontWeight}]),title:e.unref(B)(a.locale,"bold"),disabled:!a.hasSelection,onClick:d[16]||(d[16]=p=>N("bold-toggle"))},[...d[41]||(d[41]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[e.createElementVNode("path",{d:"M733.610667 467.712A267.562667 267.562667 0 0 0 548.010667 10.581333H183.466667a53.333333 53.333333 0 0 0 0 106.666667h43.221333a10.666667 10.666667 0 0 1 10.666667 10.666667V896a10.666667 10.666667 0 0 1-10.666667 10.666667H183.466667a53.333333 53.333333 0 1 0 0 106.666666h425.088a287.658667 287.658667 0 0 0 125.013333-545.536z m-185.6-350.464a160.512 160.512 0 0 1 0 320.981333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666V128a10.666667 10.666667 0 0 1 10.666667-10.666667z m60.586666 789.333333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666v-340.352a10.666667 10.666667 0 0 1 10.666667-10.666667H608.597333a180.864 180.864 0 0 1 0 361.685333z"})])],-1)])],10,Ul)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("italic"),to:F.value??void 0},[e.createElementVNode("div",Yl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--active":a.selFontStyle}]),title:e.unref(B)(a.locale,"italic"),disabled:!a.hasSelection,onClick:d[17]||(d[17]=p=>N("italic-toggle"))},[...d[42]||(d[42]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[e.createElementVNode("path",{d:"M960 10.581333h-325.845333a53.333333 53.333333 0 0 0 0 106.666667h46.336a10.666667 10.666667 0 0 1 9.002666 16.384L203.946667 896.725333a21.333333 21.333333 0 0 1-18.005334 9.856H64a53.333333 53.333333 0 0 0 0 106.666667h325.845333a53.333333 53.333333 0 0 0 0-106.666667H343.509333a10.666667 10.666667 0 0 1-9.002666-16.384L820.053333 127.146667a21.333333 21.333333 0 0 1 18.005334-9.898667H960a53.333333 53.333333 0 0 0 0-106.666667z"})])],-1)])],10,Kl)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("underline"),to:F.value??void 0},[e.createElementVNode("div",Xl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--active":a.selUnderline}]),title:e.unref(B)(a.locale,"underline"),disabled:!a.hasSelection,onClick:d[18]||(d[18]=p=>N("underline-toggle"))},[...d[43]||(d[43]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[e.createElementVNode("path",{d:"M960 906.581333h-896a53.333333 53.333333 0 0 0 0 106.666667h896a53.333333 53.333333 0 0 0 0-106.666667zM84.394667 117.248h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a358.784 358.784 0 0 0 717.568 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667h58.154666a53.333333 53.333333 0 0 0 0-106.666666H695.466667a53.333333 53.333333 0 0 0 0 106.666666h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a252.117333 252.117333 0 0 1-504.234667 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667H328.533333a53.333333 53.333333 0 1 0 0-106.666666H84.394667a53.333333 53.333333 0 0 0 0 106.666666z"})])],-1)])],10,jl)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("strike"),to:F.value??void 0},[e.createElementVNode("div",Zl,[e.createElementVNode("button",{class:e.normalizeClass(["toolbar-btn",{"toolbar-btn--active":a.selStrikethrough}]),title:e.unref(B)(a.locale,"strikethrough"),disabled:!a.hasSelection,onClick:d[19]||(d[19]=p=>N("strikethrough-toggle"))},[...d[44]||(d[44]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[e.createElementVNode("path",{d:"M1013.333333 552.618667A53.333333 53.333333 0 0 0 960 499.2h-381.269333a20.992 20.992 0 0 1-12.032-3.84c-30.805333-21.888-63.232-41.856-94.634667-61.098667-119.466667-73.173333-192-123.733333-192-207.488 0-95.36 94.165333-109.610667 150.314667-109.610666a193.706667 193.706667 0 0 1 131.456 32.597333 113.578667 113.578667 0 0 1 19.072 84.906667v12.8a53.333333 53.333333 0 1 0 106.666666 0v-11.434667a208.512 208.512 0 0 0-49.706666-161.152C595.157333 31.616 527.317333 10.581333 430.549333 10.581333c-156.074667 0-256.981333 84.864-256.981333 216.277334 0 118.314667 80.725333 192.512 170.666667 252.885333a10.666667 10.666667 0 0 1-5.930667 19.541333H64a53.333333 53.333333 0 0 0 0 106.666667h468.352a10.709333 10.709333 0 0 1 6.784 2.474667 185.130667 185.130667 0 0 1 82.432 147.882666c0 139.434667-146.176 150.272-191.018667 150.272-77.397333 0-133.930667-17.28-163.584-50.048a144.810667 144.810667 0 0 1-27.733333-115.2 53.333333 53.333333 0 0 0-106.154667-10.496A245.76 245.76 0 0 0 187.733333 928.128c51.2 56.490667 132.864 85.333333 242.688 85.333333 178.090667 0 297.685333-103.253333 297.685334-256.938666a258.517333 258.517333 0 0 0-36.224-134.272 10.666667 10.666667 0 0 1 9.216-16.085334H960a53.333333 53.333333 0 0 0 53.333333-53.546666z"})])],-1)])],10,ql)])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("sep3"),to:F.value??void 0},[d[45]||(d[45]=e.createElementVNode("div",{class:"tb-item","data-key":"sep3"},[e.createElementVNode("div",{class:"toolbar-sep"})],-1))],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("textColor"),to:F.value??void 0},[e.createElementVNode("div",Jl,[e.createElementVNode("div",Ql,[e.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:e.unref(B)(a.locale,"fontColor"),disabled:!a.hasSelection,onClick:d[20]||(d[20]=p=>N("apply-text-color"))},[(e.openBlock(),e.createElementBlock("svg",tn,[d[46]||(d[46]=e.createElementVNode("g",{transform:"translate(102.4, 102.4) scale(0.8)"},[e.createElementVNode("path",{d:"M663.120842 529.946947H364.759579l-84.07579 212.884211a53.894737 53.894737 0 0 1-50.122105 34.169263h-14.551579a34.869895 34.869895 0 0 1-32.498526-47.696842L443.715368 70.063158a53.894737 53.894737 0 0 1 50.122106-34.115369h41.768421a53.894737 53.894737 0 0 1 50.176 34.277053l257.670737 659.078737a34.977684 34.977684 0 0 1-32.552421 47.696842h-14.389895a53.894737 53.894737 0 0 1-50.229895-34.277053l-83.159579-212.776421z m-35.139368-89.788631l-113.340632-289.953684-114.472421 289.953684h227.813053z"})],-1)),e.createElementVNode("path",{d:"M62.895 844.369m53.895 0l790.474 0q53.895 0 53.895 53.895l0 26.947q0 53.895-53.895 53.895l-790.474 0q-53.895 0-53.895-53.895l0-26.947q0-53.895 53.895-53.895z",fill:a.cachedTextColor||"#000000"},null,8,on)]))],8,en),e.createElementVNode("button",{class:"toolbar-btn toolbar-split__arrow",title:e.unref(B)(a.locale,"fontColor"),disabled:!a.hasSelection,onClick:d[21]||(d[21]=p=>N("update:text-color-menu-open",!a.textColorMenuOpen))},[...d[47]||(d[47]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,ln),e.createVNode(yo,{"model-open":a.textColorMenuOpen,"color-key":"text","current-color":a.selTextColor,locale:a.locale,"onUpdate:modelOpen":d[22]||(d[22]=p=>N("update:text-color-menu-open",p)),onChange:d[23]||(d[23]=p=>N("text-color-change",p))},null,8,["model-open","current-color","locale"])])])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("fillColor"),to:F.value??void 0},[e.createElementVNode("div",nn,[e.createElementVNode("div",rn,[e.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:e.unref(B)(a.locale,"fillColor"),disabled:!a.hasSelection,onClick:d[24]||(d[24]=p=>N("apply-fill-color"))},[(e.openBlock(),e.createElementBlock("svg",sn,[d[48]||(d[48]=e.createElementVNode("path",{d:"M447.018667 37.952l352.298666 352.298667c6.613333 6.613333 6.613333 17.344 0 23.957333L446.101333 767.424a16.938667 16.938667 0 0 1-23.957333 0L121.429333 466.688a16.938667 16.938667 0 0 1 0-23.957333L428.608 135.552 388.992 96a8.469333 8.469333 0 0 1 0-11.989333l46.058667-46.037334a8.469333 8.469333 0 0 1 11.968 0z m346.325333 517.461333l57.514667 60.074667c31.744 33.194667 31.744 86.997333 0 120.192a78.869333 78.869333 0 0 1-115.008 0c-31.765333-33.194667-31.765333-86.997333 0-120.192l57.493333-60.074667zM486.101333 193.066667l-261.12 261.12 20.458667 20.458666 380.16-1.728 70.186667-70.186666-209.706667-209.664z"},null,-1)),e.createElementVNode("path",{d:"M85.333333 853.333333m8.896 0l835.541334 0q8.896 0 8.896 8.896l0 110.208q0 8.896-8.896 8.896l-835.541334 0q-8.896 0-8.896-8.896l0-110.208q0-8.896 8.896-8.896Z",fill:a.cachedFillColor||"currentColor"},null,8,cn)]))],8,an),e.createElementVNode("button",{class:"toolbar-btn toolbar-split__arrow",title:e.unref(B)(a.locale,"fillColor"),disabled:!a.hasSelection,onClick:d[25]||(d[25]=p=>N("update:fill-color-menu-open",!a.fillColorMenuOpen))},[...d[49]||(d[49]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,dn),e.createVNode(yo,{"model-open":a.fillColorMenuOpen,"color-key":"fill","current-color":a.selFillColor,locale:a.locale,"onUpdate:modelOpen":d[26]||(d[26]=p=>N("update:fill-color-menu-open",p)),onChange:d[27]||(d[27]=p=>N("fill-color-change",p))},null,8,["model-open","current-color","locale"])])])],8,["disabled","to"])),(e.openBlock(),e.createBlock(e.Teleport,{disabled:!x("border"),to:F.value??void 0},[e.createElementVNode("div",un,[e.createElementVNode("div",fn,[e.createElementVNode("button",{class:"toolbar-btn toolbar-split__main",title:e.unref(B)(a.locale,"borders"),disabled:!a.hasSelection,onClick:d[28]||(d[28]=p=>N("apply-border"))},[(e.openBlock(),e.createElementBlock("svg",pn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,p=>e.createElementVNode("line",{key:p.name,x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,"stroke-width":C(a.cachedBorder,p.name)==="thick"?3:1.5,"stroke-dasharray":C(a.cachedBorder,p.name)==="dashed"?"0 4":"none","stroke-linecap":C(a.cachedBorder,p.name)==="dashed"?"round":"square"},null,8,bn)),64))]))],8,mn),e.createElementVNode("button",{class:"toolbar-btn toolbar-split__arrow",title:e.unref(B)(a.locale,"borders"),disabled:!a.hasSelection,onClick:d[29]||(d[29]=p=>N("update:border-menu-open",!a.borderMenuOpen))},[...d[50]||(d[50]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("path",{d:"M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z"})],-1)])],8,hn),e.createVNode(Tl,{"model-open":a.borderMenuOpen,locale:a.locale,"current-border":a.cachedBorder,"onUpdate:modelOpen":d[30]||(d[30]=p=>N("update:border-menu-open",p)),onChange:d[31]||(d[31]=p=>N("border-change",p))},null,8,["model-open","locale","current-border"])])])],8,["disabled","to"])),W.value?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreBtnEl",ref:E,class:e.normalizeClass(["toolbar-more",{"toolbar-more--active":H.value}]),type:"button",onClick:Ve},[...d[51]||(d[51]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",fill:"currentColor"},[e.createElementVNode("circle",{cx:"512",cy:"160",r:"96"}),e.createElementVNode("circle",{cx:"512",cy:"512",r:"96"}),e.createElementVNode("circle",{cx:"512",cy:"864",r:"96"})],-1)])],2)):e.createCommentVNode("",!0)],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"overflowMenuEl",ref:F,class:e.normalizeClass(["overflow-menu",{"no-anim":L.value}]),style:e.normalizeStyle(j.value)},null,6),[[e.vShow,H.value]])]),_:1})]))],64))}}),[["__scopeId","data-v-69401a37"]]),kn={class:"tab-list"},En=["onClick","onDblclick","onContextmenu"],wn=["value"],Bn={key:1,class:"tab-item__name"},Cn=["title"],xn=Ye(e.defineComponent({__name:"tabbar",props:{locale:{},sheets:{},activeSheetIndex:{},renTab:{},renTabVal:{}},emits:["tab-click","tab-dblclick","tab-contextmenu","tab-rename-input","tab-rename-keydown","tab-rename-commit","tabbar-contextmenu","add-sheet"],setup(a,{emit:h}){const c=h;return(m,s)=>(e.openBlock(),e.createElementBlock("div",{class:"tab-bar",onContextmenu:s[5]||(s[5]=C=>c("tabbar-contextmenu",C))},[e.createElementVNode("div",kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.sheets,(C,D)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:e.normalizeClass(["tab-item",{"tab-item--active":D===a.activeSheetIndex}]),onClick:v=>c("tab-click",D),onDblclick:e.withModifiers(v=>c("tab-dblclick",D),["prevent"]),onContextmenu:v=>c("tab-contextmenu",{ev:v,i:D})},[a.renTab===D?(e.openBlock(),e.createElementBlock("input",{key:0,class:"tab-rename-input",value:a.renTabVal,onInput:s[0]||(s[0]=v=>c("tab-rename-input",v.target.value)),onKeydown:s[1]||(s[1]=v=>c("tab-rename-keydown",v)),onBlur:s[2]||(s[2]=v=>c("tab-rename-commit")),onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},null,40,wn)):(e.openBlock(),e.createElementBlock("span",Bn,e.toDisplayString(C.name),1))],42,En))),128))]),e.createElementVNode("button",{class:"tab-bar__add-btn",title:e.unref(B)(a.locale,"addSheet"),onClick:s[4]||(s[4]=C=>c("add-sheet"))}," + ",8,Cn)],32))}}),[["__scopeId","data-v-49f54625"]]);function ue(a){let h="",c=a;do h=String.fromCharCode(65+c%26)+h,c=Math.floor(c/26)-1;while(c>=0);return h}function Lt(a){let h=0;for(let c=0;c<a.length;c++)h=h*26+(a.toUpperCase().charCodeAt(c)-64);return h-1}function Ie(a){if(a==null)return null;if(typeof a=="number")return a;if(typeof a=="string"){const h=parseFloat(a);return a.endsWith("%")||isNaN(h)?null:h}return null}function Wt(a){navigator.clipboard.writeText(a).catch(()=>{const h=document.createElement("textarea");h.value=a,h.style.position="fixed",h.style.opacity="0",document.body.appendChild(h),h.select(),document.execCommand("copy"),document.body.removeChild(h)})}function Ke(a,h){return`${a},${h}`}function pt(a,h,c){const m=a.match(/^\$?([A-Z]+)\$?(\d+)$/i);if(!m)return null;const s=Lt(m[1]),C=parseInt(m[2],10)-1;return s<0||s>=h||C<0||C>=c?null:{col:s,row:C}}function Ae(a,h){if(!h)return{x:0,y:0};const c=h.getBoundingClientRect();return{x:a.clientX-c.left,y:a.clientY-c.top}}function Sn(a,h,c){const m=a.split(":");if(m.length!==2)return null;const s=pt(m[0],h,c),C=pt(m[1],h,c);return!s||!C?null:{sc:Math.min(s.col,C.col),sr:Math.min(s.row,C.row),ec:Math.max(s.col,C.col),er:Math.max(s.row,C.row)}}function Dn(a,h,c,m,s){const C=c[Ke(a,h)];if(!C)return 0;const D=C.value;if(D.startsWith("="))return Eo(Ke(a,h),c,m,s)??0;const v=parseFloat(D);return isNaN(v)?0:v}const Xe=new Map;function ko(){Xe.clear()}function Eo(a,h,c,m){return Tn(a,h,c,m)}function Tn(a,h,c,m,s){if(Xe.has(a))return NaN;Xe.set(a,NaN);const C=h[a];if(!C)return NaN;const D=C.value;if(!D.startsWith("=")){const E=parseFloat(D),g=isNaN(E)?0:E;return Xe.set(a,g),g}const v=D.slice(1).trim();if(v.toUpperCase().startsWith("SUM(")&&v.endsWith(")")){const E=v.slice(4,-1).trim(),g=Sn(E,c,m);if(g){let H=0;for(let L=g.sc;L<=g.ec;L++)for(let M=g.sr;M<=g.er;M++)H+=Dn(L,M,h,c,m);return isNaN(H)?NaN:(Xe.set(a,H),H)}return NaN}return NaN}function wo(a,h,c){const m=[],s=/(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;let C;for(;(C=s.exec(a))!==null;){const D=pt(C[1],h,c);if(D)if(C[2]){const v=pt(C[2],h,c);if(!v)continue;for(let F=Math.min(D.col,v.col);F<=Math.max(D.col,v.col);F++)for(let E=Math.min(D.row,v.row);E<=Math.max(D.row,v.row);E++)m.push(Ke(F,E))}else m.push(Ke(D.col,D.row))}return m}function Hn(a,h,c,m,s){const C=c[Ke(a,h)];if(!C)return"";const D=C.value;if(!D.startsWith("="))return D;const v=Eo(Ke(a,h),c,m,s);return isNaN(v)?"#ERROR":String(v)}function Rn(a,h,c,m,s,C){return h===0&&c===0?a:a.replace(/(\$?)([A-Z]+)(\$?)(\d+)/gi,(D,v,F,E,g)=>{const H=v?Lt(F):Lt(F)+h,L=E?parseInt(g,10)-1:parseInt(g,10)-1+c;let M;H<0?M="A":H>=m?M=C(m-1):M=C(H);let W;return L<0?W="1":L>=s?W=String(s):W=String(L+1),(v||"")+M+(E||"")+W})}class Mn{constructor(){this.deps=new Map,this.rev=new Map,this.dirty=new Set}clear(h){var m;const c=this.deps.get(h);if(c){for(const s of c)(m=this.rev.get(s))==null||m.delete(h);this.deps.delete(h)}}set(h,c){if(this.clear(h),c.length!==0){this.deps.set(h,c);for(const m of c)this.rev.has(m)||this.rev.set(m,new Set),this.rev.get(m).add(h)}}markDirty(h){const c=[h];for(;c.length>0;){const m=c.pop(),s=this.rev.get(m);if(s)for(const C of s)this.dirty.has(C)||(this.dirty.add(C),c.push(C))}}getDirtyAndClear(){const h=this.dirty;return this.dirty=new Set,h}rebuild(h,c,m){this.deps.clear(),this.rev.clear(),this.dirty.clear(),Xe.clear();for(const[s,C]of Object.entries(h))if(C.value.startsWith("=")){const D=wo(C.value.slice(1),c,m);this.set(s,D)}}}function Nn(a,h,c,m){const s={},C=m(h),D=m(c);return C!=null&&(s.width=`${C}px`),D!=null&&(s.height=`${D}px`),s["--sp-formula-bar-bg"]=a.formulaBarBg,s["--sp-formula-bar-border"]=a.formulaBarBorder,s["--sp-formula-bar-label-color"]=a.formulaBarLabelText,s["--sp-formula-bar-label-bg"]=a.formulaBarLabelBg,s["--sp-formula-bar-label-border"]=a.formulaBarLabelBorder,s["--sp-formula-bar-input-bg"]=a.formulaBarInputBg,s["--sp-formula-bar-input-border"]=a.formulaBarInputBorder,s["--sp-formula-bar-input-color"]=a.formulaBarInputText,s["--sp-formula-bar-input-focus-border"]=a.formulaBarInputFocusBorder,s["--sp-formula-bar-input-focus-shadow"]=a.formulaBarInputFocusShadow,s["--sp-wrapper-bg"]=a.wrapperBg,s["--sp-cell-editor-border"]=a.cellEditorBorder,s["--sp-cell-editor-color"]=a.cellEditorText,s["--sp-cell-editor-bg"]=a.cellEditorBg,s["--sp-cell-editor-shadow"]=a.cellEditorShadow,s["--sp-tab-bar-bg"]=a.tabBarBg,s["--sp-tab-bar-border"]=a.tabBarBorder,s["--sp-tab-active-bg"]=a.tabActiveBg,s["--sp-tab-active-color"]=a.tabActiveText,s["--sp-tab-active-border"]=a.tabActiveBorder,s["--sp-tab-inactive-bg"]=a.tabInactiveBg,s["--sp-tab-inactive-color"]=a.tabInactiveText,s["--sp-tab-inactive-border"]=a.tabInactiveBorder,s["--sp-tab-hover-bg"]=a.tabHoverBg,s["--sp-tab-add-btn-color"]=a.tabAddBtnColor,s["--sp-tab-add-btn-hover-bg"]=a.tabAddBtnHoverBg,s["--sp-tab-scroll-btn-color"]=a.tabScrollBtnColor,s["--sp-tab-scroll-btn-hover-bg"]=a.tabScrollBtnHoverBg,s["--sp-scroll-thumb"]=a.scrollbarThumb,s["--sp-scroll-thumb-hover"]=a.scrollbarThumbHover,s["--sp-scroll-btn-bg"]=a.scrollBtnBg,s["--sp-scroll-btn-color"]=a.scrollBtnColor,s["--sp-scroll-btn-hover-bg"]=a.scrollBtnHoverBg,s["--sp-scroll-btn-active-bg"]=a.scrollBtnActiveBg,s["--sp-scroll-track-bg"]=a.scrollTrackBg,s["--sp-toolbar-bg"]=a.toolbarBg,s["--sp-toolbar-border"]=a.toolbarBorder,s["--sp-toolbar-btn-color"]=a.toolbarBtnColor,s["--sp-toolbar-btn-hover-bg"]=a.toolbarBtnHoverBg,s["--sp-toolbar-btn-disabled-color"]=a.toolbarBtnDisabledColor,s["--sp-toolbar-btn-active-color"]=a.toolbarBtnActiveColor,s}const Fn={class:"formula-bar"},In={class:"formula-bar__cell-label"},An=["value"],Vn=["value"],zn=["title"],On=["title"],Ln=["title"],Wn=["title"],$n={key:2,class:"sb-corner"},_n=["onClick","onMouseenter"],Gn={class:"context-menu__label"},Pn={key:0,class:"context-menu__arrow"},Un=["onClick"],Yn={class:"dim-panel__title"},Kn={class:"dim-panel__body"},Xn=["value"],jn={key:0,class:"dim-panel__error"},Zn={class:"dim-panel__footer"},qn="\0",Bo="#444",Co=Ye(e.defineComponent({__name:"spreader",props:e.mergeModels({rowCount:{default:200},colCount:{default:26},width:{},height:{},theme:{default:"light"},locale:{default:"zh-CN"}},{data:{default:()=>[]},dataModifiers:{}}),emits:["update:data"],setup(a){const h=a,c=e.computed(()=>h.locale==="zh-CN"?"zh-CN":"en-US"),m=h.colCount,s=h.rowCount,C=e.useModel(a,"data");let D="";const v=e.reactive({}),F=new Mn,E=e.ref(null),g=e.ref({col:0,row:0}),H=e.ref(null),L=e.ref(""),M=e.ref(new Array(m).fill(100)),W=e.ref(new Array(s).fill(void 0)),x=e.ref(0),R=e.ref(0),A=(()=>{if(typeof window>"u")return 1;const t=window.devicePixelRatio||1;return t>1?Math.min(1.5,1+(t-1)*.25):1})();function G(t,o){var r;const l=(r=v[w(t,o)])==null?void 0:r.style;return typeof(l==null?void 0:l.fontSize)=="number"&&l.fontSize>0?l.fontSize:Fe}function z(t){return Math.round(t*A)}const J=e.computed(()=>{const t=[0];for(let o=0;o<m;o++)t.push(t[o]+M.value[o]);return t});function j(t){const o=W.value[t];if(o!=null&&o>0)return o;let l=Fe;for(let n=0;n<m;n++){const i=G(n,t);i>l&&(l=i)}const r=z(l);return Math.max(24,Math.round(r*1.2+8))}const Q=e.computed(()=>{const t=[0];for(let o=0;o<s;o++)t.push(t[o]+j(o));return t}),ke=e.computed(()=>J.value[m]),Ve=e.computed(()=>Q.value[s]);function N(t,o){g.value={col:t,row:o},E.value={startCol:t,startRow:o,endCol:t,endRow:o}}function V(t,o,l,r){g.value={col:t,row:o},E.value={startCol:Math.min(t,l),startRow:Math.min(o,r),endCol:Math.max(t,l),endRow:Math.max(o,r)}}function d(){V(0,0,m-1,s-1)}function p(t,o){const l=E.value;return l?t>=l.startCol&&t<=l.endCol&&o>=l.startRow&&o<=l.endRow:!1}function w(t,o){return`${t},${o}`}function I(t){Reflect.deleteProperty(v,t)}function Y(t,o){var l;return((l=v[w(t,o)])==null?void 0:l.value)??""}function ze(t,o){return ko(),Hn(t,o,v,m,s)}function ie(t,o,l){var u;const r=w(t,o);if(ko(),l===""||l==null){F.clear(r),I(r),F.markDirty(r);return}const n=String(l),i=((u=v[r])==null?void 0:u.style)??null;v[r]={value:n,style:i},n.startsWith("=")?F.set(r,wo(n.slice(1),m,s)):F.clear(r),F.markDirty(r)}function Te(t,o,l,r){for(let n=t;n<=o;n++)for(let i=l;i<=r;i++){const u=w(n,i);F.clear(u),I(u),F.markDirty(u)}}function He(t){H.value||(H.value={...g.value},L.value=t??Y(g.value.col,g.value.row))}function Re(){H.value&&($(),ie(H.value.col,H.value.row,L.value),H.value=null,L.value="")}function Oe(){H.value=null,L.value=""}function Ee(t,o){N(Math.max(0,Math.min(m-1,g.value.col+t)),Math.max(0,Math.min(s-1,g.value.row+o)))}function X(t,o){const l=Math.max(0,Z.w-52-11),r=Math.max(0,Z.h-24-11),n=J.value[t],i=Q.value[o],u=M.value[t],b=j(o);let k=x.value,T=R.value;n<k?k=n:n+u>k+l&&(k=n+u-l),i<T?T=i:i+b>T+r&&(T=i+b-r),ee(k,T)}function fe(t){const o=J.value;if(t<0||t>=o[m])return-1;let l=0,r=m-1;for(;l<r;){const n=l+r+1>>1;o[n]<=t?l=n:r=n-1}return l}function me(t){const o=Q.value;if(t<0||t>=o[s])return-1;let l=0,r=s-1;for(;l<r;){const n=l+r+1>>1;o[n]<=t?l=n:r=n-1}return l}const we=e.ref([]),at=e.ref([]);function xo(t){const o={};for(const[l,r]of Object.entries(t))o[l]={value:r.value,style:r.style};return o}function $t(){return je(),{sheets:_.value.map(t=>({id:t.id,name:t.name,cells:xo(t.cells),selection:t.selection?{...t.selection}:null,activeCell:t.activeCell?{...t.activeCell}:{col:0,row:0},scrollX:t.scrollX,scrollY:t.scrollY,colWidths:[...t.colWidths],rowHeights:[...t.rowHeights]})),activeSheetIndex:ne.value}}function So(t){_.value=t.sheets.map(o=>({...o,cells:xo(o.cells)})),Ne(Math.max(0,Math.min(t.activeSheetIndex,_.value.length-1))),F.rebuild(v,m,s)}function $(){const t=$t(),o=we.value[we.value.length-1];o&&JSON.stringify(o)===JSON.stringify(t)||(we.value.push(t),at.value=[],we.value.length>50&&we.value.shift())}function Do(){we.value.length&&(at.value.push($t()),So(we.value.pop()),y(),e.nextTick(P))}function To(){at.value.length&&(we.value.push($t()),So(at.value.pop()),y(),e.nextTick(P))}const Jn=e.computed(()=>we.value.length>0),Qn=e.computed(()=>at.value.length>0),er=e.computed(()=>!!E.value),Le=e.ref(null);function tr(){var l;const t=E.value;if(!t)return;const o={};for(let r=t.startCol;r<=t.endCol;r++)for(let n=t.startRow;n<=t.endRow;n++)o[`${r-t.startCol},${n-t.startRow}`]=((l=v[w(r,n)])==null?void 0:l.style)??null;Le.value={styles:o}}function or(){var l;const t=Le.value,o=E.value;if(!(!t||!o)){$();for(let r=o.startCol;r<=o.endCol;r++)for(let n=o.startRow;n<=o.endRow;n++){const i=t.styles[`${r-o.startCol},${n-o.startRow}`]??null,u=w(r,n),b=((l=v[u])==null?void 0:l.value)??"";b===""&&i===null?I(u):v[u]={value:b,style:i}}Le.value=null,y(),P()}}function lr(){var o;const t=E.value;if(t){$();for(let l=t.startCol;l<=t.endCol;l++)for(let r=t.startRow;r<=t.endRow;r++){const n=w(l,r),i=((o=v[n])==null?void 0:o.value)??"";i===""?I(n):v[n]={value:i,style:null}}y(),P()}}const nr=e.computed(()=>ml.map(t=>({...t,label:t.value===""?B(c.value,"fontDefault"):t.label}))),rr=e.computed(()=>pl.map(t=>({...t,label:String(t.value)}))),ar=e.computed(()=>{var r;const t=E.value;if(!t)return"";let o,l=!1;for(let n=t.startCol;n<=t.endCol&&!l;n++)for(let i=t.startRow;i<=t.endRow&&!l;i++){const u=(r=v[w(n,i)])==null?void 0:r.style,b=typeof(u==null?void 0:u.fontFamily)=="string"?u.fontFamily:"";o===void 0?o=b:b!==o&&(l=!0)}return l?qn:o??""}),Be=e.computed(()=>{const t=E.value;if(!t)return Fe;let o,l=!1;for(let r=t.startCol;r<=t.endCol&&!l;r++)for(let n=t.startRow;n<=t.endRow&&!l;n++){const i=G(r,n);o===void 0?o=i:i!==o&&(l=!0)}return l?0:o??Fe});function le(t,o){var r,n;const l=E.value;if(l){$();for(let i=l.startCol;i<=l.endCol;i++)for(let u=l.startRow;u<=l.endRow;u++){const b=w(i,u),k=((r=v[b])==null?void 0:r.value)??"",T=(n=v[b])!=null&&n.style?{...v[b].style}:{};o===""||o===null||o===void 0||o===0?delete T[t]:T[t]=o;const ve=Object.keys(T).length?T:null;k===""&&ve===null?I(b):v[b]={value:k,style:ve}}y(),P()}}function ir(t){le("fontFamily",t===""?"":t)}function sr(t){le("fontSize",t),We.value=!1}const Me=e.ref(""),We=e.ref(!1);e.watch(Be,t=>{Me.value=t===0?"":String(t)},{immediate:!0});function cr(t){const o=t.target;Me.value=o.value.replace(/[^\d]/g,"")}function dr(){const t=Me.value.trim();if(!t){Me.value=Be.value===0?"":String(Be.value);return}let o=parseInt(t,10);isNaN(o)&&(o=Fe),o=Math.max(5,Math.min(72,o)),Me.value=String(o),o!==Be.value&&le("fontSize",o)}function ur(t){t.key==="Enter"&&t.target.blur()}function fr(t){We.value=!We.value}function mr(){const t=Be.value===0?Fe:Be.value,o=Math.min(72,t+1);le("fontSize",o),Me.value=String(o),We.value=!1}function pr(){const t=Be.value===0?Fe:Be.value,o=Math.max(5,t-1);le("fontSize",o),Me.value=String(o),We.value=!1}function bt(t){var n;const o=E.value;if(!o)return!1;let l,r=!1;for(let i=o.startCol;i<=o.endCol&&!r;i++)for(let u=o.startRow;u<=o.endRow&&!r;u++){const b=(n=v[w(i,u)])==null?void 0:n.style,k=!!(b!=null&&b[t]);l===void 0?l=k:k!==l&&(r=!0)}return!r&&l===!0}const Ho=e.computed(()=>bt("fontWeight")),Ro=e.computed(()=>bt("fontStyle")),Mo=e.computed(()=>bt("underline")),No=e.computed(()=>bt("strikethrough"));function br(){le("fontWeight",Ho.value?"":"bold")}function hr(){le("fontStyle",Ro.value?"":"italic")}function vr(){le("underline",Mo.value?"":"underline")}function gr(){le("strikethrough",No.value?"":"line-through")}const ht=e.ref(""),vt=e.ref(""),_t=e.ref(!1),Gt=e.ref(!1);function yr(t){Fo.value=t,t&&(_t.value=!1,Gt.value=!1)}function kr(t){ht.value=t,le("color",t===""?"":t)}function Er(t){vt.value=t,le("backgroundColor",t===""?"":t)}function wr(){le("color",ht.value===""?"":ht.value)}function Br(){le("backgroundColor",vt.value===""?"":vt.value)}const Cr=e.computed(()=>{var r;const t=E.value;if(!t)return"";let o,l=!1;for(let n=t.startCol;n<=t.endCol&&!l;n++)for(let i=t.startRow;i<=t.endRow&&!l;i++){const u=(r=v[w(n,i)])==null?void 0:r.style,b=typeof(u==null?void 0:u.color)=="string"?u.color:"";o===void 0?o=b:b!==o&&(l=!0)}return l?"":o??""}),xr=e.computed(()=>{var r;const t=E.value;if(!t)return"";let o,l=!1;for(let n=t.startCol;n<=t.endCol&&!l;n++)for(let i=t.startRow;i<=t.endRow&&!l;i++){const u=(r=v[w(n,i)])==null?void 0:r.style,b=typeof(u==null?void 0:u.backgroundColor)=="string"?u.backgroundColor:"";o===void 0?o=b:b!==o&&(l=!0)}return l?"":o??""}),Pt=e.ref("none"),Fo=e.ref(!1);function Sr(t,o,l,r){const n=l===r.startRow,i=l===r.endRow,u=o===r.startCol,b=o===r.endCol,k={top:0,bottom:0,left:0,right:0};switch(t){case"none":return k;case"bottom":i&&(k.bottom=1);break;case"top":n&&(k.top=1);break;case"left":u&&(k.left=1);break;case"right":b&&(k.right=1);break;case"all":k.top=1,k.bottom=1,k.left=1,k.right=1;break;case"outer":n&&(k.top=1),i&&(k.bottom=1),u&&(k.left=1),b&&(k.right=1);break;case"thickOuter":n&&(k.top=2),i&&(k.bottom=2),u&&(k.left=2),b&&(k.right=2);break}return k}function Io(t){Pt.value=t;const o=E.value;if(o){if($(),t==="none")for(let l=o.startCol;l<=o.endCol;l++)for(let r=o.startRow;r<=o.endRow;r++)Ao(l,r,{top:0,bottom:0,left:0,right:0},!0);else for(let l=o.startCol;l<=o.endCol;l++)for(let r=o.startRow;r<=o.endRow;r++){const n=Sr(t,l,r,o);Ao(l,r,n,!1)}y(),P()}}function Ao(t,o,l,r=!0){var ge,Pe;const n=w(t,o),i=((ge=v[n])==null?void 0:ge.value)??"",u=(Pe=v[n])!=null&&Pe.style?{...v[n].style}:{},b=["Top","Bottom","Left","Right"],k=[l.top,l.bottom,l.left,l.right];for(let te=0;te<4;te++){const Ue=`border${b[te]}Width`;k[te]===0?r&&delete u[Ue]:(u[Ue]=k[te],u.borderColor=Bo)}b.some(te=>u[`border${te}Width`]!==void 0)||delete u.borderColor;const ve=Object.keys(u).length?u:null;i===""&&ve===null?I(n):v[n]={value:i,style:ve}}function Dr(){Io(Pt.value)}function Vo(t,o,l){var n;const r=(n=v[w(t,o)])==null?void 0:n.style;return(r==null?void 0:r[`border${l}Width`])||0}let zo=null;function gt(){const t=E.value;if(!t)return;zo={...t};const o=[];for(let l=t.startRow;l<=t.endRow;l++){const r=[];for(let n=t.startCol;n<=t.endCol;n++)r.push(Y(n,l));o.push(r.join(" "))}Wt(o.join(`
2
+ `))}function yt(){const t=E.value;if(t){if(t.startCol===0&&t.endCol===m-1){const o=[];for(let l=t.startRow;l<=t.endRow;l++){const r=[];for(let n=0;n<m;n++)r.push(Y(n,l));o.push(r.join(" "))}Wt(o.join(`
3
+ `))}else if(t.startRow===0&&t.endRow===s-1){const o=[];for(let l=0;l<s;l++){const r=[];for(let n=t.startCol;n<=t.endCol;n++)r.push(Y(n,l));o.push(r.join(" "))}Wt(o.join(`
4
+ `))}}}async function it(){let t="";try{t=await navigator.clipboard.readText()}catch{return}if(!t&&t!=="")return;const o=t.split(/\r?\n/),l=g.value,r=zo;for(let n=0;n<o.length;n++){const i=o[n].split(" ");for(let u=0;u<i.length;u++){const b=l.col+u,k=l.row+n;if(b<m&&k<s){let T=i[u];T.startsWith("=")&&r&&(T=Rn(T,b-(r.startCol+u),k-(r.startRow+n),m,s,ue)),ie(b,k,T)}}}}function Ut(){if(gt(),E.value){const t=E.value;Te(t.startCol,t.endCol,t.startRow,t.endRow),y()}}function Yt(){if(E.value){const t=E.value;Te(t.startCol,t.endCol,t.startRow,t.endRow),y()}}function Tr(){const t=E.value;if(!t)return;$();const o=t.startCol,l=t.startRow,r=t.endCol,n=t.endRow;if(l===n)if(r+1<m){const i=`${ue(o)}${l+1}:${ue(r)}${l+1}`;ie(r+1,l,`=SUM(${i})`)}else{const i=`${ue(o)}${l+1}:${ue(r-1)}${l+1}`;ie(r,l,`=SUM(${i})`)}else for(let i=o;i<=r;i++)if(n+1<s){const u=`${ue(i)}${l+1}:${ue(i)}${n+1}`;ie(i,n+1,`=SUM(${u})`)}else{const u=`${ue(i)}${l+1}:${ue(i)}${n}`;ie(i,n,`=SUM(${u})`)}y(),P()}function Hr(t,o){const l=o-t+1;for(let r=t;r<=o;r++)for(let n=0;n<m;n++)I(w(n,r));for(let r=t;r<s-l;r++){for(let n=0;n<m;n++){const i=w(n,r+l),u=w(n,r);v[i]?(v[u]=v[i],I(i)):I(u)}W.value[r]=W.value[r+l]}for(let r=s-l;r<s;r++){for(let n=0;n<m;n++)I(w(n,r));W.value[r]=void 0}}function Rr(t,o){const l=o-t+1;if(!(o>=s-1)){for(let r=s-1;r>o;r--){for(let n=0;n<m;n++){const i=w(n,r-l),u=w(n,r);v[i]?v[u]=v[i]:I(u)}W.value[r]=W.value[r-l]}for(let r=o+1;r<=o+l;r++){for(let n=0;n<m;n++)I(w(n,r));W.value[r]=void 0}}}function Mr(t,o){const l=o-t+1;if(!(o>=m-1)){for(let r=m-1;r>o;r--){for(let n=0;n<s;n++){const i=w(r-l,n),u=w(r,n);v[i]?v[u]=v[i]:I(u)}M.value[r]=M.value[r-l]}for(let r=o+1;r<=o+l;r++){for(let n=0;n<s;n++)I(w(r,n));M.value[r]=100}}}function Nr(t,o){const l=o-t+1;for(let r=t;r<=o;r++)for(let n=0;n<s;n++)I(w(r,n));for(let r=t;r<m-l;r++){for(let n=0;n<s;n++){const i=w(r+l,n),u=w(r,n);v[i]?(v[u]=v[i],I(i)):I(u)}M.value[r]=M.value[r+l]}for(let r=m-l;r<m;r++){for(let n=0;n<s;n++)I(w(r,n));M.value[r]=100}}let Oo=0;function Lo(){return Oo++,`s_${Oo}`}function kt(t){return{id:Lo(),name:t,cells:{},selection:{startCol:0,startRow:0,endCol:0,endRow:0},activeCell:{col:0,row:0},scrollX:0,scrollY:0,colWidths:new Array(m).fill(100),rowHeights:new Array(s).fill(void 0)}}const _=e.ref([kt("Sheet1")]),ne=e.ref(0);function je(){const t=_.value[ne.value];t&&(t.cells={...v},t.selection=E.value?{...E.value}:null,t.activeCell={...g.value},t.scrollX=x.value,t.scrollY=R.value,t.colWidths=[...M.value],t.rowHeights=[...W.value])}function Ne(t){const o=_.value[t];o&&(Object.keys(v).forEach(l=>I(l)),Object.assign(v,o.cells),E.value=o.selection?{...o.selection}:null,g.value={...o.activeCell},x.value=o.scrollX,R.value=o.scrollY,M.value=[...o.colWidths],W.value=[...o.rowHeights],ne.value=t)}function Fr(t){t===ne.value||t<0||t>=_.value.length||(Oe(),je(),Ne(t))}function Kt(t){return $(),Oe(),je(),_.value.push(kt(`Sheet${_.value.length+1}`)),Ne(_.value.length-1),_.value.length-1}function Ir(t){return _.value.length<=1||($(),Oe(),_.value.splice(t,1),Ne(Math.min(t,_.value.length-1))),ne.value}function Ar(t,o){_.value[t]&&o.trim()&&($(),_.value[t].name=o.trim())}function Vr(t){$(),Oe(),je();const o=_.value[t];if(!o)return t;let l=o.name;const r=l.match(/^(.*?)\s*\((\d+)\)$/);let n=r?parseInt(r[2],10)+1:2;r&&(l=r[1]);let i=`${l} (${n})`;const u=new Set(_.value.map(k=>k.name));for(;u.has(i);)n++,i=`${l} (${n})`;const b={id:Lo(),name:i,cells:{...o.cells},selection:o.selection?{...o.selection}:null,activeCell:o.activeCell?{...o.activeCell}:{col:0,row:0},scrollX:o.scrollX,scrollY:o.scrollY,colWidths:[...o.colWidths],rowHeights:[...o.rowHeights]};return _.value.splice(t+1,0,b),Ne(t+1),t+1}function Wo(t,o){const l=t+o;if(l<0||l>=_.value.length)return;$();const r=ne.value,n=_.value.splice(t,1)[0];_.value.splice(l,0,n),r===t?ne.value=l:t<r&&l>=r?ne.value=r-1:t>r&&l<=r&&(ne.value=r+1),y()}const zr=e.computed(()=>_.value.length);function P(){je();const t=_.value.map(l=>{const r={};for(const[b,k]of Object.entries(l.cells))r[b]={value:k.value},k.style&&(r[b].style=k.style);const n={name:l.name,cells:r},i={};for(let b=0;b<l.colWidths.length;b++)l.colWidths[b]!==100&&(i[b]=l.colWidths[b]);Object.keys(i).length&&(n.colWidths=i);const u={};for(let b=0;b<l.rowHeights.length;b++){const k=l.rowHeights[b];k!=null&&(u[b]=k)}return Object.keys(u).length&&(n.rowHeights=u),n}),o=JSON.stringify(t);o!==D&&(D=o,C.value=t)}let Xt=!1;function $o(){Xt||(Xt=!0,Promise.resolve().then(()=>{Xt=!1,P()}))}const _o=e.computed(()=>h.theme==="dark"?hl:bl),Or=e.computed(()=>Nn(_o.value,h.width,h.height,Ie)),$e=e.ref(null),pe=e.ref(null),jt=e.ref(null),Zt=e.ref(null),Z=e.reactive({w:800,h:600}),Ze=e.computed(()=>Math.max(0,ke.value-Math.max(0,Z.w-52-11))),qe=e.computed(()=>Math.max(0,Ve.value-Math.max(0,Z.h-24-11)));function ee(t,o){const l=Math.max(0,Z.w-52-11),r=Math.max(0,Z.h-24-11);x.value=Math.max(0,Math.min(t??x.value,Math.max(0,ke.value-l))),R.value=Math.max(0,Math.min(o??R.value,Math.max(0,Ve.value-r)))}function Lr(){var t;return typeof window>"u"?!1:!((t=window.matchMedia)!=null&&t.call(window,"(hover: none) and (pointer: coarse)").matches)}function re(t=!1){e.nextTick(()=>{const o=jt.value;if(o){if(!H.value&&!Lr()){document.activeElement===o&&o.blur();return}o.focus({preventScroll:!0}),t&&o.select()}})}function Wr(){re()}let qt=!1,f=null,st=1;function y(){qt||(qt=!0,requestAnimationFrame(()=>{qt=!1,$r()}))}function $r(){var al,il,sl;const t=pe.value;if(!t)return;const o=$e.value;if(!o||(f=t.getContext("2d"),!f))return;st=window.devicePixelRatio||1;const l=o.getBoundingClientRect(),r=l.width,n=l.height;Z.w=r,Z.h=n,t.width=r*st,t.height=n*st,t.style.width=r+"px",t.style.height=n+"px",f.setTransform(st,0,0,st,0,0);const i=x.value,u=R.value,b=52,k=24,T=_o.value,ve=J.value,ge=Q.value,Pe=M.value,te=[];for(let S=0;S<s;S++)te[S]=ge[S+1]-ge[S];const Ue=Math.max(0,fe(i));let nl=Ue;for(let S=Ue;S<m&&!(b+ve[S]-i>=r);S++)nl=S;const mo=nl,Rt=Math.max(0,me(u));let rl=Rt;for(let S=Rt;S<s&&!(k+ge[S]-u>=n);S++)rl=S;const po=rl;f.fillStyle=T.bg,f.fillRect(0,0,r,n),f.fillStyle=T.gridBg,f.fillRect(b,k,r-b,n-k),f.save(),f.beginPath(),f.rect(b+.5,k+.5,r-b-1,n-k-1),f.clip();const ce=E.value,bo=H.value;for(let S=Rt;S<=po;S++)for(let O=Ue;O<=mo;O++){const U=b+ve[O]-i,oe=k+ge[S]-u,xe=Pe[O],ye=te[S];if(U+xe<b||oe+ye<k||U>r||oe>n)continue;p(O,S)&&(f.fillStyle=T.selectionBg,f.fillRect(U,oe,xe,ye)),g.value.col===O&&g.value.row===S&&(f.strokeStyle=T.activeCellBorder,f.lineWidth=2,f.strokeRect(U+1,oe+1,xe-2,ye-2)),f.strokeStyle=T.gridLine,f.lineWidth=.5,f.strokeRect(U+.25,oe+.25,xe-.5,ye-.5);const Mt=(al=v[w(O,S)])==null?void 0:al.style,cl=typeof(Mt==null?void 0:Mt.backgroundColor)=="string"?Mt.backgroundColor:"";if(cl&&(f.fillStyle=cl,f.fillRect(U,oe,xe,ye)),!(bo&&bo.col===O&&bo.row===S)){const q=ze(O,S);if(q){const K=(il=v[w(O,S)])==null?void 0:il.style,dl=z(G(O,S)),Na=typeof(K==null?void 0:K.fontFamily)=="string"&&K.fontFamily?K.fontFamily:vo,Fa=(K==null?void 0:K.fontWeight)==="bold"?"bold":"normal",Ia=(K==null?void 0:K.fontStyle)==="italic"?"italic":"normal",Aa=(K==null?void 0:K.underline)==="underline",Va=(K==null?void 0:K.strikethrough)==="line-through",ho=typeof(K==null?void 0:K.color)=="string"?K.color:"";f.fillStyle=ho||T.cellText,f.font=`${Ia} ${Fa} ${dl}px ${Na}`,f.textBaseline="alphabetic",f.save(),f.beginPath(),f.rect(U+5,oe+1,xe-10,ye-2),f.clip();const Se=f.measureText(q),za=(Se.actualBoundingBoxAscent-Se.actualBoundingBoxDescent)/2,ft=U+5,Vt=oe+ye/2+za;if(f.fillText(q,ft,Vt),Aa){const mt=Se.actualBoundingBoxLeft??0,zt=Se.actualBoundingBoxDescent??0;f.strokeStyle=ho||T.cellText,f.lineWidth=1,f.beginPath(),f.moveTo(ft+mt,Vt+zt+1),f.lineTo(ft+mt+Se.width,Vt+zt+1),f.stroke()}if(Va){const mt=Se.actualBoundingBoxLeft??0,zt=Se.actualBoundingBoxDescent??0,Oa=Se.actualBoundingBoxAscent??dl;f.strokeStyle=ho||T.cellText,f.lineWidth=1;const ul=Vt-(Oa-zt)*.25;f.beginPath(),f.moveTo(ft+mt,ul),f.lineTo(ft+mt+Se.width,ul),f.stroke()}f.restore()}}const de=(sl=v[w(O,S)])==null?void 0:sl.style,Ra=(de==null?void 0:de.borderTopWidth)||0,Ma=(de==null?void 0:de.borderLeftWidth)||0,Nt=(de==null?void 0:de.borderBottomWidth)||0,Ft=(de==null?void 0:de.borderRightWidth)||0,It=Math.max(Ra,Vo(O,S-1,"Bottom")),At=Math.max(Ma,Vo(O-1,S,"Right"));if(It>0||At>0||Nt>0||Ft>0){if(f.strokeStyle=Bo,It>0){f.lineWidth=It,f.beginPath();const q=oe+It/2-.5;f.moveTo(U,q),f.lineTo(U+xe,q),f.stroke()}if(At>0){f.lineWidth=At,f.beginPath();const q=U+At/2-.5;f.moveTo(q,oe),f.lineTo(q,oe+ye),f.stroke()}if(S===po&&Nt>0){f.lineWidth=Nt,f.beginPath();const q=oe+ye-Nt/2+.5;f.moveTo(U,q),f.lineTo(U+xe,q),f.stroke()}if(O===mo&&Ft>0){f.lineWidth=Ft,f.beginPath();const q=U+xe-Ft/2+.5;f.moveTo(q,oe),f.lineTo(q,oe+ye),f.stroke()}}}f.restore(),f.fillStyle=T.headerBg,f.fillRect(b,0,r-b,k);for(let S=Ue;S<=mo;S++){const O=b+ve[S]-i,U=Pe[S];O+U<b||O>r||(ce&&S>=ce.startCol&&S<=ce.endCol&&(f.fillStyle=T.selectionBg,f.fillRect(O,0,U,k)),f.strokeStyle=T.headerBorder,f.lineWidth=.5,f.strokeRect(O+.25,.25,U-.5,k-.5),ce&&S>=ce.startCol&&S<=ce.endCol&&(f.strokeStyle=T.activeCellBorder,f.lineWidth=2,f.beginPath(),f.moveTo(O,k-1),f.lineTo(O+U,k-1),f.stroke()),f.fillStyle=T.headerText,f.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',f.textAlign="center",f.textBaseline="middle",f.fillText(ue(S),O+U/2,k/2))}f.strokeStyle=T.headerSep,f.lineWidth=1,f.beginPath(),f.moveTo(b,k+.5),f.lineTo(r,k+.5),f.stroke(),f.fillStyle=T.headerBg,f.fillRect(0,k,b,n-k);for(let S=Rt;S<=po;S++){const O=k+ge[S]-u,U=te[S];O+U<k||O>n||(ce&&S>=ce.startRow&&S<=ce.endRow&&(f.fillStyle=T.selectionBg,f.fillRect(0,O,b,U)),f.strokeStyle=T.headerBorder,f.lineWidth=.5,f.strokeRect(.25,O+.25,b-.5,U-.5),ce&&S>=ce.startRow&&S<=ce.endRow&&(f.strokeStyle=T.activeCellBorder,f.lineWidth=2,f.beginPath(),f.moveTo(b-1,O),f.lineTo(b-1,O+U),f.stroke()),f.fillStyle=T.headerText,f.font='11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',f.textAlign="center",f.textBaseline="middle",f.fillText(String(S+1),b/2,O+U/2+.5))}f.strokeStyle=T.headerSep,f.lineWidth=1,f.beginPath(),f.moveTo(b+.5,k),f.lineTo(b+.5,n),f.stroke(),f.fillStyle=T.headerBg,f.fillRect(0,0,b,k),f.strokeStyle=T.headerSep,f.lineWidth=1,f.strokeRect(.5,.5,b-.5,k-.5)}const _r=e.computed(()=>ue(g.value.col)+String(g.value.row+1)),Gr=e.computed(()=>H.value?L.value:Y(g.value.col,g.value.row));function Pr(){H.value||(X(g.value.col,g.value.row),L.value=Y(g.value.col,g.value.row),He(),y())}function Ur(t){L.value=t.target.value}function Yr(t){var o,l;t.key==="Enter"?(t.preventDefault(),Re(),Ee(0,1),X(g.value.col,g.value.row),(o=Zt.value)==null||o.blur(),y(),re()):t.key==="Escape"&&(t.preventDefault(),Oe(),(l=Zt.value)==null||l.blur(),y(),re())}function Kr(){setTimeout(()=>{H.value&&(Re(),y())},0)}const _e=e.ref(null),Je=e.ref("");function Xr(t){_e.value===null&&(Fr(t),y())}function Go(t){t!==ne.value&&(je(),Ne(t),y()),_e.value=t,Je.value=_.value[t].name,e.nextTick(()=>{const o=document.querySelector(".tab-rename-input");o==null||o.focus(),o==null||o.select()})}function Po(){_e.value!==null&&(Ar(_e.value,Je.value),e.nextTick(P)),_e.value=null,Je.value=""}function jr(){_e.value=null,Je.value=""}function Zr(t){t.key==="Enter"?(t.preventDefault(),Po()):t.key==="Escape"&&(t.preventDefault(),jr())}const Ce=e.ref(null);let ct=null;function Uo(){ct&&(document.removeEventListener("click",ct),ct=null)}function Qe(t,o,l){Uo();const r=140,n=l.length*28+8,i=window.innerWidth,u=window.innerHeight;t+r>i&&(t-=r),o+n>u&&(o-=n),Ce.value={x:t,y:o,items:l},ct=()=>{Ce.value=null,Uo()},setTimeout(()=>document.addEventListener("click",ct,{once:!0}),0)}const Et=e.ref(!1);function qr(t,o){if(!o.children){Et.value=!1;return}const r=t.currentTarget.querySelector(".context-submenu");if(!r){Et.value=!1;return}const n=r.getBoundingClientRect();Et.value=n.right>window.innerWidth}function Jr(t,o){t.preventDefault(),t.stopPropagation(),Qe(t.clientX,t.clientY,[{label:B(c.value,"insert"),action:()=>{Kt(),y()}},{label:B(c.value,"copy"),action:()=>{Vr(o)}},{label:B(c.value,"rename"),action:()=>{Go(o)}},{label:B(c.value,"delete"),action:()=>{Ir(o),y()},disabled:zr.value<=1},{label:B(c.value,"moveSheetLeft"),action:()=>{Wo(o,-1)},disabled:o===0},{label:B(c.value,"moveSheetRight"),action:()=>{Wo(o,1)},disabled:o===_.value.length-1}])}function Qr(t){t.preventDefault(),!(t.target.closest(".tab-item")||t.target.closest(".tab-bar__add-btn"))&&Qe(t.clientX,t.clientY,[{label:B(c.value,"insert"),action:()=>{Kt(),y()}}])}function ea(t){t.preventDefault(),d(),y(),Qe(t.clientX,t.clientY,[{label:B(c.value,"cut"),action:()=>{Ut(),P()}},{label:B(c.value,"copy"),action:()=>gt()},{label:B(c.value,"paste"),action:()=>{$(),it().then(()=>{y(),e.nextTick(P)})}},{label:B(c.value,"delete"),action:()=>{$(),Yt();for(let o=0;o<m;o++)M.value[o]=100;for(let o=0;o<s;o++)W.value[o]=void 0;y(),P()}}])}function ta(t,o){t.preventDefault();const l=t.clientX,r=t.clientY,n=E.value;n&&n.startCol===0&&n.endCol===m-1&&o>=n.startRow&&o<=n.endRow||(V(0,o,m-1,o),y());const i=E.value;Qe(t.clientX,t.clientY,[{label:B(c.value,"insert"),action:()=>{$(),Rr(i.startRow,i.endRow),y(),P()},disabled:i.endRow>=s-1},{label:B(c.value,"cut"),action:()=>{$(),yt();for(let u=i.startRow;u<=i.endRow;u++)for(let b=0;b<m;b++)I(w(b,u));y(),P()}},{label:B(c.value,"copy"),action:()=>yt()},{label:B(c.value,"paste"),action:()=>{$(),it().then(()=>{y(),e.nextTick(P)})}},{label:B(c.value,"delete"),action:()=>{$(),Hr(i.startRow,i.endRow),y(),P()}},{label:`${B(c.value,"rowHeight")}...`,action:()=>Xo("row",l,r)},{label:B(c.value,"defaultRowHeight"),action:()=>aa()}])}function oa(t,o){t.preventDefault();const l=t.clientX,r=t.clientY,n=E.value;n&&n.startRow===0&&n.endRow===s-1&&o>=n.startCol&&o<=n.endCol||(V(o,0,o,s-1),y());const i=E.value;Qe(t.clientX,t.clientY,[{label:B(c.value,"insert"),action:()=>{$(),Mr(i.startCol,i.endCol),y(),P()},disabled:i.endCol>=m-1},{label:B(c.value,"cut"),action:()=>{$(),yt();for(let u=i.startCol;u<=i.endCol;u++)for(let b=0;b<s;b++)I(w(u,b));y(),P()}},{label:B(c.value,"copy"),action:()=>yt()},{label:B(c.value,"paste"),action:()=>{$(),it().then(()=>{y(),e.nextTick(P)})}},{label:B(c.value,"delete"),action:()=>{$(),Nr(i.startCol,i.endCol),y(),P()}},{label:`${B(c.value,"colWidth")}...`,action:()=>Xo("col",l,r)},{label:B(c.value,"defaultColWidth"),action:()=>ia()}])}function la(t,o,l){t.preventDefault(),p(o,l)||(N(o,l),y());const r=E.value,n=!!(r&&r.startCol===r.endCol&&r.startRow===r.endRow);Qe(t.clientX,t.clientY,[{label:B(c.value,"cut"),action:()=>{Ut(),P()}},{label:B(c.value,"copy"),action:()=>gt()},{label:B(c.value,"paste"),action:()=>{$(),it().then(()=>{y(),e.nextTick(P)})}},{label:B(c.value,"delete"),action:()=>{$(),Yt(),y(),P()}},{label:B(c.value,"calculate"),children:[{label:B(c.value,"sum"),action:Tr,disabled:n}]}])}const Yo=e.ref(null),ae=e.ref(null);let dt=null;function Ko(){dt&&(document.removeEventListener("mousedown",dt),dt=null)}function Xo(t,o,l){Ko();const r=E.value;let n="";if(r){const T=t==="row"?j(r.startRow):M.value[r.startCol];n=T!=null&&T>0?String(Math.round(T)):""}const i=220,u=118;let b=o,k=l;b+i>window.innerWidth&&(b=window.innerWidth-i-8),k+u>window.innerHeight&&(k=window.innerHeight-u-8),b<8&&(b=8),k<8&&(k=8),ae.value={type:t,x:b,y:k,value:n,error:""},dt=()=>{ae.value=null},setTimeout(()=>document.addEventListener("mousedown",dt,{once:!0}),0),e.nextTick(()=>{const T=Yo.value;T&&(T.focus(),T.select())})}function na(t){const o=ae.value;if(!o)return;const l=t.target,r=l.value,n=r.replace(/[^\d]/g,"");o.value=n,r!==n&&(l.value=n),o.error=""}function ra(t){t.key==="Enter"?(t.preventDefault(),jo()):t.key==="Escape"&&Jt()}function jo(){const t=ae.value,o=E.value;if(!t||!o)return;const l=t.value.trim(),r=Number(l),n=t.type==="row",i=n?24:30,u=n?500:1e3;if(l===""||!Number.isFinite(r)){t.error=B(c.value,"dimNumberError");return}if(r<i||r>u){t.error=B(c.value,"dimRangeError").replace("{min}",String(i)).replace("{max}",String(u));return}const b=r;if($(),n)for(let k=o.startRow;k<=o.endRow;k++)W.value[k]=b;else for(let k=o.startCol;k<=o.endCol;k++)M.value[k]=b;y(),P(),Jt()}function Jt(){Ko(),ae.value=null}function aa(){const t=E.value;if(t){$();for(let o=t.startRow;o<=t.endRow;o++)W.value[o]=void 0;y(),P()}}function ia(){const t=E.value;if(t){$();for(let o=t.startCol;o<=t.endCol;o++)M.value[o]=100;y(),P()}}const sa=e.computed(()=>{var te;const t=!H.value,o=H.value??g.value,l=o.col,r=o.row,n=(te=v[w(l,r)])==null?void 0:te.style,i=z(G(l,r)),u=typeof(n==null?void 0:n.fontFamily)=="string"&&n.fontFamily?n.fontFamily:vo,b=(n==null?void 0:n.fontWeight)==="bold"?"bold":"normal",k=(n==null?void 0:n.fontStyle)==="italic"?"italic":"normal",T=(n==null?void 0:n.underline)==="underline"?"underline":(n==null?void 0:n.strikethrough)==="line-through"?"line-through":"none",ve=(n==null?void 0:n.underline)==="underline"&&(n==null?void 0:n.strikethrough)==="line-through"?"underline line-through":T,ge=typeof(n==null?void 0:n.color)=="string"?n.color:void 0,Pe=typeof(n==null?void 0:n.backgroundColor)=="string"?n.backgroundColor:void 0;return{left:`${52+J.value[l]-x.value}px`,top:`${24+Q.value[r]-R.value}px`,width:`${M.value[l]}px`,height:`${j(r)}px`,fontFamily:u,fontSize:`${i}px`,fontWeight:b,fontStyle:k,textDecoration:ve,opacity:t?0:1,pointerEvents:t?"none":"auto",color:t?"transparent":ge,caretColor:t?"transparent":void 0,borderColor:t?"transparent":void 0,background:t?"transparent":Pe,boxShadow:t?"none":void 0}}),ca=e.computed(()=>Math.max(0,Z.w-52-11)),da=e.computed(()=>Math.max(0,Z.h-24-11)),wt=e.computed(()=>Math.max(0,ca.value-11*2)),Bt=e.computed(()=>Math.max(0,da.value-11*2));function Qt(){return Math.max(0,Z.w-52-11)}function eo(){return Math.max(0,Z.h-24-11)}const Ct=e.computed(()=>Ze.value<=0?wt.value:Math.max(24,Qt()/ke.value*wt.value)),to=e.computed(()=>Ze.value<=0?0:x.value/Ze.value*(wt.value-Ct.value)),xt=e.computed(()=>qe.value<=0?Bt.value:Math.max(24,eo()/Ve.value*Bt.value)),oo=e.computed(()=>qe.value<=0?0:R.value/qe.value*(Bt.value-xt.value));let Ge=null,St=0,Dt=0;function ua(t){t.preventDefault(),Ge="v",St=t.clientY,Dt=R.value,document.addEventListener("mousemove",lo),document.addEventListener("mouseup",no)}function fa(t){t.preventDefault(),Ge="h",St=t.clientX,Dt=x.value,document.addEventListener("mousemove",lo),document.addEventListener("mouseup",no)}function lo(t){if(Ge==="v"){const l=(t.clientY-St)/(Bt.value-xt.value);ee(null,Dt+l*qe.value),y()}else if(Ge==="h"){const l=(t.clientX-St)/(wt.value-Ct.value);ee(Dt+l*Ze.value,null),y()}}function no(){Ge=null,document.removeEventListener("mousemove",lo),document.removeEventListener("mouseup",no)}function ma(t){if(Ge)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientY-o.top;l<oo.value?ee(null,R.value-eo()):l>oo.value+xt.value&&ee(null,R.value+eo()),y()}function pa(t){if(Ge)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left;l<to.value?ee(x.value-Qt(),null):l>to.value+Ct.value&&ee(x.value+Qt(),null),y()}let et=!1,be=0,he=0,tt=!1,ot=!1,Zo=0,qo=0,lt=0,Tt=0,ro=0,ao=0,Jo=0,Qo=0,ut=!1,io=!1,nt=0,rt=0,so=0,el=-1,tl=-1;function ba(t){if(t.button!==0)return;t.preventDefault(),Ce.value=null;const o=Ae(t,pe.value);if(o.y<24&&o.x>=52){const n=o.x-52+x.value,i=fe(n);if(i>=0&&Math.abs(o.x-(52+J.value[i+1]-x.value))<=4){$(),tt=!0,Zo=i,lt=M.value[i],Tt=n,y();return}}if(o.x<52&&o.y>=24){const n=o.y-24+R.value,i=me(n);if(i>=0&&Math.abs(o.y-(24+Q.value[i+1]-R.value))<=4){$(),ot=!0,qo=i,lt=j(i),Tt=n,y();return}}if(o.x<52||o.y<24){if(Re(),o.y<24&&o.x>=52){const n=fe(o.x-52+x.value);n>=0&&(V(n,0,n,s-1),et=!0,be=n,he=0)}else if(o.x<52&&o.y>=24){const n=me(o.y-24+R.value);n>=0&&(V(0,n,m-1,n),et=!0,be=0,he=n)}else o.x<52&&o.y<24&&d();y();return}const l=fe(o.x-52+x.value),r=me(o.y-24+R.value);if(!(l<0||r<0)){if(Re(),t.shiftKey&&E.value){const n=E.value;V(n.startCol,n.startRow,l,r)}else N(l,r);et=!0,be=l,he=r,re(),y()}}function ha(t){if(tt){const i=Ae(t,pe.value).x-52+x.value-Tt;lt+i>=30&&(M.value[Zo]=lt+i),y();return}if(ot){const i=Ae(t,pe.value).y-24+R.value-Tt;lt+i>=24&&(W.value[qo]=lt+i),y();return}if(!et){const n=pe.value;if(!n)return;if(Le.value){n.style.cursor="copy";return}const i=Ae(t,n);if(i.y<24&&i.x>=52){const u=fe(i.x-52+x.value);if(u>=0&&Math.abs(i.x-(52+J.value[u+1]-x.value))<=4){n.style.cursor="col-resize";return}}if(i.x<52&&i.y>=24){const u=me(i.y-24+R.value);if(u>=0&&Math.abs(i.y-(24+Q.value[u+1]-R.value))<=4){n.style.cursor="row-resize";return}}n.style.cursor="cell";return}const o=Ae(t,pe.value);if(be<0||he<0)return;if(o.x<52||o.y<24){if(o.y<24&&o.x>=52){const n=fe(o.x-52+x.value);n>=0&&V(Math.min(be,n),0,Math.max(be,n),s-1)}else if(o.x<52&&o.y>=24){const n=me(o.y-24+R.value);n>=0&&V(0,Math.min(he,n),m-1,Math.max(he,n))}y();return}const l=fe(o.x-52+x.value),r=me(o.y-24+R.value);l<0||r<0||(he===0&&be>=0&&E.value&&E.value.startRow===0&&E.value.endRow===s-1?V(Math.min(be,l),0,Math.max(be,l),s-1):be===0&&he>=0&&E.value&&E.value.startCol===0&&E.value.endCol===m-1?V(0,Math.min(he,r),m-1,Math.max(he,r)):V(be,he,l,r),y())}function va(t){const o=tt||ot;et=!1,tt=!1,ot=!1,o&&$o(),Le.value&&or()}function ga(){const t=tt||ot;et=!1,tt=!1,ot=!1,t&&$o()}function ya(t){t.preventDefault();const o=Ae(t,pe.value);if(o.x<52&&o.y<24){ea(t);return}if(o.y<24&&o.x>=52){const l=fe(o.x-52+x.value);l>=0&&oa(t,l);return}if(o.x<52&&o.y>=24){const l=me(o.y-24+R.value);l>=0&&ta(t,l);return}if(o.x>=52&&o.y>=24){const l=fe(o.x-52+x.value),r=me(o.y-24+R.value);l>=0&&r>=0&&la(t,l,r)}}function ka(t){const o=Ae(t,pe.value);if(o.x<52||o.y<24)return;const l=fe(o.x-52+x.value),r=me(o.y-24+R.value);l<0||r<0||(N(l,r),X(l,r),He(),y(),re())}function Ea(t){ee(x.value+t.deltaX,R.value+t.deltaY),y()}function wa(t){if(t.touches.length!==1){ut=!1;return}const o=t.touches[0],l=pe.value;if(!l)return;const r=l.getBoundingClientRect(),n=o.clientX-r.left,i=o.clientY-r.top;n>=52&&i>=24&&(t.preventDefault(),ut=!0,io=!1,ro=n,ao=i,Jo=x.value,Qo=R.value,nt=fe(n-52+x.value),rt=me(i-24+R.value))}function Ba(t){if(!ut||t.touches.length!==1)return;const o=t.touches[0],l=pe.value;if(!l)return;const r=l.getBoundingClientRect(),n=o.clientX-r.left,i=o.clientY-r.top;(Math.abs(n-ro)>8||Math.abs(i-ao)>8)&&(io=!0,t.preventDefault(),ee(Jo+(ro-n),Qo+(ao-i)),y())}function Ca(){if(ut&&(ut=!1,!io&&nt>=0&&rt>=0)){const t=Date.now();nt===el&&rt===tl&&t-so<300?(N(nt,rt),He(),y(),re(),so=0):(Re(),N(nt,rt),y(),so=t),el=nt,tl=rt,re()}}function co(t){return t.isComposing||t.key==="Process"||t.keyCode===229}function ol(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey}function ll(t){if(H.value)return;const o=t.ctrlKey||t.metaKey,l=t.shiftKey;switch(!0){case(o&&(t.key==="c"||t.key==="C")):t.preventDefault(),gt();return;case(o&&(t.key==="x"||t.key==="X")):t.preventDefault(),Ut();return;case(o&&(t.key==="z"||t.key==="Z")):t.preventDefault(),Do();return;case(o&&(t.key==="y"||t.key==="Y")):t.preventDefault(),To();return;case(o&&(t.key==="v"||t.key==="V")):t.preventDefault(),$(),it().then(()=>{y(),e.nextTick(P)});return;case(o&&(t.key==="a"||t.key==="A")):t.preventDefault(),d(),y();return;case(o&&t.key==="Home"):t.preventDefault(),N(0,0),X(0,0),y();return;case(o&&t.key==="End"):t.preventDefault(),N(m-1,s-1),X(m-1,s-1),y();return;case t.key==="Home":t.preventDefault(),N(0,g.value.row),X(0,g.value.row),y();return;case t.key==="End":t.preventDefault(),N(m-1,g.value.row),X(m-1,g.value.row),y();return;case t.key==="ArrowUp":t.preventDefault(),Ee(0,-1),X(g.value.col,g.value.row),y();return;case t.key==="ArrowDown":t.preventDefault(),Ee(0,1),X(g.value.col,g.value.row),y();return;case t.key==="ArrowLeft":t.preventDefault(),Ee(-1,0),X(g.value.col,g.value.row),y();return;case t.key==="ArrowRight":t.preventDefault(),Ee(1,0),X(g.value.col,g.value.row),y();return;case t.key==="Tab":t.preventDefault(),Ee(l?-1:1,0),X(g.value.col,g.value.row),y();return;case t.key==="Enter":t.preventDefault(),Ee(0,l?-1:1),X(g.value.col,g.value.row),y();return;case t.key==="F2":t.preventDefault(),X(g.value.col,g.value.row),He(),y(),re();return;case t.key==="Delete":case t.key==="Backspace":t.preventDefault(),$(),Yt(),y();return;case t.key==="Escape":t.preventDefault(),Oe(),Le.value=null,y();return;case ol(t):if(co(t)){X(g.value.col,g.value.row),He(""),y(),re();return}t.preventDefault(),X(g.value.col,g.value.row),He(t.key),y(),e.nextTick(()=>{const r=jt.value;r&&(r.focus(),r.setSelectionRange(1,1))});return}}let uo=!1,fo=!1;function xa(t){const o=t.target.value;if(!H.value){X(g.value.col,g.value.row),He(o),y();return}L.value=o}function Sa(){uo=!0,H.value||(X(g.value.col,g.value.row),He(""),y())}function Da(t){uo=!1,fo=!0,setTimeout(()=>{fo=!1},0),L.value=t.target.value}function Ta(t){if(!H.value){if(ol(t)||co(t))return;ll(t);return}uo||co(t)||fo&&(t.key==="Enter"||t.key==="Escape")||(t.key==="Enter"?(t.preventDefault(),Re(),Ee(0,1),X(g.value.col,g.value.row),y(),re()):t.key==="Tab"?(t.preventDefault(),Re(),Ee(t.shiftKey?-1:1,0),X(g.value.col,g.value.row),y(),re()):t.key==="Escape"&&(t.preventDefault(),Oe(),y(),re()))}function Ha(){setTimeout(()=>{H.value&&(Re(),y())},0)}function Ht(){var o;const t=(o=$e.value)==null?void 0:o.getBoundingClientRect();if(t){const l=Ie(h.width),r=Ie(h.height);l!=null?Z.w=l:Z.w=t.width,r!=null?Z.h=r:Z.h=t.height}ee(null,null),y()}let se=null;return e.onMounted(()=>{const t=Ie(h.width),o=Ie(h.height);(t==null||o==null)&&(se=new ResizeObserver(()=>Ht()),$e.value&&se.observe($e.value)),e.nextTick(()=>{Ht(),re()}),N(0,0),C.value&&C.value.length>0&&(D=JSON.stringify(C.value),_.value=C.value.map(l=>{const r=kt(l.name);for(const[n,i]of Object.entries(l.cells))r.cells[n]={value:i.value,style:i.style??null};if(l.colWidths)for(const[n,i]of Object.entries(l.colWidths)){const u=Number(n);u>=0&&u<m&&i>=30&&(r.colWidths[u]=i)}if(l.rowHeights)for(const[n,i]of Object.entries(l.rowHeights)){const u=Number(n);u>=0&&u<s&&i>=24&&(r.rowHeights[u]=i)}return r}),_.value.length>0&&Ne(0))}),e.watch(()=>[h.width,h.height],()=>{const t=Ie(h.width),o=Ie(h.height);t!=null&&o!=null?(se==null||se.disconnect(),se=null):!se&&$e.value&&(se=new ResizeObserver(()=>Ht()),se.observe($e.value)),e.nextTick(()=>Ht())}),e.watch(()=>h.theme,()=>y()),e.watch(()=>({...v}),()=>e.nextTick(P),{deep:!1}),e.watch(ne,()=>e.nextTick(P)),e.watch(()=>C.value,t=>{if(!t||t.length===0)return;const o=JSON.stringify(t);o!==D&&(D=o,_.value=t.map(l=>{const r=kt(l.name);for(const[n,i]of Object.entries(l.cells))r.cells[n]={value:i.value,style:i.style??null};if(l.colWidths)for(const[n,i]of Object.entries(l.colWidths)){const u=Number(n);u>=0&&u<m&&i>=30&&(r.colWidths[u]=i)}if(l.rowHeights)for(const[n,i]of Object.entries(l.rowHeights)){const u=Number(n);u>=0&&u<s&&i>=24&&(r.rowHeights[u]=i)}return r}),_.value.length>0&&Ne(0),y())},{deep:!0}),e.onBeforeUnmount(()=>{se==null||se.disconnect()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:"spreadsheet-outer",style:e.normalizeStyle(Or.value)},[e.createVNode(yn,{locale:c.value,"can-undo":Jn.value,"can-redo":Qn.value,"paint-fmt-active":Le.value!==null,"has-selection":er.value,"font-family-options":nr.value,"font-size-options":rr.value,"sel-font-family":ar.value,"sel-font-size":Be.value,"font-size-input":Me.value,"font-size-menu-open":We.value,"sel-font-weight":Ho.value,"sel-font-style":Ro.value,"sel-underline":Mo.value,"sel-strikethrough":No.value,"sel-text-color":Cr.value,"text-color-menu-open":_t.value,"sel-fill-color":xr.value,"fill-color-menu-open":Gt.value,"cached-text-color":ht.value,"cached-fill-color":vt.value,"border-menu-open":Fo.value,"cached-border":Pt.value,onUndo:o[0]||(o[0]=l=>Do()),onRedo:o[1]||(o[1]=l=>To()),onPaintFormat:tr,onClearFormat:o[2]||(o[2]=l=>lr()),onFontFamilyChange:o[3]||(o[3]=l=>ir(l)),onFontSizeInput:o[4]||(o[4]=l=>cr(l)),onFontSizeBlur:dr,onFontSizeKeydown:o[5]||(o[5]=l=>ur(l)),onFontSizeChange:o[6]||(o[6]=l=>sr(l)),"onUpdate:fontSizeMenuOpen":o[7]||(o[7]=l=>We.value=l),onFontSizeToggle:o[8]||(o[8]=l=>fr()),onFontSizeStepUp:mr,onFontSizeStepDown:pr,onBoldToggle:br,onItalicToggle:hr,onUnderlineToggle:vr,onStrikethroughToggle:gr,onTextColorChange:o[9]||(o[9]=l=>kr(l)),"onUpdate:textColorMenuOpen":o[10]||(o[10]=l=>_t.value=l),onFillColorChange:o[11]||(o[11]=l=>Er(l)),"onUpdate:fillColorMenuOpen":o[12]||(o[12]=l=>Gt.value=l),onApplyTextColor:wr,onApplyFillColor:Br,"onUpdate:borderMenuOpen":o[13]||(o[13]=l=>yr(l)),onBorderChange:o[14]||(o[14]=l=>Io(l)),onApplyBorder:Dr},null,8,["locale","can-undo","can-redo","paint-fmt-active","has-selection","font-family-options","font-size-options","sel-font-family","sel-font-size","font-size-input","font-size-menu-open","sel-font-weight","sel-font-style","sel-underline","sel-strikethrough","sel-text-color","text-color-menu-open","sel-fill-color","fill-color-menu-open","cached-text-color","cached-fill-color","border-menu-open","cached-border"]),e.createElementVNode("div",Fn,[e.createElementVNode("div",In,e.toDisplayString(_r.value),1),e.createElementVNode("input",{ref_key:"formulaBarRef",ref:Zt,class:"formula-bar__input",value:Gr.value,onFocus:Pr,onInput:Ur,onKeydown:Yr,onBlur:Kr},null,40,An)]),e.createElementVNode("div",{ref_key:"wrapperRef",ref:$e,class:"spreadsheet-wrapper"},[e.createElementVNode("canvas",{ref_key:"canvasRef",ref:pe,class:"grid-canvas",tabindex:"0",onMousedown:ba,onMousemove:ha,onMouseup:va,onMouseleave:ga,onDblclick:ka,onWheel:e.withModifiers(Ea,["prevent"]),onFocus:Wr,onKeydown:ll,onContextmenu:ya,onTouchstart:e.withModifiers(wa,["prevent"]),onTouchmove:e.withModifiers(Ba,["prevent"]),onTouchend:Ca},null,544),e.createElementVNode("input",{ref_key:"editInputRef",ref:jt,class:"cell-editor",value:L.value,style:e.normalizeStyle(sa.value),onInput:xa,onKeydown:Ta,onCompositionstart:Sa,onCompositionend:Da,onBlur:Ha},null,44,Vn),qe.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"v-scrollbar",style:e.normalizeStyle({top:e.unref(24)+"px",height:`calc(100% - ${e.unref(24)+e.unref(11)}px)`})},[e.createElementVNode("button",{class:"sb-btn sb-btn--up",title:e.unref(B)(c.value,"scrollUp"),onMousedown:o[15]||(o[15]=e.withModifiers(l=>{ee(null,R.value-50),y()},["prevent"]))},[...o[29]||(o[29]=[e.createElementVNode("span",{class:"sb-arrow sb-arrow--up"},null,-1)])],40,zn),e.createElementVNode("div",{class:"sb-track sb-track--v",onMousedown:ma},[e.createElementVNode("div",{class:"sb-thumb sb-thumb--v",style:e.normalizeStyle({top:oo.value+"px",height:xt.value+"px"}),onMousedown:ua},null,36)],32),e.createElementVNode("button",{class:"sb-btn sb-btn--down",title:e.unref(B)(c.value,"scrollDown"),onMousedown:o[16]||(o[16]=e.withModifiers(l=>{ee(null,R.value+50),y()},["prevent"]))},[...o[30]||(o[30]=[e.createElementVNode("span",{class:"sb-arrow sb-arrow--down"},null,-1)])],40,On)],4)):e.createCommentVNode("",!0),Ze.value>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:"h-scrollbar",style:e.normalizeStyle({left:e.unref(52)+"px",width:`calc(100% - ${e.unref(52)+e.unref(11)}px)`})},[e.createElementVNode("button",{class:"sb-btn sb-btn--left",title:e.unref(B)(c.value,"scrollLeft"),onMousedown:o[17]||(o[17]=e.withModifiers(l=>{ee(x.value-50,null),y()},["prevent"]))},[...o[31]||(o[31]=[e.createElementVNode("span",{class:"sb-arrow sb-arrow--left"},null,-1)])],40,Ln),e.createElementVNode("div",{class:"sb-track sb-track--h",onMousedown:pa},[e.createElementVNode("div",{class:"sb-thumb sb-thumb--h",style:e.normalizeStyle({left:to.value+"px",width:Ct.value+"px"}),onMousedown:fa},null,36)],32),e.createElementVNode("button",{class:"sb-btn sb-btn--right",title:e.unref(B)(c.value,"scrollRight"),onMousedown:o[18]||(o[18]=e.withModifiers(l=>{ee(x.value+50,null),y()},["prevent"]))},[...o[32]||(o[32]=[e.createElementVNode("span",{class:"sb-arrow sb-arrow--right"},null,-1)])],40,Wn)],4)):e.createCommentVNode("",!0),Ze.value>0&&qe.value>0?(e.openBlock(),e.createElementBlock("div",$n)):e.createCommentVNode("",!0)],512),e.createVNode(xn,{locale:c.value,sheets:_.value,"active-sheet-index":ne.value,"ren-tab":_e.value,"ren-tab-val":Je.value,onTabClick:o[19]||(o[19]=l=>Xr(l)),onTabDblclick:o[20]||(o[20]=l=>Go(l)),onTabContextmenu:o[21]||(o[21]=l=>Jr(l.ev,l.i)),onTabRenameInput:o[22]||(o[22]=l=>Je.value=l),onTabRenameKeydown:o[23]||(o[23]=l=>Zr(l)),onTabRenameCommit:Po,onTabbarContextmenu:o[24]||(o[24]=l=>Qr(l)),onAddSheet:o[25]||(o[25]=l=>{Kt(),y()})},null,8,["locale","sheets","active-sheet-index","ren-tab","ren-tab-val"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"context-menu",style:e.normalizeStyle({left:Ce.value.x+"px",top:Ce.value.y+"px"}),onClick:o[26]||(o[26]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value.items,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:e.normalizeClass(["context-menu__item",{"context-menu__item--disabled":l.disabled}]),onClick:n=>!l.disabled&&l.action&&(l.action(),Ce.value=null),onMouseenter:n=>qr(n,l)},[e.createElementVNode("span",Gn,e.toDisplayString(l.label),1),l.children?(e.openBlock(),e.createElementBlock("span",Pn)):e.createCommentVNode("",!0),l.children?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["context-submenu",{"context-submenu--left":Et.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:e.normalizeClass(["context-menu__item",{"context-menu__item--disabled":n.disabled}]),onClick:e.withModifiers(u=>!n.disabled&&n.action&&(n.action(),Ce.value=null),["stop"])},e.toDisplayString(n.label),11,Un))),128))],2)):e.createCommentVNode("",!0)],42,_n))),128))],4)):e.createCommentVNode("",!0)]),_:1})])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"menu-pop"},{default:e.withCtx(()=>[ae.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dim-panel",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onMousedown:o[27]||(o[27]=e.withModifiers(()=>{},["stop"])),onClick:o[28]||(o[28]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Yn,e.toDisplayString(ae.value.type==="row"?e.unref(B)(c.value,"rowHeight"):e.unref(B)(c.value,"colWidth")),1),e.createElementVNode("div",Kn,[e.createElementVNode("input",{ref_key:"dimInputRef",ref:Yo,class:e.normalizeClass(["dim-panel__input",{"dim-panel__input--error":ae.value.error}]),type:"number",step:"1",min:"1",inputmode:"numeric",value:ae.value.value,onInput:na,onKeydown:ra},null,42,Xn),o[33]||(o[33]=e.createElementVNode("span",{class:"dim-panel__unit"},"px",-1))]),ae.value.error?(e.openBlock(),e.createElementBlock("div",jn,e.toDisplayString(ae.value.error),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Zn,[e.createElementVNode("button",{class:"dim-panel__btn dim-panel__btn--primary",onClick:jo},e.toDisplayString(e.unref(B)(c.value,"ok")),1),e.createElementVNode("button",{class:"dim-panel__btn",onClick:Jt},e.toDisplayString(e.unref(B)(c.value,"cancel")),1)])],36)):e.createCommentVNode("",!0)]),_:1})]))],4))}}),[["__scopeId","data-v-59bd8e5f"]]);De.Spreader=Co,De.default=Co,Object.defineProperties(De,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaodao-spreader",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A Vue 3 component for spreading sheets",
5
5
  "type": "module",
6
6
  "license": "MIT",